540 Commits

Author SHA1 Message Date
0xmrpeter
18b9d5a58b refactor(discord): migrate DraftManager to use shared primitive
Renamed to DiscordDraftManager for naming consistency. Discord's
MessageDraft has platform-specific features (truncation, message
splitting, stripPattern) that diverge from the shared Draft primitive,
so the class documents this divergence while following the established
naming convention.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:47:57 +07:00
0xmrpeter
8bb7f3eac9 refactor(discord): migrate ToolCallTracker to use shared primitive
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:46:33 +07:00
0xmrpeter
dacc5decb7 refactor(telegram): migrate ToolCallTracker to use shared primitive for state management
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:44:28 +07:00
0xmrpeter
986ec9e7b9 feat(slack): extract SlackRenderer with Block Kit formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:40:24 +07:00
0xmrpeter
f47b6e56b4 feat(discord): extract DiscordRenderer with markdown formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:40:17 +07:00
0xmrpeter
865d453ffd test: add ACP event pipeline integration tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:20:11 +07:00
0xmrpeter
97a44ecb8f refactor(discord): migrate to shared SendQueue primitive
Replace local DiscordSendQueue with the shared SendQueue from
src/adapters/shared/primitives/send-queue.js across all Discord
adapter files, and delete the now-redundant local send-queue.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:16:11 +07:00
0xmrpeter
e4e0f91d80 refactor(telegram): migrate to shared SendQueue primitive
Replace TelegramSendQueue with shared SendQueue from primitives.
Delete local send-queue.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:14:30 +07:00
0xmrpeter
8d45ff7feb refactor(agent): replace as-any casts with typed session update interfaces
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:12:26 +07:00
0xmrpeter
46942d0bc7 refactor(shared): remove deprecated message-dispatcher.ts
Replaced by MessagingAdapter.dispatchMessage() in Phase 1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:10:58 +07:00
0xmrpeter
9ea9eed2fd feat(telegram): extract TelegramRenderer with HTML formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:10:22 +07:00
0xmrpeter
0d76db7d17 feat(fs): add line/limit support to readTextFile for ACP compliance
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:07:41 +07:00
0xmrpeter
1fddc9cdb5 feat(session): store agentCapabilities on Session
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:06:59 +07:00
0xmrpeter
78d0fc2464 test(adapters): wire conformance test suite to all adapters
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:06:12 +07:00
0xmrpeter
abf96bdf47 docs: add remaining fixes plan for Phase 2a
8 tasks: conformance tests, TelegramRenderer, agentCapabilities,
FileService line/limit, remove deprecated dispatcher, reduce as-any
casts, integration tests, final verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:01:35 +07:00
0xmrpeter
4197dfd542 fix(test): mock autocompleteMultiselect to return empty array in setup test
Also fix mock paths for agent-catalog and agent-store to point to the
correct subpath (core/agents/) so the mocks actually intercept dynamic
imports in setup-agents.ts instead of falling through to the real impl.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:53:24 +07:00
0xmrpeter
86509fba41 fix(agent): handle resource content blocks and model updates in sessionUpdate
Add resource and resource_link content type branches in the agent_message_chunk
case to emit resource_content and resource_link AgentEvents. Add explanatory
comment for model_update: the ACP SDK has no model_update session update
notification — model changes only occur synchronously via setModel().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:53:19 +07:00
0xmrpeter
05bcff19cf feat(adapters): add handler stubs and render methods for ACP message types
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:19:19 +07:00
0xmrpeter
63c795984f feat(bridge): wire ACP mode, config, model, resource events to adapters
Add setName() to Session and handle session_info_update, current_mode_update,
config_option_update, model_update, user_message_chunk, resource_content, and
resource_link events in SessionBridge, forwarding them to the adapter via
MessageTransformer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:17:37 +07:00
0xmrpeter
992311379d feat(transformer): transform new ACP event types to OutgoingMessage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:16:31 +07:00
0xmrpeter
d021d380c6 feat(session): add ACP mode, config, and model state management
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:14:38 +07:00
0xmrpeter
eecba2be84 docs: add Phase 2a Part 2 ACP core implementation plan
5 tasks: Session ACP state, MessageTransformer, SessionBridge wiring,
adapter handlers, and export verification. TDD throughout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:11:12 +07:00
0xmrpeter
30ff92caab feat(agent): handle new ACP session/update types and add mode/config/model methods
Add session_info_update, current_mode_update, config_option_update,
user_message_chunk handling in the sessionUpdate switch. Add rawOutput
forwarding on tool_call and tool_update events. Add setMode,
setConfigOption, setModel, listSessions, loadSession, authenticate,
forkSession, closeSession methods. Protocol version negotiation with
mismatch warning. MCP server passthrough support in spawn/resume.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:05:31 +07:00
0xmrpeter
163efe1d15 feat(types): add ACP protocol types for modes, config, model, auth, content blocks
New types: SessionMode, ConfigOption, ModelInfo, AgentCapabilities,
AuthMethod, ContentBlock, McpServerConfig, PromptResponse, etc.
Expanded AgentEvent and OutgoingMessage unions with new ACP event types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:01:17 +07:00
0xmrpeter
119f89bbad refactor: split cli/commands.ts into per-command files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:30:26 +07:00
0xmrpeter
10bfcd12ff refactor: standardize all test files into __tests__/ subdirectories
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:22:59 +07:00
0xmrpeter
98c59c50a4 refactor: move CLI lifecycle files and product-guide
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:20:17 +07:00
0xmrpeter
e1e0918edf refactor: move speech service from core/speech/ to src/speech/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:17:17 +07:00
0xmrpeter
5f8628e91a refactor: move API files into core/api/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:15:33 +07:00
0xmrpeter
4604779936 refactor: move utility files to core/utils/
Move log, typed-emitter, file-service, streams, stderr-capture,
install-binary, and install-jq to src/core/utils/ along with their
tests. Update all import paths across the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:12:00 +07:00
0xmrpeter
d68d963779 refactor: move session files to core/sessions/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:08:31 +07:00
0xmrpeter
bbb2dbcfa8 refactor: move config files to core/config/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 02:03:31 +07:00
0xmrpeter
b1cde6ab70 refactor: move agent files to core/agents/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 01:57:25 +07:00
0xmrpeter
1fbe59beb6 docs: add Phase 2a folder restructure implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 01:52:17 +07:00
0xmrpeter
b675163f5a docs: add Phase 2a design spec — folder restructure + full ACP core
Covers: folder restructure (44 flat core files → grouped subdirs),
full ACP protocol compliance (modes, config, terminal, auth, model,
fork, close, MCP passthrough), and CLI commands split.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 01:44:10 +07:00
0xmrpeter
37f417ba66 fix(slack): use per-session meta map for thread safety in concurrent sendMessage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 01:07:17 +07:00
0xmrpeter
a2d8c1a4d1 fix(adapters): use per-session context maps for thread safety in concurrent sendMessage
Replace shared mutable instance properties (_currentThreadId, _currentThread,
_currentIsAssistant) with per-session Maps keyed by sessionId. This prevents
concurrent sendMessage() calls for different sessions from racing on shared
thread context fields.

