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
@@ -0,0 +1,24 @@
1
+ import type { ComplexityLevel } from "./complexity-types";
2
+ /**
3
+ * Built-in complexity-to-model downgrade targets per category.
4
+ * Key: category name, Value: map of complexity level → model string.
5
+ * Only levels 1-2 are downgradable; levels 3+ use the category's resolved model.
6
+ */
7
+ export declare const BUILTIN_COMPLEXITY_DOWNGRADES: Record<string, Partial<Record<ComplexityLevel, string>>>;
8
+ /**
9
+ * Resolve the model for a given category and complexity level.
10
+ *
11
+ * Returns the original model unchanged if:
12
+ * - Complexity is 3+ (not eligible for downgrade)
13
+ * - No downgrade target exists for this category/level combination
14
+ *
15
+ * @param category - The task category name
16
+ * @param complexity - The complexity level (1-5)
17
+ * @param originalModel - The currently resolved model string
18
+ * @param userDowngrades - Optional per-category user override from CategoryConfig
19
+ * @returns The model to use and whether a downgrade was applied
20
+ */
21
+ export declare function resolveComplexityModel(category: string, complexity: ComplexityLevel, originalModel: string, userDowngrades?: Record<string, string>): {
22
+ model: string;
23
+ downgraded: boolean;
24
+ };
@@ -0,0 +1,31 @@
1
+ import type { ComplexityLevel } from "./complexity-types";
2
+ export interface ComplexityScorerInput {
3
+ /** Short task description (3-5 words) */
4
+ description?: string;
5
+ /** Full task prompt content */
6
+ prompt?: string;
7
+ /** Skill names requested */
8
+ loadSkills?: string[];
9
+ /** Task category name */
10
+ category?: string;
11
+ }
12
+ /**
13
+ * Category baseline complexity levels.
14
+ * Used when no keyword signal is present to provide a sensible default.
15
+ */
16
+ export declare const CATEGORY_BASELINE: Partial<Record<string, ComplexityLevel>>;
17
+ /**
18
+ * Auto-score complexity from task context.
19
+ *
20
+ * Heuristic:
21
+ * 1. Start with category baseline (defaults to 3 for unknown categories)
22
+ * 2. Keyword detection in description/prompt can override:
23
+ * - Trivial keywords → level 1 (unless complex keywords also present)
24
+ * - Simple keywords → level 2 (unless complex keywords also present)
25
+ * - Architectural keywords → level 5
26
+ * - Complex keywords → level 4
27
+ * 3. Skills signal: many skills bump minimum score
28
+ *
29
+ * Returns a ComplexityLevel (1-5).
30
+ */
31
+ export declare function autoScoreComplexity(input: ComplexityScorerInput): ComplexityLevel;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Complexity level for per-task model routing.
3
+ * 1 = trivial, 2 = simple, 3 = standard, 4 = complex, 5 = architectural
4
+ */
5
+ export type ComplexityLevel = 1 | 2 | 3 | 4 | 5;
6
+ export declare const COMPLEXITY_LEVELS: readonly [1, 2, 3, 4, 5];
7
+ export type ComplexityInput = ComplexityLevel | "auto";
8
+ export declare const COMPLEXITY_DESCRIPTIONS: Record<ComplexityLevel, string>;
9
+ /** Returns true if this complexity level is eligible for model downgrade. */
10
+ export declare function isDowngradable(level: ComplexityLevel): boolean;
@@ -7,6 +7,7 @@ export interface ExecutorContext {
7
7
  directory: string;
8
8
  userCategories?: CategoriesConfig;
9
9
  mouseModel?: string;
10
+ globalModel?: string;
10
11
  browserProvider?: BrowserAutomationProvider;
11
12
  agentOverrides?: AgentOverrides;
12
13
  onSyncSessionCreated?: (event: {
@@ -1,3 +1,6 @@
1
+ export { BUILTIN_COMPLEXITY_DOWNGRADES, resolveComplexityModel } from "./complexity-constants";
2
+ export { autoScoreComplexity } from "./complexity-scorer";
3
+ export type { ComplexityInput, ComplexityLevel } from "./complexity-types";
1
4
  export * from "./constants";
2
5
  export type { BuildSystemContentInput, DelegateTaskToolOptions, SyncSessionCreatedEvent } from "./tools";
3
6
  export { buildSystemContent, createDelegateTask, resolveCategoryConfig } from "./tools";
@@ -16,6 +16,12 @@ export interface DelegateTaskArgs {
16
16
  task_id: string;
17
17
  task_dir?: string;
18
18
  };
19
+ /**
20
+ * Task complexity level (1-5) or "auto" for automatic scoring.
21
+ * When < 3, model may be downgraded to a cheaper tier.
22
+ * Default: "auto" (scored from prompt/description heuristics)
23
+ */
24
+ complexity?: import("./complexity-types").ComplexityLevel | "auto";
19
25
  }
20
26
  export interface ToolContextWithMetadata {
21
27
  sessionID: string;
@@ -55,6 +61,8 @@ export interface DelegateTaskToolOptions {
55
61
  */
56
62
  availableModelsOverride?: Set<string>;
57
63
  userCategories?: CategoriesConfig;
64
+ /** Global provider/model override for ALL tasks (overrides all category models) */
65
+ globalModel?: string;
58
66
  mouseModel?: string;
59
67
  browserProvider?: BrowserAutomationProvider;
60
68
  disabledSkills?: Set<string>;
@@ -12,6 +12,3 @@ export declare const MAX_GIT_OUTPUT_BYTES = 4096;
12
12
  export declare const GIT_COMMAND_TIMEOUT_MS = 5000;
13
13
  /** Sentinel used when we cannot resolve git metadata for the working dir. */
14
14
  export declare const UNKNOWN_GIT_SHA = "unknown";
15
- /** Canonical list of supported actions (kept in sync with the zod enum). */
16
- export declare const HANDOFF_ACTIONS: readonly ["create", "read", "list", "archive"];
17
- export type HandoffAction = (typeof HANDOFF_ACTIONS)[number];
@@ -1,5 +1,9 @@
1
1
  import { lspManager } from "./lsp";
2
2
  export { createAstGrepTools } from "./ast-grep";
3
+ export { createBddCreateContractTool } from "./bdd-create-contract";
4
+ export { createBddParseGherkinTool } from "./bdd-parse-gherkin";
5
+ export { createBddPipelineTool } from "./bdd-pipeline";
6
+ export { createBddValidateContractTool } from "./bdd-validate-contract";
3
7
  export { createGlobTools } from "./glob";
4
8
  export { createGrepTools } from "./grep";
5
9
  export { createHandoffTools } from "./handoff";
@@ -13,6 +17,7 @@ export { lspManager };
13
17
  import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin";
14
18
  import type { BackgroundManager } from "../features/background-agent";
15
19
  type OpencodeClient = PluginInput["client"];
20
+ export { createAssemblyTool } from "./assembly";
16
21
  export { createDelegateAgent } from "./delegate-agent";
17
22
  export { createDelegateTask } from "./delegate-task";
18
23
  export { createHashlineEditTool } from "./hashline-edit";
@@ -1,5 +1,5 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { Task } from "../../features/claude-tasks/types.ts";
2
+ import type { Task } from "../../features/task-storage/types.ts";
3
3
  export interface TodoInfo {
4
4
  id?: string;
5
5
  content: string;
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "opencode-matrixx",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
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",
7
7
  "type": "module",
8
- "bin": {
9
- "matrixx": "./bin/matrixx.js"
10
- },
11
8
  "files": [
12
- "dist",
13
- "bin",
14
- "postinstall.mjs"
9
+ "dist"
15
10
  ],
16
11
  "exports": {
17
12
  ".": {
@@ -21,12 +16,9 @@
21
16
  "./schema.json": "./dist/matrixx.schema.json"
22
17
  },
23
18
  "scripts": {
24
- "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
25
- "build:all": "bun run build && bun run build:binaries",
26
- "build:binaries": "bun run script/build-binaries.ts",
19
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun run build:schema",
27
20
  "build:schema": "bun run script/build-schema.ts",
28
21
  "clean": "rm -rf dist",
29
- "postinstall": "node postinstall.mjs",
30
22
  "prepublishOnly": "bun run clean && bun run build",
31
23
  "typecheck": "tsc --noEmit",
32
24
  "lint": "biome check src/",
@@ -51,55 +43,53 @@
51
43
  "vibe-coding",
52
44
  "agentic",
53
45
  "autonomous-agents",
54
- "developer-tools",
55
- "typescript",
56
- "plugin",
57
- "cli"
46
+ "plugin"
58
47
  ],
59
48
  "author": "klpanagi",
60
49
  "license": "SUL-1.0",
61
50
  "repository": {
62
51
  "type": "git",
63
- "url": "git+https://github.com/klpanagi/matrixx.git"
52
+ "url": "git+https://github.com/klpanagi/opencode-matrixx.git"
64
53
  },
65
54
  "bugs": {
66
- "url": "https://github.com/klpanagi/matrixx/issues"
55
+ "url": "https://github.com/klpanagi/opencode-matrixx/issues"
67
56
  },
68
- "homepage": "https://github.com/klpanagi/matrixx#readme",
57
+ "homepage": "https://github.com/klpanagi/opencode-matrixx#readme",
69
58
  "dependencies": {
70
59
  "@ast-grep/cli": "^0.40.0",
71
60
  "@ast-grep/napi": "^0.40.0",
72
- "@clack/prompts": "^0.11.0",
73
61
  "@code-yeongyu/comment-checker": "^0.6.1",
62
+ "@cucumber/gherkin": "^34.0.0",
74
63
  "@modelcontextprotocol/sdk": "^1.25.1",
75
64
  "@opencode-ai/plugin": "1.3.15",
76
65
  "@opencode-ai/sdk": "1.3.15",
77
- "commander": "^14.0.2",
78
- "detect-libc": "^2.0.0",
79
66
  "js-yaml": "^4.1.1",
80
67
  "jsonc-parser": "^3.3.1",
81
- "opencode-matrixx": ".",
82
- "picocolors": "^1.1.1",
83
68
  "picomatch": "^4.0.2",
84
69
  "vscode-jsonrpc": "^8.2.0",
85
70
  "zod": "^4.1.8"
86
71
  },
87
72
  "devDependencies": {
88
73
  "@biomejs/biome": "^2.5.0",
74
+ "@cucumber/cucumber": "^13.0.0",
75
+ "@playwright/test": "^1.61.1",
76
+ "@testing-library/jest-dom": "^6.6.3",
77
+ "@testing-library/react": "^16.3.0",
78
+ "@testing-library/user-event": "^14.6.1",
79
+ "@types/chai": "^5.2.3",
89
80
  "@types/js-yaml": "^4.0.9",
90
81
  "@types/picomatch": "^3.0.2",
82
+ "@types/react": "^19.0.0",
83
+ "@types/react-dom": "^19.0.0",
91
84
  "bun-types": "1.3.6",
85
+ "chai": "^6.2.2",
86
+ "happy-dom": "^15.11.7",
87
+ "jsdom": "^29.1.1",
88
+ "react": "^19.0.0",
89
+ "react-dom": "^19.0.0",
90
+ "tsx": "^4.23.0",
92
91
  "typescript": "^5.7.3"
93
92
  },
94
- "optionalDependencies": {
95
- "opencode-matrixx-darwin-arm64": "2.1.0",
96
- "opencode-matrixx-darwin-x64": "2.1.0",
97
- "opencode-matrixx-linux-arm64": "2.1.0",
98
- "opencode-matrixx-linux-arm64-musl": "2.1.0",
99
- "opencode-matrixx-linux-x64": "2.1.0",
100
- "opencode-matrixx-linux-x64-musl": "2.1.0",
101
- "opencode-matrixx-windows-x64": "2.1.0"
102
- },
103
93
  "trustedDependencies": [
104
94
  "@ast-grep/cli",
105
95
  "@ast-grep/napi",
package/bin/matrixx.js DELETED
@@ -1,80 +0,0 @@
1
- #!/usr/bin/env node
2
- // bin/matrixx.js
3
- // Wrapper script that detects platform and spawns the correct binary
4
-
5
- import { spawnSync } from "node:child_process";
6
- import { createRequire } from "node:module";
7
- import { getPlatformPackage, getBinaryPath } from "./platform.js";
8
-
9
- const require = createRequire(import.meta.url);
10
-
11
- /**
12
- * Detect libc family on Linux
13
- * @returns {string | null} 'glibc', 'musl', or null if detection fails
14
- */
15
- function getLibcFamily() {
16
- if (process.platform !== "linux") {
17
- return undefined; // Not needed on non-Linux
18
- }
19
-
20
- try {
21
- const detectLibc = require("detect-libc");
22
- return detectLibc.familySync();
23
- } catch {
24
- // detect-libc not available
25
- return null;
26
- }
27
- }
28
-
29
- function main() {
30
- const { platform, arch } = process;
31
- const libcFamily = getLibcFamily();
32
-
33
- // Get platform package name
34
- let pkg;
35
- try {
36
- pkg = getPlatformPackage({ platform, arch, libcFamily });
37
- } catch (error) {
38
- console.error(`\nmatrixx: ${error.message}\n`);
39
- process.exit(1);
40
- }
41
-
42
- // Resolve binary path
43
- const binRelPath = getBinaryPath(pkg, platform);
44
-
45
- let binPath;
46
- try {
47
- binPath = require.resolve(binRelPath);
48
- } catch {
49
- console.error(`\nmatrixx: Platform binary not installed.`);
50
- console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
51
- console.error(`Expected package: ${pkg}`);
52
- console.error(`\nTo fix, run:`);
53
- console.error(` npm install ${pkg}\n`);
54
- process.exit(1);
55
- }
56
-
57
- // Spawn the binary
58
- const result = spawnSync(binPath, process.argv.slice(2), {
59
- stdio: "inherit",
60
- });
61
-
62
- // Handle spawn errors
63
- if (result.error) {
64
- console.error(`\nmatrixx: Failed to execute binary.`);
65
- console.error(`Error: ${result.error.message}\n`);
66
- process.exit(2);
67
- }
68
-
69
- // Handle signals
70
- if (result.signal) {
71
- const signalNum = result.signal === "SIGTERM" ? 15 :
72
- result.signal === "SIGKILL" ? 9 :
73
- result.signal === "SIGINT" ? 2 : 1;
74
- process.exit(128 + signalNum);
75
- }
76
-
77
- process.exit(result.status ?? 1);
78
- }
79
-
80
- main();
package/bin/platform.js DELETED
@@ -1,38 +0,0 @@
1
- // bin/platform.js
2
- // Shared platform detection module - used by wrapper and postinstall
3
-
4
- /**
5
- * Get the platform-specific package name
6
- * @param {{ platform: string, arch: string, libcFamily?: string | null }} options
7
- * @returns {string} Package name like "opencode-matrixx-darwin-arm64"
8
- * @throws {Error} If libc cannot be detected on Linux
9
- */
10
- export function getPlatformPackage({ platform, arch, libcFamily }) {
11
- let suffix = "";
12
- if (platform === "linux") {
13
- if (libcFamily === null || libcFamily === undefined) {
14
- throw new Error(
15
- "Could not detect libc on Linux. " +
16
- "Please ensure detect-libc is installed or report this issue."
17
- );
18
- }
19
- if (libcFamily === "musl") {
20
- suffix = "-musl";
21
- }
22
- }
23
-
24
- // Map platform names: win32 -> windows (for package name)
25
- const os = platform === "win32" ? "windows" : platform;
26
- return `opencode-matrixx-${os}-${arch}${suffix}`;
27
- }
28
-
29
- /**
30
- * Get the path to the binary within a platform package
31
- * @param {string} pkg Package name
32
- * @param {string} platform Process platform
33
- * @returns {string} Relative path like "opencode-matrixx-darwin-arm64/bin/matrixx"
34
- */
35
- export function getBinaryPath(pkg, platform) {
36
- const ext = platform === "win32" ? ".exe" : "";
37
- return `${pkg}/bin/matrixx${ext}`;
38
- }
@@ -1,148 +0,0 @@
1
- // bin/platform.test.ts
2
- import { describe, expect, test } from "bun:test";
3
- import { getPlatformPackage, getBinaryPath } from "./platform.js";
4
-
5
- describe("getPlatformPackage", () => {
6
- // #region Darwin platforms
7
- test("returns darwin-arm64 for macOS ARM64", () => {
8
- // #given macOS ARM64 platform
9
- const input = { platform: "darwin", arch: "arm64" };
10
-
11
- // #when getting platform package
12
- const result = getPlatformPackage(input);
13
-
14
- // #then returns correct package name
15
- expect(result).toBe("opencode-matrixx-darwin-arm64");
16
- });
17
-
18
- test("returns darwin-x64 for macOS Intel", () => {
19
- // #given macOS x64 platform
20
- const input = { platform: "darwin", arch: "x64" };
21
-
22
- // #when getting platform package
23
- const result = getPlatformPackage(input);
24
-
25
- // #then returns correct package name
26
- expect(result).toBe("opencode-matrixx-darwin-x64");
27
- });
28
- // #endregion
29
-
30
- // #region Linux glibc platforms
31
- test("returns linux-x64 for Linux x64 with glibc", () => {
32
- // #given Linux x64 with glibc
33
- const input = { platform: "linux", arch: "x64", libcFamily: "glibc" };
34
-
35
- // #when getting platform package
36
- const result = getPlatformPackage(input);
37
-
38
- // #then returns correct package name
39
- expect(result).toBe("opencode-matrixx-linux-x64");
40
- });
41
-
42
- test("returns linux-arm64 for Linux ARM64 with glibc", () => {
43
- // #given Linux ARM64 with glibc
44
- const input = { platform: "linux", arch: "arm64", libcFamily: "glibc" };
45
-
46
- // #when getting platform package
47
- const result = getPlatformPackage(input);
48
-
49
- // #then returns correct package name
50
- expect(result).toBe("opencode-matrixx-linux-arm64");
51
- });
52
- // #endregion
53
-
54
- // #region Linux musl platforms
55
- test("returns linux-x64-musl for Alpine x64", () => {
56
- // #given Linux x64 with musl (Alpine)
57
- const input = { platform: "linux", arch: "x64", libcFamily: "musl" };
58
-
59
- // #when getting platform package
60
- const result = getPlatformPackage(input);
61
-
62
- // #then returns correct package name with musl suffix
63
- expect(result).toBe("opencode-matrixx-linux-x64-musl");
64
- });
65
-
66
- test("returns linux-arm64-musl for Alpine ARM64", () => {
67
- // #given Linux ARM64 with musl (Alpine)
68
- const input = { platform: "linux", arch: "arm64", libcFamily: "musl" };
69
-
70
- // #when getting platform package
71
- const result = getPlatformPackage(input);
72
-
73
- // #then returns correct package name with musl suffix
74
- expect(result).toBe("opencode-matrixx-linux-arm64-musl");
75
- });
76
- // #endregion
77
-
78
- // #region Windows platform
79
- test("returns windows-x64 for Windows", () => {
80
- // #given Windows x64 platform (win32 is Node's platform name)
81
- const input = { platform: "win32", arch: "x64" };
82
-
83
- // #when getting platform package
84
- const result = getPlatformPackage(input);
85
-
86
- // #then returns correct package name with 'windows' not 'win32'
87
- expect(result).toBe("opencode-matrixx-windows-x64");
88
- });
89
- // #endregion
90
-
91
- // #region Error cases
92
- test("throws error for Linux with null libcFamily", () => {
93
- // #given Linux platform with null libc detection
94
- const input = { platform: "linux", arch: "x64", libcFamily: null };
95
-
96
- // #when getting platform package
97
- // #then throws descriptive error
98
- expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
99
- });
100
-
101
- test("throws error for Linux with undefined libcFamily", () => {
102
- // #given Linux platform with undefined libc
103
- const input = { platform: "linux", arch: "x64", libcFamily: undefined };
104
-
105
- // #when getting platform package
106
- // #then throws descriptive error
107
- expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
108
- });
109
- // #endregion
110
- });
111
-
112
- describe("getBinaryPath", () => {
113
- test("returns path without .exe for Unix platforms", () => {
114
- // #given Unix platform package
115
- const pkg = "opencode-matrixx-darwin-arm64";
116
- const platform = "darwin";
117
-
118
- // #when getting binary path
119
- const result = getBinaryPath(pkg, platform);
120
-
121
- // #then returns path without extension
122
- expect(result).toBe("opencode-matrixx-darwin-arm64/bin/matrixx");
123
- });
124
-
125
- test("returns path with .exe for Windows", () => {
126
- // #given Windows platform package
127
- const pkg = "opencode-matrixx-windows-x64";
128
- const platform = "win32";
129
-
130
- // #when getting binary path
131
- const result = getBinaryPath(pkg, platform);
132
-
133
- // #then returns path with .exe extension
134
- expect(result).toBe("opencode-matrixx-windows-x64/bin/matrixx.exe");
135
- });
136
-
137
- test("returns path without .exe for Linux", () => {
138
- // #given Linux platform package
139
- const pkg = "opencode-matrixx-linux-x64";
140
- const platform = "linux";
141
-
142
- // #when getting binary path
143
- const result = getBinaryPath(pkg, platform);
144
-
145
- // #then returns path without extension
146
- expect(result).toBe("opencode-matrixx-linux-x64/bin/matrixx");
147
- });
148
- });
@@ -1,2 +0,0 @@
1
- import type { AgentConfig } from "@opencode-ai/sdk";
2
- export declare function applyEnvironmentContext(config: AgentConfig, directory?: string): AgentConfig;
@@ -1,2 +0,0 @@
1
- import type { InstallArgs } from "./types";
2
- export declare function runCliInstaller(args: InstallArgs, version: string): Promise<number>;
@@ -1 +0,0 @@
1
- export declare function runCli(): void;
@@ -1,2 +0,0 @@
1
- import type { ConfigMergeResult } from "../types";
2
- export declare function addPluginToOpenCodeConfig(currentVersion: string): Promise<ConfigMergeResult>;
@@ -1,2 +0,0 @@
1
- import type { ConfigMergeResult, InstallConfig } from "../types";
2
- export declare function addProviderConfig(config: InstallConfig): ConfigMergeResult;
@@ -1,122 +0,0 @@
1
- /**
2
- * Antigravity Provider Configuration
3
- *
4
- * IMPORTANT: Model names MUST use `antigravity-` prefix for stability.
5
- *
6
- * Since opencode-antigravity-auth v1.3.0, models use a variant system:
7
- * - `antigravity-gemini-3-pro` with variants: low, high
8
- * - `antigravity-gemini-3-flash` with variants: minimal, low, medium, high
9
- *
10
- * Legacy tier-suffixed names (e.g., `antigravity-gemini-3-pro-high`) still work
11
- * but variants are the recommended approach.
12
- *
13
- * @see https://github.com/NoeFabris/opencode-antigravity-auth#models
14
- */
15
- export declare const ANTIGRAVITY_PROVIDER_CONFIG: {
16
- google: {
17
- name: string;
18
- models: {
19
- "antigravity-gemini-3-pro": {
20
- name: string;
21
- limit: {
22
- context: number;
23
- output: number;
24
- };
25
- modalities: {
26
- input: string[];
27
- output: string[];
28
- };
29
- variants: {
30
- low: {
31
- thinkingLevel: string;
32
- };
33
- high: {
34
- thinkingLevel: string;
35
- };
36
- };
37
- };
38
- "antigravity-gemini-3-flash": {
39
- name: string;
40
- limit: {
41
- context: number;
42
- output: number;
43
- };
44
- modalities: {
45
- input: string[];
46
- output: string[];
47
- };
48
- variants: {
49
- minimal: {
50
- thinkingLevel: string;
51
- };
52
- low: {
53
- thinkingLevel: string;
54
- };
55
- medium: {
56
- thinkingLevel: string;
57
- };
58
- high: {
59
- thinkingLevel: string;
60
- };
61
- };
62
- };
63
- "antigravity-claude-sonnet-4-5": {
64
- name: string;
65
- limit: {
66
- context: number;
67
- output: number;
68
- };
69
- modalities: {
70
- input: string[];
71
- output: string[];
72
- };
73
- };
74
- "antigravity-claude-sonnet-4-5-thinking": {
75
- name: string;
76
- limit: {
77
- context: number;
78
- output: number;
79
- };
80
- modalities: {
81
- input: string[];
82
- output: string[];
83
- };
84
- variants: {
85
- low: {
86
- thinkingConfig: {
87
- thinkingBudget: number;
88
- };
89
- };
90
- max: {
91
- thinkingConfig: {
92
- thinkingBudget: number;
93
- };
94
- };
95
- };
96
- };
97
- "antigravity-claude-opus-4-5-thinking": {
98
- name: string;
99
- limit: {
100
- context: number;
101
- output: number;
102
- };
103
- modalities: {
104
- input: string[];
105
- output: string[];
106
- };
107
- variants: {
108
- low: {
109
- thinkingConfig: {
110
- thinkingBudget: number;
111
- };
112
- };
113
- max: {
114
- thinkingConfig: {
115
- thinkingBudget: number;
116
- };
117
- };
118
- };
119
- };
120
- };
121
- };
122
- };
@@ -1,3 +0,0 @@
1
- import type { ConfigMergeResult, InstallConfig } from "../types";
2
- export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
3
- export declare function addAuthPlugins(config: InstallConfig): Promise<ConfigMergeResult>;