156 Commits

Author SHA1 Message Date
0xmrpeter
e55307fa11 feat(diff): enhance line diff computation and update display specifications
- Introduced a new function `computeLineDiff` to accurately calculate line-level diffs by stripping common prefixes and suffixes, improving diff accuracy.
- Updated `MessageTransformer` to utilize the new diff computation for better metadata extraction.
- Enhanced `DisplaySpecBuilder` to include `inputContent` in the display specifications, allowing for inline display of raw input in high verbosity mode.
- Refined title generation logic to improve clarity and consistency in displayed titles across different contexts.
- Adjusted formatting functions to ensure proper display of input content and viewer links in tool cards.
2026-03-30 12:27:30 +07:00
0xmrpeter
81f9587a8c refactor(logging): streamline logging in agent-instance and activity tracker
- Refined logging in agent-instance to reduce verbosity by removing debug logs for raw input/output.
- Enhanced activity tracker logging to include viewer links for improved traceability.
- Updated .gitignore to exclude .log files from version control.
2026-03-30 09:56:04 +07:00
0xmrpeter
4114359f02 chore: update .gitignore and refine logging in agent-instance and activity tracker
- Added .log to .gitignore to exclude log files from version control.
- Removed debug logging for raw input/output in agent-instance to reduce verbosity.
- Enhanced logging in activity tracker to include viewer links for better traceability.
2026-03-30 09:52:42 +07:00
0xmrpeter
16e0884354 fix(output-mode): wire outputViewerLink, fix verbosity callback key, update docs
- DisplaySpecBuilder: add TunnelServiceInterface constructor injection, implement
  outputViewerLink/outputFallbackContent for long output (>15 lines or >800 chars)
- DisplaySpecBuilder: fix buildThoughtSpec indicator to "Thinking..."
- ActivityTracker: store and pass tunnelService to DisplaySpecBuilder, pass sessionContext
  to all buildToolSpec calls
- setupVerbosityCallbacks: write outputMode instead of deprecated displayVerbosity key
- /verbosity static command description updated to note deprecation
- Docs: update displayVerbosity → outputMode across configuration, chat-commands,
  troubleshooting, and architecture docs; add /outputmode command reference
2026-03-30 01:52:51 +07:00
0xmrpeter
7c8c10f51b feat: add OPENACP_DEBUG trace logging (3 JSONL files per session)
When OPENACP_DEBUG=true, writes per-session trace files to <workingDir>/.log/:
- <sessionId>_acp.jsonl — raw ACP JSON-RPC protocol (stdin/stdout)
- <sessionId>_core.jsonl — core event pipeline (agent_event → middleware → transform → dispatch)
- <sessionId>_telegram.jsonl — all Telegram UI actions (handlers, tracker, tool card, draft, API calls)

