opencode-matrixx 2.6.10 → 2.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +6 -5
  2. package/dist/agents/architect/default.d.ts +1 -1
  3. package/dist/agents/architect/gpt.d.ts +1 -1
  4. package/dist/agents/dynamic-agent-prompt-builder.d.ts +6 -5
  5. package/dist/agents/oracle/plan-template.d.ts +1 -7
  6. package/dist/agents/oracle/system-prompt.d.ts +1 -1
  7. package/dist/cli.js +29 -86
  8. package/dist/config/schema/agent-overrides.d.ts +126 -126
  9. package/dist/config/schema/commands.d.ts +0 -5
  10. package/dist/config/schema/dcp.d.ts +3 -3
  11. package/dist/config/schema/hooks.d.ts +3 -2
  12. package/dist/config/schema/internal/permission.d.ts +8 -8
  13. package/dist/config/schema/knowledge.d.ts +34 -0
  14. package/dist/config/schema/matrixx-config.d.ts +145 -132
  15. package/dist/config/schema/tool-gating.d.ts +9 -0
  16. package/dist/config/schema.d.ts +2 -1
  17. package/dist/create-hooks.d.ts +3 -2
  18. package/dist/features/background-agent/manager.d.ts +19 -0
  19. package/dist/features/bdd/schema.d.ts +5 -5
  20. package/dist/features/builtin-commands/templates/evolution.d.ts +1 -1
  21. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  22. package/dist/features/builtin-commands/types.d.ts +1 -1
  23. package/dist/features/evolution/compressor/index.d.ts +2 -2
  24. package/dist/features/evolution/compressor/interface.d.ts +9 -4
  25. package/dist/features/evolution/compressor/llm.d.ts +14 -4
  26. package/dist/features/evolution/evaluator.d.ts +10 -0
  27. package/dist/features/evolution/pipeline.d.ts +3 -1
  28. package/dist/features/evolution/schema.d.ts +46 -0
  29. package/dist/features/evolution/store/budget-ledger.d.ts +46 -0
  30. package/dist/features/evolution/store/index.d.ts +5 -0
  31. package/dist/features/evolution/store/lifecycle.d.ts +52 -0
  32. package/dist/features/evolution/store/project-identity.d.ts +27 -0
  33. package/dist/features/evolution/store/query.d.ts +23 -0
  34. package/dist/features/evolution/{store.d.ts → store/trace-store.d.ts} +1 -1
  35. package/dist/features/evolution/types.d.ts +34 -1
  36. package/dist/features/evolution/writer-emit.d.ts +17 -0
  37. package/dist/features/evolution/writer-frontmatter.d.ts +23 -0
  38. package/dist/features/evolution/writer-supersede.d.ts +20 -0
  39. package/dist/features/evolution/writer.d.ts +4 -0
  40. package/dist/features/knowledge-hub/index.d.ts +3 -0
  41. package/dist/features/knowledge-hub/loader.d.ts +11 -0
  42. package/dist/features/knowledge-hub/resolver.d.ts +2 -0
  43. package/dist/features/mission-state/constants.d.ts +20 -0
  44. package/dist/features/mission-state/index.d.ts +1 -0
  45. package/dist/features/mission-state/plan-storage.d.ts +32 -6
  46. package/dist/features/mission-state/reconcile.d.ts +75 -0
  47. package/dist/features/mission-state/reconcile.test.d.ts +1 -0
  48. package/dist/features/mission-state/storage.d.ts +26 -0
  49. package/dist/features/mission-state/types.d.ts +6 -0
  50. package/dist/features/plan-contract/appendix.d.ts +14 -0
  51. package/dist/features/plan-contract/constants.d.ts +16 -0
  52. package/dist/features/plan-contract/front-matter.d.ts +34 -0
  53. package/dist/features/plan-contract/index.d.ts +14 -0
  54. package/dist/features/plan-contract/migration.d.ts +36 -0
  55. package/dist/features/plan-contract/schema.d.ts +32 -0
  56. package/dist/features/plan-contract/skeleton.d.ts +5 -0
  57. package/dist/features/plan-contract/types.d.ts +56 -0
  58. package/dist/features/plan-contract/validate.d.ts +9 -0
  59. package/dist/features/session-state/state.d.ts +0 -11
  60. package/dist/hooks/auto-slash-command/executor.d.ts +11 -3
  61. package/dist/hooks/auto-slash-command/hook.d.ts +0 -2
  62. package/dist/hooks/evolution-compressor/host-llm-call.d.ts +17 -0
  63. package/dist/hooks/index.d.ts +3 -2
  64. package/dist/hooks/knowledge-hub-guard/approvals.d.ts +5 -0
  65. package/dist/hooks/knowledge-hub-guard/hook.d.ts +15 -0
  66. package/dist/hooks/knowledge-hub-guard/hook.test.d.ts +1 -0
  67. package/dist/hooks/knowledge-hub-guard/index.d.ts +3 -0
  68. package/dist/hooks/knowledge-hub-injector/hook.d.ts +26 -0
  69. package/dist/hooks/knowledge-hub-injector/hook.test.d.ts +1 -0
  70. package/dist/hooks/knowledge-hub-injector/index.d.ts +2 -0
  71. package/dist/hooks/knowledge-hub-search-nudge/hook.d.ts +16 -0
  72. package/dist/hooks/knowledge-hub-search-nudge/hook.test.d.ts +1 -0
  73. package/dist/hooks/knowledge-hub-search-nudge/index.d.ts +2 -0
  74. package/dist/hooks/plan-persister/index.d.ts +4 -0
  75. package/dist/hooks/plan-persister/task-link.d.ts +31 -0
  76. package/dist/hooks/plan-persister/task-sync.d.ts +39 -0
  77. package/dist/hooks/plan-persister/task-sync.test.d.ts +1 -0
  78. package/dist/hooks/start-work/index.d.ts +1 -0
  79. package/dist/hooks/start-work/plan-filter.d.ts +48 -0
  80. package/dist/hooks/task-continuation-enforcer/constants.d.ts +0 -5
  81. package/dist/index.js +6247 -4111
  82. package/dist/matrixx.schema.json +88 -145
  83. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -2
  84. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
  85. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +3 -2
  86. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
  87. package/dist/plugin/tool-gating.d.ts +35 -0
  88. package/dist/shared/dcp-guidance.d.ts +16 -0
  89. package/dist/{tools/dcp-switch-profile/tools.d.ts → shared/dcp-switch-profile.d.ts} +1 -3
  90. package/dist/shared/index.d.ts +1 -0
  91. package/dist/tools/background-task/constants.d.ts +1 -0
  92. package/dist/tools/background-task/create-background-wait-all.d.ts +3 -0
  93. package/dist/tools/background-task/index.d.ts +1 -1
  94. package/dist/tools/background-task/tools.d.ts +1 -0
  95. package/dist/tools/background-task/types.d.ts +3 -0
  96. package/dist/tools/delegate-task/constants.d.ts +6 -0
  97. package/dist/tools/delegate-task/prompt-builder.d.ts +1 -0
  98. package/dist/tools/delegate-task/prompt-builder.tdd.test.d.ts +1 -0
  99. package/dist/tools/delegate-task/tdd-enforcement.test.d.ts +1 -0
  100. package/dist/tools/delegate-task/tools.d.ts +6 -0
  101. package/dist/tools/delegate-task/types.d.ts +1 -0
  102. package/dist/tools/evolution/constants.d.ts +24 -0
  103. package/dist/tools/evolution/index.d.ts +3 -0
  104. package/dist/tools/evolution/query-actions.d.ts +3 -0
  105. package/dist/tools/evolution/query-actions.test.d.ts +1 -0
  106. package/dist/tools/evolution/tools.d.ts +16 -0
  107. package/dist/tools/evolution/tools.test.d.ts +1 -0
  108. package/dist/tools/evolution/types.d.ts +20 -0
  109. package/dist/tools/index.d.ts +2 -1
  110. package/dist/tools/knowledge-hub-confirm/index.d.ts +1 -0
  111. package/dist/tools/knowledge-hub-confirm/tools.d.ts +12 -0
  112. package/dist/tools/knowledge-hub-confirm/tools.test.d.ts +1 -0
  113. package/dist/tools/plan/constants.d.ts +1 -0
  114. package/dist/tools/plan/index.d.ts +1 -0
  115. package/dist/tools/plan/plan-tasks.d.ts +3 -0
  116. package/dist/tools/plan/types.d.ts +10 -0
  117. package/package.json +1 -1
  118. package/dist/config/schema/failure-counter.d.ts +0 -7
  119. package/dist/features/builtin-commands/templates/bdd-backend.d.ts +0 -1
  120. package/dist/features/builtin-commands/templates/bdd-contract.d.ts +0 -1
  121. package/dist/features/builtin-commands/templates/bdd-frontend.d.ts +0 -1
  122. package/dist/features/builtin-commands/templates/bdd-tests.d.ts +0 -1
  123. package/dist/features/builtin-commands/templates/dcp-profile.d.ts +0 -1
  124. package/dist/hooks/failure-counter/counter.d.ts +0 -7
  125. package/dist/hooks/failure-counter/hook.d.ts +0 -18
  126. package/dist/hooks/failure-counter/index.d.ts +0 -3
  127. package/dist/hooks/failure-counter/patterns.d.ts +0 -6
  128. package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +0 -28
  129. package/dist/hooks/hashline-edit-diff-enhancer/index.d.ts +0 -1
  130. package/dist/tools/dcp-switch-profile/index.d.ts +0 -1
  131. /package/dist/{hooks/failure-counter/counter.test.d.ts → features/knowledge-hub/loader.test.d.ts} +0 -0
  132. /package/dist/{hooks/failure-counter/patterns.test.d.ts → features/knowledge-hub/resolver.test.d.ts} +0 -0
