214 Commits

Author SHA1 Message Date
0xmrpeter
9ea46457de feat: emit message:queued and message:processing events for cross-adapter input visibility
SSE /events stream now receives input messages from external adapters (Telegram, Discord)
with full metadata and queue lifecycle state so app can display conversation history
and accurate typing indicators.

- Add message:queued EventBus event emitted in core.handleMessage() after enqueue
  (skipped for sse/api sources — app already knows its own messages)
- Add message:processing EventBus event emitted via session-bridge turn_started listener
- Generate turnId at enqueue time so both events share the same ID for client pairing
- Pass pre-generated turnId through queue → createTurnContext() to avoid ID mismatch
- SSEManager subscribes to both new events and filters them by sessionId

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 01:08:26 +07:00
0xmrpeter
69d73c981b docs: add file attachment API spec and implementation plan 2026-04-04 00:09:42 +07:00
0xmrpeter
e3f017e05d docs: add session list history spec and plan 2026-04-03 23:00:16 +07:00
0xmrpeter
7b6c96828d Add multi-adapter session routing implementation plan
14 tasks covering: TurnContext, PromptQueue routing, Session multi-adapter
fields, SessionBridge turn-aware routing, SessionRecord migration,
SessionManager lookup, Core pipeline with attach/detach, AgentSwitch
multi-bridge, SessionFactory resume, API endpoints, SSE routing,
permission resolved broadcast.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:57:13 +07:00
0xmrpeter
1f0297cce5 Add multi-adapter session routing design spec
Sessions become global with per-session multi-bridge architecture.
Any adapter can attach/detach from sessions via explicit action.
Turn-based response routing with sealed TurnContext per event.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:51:04 +07:00
0xmrpeter
0dbaa518cf fix: enhance session configuration handling and legacy support
- Updated the `setConfigOption` method in the `Session` class to optimistically update the current value for select options when legacy agents return empty configOptions.
- Introduced a new method `applySpawnResponse` in the `Session` class to handle both native and legacy configOptions formats.
- Improved error logging in the `setConfigOption` method for better debugging.
- Added tests to ensure correct behavior for legacy fallback scenarios in the `Session` class and `AgentInstance` methods.

This change improves compatibility with legacy agents and enhances the overall robustness of session configuration management.
2026-04-03 19:03:04 +07:00
0xmrpeter
637d326ea8 fix(api): enhance input validation and security measures across routes
- Implement Zod schemas for strict input validation on notify, tunnel, and topic routes.
- Block absolute workspace paths in CreateSession to prevent path injection.
- Validate scope strings and enforce limits on token lifetime and command strings.
- Sanitize output in file-viewer template to prevent XSS attacks.
- Adjust CORS settings and apply rate limiting for unauthenticated requests.
- Cap SSE connections and prompt body size to mitigate DoS risks.
- Restrict public health endpoint information to enhance security.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 13:22:26 +07:00
0xmrpeter
ed3256a283 feat(conversation-history): implement conversation history tracking with middleware and type definitions 2026-04-03 09:54:37 +07:00
0xmrpeter
81d2184f4d docs: add plugins API spec and implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 00:12:35 +07:00
0xmrpeter
3a01a50949 feat: enhance CLI instance commands and add POST /exchange route
- Updated CLI to register `instances` in `noInstanceCommands` map, allowing access without an existing instance root.
- Refactored instance creation to use `generateSlug` instead of `slugify`.
- Added `POST /exchange` route in the API server for exchanging one-time codes for JWTs, ensuring proper authentication bypass handling.
- Improved error handling for port detection in the API server, simplifying retry logic for available ports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 21:46:31 +07:00
0xmrpeter
695dd1c6fe docs: add implementation plan for instances CLI and auth exchange
Covers: instances list/create commands, start --json extension,
POST /auth/exchange endpoint, GET /api/v1/workspace route.
TDD with vitest, step-by-step with exact code and commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 16:40:42 +07:00
0xmrpeter
56e79875fe Merge branch 'develop' of github.com:Open-ACP/OpenACP into develop 2026-04-02 16:25:20 +07:00
0xmrpeter
0c302331cc docs(cli): enhance help documentation with --json flag support
- Added `--json` flag descriptions to various CLI commands in the help text.
- Updated command usage examples to include `--json` for machine-readable output.
- Clarified that commands supporting `--json` will output results in a consistent JSON format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 16:24:54 +07:00
0xmrpeter
9c74a3e9e0 docs: revise instances CLI and auth codes spec
- Clarify instances list vs status --all distinction
- Fix --from flag convention (parent dir, not .openacp subdir)
- Extend start --json output spec to include name/directory/port
- Clarify --json on onboarding: controls output format, not interactivity
- Fix CLI registration files: src/cli.ts + src/cli/commands/index.ts
- Add note on backward compat: keep dir field in start --json output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 16:22:35 +07:00
0xmrpeter
7b768c717d docs: add spec for instances CLI and auth code exchange
Spec for two core additions supporting the Add Workspace app feature:
- `openacp instances list/create` CLI subcommands with --json output
- Auth code exchange endpoints (POST /auth/codes, POST /auth/exchange)
- GET /api/v1/workspace endpoint for workspace identity info

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 16:17:16 +07:00
0xmrpeter
943f8ab26c chore: move spec and plan to docs/superpowers/ 2026-04-02 15:27:55 +07:00
0xmrpeter
7fe7869cad Add implementation plan: menu button & command dispatch fix
8 tasks covering: intercept map, slash command intercept, m: handler
fixes (command + callback types), m:topics refresh, New Session
button flow with ns: prefix callbacks, and manual smoke test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:38:48 +07:00
0xmrpeter
5dfac08605 Fix spec: callback data size limit, ns: dispatch flow
- Workspace paths use numeric cache IDs instead of base64 in callback
  data (Telegram 64-byte limit)
