233 Commits

Author SHA1 Message Date
0xmrpeter
23aa5d0459 docs: add implementation plan for telegram custom path wizard 2026-04-07 15:25:56 +07:00
0xmrpeter
eb07e68aa4 docs: add spec for telegram custom path wizard (no-AI path input) 2026-04-07 15:19:12 +07:00
0xmrpeter
abe0d8ed29 docs: update CLAUDE.md to reflect the addition of a new middleware hook
- Updated the documentation to indicate the total number of middleware hooks has increased from 18 to 19.
- Adjusted references in the getting-started-plugin guide to ensure consistency with the updated middleware hook count.
- Corrected the middleware hooks section in the plugin template to reflect the accurate total.
2026-04-06 15:50:16 +07:00
0xmrpeter
1644f7b888 docs: add persistent assistant session implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 01:11:02 +07:00
0xmrpeter
d9e0a90be7 docs: add persistent assistant session design spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 01:04:17 +07:00
0xmrpeter
12e7af8da2 feat(telegram): add comprehensive UX improvements for Topics setup
- Introduced a new specification for Telegram Topics UX, addressing user confusion when prerequisites are not met.
- Implemented user-friendly terminology changes, replacing "supergroup" with "group with Topics enabled."
- Enhanced installation flow with warnings and actionable instructions if Topics are disabled or the bot lacks necessary permissions.
- Added runtime checks to ensure prerequisites are met before full initialization, with clear messaging for users during setup.
- Updated documentation to reflect these changes and improve clarity for users.
2026-04-05 22:37:35 +07:00
0xmrpeter
2075fc4819 docs(telegram): update terminology and document new prerequisite behavior
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 22:28:14 +07:00
0xmrpeter
faf6286e12 fix(onboard): fix channel setup flow and normalize adapter plugin names
- setup-channels: call plugin.install() for first-time setup, plugin.configure()
  for existing channels (was always calling configure())
- setup-channels: add CHANNEL_PLUGIN_NAME map so discord correctly imports
  @openacp/discord-adapter instead of bare 'discord'
- setup-channels: fix delete action to call clear() instead of updatePluginSettings({})
  which was a no-op
- setup-channels: guard SSE channel with early return to prevent failed import
- setup-channels: fix null guard before accessing plugin.name
- setup-channels: fix disable/delete to use correct plugin name per adapter
- Normalize all discord/slack adapter plugin references to canonical names:
  @openacp/discord-adapter and @openacp/slack-adapter
