759 Commits

Author SHA1 Message Date
0xmrpeter
9e14b8b8b7 fix(install): address code review issues in install scripts
- Add accepted-risk comment for NodeSource curl|bash pattern (HTTPS enforced)
- Fix wrapper script to use printf %q to safely handle special chars in repo_dir
- Add validate_args() to reject unsafe chars and path traversal in --git-dir/--version
- Add npm retry logic (3x, 2s delay) to install.ps1 to match install.sh behavior
- Fix nvm detection: replace unreliable command -v nvm with NVM_DIR/nvm.sh checks
- Add git re-check after install_git() with clear error if installation failed
- Fix PowerShell Add-ToPath null-safety for PATH on fresh installs
- Replace echo -e with printf %b to avoid flag misinterpretation in prompt_choice

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 09:53:55 +07:00
lngdao
278a0fdc43 fix(install): update taglines 2026-03-30 01:10:56 +07:00
lngdao
6c34bc6a57 feat(install): add Windows PowerShell installer 2026-03-29 02:16:33 +07:00
lngdao
afe4445c94 docs: add one-liner install commands to Quick Start 2026-03-29 02:16:33 +07:00
lngdao
fe3d3397e5 feat(install): add macOS/Linux one-liner install script 2026-03-29 02:16:33 +07:00
0xmrpeter
c7913ff67b fix: remove phantom @openacp/usage registration and guard readdirSync
- Remove @openacp/usage from builtin plugin lists (plugin was extracted
  but registration entries remained, causing silent failures on first boot)
- Guard fs.readdirSync(nodeModulesDir) with existsSync check to prevent
  crash when community plugins are registered but node_modules/ missing
- Clean up onboard.ts: remove redundant duplicate imports and local constants

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:47:14 +07:00
0xmrpeter
10a7bd8c73 merge: integrate fix/setup-wizard-plugin-init into develop
Combines setup wizard fixes (settingsManager/pluginRegistry passing,
ESM plugin resolution, path centralization) with develop's shell
injection validation and community adapter flow. Adds error handling
and tests for importFromDir.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:42:42 +07:00
0xmrpeter
e190ff64a2 fix: add error handling and tests for importFromDir
Wrap package.json parsing with descriptive error messages and validate
entry point exists before importing. Add 7 unit tests covering all
resolution paths and error cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:40:09 +07:00
0xmrpeter
a56120d114 chore: bump version to 2026.328.2 v2026.328.2 2026-03-28 07:48:55 +07:00
0xmrpeter
428e343ea8 Merge branch 'develop' 2026-03-28 07:44:40 +07:00
0xmrpeter
cafd8947f4 chore: bump version to 2026.328.1 v2026.328.1 2026-03-28 07:44:10 +07:00
0xmrpeter
ca20290c63 Merge branch 'fix/codebase-logic-review' into develop 2026-03-28 07:43:59 +07:00
0xmrpeter
08bbc6b134 revert: remove usage plugin (extracted to external package) 2026-03-28 01:39:24 +07:00
0xmrpeter
c60a320c18 fix: address code review feedback
- Remove redundant threadId assignment in lazy resume (already set via createSession param)
- Wrap patchRecord in archive with try-catch (topic already recreated, store update is best-effort)
- Add edge case comment in stripPattern for slow TTS synthesis
2026-03-28 01:38:08 +07:00
0xmrpeter
8987822032 docs: update review findings with fix status 2026-03-28 01:28:52 +07:00
0xmrpeter
0bc34ca93e feat: usage tracking plugin and tunnel command improvements
Usage plugin (F18):
- Create src/plugins/usage/ with UsageStore, UsageBudget
- Listen to usage:recorded events, buffer with debounced flush
- Budget checking with warning/exceeded notifications (dedup)
- /usage command showing monthly spending summary
- 26 tests for store and budget logic
- Registered in core-plugins

Tunnel commands (F24):
- /tunnel <port> [label] creates user tunnels
- /tunnel stop <port> stops user tunnels
- /tunnels lists all active tunnels with details