DebugTracer utility with lazy dir creation, appendFileSync writes, zero overhead when disabled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:29:09 +07:00
0xmrpeter
428e343ea8 Merge branch 'develop' 2026-03-28 07:44:40 +07:00
0xmrpeter
8987822032 docs: update review findings with fix status 2026-03-28 01:28:52 +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
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
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
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
1cb9b38388
feat: extract Discord plugin to standalone package
* 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>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: 0xmrpeter <0xmrpeter@gmail.com>
2026-03-27 16:05:50 +07:00
0xmrpeter
14fb687172 docs: convert remaining docs to English
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:58:35 +07:00
0xmrpeter
340b7bdc34 feat(scaffold): add CLAUDE.md and PLUGIN_GUIDE.md to plugin template
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:41:56 +07:00
0xmrpeter
e7f925b055 feat(cli): support community npm install, @version syntax, and compatibility check
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:37:29 +07:00
0xmrpeter
0898fe6e37 docs: add plugin registry submission guide to GitBook
- contributing.md: full step-by-step guide for publishing to registry
- getting-started-plugin.md: brief mention with link after npm publish step

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 10:03:27 +07:00
0xmrpeter
a0f0050d60 Merge branch 'redesign/microkernel-plugin-architecture' of github.com:Open-ACP/OpenACP into redesign/microkernel-plugin-architecture 2026-03-27 09:59:26 +07:00
0xmrpeter
5061676cc4 docs: add usage plugin extraction implementation plan 2026-03-27 02:26:11 +07:00
0xmrpeter
3b10909ce6 docs: update usage plugin extraction spec after review
- Fix EventBus: add usage:recorded to EventBusEvents interface
- Fix notifications: use getService('notifications').notifyAll() instead of event emit
- Fix UsageRecord schema: include id, agentName, contextSize fields
- Fix budget.check(): make async since storage is async
- Add in-memory cache + debounced flush to UsageStore (avoid perf regression)
- Drop query() API surface (Telegram handleUsage removed, plugin /usage command replaces it)
- Use @openacp/usage-plugin as plugin name
2026-03-27 02:08:14 +07:00
0xmrpeter
81dc30f6f1 docs: add plugin registry design spec
GitHub-based community plugin registry with auto-merge PRs,
daily version sync from npm, CLI search + smart install,
and verified badge system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 02:07:03 +07:00
0xmrpeter
ebde61d46b docs: add usage plugin extraction design spec 2026-03-27 01:34:12 +07:00
0xmrpeter
63bee61daa fix: update outdated docs + add system command tests
- Fix adapter-reference.md and building-adapters.md (AdapterFactory → plugin pattern)
- Fix contributing.md (src/adapters/ → src/plugins/)
- Fix for-contributors.md (plugin-manager → PluginRegistry)
- Update configuration.md for per-plugin settings
- Update environment-variables.md for plugin-level env vars
- Add system command handler tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 22:14:52 +07:00
0xmrpeter
4121840b84 docs: add plugin dev tooling guides (getting started, SDK reference, dev mode)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:07:56 +07:00
0xmrpeter
98b3127509 docs: fix plugin dev tooling plan — address review issues
- Add Step 0 to export adapter primitives from main package (Critical #1)
- Add missing types: IChannelAdapter, PermissionOption, AgentCommand (Critical #2-3)
- Add Task 1b: unloadPlugin() method for LifecycleManager (Important #4-5)
- Replace globalThis with startServer({ devPlugin }) options (Suggestion #10)
- Fix testing.ts barrel to only export available files (Suggestion #9)
- Fix CLI routing note to read actual router file (Important #7)
- Fix chokidar/fs.watch confusion (Suggestion #12)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:37:14 +07:00
0xmrpeter
ce8ee13f0d docs: add plugin dev tooling implementation plan
9 tasks in 3 phases: fix cleanup() prerequisite, SDK package with
types + testing utilities, scaffold generator, dev mode with hot-reload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:31:11 +07:00
0xmrpeter
3e06539bd0 docs: fix plugin dev tooling spec — address review issues
C1: document cleanup() fix prerequisite (service/command unregistration)
C2: document ESM cache-busting limitations + future worker thread approach
I1: note workspace package name resolution
I4: scaffold imports from @openacp/plugin-sdk, not @openacp/cli
I5: generated package.json only has SDK as devDep, CLI as peerDep

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:26:46 +07:00
0xmrpeter
8e597071a5 docs: add plugin developer tooling design spec
Four features: openacp dev (hot-reload), openacp plugin create (scaffold),
@openacp/plugin-sdk (types + testing), and version-synced publishing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:18:22 +07:00
0xmrpeter
301d1c0b3c docs: add architecture documentation for microkernel plugin system
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:52:41 +07:00
0xmrpeter
27dc3276ee docs: fix command system plan — address review issues
- reply() accepts OutgoingMessage for backward compat
- coreAccess typed as CoreAccess, not unknown
- toCallbackData uses cache for >64 byte payloads
- core.serviceRegistry → core.lifecycleManager.serviceRegistry
- system:commands-ready emission updated in Task 5
- Middleware ordering clarified for Task 6
- Handler types use unknown instead of any

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:13:44 +07:00
0xmrpeter
bdf9f7483f docs: add command system implementation plan
8 tasks: types, CommandRegistry, system commands, plugin commands,
boot flow wiring, Telegram dispatch + renderers, Discord dispatch,
integration verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:08:22 +07:00
0xmrpeter
3dcc7bb1c8 docs: fix command system spec — address all review blocking issues
B1: handler returns Promise<CommandResponse | void> for backward compat
B2: reply() kept on CommandArgs as escape hatch for mid-execution feedback
B3: two-layer architecture for multi-step commands (core logic + adapter override)
I1: platform orchestration layer documented
I2: callback prefix scope clarified (c/ only for commands, existing prefixes unchanged)
I3: callback data cache for >64 byte payloads
I4: complete migration table with all missing commands + name migration
I5: options field added to CommandArgs for Discord typed options
S4: first-wins namespace rule (less disruptive than both-lose)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:03:12 +07:00
0xmrpeter
5724f1948d docs: add command system design spec
Centralized CommandRegistry, structured CommandResponse types,
auto-generated help, namespace conflict resolution, and full
migration plan from hardcoded adapter commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:36:52 +07:00
0xmrpeter
9c37b82798 docs: add Plan B for codebase consolidation (decouple core + simplify main.ts)
7 tasks: convert plugin imports to import type, decouple
message-transformer, move speech hot-reload to plugin, lazy-load
validators, simplify main.ts, clean up re-exports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:35:47 +07:00
0xmrpeter
e77f6c02df docs: add codebase consolidation design spec
Consolidate adapter/speech/tunnel code into plugins, decouple core
from plugin imports via ServiceRegistry, simplify main.ts boot flow.
Two implementation plans: mechanical moves first, then logic changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:11:00 +07:00
0xmrpeter
4987004376 docs: add plugin setup workflow implementation plan
10 tasks covering SettingsManager, PluginRegistry, TerminalIO,
InstallContext, LifecycleManager migration support, CLI commands,
and integration tests. TDD approach throughout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:48:55 +07:00
0xmrpeter
6306798c5f docs: add plugin setup workflow design spec
Per-plugin settings, install/configure/migrate/uninstall lifecycle hooks,
PluginRegistry, SettingsManager, and legacy config migration strategy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:40:02 +07:00
0xmrpeter
6a056ad7e7 docs: add Phase 2b Part 3 source move plan — move code into src/plugins/
9 tasks: move security, notifications, file-service, context, speech,
tunnel, usage source code into their plugin directories. Each plugin
becomes self-contained.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:42:42 +07:00
0xmrpeter
5c456cf6b2 docs: add Phase 2b Part 2 built-in extraction plan (759 lines, 14 tasks)
Fixed all 5 blockers from review:
1. Task 0: fix pluginConfig resolution + expose core on PluginContext
2. Adapter plugins use ctx.core for OpenACPCore access
3. Notifications plugin uses ctx.core.adapters for live Map
4. Security plugin registers SecurityGuard directly (no wrapper mismatch)
5. Added Task 11 for plugin wrapper tests + boot integration test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:06:27 +07:00
0xmrpeter
d96b5578e2 docs: fix Phase 2b plan review issues (6 fixes)
1. Add config migration task (Task 12) with field-by-field mapping tests
2. Add checksum verification tests to PluginLoader (Task 6)
3. Expand PluginContext tests to cover all 9 permission types (Task 7)
4. Add function-level specificity to all Task 11 sub-tasks
5. Add session-manager.ts to Files to modify list
6. Clarify Task 13 relationship with existing plugins.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:00:47 +07:00
0xmrpeter
ea228810de docs: add Phase 2b Part 1 plugin infrastructure implementation plan
13 tasks: types, ServiceRegistry, MiddlewareChain, PluginStorage,
ErrorTracker, PluginLoader, PluginContext, LifecycleManager,
EventBus expansion, core wiring, 19 middleware hooks, CLI, integration test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:55:48 +07:00
0xmrpeter
5d3609108f docs: fix Phase 2b spec review issues (1888 → 1978 lines)
Critical fixes:
- Fix Telegram plugin example: replace invalid private field with closure
- Fix Translation plugin: capture ctx in closure for teardown access
- Add complete config migration field-by-field mapping table
- Add env var override compatibility documentation

Important fixes:
- Add model:beforeChange hook (#19) for model selection restriction
- Add Flow 2b: Agent writes a file (fs:beforeWrite)
- Specify sendMessage routing on PluginContext (through message:outgoing middleware)
- Update task 10g to include model:beforeChange

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:02 +07:00
0xmrpeter
82354b89d5 docs: comprehensive rewrite of Phase 2b plugin system spec (750 → 1888 lines)
Added: typed middleware payloads for all 18 hooks, modifiable vs read-only
matrix, edge cases for every section, service contracts for all built-in
services, 8 detailed flow diagrams, full config format, plugin discovery
and checksum verification, transition state documentation, 4 concrete
plugin examples, CLI command spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:30:03 +07:00
0xmrpeter
0e0feeb89c docs: fix Phase 2b spec — add emit(), clarify middleware ordering, break Task 10
Fixes from spec review:
- Add emit() to PluginContext for events:emit permission
- Clarify priority cannot override dependency order in middleware
- Add 5s middleware timeout
- Document next() return semantics
- Break Task 10 into 7 sub-tasks (10a-10g) per hook category
- Add integration test task (Task 13)
- Add error budget recovery semantics
- Add plugin enable/disable CLI commands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:11:18 +07:00
0xmrpeter
7171408403 docs: add Phase 2b plugin system design spec
Covers: plugin interface, PluginContext, 18 middleware hooks,
service registry, lifecycle management, error isolation,
provider pattern, storage, and 2-plan implementation strategy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:07:03 +07:00
0xmrpeter
0b193428b7 docs: update links in README and documentation for consistency
- Updated various links in README.md and documentation files to point to the new GitBook URLs for better accessibility.
- Ensured all references to the Agent Client Protocol (ACP) guide are now linked correctly.
2026-03-26 10:03:37 +07:00
0xmrpeter
1835baab51 docs: microkernel lifecycle architecture proposal
Unified proposal merging Plugin API v2 (PR #63) with microkernel
architecture. Covers kernel extraction, built-in/community plugins,
service registry, dependency resolution, security model, and
implementation roadmap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:00:53 +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
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
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
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