101 Commits

Author SHA1 Message Date
0xmrpeter
670d9d96f1 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 02:23:04 +07:00
0xmrpeter
d1074c645c 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 01:41:16 +07:00
0xmrpeter
dd1a5b6256 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 01:38:17 +07:00
0xmrpeter
a58eab8f04 feat: add session lookup by agentSessionId
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 00:52:18 +07:00
0xmrpeter
9780a46b4b feat: add agent registry with resume capabilities 2026-03-22 00:51:24 +07:00
0xmrpeter
53cce9670a 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-21 23:05:32 +07:00
0xmrpeter
b0dbd4f1ab feat: enhance assistant with dynamic prompt and topic management commands
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 17:30:43 +07:00
0xmrpeter
d00af73ffa feat: add TopicManager core module with list, delete, cleanup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:25:58 +07:00
0xmrpeter
0a8db9d5ff 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-21 14:32:42 +07:00
0xmrpeter
269e7854ec fix: persist dangerous mode state across server restarts
Toggle dangerous mode now falls back to session store when the session
is not in memory (e.g. after restart), so the setting survives reboots.
Also restores dangerousMode from store during lazy session resume.

Bump version to 0.4.4.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 14:20:04 +07:00
0xmrpeter
e5d2d09f1c refactor: replace skill command buttons with plain text for tap-to-copy
Replace inline keyboard buttons with plain <code> text lines for skill
commands, making them easier to copy on mobile. Remove dynamic bot menu
updates (updateCommandAutocomplete) — only static system commands remain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:43:58 +07:00
0xmrpeter
57ae5c675a refactor: rename /new_chat command to /newchat for easier mobile typing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:19:31 +07:00
0xmrpeter
2b6554cd8b feat: add environment variable to skip update checks
- Introduced the `OPENACP_SKIP_UPDATE_CHECK` environment variable to allow users to bypass update checks during server startup.
- Updated the `startServer` function to set this variable for both daemon and non-daemon child processes.
- Modified the `checkAndPromptUpdate` function to respect the new environment variable, enhancing flexibility in update management.
2026-03-21 12:57:40 +07:00
0xmrpeter
dd07dc2481 feat: add restart and update commands to Telegram adapter
- Introduced `/restart` and `/update` commands for managing the OpenACP application directly from Telegram.
- Implemented logic to check for updates, notify users, and handle application restarts seamlessly.
- Enhanced menu options to include new commands, improving user interaction and accessibility.
- Updated session management to ensure proper handling of permission requests and session states during updates and restarts.
2026-03-21 12:49:01 +07:00
0xmrpeter
4367e43e22 feat(telegram): improve new chat session handling and error management
- Enhanced `handleNewChat` to resolve agent configuration from existing sessions or records before creating a new session.
- Implemented cleanup of orphaned topics if session creation fails, ensuring better resource management.
- Updated session cancellation logic to maintain active status during cancellation, improving session state integrity.
2026-03-21 01:52:23 +07:00
0xmrpeter
835d7cd1f5 feat(telegram): enhance session management with message ID tracking
- Updated `executeNewSession` to return `firstMsgId` alongside `threadId` for improved session link generation.
- Modified `setupActionCallbacks` and `TelegramAdapter` to utilize `firstMsgId` when creating deep links to session topics.
- Added `getMsgId` and `getUsageMsgId` methods in `UsageMessage` and `ActivityTracker` respectively for better access to message IDs.
- Ensured proper handling of message IDs in session cancellation to maintain state integrity.
2026-03-21 01:25:38 +07:00
0xmrpeter
f532a674da feat(telegram): introduce dangerous mode for session management
- Added commands to enable and disable dangerous mode, allowing auto-approval of permission requests within a session.
- Implemented UI updates to reflect the current state of dangerous mode in session topics.
- Enhanced session handling to suppress notifications and commands for the assistant session.
- Updated session management to handle state persistence and fallback mechanisms for session records.
- Adjusted ThinkingIndicator behavior to accommodate new session timeout configurations.
2026-03-21 01:10:23 +07:00
0xmrpeter
7dd7bafcdd refactor(telegram): enhance ThinkingIndicator and ActivityTracker behavior
- Updated ThinkingIndicator to prevent API calls when dismissed and added a refresh timer for ongoing messages.
- Modified ActivityTracker to ensure proper dismissal of the ThinkingIndicator without triggering deleteMessage API calls.
- Improved test cases to reflect new behavior and ensure correct state management during show/dismiss/reset cycles.
- Adjusted spawnAssistant to handle assistant initialization in the background, improving startup responsiveness.
2026-03-21 00:14:01 +07:00
0xmrpeter
30b1417e58 feat(telegram): wire ActivityTracker into adapter — fix plan bug, add ThinkingIndicator and rolling usage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 23:30:13 +07:00
0xmrpeter
340365c423 feat(telegram): implement ActivityTracker coordinator
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 23:27:05 +07:00
0xmrpeter
25286ce3d7 feat(telegram): implement PlanCard with debounce and progress bar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 23:25:04 +07:00
0xmrpeter
33d47e640d feat(telegram): add ThinkingIndicator and UsageMessage classes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 23:22:55 +07:00
0xmrpeter
e67d44c16c feat(telegram): update formatUsage — remove cost, add token progress bar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 23:20:45 +07:00
0xmrpeter
0b0c239b00 feat(telegram): enhance assistant session handling and error notifications
- Added logging for assistant session spawning and readiness in TelegramAdapter.
- Implemented user notifications for failed assistant session starts, including error messages.
- Updated message handling to check for assistant availability before finalizing drafts.
- Improved logging in spawnAssistant function to track session creation and system prompt completion.
2026-03-20 22:37:19 +07:00
0xmrpeter
498c4530f7 feat(session): implement session name persistence and skillMsgId handling
- Added `getSessionRecord` method to `SessionManager` for retrieving session data.
- Introduced `skillMsgId` field in `TelegramPlatformData` to persist message IDs across sessions.
- Updated `TelegramAdapter` to restore and persist `skillMsgId` during command handling and cleanup.
- Enhanced session name persistence to ensure it is retained after bot restarts.
- Included verification steps for manual testing of new functionality.
2026-03-20 21:48:08 +07:00
0xmrpeter
f1b02dc22a feat(telegram): update grammY to v1.41.1 and remove outdated Telegram streaming redesign documents
- Upgraded grammY dependency from v1.30.0 to v1.41.1 in package.json and pnpm-lock.yaml.
- Deleted obsolete Telegram streaming redesign implementation and specification documents as they are no longer relevant.
2026-03-20 20:36:55 +07:00
0xmrpeter
8771a363e1 feat(telegram): wire 429 handler, finalize draft on new prompt, remove streamThrottleMs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 19:58:50 +07:00
0xmrpeter
6e33598063 feat(telegram): rewrite MessageDraft with 5s flush and send queue coalescing
Replace old MessageDraft (sendMessageDraft, ChatType, draftUnsupportedChats,
fallback logic) with a simpler design using only sendMessage + editMessageText.
Flushes buffered text every 5s via TelegramSendQueue with coalescing support.
Update adapter.ts constructor call to match new signature.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 19:53:22 +07:00
0xmrpeter
1383ddf7ab feat(telegram): rewrite TelegramSendQueue with coalescing and 3s interval
Replace simple promise-chain throttler with explicit item array supporting
per-session text coalescing (type/key dedup) and 429 rate-limit drop via
onRateLimited(). Default interval changed from 100ms to 3000ms.

