opencode-matrixx 2.1.0 → 2.3.0

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 (280) hide show
  1. package/README.md +150 -43
  2. package/dist/agents/bdd-contract.d.ts +7 -0
  3. package/dist/agents/builtin-agents/architect-agent.d.ts +1 -0
  4. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  5. package/dist/agents/builtin-agents/{hephaestus-agent.d.ts → keymaker-agent.d.ts} +2 -0
  6. package/dist/agents/builtin-agents/model-resolution.d.ts +2 -1
  7. package/dist/agents/builtin-agents/morpheus-agent.d.ts +2 -0
  8. package/dist/agents/builtin-agents.d.ts +1 -1
  9. package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -1
  10. package/dist/agents/env-context.d.ts +1 -1
  11. package/dist/agents/index.d.ts +1 -1
  12. package/dist/agents/merovingian.d.ts +2 -2
  13. package/dist/agents/mouse/agent.d.ts +5 -2
  14. package/dist/agents/mouse/deepseek.d.ts +16 -0
  15. package/dist/agents/mouse/index.d.ts +3 -0
  16. package/dist/agents/mouse/mimo.d.ts +15 -0
  17. package/dist/agents/mouse/qwen.d.ts +16 -0
  18. package/dist/agents/mouse/shared.d.ts +7 -0
  19. package/dist/agents/types.d.ts +4 -1
  20. package/dist/config/index.d.ts +3 -4
  21. package/dist/config/presets.d.ts +4 -0
  22. package/dist/config/resolve-tiers.d.ts +32 -0
  23. package/dist/config/schema/agent-names.d.ts +9 -17
  24. package/dist/config/schema/agent-overrides.d.ts +133 -0
  25. package/dist/config/schema/assembly.d.ts +13 -0
  26. package/dist/config/schema/categories.d.ts +16 -1
  27. package/dist/config/schema/commands.d.ts +10 -0
  28. package/dist/config/schema/dcp.d.ts +16 -0
  29. package/dist/config/schema/hooks.d.ts +2 -1
  30. package/dist/config/schema/matrixx-config.d.ts +169 -19
  31. package/dist/config/schema/security.d.ts +0 -5
  32. package/dist/config/schema.d.ts +4 -1
  33. package/dist/create-hooks.d.ts +2 -0
  34. package/dist/features/assembly-state/index.d.ts +1 -0
  35. package/dist/features/assembly-state/manager.d.ts +6 -0
  36. package/dist/features/background-agent/error-helpers.d.ts +6 -0
  37. package/dist/features/background-agent/manager.d.ts +6 -8
  38. package/dist/features/background-agent/message-dir.d.ts +5 -0
  39. package/dist/features/background-agent/notification-builder.d.ts +17 -0
  40. package/dist/features/bdd/schema.d.ts +434 -0
  41. package/dist/features/bdd/types.d.ts +2 -0
  42. package/dist/features/builtin-commands/templates/assembly.d.ts +1 -0
  43. package/dist/features/builtin-commands/templates/bdd-backend.d.ts +1 -0
  44. package/dist/features/builtin-commands/templates/bdd-contract.d.ts +1 -0
  45. package/dist/features/builtin-commands/templates/bdd-frontend.d.ts +1 -0
  46. package/dist/features/builtin-commands/templates/bdd-pipeline.d.ts +1 -0
  47. package/dist/features/builtin-commands/templates/bdd-tests.d.ts +1 -0
  48. package/dist/features/builtin-commands/templates/dcp-profile.d.ts +1 -0
  49. package/dist/features/builtin-commands/templates/research.d.ts +1 -0
  50. package/dist/features/builtin-commands/templates/ultrawork.d.ts +1 -0
  51. package/dist/features/builtin-commands/types.d.ts +2 -2
  52. package/dist/features/builtin-skills/lazy-skill-helper.d.ts +17 -0
  53. package/dist/features/builtin-skills/skills/bdd-backend.d.ts +3 -0
  54. package/dist/features/builtin-skills/skills/bdd-contract.d.ts +3 -0
  55. package/dist/features/builtin-skills/skills/bdd-frontend.d.ts +3 -0
  56. package/dist/features/builtin-skills/skills/bdd-tests.d.ts +3 -0
  57. package/dist/features/builtin-skills/skills/docker-master.d.ts +2 -0
  58. package/dist/features/builtin-skills/skills/index.d.ts +7 -0
  59. package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +2 -0
  60. package/dist/features/builtin-skills/skills/ulw-research.d.ts +2 -0
  61. package/dist/features/command-loader/loader.d.ts +3 -0
  62. package/dist/features/hook-message-injector/injector.d.ts +1 -2
  63. package/dist/features/mission-state/constants.d.ts +10 -0
  64. package/dist/features/mission-state/index.d.ts +2 -0
  65. package/dist/features/mission-state/plan-storage.d.ts +48 -0
  66. package/dist/features/mission-state/rehydrate.d.ts +21 -0
  67. package/dist/features/mission-state/types.d.ts +46 -0
  68. package/dist/features/opencode-skill-loader/loader.d.ts +1 -3
  69. package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +1 -1
  70. package/dist/features/opencode-skill-loader/types.d.ts +1 -1
  71. package/dist/features/skill-mcp-manager/connection-type.d.ts +2 -3
  72. package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
  73. package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
  74. package/dist/features/skill-mcp-manager/oauth-handler.d.ts +3 -3
  75. package/dist/features/skill-mcp-manager/types.d.ts +16 -4
  76. package/dist/features/tmux-subagent/index.d.ts +0 -2
  77. package/dist/features/ultrawork-state/index.d.ts +1 -0
  78. package/dist/features/ultrawork-state/manager.d.ts +6 -0
  79. package/dist/hooks/auto-update-checker/cache.d.ts +0 -2
  80. package/dist/hooks/auto-update-checker/index.d.ts +1 -1
  81. package/dist/hooks/env-context-injector/index.d.ts +23 -0
  82. package/dist/hooks/index.d.ts +2 -0
  83. package/dist/hooks/interactive-bash-session/parser.d.ts +0 -6
  84. package/dist/hooks/plan-persister/hook.d.ts +20 -0
  85. package/dist/hooks/plan-persister/index.d.ts +2 -0
  86. package/dist/index.js +44832 -26999
  87. package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
  88. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  89. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
  90. package/dist/plugin-config.d.ts +1 -1
  91. package/dist/plugin-handlers/agent-config-handler.d.ts +2 -0
  92. package/dist/plugin-handlers/plugin-components-loader.d.ts +1 -1
  93. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
  94. package/dist/shared/index.d.ts +2 -1
  95. package/dist/shared/merge-categories.d.ts +4 -0
  96. package/dist/shared/model-resolution-pipeline.d.ts +1 -24
  97. package/dist/shared/model-resolution-types.d.ts +4 -0
  98. package/dist/shared/model-resolver.d.ts +4 -2
  99. package/dist/shared/model-tiers.d.ts +31 -0
  100. package/dist/shared/opencode-config-dir.d.ts +1 -2
  101. package/dist/shared/session-directory-resolver.d.ts +0 -6
  102. package/dist/shared/tier-resolver.d.ts +26 -0
  103. package/dist/shared/tool-guards.d.ts +16 -0
  104. package/dist/tools/assembly/assembly-executor.d.ts +17 -0
  105. package/dist/tools/assembly/constants.d.ts +6 -0
  106. package/dist/tools/assembly/index.d.ts +2 -0
  107. package/dist/tools/assembly/provider-selector.d.ts +3 -0
  108. package/dist/tools/assembly/synthesizer.d.ts +3 -0
  109. package/dist/tools/assembly/tool-description.d.ts +2 -0
  110. package/dist/tools/assembly/tools.d.ts +10 -0
  111. package/dist/tools/assembly/types.d.ts +25 -0
  112. package/dist/tools/assembly/voter-spawner.d.ts +3 -0
  113. package/dist/tools/bdd-create-contract/constants.d.ts +1 -0
  114. package/dist/tools/bdd-create-contract/index.d.ts +3 -0
  115. package/dist/tools/bdd-create-contract/tools.d.ts +3 -0
  116. package/dist/tools/bdd-create-contract/types.d.ts +12 -0
  117. package/dist/tools/bdd-parse-gherkin/constants.d.ts +1 -0
  118. package/dist/tools/bdd-parse-gherkin/index.d.ts +3 -0
  119. package/dist/tools/bdd-parse-gherkin/tools.d.ts +5 -0
  120. package/dist/tools/bdd-parse-gherkin/types.d.ts +9 -0
  121. package/dist/tools/bdd-pipeline/analysis-report-sections.d.ts +10 -0
  122. package/dist/tools/bdd-pipeline/analysis-report.d.ts +9 -0
  123. package/dist/tools/bdd-pipeline/constants.d.ts +4 -0
  124. package/dist/tools/bdd-pipeline/feature-resolver.d.ts +5 -0
  125. package/dist/{features/run-continuation-state → tools/bdd-pipeline}/index.d.ts +1 -1
  126. package/dist/tools/bdd-pipeline/pipeline-runner.d.ts +6 -0
  127. package/dist/tools/bdd-pipeline/subagent-runner.d.ts +14 -0
  128. package/dist/tools/bdd-pipeline/tools.d.ts +5 -0
  129. package/dist/tools/bdd-pipeline/types.d.ts +74 -0
  130. package/dist/tools/bdd-validate-contract/index.d.ts +1 -0
  131. package/dist/tools/bdd-validate-contract/tools.d.ts +21 -0
  132. package/dist/tools/delegate-task/categories.d.ts +7 -0
  133. package/dist/tools/delegate-task/category-resolver.d.ts +6 -0
  134. package/dist/tools/delegate-task/complexity-constants.d.ts +24 -0
  135. package/dist/tools/delegate-task/complexity-scorer.d.ts +31 -0
  136. package/dist/tools/delegate-task/complexity-types.d.ts +10 -0
  137. package/dist/tools/delegate-task/executor-types.d.ts +1 -0
  138. package/dist/tools/delegate-task/index.d.ts +3 -0
  139. package/dist/tools/delegate-task/types.d.ts +8 -0
  140. package/dist/tools/handoff/constants.d.ts +0 -3
  141. package/dist/tools/index.d.ts +5 -0
  142. package/dist/tools/task/todo-sync.d.ts +1 -1
  143. package/package.json +22 -32
  144. package/bin/matrixx.js +0 -80
  145. package/bin/platform.js +0 -38
  146. package/bin/platform.test.ts +0 -148
  147. package/dist/agents/builtin-agents/environment-context.d.ts +0 -2
  148. package/dist/cli/cli-installer.d.ts +0 -2
  149. package/dist/cli/cli-program.d.ts +0 -1
  150. package/dist/cli/config-manager/add-plugin-to-opencode-config.d.ts +0 -2
  151. package/dist/cli/config-manager/add-provider-config.d.ts +0 -2
  152. package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +0 -122
  153. package/dist/cli/config-manager/auth-plugins.d.ts +0 -3
  154. package/dist/cli/config-manager/bun-install.d.ts +0 -7
  155. package/dist/cli/config-manager/config-context.d.ts +0 -13
  156. package/dist/cli/config-manager/deep-merge-record.d.ts +0 -1
  157. package/dist/cli/config-manager/detect-current-config.d.ts +0 -2
  158. package/dist/cli/config-manager/ensure-config-directory-exists.d.ts +0 -1
  159. package/dist/cli/config-manager/format-error-with-suggestion.d.ts +0 -1
  160. package/dist/cli/config-manager/generate-matrixx-config.d.ts +0 -2
  161. package/dist/cli/config-manager/jsonc-provider-editor.d.ts +0 -1
  162. package/dist/cli/config-manager/npm-dist-tags.d.ts +0 -7
  163. package/dist/cli/config-manager/opencode-binary.d.ts +0 -2
  164. package/dist/cli/config-manager/opencode-config-format.d.ts +0 -6
  165. package/dist/cli/config-manager/parse-opencode-config-file.d.ts +0 -10
  166. package/dist/cli/config-manager/plugin-name-with-version.d.ts +0 -1
  167. package/dist/cli/config-manager/write-matrixx-config.d.ts +0 -2
  168. package/dist/cli/config-manager.d.ts +0 -14
  169. package/dist/cli/doctor/checks/config.d.ts +0 -2
  170. package/dist/cli/doctor/checks/dependencies.d.ts +0 -4
  171. package/dist/cli/doctor/checks/index.d.ts +0 -7
  172. package/dist/cli/doctor/checks/model-resolution-cache.d.ts +0 -2
  173. package/dist/cli/doctor/checks/model-resolution-config.d.ts +0 -2
  174. package/dist/cli/doctor/checks/model-resolution-details.d.ts +0 -6
  175. package/dist/cli/doctor/checks/model-resolution-effective-model.d.ts +0 -3
  176. package/dist/cli/doctor/checks/model-resolution-types.d.ts +0 -37
  177. package/dist/cli/doctor/checks/model-resolution-variant.d.ts +0 -5
  178. package/dist/cli/doctor/checks/model-resolution.d.ts +0 -6
  179. package/dist/cli/doctor/checks/system-binary.d.ts +0 -8
  180. package/dist/cli/doctor/checks/system-loaded-version.d.ts +0 -10
  181. package/dist/cli/doctor/checks/system-plugin.d.ts +0 -15
  182. package/dist/cli/doctor/checks/system.d.ts +0 -3
  183. package/dist/cli/doctor/checks/tools-gh.d.ts +0 -11
  184. package/dist/cli/doctor/checks/tools-lsp.d.ts +0 -6
  185. package/dist/cli/doctor/checks/tools-mcp.d.ts +0 -3
  186. package/dist/cli/doctor/checks/tools.d.ts +0 -3
  187. package/dist/cli/doctor/constants.d.ts +0 -31
  188. package/dist/cli/doctor/format-default.d.ts +0 -2
  189. package/dist/cli/doctor/format-shared.d.ts +0 -6
  190. package/dist/cli/doctor/format-status.d.ts +0 -2
  191. package/dist/cli/doctor/format-verbose.d.ts +0 -2
  192. package/dist/cli/doctor/formatter.d.ts +0 -3
  193. package/dist/cli/doctor/index.d.ts +0 -5
  194. package/dist/cli/doctor/runner.d.ts +0 -5
  195. package/dist/cli/doctor/types.d.ts +0 -96
  196. package/dist/cli/fallback-chain-resolution.d.ts +0 -10
  197. package/dist/cli/get-local-version/formatter.d.ts +0 -3
  198. package/dist/cli/get-local-version/get-local-version.d.ts +0 -2
  199. package/dist/cli/get-local-version/index.d.ts +0 -2
  200. package/dist/cli/get-local-version/types.d.ts +0 -13
  201. package/dist/cli/index.d.ts +0 -2
  202. package/dist/cli/index.js +0 -30691
  203. package/dist/cli/install-validators.d.ts +0 -31
  204. package/dist/cli/install.d.ts +0 -2
  205. package/dist/cli/mcp-oauth/index.d.ts +0 -6
  206. package/dist/cli/mcp-oauth/login.d.ts +0 -7
  207. package/dist/cli/mcp-oauth/logout.d.ts +0 -5
  208. package/dist/cli/mcp-oauth/status.d.ts +0 -1
  209. package/dist/cli/model-fallback-types.d.ts +0 -25
  210. package/dist/cli/model-fallback.d.ts +0 -4
  211. package/dist/cli/provider-availability.d.ts +0 -4
  212. package/dist/cli/provider-model-id-transform.d.ts +0 -1
  213. package/dist/cli/run/agent-resolver.d.ts +0 -5
  214. package/dist/cli/run/completion.d.ts +0 -2
  215. package/dist/cli/run/event-formatting.d.ts +0 -3
  216. package/dist/cli/run/event-handlers.d.ts +0 -10
  217. package/dist/cli/run/event-state.d.ts +0 -13
  218. package/dist/cli/run/event-stream-processor.d.ts +0 -3
  219. package/dist/cli/run/events.d.ts +0 -4
  220. package/dist/cli/run/index.d.ts +0 -9
  221. package/dist/cli/run/json-output.d.ts +0 -12
  222. package/dist/cli/run/on-complete-hook.d.ts +0 -7
  223. package/dist/cli/run/opencode-bin-path.d.ts +0 -3
  224. package/dist/cli/run/opencode-binary-resolver.d.ts +0 -4
  225. package/dist/cli/run/poll-for-completion.d.ts +0 -9
  226. package/dist/cli/run/runner.d.ts +0 -5
  227. package/dist/cli/run/server-connection.d.ts +0 -6
  228. package/dist/cli/run/session-resolver.d.ts +0 -6
  229. package/dist/cli/run/types.d.ts +0 -119
  230. package/dist/cli/tui-install-prompts.d.ts +0 -2
  231. package/dist/cli/tui-installer.d.ts +0 -2
  232. package/dist/cli/types.d.ts +0 -36
  233. package/dist/config/profiles.d.ts +0 -4
  234. package/dist/config/schema/claude-code.d.ts +0 -10
  235. package/dist/features/background-agent/background-task-notification-template.d.ts +0 -11
  236. package/dist/features/background-agent/opencode-client.d.ts +0 -2
  237. package/dist/features/background-agent/task-poller.d.ts +0 -21
  238. package/dist/features/claude-code-command-loader/loader.d.ts +0 -6
  239. package/dist/features/claude-code-mcp-loader/index.d.ts +0 -10
  240. package/dist/features/claude-code-mcp-loader/loader.d.ts +0 -3
  241. package/dist/features/claude-code-mcp-loader/transformer.d.ts +0 -2
  242. package/dist/features/claude-code-mcp-loader/types.d.ts +0 -39
  243. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -3
  244. package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -3
  245. package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -2
  246. package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -2
  247. package/dist/features/claude-code-plugin-loader/index.d.ts +0 -10
  248. package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -20
  249. package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -3
  250. package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
  251. package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -3
  252. package/dist/features/claude-code-plugin-loader/types.d.ts +0 -187
  253. package/dist/features/claude-tasks/index.d.ts +0 -3
  254. package/dist/features/claude-tasks/session-storage.d.ts +0 -10
  255. package/dist/features/mcp-oauth/index.d.ts +0 -3
  256. package/dist/features/mcp-oauth/schema.d.ts +0 -5
  257. package/dist/features/run-continuation-state/constants.d.ts +0 -1
  258. package/dist/features/run-continuation-state/storage.d.ts +0 -6
  259. package/dist/features/run-continuation-state/types.d.ts +0 -13
  260. package/dist/features/tmux-subagent/cleanup.d.ts +0 -1
  261. package/dist/features/tmux-subagent/polling.d.ts +0 -1
  262. package/dist/hooks/session-recovery/recover-empty-content-message-sdk.d.ts +0 -13
  263. package/dist/hooks/task-reminder/hook.d.ts +0 -19
  264. package/dist/hooks/task-reminder/index.d.ts +0 -1
  265. package/dist/shared/claude-config-dir.d.ts +0 -1
  266. package/dist/tools/delegate-agent/background-agent-executor.d.ts +0 -5
  267. package/dist/tools/delegate-agent/message-storage-directory.d.ts +0 -1
  268. package/dist/tools/delegate-agent/subagent-session-creator.d.ts +0 -10
  269. package/dist/tools/delegate-agent/tool-context-with-metadata.d.ts +0 -10
  270. package/postinstall.mjs +0 -43
  271. /package/dist/features/{claude-code-agent-loader → agent-loader}/index.d.ts +0 -0
  272. /package/dist/features/{claude-code-agent-loader → agent-loader}/loader.d.ts +0 -0
  273. /package/dist/features/{claude-code-agent-loader → agent-loader}/types.d.ts +0 -0
  274. /package/dist/features/{claude-code-command-loader → command-loader}/index.d.ts +0 -0
  275. /package/dist/features/{claude-code-command-loader → command-loader}/types.d.ts +0 -0
  276. /package/dist/features/{claude-code-session-state → session-state}/index.d.ts +0 -0
  277. /package/dist/features/{claude-code-session-state → session-state}/state.d.ts +0 -0
  278. /package/dist/features/{claude-code-mcp-loader → skill-mcp-manager}/env-expander.d.ts +0 -0
  279. /package/dist/features/{claude-tasks → task-storage}/storage.d.ts +0 -0
  280. /package/dist/features/{claude-tasks → task-storage}/types.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { HookName, MatrixxConfig } from "../../config";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
