- Remove global speech.tts.voice, move to per-provider config
- Add edge-tts voice selector with 19 popular voices (10 languages)
- Fix sendVoice duplex error: add baseFetchConfig duplex for Node.js 20+
- Add core.getOrResumeSession() for command handlers to lazy-resume
- Rename /voice to /text_to_speech throughout
Add optional voice field to both the Zod SpeechSchema (config.ts)
and the SpeechServiceConfig interface (types.ts) to support
voice selection for TTS providers.
TTS providers like edge-tts don't require an API key. Updated
isTTSAvailable() to check provider registration instead of apiKey,
and updated synthesize() to remove the apiKey guard. STT methods
remain unchanged and still require apiKey.
- Add `import type { DiscordAdapter }` to all command files
- Replace all `adapter: any` parameters with `adapter: DiscordAdapter`
- Remove unnecessary `(interaction as any).deferred/replied` casts
- Fix menu.ts to use `adapter.respawnAssistant()` instead of non-existent `adapter.assistant.respawn()`
- Change `core` from protected to public readonly in ChannelAdapter base class
Replace unsafe `as never as` and `as any` casts with proper metadata
type interfaces (ToolCallMetadata, ToolUpdateMetadata, PlanMetadata,
UsageMetadata). Make TelegramChannelConfig extend ChannelConfig to
eliminate the constructor cast.
Replace the switch statement in DiscordAdapter.sendMessage() with the
dispatchMessage/MessageHandlers pattern, matching the Telegram adapter.
Extract a getOrCreateTracker helper and define DiscordMessageCtx interface.
Move the inline security checks (allowedUserIds + maxConcurrentSessions)
from OpenACPCore.handleMessage() into a dedicated SecurityGuard class,
improving separation of concerns and testability.
Replace the onSessionUpdate callback property with TypedEmitter's
emit('agent_event', event) pattern. Update autoName in session.ts
to use pause/resume instead of swapping the callback. Update test
mocks to use TypedEmitter instances.
- Speech-to-text: send voice messages, agent receives transcribed text (Groq Whisper)
- Session cost tracking with monthly budget limits and /usage command
- /archive command to recreate session topics with clean slate
- /tunnels scoped to current session in session topics
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Added support for system messages in Discord and Telegram adapters, allowing for better integration of speech functionalities.
- Updated configuration schemas to include speech settings for STT and TTS providers, with environment variable overrides for easier setup.
- Enhanced session processing to transcribe audio attachments when agents lack audio capabilities, improving user experience.
- Introduced comprehensive tests for the new speech features, ensuring reliability and functionality across the system.
* 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>
- /tunnels in session topic now shows only that session's tunnels
- /tunnels in assistant topic shows all tunnels
- README: move tunnel from nav heading to features section with link
* 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>
- Full Discord adapter: forum channels, streaming, permissions, activity tracking, media support
- Discord interactive setup and doctor health check
- Channel selection in CLI config editor and onboarding
- Security: file-based token auth for API server, XML/systemd injection escaping
- Fix: wait for process exit before removing PID file
- Comprehensive documentation for CLI, daemon, API, and Discord setup
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.
- Keep GET /api/tunnel returning { enabled, url, provider } for backward
compat. New list endpoint at GET /api/tunnel/list.
- Re-attach inline keyboard after stop callback so remaining tunnels
keep their Stop buttons.
- Remove unnecessary (config as any) cast for maxUserTunnels.
- Skip system entries in restore() to prevent double-registration.
- Rename stopAll() โ shutdown() (kills everything including system).
Add stopAllUser() for user-facing operations.
- Added text processing to strip leading slashes from unrecognized commands in the Telegram adapter to prevent agent subprocesses from hanging.
- Updated session cancellation messages for clarity, changing "Cancel session command" to "Abort prompt command" and adjusting user feedback for session status.
- Modified session resumption logic to allow resuming cancelled sessions while preventing errors from being resumed.
- Implemented abort functionality in the prompt queue to handle ongoing processes more gracefully.