opencode-matrixx 2.6.9 → 2.6.11

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 (93) hide show
  1. package/README.md +7 -6
  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/cli.js +32 -78
  6. package/dist/config/schema/agent-overrides.d.ts +126 -126
  7. package/dist/config/schema/commands.d.ts +0 -5
  8. package/dist/config/schema/dcp.d.ts +3 -3
  9. package/dist/config/schema/hooks.d.ts +4 -0
  10. package/dist/config/schema/internal/permission.d.ts +8 -8
  11. package/dist/config/schema/knowledge.d.ts +34 -0
  12. package/dist/config/schema/matrixx-config.d.ts +146 -125
  13. package/dist/config/schema/tool-gating.d.ts +9 -0
  14. package/dist/config/schema.d.ts +2 -0
  15. package/dist/create-hooks.d.ts +4 -0
  16. package/dist/features/background-agent/manager.d.ts +19 -0
  17. package/dist/features/bdd/schema.d.ts +5 -5
  18. package/dist/features/builtin-commands/types.d.ts +1 -1
  19. package/dist/features/knowledge-hub/index.d.ts +3 -0
  20. package/dist/features/knowledge-hub/loader.d.ts +11 -0
  21. package/dist/features/knowledge-hub/loader.test.d.ts +1 -0
  22. package/dist/features/knowledge-hub/resolver.d.ts +2 -0
  23. package/dist/features/knowledge-hub/resolver.test.d.ts +1 -0
  24. package/dist/features/mission-state/constants.d.ts +20 -0
  25. package/dist/features/mission-state/index.d.ts +1 -0
  26. package/dist/features/mission-state/plan-storage.d.ts +32 -6
  27. package/dist/features/mission-state/reconcile.d.ts +75 -0
  28. package/dist/features/mission-state/reconcile.test.d.ts +1 -0
  29. package/dist/features/mission-state/storage.d.ts +26 -0
  30. package/dist/features/mission-state/types.d.ts +6 -0
  31. package/dist/hooks/auto-slash-command/executor.d.ts +11 -3
  32. package/dist/hooks/auto-slash-command/hook.d.ts +0 -2
  33. package/dist/hooks/document-reader-guard/constants.d.ts +5 -0
  34. package/dist/hooks/document-reader-guard/hook.d.ts +2 -0
  35. package/dist/hooks/document-reader-guard/index.d.ts +2 -0
  36. package/dist/hooks/index.d.ts +4 -0
  37. package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
  38. package/dist/hooks/knowledge-hub-guard/approvals.d.ts +5 -0
  39. package/dist/hooks/knowledge-hub-guard/hook.d.ts +15 -0
  40. package/dist/hooks/knowledge-hub-guard/hook.test.d.ts +1 -0
  41. package/dist/hooks/knowledge-hub-guard/index.d.ts +3 -0
  42. package/dist/hooks/knowledge-hub-injector/hook.d.ts +26 -0
  43. package/dist/hooks/knowledge-hub-injector/hook.test.d.ts +1 -0
  44. package/dist/hooks/knowledge-hub-injector/index.d.ts +2 -0
  45. package/dist/hooks/knowledge-hub-search-nudge/hook.d.ts +16 -0
  46. package/dist/hooks/knowledge-hub-search-nudge/hook.test.d.ts +1 -0
  47. package/dist/hooks/knowledge-hub-search-nudge/index.d.ts +2 -0
  48. package/dist/hooks/plan-persister/index.d.ts +4 -0
  49. package/dist/hooks/plan-persister/task-link.d.ts +31 -0
  50. package/dist/hooks/plan-persister/task-sync.d.ts +39 -0
  51. package/dist/hooks/plan-persister/task-sync.test.d.ts +1 -0
  52. package/dist/hooks/start-work/index.d.ts +1 -0
  53. package/dist/hooks/start-work/plan-filter.d.ts +48 -0
  54. package/dist/index.js +3472 -2333
  55. package/dist/matrixx.schema.json +90 -119
  56. package/dist/mcp/types.d.ts +0 -1
  57. package/dist/plugin/hooks/create-core-hooks.d.ts +4 -0
  58. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +4 -1
  59. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
  60. package/dist/plugin/tool-gating.d.ts +33 -0
  61. package/dist/shared/dcp-guidance.d.ts +16 -0
  62. package/dist/{tools/dcp-switch-profile/tools.d.ts → shared/dcp-switch-profile.d.ts} +1 -3
  63. package/dist/shared/index.d.ts +1 -0
  64. package/dist/tools/background-task/constants.d.ts +1 -0
  65. package/dist/tools/background-task/create-background-wait-all.d.ts +3 -0
  66. package/dist/tools/background-task/index.d.ts +1 -1
  67. package/dist/tools/background-task/tools.d.ts +1 -0
  68. package/dist/tools/background-task/types.d.ts +3 -0
  69. package/dist/tools/delegate-task/constants.d.ts +6 -0
  70. package/dist/tools/delegate-task/prompt-builder.d.ts +1 -0
  71. package/dist/tools/delegate-task/prompt-builder.tdd.test.d.ts +1 -0
  72. package/dist/tools/delegate-task/tdd-enforcement.test.d.ts +1 -0
  73. package/dist/tools/delegate-task/tools.d.ts +6 -0
  74. package/dist/tools/delegate-task/types.d.ts +1 -0
  75. package/dist/tools/github-search/cli.d.ts +7 -0
  76. package/dist/tools/github-search/constants.d.ts +6 -0
  77. package/dist/tools/github-search/index.d.ts +1 -0
  78. package/dist/tools/github-search/result-formatter.d.ts +2 -0
  79. package/dist/tools/github-search/result-formatter.test.d.ts +1 -0
  80. package/dist/tools/github-search/tools.d.ts +3 -0
  81. package/dist/tools/github-search/types.d.ts +20 -0
  82. package/dist/tools/index.d.ts +2 -1
  83. package/dist/tools/knowledge-hub-confirm/index.d.ts +1 -0
  84. package/dist/tools/knowledge-hub-confirm/tools.d.ts +12 -0
  85. package/dist/tools/knowledge-hub-confirm/tools.test.d.ts +1 -0
  86. package/package.json +1 -1
  87. package/dist/features/builtin-commands/templates/bdd-backend.d.ts +0 -1
  88. package/dist/features/builtin-commands/templates/bdd-contract.d.ts +0 -1
  89. package/dist/features/builtin-commands/templates/bdd-frontend.d.ts +0 -1
  90. package/dist/features/builtin-commands/templates/bdd-tests.d.ts +0 -1
  91. package/dist/features/builtin-commands/templates/dcp-profile.d.ts +0 -1
  92. package/dist/mcp/white-rabbit.d.ts +0 -6
  93. package/dist/tools/dcp-switch-profile/index.d.ts +0 -1
