201 Commits

Author SHA1 Message Date
Leo Agent
16f366b9b0 feat(api): serve embedded UI dashboard as static files
Add static file serving to ApiServer so the React SPA can be served
from the same HTTP server. Accepts optional uiDir as 5th constructor
parameter with auto-detection fallback for dev and publish layouts.
Includes path traversal guard and SPA fallback to index.html.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 1fe28d47aa9b
2026-03-23 10:49:45 +07:00
Leo Agent
b027d0189b feat(api): add optional token authentication with localhost bypass
Add token-based auth to API server: when api.token is set and host is not
127.0.0.1/localhost, all /api/* routes require Bearer token or ?token query param.
SSE supports query param since EventSource cannot set headers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 22c5ab501afc
2026-03-23 10:47:14 +07:00
Leo Agent
dd92dade05 feat(api): add SSE endpoint for real-time event streaming
Adds GET /api/events that streams EventBus events to dashboard clients
with optional ?sessionId= filter for session-scoped event subscriptions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 3290361e05d2
2026-03-23 10:44:20 +07:00
Leo Agent
7cae46d26e feat(api): add permission resolution endpoint
Add POST /api/sessions/:id/permission to allow dashboard to resolve pending permission requests. Returns 404 for unknown sessions, 400 when no matching pending permission gate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: d80059abc1c2
2026-03-23 10:40:05 +07:00
Leo Agent
168148780d fix(api): cancel session properly and extend list response
- handleCancelSession now calls sessionManager.cancelSession() instead of
  session.abortPrompt() directly, ensuring status transitions to cancelled
- handleListSessions returns extended fields: createdAt, dangerousMode,
  queueDepth, promptRunning, lastActiveAt for dashboard use
- Add getSessionRecord and cancelSession to sessionManager mock
- Update existing list test to use toMatchObject for forward compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 9b2db4989d74
2026-03-23 10:38:17 +07:00
Leo Agent
328b2394d9 feat(core): wire EventBus into SessionBridge, SessionManager, and OpenACPCore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 429f53d2e4d6
2026-03-23 10:35:10 +07:00
Leo Agent
8be80f7054 feat(core): add EventBus for system-wide event broadcasting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: f7a2031e57bd
2026-03-23 10:31:33 +07:00
Leo Agent
8027e06e4b docs: add UI dashboard design specification
Spec for embedded React + Vite dashboard served from OpenACP API server.
Covers architecture, SSE real-time updates, 5 pages (dashboard, sessions,
agents, config, topics), auth, EventBus design, and error handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:06:03 +07:00
0xmrpeter
77704bf671 test: add edge case coverage for formatting, action-detect, config-registry, agent-store, permission-gate, session-store
Add 6 new test files (~120 test cases) covering previously untested
functions and edge cases:
- formatting.ts: escapeHtml, markdownToTelegramHtml, formatToolCall,
  formatToolUpdate, formatPlan, splitMessage (code block boundary handling)
- action-detect.ts: storeAction/getAction/removeAction lifecycle,
  buildActionKeyboard for both action types
- config-registry.ts: getConfigValue nested paths, resolveOptions
  with static and dynamic options
- agent-store.ts: exists, hasAgent, corrupted/invalid JSON handling,
  atomic write persistence
- permission-gate.ts: requestId lifecycle, reject defaults, concurrent
  setPending, resolve-then-reject idempotency, custom timeouts
- session-store.ts: findByAgentSessionId with originalAgentSessionId
  fallback, corrupted file handling, concurrent saves, TTL preservation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 02:03:40 +07:00
0xmrpeter
6dba173fce test: add comprehensive test coverage for untested modules
Add 16 new test files (~290 test cases) covering previously untested
modules: StderrCapture, streams, NotificationManager, SessionManager,
ViewerStore, extractFileInfo, version utils, ToolCallTracker,
DraftManager, Session lifecycle, ConfigManager (workspace/env/hot-reload),
OpenACPCore orchestrator, AgentManager, PromptQueue edge cases,
SkillCommandManager, and MessageTransformer tunnel integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 01:50:48 +07:00
0xmrpeter
519e2055d4 feat(handoff): generic bi-directional handoff for all agents
Replace Claude-only handoff with data-driven integration engine:
- Add AgentIntegrationSpec to define hooks, settings paths, output formats per agent
- Extend AGENT_CAPABILITIES with resume commands for 7 agents (Claude, Cursor, Gemini, Cline, Codex, Kilo, Amp)
- Add integration specs for 4 agents with hooks systems (Claude, Cursor, Gemini, Cline)
- Rewrite integrate.ts as generic engine: generates scripts, merges settings based on spec data
- Support both settings_json (Claude/Gemini/Cline) and hooks_json (Cursor) config formats
- Support both markdown commands (Claude) and skills (Cursor) for handoff triggers
- Auto-integrate handoff on agent install (CLI + Telegram bot)
- Auto-unintegrate on agent uninstall
- Backward compat: Claude keeps CLAUDE_SESSION_ID/CLAUDE_WORKING_DIR variable names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 01:31:24 +07:00
0xmrpeter
a3c5f5c647 feat(cli): add typo suggestions with fuzzy matching across all CLI commands
Add "Did you mean: X?" suggestions when users mistype commands, agent
names, config keys, or flags. Uses fastest-levenshtein with prefix and
substring matching for comprehensive typo detection across 7 integration
points: top-level commands, api subcommands, agents subcommands, agent
name lookups, integrate command, config set keys, and doctor flags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 01:19:06 +07:00
0xmrpeter
2941956fd7 fix(agents): improve ACP flag stripping in agents run command
Handle edge cases: factory-droid's "exec --output-format acp" pair,
qwen-code's --experimental-skills flag. Verified correct stripping
for all 28 agents in the registry.
2026-03-22 22:43:54 +07:00
0xmrpeter
df7404baec fix(agents): include agent base args in agents run command
The agents run command was only passing user args, missing the agent's
own args (e.g., package name for npx). Now includes base args while
stripping ACP-specific flags (--acp, acp) so the interactive CLI works.
2026-03-22 22:42:14 +07:00
0xmrpeter
f00ec6ac99 Merge branch 'develop' 2026-03-22 22:40:31 +07:00
0xmrpeter
95928b869d feat(agents): add comprehensive setup guide, CLI improvements, and post-install instructions
- Add per-agent setup info for 20+ agents (login commands, API keys, env vars)
- Create docs/guide/agents.md with detailed setup instructions for every agent
- Show setup steps automatically after agent installation (CLI + Telegram)
- Add `openacp agents run` command to execute agent CLI for login/config
- Rewrite CLI help with clear sections and examples
- Update assistant system prompt to use AgentCatalog for agent discovery
- Update product guide with agent management, registry info, and troubleshooting
2026-03-22 22:40:13 +07:00
0xmrpeter
66a6cf84c9 feat(docs): update development guide with new CLI commands and architecture details
- Added 'pnpm test:watch' command for watch mode in testing.
- Expanded file structure documentation to include new core and adapter modules.
- Introduced sections on message flow and session state machine for better understanding of architecture.
- Updated CLI commands section with detailed usage for daemon management, configuration, agents, plugins, integrations, diagnostics, and API.
2026-03-22 22:12:30 +07:00
0xmrpeter
ddd237274d chore: bump version to 0.5.0 v0.5.0 2026-03-22 21:55:50 +07:00
Mr.Peter
0dd24b8e5a
Merge pull request #30 from Open-ACP/develop
feat: ACP Registry integration for agent discovery and installation
2026-03-22 21:55:29 +07:00
0xmrpeter
aae01af109 feat(registry): improve agent UX with pagination, descriptions, and deduplication
- Add pagination to /agents in Telegram (6 per page, prev/next buttons)
- Show agent descriptions from ACP Registry in both CLI and Telegram
- Deduplicate agent picker logic (handleNew + startInteractiveNewSession)
- Improve CLI install progress with visual progress bar
- Add supported agents table and ACP Registry attribution to README
- Add social links and keywords to package.json and publish script
2026-03-22 21:53:18 +07:00
0xmrpeter
2300a21dfc fix: remove duplicate handleAgents from menu.ts, cleanup imports
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:53:57 +07:00
0xmrpeter
ccc44194e7 fix(registry): address code review findings
- Fix na: callback to use topic-first pattern (prevent race condition)
- Add zip-slip protection for binary archive extraction
- Remove duplicate escapeHtml, import from formatting.ts
- Consolidate commandExists into single shared function

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:07:04 +07:00
0xmrpeter
34a8ce36f9 feat(registry): integrate ACP Registry for agent discovery and installation
Add AgentCatalog service layer that fetches agents from the official ACP
Registry CDN, supports 3 distribution types (npx, uvx, binary), and
manages installed agents in ~/.openacp/agents.json.

- New core modules: agent-catalog, agent-store, agent-installer, agent-dependencies
- Bundle registry snapshot for offline fallback
- Auto-migrate existing config.agents to new agent store on startup
- CLI: openacp agents list/install/uninstall/refresh/info
- Telegram: /agents browser, /install command, per-session agent picker
- Setup flow rewritten to use registry with multi-select
- 28 agents available from registry (Claude, Gemini, Cursor, Copilot, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:52:05 +07:00
0xmrpeter
a3f9df358f chore: update README with npm version badge 2026-03-22 17:24:02 +07:00
0xmrpeter
9ec6cb59ad chore: bump version to 0.4.11
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:50 +07:00
0xmrpeter
b71a74b50c feat(telegram): add system diagnostics command and enhance README
- Introduced a new 'doctor' command in the CLI for running system diagnostics, including a dry-run option.
- Updated the Telegram adapter to integrate the 'doctor' command into the command structure and menu.
- Enhanced the README with a new section for screenshots showcasing the application interface.
2026-03-22 17:04:50 +07:00
0xmrpeter
c19b9a183d chore: add MIT license and update package metadata
- Introduced a new LICENSE file with the MIT License.
- Updated package.json to specify the license as MIT.
- Modified README.md to reflect the change in license from AGPL-3.0 to MIT.
2026-03-22 17:04:50 +07:00
0xmrpeter
607317b85a feat(telegram): enhance session management and configuration commands
- Updated the CLI configuration command to support setting values directly via arguments.
- Refactored session management to utilize a unified session creation pipeline, improving code organization and maintainability.
- Introduced new API endpoints for editable configuration fields and improved handling of session state changes.
- Enhanced the Telegram adapter to streamline session creation and management, including better integration with the command structure.
- Added tests for new session creation and configuration updates to ensure reliability.
2026-03-22 17:04:50 +07:00
0xmrpeter
eefe48a818 chore: bump version to 0.4.10
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:50 +07:00
0xmrpeter
098be57c6c refactor(telegram): split commands.ts into commands/ directory
Extract the 1400-line monolithic commands.ts into 6 domain-specific files:
- commands/admin.ts — restart, update, dangerous mode
- commands/menu.ts — menu keyboard, help, agents, clear, buildSkillMessages
- commands/integrate.ts — integrate flow + callbacks
- commands/session.ts — cancel, status, topics, cleanup
- commands/new-session.ts — new session creation flow + state
- commands/index.ts — setupCommands, setupAllCallbacks, re-exports

Each file registers its own grammY callback handlers with distinct prefixes.
External API preserved via re-exports from index.ts.
2026-03-22 17:04:50 +07:00
0xmrpeter
61dbd1851b refactor(telegram): add CommandsAssistantContext to types 2026-03-22 17:04:19 +07:00
0xmrpeter
90903a5935 feat(telegram): improve message handling and user interaction
- Updated the Telegram adapter to minimize API calls by refining terminal status checks.
- Enhanced user experience with additional "Cancel" options in command prompts.
- Improved message chunking logic to better handle long messages and prevent HTML tag breaks.
- Introduced a mechanism to track message truncation for more accurate message management.
2026-03-22 17:04:19 +07:00
0xmrpeter
d976e37516 chore: bump version to 0.4.9
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
bd917c20ba feat(telegram): enhance session management with interactive flow and command updates
- Introduced an interactive flow for creating new sessions, allowing users to select agents and workspaces conversationally.
- Updated the assistant system prompt to include product references and improved guidelines for user interactions.
- Added a new command to clear assistant history and improved error handling during session creation.
- Enhanced workspace input handling to support relative paths and ensure user-friendly prompts.
2026-03-22 17:04:19 +07:00
0xmrpeter
38d2490015 feat(new-session): interactive flow with agent and workspace selection 2026-03-22 17:04:19 +07:00
0xmrpeter
316c0887e2 feat(assistant): rewrite system prompt with product context and action playbook 2026-03-22 17:04:19 +07:00
0xmrpeter
de35ea00c3 feat(menu,help): reorganize keyboard layout and rewrite help text by use case 2026-03-22 17:04:19 +07:00
0xmrpeter
7bbbb5301a feat(assistant): add context-aware welcome message builder 2026-03-22 17:04:19 +07:00
0xmrpeter
02bacdbe72 chore: bump version to 0.4.8
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
9b52d981fe feat: enhance Telegram adapter with new cleanup commands and session management improvements
- Added new commands for cleaning up sessions, including a comprehensive cleanup option that excludes notification and assistant topics.
- Updated message formatting for session status display and improved user feedback during cleanup operations.
- Introduced additional parameters for better session management and command handling in the Telegram adapter.
2026-03-22 17:04:19 +07:00
0xmrpeter
5309eb3eec chore: bump version to 0.4.7
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
bd90bae074 feat: enhance session management and integration capabilities
- Updated session handoff terminology in documentation and code for clarity.
- Introduced new commands for managing sessions and integrations in Telegram.
- Improved session transfer functionality between terminal and Telegram.
- Enhanced message formatting to prevent HTML tag breaks during message splitting.
- Added integration management for agents, allowing installation and uninstallation of session transfer features.

This update improves user experience by streamlining session management and enhancing integration options.
2026-03-22 17:04:19 +07:00
0xmrpeter
7f349ac5f2 fix: resolve --version showing 0.0.0-dev when installed globally
Use getCurrentVersion() which walks up directories to find package.json
instead of hardcoded relative path that fails in global installs.

Bump version to 0.4.6.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
593e357a6f feat: implement session handoff and CLI integration for Claude
- Added commands for session handoff between Claude CLI and Telegram, allowing users to transfer sessions seamlessly.
- Introduced `adopt` and `integrate` commands in the CLI for managing agent sessions and integrations.
- Enhanced API server to support session adoption and improved agent capabilities reporting.
- Updated documentation to reflect new features and usage instructions for session handoff.
2026-03-22 17:04:19 +07:00
0xmrpeter
b8d8f7fb56 feat: add session lookup by agentSessionId
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
37aca93981 feat: add agent registry with resume capabilities 2026-03-22 17:04:19 +07:00
0xmrpeter
6d7262186b feat(api): implement HTTP control API and CLI commands for session and topic management
- Added an HTTP API to the OpenACP daemon for managing sessions and topics.
- Introduced `openacp api` CLI commands for creating, canceling, and querying sessions, as well as managing topics.
- Updated the API server to handle new endpoints for session details, health checks, and configuration management.
- Enhanced topic management with cleanup and deletion capabilities.
- Refactored existing CLI commands to align with the new API structure.

This update improves user interaction by allowing session and topic management directly from the command line, enhancing the overall functionality of OpenACP.
2026-03-22 17:04:19 +07:00
0xmrpeter
9db5f2c597 feat: enhance assistant with dynamic prompt and topic management commands
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
7e0b62b021 feat: add TopicManager core module with list, delete, cleanup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00
0xmrpeter
51e4c26231 fix: prevent duplicate skill messages on session resume
Handle Telegram "message is not modified" error gracefully when resuming
sessions, instead of falling through to create a duplicate message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:04:19 +07:00