@@ -4,11 +4,13 @@ export { createBddCreateContractTool } from "./bdd-create-contract";
4
4
  export { createBddParseGherkinTool } from "./bdd-parse-gherkin";
5
5
  export { createBddPipelineTool } from "./bdd-pipeline";
6
6
  export { createBddValidateContractTool } from "./bdd-validate-contract";
7
+ export { createEvolutionTool } from "./evolution";
7
8
  export { createGithubSearchTools } from "./github-search";
8
9
  export { createGlobTools } from "./glob";
9
10
  export { createGrepTools } from "./grep";
10
11
  export { createHandoffTools } from "./handoff";
11
12
  export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
13
+ export { createKnowledgeHubConfirmTool } from "./knowledge-hub-confirm";
12
14
  export { createPdfExtractFiguresTool } from "./pdf-extract-figures";
13
15
  export { createPlanCreateTool } from "./plan/plan-create";
14
16
  export { createPlanDeleteTool } from "./plan/plan-delete";
@@ -25,7 +27,6 @@ import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin";
25
27
  import type { BackgroundManager } from "../features/background-agent";
26
28
  type OpencodeClient = PluginInput["client"];
27
29
  export { createAssemblyTool } from "./assembly";
28
- export { createDcpSwitchProfileTool } from "./dcp-switch-profile";
29
30
  export { createDelegateTask } from "./delegate-task";