@@ -220,7 +220,11 @@
220
220
  "evolution-hitl",
221
221
  "context-mode-enforcer",
222
222
  "task-edit-guard",
223
- "failure-counter"
223
+ "document-reader-guard",
224
+ "failure-counter",
225
+ "knowledge-hub-guard",
226
+ "knowledge-hub-injector",
227
+ "knowledge-hub-search-nudge"
224
228
  ]
225
229
  },
226
230
  {}
@@ -245,12 +249,7 @@
245
249
  "research",
246
250
  "assembly",
247
251
  "ultrawork",
248
- "bdd-backend",
249
- "bdd-contract",
250
- "bdd-frontend",
251
- "bdd-pipeline",
252
- "bdd-tests",
253
- "dcp-profile"
252
+ "bdd-pipeline"
254
253
  ]
255
254
  }
256
255
  },
@@ -3975,117 +3974,7 @@
3975
3974
  "type": "boolean"
3976
3975
  },
3977
3976
  "profiles": {
3978
- "default": {
3979
- "economy": {
3980
- "pruneNotification": "off",
3981
- "compress": {
3982
- "maxContextLimit": "30%",
3983
- "minContextLimit": "20%",
3984
- "nudgeFrequency": 2,
3985
- "nudgeForce": "strong",
3986
- "iterationNudgeThreshold": 7
3987
- },
3988
- "turnProtection": {
3989
- "enabled": false
3990
- },
3991
- "experimental": {
3992
- "allowSubAgents": false
3993
- },
3994
- "strategies": {
3995
- "purgeErrors": {
3996
- "turns": 1
3997
- }
3998
- }
3999
- },
4000
- "balanced": {
4001
- "pruneNotification": "minimal",
4002
- "compress": {
4003
- "maxContextLimit": "60%",
4004
- "minContextLimit": "30%",
4005
- "nudgeFrequency": 3,
4006
- "nudgeForce": "strong",
4007
- "iterationNudgeThreshold": 10
4008
- },
4009
- "turnProtection": {
4010
- "enabled": true,
4011
- "turns": 2
4012
- },
4013
- "experimental": {
4014
- "allowSubAgents": true
4015
- },
4016
- "strategies": {
4017
- "purgeErrors": {
4018
- "turns": 2
4019
- }
4020
- }
4021
- },
4022
- "performance": {
4023
- "pruneNotification": "minimal",
4024
- "compress": {
4025
- "maxContextLimit": "80%",
4026
- "minContextLimit": "35%",
4027
- "nudgeFrequency": 4,
4028
- "nudgeForce": "strong",
4029
- "iterationNudgeThreshold": 12
4030
- },
4031
- "turnProtection": {
4032
- "enabled": true,
4033
- "turns": 3
4034
- },
4035
- "experimental": {
4036
- "allowSubAgents": true
4037
- },
4038
- "strategies": {
4039
- "purgeErrors": {
4040
- "turns": 2
4041
- }
4042
- }
4043
- },
4044
- "ultimate": {
4045
- "pruneNotification": "detailed",
4046
- "compress": {
4047
- "maxContextLimit": "85%",
4048
- "minContextLimit": "40%",
4049
- "nudgeFrequency": 5,
4050
- "nudgeForce": "strong",
4051
- "iterationNudgeThreshold": 15,
4052
- "protectTags": true
4053
- },
4054
- "turnProtection": {
4055
- "enabled": true,
4056
- "turns": 5
4057
- },
4058
- "experimental": {
4059
- "allowSubAgents": true
4060
- },
4061
- "strategies": {
4062
- "purgeErrors": {
4063
- "turns": 4
4064
- }
4065
- }
4066
- },
4067
- "brutal": {
4068
- "pruneNotification": "off",
4069
- "compress": {
4070
- "maxContextLimit": "20%",
4071
- "minContextLimit": "10%",
4072
- "nudgeFrequency": 1,
4073
- "nudgeForce": "strong",
4074
- "iterationNudgeThreshold": 1
4075
- },
4076
- "turnProtection": {
4077
- "enabled": false
4078
- },
4079
- "experimental": {
4080
- "allowSubAgents": false
4081
- },
4082
- "strategies": {
4083
- "purgeErrors": {
4084
- "turns": 1
4085
- }
4086
- }
4087
- }
4088
- },
3977
+ "default": {},
4089
3978
  "type": "object",
4090
3979
  "propertyNames": {
4091
3980
  "type": "string"
@@ -4650,6 +4539,66 @@
4650
4539
  }
4651
4540
  ]
