* docs: add cost tracking & budget limits design spec
New feature spec for session-level usage tracking with JSON file
persistence, configurable monthly budget warnings, and Telegram
/usage command for on-demand reporting.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add cost tracking & budget limits implementation plan
8-task TDD plan covering UsageStore, UsageBudget, config schema,
core wiring, formatting helpers, and /usage Telegram command.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(core): implement session cost tracking & budget limits
- Add UsageStore with JSON persistence, calendar-month queries, and retention cleanup
- Add UsageBudget with threshold checking, de-duplication, and injectable date provider
- Add UsageSchema to config (derived UsageConfig type as single source of truth)
- Wire usage event tracking and budget warnings into OpenACPCore
- Add /usage Telegram command with formatUsageReport helper
- Add 25 tests covering store, budget, and formatting
- Update implementation plan per review feedback (#1-6)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review feedback on cost tracking implementation
đ´ Must fix:
- destroy() now calls flushSync() before cleanup to prevent data loss
đĄ Should fix:
- usageStore/usageBudget marked readonly to prevent accidental reassignment
- Replace inline import type with top-level import in formatting.ts
âšī¸ Nits:
- Rename usage-command.test.ts â usage-formatting.test.ts (tests formatUsageReport, not command)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: peter <peter@lab3.asia>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add /clear session topic design spec and implementation plan
- Design spec covers topic recreation approach, confirmation flow, error handling
- Implementation plan with 6 TDD tasks: store update, topic helpers, adapter method, command expansion, tests, verification
- Extends existing /clear (assistant-only) to work in session topics
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: update /archive spec and plan per review feedback
- Rename /clear â /archive (user-friendly, aligns with Gmail/Slack patterns)
- Separate from existing /clear (assistant-only stays untouched)
- Add core archiveSession() + API endpoint (POST /sessions/:id/archive)
- Add assistant guidance when /archive used in wrong topic
- Use patchRecord() instead of new updatePlatformData method
- Fix: setupMenuCallbacks alias, chatId access, missing vi import in tests
- Fix: handleArchiveConfirm tests for success/cancel/error paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: address review feedback on /archive spec and plan
1. Fix API response type: use newThreadId (string) consistently
2. Add try/catch for orphan recovery between topic delete and create
3. Spread existing platform data in patchRecord to preserve skillMsgId
4. Add session.archiving flag to buffer events during transition
5. Rewrite core tests with full mock flow (adapter delegation, error paths)
6. Add explicit escapeHtml import line in session.ts
7. Strip existing đ prefix to prevent emoji stacking on repeated archives
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: implement /archive command for session topics
- Add archiveSession() to OpenACPCore with validation and error handling
- Add archiveSessionTopic() to ChannelAdapter base (no-op default)
- Implement Telegram adapter: topic delete â create â rewire with orphan recovery
- Add /archive command with confirmation flow (ar: callback prefix)
- Add POST /api/sessions/:id/archive endpoint
- Strip đ prefix on repeated archives to prevent emoji stacking
- Spread existing platform data in patchRecord to preserve skillMsgId
- 13 tests covering command, confirm, cancel, error, and core integration
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(test): fix setup-integration timeout by mocking cloudflared download
- Mock ensureCloudflared to avoid real network download during test
- Increase test timeout to 15s for setup wizard flow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address 4 review findings on /archive implementation
1. Add session.archiving flag to Session class, set during topic
recreation, guard sendMessage to drop events during transition
2. Fix skillMsgId cleanup: use delete instead of undefined assignment
3. Add /archive to handleHelp text in menu.ts
4. Guard non-active sessions (finished/cancelled/error) in handleArchive
with early return instead of showing doomed confirmation dialog
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: peter <peter@lab3.asia>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Create detailed discord-setup.md with step-by-step bot creation, permissions, and troubleshooting
- Show quick setup steps and link to guide during Discord onboarding wizard
- Add Discord Setup link in getting-started.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 5fd77a225732
- Added a new speech module to OpenACP, featuring a pluggable architecture for Speech-to-Text (STT) and Text-to-Speech (TTS) functionalities.
- Created interfaces for STT and TTS providers, along with a SpeechService orchestrator to manage provider interactions.
- Integrated Groq Whisper as the default STT provider, allowing for automatic transcription of voice messages.
- Updated configuration schemas to support speech settings and added environment variable overrides.
- Enhanced session processing to utilize the new speech capabilities, ensuring seamless integration with existing message flows.
- Included comprehensive tests for the SpeechService and its providers to ensure reliability and functionality.
- Replace fabricated `openacp runtime` commands with actual `openacp api`
- Update getting-started.md setup wizard to reflect current flow (channel selection, Discord support, run mode step)
- Remove Entire CLI husky hooks (commit-msg, post-commit, pre-push, prepare-commit-msg) that were added without request
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 11997f530f30
Tunnel Registry:
- Multi-port registry: each port gets its own cloudflared process + URL
- Two entry types: system (file viewer, hidden) and user (managed)
- Persistence to ~/.openacp/tunnels.json with debounced writes
- Restore tunnels on restart (re-spawn with new URLs)
- Max concurrent user tunnels (default: 5, configurable)
- Race condition handling for stop during spawn
- Provider-per-entry from TunnelProvider abstraction
Telegram:
- /tunnel <port> [label] â create tunnel
- /tunnels â list with inline Stop buttons
- /tunnel stop <port> â stop tunnel
- Session destroy auto-stops user tunnels with notification
CLI:
- openacp tunnel add/list/stop/stop-all subcommands
- Calls daemon API endpoints
Daemon API:
- POST /api/tunnel â create tunnel
- GET /api/tunnel â list user tunnels
- DELETE /api/tunnel/:port â stop tunnel
- DELETE /api/tunnel â stop all user tunnels
Agent Integration:
- Tunnel skill installed via openacp integrate claude
- ~/.claude/skills/openacp-tunnel/SKILL.md
- Broad trigger: "expose port", "share app", "preview on phone", etc.
- Product guide updated with tunnel CLI docs
Config:
- Added tunnel.maxUserTunnels (default: 5)
4-task plan: media helpers + tests, incoming media handling,
outgoing attachment support, full verification.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: dcddb00f7cd9
Spec for adding file, image, and audio support to Discord adapter,
matching Telegram adapter's v0.5.2 capabilities.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: aa9a2339bc1a
Resolves conflicts in package.json (keep both discord.js and
fastest-levenshtein) and pnpm-lock.yaml (regenerated).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: d7e8e9299f36
16 tasks covering full feature parity with Telegram adapter.
Fixed critical API mismatches found during review:
- sessionManager.listSessions() not getAllSessions()
- agentManager.getAvailableAgents() not getInstalledAgents()
- core.handleNewSession() positional args not object
- configManager.save() nested objects not dot-paths
- Channel-aware platform storage for Discord snowflakes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: f43825efdb0d
5 tasks: unused import, injection escaping, PID race condition,
API authentication, final verification.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Address 9 issues from spec review: explicit file paths for API client,
exempt health/version routes, systemd % escaping, ESRCH vs EPERM
handling in PID polling, token rotation guidance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>
- 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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.