Resume (F7):
- Added TODO for over-budget interactive selection
2026-03-28 01:28:00 +07:00
0xmrpeter
18c590d719 fix: archive topic recreation and tts_strip event
Archive rewrite (F3+F4):
- Archive now keeps agent alive and recreates topic instead of killing session
- Flow: delete old topic → create new topic → rewire session.threadId
- Session stays in memory and store with updated topicId
- Validates session state (must be active, not initializing)
- Rejects non-session topics with guidance message
- Tests updated to verify new behavior

TTS strip (F10):
- Add tts_strip AgentEvent type
- Emit tts_strip after successful TTS synthesis
- SessionBridge dispatches to adapter.stripTTSBlock()
- Telegram DraftManager retains finalized drafts for post-finalize strip
- [TTS]...[/TTS] block removed from visible message after audio sent
2026-03-28 01:20:58 +07:00
0xmrpeter
270ab52ba2 fix: TTS voiceMode, ThinkingIndicator cleanup, settings validation
TTS fixes (F11+F12):
- /tts command now sets session voiceMode via kernel:access
- /tts on/off/next all work across adapters (not just Telegram)
- ttsProvider read from plugin config instead of hardcoded edge-tts

ThinkingIndicator fixes (F13+C17):
- dismiss() now deletes the Telegram message instead of just clearing state
- show() deletes just-sent message if dismissed during SendQueue wait

Plugin system (F22):
- Settings validation against settingsSchema enforced at boot
- Invalid settings prevent plugin from booting (marked as failed)
2026-03-28 01:16:01 +07:00
0xmrpeter
9038102d46 fix: critical code fixes from codebase logic review
Session state machine:
- Guard processPrompt for finished state (prevents double-throw crash)
- Add cancelled to valid transitions from error state
- Wrap abortPrompt in try-catch in cancelSession (agent may be dead)
- Set session.threadId before createSession in lazy resume
- Skip cancelled sessions in lazy resume (spawn fresh instead)
- Backup corrupt sessions.json as .bak before starting empty

Error handling & stability:
- Validate config before writing to disk (prevents bricking on restart)
- Close session logger file descriptors on destroy
- Clean up spinner/logger on plugin boot failure
- Catch sendMessage middleware errors (prevent unhandled rejections)
- Unref permission gate timeout timer (unblock graceful shutdown)

Adapter primitives:
- Remove thinking indicator on maxThinkingDuration exceeded
- Remove draft from map after finalize in shared DraftManager
- ToolCardState appendUsage uses scheduleFlush instead of immediate flush
- Node stream adapters: add close/cancel/abort handlers

CLI/API field fixes:
- Fix CLI api session field access (.session wrapper + correct field names)
- Fix CLI api health field access (uptime in ms, memory.rss, tunnel object)
- Use AgentCatalog.resolve() in API sessions route instead of config.agents

TTS:
- Move voiceMode "next" reset after successful prompt (preserve on error)
2026-03-28 01:10:21 +07:00
0xmrpeter
1a2c267fa2 Merge branch 'develop' of github.com:Open-ACP/OpenACP into develop 2026-03-27 23:53:44 +07:00
0xmrpeter
8df3e764c6 refactor: enhance session management and message formatting in Telegram plugin
- Updated session management to persist session state without terminating agent subprocesses.
- Renamed `destroyAll` to `shutdownAll` for clarity in session handling.
- Improved message formatting in the Telegram plugin to split tool card text into manageable chunks.
- Adjusted usage reporting to send as a separate message rather than appending to tool cards.
- Updated tests to reflect changes in usage handling and message formatting.
2026-03-27 23:52:43 +07:00
0xmrpeter
291d8c8899 fix: enhance session management and error handling across components
- Implemented logic to ensure sessions are properly removed from memory upon cancellation.
- Updated session lifecycle to auto-activate from cancelled or error states when processing prompts.
- Improved error handling in `SessionBridge` for message sending and agent event processing.
- Added cleanup functionality in `FileService` to remove old session files on startup.
- Enhanced `ConfigManager` to return a clone of the configuration object, preventing unintended mutations.
- Refined command unregistration to ensure both short and qualified names are removed.
- Introduced tests for new functionalities and improved existing test coverage.
2026-03-27 23:09:50 +07:00
Mr.Peter
988caae265
Merge pull request #100 from Open-ACP/fix/codebase-logic-review
Fix/codebase logic review
2026-03-27 22:44:24 +07:00
0xmrpeter
7f00232681 refactor: improve command unregistration and enhance error handling in agent events
- Updated `unregister` method to simplify command removal logic.
- Enhanced error handling in `AgentInstance` for event processing and subprocess termination.
- Added sorting of middleware handlers upon registration in `MiddlewareChain`.
- Improved `PermissionGate` to reject previous pending requests when a new one is set.
- Enhanced `NotificationManager` to handle notification failures gracefully without crashing the caller.
2026-03-27 22:39:54 +07:00
0xmrpeter
c49d7ec397 chore: bump version to 2026.0327.6 v2026.0327.6 2026-03-27 21:32:08 +07:00
Mr.Peter
cf67b9cfa4
Merge pull request #98 from Open-ACP/redesign/microkernel-plugin-architecture
feat: microkernel plugin architecture redesign
2026-03-27 21:30:38 +07:00
0xmrpeter
3c753fcad8 fix: persist plugin registry in wizard and use static metadata for plugin discovery
- Save community plugin registrations after setup wizard loop
- Replace dynamic import-based plugin name matching with static
  openacp.pluginName field lookup in package.json (no code execution)