4652
4541
  },
4542
+ "knowledge": {
4543
+ "type": "object",
4544
+ "properties": {
4545
+ "hubs": {
4546
+ "default": [],
4547
+ "type": "array",
4548
+ "items": {
4549
+ "type": "object",
4550
+ "properties": {
4551
+ "name": {
4552
+ "type": "string"
4553
+ },
4554
+ "path": {
4555
+ "type": "string"
4556
+ },
4557
+ "index": {
4558
+ "default": "_index.md",
4559
+ "type": "string"
4560
+ },
4561
+ "scope": {
4562
+ "default": "global",
4563
+ "type": "string",
4564
+ "enum": [
4565
+ "global",
4566
+ "project"
4567
+ ]
4568
+ },
4569
+ "mode": {
4570
+ "default": "router-only",
4571
+ "type": "string",
4572
+ "enum": [
4573
+ "router-only",
4574
+ "pinned"
4575
+ ]
4576
+ },
4577
+ "exclude": {
4578
+ "default": [],
4579
+ "type": "array",
4580
+ "items": {
4581
+ "type": "string"
4582
+ }
4583
+ }
4584
+ },
4585
+ "required": [
4586
+ "name",
4587
+ "path",
4588
+ "index",
4589
+ "scope",
4590
+ "mode",
4591
+ "exclude"
4592
+ ],
4593
+ "additionalProperties": false
4594
+ }
4595
+ }
4596
+ },
4597
+ "required": [
4598
+ "hubs"
4599
+ ],
4600
+ "additionalProperties": false
4601
+ },
4653
4602
  "matrix_loop": {
4654
4603
  "type": "object",
4655
4604
  "properties": {
@@ -4924,7 +4873,7 @@
4924
4873
  "type": "object",
4925
4874
  "properties": {
4926
4875
  "enabled": {
4927
- "default": false,
4876
+ "default": true,
4928
4877
  "type": "boolean"
4929
4878
  }
4930
4879
  },
@@ -5094,6 +5043,28 @@
5094
5043
  ],
5095
5044
  "additionalProperties": false
5096
5045
  },
