diff --git a/src/AGENTS.md b/src/AGENTS.md index 2c839aa22..7887d9848 100644 --- a/src/AGENTS.md +++ b/src/AGENTS.md @@ -1,6 +1,6 @@ # src/ — Plugin Source -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW @@ -14,8 +14,8 @@ Entry point `index.ts` orchestrates 5-step initialization: loadConfig → create | `plugin-config.ts` | JSONC parse, multi-level merge, Zod v4 validation | | `create-managers.ts` | TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler | | `create-tools.ts` | SkillContext + AvailableCategories + ToolRegistry (26 tools) | -| `create-hooks.ts` | 3-tier: Core(39) + Continuation(7) + Skill(2) = 48 hooks | -| `plugin-interface.ts` | 8 OpenCode hook handlers: config, tool, chat.message, chat.params, chat.headers, event, tool.execute.before, tool.execute.after | +| `create-hooks.ts` | 3-tier: Core(43) + Continuation(7) + Skill(2) = 52 hooks | +| `plugin-interface.ts` | 10 OpenCode hook handlers: config, tool, chat.message, chat.params, chat.headers, event, tool.execute.before, tool.execute.after, experimental.chat.messages.transform, experimental.session.compacting | ## CONFIG LOADING @@ -32,10 +32,10 @@ loadPluginConfig(directory, ctx) ``` createHooks() - ├─→ createCoreHooks() # 39 hooks - │ ├─ createSessionHooks() # 23: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort, intentGate... - │ ├─ createToolGuardHooks() # 12: commentChecker, rulesInjector, writeExistingFileGuard, jsonErrorRecovery, hashlineReadEnhancer... - │ └─ createTransformHooks() # 4: claudeCodeHooks, keywordDetector, contextInjector, thinkingBlockValidator + ├─→ createCoreHooks() # 43 hooks + │ ├─ createSessionHooks() # 24: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort, intentGate, legacyPluginToast... + │ ├─ createToolGuardHooks() # 14: commentChecker, rulesInjector, writeExistingFileGuard, jsonErrorRecovery, hashlineReadEnhancer, bashFileReadGuard, readImageResizer, todoDescriptionOverride, webfetchRedirectGuard... + │ └─ createTransformHooks() # 5: claudeCodeHooks, keywordDetector, contextInjector, thinkingBlockValidator, toolPairValidator ├─→ createContinuationHooks() # 7: todoContinuationEnforcer, atlas, stopContinuationGuard, compactionContextInjector... └─→ createSkillHooks() # 2: categorySkillReminder, autoSlashCommand ``` diff --git a/src/plugin/AGENTS.md b/src/plugin/AGENTS.md index 805a8f621..8dca76ed2 100644 --- a/src/plugin/AGENTS.md +++ b/src/plugin/AGENTS.md @@ -1,23 +1,25 @@ -# src/plugin/ — 8 OpenCode Hook Handlers + Hook Composition +# src/plugin/ — 10 OpenCode Hook Handlers + Hook Composition -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW -Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and composing 48 hooks into the PluginInterface. Every handler file corresponds to one OpenCode hook type. +Core glue layer. 20 source files assembling the 10 OpenCode hook handlers and composing 50 hooks into the PluginInterface. Every handler file corresponds to one OpenCode hook type. ## HANDLER FILES | File | OpenCode Hook | Purpose | |------|---------------|---------| +| `config.ts` | `config` | 6-phase config loading pipeline | +| `tool-registry.ts` | `tool` | 26 tools assembled from factories | | `chat-message.ts` | `chat.message` | First-message variant, session setup, keyword detection | | `chat-params.ts` | `chat.params` | Anthropic effort level, think mode | +| `chat-headers.ts` | `chat.headers` | Copilot x-initiator header injection | | `event.ts` | `event` | Session lifecycle (created, deleted, idle, error) | | `tool-execute-before.ts` | `tool.execute.before` | Pre-tool guards (file guard, label truncator, rules injector) | | `tool-execute-after.ts` | `tool.execute.after` | Post-tool hooks (output truncation, comment checker, metadata) | | `messages-transform.ts` | `experimental.chat.messages.transform` | Context injection, thinking block validation | -| `tool-registry.ts` | `tool` | 26 tools assembled from factories | -| `chat-headers.ts` | `chat.headers` | Copilot x-initiator header injection | +| `session-compacting.ts` | `experimental.session.compacting` | Context + todo preservation during compaction | | `skill-context.ts` | — | Skill/browser/category context for tool creation | ## HOOK COMPOSITION (hooks/ subdir) @@ -25,9 +27,10 @@ Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and com | File | Tier | Count | |------|------|-------| | `create-session-hooks.ts` | Session | 23 | -| `create-tool-guard-hooks.ts` | Tool Guard | 12 | +| `create-tool-guard-hooks.ts` | Tool Guard | 14 | +| `create-transform-hooks.ts` | Transform | 5 | | `create-skill-hooks.ts` | Skill | 2 | -| `create-core-hooks.ts` | Aggregator | Session + Guard + Transform = 39 | +| `create-core-hooks.ts` | Aggregator | Session + Guard + Transform = 42 | ## SUPPORT FILES