- Clarify that m: handler must call ns: logic directly since grammY
  cannot re-dispatch callbacks
- Add explicit callback case handling for both s:settings and ns:start

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:35:53 +07:00
0xmrpeter
2caeb4f750 Add spec: menu button & command dispatch fix
Addresses broken menu buttons (Settings, Update, Doctor), degraded UX
(Sessions, Agents, Help), and adds button-driven New Session flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:32:12 +07:00
0xmrpeter
add905a40c docs: clean up and simplify gitbook documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:28:37 +07:00
0xmrpeter
e8af143c87 docs: update gitbook for recent specs (03-29 to 04-01)
Add new pages: output modes, workspaces (multi-instance), app connectivity.
Update 16 existing pages to reflect: tunnel auto-start/keepalive, JWT auth
system, SSE streaming, session config options, one-liner install, startup UX,
lazy session resume, new CLI commands (attach, remote), and new chat commands
(/mode, /model, /thought, /dangerous).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:24:26 +07:00
Mr.Peter
04f29de190
Merge pull request #186 from Open-ACP/refactor/cmd-assistant-impl
refactor: unify command dispatch, move assistant to core, extensible menu
2026-04-01 20:40:30 +07:00
0xmrpeter
7d53337f7a docs: add spec and implementation plan for tunnel + auth updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:22:57 +07:00
0xmrpeter
a809524f5a fix: address plan review issues
- Task 9: add full code for each command handler (/new, /cancel, /status, etc.)
- Task 10: fix broken build — remove adapter imports of deleted functions before committing
- Task 7: add connectSessionBridge() method to OpenACPCore
- Task 11: fix placeholder for assistantTopicId in menu callback handler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:47:41 +07:00
0xmrpeter
bf6a4d9de3 plan: add command & assistant architecture refactor implementation plan
13-task plan covering MenuRegistry, AssistantRegistry, AssistantManager,
SessionBridge simplification, command handler migration, and Telegram
adapter cleanup. TDD approach with tests before implementation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:36:55 +07:00
0xmrpeter
26ca0caa08 Add command & assistant architecture refactor spec
Design doc for refactoring the three intertwined systems (command dispatch,
assistant session management, bot/chat flows) into clean, separated concerns
with plugin extensibility for assistant context and menu items.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:25:19 +07:00
0xmrpeter
914fc013d6 refactor: rename 'dangerous mode' to 'bypass permissions' across documentation and code
- Updated all references from 'dangerous mode' to 'bypass permissions' in CLI commands, API documentation, and internal logic.
- Adjusted command usage and descriptions to reflect the new terminology for clarity and consistency.
- Removed warmup functionality from session management as part of the refactor.
2026-04-01 13:28:08 +07:00
0xmrpeter
3b689734da Merge branch 'develop' of github.com:Open-ACP/OpenACP into develop 2026-04-01 10:58:46 +07:00
0xmrpeter
e8aabd58fd chore: update workspace terminology and improve instance handling
Changes include:
- Updated `.gitignore` to include `.openacp` for local workspace secrets.
- Refactored CLI commands to replace "instance" with "workspace" for consistency.
- Enhanced workspace setup and registration logic, including deduplication of entries.
- Improved user prompts and error messages related to workspaces.
- Added functionality to protect local workspace secrets from being tracked by git.