5046
+ "tool_gating": {
5047
+ "type": "object",
5048
+ "properties": {
5049
+ "bdd_tools": {
5050
+ "type": "boolean"
5051
+ },
5052
+ "pdf_figures": {
5053
+ "type": "boolean"
5054
+ },
5055
+ "look_at": {
5056
+ "type": "boolean"
5057
+ },
5058
+ "preset_tools": {
5059
+ "default": false,
5060
+ "type": "boolean"
5061
+ }
5062
+ },
5063
+ "required": [
5064
+ "preset_tools"
5065
+ ],
5066
+ "additionalProperties": false
5067
+ },
5097
5068
  "security": {
5098
5069
  "type": "object",
5099
5070
  "properties": {
@@ -2,7 +2,6 @@ import { z } from "zod";
2
2
  export declare const McpNameSchema: z.ZodEnum<{
3
3
  websearch: "websearch";
4
4
  context7: "context7";
5
- white_rabbit: "white_rabbit";
6
5
  document_reader: "document_reader";
7
6
  }>;
8
7
  export type McpName = z.infer<typeof McpNameSchema>;
@@ -9,6 +9,7 @@ export declare function createCoreHooks(args: {
9
9
  inputSecretGuard: ReturnType<typeof import("../../hooks").createInputSecretGuardHook> | null;
10
10
  keywordDetector: ReturnType<typeof import("../../hooks").createKeywordDetectorHook> | null;
11
11
  contextInjectorMessagesTransform: ReturnType<typeof import("../../features/context-injector").createContextInjectorMessagesTransformHook>;
12
+ knowledgeHubInjector: ReturnType<typeof import("../../hooks").createKnowledgeHubInjectorHook> | null;
12
13
  envContextInjector: ReturnType<typeof import("../../hooks").createEnvContextInjectorHook> | null;
13
14
  thinkingBlockValidator: ReturnType<typeof import("../../hooks").createThinkingBlockValidatorHook> | null;
14
15
  toolPairValidator: ReturnType<typeof import("../../hooks").createToolPairValidatorHook> | null;
@@ -33,6 +34,9 @@ export declare function createCoreHooks(args: {
33
34
  qualityGate: ReturnType<typeof import("../../hooks").createQualityGateHook> | null;
34
35
  taskNotepad: ReturnType<typeof import("../../hooks").createTaskNotepadHook> | null;
35
36
  taskEditGuard: ReturnType<typeof import("../../hooks").createTaskEditGuardHook> | null;
37
+ documentReaderGuard: ReturnType<typeof import("../../hooks").createDocumentReaderGuardHook> | null;
38
+ knowledgeHubGuard: ReturnType<typeof import("../../hooks").createKnowledgeHubGuardHook> | null;
39
+ knowledgeHubSearchNudge: ReturnType<typeof import("../../hooks").createKnowledgeHubSearchNudgeHook> | null;
36
40
  evolutionWatcher: ReturnType<typeof import("../../hooks").createEvolutionWatcherHook> | null;
37
41
  contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
38
42
  preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
@@ -1,5 +1,5 @@
1
1
  import type { HookName, MatrixxConfig } from "../../config";
2
- import { createBackgroundTaskBlockerHook, createBashFileReadGuardHook, createCommentCheckerHooks, createContextModeEnforcerHook, createDirectoryAgentsInjectorHook, createEmptyTaskResponseDetectorHook, createEnvFileWriteGuardHook, createEvolutionWatcherHook, createHashlineEditDiffEnhancerHook, createHashlineReadEnhancerHook, createJsonErrorRecoveryHook, createQualityGateHook, createReadImageResizerHook, createRulesInjectorHook, createSecretLeakGuardHook, createTaskEditGuardHook, createTaskNotepadHook, createTasksTodowriteDisablerHook, createToolOutputTruncatorHook, createWebFetchRedirectGuardHook, createWriteExistingFileGuardHook } from "../../hooks";
2
+ import { createBackgroundTaskBlockerHook, createBashFileReadGuardHook, createCommentCheckerHooks, createContextModeEnforcerHook, createDirectoryAgentsInjectorHook, createDocumentReaderGuardHook, createEmptyTaskResponseDetectorHook, createEnvFileWriteGuardHook, createEvolutionWatcherHook, createHashlineEditDiffEnhancerHook, createHashlineReadEnhancerHook, createJsonErrorRecoveryHook, createKnowledgeHubGuardHook, createKnowledgeHubSearchNudgeHook, createQualityGateHook, createReadImageResizerHook, createRulesInjectorHook, createSecretLeakGuardHook, createTaskEditGuardHook, createTaskNotepadHook, createTasksTodowriteDisablerHook, createToolOutputTruncatorHook, createWebFetchRedirectGuardHook, createWriteExistingFileGuardHook } from "../../hooks";
3
3
  import type { PluginContext } from "../types";
4
4
  export type ToolGuardHooks = {
5
5
  backgroundTaskBlocker: ReturnType<typeof createBackgroundTaskBlockerHook> | null;
@@ -22,6 +22,9 @@ export type ToolGuardHooks = {
22
22
  qualityGate: ReturnType<typeof createQualityGateHook> | null;
23
23
  taskNotepad: ReturnType<typeof createTaskNotepadHook> | null;
24
24
  taskEditGuard: ReturnType<typeof createTaskEditGuardHook> | null;
25
+ documentReaderGuard: ReturnType<typeof createDocumentReaderGuardHook> | null;
26
+ knowledgeHubGuard: ReturnType<typeof createKnowledgeHubGuardHook> | null;
27
+ knowledgeHubSearchNudge: ReturnType<typeof createKnowledgeHubSearchNudgeHook> | null;
25
28
  evolutionWatcher: ReturnType<typeof createEvolutionWatcherHook> | null;
26
29
  };
27
30
  export declare function createToolGuardHooks(args: {
@@ -1,12 +1,13 @@
1
1
  import type { MatrixxConfig } from "../../config";
2
2
  import { createContextInjectorMessagesTransformHook } from "../../features/context-injector";
3
- import { createDesignIntentPreserverHook, createEnvContextInjectorHook, createKeywordDetectorHook, createThinkingBlockValidatorHook, createToolPairValidatorHook } from "../../hooks";
3
+ import { createDesignIntentPreserverHook, createEnvContextInjectorHook, createKeywordDetectorHook, createKnowledgeHubInjectorHook, createThinkingBlockValidatorHook, createToolPairValidatorHook } from "../../hooks";
4
4
  import { createInputSecretGuardHook } from "../../hooks/input-secret-guard";
5
5
  import type { PluginContext } from "../types";
6
6
  export type TransformHooks = {
7
7
  inputSecretGuard: ReturnType<typeof createInputSecretGuardHook> | null;
8
8
  keywordDetector: ReturnType<typeof createKeywordDetectorHook> | null;
9
9
  contextInjectorMessagesTransform: ReturnType<typeof createContextInjectorMessagesTransformHook>;
10
+ knowledgeHubInjector: ReturnType<typeof createKnowledgeHubInjectorHook> | null;
10
11
  envContextInjector: ReturnType<typeof createEnvContextInjectorHook> | null;
11
12
  thinkingBlockValidator: ReturnType<typeof createThinkingBlockValidatorHook> | null;
12
13
  toolPairValidator: ReturnType<typeof createToolPairValidatorHook> | null;
@@ -0,0 +1,33 @@
1
+ /** Directories never descended into during the bounded startup scan. */
2
+ export declare const TOOL_GATING_SKIP_DIRS: readonly string[];
3
+ /** Maximum directory depth visited by the startup scan. */
4
+ export declare const TOOL_GATING_MAX_DEPTH = 4;
5
+ /** Maximum filesystem entries visited before the scan gives up. */
6
+ export declare const TOOL_GATING_MAX_ENTRIES = 2000;
7
+ /** File extensions that trigger look_at registration (lowercase, with leading dot). */
8
+ export declare const LOOK_AT_MEDIA_EXTENSIONS: readonly string[];
9
+ /** File extension that triggers BDD tool registration. */
10
+ export declare const BDD_FILE_EXTENSION = ".feature";
11
+ /** File extension that triggers pdf_extract_figures registration. */
12
+ export declare const PDF_FILE_EXTENSION = ".pdf";
13
+ /**
14
+ * Bounded sync scan: true when a file with one of the given extensions exists
15
+ * under the directory. Skips ignored dirs, caps depth and entries, exits early
16
+ * on the first match. Never throws — returns false on any filesystem error.
17
+ */
18
+ export declare function directoryHasMatch(directory: string | undefined, extensions: readonly string[]): boolean;
19
+ /** True unless the construct agent is listed in disabled_agents (case-insensitive). */
20
+ export declare function isConstructAgentEnabled(disabledAgents: readonly string[] | undefined): boolean;
21
+ /** BDD tools: explicit override wins, otherwise auto iff a *.feature file is found. */
22
+ export declare function shouldEnableBddTools(directory: string | undefined, override: boolean | undefined): boolean;
23
+ /** pdf_extract_figures: explicit override wins, otherwise auto iff a *.pdf file is found. */
24
+ export declare function shouldEnablePdfFigures(directory: string | undefined, override: boolean | undefined): boolean;
25
+ /**
26
+ * look_at: explicit true forces registration (bypasses both gates), explicit
27
+ * false forces skip, otherwise requires construct enabled AND a media file.
28
+ */
29
+ export declare function shouldEnableLookAt(directory: string | undefined, constructEnabled: boolean, override: boolean | undefined): boolean;
30
+ /** knowledge_hub_confirm: register iff at least one knowledge hub is configured. */
31
+ export declare function shouldEnableKnowledgeHubConfirm(hubs: readonly unknown[] | undefined): boolean;
32
+ /** preset: opt-in only, default false. */
33
+ export declare function shouldEnablePresetTools(override: boolean | undefined): boolean;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * How DCP compression is available. "guided" = DCP auto-mode (nudges drive
3
+ * DCP's `compress` tool); "manual" = DCP manualMode (tool exists,
4
+ * trigger-only, no nudges); "none" = no `compress` tool exists.
5
+ */
6
+ export type DcpCompressionMode = "guided" | "manual" | "none";
7
+ export declare function _setDcpConfigPathForTesting(p: string | null | undefined): void;
8
+ export declare function _resetDcpGuidanceForTesting(): void;
9
+ /**
10
+ * How DCP compression is available in this environment.
11
+ * True model (DCP owns the only `compress` tool — the host has none):
12
+ * - "guided": DCP auto-mode — never bare without message IDs; proactive on closed sections with IDs + usage signals.
13
+ * - "manual": DCP manualMode — call `compress` only after the manual trigger; no nudges.
14
+ * - "none": no `compress` tool exists — never call it.
15
+ */
16
+ export declare function resolveDcpCompressionMode(): DcpCompressionMode;
@@ -1,5 +1,4 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- import type { DcpConfig } from "../../config/schema/dcp";
1
+ import type { DcpConfig } from "../config/schema/dcp";
3
2
  export interface DcpSwitchProfileOptions {
4
3
  pluginConfig?: {
5
4
  dcp?: DcpConfig;
@@ -12,4 +11,3 @@ export declare function deepMergeProfile(builtin: Record<string, unknown>, overr
12
11
  * a full inline DCP config to ~/.config/opencode/dcp.jsonc.
13
12
  */
14
13
  export declare function switchProfile(profile: string, options?: DcpSwitchProfileOptions): string;
15
- export declare function createDcpSwitchProfileTool(options?: DcpSwitchProfileOptions): Record<string, ToolDefinition>;
@@ -6,6 +6,7 @@ export * from "./config-errors";
6
6
  export * from "./connected-providers-cache";
7
7
  export * from "./context-mode-enforcement";
8
8
  export * from "./data-path";
9
+ export * from "./dcp-switch-profile";
9
10
  export * from "./deep-merge";
10
11
  export * from "./delay";
11
12
  export * from "./dynamic-truncator";
@@ -1,3 +1,4 @@
1
1
  export declare const BACKGROUND_OUTPUT_DESCRIPTION = "Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed.";
2
2
  export declare const BACKGROUND_CANCEL_DESCRIPTION = "Cancel running background task(s). Use all=true to cancel ALL before final answer.";
3
3
  export declare const BACKGROUND_REVIVE_DESCRIPTION = "Revive a retained terminal background task with a NEW instruction.\n\nCall with no arguments (or list=true) to DISCOVER revivable tasks.\n\nRevivable: cancelled, stopped, interrupt, error, completed \u2014 provided the task still has a session ID.\nNot revivable: pending/running (still active \u2014 use background_output), statusUncertain (unknown liveness \u2014 pass force=true to acknowledge), and tasks that never produced a session (e.g. queue-saturated).\n\nHandles are retained for 30 minutes, so revive works after a task was pruned or the plugin restarted.";
4
+ export declare const BACKGROUND_WAIT_ALL_DESCRIPTION = "Wait for ALL running/pending background tasks in the current session to complete. Polls until all tasks reach a terminal state or timeout. Use this BEFORE background_cancel(all=true) to allow exploration tasks to finish and return their results.";
@@ -0,0 +1,3 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import type { BackgroundManager } from "../../features/background-agent";
3
+ export declare function createBackgroundWaitAll(manager: BackgroundManager): ToolDefinition;
@@ -1,3 +1,3 @@
1
1
  export * from "./constants";
2
- export { createBackgroundCancel, createBackgroundOutput, createBackgroundRevive, } from "./tools";
2
+ export { createBackgroundCancel, createBackgroundOutput, createBackgroundRevive, createBackgroundWaitAll, } from "./tools";
3
3
  export type * from "./types";
@@ -2,3 +2,4 @@ export type { BackgroundCancelClient, BackgroundOutputClient, BackgroundOutputMa
2
2
  export { createBackgroundCancel } from "./create-background-cancel";
3
3
  export { createBackgroundOutput } from "./create-background-output";
4
4
  export { createBackgroundRevive } from "./create-background-revive";
5
+ export { createBackgroundWaitAll } from "./create-background-wait-all";
@@ -13,6 +13,9 @@ export interface BackgroundCancelArgs {
13
13
  taskId?: string;
14
14
  all?: boolean;
15
15
  }
16
+ export interface BackgroundWaitAllArgs {
17
+ timeout?: number;
18
+ }
16
19
  export interface BackgroundReviveArgs {
17
20
  taskId?: string;
18
21
  session_id?: string;
@@ -1,5 +1,11 @@
1
1
  import type { AvailableCategory, AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
2
2
  import type { CategoryConfig } from "../../config/schema";
3
+ export declare const TDD_TEST_FIRST_APPEND = "<TDD_Test_First>\n**NO IMPLEMENTATION WITHOUT A FAILING TEST FIRST.**\n\nMandatory RED-GREEN-REFACTOR cycle:\n- RED: write a failing test first; run it and confirm it fails for the right reason.\n- GREEN: write the minimum code to make the test pass.\n- REFACTOR: clean up; tests stay green throughout.\n\nEvery test uses //#given (setup), //#when (action), //#then (assert) markers.\nVerify with `bun test` (0 failures) before reporting done.\n</TDD_Test_First>";
4
+ /**
5
+ * Code-writing categories requiring TDD enforcement (issue #127).
6
+ * Single source of truth for banner gating + fail-closed guard.
7
+ */
8
+ export declare function isCodeWritingCategory(category: string | undefined): boolean;
3
9
  export declare const DEFAULT_CATEGORIES: Record<string, CategoryConfig>;
4
10
  export declare const CATEGORY_PROMPT_APPENDS: Record<string, string>;
5
11
  export declare const CATEGORY_DESCRIPTIONS: Record<string, string>;
@@ -2,5 +2,6 @@ import type { BuildSystemContentInput } from "./types";
2
2
  /**
3
3
  * Build the system content to inject into the agent prompt.
4
4
  * Combines skill content, category prompt append, and plan agent system prepend.
5
+ * Appends the TDD test-first banner LAST only for code-writing categories.
5
6
  */
6
7
  export declare function buildSystemContent(input: BuildSystemContentInput): string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -3,4 +3,10 @@ import type { DelegateTaskToolOptions } from "./types";
3
3
  export { resolveCategoryConfig } from "./categories";
4
4
  export { buildSystemContent } from "./prompt-builder";
5
5
  export type { BuildSystemContentInput, DelegateTaskToolOptions, SyncSessionCreatedEvent } from "./types";
6
+ /**
7
+ * Fail-closed TDD enforcement for code-writing delegations (issue #127).
8
+ * Returns a hard error string when the delegation must be rejected, else null.
9
+ * Complexity: 1 — single exception path (source without the skill).
10
+ */
11
+ export declare function requireTddEnforcerForCodeWriting(category: string | undefined, loadSkills: string[]): string | null;
6
12
  export declare function createDelegateTask(options: DelegateTaskToolOptions): ToolDefinition;
@@ -81,6 +81,7 @@ export interface BuildSystemContentInput {
81
81
  skillContent?: string;
82
82
  categoryPromptAppend?: string;
83
83
  agentName?: string;
84
+ category?: string;
84
85
  availableCategories?: AvailableCategory[];
85
86
  availableSkills?: AvailableSkill[];
86
87
  }
@@ -0,0 +1,7 @@
1
+ import type { GithubSearchResult } from "./types";
2
+ export declare function githubSearch(opts: {
3
+ query: string;
4
+ repo?: string;
5
+ language?: string;
6
+ limit?: number;
7
+ }): Promise<GithubSearchResult>;
@@ -0,0 +1,6 @@
1
+ export declare const DEFAULT_TIMEOUT_MS = 60000;
2
+ export declare const DEFAULT_MAX_OUTPUT_CHARS = 20000;
3
+ export declare const DEFAULT_LIMIT = 10;
4
+ export declare const MAX_LIMIT = 30;
5
+ export declare const CLONE_DEPTH = 1;
6
+ export declare const TMP_PREFIX = "matrixx-gh-";
@@ -0,0 +1 @@
1
+ export { createGithubSearchTools } from "./tools";
@@ -0,0 +1,2 @@
1
+ import type { GithubSearchResult } from "./types";
2
+ export declare function formatGithubSearchResult(result: GithubSearchResult): string;
@@ -0,0 +1,3 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
3
+ export declare function createGithubSearchTools(_ctx: PluginInput): Record<string, ToolDefinition>;
@@ -0,0 +1,20 @@
1
+ export interface GithubSearchHit {
2
+ repo: string;
3
+ path: string;
4
+ sha?: string;
5
+ line?: number;
6
+ text?: string;
7
+ url?: string;
8
+ }
9
+ export interface GithubSearchResult {
10
+ hits: GithubSearchHit[];
11
+ truncated: boolean;
12
+ mode: "code-search" | "clone-search";
13
+ error?: string;
14
+ }
15
+ export interface GithubSearchOptions {
16
+ query: string;
17
+ repo?: string;
18
+ language?: string;
19
+ limit?: number;
20
+ }
@@ -4,10 +4,12 @@ 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 { createGithubSearchTools } from "./github-search";
7
8
  export { createGlobTools } from "./glob";
8
9
  export { createGrepTools } from "./grep";
9
10
  export { createHandoffTools } from "./handoff";
10
11
  export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
12
+ export { createKnowledgeHubConfirmTool } from "./knowledge-hub-confirm";
11
13
  export { createPdfExtractFiguresTool } from "./pdf-extract-figures";
12
14
  export { createPlanCreateTool } from "./plan/plan-create";
13
15
  export { createPlanDeleteTool } from "./plan/plan-delete";
@@ -24,7 +26,6 @@ import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin";
24
26
  import type { BackgroundManager } from "../features/background-agent";
25
27
  type OpencodeClient = PluginInput["client"];
26
28
  export { createAssemblyTool } from "./assembly";
27
- export { createDcpSwitchProfileTool } from "./dcp-switch-profile";
28
29
  export { createDelegateTask } from "./delegate-task";
29
30
  export { createHashlineEditTool } from "./hashline-edit";
30
31
  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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-matrixx",
3
- "version": "2.6.9",
3
+ "version": "2.6.11",
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 +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,6 +0,0 @@
1
- export declare const white_rabbit: {
2
- type: "remote";
3
- url: string;
4
- enabled: boolean;
5
- oauth: false;
6
- };
@@ -1 +0,0 @@
1
- export { createDcpSwitchProfileTool } from "./tools";