30
31
  export { createHashlineEditTool } from "./hashline-edit";
31
32
  export { createLookAt } from "./look-at";
@@ -0,0 +1 @@
1
+ export { createKnowledgeHubConfirmTool } from "./tools";
@@ -0,0 +1,12 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
3
+ /**
4
+ * `knowledge_hub_confirm` tool — records a user-confirmed override for the
5
+ * knowledge-hub read-only guard.
6
+ *
7
+ * Call this ONLY after the user explicitly approved the write via the
8
+ * question tool. It records a session-scoped approval (default TTL 10 min)
9
+ * for the resolved absolute path, then the agent retries the blocked write
10
+ * and the guard lets it through.
11
+ */
12
+ export declare function createKnowledgeHubConfirmTool(ctx: PluginInput): ToolDefinition;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,6 +4,7 @@
4
4
  */
5
5
  export declare const PLANS_DIR = ".matrixx/plans";
6
6
  export declare const MAX_PLAN_FILE_BYTES = 102400;
7
+ export declare const MAX_PLAN_READ_RENDERED_BYTES = 40000;
7
8
  export declare const PLAN_FILENAME_KEBAB_REGEX: RegExp;
8
9
  export declare const PLAN_BASENAME_KEBAB_REGEX: RegExp;
9
10
  export declare const META_TAG_PREFIX = "<!-- plan-persister:";
@@ -3,4 +3,5 @@ export { createPlanCreateTool } from "./plan-create";
3
3
  export { createPlanDeleteTool } from "./plan-delete";
4
4
  export { createPlanListTool } from "./plan-list";
5
5
  export { createPlanReadTool } from "./plan-read";
6
+ export { createPlanTasksTool } from "./plan-tasks";
6
7
  export { createPlanUpdateTool } from "./plan-update";
@@ -0,0 +1,3 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ import type { PluginContext } from "../../plugin/types";
3
+ export declare function createPlanTasksTool(ctx?: PluginContext): ToolDefinition;
@@ -9,8 +9,18 @@ export interface PlanCreateArgs {
9
9
  filePath: string;
10
10
  content: string;
11
11
  }