This commit aims to clarify the distinction between workspaces and instances, enhancing user experience and code maintainability.
2026-04-01 10:58:33 +07:00
0xmrpeter
3012a5568d docs: add session config options implementation plan
12-task plan covering types migration, session class, bridge, factory,
commands (/mode, /model, /thought, /dangerous), API routes, CLI, and tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:38:39 +07:00
0xmrpeter
b8efcbca3f docs: add platform UI rendering section to config options spec
Added Section 6 covering Telegram/Discord/Slack button rendering,
command response format, and agent-initiated notification handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:24:24 +07:00
0xmrpeter
227a3e0295 docs: add session config options design spec
Unified ACP config options to replace separate mode/model/dangerous fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:19:19 +07:00
0xmrpeter
544a314f6c docs: fix blocking issues in Phase 1 plan (code review)
- B4: Remove createThread:false override from createFullSession callback
- B5: Add createThread to createFullSession type signature
- B6: Fix createSessionWithContext to pick fields, not spread params
- B2: Use optional chaining for middleware, preserve original semantics
- I2: Note handleNewChat as dead code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:45:25 +07:00
0xmrpeter
0c64218386 docs: add Phase 1 implementation plan for core refactor
5 tasks: group instance files, extract AgentSwitchHandler,
move lazy resume to SessionFactory, move convenience creation
methods, cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:40:24 +07:00
0xmrpeter
2c335c0af9 docs: add instance directory grouping to core refactor spec
Phase 1d: Move 4 loose instance-* files into core/instance/ directory.
All belong to multi-instance management domain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:36:57 +07:00
0xmrpeter
57f1db002a docs: fix 5 issues found in core refactor spec self-review
- Phase 1b: Move lazyResume to SessionFactory (not SessionManager) to avoid circular dep
- Phase 1c: Keep adoptSession in core.ts — it's orchestration, not factory logic
- Phase 2a: Detail event-driven TTS approach — middleware + EventBus listener pattern
- Phase 3b: Security fails closed (deny all) when securityGuard missing, not open
- Phase 3c: Tunnel cleanup via session:afterDestroy middleware, not wireSideEffects

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:33:45 +07:00
0xmrpeter
8beddd18b5 docs: add core module refactor design spec
3-phase incremental refactor plan for src/core/:
- Phase 1: Split core.ts (929→350 lines) — extract AgentSwitchHandler, move lazy resume to SessionManager, move session creation variants to SessionFactory
- Phase 2: Clean session.ts (569→400 lines) — extract TTS/voice into speech plugin middleware
- Phase 3: Decouple plugin services — remove tunnel awareness from MessageTransformer, graceful service degradation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:31:08 +07:00
0xmrpeter
de2eebd35a docs: add startup UX design spec and implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 18:14:29 +07:00
0xmrpeter
abd2cc098a feat: implement agent switch lifecycle events for UI feedback
- Added system messages and structured events for agent switching, including "starting", "succeeded", and "failed" statuses.
- Updated the event bus to handle new `session:agentSwitch` events, allowing UIs to display loading and error states during agent transitions.
- Enhanced error handling during agent startup to provide users with clear guidance on resolving issues.