Also add non-null assertions to existing callers for the new T | undefined
return type (callers without coalescing always receive defined values).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 19:47:02 +07:00
0xmrpeter
92491df98e refactor(tests, action-detect): update test cases and regex patterns for English commands
- Updated regex patterns in action-detect.ts to match English command phrases.
- Adjusted inline keyboard text responses to English for consistency in user interaction.
- Ensured that the detection logic accommodates both command patterns and keywords in English.
2026-03-20 18:18:48 +07:00
lngdao
8d9caad666 feat(tunnel): viewer link extraction, md preview, port auto-retry
Viewer links:
- Pass _meta and rawInput from ACP events to extractFileInfo
- Extract file content from _meta.claudeCode.toolResponse.file
  (where Claude Code stores raw file data)
- Carry forward viewerFilePath in tool state for display

File viewer:
- Markdown preview toggle (marked.js) for .md files
- Fix preview scrollbar — wrapper div for full-width scroll

Display:
- Viewer links show file name (e.g. "View index.html" not "View file")
- Extra line break before viewer links for spacing

Tunnel service:
- Auto-retry next port when configured port is in use (up to 10 attempts)
- Log actual port used if different from configured
2026-03-20 17:59:45 +07:00
0xmrpeter
1051a66f32 feat(agent): implement findPackageRoot function to dynamically locate package.json
- Replaced hardcoded path resolution with findPackageRoot to support various directory structures for agent commands.
- Ensures compatibility with both TypeScript compilation and bundling scenarios.
2026-03-20 17:54:43 +07:00
Leo Agent
8ce9c913c5 Merge remote-tracking branch 'upstream/develop' into develop 2026-03-20 17:45:58 +07:00
Leo Agent
834cb4a677 feat(commands): forward incomplete commands to assistant in assistant topic
- /new without full params → assistant asks for missing agent/workspace
- /cancel in assistant topic → assistant confirms which session to cancel
- Only applies to assistant topic, session topics unchanged