- import { createArchitectHook, createBackgroundNotificationHook, createCompactionContextInjector, createCompactionTodoPreserverHook, createStopContinuationGuardHook, createTodoContinuationEnforcer } from "../../hooks";
3
+ import { createArchitectHook, createBackgroundNotificationHook, createCompactionContextInjector, createCompactionTodoPreserverHook, createPlanPersister, createStopContinuationGuardHook, createTodoContinuationEnforcer } from "../../hooks";
4
4
  import type { PluginContext } from "../types";
5
5
  import { createUnstableAgentBabysitter } from "../unstable-agent-babysitter";
6
6
  export type ContinuationHooks = {
@@ -11,6 +11,7 @@ export type ContinuationHooks = {
11
11
  unstableAgentBabysitter: ReturnType<typeof createUnstableAgentBabysitter> | null;
12
12
  backgroundNotificationHook: ReturnType<typeof createBackgroundNotificationHook> | null;
13
13
  architectHook: ReturnType<typeof createArchitectHook> | null;
14
+ planPersister: ReturnType<typeof createPlanPersister> | null;
14
15
  };
15
16
  type SessionRecovery = {
16
17
  setOnAbortCallback: (callback: (sessionID: string) => void) => void;
@@ -8,6 +8,7 @@ export declare function createCoreHooks(args: {
8
8
  }): {
9
9
  keywordDetector: ReturnType<typeof import("../../hooks").createKeywordDetectorHook> | null;
10
10
  contextInjectorMessagesTransform: ReturnType<typeof import("../../features/context-injector").createContextInjectorMessagesTransformHook>;
11
+ envContextInjector: ReturnType<typeof import("../../hooks").createEnvContextInjectorHook> | null;
11
12
  thinkingBlockValidator: ReturnType<typeof import("../../hooks").createThinkingBlockValidatorHook> | null;
12
13
  toolPairValidator: ReturnType<typeof import("../../hooks").createToolPairValidatorHook> | null;
13
14
  designIntentPreserver: ReturnType<typeof import("../../hooks").createDesignIntentPreserverHook> | null;
@@ -1,10 +1,11 @@
1
1
  import type { MatrixxConfig } from "../../config";
2
2
  import { createContextInjectorMessagesTransformHook } from "../../features/context-injector";
3
- import { createDesignIntentPreserverHook, createKeywordDetectorHook, createThinkingBlockValidatorHook, createToolPairValidatorHook } from "../../hooks";
3
+ import { createDesignIntentPreserverHook, createEnvContextInjectorHook, createKeywordDetectorHook, createThinkingBlockValidatorHook, createToolPairValidatorHook } from "../../hooks";
4
4
  import type { PluginContext } from "../types";
5
5
  export type TransformHooks = {
6
6
  keywordDetector: ReturnType<typeof createKeywordDetectorHook> | null;
7
7
  contextInjectorMessagesTransform: ReturnType<typeof createContextInjectorMessagesTransformHook>;
8
+ envContextInjector: ReturnType<typeof createEnvContextInjectorHook> | null;
8
9
  thinkingBlockValidator: ReturnType<typeof createThinkingBlockValidatorHook> | null;
9
10
  toolPairValidator: ReturnType<typeof createToolPairValidatorHook> | null;
10
11
  designIntentPreserver: ReturnType<typeof createDesignIntentPreserverHook> | null;
@@ -24,5 +24,5 @@ export declare function getDisabledSets(config: MatrixxConfig): DisabledSets;
24
24
  */
25
25
  export declare function _resetDisabledSetsCacheForTesting(): void;
26
26
  export declare function mergeConfigs(base: MatrixxConfig, override: MatrixxConfig): MatrixxConfig;
27
- export declare function loadPluginConfig(directory: string, ctx: unknown): MatrixxConfig;
27
+ export declare function loadPluginConfig(directory: string, ctx: unknown): Promise<MatrixxConfig>;
28
28
  export {};
@@ -1,5 +1,7 @@
1
1
  import type { MatrixxConfig } from "../config";
2
2
  import type { PluginComponents } from "./plugin-components-loader";
3
+ export declare function setAvailableToolNames(names: string[]): void;
4
+ export declare function getAvailableToolNames(): string[];
3
5
  export declare function applyAgentConfig(params: {
4
6
  config: Record<string, unknown>;
5
7
  pluginConfig: MatrixxConfig;
@@ -17,6 +17,6 @@ export type PluginComponents = {
17
17
  error: string;
18
18
  }>;
19
19
  };
20
- export declare function loadPluginComponents(params: {
20
+ export declare function loadPluginComponents(_params: {
21
21
  pluginConfig: MatrixxConfig;
22
22
  }): Promise<PluginComponents>;
@@ -19,5 +19,6 @@ export declare function buildOracleAgentConfig(params: {
19
19
  pluginOracleOverride: OracleOverride | undefined;
20
20
  userCategories: Record<string, CategoryConfig> | undefined;
21
21
  currentModel: string | undefined;
22
+ globalOverrideModel?: string;
22
23
  }): Promise<Record<string, unknown>>;
23
24
  export {};
@@ -1,7 +1,7 @@
1
1
  export * from "./agent-tool-restrictions";
2
2
  export * from "./agent-variant";
3
3
  export * from "./binary-downloader";
4
- export * from "./claude-config-dir";
4
+ export * from "./code-patterns";
5
5
  export * from "./code-patterns";
6
6
  export * from "./command-executor";
7
7
  export * from "./config-errors";
@@ -45,6 +45,7 @@ export * from "./shell-env";
45
45
  export * from "./system-directive";
46
46
  export * from "./tmux";
47
47
  export * from "./token-cache";
48
+ export * from "./tool-guards";
48
49
  export * from "./transcript-path";
49
50
  export * from "./truncate-description";
50
51
  export * from "./zip-extractor";
@@ -2,5 +2,9 @@ import type { CategoriesConfig, CategoryConfig } from "../config/schema";
2
2
  /**
3
3
  * Merge default and user categories, filtering out disabled ones.
4
4
  * Single source of truth for category merging across the codebase.
5
+ *
6
+ * The built-in `DEFAULT_CATEGORIES` registry is now tier-based. Before
7
+ * returning, the tier fields are resolved against the live provider cache
8
+ * (or the static fallback) so callers always see concrete `model:` strings.
5
9
  */
6
10
  export declare function mergeCategories(userCategories?: CategoriesConfig): Record<string, CategoryConfig>;
@@ -1,25 +1,2 @@
1
- import type { FallbackEntry } from "./model-requirements";
2
- export type ModelResolutionRequest = {
3
- intent?: {
4
- uiSelectedModel?: string;
5
- userModel?: string;
6
- categoryDefaultModel?: string;
7
- };
8
- constraints: {
9
- availableModels: Set<string>;
10
- connectedProviders?: string[] | null;
11
- };
12
- policy?: {
13
- fallbackChain?: FallbackEntry[];
14
- systemDefaultModel?: string;
15
- };
16
- };
17
- export type ModelResolutionProvenance = "override" | "category-default" | "provider-fallback" | "system-default";
18
- export type ModelResolutionResult = {
19
- model: string;
20
- provenance: ModelResolutionProvenance;
21
- variant?: string;
22
- attempted?: string[];
23
- reason?: string;
24
- };
1
+ import type { ModelResolutionRequest, ModelResolutionResult } from "./model-resolution-types";
25
2
  export declare function resolveModelPipeline(request: ModelResolutionRequest): ModelResolutionResult | undefined;
@@ -1,12 +1,16 @@
1
1
  import type { FallbackEntry } from "./model-requirements";
2
2
  export type ModelResolutionRequest = {
3
3
  intent?: {
4
+ /** Global override for all agents and categories — set via the global_model config.
5
+ * Highest priority; checked before everything else. */
6
+ globalOverrideModel?: string;
4
7
  uiSelectedModel?: string;
5
8
  userModel?: string;
6
9
  categoryDefaultModel?: string;
7
10
  };
8
11
  constraints: {
9
12
  availableModels: Set<string>;
13
+ connectedProviders?: string[];
10
14
  };
11
15
  policy?: {
12
16
  fallbackChain?: FallbackEntry[];
@@ -1,13 +1,15 @@
1
1
  import type { FallbackEntry } from "./model-requirements";
2
+ import type { ModelResolutionProvenance } from "./model-resolution-types";
2
3
  export type ModelResolutionInput = {
3
4
  userModel?: string;
4
5
  inheritedModel?: string;
5
6
  systemDefault?: string;
6
7
  };
7
- export type ModelSource = "override" | "category-default" | "provider-fallback" | "system-default";
8
+ /** @deprecated Use ModelResolutionProvenance from model-resolution-types.ts */
9
+ export type ModelSource = ModelResolutionProvenance;
8
10
  export type ModelResolutionResult = {
9
11
  model: string;
10
- source: ModelSource;
12
+ source: ModelResolutionProvenance;
11
13
  variant?: string;
12
14
  };
13
15
  export type ExtendedModelResolutionInput = {
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Tier registry — abstract model classifications resolved against the live provider list.
3
+ *
4
+ * Tiers are matched by regex against "provider/model" strings, with a `providerPriority`
5
+ * list to choose between providers when multiple match. A `staticFallback` is used at
6
+ * first run when the live provider list is not yet available.
7
+ *
8
+ * Adding a new model does NOT require code changes — the regex patterns intentionally
9
+ * match model families (e.g. `claude-opus`) so a new opus-4-7 model is picked up
10
+ * automatically.
11
+ */
12
+ export type TierName = "free" | "fast" | "standard" | "premium" | "frontier";
13
+ export interface TierSpec {
14
+ name: TierName;
15
+ /** Provider priority — first provider with a matching model wins. */
16
+ providerPriority: string[];
17
+ /** Regex tested against each "provider/model" string in the live provider list. */
18
+ modelPattern: RegExp;
19
+ /** Tier to recurse into if this tier cannot be satisfied. */
20
+ fallbackTier?: TierName;
21
+ /** Static fallbacks used at first run when the live provider list is empty
22
+ * but the connected providers cache already lists which providers are reachable. */
23
+ staticFallback: {
24
+ providers: string[];
25
+ model: string;
26
+ variant?: string;
27
+ }[];
28
+ }
29
+ export declare const TIER_SPECS: Record<TierName, TierSpec>;
30
+ export declare const TIER_NAMES: TierName[];
31
+ export declare function parseTierReference(value: string | undefined | null): TierName | null;
@@ -1,8 +1,7 @@
1
- import type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths } from "./opencode-config-dir-types";
1
+ import type { OpenCodeConfigDirOptions, OpenCodeConfigPaths } from "./opencode-config-dir-types";
2
2
  export type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths, } from "./opencode-config-dir-types";
3
3
  export declare const TAURI_APP_IDENTIFIER = "ai.opencode.desktop";
4
4
  export declare const TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
5
5
  export declare function isDevBuild(version: string | null | undefined): boolean;
6
6
  export declare function getOpenCodeConfigDir(options: OpenCodeConfigDirOptions): string;
7
7
  export declare function getOpenCodeConfigPaths(options: OpenCodeConfigDirOptions): OpenCodeConfigPaths;
8
- export declare function detectExistingConfigDir(binary: OpenCodeBinaryType, version?: string | null): string | null;
@@ -1,7 +1 @@
1
1
  export declare function isWindowsAppDataDirectory(directory: string): boolean;
2
- export declare function resolveSessionDirectory(options: {
3
- parentDirectory: string | null | undefined;
4
- fallbackDirectory: string;
5
- platform?: NodeJS.Platform;
6
- currentWorkingDirectory?: string;
7
- }): string;
@@ -0,0 +1,26 @@
1
+ import { parseTierReference, type TierName } from "./model-tiers";
2
+ export interface TierResolverContext {
3
+ availableModels: Set<string>;
4
+ connectedProviders: string[] | null;
5
+ }
6
+ export type TierProvenance = "tier-resolved" | "tier-static-fallback";
7
+ export interface TierResolutionResult {
8
+ model: string;
9
+ provenance: TierProvenance;
10
+ tier: TierName;
11
+ }
12
+ /**
13
+ * Resolve a tier alias to a concrete "provider/model" string.
14
+ *
15
+ * Strategy:
16
+ * 1. Live resolution: walk `providerPriority`, test `modelPattern` against
17
+ * each `provider/model` in the available set.
18
+ * 2. Static fallback: pick the first static fallback whose provider is
19
+ * connected (used at first run when the live cache is cold).
20
+ * 3. Recurse into `fallbackTier` if defined.
21
+ *
22
+ * Returns null when no match is possible (no live models, no static fallback
23
+ * available, no fallback tier).
24
+ */
25
+ export declare function resolveTier(tier: TierName, ctx: TierResolverContext): TierResolutionResult | null;
26
+ export { parseTierReference };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared tool name guard functions.
3
+ * Used by multiple hooks to check tool types (read/write).
4
+ */
5
+ /**
6
+ * Check if a tool name represents a read operation.
7
+ * @param toolName - The tool name to check (case-insensitive)
8
+ * @returns true if the tool is a read tool
9
+ */
10
+ export declare function isReadTool(toolName: string): boolean;
11
+ /**
12
+ * Check if a tool name represents a write operation.
13
+ * @param toolName - The tool name to check (case-insensitive)
14
+ * @returns true if the tool is a write tool
15
+ */
16
+ export declare function isWriteTool(toolName: string): boolean;
@@ -0,0 +1,17 @@
1
+ import type { AssemblyConfig } from "../../config/schema/assembly";
2
+ import type { BackgroundManager } from "../../features/background-agent/manager";
3
+ import type { AssemblyArgs, SynthesisResult, VoterResult } from "./types";
4
+ export interface AssemblyExecutorInput {
5
+ manager: BackgroundManager;
6
+ args: AssemblyArgs;
7
+ config: AssemblyConfig | undefined;
8
+ sessionID: string;
9
+ messageID: string;
10
+ }
11
+ export interface AssemblyOutput {
12
+ question: string;
13
+ voters: VoterResult[];
14
+ rounds: SynthesisResult[];
15
+ finalConsensus: string;
16
+ }
17
+ export declare function executeAssembly(input: AssemblyExecutorInput): Promise<AssemblyOutput>;
@@ -0,0 +1,6 @@
1
+ import type { ProviderModel } from "./types";
2
+ export declare const DEFAULT_VOTERS = 3;
3
+ export declare const DEFAULT_ROUNDS = 2;
4
+ export declare const VOTER_TIMEOUT_MS = 120000;
5
+ export declare const POLL_INTERVAL_MS = 1000;
6
+ export declare const DEFAULT_PROVIDERS: ProviderModel[];
@@ -0,0 +1,2 @@
1
+ export type { AssemblyToolOptions } from "./tools";
2
+ export { createAssemblyTool } from "./tools";
@@ -0,0 +1,3 @@
1
+ import type { AssemblyConfig } from "../../config/schema/assembly";
2
+ import type { ProviderModel } from "./types";
3
+ export declare function selectProviders(count: number, modelsOverride: string[] | undefined, config: AssemblyConfig | undefined): ProviderModel[];
@@ -0,0 +1,3 @@
1
+ import type { BackgroundManager } from "../../features/background-agent/manager";
2
+ import type { SynthesisResult, VoterResult } from "./types";
3
+ export declare function synthesizeResults(manager: BackgroundManager, question: string, voterResults: VoterResult[], round: number, parentSessionID: string, parentMessageID: string): Promise<SynthesisResult>;
@@ -0,0 +1,2 @@
1
+ /** Assembly tool description for LLM consumption */
2
+ export declare const TOOL_DESCRIPTION = "\nSpawns multiple AI agents (voters) with different model providers to independently analyze a question or decision, then synthesizes their reasoning into a unified consensus.\n\n## When to use\n- Making critical decisions that benefit from multiple perspectives\n- Evaluating complex tradeoffs where bias reduction matters\n- Validating architectural choices through multi-model reasoning\n- When you need confidence scoring on analysis\n\n## How it works\n1. **Voter selection**: Auto-selects N models from configured providers (or use your override)\n2. **Independent voting**: Each voter independently analyzes the question\n3. **Synthesis**: All voter outputs are fed to a synthesis round that identifies agreement, disagreement, and confidence\n4. **Multi-round**: Optionally repeat synthesis for deeper convergence\n\n## Output format\nReturns a structured consensus with:\n- Unified answer/conclusion\n- Confidence level (high/medium/low)\n- Key disagreements between voters\n- Per-voter reasoning traces\n";
@@ -0,0 +1,10 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import type { AssemblyConfig } from "../../config/schema/assembly";
3
+ import type { BackgroundManager } from "../../features/background-agent/manager";
4
+ export interface AssemblyToolOptions {
5
+ manager: BackgroundManager;
6
+ pluginConfig?: {
7
+ assembly?: AssemblyConfig;
8
+ };
9
+ }
10
+ export declare function createAssemblyTool(options: AssemblyToolOptions): ToolDefinition;
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ export declare const AssemblyArgsSchema: z.ZodObject<{
3
+ question: z.ZodString;
4
+ voters: z.ZodOptional<z.ZodNumber>;
5
+ rounds: z.ZodOptional<z.ZodNumber>;
6
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ }, z.core.$strip>;
8
+ export type AssemblyArgs = z.infer<typeof AssemblyArgsSchema>;
9
+ export interface VoterResult {
10
+ voterIndex: number;
11
+ modelLabel: string;
12
+ reasoning: string;
13
+ status: "completed" | "error" | "timeout";
14
+ error?: string;
15
+ }
16
+ export interface SynthesisResult {
17
+ round: number;
18
+ consensus: string;
19
+ confidence: "high" | "medium" | "low";
20
+ disagreements: string[];
21
+ }
22
+ export interface ProviderModel {
23
+ providerID: string;
24
+ modelID: string;
25
+ }
@@ -0,0 +1,3 @@
1
+ import type { BackgroundManager } from "../../features/background-agent/manager";
2
+ import type { ProviderModel, VoterResult } from "./types";
3
+ export declare function spawnVoters(manager: BackgroundManager, question: string, providers: ProviderModel[], parentSessionID: string, parentMessageID: string): Promise<VoterResult[]>;
@@ -0,0 +1 @@
1
+ export declare const BDD_CREATE_CONTRACT_TOOL_NAME = "bdd_create_contract";
@@ -0,0 +1,3 @@
1
+ export * from "./constants";
2
+ export { createBddCreateContractTool } from "./tools";
3
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ /** Create a tool that produces a Contract JSON from a parsed Gherkin AST. */
3
+ export declare function createBddCreateContractTool(): ToolDefinition;
@@ -0,0 +1,12 @@
1
+ export interface BddCreateContractArgs {
2
+ parsedAst: string;
3
+ sourceFile: string;
4
+ sourceText: string;
5
+ force?: boolean;
6
+ outputPath?: string;
7
+ }
8
+ export interface BddCreateContractResult {
9
+ success: boolean;
10
+ outputPath?: string;
11
+ error?: string;
12
+ }
@@ -0,0 +1 @@
1
+ export declare const BDD_PARSE_GHERKIN_TOOL_NAME = "bdd_parse_gherkin";
@@ -0,0 +1,3 @@
1
+ export * from "./constants";
2
+ export { createBddParseGherkinTool } from "./tools";
3
+ export * from "./types";
@@ -0,0 +1,5 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ /**
3
+ * Create a tool that parses Gherkin .feature files into structured JSON AST.
4
+ */
5
+ export declare function createBddParseGherkinTool(): ToolDefinition;
@@ -0,0 +1,9 @@
1
+ export interface BddParseGherkinArgs {
2
+ filePath: string;
3
+ includeSourceMap?: boolean;
4
+ }
5
+ export interface BddParseGherkinResult {
6
+ success: boolean;
7
+ data?: Record<string, unknown>;
8
+ error?: string;
9
+ }
@@ -0,0 +1,10 @@
1
+ import type { Contract } from "../../features/bdd/schema";
2
+ import type { BddPipelineResult, BddPipelineStageName, BddPipelineStageResult } from "./types";
3
+ export declare function stageStatusBadge(stage: BddPipelineStageResult): string;
4
+ export declare function buildAnnotationsSection(contract: Contract): string;
5
+ export declare function buildFrontendMappingSection(contract: Contract, stage: BddPipelineStageResult): string;
6
+ export declare function buildBackendMappingSection(contract: Contract, stage: BddPipelineStageResult): string;
7
+ export declare function buildTestCoverageSection(result: BddPipelineResult): string;
8
+ export declare function buildAssumptionsSection(contract: Contract): string;
9
+ export declare function buildAmbiguitiesSection(result: BddPipelineResult): string;
10
+ export declare function buildFilesGeneratedSection(result: BddPipelineResult, featureDir: string, order: readonly BddPipelineStageName[]): string;
@@ -0,0 +1,9 @@
1
+ import type { Contract } from "../../features/bdd/schema";
2
+ import type { BddPipelineResult } from "./types";
3
+ export { stageStatusBadge } from "./analysis-report-sections";
4
+ export interface AnalysisReportInput {
5
+ result: BddPipelineResult;
6
+ contract: Contract;
7
+ featureDir: string;
8
+ }
9
+ export declare function buildAnalysisReport(input: AnalysisReportInput): string;
@@ -0,0 +1,4 @@
1
+ export declare const BDD_PIPELINE_TOOL_NAME = "bdd_pipeline_run";
2
+ export declare const BDD_PIPELINE_DESCRIPTION: string;
3
+ export declare const PIPELINE_REQUIRED_OUTPUTS: readonly ["ANALYSIS.md", "cucumber.cjs", "run-tests.sh"];
4
+ export declare const PIPELINE_STAGES: readonly ["tests", "frontend", "backend"];
@@ -0,0 +1,5 @@
1
+ export declare function isFeaturePath(input: string): boolean;
2
+ export declare function looksLikeGlob(input: string): boolean;
3
+ export declare function listFeatureFilesInDir(input: string): string[];
4
+ export declare function expandGlob(input: string): string[];
5
+ export declare function resolveFeaturePaths(inputs: string[]): string[];
@@ -1,3 +1,3 @@
1
1
  export * from "./constants";
2
- export * from "./storage";
2
+ export { createBddPipelineTool } from "./tools";
3
3
  export * from "./types";
@@ -0,0 +1,6 @@
1
+ import type { BddPipelineContext, BddPipelineDeps, BddPipelineResult } from "./types";
2
+ export declare function runBddPipeline(args: {
3
+ featurePaths: string[];
4
+ outDir: string;
5
+ force?: boolean;
6
+ }, ctxIn: Omit<BddPipelineContext, "outDir" | "force" | "featureName">, deps: BddPipelineDeps): Promise<BddPipelineResult>;
@@ -0,0 +1,14 @@
1
+ import type { BackgroundManager } from "../../features/background-agent/manager";
2
+ import type { BddPipelineStageName, BddPipelineStageResult } from "./types";
3
+ export interface SpawnSubagentOptions {
4
+ manager: BackgroundManager;
5
+ stage: BddPipelineStageName;
6
+ prompt: string;
7
+ contractPath: string;
8
+ parentSessionID: string;
9
+ parentMessageID: string;
10
+ parentAgent?: string;
11
+ abort?: AbortSignal;
12
+ outDir: string;
13
+ }
14
+ export declare function spawnStageSubagent(opts: SpawnSubagentOptions): Promise<BddPipelineStageResult>;
@@ -0,0 +1,5 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import type { BackgroundManager } from "../../features/background-agent/manager";
3
+ export declare function createBddPipelineTool(opts: {
4
+ manager: BackgroundManager;
5
+ }): ToolDefinition;
@@ -0,0 +1,74 @@
1
+ import type { Contract } from "../../features/bdd/schema";
2
+ export interface BddPipelineArgs {
3
+ featurePaths: string[];
4
+ outDir: string;
5
+ force?: boolean;
6
+ }
7
+ export type BddPipelineStageName = "tests" | "frontend" | "backend";
8
+ export type BddPipelineStageStatus = "completed" | "failed" | "timeout";
9
+ export interface BddPipelineStageResult {
10
+ stage: BddPipelineStageName;
11
+ status: BddPipelineStageStatus;
12
+ filesCreated: string[];
13
+ testsRun: number;
14
+ testsPassed: number;
15
+ testsFailed: number;
16
+ testOutput: string;
17
+ error?: string;
18
+ }
19
+ export type BddPipelineStatus = "PASS" | "FAIL";
20
+ export interface BddPipelineResult {
21
+ feature: string;
22
+ sourceFile: string;
23
+ contractPath: string;
24
+ status: BddPipelineStatus;
25
+ stages: Record<BddPipelineStageName, BddPipelineStageResult>;
26
+ missingOutputs: string[];
27
+ ambiguities: string[];
28
+ startedAt: string;
29
+ finishedAt: string;
30
+ error?: string;
31
+ }
32
+ export interface BddPipelineContext {
33
+ parentSessionID: string;
34
+ parentMessageID: string;
35
+ parentAgent?: string;
36
+ abort?: AbortSignal;
37
+ outDir: string;
38
+ force: boolean;
39
+ featureName: string;
40
+ }
41
+ export interface ParseFeatureResult {
42
+ success: boolean;
43
+ data?: unknown;
44
+ error?: string;
45
+ }
46
+ export interface CreateContractResult {
47
+ success: boolean;
48
+ outputPath?: string;
49
+ error?: string;
50
+ }
51
+ export interface EnrichContractResult {
52
+ success: boolean;
53
+ contract?: Contract;
54
+ error?: string;
55
+ }
56
+ export interface GateResult {
57
+ ok: boolean;
58
+ missing: string[];
59
+ }
60
+ export interface BddPipelineDeps {
61
+ parseFeature: (path: string) => Promise<ParseFeatureResult>;
62
+ createContract: (args: {
63
+ parsedAst: string;
64
+ sourceFile: string;
65
+ sourceText: string;
66
+ force?: boolean;
67
+ outputPath?: string;
68
+ }) => Promise<CreateContractResult>;
69
+ enrichContract: (contractPath: string) => Promise<EnrichContractResult>;
70
+ spawnSubagent: (stage: BddPipelineStageName, prompt: string, contract: Contract, ctx: BddPipelineContext) => Promise<BddPipelineStageResult>;
71
+ gateRequiredOutputs: (featureDir: string) => Promise<GateResult>;
72
+ writeAnalysis: (featureDir: string, report: BddPipelineResult) => Promise<void>;
73
+ readFeatureSource: (path: string) => Promise<string>;
74
+ }
@@ -0,0 +1 @@
1
+ export { createBddValidateContractTool } from "./tools";
@@ -0,0 +1,21 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ /**
3
+ * The bdd_validate_contract tool reads a contract JSON from disk and
4
+ * validates it against the strict ContractSchema. It is the single source
5
+ * of truth for what a valid contract looks like.
6
+ *
7
+ * Use this tool:
8
+ * - After the bdd-contract agent edits a contract file in any way
9
+ * (read-back-then-validate is the only way to be sure the on-disk
10
+ * bytes conform to the schema).
11
+ * - In a CI gate that re-validates every contract in the repo.
12
+ * - Whenever the bdd-pipeline runs as a pre-flight check before
13
+ * bdd-frontend / bdd-backend / bdd-tests phase starts.
14
+ *
15
+ * Returns:
16
+ * { success: true, contract } -- when validation passes
17
+ * { success: false, errors: <ZodFlatten> } -- when validation fails
18
+ * { success: false, error: <string> } -- when the file is missing,
19
+ * unreadable, or not JSON
20
+ */
21
+ export declare function createBddValidateContractTool(): ToolDefinition;
@@ -1,9 +1,11 @@
1
1
  import type { CategoriesConfig, CategoryConfig } from "../../config/schema";
2
+ import type { TierResolverContext } from "../../shared/tier-resolver";
2
3
  interface ResolveCategoryConfigOptions {
3
4
  userCategories?: CategoriesConfig;
4
5
  inheritedModel?: string;
5
6
  systemDefaultModel?: string;
6
7
  availableModels?: Set<string>;
8
+ tierContext?: TierResolverContext;
7
9
  }
8
10
  interface ResolveCategoryConfigResult {
9
11
  config: CategoryConfig;
@@ -14,6 +16,11 @@ interface ResolveCategoryConfigResult {
14
16
  /**
15
17
  * Resolve the configuration for a given category name.
16
18
  * Merges default and user configurations, handles model resolution.
19
+ *
20
+ * Tier resolution: both `userConfig.tier` and `defaultConfig.tier` are
21
+ * resolved against the live provider list (`tierContext`). An explicit
22
+ * `userConfig.model` always wins; an explicit `userConfig.tier` wins
23
+ * over the default tier; otherwise the default tier is used.
17
24
  */
18
25
  export declare function resolveCategoryConfig(categoryName: string, options: ResolveCategoryConfigOptions): ResolveCategoryConfigResult | null;
19
26
  export {};
@@ -13,6 +13,12 @@ export interface CategoryResolutionResult {
13
13
  modelInfo: ModelFallbackInfo | undefined;
14
14
  actualModel: string | undefined;
15
15
  isUnstableAgent: boolean;
16
+ /** The complexity level that was applied (auto-scored or caller-provided) */
17
+ complexityApplied?: import("./complexity-types").ComplexityLevel;
18
+ /** If true, model was downgraded due to low complexity */
19
+ complexityDowngraded?: boolean;
20
+ /** Human-readable note about complexity-based model selection */
21
+ _complexityNote?: string;
16
22
  error?: string;
17
23
  }
18
24
  export declare function resolveCategoryExecution(args: DelegateTaskArgs, executorCtx: ExecutorContext, inheritedModel: string | undefined, systemDefaultModel: string | undefined): Promise<CategoryResolutionResult>;