This change improves user experience by providing real-time feedback during agent switches.
2026-03-31 17:32:27 +07:00
0xmrpeter
0ff03d1459 fix: update archive session behavior and documentation
- Changed the behavior of the `/archive` command to stop the agent session and permanently delete the Telegram topic without recreating it.
- Updated related tests to reflect the new confirmation messages and ensure accurate descriptions of the archiving process.
- Adjusted the interface and implementation of the `archiveSessionTopic` method to return void instead of a new thread ID, aligning with the new functionality.

This change clarifies the archiving process and ensures that users are aware that the deletion is permanent and cannot be undone.
2026-03-31 16:56:31 +07:00
0xmrpeter
8c2da0af50 feat: add openacp restart command, fix bundle chunk crash on upgrade
- Add restart CLI command (stop + start in one step)
- Disable tsup code splitting to prevent ERR_MODULE_NOT_FOUND when
  daemon is running during a global npm upgrade (hash-named chunks
  get replaced, breaking dynamic imports in the old process)
- Update help, docs, and README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 15:52:48 +07:00
0xmrpeter
3380faa4df docs: update plugin commands for consistency and clarity
- Changed 'plugins' to 'plugin' in installation, configuration, enabling, and disabling commands for uniformity.
- Updated Node.js version requirements in install script to reflect the minimum supported version.
2026-03-31 15:40:09 +07:00
0xmrpeter
40f364717f docs: update Discord docs for output mode parity
- discord.md: add missing slash commands to table (outputmode, verbosity,
  dangerous, tts, settings, doctor, etc.); document tool card embeds
  and action row buttons in "How Sessions Work"
- chat-commands.md: fix /outputmode description — correct low mode label
  ("icons only"), add adapter-level reset, document 3-level cascade,
  add note about Discord action row buttons
- configuration-schema.md: expand discord outputMode description to
  mention per-session override cascade and displayVerbosity auto-migration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 15:03:23 +07:00
0xmrpeter
25475fb74a docs(slack): add output mode section, /outputmode setup step, fix /openacp-new typo
- slack.md: add Step 6 sub-section for registering /outputmode slash command
- slack.md: add outputMode field to config table
- slack.md: add Output Mode section (Low/Medium/High, thread rendering, /outputmode usage)
- slack.md: add /outputmode to commands table and examples
- slack-issues.md: fix incorrect /openacp-new command (should be /new)
- slack-issues.md: update outputMode reference, remove deprecated displayVerbosity mention
- slack-issues.md: add /outputmode troubleshooting entry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 15:03:02 +07:00
0xmrpeter
77daa3c8bc Merge remote-tracking branch 'origin/develop' into feat/api-server-redesign 2026-03-31 10:00:59 +07:00
0xmrpeter
6f99baba2a Merge remote-tracking branch 'origin/main' into feat/api-server-redesign 2026-03-31 10:00:21 +07:00
lngdao
55e0611249
docs: add one-liner install script spec and implementation plan (#105) 2026-03-31 09:58:44 +07:00
0xmrpeter
45ef9beda9 docs: add API server redesign specs and implementation plans
4 specs: API Server Core, Auth System, SSE Adapter, App Connectivity
4 plans: detailed TDD implementation plans for each spec
2026-03-31 01:26:23 +07:00
0xmrpeter
71c8b47be0 Add multi-instance implementation plan (13 tasks)
Detailed step-by-step plan covering: InstanceContext type, registry,
config schema changes, CLI flag parsing, startServer refactor, CLI
command refactoring, plugin path refactoring, instance copy logic,
setup wizard changes, status commands, and migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:33:48 +07:00
0xmrpeter
ab89febcae Slim down instance registry to minimal index
Registry only stores id + root path. All details (name, ports,
channels, mode, PID) are read from each instance's own config and
state files. This avoids stale data and keeps the registry simple.

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