- status.ts: use explicit pluginName→channelId map instead of string replace
- lifecycle-manager: remove stale legacy aliases for old discord/slack names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 21:32:56 +07:00
0xmrpeter
0aab4e63e8 chore: resolve merge conflicts with develop (config legacy removal)
All conflicts resolved in favor of the merged refactor branch (PR #208):
- config-migrations.ts: keep only add-instance-name migration
- config.ts (assistant section): remove speech legacy fallback
- config-section.test.ts: remove legacy speech tests
- speech-plugin-setup.test.ts: remove legacyConfig test cases
- design spec: keep merged version

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 17:01:47 +07:00
Mr.Peter
179f36442d
refactor: remove legacy config sections and add plugin field declaration API (#208)
* fix(speech): STT not working when plugin settings missing groqApiKey

Fixes two bugs reported in #198 where STT feature does not work despite
being marked as configured.

Bug 1: speech plugin setup() now falls back to reading the API key from
legacy config.json (ctx.config) when groqApiKey is absent from plugin
settings. This handles users who upgraded OpenACP without reinstalling
the speech plugin, so the install() migration was never triggered. A
warn log is emitted to guide permanent migration via
`openacp plugin configure @openacp/speech`.

Bug 2: createConfigSection now uses SpeechService.isSTTAvailable() from
the ServiceRegistry to determine STT status, rather than reading from the
legacy config.json field. This ensures the assistant status snapshot
reflects actual runtime state instead of showing a false positive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: add config legacy removal design spec

Spec for two-phase removal of legacy config sections from ConfigSchema,
env var deduplication, and plugin self-declaring editable fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove legacy sections from ConfigSchema

Remove channels, agents, security, api, tunnel, usage, speech sections.
These now live exclusively in plugin settings files.
BaseChannelSchema, AgentSchema, TunnelSchema, UsageSchema, SpeechSchema
and their exported types are deleted.
DEFAULT_CONFIG simplified to core-only fields.

* fix: update all files referencing removed ConfigSchema fields

Replace config.agents/security/api/tunnel/speech/channels references
with agents.json reads or plugin settings reads. Fixes TypeScript errors
from ConfigSchema cleanup in previous commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove legacy config migrations

Keep only add-instance-name migration (needed for new installs).
Delete plugin-config-migration.ts (unused scaffolding, never integrated).

* refactor: remove plugin-mapped fields from config-registry

Remove: channels.telegram.outputMode, channels.discord.outputMode,
tunnel.enabled, security.maxConcurrentSessions, security.sessionTimeoutMinutes,
speech.stt.provider, speech.stt.apiKey.
Remove plugin? field from ConfigFieldDef — plugins self-declare via
registerEditableFields() in Phase 2.
Remove getFieldValueAsync, slim setFieldValueAsync to 3 params.

* refactor: config-editor reads/writes plugin fields via settings only

Drop config.json fallback in editTelegram, editSecurity, editApi, editTunnel.
These functions now exclusively use SettingsManager for plugin-owned fields.

* test: remove legacy config test cases

Delete: config-env-overrides.test.ts (channel token env overrides),
  config-registry-plugin.test.ts (getFieldValueAsync, plugin-mapped setFieldValueAsync)
Trim: config-migrations.test.ts (keep only add-instance-name),
  config-registry.test.ts (remove tunnel/channels assertions),
  install-context.test.ts and plugin-setup-integration.test.ts
  (remove legacyConfig test cases).

Also trim pre-existing failures from Phase 1 schema changes:
  config-schema.test.ts (remove channels/api/security refs),
  config-workspace.test.ts (remove channels/security/tunnel env override tests),
  api-server.test.ts (update mock config, 429 test, PATCH config test),
  routes-sessions.test.ts (fix 429 via lifecycleManager.settingsManager mock),
  setup-integration.test.ts (remove channels/agents/security assertions),
  helpers.test.ts and setup-channels.test.ts (remove legacy config.channels tests),
  config-section.test.ts (remove legacy speech provider tests),
  multi-instance-plumbing.test.ts (remove migrate-agents-to-store test).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add FieldDef type and registerEditableFields to PluginContext

Plugins can now declare their editable settings fields in setup():
  ctx.registerEditableFields([
    { key: 'botToken', displayName: 'Bot Token', type: 'string', scope: 'sensitive' },
  ])
Fields are stored in PluginFieldRegistry (service: 'field-registry').
Requires 'commands:register' permission.

* refactor: remove legacyConfig from InstallContext

Plugin install() hooks no longer receive legacy config.json data.
Interactive setup is the only install path going forward.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove legacyConfig from telegram, security, speech plugins

Each plugin's install() now has only the interactive setup path.
Added registerEditableFields() calls in each plugin's setup() hook.
Remove speech legacy config fallback (config.speech no longer exists).

Also export FieldDef from @openacp/cli public API and add
registerEditableFields() no-op stub to createTestContext() in plugin-sdk.
Remove speech-plugin-setup test case for legacy config fallback path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove legacyConfig from tunnel, api-server, file-service plugins

Completes legacyConfig removal from all plugins.
Added registerEditableFields() to each plugin's setup() hook.
Added commands:register permission to api-server and file-service plugins
to satisfy registerEditableFields() permission requirement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: export FieldDef from plugin-sdk

Plugin authors can import FieldDef from @openacp/plugin-sdk to type
their registerEditableFields() calls.

* fix: add commands:register to telegram, clean up dead legacyConfig in main.ts, update plugin template

- Add missing commands:register permission to telegram plugin (required by registerEditableFields)
- Remove dead legacyConfig variable from autoRegisterBuiltinPlugins in main.ts
- Remove legacyConfig documentation from plugin template (field removed from InstallContext)

* test: add missing coverage for config legacy removal

- config-registry: exact 5-field count, removed plugin fields absent,
  setFieldValueAsync 3-arg API with return values and validation
- config-schema: removed fields (channels, security, tunnel) are stripped,
  outputMode and agentSwitch core fields work correctly
- plugin-context: registerEditableFields permission guard and registry wiring
- install-context: assert legacyConfig absent from context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: add Discord and Slack env var override tests for applyEnvToPluginSettings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 16:58:27 +07:00
0xmrpeter
007012fef1 docs: add config legacy removal implementation plan
Two-phase plan covering ConfigSchema cleanup, env var deduplication,
config-editor migration, PluginFieldRegistry, and legacyConfig removal
from all 6 affected plugins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 13:11:29 +07:00
0xmrpeter
d6a1321784 docs: fix config legacy removal spec after review
- Correct plugin list: remove discord/slack/usage (don't exist), add file-service
- Add config-editor.ts to Phase 1 impact (was missing, heavy legacy references)
- Note BaseChannelSchema removal alongside channels section
- Clarify usage section: remove from schema, no plugin migration needed
- Fix InstallContext type file reference (types.ts not plugin-context-types.ts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 13:03:37 +07:00
0xmrpeter
4371823763 docs: add config legacy removal design spec
Spec for two-phase removal of legacy config sections from ConfigSchema,
env var deduplication, and plugin self-declaring editable fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 12:59:04 +07:00
0xmrpeter
7b206f8124 chore: merge main into develop
Resolve conflicts in display-spec-builder.ts and formatting.ts:
- Keep JSDoc comments from develop
- Take normalizePathLike + comma-separated path handling from main's formatting.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 10:18:44 +07:00
hightman
6f77aed353
feat(integrate): add OpenCode session handoff integration (#205)
* feat(integrate): add opencode handoff plugin strategy

Add a plugin-based integration path so OpenCode can hand off sessions bidirectionally while preserving the existing hooks flow for other agents. This enables /openacp:handoff in OpenCode and avoids jq requirements for that integration.

Co-authored-by: Codex <noreply@openai.com>

* fix(integrate): address PR review for opencode strategy

Make integration strategy discriminated and exhaustive, harden OpenCode injected text part shape, and improve plugin install/uninstall idempotency and messaging. Add regression tests for reinstall and empty uninstall paths.
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: 0xmrpeter <0xmrpeter@gmail.com>

---------

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: 0xmrpeter <0xmrpeter@gmail.com>
2026-04-05 10:07:19 +07:00
0xmrpeter
4a2e574e2c Merge branch 'main' of github.com:Open-ACP/OpenACP 2026-04-04 09:39:46 +07:00
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
Mr.Peter
6b4867854d
Merge pull request #196 from Open-ACP/develop
chore: merge develop into main
2026-04-03 10:29:30 +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
Mr.Peter
0fed71db58
Merge pull request #191 from Open-ACP/develop
Develop
2026-04-02 11:00:23 +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