Entire-Checkpoint: 1424524a9044
2026-03-20 17:42:05 +07:00
0xmrpeter
41289a83ca Merge branch 'develop' of github.com-peter:Open-ACP/OpenACP into develop 2026-03-20 17:40:34 +07:00
0xmrpeter
54b1e018ed fix: resolve agent command from package's own node_modules for global installs
When installed globally, claude-agent-acp binary lives in @openacp/cli's
own node_modules, not in cwd. Search both locations.
2026-03-20 17:40:01 +07:00
0xmrpeter
36aea72534 feat(telegram): integrate send queue for all non-streaming API calls
Wrap tool_call, tool_update, plan, usage, session_end, error,
notification, sendSkillCommands, and sendPermissionRequest through
TelegramSendQueue. Pass streamThrottleMs and sendQueue to MessageDraft.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:13:29 +07:00
Mr.Peter
0d43630cff
Merge pull request #19 from dylan-112/develop
Feat: Update cli for full handling function
2026-03-20 17:11:39 +07:00
0xmrpeter
9c698dfbfc feat(telegram): rewrite MessageDraft to use sendMessageDraft with fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 17:10:23 +07:00
dylan
6bc887f3fd feat(config-editor): add tunnel configuration UI
Support configuring tunnel provider (cloudflare, ngrok, bore, tailscale),
port, auth, and provider-specific options via openacp config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: ab23c769533a
2026-03-20 17:09:03 +07:00
Mr.Peter
0c3a83b9fe
Merge pull request #20 from Zysd836/develop
fix: improve error logging and message formatting in session creation
2026-03-20 17:04:57 +07:00
0xmrpeter
2f4bc52cc3 feat(telegram): add streamThrottleMs config option
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:02:21 +07:00
0xmrpeter
927c5c8d28 feat(telegram): add TelegramSendQueue for rate limit protection 2026-03-20 17:01:38 +07:00
0xmrpeter
c4da1f0cea Merge branch 'develop' of github.com-peter:Open-ACP/OpenACP into develop 2026-03-20 17:00:42 +07:00
hoangnv
8a99e551fb fix: improve error logging and message formatting in session creation 2026-03-20 17:00:18 +07:00
0xmrpeter
37a08b821f Telegram streaming 2026-03-20 16:58:54 +07:00
Mr.Peter
9a79b1b59a
Merge pull request #17 from rex-qa-bot/develop
feat: assistant action detection with inline confirm buttons
2026-03-20 16:58:14 +07:00
dylan
daa1385206 merge: sync upstream/develop into develop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 16:57:31 +07:00
dylan
84b7890623 fix(api): wire API sessions to Telegram adapter and fix warmup status
- API sessions now create Telegram topics and wire events (like /new command)
- Fix warmup() not setting status to 'active' after completion
- Auto-approve permissions for headless sessions (no adapter fallback)
- Support positional workspace arg: openacp runtime new [agent] [workspace]
- Add auto-update check, bot admin validation, and improved autostart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 7c2ecfa24084
2026-03-20 16:53:05 +07:00
lngdao
1eb74cf899 feat(setup): pre-download cloudflared during onboarding wizard 2026-03-20 16:42:48 +07:00