12
+ export type PlanReadFormat = "hashline" | "content";
13
+ export interface PlanOutlineEntry {
14
+ level: 2 | 3;
15
+ text: string;
16
+ line: number;
17
+ anchor: string;
18
+ }
12
19
  export interface PlanReadArgs {
13
20
  filePath: string;
21
+ format?: PlanReadFormat;
22
+ offset?: number;
23
+ limit?: number;
14
24
  }
15
25
  export interface PlanUpdateArgs {
16
26
  filePath: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-matrixx",
3
- "version": "2.6.10",
3
+ "version": "2.6.12",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import { z } from "zod";
2
- export declare const FailureCounterConfigSchema: z.ZodObject<{
3
- enabled: z.ZodDefault<z.ZodBoolean>;
4
- threshold: z.ZodDefault<z.ZodNumber>;
5
- resetOnSuccess: z.ZodDefault<z.ZodBoolean>;
6
- }, z.core.$strip>;
7
- export type FailureCounterConfig = z.infer<typeof FailureCounterConfigSchema>;
@@ -1 +0,0 @@
1
- export declare const BDD_BACKEND_TEMPLATE = "# /bdd-backend\n\nGenerate typed API services from one or more BDD Contract JSON files.\n\n## Usage\n\nSingle file:\n```\n/bdd-backend <contract.json> --out <out-dir>\n```\n\nBatch (directory or glob):\n```\n/bdd-backend <dir> --out <out-dir>\n/bdd-backend \"<dir>/**/*.contract.json\" --out <out-dir>\n```\n\n## Workflow\n\nSingle file:\n1. Read the Contract JSON\n2. Extract @api:endpoint and @api:response annotations\n3. Generate typed service files with Zod request/response schemas\n4. One service function per endpoint\n5. Report generated file paths\n\nBatch input (directory or glob):\n1. Expand the input into a list of .contract.json files\n2. For each contract, run the single-file workflow above\n3. Use background subagents (`task(run_in_background=true)`) to run each in parallel (up to 5 concurrent)\n4. Wait for all to finish, then collect results and report a summary\n\n## Output\n\nSingle file: TypeScript service files (.ts) with Zod validation schemas for each API endpoint.\n\nBatch: per-feature service subdirectory tree under `<out-dir>/<feature>/backend/`.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated files in the target output directory.\n";
@@ -1 +0,0 @@
1
- export declare const BDD_CONTRACT_TEMPLATE = "# /bdd-contract\n\nGenerate BDD Contract JSON from one or more Gherkin .feature files. The .feature file must be 100% pure Gherkin (no '# @annotation' comments). The bdd-contract agent infers all annotations (api/ui/state/assumptions) via LLM reasoning from feature content.\n\n## Usage\n\nSingle file:\n```\n/bdd-contract <feature-path> [--force]\n```\n\nBatch (directory or glob):\n```\n/bdd-contract <dir> [--force]\n/bdd-contract \"<dir>/**/*.feature\" [--force]\n```\n\n## Workflow\n\nSingle file:\n1. Parse the .feature file using bdd_parse_gherkin tool (deterministic AST)\n2. Create initial Contract JSON using bdd_create_contract tool (deterministic, empty annotations)\n3. ENRICH the Contract: the bdd-contract agent infers annotations (api/ui/state/assumptions) via LLM reasoning from feature content and edits the Contract JSON file in place\n4. **VALIDATE**: call bdd_validate_contract on the file -- if it returns errors, fix the contract and re-validate. The contract must conform to the strict ContractSchema (all annotation field names must match the required naming conventions: kebab-case for routes/testIds, camelCase for state variables, dotted kebab-case for string keys).\n5. Report the Contract file path, key features identified, and annotations inferred\n\nBatch input (directory or glob):\n1. Expand the input into a list of .feature files\n2. For each .feature file, run the single-file workflow above\n3. Report a summary of all generated contracts (count, paths, any failures)\n\n## Output\n\nSingle file: a `<file>.contract.json` alongside the source .feature file, conforming to ContractSchema v1 with schemaVersion: 1, scenarios, and LLM-inferred annotations.\n\nBatch: one contract file per source .feature, written next to each source file.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated contract JSON.\n";
@@ -1 +0,0 @@
1
- export declare const BDD_FRONTEND_TEMPLATE = "# /bdd-frontend\n\nGenerate React components and a dev preview server from one or more BDD Contract JSON files.\n\n## Usage\n\nSingle file:\n```\n/bdd-frontend <contract.json>\n```\n\nBatch (directory or glob):\n```\n/bdd-frontend <dir> --out <out-dir>\n/bdd-frontend \"<dir>/**/*.contract.json\" --out <out-dir>\n```\n\n## Workflow\n\nSingle file:\n1. Read the Contract JSON\n2. Extract @ui:* annotations (routes, testIds, strings)\n3. Generate React components for each route/feature\n4. Implement form fields from state variables\n5. Apply test IDs and accessibility attributes\n6. Generate a preview-server.ts for visual review\n\nBatch input (directory or glob):\n1. Expand the input into a list of .contract.json files\n2. For each contract, run the single-file workflow above\n3. Use background subagents (`task(run_in_background=true)`) to run each in parallel (up to 5 concurrent)\n4. Wait for all to finish, then collect results and report a summary\n\n## Output\n\nSingle file: React component files (.tsx) with TypeScript props, design tokens, data-testid attributes, and a preview-server.ts for visual review.\n\nBatch: per-feature component subdirectory tree under `<out-dir>/<feature>/components/`, with one preview-server.ts per feature.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated files in the target output directory.\n";
@@ -1 +0,0 @@
1
- export declare const BDD_TESTS_TEMPLATE = "# /bdd-tests\n\nGenerate Cucumber step definitions and page objects from one or more BDD Contract JSON files.\n\n## Usage\n\nSingle file:\n```\n/bdd-tests <contract.json> --out <out-dir>\n```\n\nBatch (directory or glob):\n```\n/bdd-tests <dir> --out <out-dir>\n/bdd-tests \"<dir>/**/*.contract.json\" --out <out-dir>\n```\n\n## Workflow\n\nSingle file:\n1. Read the Contract JSON file\n2. Extract feature scenarios and their steps\n3. Generate Cucumber step definition files (Given/When/Then/And/But)\n4. Generate page object classes for UI interactions\n5. Generate `cucumber.cjs` (CommonJS, NOT `cucumber.js`) + a per-feature `Dockerfile` + `run-tests.sh` so the tests are runnable in CI and locally\n6. Verify with `npx cucumber-js` via bash (use the generated `run-tests.sh` if it exists, else invoke cucumber directly)\n\nBatch input (directory or glob):\n1. Expand the input into a list of .contract.json files\n2. For each contract, run the single-file workflow above (including the per-feature Dockerfile + run-tests.sh generation)\n3. Use background subagents (`task(run_in_background=true)`) to run each in parallel (up to 5 concurrent)\n4. Wait for all to finish and collect results\n5. AFTER all per-feature runs finish, generate TWO parent-shared files at the input directory root:\n - `<input-dir>/Dockerfile` -- same base image as the per-feature one, CMD points to the parent run-tests.sh\n - `<input-dir>/run-tests.sh` -- iterates every feature subdir that has a run-tests.sh and invokes it in sequence (with BDD_FEATURE filter support)\n6. Report a summary that lists the per-feature outputs AND the parent batch runner\n\n## Output\n\nSingle file: `<out-dir>/<feature>/` containing `cucumber.cjs`, `Dockerfile`, `run-tests.sh`, plus `tests/` (step definitions, page objects, world, hooks).\n\nBatch: per-feature subdirectory tree under `<input-dir>/<feature>/` with the same layout for each feature, PLUS parent-shared `<input-dir>/Dockerfile` and `<input-dir>/run-tests.sh` for running every feature in one go.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated files in the target output directory.\n";
@@ -1 +0,0 @@
1
- export declare const DCP_PROFILE_TEMPLATE = "You are switching the active DCP (Dynamic Context Pruning) profile tier.\n\nThis command is provided by the Matrixx plugin. It uses the built-in `dcp_switch_profile` tool to apply DCP profile configurations \u2014 no external scripts needed.\n\n## Step 1: Verify DCP is installed\n\nCheck whether the DCP plugin is installed at the standard OpenCode plugin location:\n\n```bash\nif [ ! -d \"$HOME/.config/opencode/node_modules/@tarquinen/opencode-dcp\" ]; then\n echo \"DCP is not installed at the standard OpenCode plugin location.\" >&2\n echo \"Install it with: npm install --prefix ~/.config/opencode @tarquinen/opencode-dcp\" >&2\n exit 1\nfi\n```\n\nIf the directory does not exist, stop immediately and report the error to the user. Do not proceed.\n\n## Step 2: Determine the target profile\n\nParse the arguments passed to this command. The user invoked `/dcp-profile <arguments>` where `<arguments>` is the first positional argument.\n\n- If the argument is a known profile name (one of: economy, balanced, performance, ultimate), use it directly.\n- If the argument is empty or missing, read `dcp.default_profile` from the user's `matrixx.jsonc` config; if absent, default to `balanced`.\n- If the argument is not a recognized profile name, list the available profiles and stop. Do NOT guess or pass invalid names.\n\n## Step 3: Call the built-in `dcp_switch_profile` tool\n\nUse the `dcp_switch_profile` tool with the resolved profile name. This tool reads profile parameters from the Matrixx plugin configuration and writes the full inline DCP config to `~/.config/opencode/dcp.jsonc`.\n\nThe tool will handle all file operations \u2014 you do NOT need to run any external scripts or edit DCP config files directly.\n\n## Step 4: Confirm and instruct\n\nAfter a successful switch:\n\n1. Report the tool's output to the user.\n2. Tell the user that the new DCP configuration will take effect after they restart their OpenCode session (the active session has already loaded the previous config into memory).\n3. Do not attempt to reload DCP in-place; a session restart is required.\n\n## Important constraints\n\n- Use the built-in `dcp_switch_profile` tool. Do NOT bypass it by editing DCP config files directly.\n- Do not install, upgrade, or modify the DCP plugin from this command. If the user needs to install or upgrade DCP, instruct them to run `opencode plugin @tarquinen/opencode-dcp@<version>` (or use `npm install --prefix ~/.config/opencode` for cached installs).\n";
@@ -1,7 +0,0 @@
1
- import { clearFailureCounter, getFailureCount, resetFailureCounter } from "../../features/session-state/state";
2
- export declare const CONTINUATION_COOLDOWN_MS = 30000;
3
- export interface HandleToolAfterOptions {
4
- parentSessionID?: string;
5
- }
6
- export declare function handleToolAfter(sessionID: string, output: string, isSuccess: boolean, options?: HandleToolAfterOptions): void;
7
- export { clearFailureCounter, getFailureCount, resetFailureCounter };
@@ -1,18 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- export declare function createFailureCounterHook(_ctx: PluginInput): {
3
- "tool.execute.after": (input: {
4
- tool: string;
5
- sessionID: string;
6
- callID: string;
7
- }, output: {
8
- title: string;
9
- output: string;
10
- metadata: unknown;
11
- }) => Promise<void>;
12
- event: (input: {
13
- event: {
14
- type: string;
15
- properties: Record<string, unknown>;
16
- };
17
- }) => Promise<void>;
18
- };
@@ -1,3 +0,0 @@
1
- export * from "./counter";
2
- export { createFailureCounterHook } from "./hook";
3
- export * from "./patterns";
@@ -1,6 +0,0 @@
1
- export interface FailureSignature {
2
- pattern: string | RegExp;
3
- kind: "task_error" | "timeout" | "abort_excluded";
4
- }
5
- export declare const FAILURE_COUNTER_PATTERNS: FailureSignature[];
6
- export declare function isCountableFailure(output: string): boolean;
@@ -1,28 +0,0 @@
1
- interface HashlineEditDiffEnhancerConfig {
2
- hashline_edit?: {
3
- enabled: boolean;
4
- };
5
- }
6
- type BeforeInput = {
7
- tool: string;
8
- sessionID: string;
9
- callID: string;
10
- };
11
- type BeforeOutput = {
12
- args: Record<string, unknown>;
13
- };
14
- type AfterInput = {
15
- tool: string;
16
- sessionID: string;
17
- callID: string;
18
- };
19
- type AfterOutput = {
20
- title: string;
21
- output: string;
22
- metadata: Record<string, unknown>;
23
- };
24
- export declare function createHashlineEditDiffEnhancerHook(config: HashlineEditDiffEnhancerConfig): {
25
- "tool.execute.before": (input: BeforeInput, output: BeforeOutput) => Promise<void>;
26
- "tool.execute.after": (input: AfterInput, output: AfterOutput) => Promise<void>;
27
- };
28
- export {};
@@ -1 +0,0 @@
1
- export { createHashlineEditDiffEnhancerHook } from "./hook";
@@ -1 +0,0 @@
1
- export { createDcpSwitchProfileTool } from "./tools";