2026-03-27 21:29:47 +07:00
Mr.Peter
a42ea1f069
Merge pull request #97 from EthanMiller0x/feat/extract-slack-plugin
feat: extract Slack adapter to standalone plugin
2026-03-27 21:26:23 +07:00
0xmrpeter
c3691909b8 refactor(speech): remove Edge TTS integration and related tests; update TTS provider handling
- Removed the Edge TTS provider implementation and its associated tests.
- Updated the SpeechService to support dynamic registration and unregistration of TTS providers.
- Enhanced the speech plugin to install the Edge TTS plugin dynamically if not already available.
- Adjusted configuration to exclude specific test directories and removed unnecessary dependencies from package.json.
2026-03-27 21:24:39 +07:00
EthanMiller0x
a048dd637d fix: register failed community plugins as disabled instead of enabled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 20:53:16 +07:00
EthanMiller0x
e560f3a5c8 chore: remove plan file from PR (working artifact with local paths)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:55:50 +07:00
EthanMiller0x
6698661812 fix: address code review feedback (security, consistency, cleanup)
- Replace execSync with execFileSync to prevent command injection
- Filter plugin scan by keywords/scope before importing to avoid executing arbitrary code
- Fix basePath inconsistency in setup-channels.ts (use plugins/data)
- Remove dangling Slack references from admin menu and ADAPTER_SCOPES
- Log warning instead of silently swallowing errors in configureViaPlugin
- Remove duplicate imports in onboard.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:55:16 +07:00
EthanMiller0x
68ca2e4c78 fix: community plugin loading, settings path, and onboard init
- Load community plugins from registry on startup (main.ts)
- Fix path resolution for local and npm plugins (absolute paths, ESM entry point)
- Scan node_modules when plugin name differs from npm package name
- Align settings basePath to ~/.openacp/plugins/data/ across all CLI commands
- Initialize plugin system in onboard command
- Add debug logging for settings resolution in lifecycle-manager

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:14:56 +07:00
EthanMiller0x
8c85d5b2d1 feat: load community plugins from registry on startup
Community plugins installed via `plugin add` are now dynamically loaded
and booted after built-in plugins. Supports both npm and local sources,
with per-plugin error handling so a failing community plugin won't crash
the server.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:14:56 +07:00
EthanMiller0x
af94b052e2 fix(config): remove strict Slack schema to allow old configs with channels.slack
Old configs with `channels.slack` crashed on startup because the
SlackChannelConfigSchema used `z.literal("slack")` for the adapter field.
Since Slack was extracted as a plugin, remove the dedicated schema and let
`channels.slack` fall through to BaseChannelSchema (which uses passthrough),
ensuring backward compatibility with existing user configs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:14:56 +07:00
EthanMiller0x
8be211036c feat(wizard): discover community adapter plugins from registry
The setup wizard now fetches verified adapter plugins from the plugin
registry and shows them alongside built-in Telegram/Discord options.
When a community adapter is selected, it auto-installs from npm and
runs the plugin's install() hook. Gracefully falls back to built-in
options only when the registry is unreachable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:14:56 +07:00
EthanMiller0x
dc4bafbfc3 feat: remove Slack built-in plugin (extracted to @openacp/adapter-slack)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 19:14:09 +07:00
EthanMiller0x
ee83873836 docs: add clear repo indicators to each task in implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:13:56 +07:00
EthanMiller0x
0057277493 docs: add implementation plan for extracting Slack plugin
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:13:56 +07:00
0xmrpeter
a9e3e8d516 fix(sdk): remove duplicate type exports causing build failure v2026.0327.5 2026-03-27 18:44:02 +07:00
0xmrpeter
ba096e4102 chore: bump version to 2026.0327.4 v2026.0327.4 2026-03-27 18:34:45 +07:00
Rex DEV
ce15c30d2b
fix(formatting): always show plan regardless of verbosity (#81)
* fix(formatting): wire rawInput + display* fields through both adapters

- Add rawInput, displaySummary, displayTitle, displayKind to Discord
  adapter tool call/update meta construction (were missing after reset)
- Add displaySummary, displayTitle, displayKind to Telegram adapter
  (rawInput was already present)
- Update existing tests to pass "high" for full-detail assertions
  (default changed to "medium" which returns compact output)

Entire-Checkpoint: e0737b6c7432

* fix(formatting): preserve display* on tool edit, cleanup duplication

- Store displaySummary/displayTitle/displayKind in ToolCallState
  so they survive from tool_call to tool_call_update edit
- Merge with ?? fallback: update fields take precedence over stored
- Telegram formatToolUpdate delegates to formatToolCall (like Discord)
- Remove unused STATUS_ICONS/KIND_ICONS imports from platform formatters

Entire-Checkpoint: 5afc4b23e3ed

* fix(formatting): always show plan regardless of verbosity level

Plan messages were hidden when displayVerbosity was set to "low".
Removed "plan" from HIDDEN_ON_LOW set and added low verbosity
handling in Discord/Telegram formatPlan to show summary count.

Entire-Checkpoint: 25f61b05a8f3

* fix(telegram): handle low verbosity in PlanCard formatPlanCard

PlanCard uses its own formatPlanCard() instead of the shared
formatPlan() from formatting.ts. The low verbosity case was
missing, causing it to fall through to high detail mode.

Entire-Checkpoint: ad8701fddbdc

* fix(formatting): plan always shows full entries regardless of verbosity

Remove verbosity branching from formatPlan — plan always renders
the full entry list with status icons. Previously low/medium showed
only a summary count. Also fix Telegram PlanCard formatPlanCard
which had the same issue.

Entire-Checkpoint: ec946aa88fa1

* docs: add consolidated tool card design spec

Entire-Checkpoint: 41ede6b49d70

* docs: update tool card spec with review decisions (v2)

Entire-Checkpoint: c49386e3cfc2

* docs: update tool card verbosity tiers — full list on all levels (v3)

Entire-Checkpoint: 075290d470e5

* docs: viewer links shown on all verbosity levels (v4)

Entire-Checkpoint: cbc26f5db2c4

* docs: add grep to noise filter rules

Entire-Checkpoint: 2b8dbb47e518

* docs: add consolidated tool card implementation plan

Entire-Checkpoint: 2baf2ed990bc

* feat(formatting): add grep to noise filter, change glob to hide

Entire-Checkpoint: 5d880ff51b85

* feat: add ToolCardState for consolidated tool card

Entire-Checkpoint: 31469436e6e5

* feat(discord): add renderToolCard formatter

Entire-Checkpoint: 1c21fec9dc31

* feat(telegram): add renderToolCard formatter

Add renderToolCard() to Telegram formatting that renders tool card snapshots
as HTML (bold headers, escaped labels, anchor viewer links, plan section,
usage footer). Add corresponding tests covering all output behaviors.

Entire-Checkpoint: 643c26444277

* feat(discord): wire ToolCard into ActivityTracker

Entire-Checkpoint: 018413b14f8d

* feat(telegram): wire ToolCard into ActivityTracker

Entire-Checkpoint: 22d59ca7c6f5

* refactor: delete deprecated platform ToolCallTrackers

Entire-Checkpoint: c5c4b3ac6239

* docs: update message format reference for consolidated tool card

Entire-Checkpoint: f211f739e728

* fix(tool-card): guard empty render, fix falsy usage check, make destroy terminal

- Skip send/edit when renderToolCard returns empty string (prevents API
  errors for sessions that end with no tool calls)
- Fix tokensUsed check from falsy to != null in both Discord and Telegram
  renderToolCard so tokensUsed=0 is not silently hidden
- Set finalized=true in ToolCardState.destroy() to make it terminal and
  prevent post-destroy mutations

Entire-Checkpoint: de056e6643c9

* fix(tool-card): put viewer links on new line for better readability

Entire-Checkpoint: 4ce2b139ecbd

* fix(tool-card): always show usage stats, use formatUsage with verbosity

- sendUsage() no longer skips when no tool content — standalone usage
  message is sent for text-only responses
- renderToolCard uses formatUsage() so progress bar and cost appear
  according to verbosity (high verbosity shows progress bar + %)
- Separator line only rendered when there are tool entries above it
- Update test to assert standalone usage message behavior

Entire-Checkpoint: b55f5bc768c0

* fix(telegram): edit thinking message instead of sending new ones

Entire-Checkpoint: 4f47ffddcdb4

* fix(formatting): recognize Terminal tool name, show command in summary

Entire-Checkpoint: 1c66813043ae

* fix(formatting): show play icon for Terminal tool with no command

Entire-Checkpoint: 46c93d01eee8

---------

Co-authored-by: Leo Agent <bigbearman078@mgail.com>
2026-03-27 18:30:31 +07:00
dylan-112
cf184c78d5
fix: setup wizard fails with 'Plugin system not initialized' (#92)
* fix(api): respect channel param in POST /api/sessions (#76)

Session creation always used the first registered adapter. Add optional
`channel` field so callers can target a specific platform (e.g. discord).
Falls back to first-adapter behavior when omitted for backward compat.

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

* fix(api): wire --channel flag in CLI and assistant prompts (#76)

The API endpoint accepted `channel` but the CLI `openacp api new` didn't
pass it through. Add --channel flag to CLI and update Discord/Telegram
assistant prompts to include --channel so sessions are created on the
correct platform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 27c1f141d0c1

* docs: add session cleanup feature design spec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 8de760ac911e

* docs: address spec review feedback for session cleanup

- Reference existing TopicManager and archiveSession() instead of reimplementing
- Add parseDuration utility for --older-than flag
- Fix API route collision (/api/cleanup/ instead of /api/sessions/cleanable)
- Add CleanupFlowState for Telegram selection state with TTL
- Clarify default filter excludes active/initializing
- Add archiving flag edge case to test plan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 98610f1a27c8

* docs: add design spec for extracting Discord plugin to standalone package

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 10f437186acf

* docs: address spec review feedback for Discord plugin extraction

- Fix npm scope to @openacp (not @open-acp) for consistency
- Fix peerDependency version to match date-based versioning
- Move misclassified exports to "Need to add" section
- Add ConfigManager, AgentCatalog, requestRestart to SDK exports list
- Add essential: false, pluginDependencies notes
- Add tsconfig.json template
- Add exports field and .npmignore to package.json
- Add runAdapterConformanceTests to SDK testing exports
- Add legacy migration map update for backward compat
- Add boot order note for pluginDependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: c5db89eae6aa

* docs: add implementation plan for extracting Discord plugin

9 tasks: extend CLI exports, extend SDK, migration map, scaffold
project, copy+refactor source, verify build, remove from OpenACP,
update README, push repos.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: a54a5510736a

* feat(core): export format-utils, message-formatter, CommandRegistry, Doctor, PRODUCT_GUIDE for plugin SDK

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 27b04551e9a7

* feat(plugin-sdk): export all symbols needed by adapter plugins

Entire-Checkpoint: a1ed33612eb6

* fix(plugin): add @openacp/plugin-discord migration alias for backward compat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: a9db7beb2975

* fix(sdk): add missing adapter-primitive exports and testing entry point

- Add MessagingAdapterConfig, IRenderer, RenderedMessage type exports to src/core/index.ts
- Add DisplayVerbosity, ToolCallMeta, ToolUpdateMeta, ViewerLinks type exports
- Add STATUS_ICONS, KIND_ICONS, progressBar, formatTokens, truncateContent, stripCodeFences, splitMessage exports
- Add extractContentText, formatToolSummary, formatToolTitle, resolveToolIcon exports
- Create src/testing.ts as a separate entry point exporting runAdapterConformanceTests
- Add ./testing export map to @openacp/cli package.json
- Fix @openacp/plugin-sdk/testing.ts to import from @openacp/cli/testing
- Fix version strings to use valid semver (2026.326.4 not 2026.0326.4)

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

* fix: restore original version format YYYY.MMDD.patch

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

* feat: remove built-in Discord plugin (now available as @openacp/plugin-discord)

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

* fix(plugin): resolve 3 bugs preventing dev plugins from loading

- lifecycle-manager: include already-loaded plugins in dependency resolution
  so late-booted dev plugins aren't cascade-skipped
- dev-loader: use URL query string for ESM cache busting instead of copying
  to temp dir, which broke relative imports (e.g., './adapter.js')
- adapter-primitives: remove runAdapterConformanceTests from main barrel
  to prevent vitest from leaking into runtime bundle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 64f604573bb7

* fix(review): address PR #80 code review feedback

- Remove core→plugin-discord import in config-editor (architecture violation):
  inline Discord token validation using REST API /users/@me instead of
  importing from @openacp/plugin-discord/validators
- Mark legacyMap in lifecycle-manager as @deprecated with migration notes
- Remove 98 planning artifacts from docs/superpowers/ (72k+ lines)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: cdeeaa98a4f1

* Revert "fix(plugin): resolve 3 bugs preventing dev plugins from loading"

This reverts commit 031464640560628dd8c093a4d8d30895c775ef98.

Entire-Checkpoint: 6ed1a02a0cb5

* Reapply "fix(plugin): resolve 3 bugs preventing dev plugins from loading"

This reverts commit 5707bf1c240f52baab277d21333cd7d92c191fac.

Entire-Checkpoint: bfaaa263a765

* revert: restore docs/superpowers/ plans and specs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 9195220e9172

* fix(review): revert unrelated changes and organize SDK sub-paths

- Revert --channel flag, assistant prompt changes, and session route
  changes that don't belong in Discord extraction PR (#82)
- Add SDK sub-path exports: @openacp/plugin-sdk/formatting,
  @openacp/plugin-sdk/config (alongside existing /testing) (#83)
- Mark SDK exports as @stable vs @experimental
- Fix plugin count test (10 → 9 after Discord removal)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 9bd5c44d98c4

* fix(review): address round 2 feedback on PR #80

- Rename @openacp/plugin-discord → @openacp/adapter-discord in all refs
  (setup-channels, wizard, lifecycle-manager, docs)
- Keep @openacp/plugin-discord as legacy alias in lifecycle-manager
- Remove unrelated session-cleanup-design.md spec from PR
- SDK: deduplicate main barrel by re-exporting from sub-path modules

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 4454289e400f

* fix(review): remove remaining Discord references from core

- Remove Discord doctor check from core (plugin registers its own)
- Dynamic adapter discovery via ServiceRegistry instead of hardcoded list
- Remove @openacp/discord from auto-register built-in plugins list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: c15c5fbf08c8

* fix(config): auto-install Discord plugin when enabling via config editor

When user enables or configures Discord through `openacp config` (not
onboarding), check if @openacp/adapter-discord is installed. If not,
prompt to install it automatically via npm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: dd218c585ae3

* fix(review): round 3 cleanup — extensible ChannelId, update CLAUDE.md

- Change ChannelId from fixed union to string for extensibility
- Remove discord/ from CLAUDE.md project layout (now external plugin)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 66d8d185cda7

* fix(review): resolve all remaining Discord coupling in core

- Remove DiscordPlatformData from core types (plugin defines its own)
- Remove DiscordPlatformData from SDK re-exports
- Config editor: delegate Discord config to plugin configure() instead
  of 100+ lines of inline Discord logic
- Update integrate.ts help text to be adapter-agnostic
- Clean absolute local paths from planning docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 094cc484aaae

* fix: replace execSync npm install with async utility

Extract installNpmPlugin() into a shared utility that uses async exec
instead of execSync, preventing event loop blocking. Used by both
config-editor.ts and wizard.ts instead of inline execSync calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: replace execSync with async installNpmPlugin utility

Extract shared plugin install logic into plugin-installer.ts using
promisify(exec) to avoid blocking the event loop during npm install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 09c3d8b93ec9

* fix: pass settingsManager and pluginRegistry to setup wizard from CLI commands

cmdDefault and cmdOnboard called runSetup() without the required
settingsManager/pluginRegistry opts, causing "Plugin system not
initialized" error on first-run setup. Now both paths create these
dependencies before invoking the wizard, matching main.ts behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 4cb5e64819c9

* fix: resolve npm plugins from plugins dir instead of project root

import(packageName) resolves from the project root, not from the
~/.openacp/plugins/node_modules where npm packages are actually
installed. Use createRequire + pathToFileURL to resolve from the
correct directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: e3f8576e9f51

* fix: resolve ESM-only npm plugins by reading package.json exports

createRequire cannot resolve packages that only define ESM exports
(no "require" condition). Instead, read the package's package.json
to find the entry point (exports["."].import > main > index.js)
and import by file URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 512775b194fb

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: 0xmrpeter <0xmrpeter@gmail.com>
2026-03-27 18:21:34 +07:00
0xmrpeter
7629308a47 refactor: centralize path constants and use async fs
- Extract OPENACP_DIR, PLUGINS_DATA_DIR, REGISTRY_PATH to config.ts
  instead of duplicating across main.ts, default.ts, onboard.ts
- Use fs/promises.readFile instead of sync readFileSync in importFromDir

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:16:44 +07:00
dylan
0e1d6fa34b fix: resolve ESM-only npm plugins by reading package.json exports
createRequire cannot resolve packages that only define ESM exports
(no "require" condition). Instead, read the package's package.json
to find the entry point (exports["."].import > main > index.js)
and import by file URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 512775b194fb
2026-03-27 17:53:58 +07:00
dylan
aa7433dab5 fix: resolve npm plugins from plugins dir instead of project root
import(packageName) resolves from the project root, not from the
~/.openacp/plugins/node_modules where npm packages are actually
installed. Use createRequire + pathToFileURL to resolve from the
correct directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: e3f8576e9f51
2026-03-27 17:53:58 +07:00
dylan
76ce259c61 fix: pass settingsManager and pluginRegistry to setup wizard from CLI commands
cmdDefault and cmdOnboard called runSetup() without the required
settingsManager/pluginRegistry opts, causing "Plugin system not
initialized" error on first-run setup. Now both paths create these
dependencies before invoking the wizard, matching main.ts behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 4cb5e64819c9
2026-03-27 17:53:58 +07:00
dylan
f2de50fe89 merge: sync with upstream redesign/microkernel-plugin-architecture
Resolves conflicts in plugin-sdk exports and core index files.
Upstream extracted Discord to standalone package and refined SDK exports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 385aad6258f7
2026-03-27 17:53:19 +07:00
0xmrpeter
b5ebcc6038 refactor(sdk): prefer export type for core classes used only as type annotations
OpenACPCore, Session, SessionManager, CommandRegistry are only imported
as types by external plugins — no need for runtime value exports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v2026.0327.3
2026-03-27 16:59:39 +07:00
0xmrpeter
a09d8296ba feat(sdk): export all types and values needed by external adapter plugins
Add missing exports: PlanEntry, DisplayVerbosity, Attachment, OpenACPCore,
Session, SessionManager, CommandRegistry, IRenderer, MessagingAdapterConfig,
RenderedMessage, ToolCallMeta, ToolUpdateMeta, ViewerLinks, InstallProgress,
log, createChildLogger, PRODUCT_GUIDE, DoctorEngine, DoctorReport, PendingFix.

Add new SDK sub-path exports:
- @openacp/plugin-sdk/config (DoctorEngine, config registry utils)
- @openacp/plugin-sdk/formatting (STATUS_ICONS, KIND_ICONS, format utils)
- @openacp/plugin-sdk/testing (runAdapterConformanceTests)

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