- TelegramAdapter: _currentThreadId -> _sessionThreadIds Map + getThreadId()
- DiscordAdapter: _currentThread/_currentIsAssistant -> _sessionContexts Map + getSessionContext()
- Cleanup in finally blocks after super.sendMessage() completes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:58:17 +07:00
0xmrpeter
632cbe595f fix(slack): route messages through MessagingAdapter base flow for noise filtering
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:56:42 +07:00
0xmrpeter
42b9adf720 refactor(discord): migrate DiscordAdapter to extend MessagingAdapter
Replace ChannelAdapter base class with MessagingAdapter, converting
messageHandlers object to overridden handle* methods. Remove dispatchMessage
and evaluateNoise imports (now handled by MessagingAdapter.shouldDisplay()).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:48:13 +07:00
0xmrpeter
aba24abdec refactor(slack): migrate SlackAdapter to extend MessagingAdapter
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:46:53 +07:00
0xmrpeter
452297ce8c refactor(telegram): migrate TelegramAdapter to extend MessagingAdapter
Replace ChannelAdapter base with MessagingAdapter. Convert messageHandlers
to overridden protected handle* methods. All existing behavior preserved.
Noise filtering for tool_call now handled by MessagingAdapter.shouldDisplay().
Updated spawnAssistant to accept IChannelAdapter instead of ChannelAdapter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:39:36 +07:00
0xmrpeter
605e6973a3 feat(shared): add adapter conformance tests and barrel export
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:21:52 +07:00
0xmrpeter
6815781f07 feat(shared): add MessagingAdapter abstract base class with dispatch and verbosity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:19:48 +07:00
0xmrpeter
314d77f934 feat(shared): add StreamAdapter base class for WebSocket/API transports
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:19:14 +07:00
0xmrpeter
5a866da634 feat(shared): add IRenderer interface and BaseRenderer with plain text defaults
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:19:11 +07:00
0xmrpeter
11adf1eb92 feat(shared): add generic DraftManager primitive with callback-based flush
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:16:59 +07:00
0xmrpeter
3254a53650 feat(shared): add ActivityTracker primitive and barrel export for all primitives
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:16:42 +07:00
0xmrpeter
0a29c81793 feat(shared): add generic SendQueue primitive with rate limiting and dedup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:16:26 +07:00
0xmrpeter
745e7a1442 feat(shared): add generic ToolCallTracker primitive
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:16:03 +07:00
0xmrpeter
10d1e96e20 refactor(channel): add name, capabilities, optional methods to IChannelAdapter
Update all core files and tests to use IChannelAdapter interface instead of
ChannelAdapter class. Add name property to all existing adapters. Make
deleteSessionThread, archiveSessionTopic, sendSkillCommands, and
cleanupSkillCommands optional on the interface with optional chaining at
all call sites.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:13:16 +07:00