opencode-matrixx 2.5.0 → 2.6.1

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 (151) hide show
  1. package/README.md +184 -8
  2. package/dist/agents/dynamic-agent-prompt-builder.d.ts +3 -0
  3. package/dist/cli/doctor/checks/auth.d.ts +2 -0
  4. package/dist/cli/doctor/checks/config.d.ts +2 -0
  5. package/dist/cli/doctor/checks/context-mode.d.ts +2 -0
  6. package/dist/cli/doctor/checks/dcp.d.ts +2 -0
  7. package/dist/cli/doctor/checks/docker.d.ts +2 -0
  8. package/dist/cli/doctor/checks/headroom.d.ts +2 -0
  9. package/dist/cli/doctor/checks/helpers.d.ts +2 -0
  10. package/dist/cli/doctor/checks/index.d.ts +16 -0
  11. package/dist/cli/doctor/checks/mcp.d.ts +2 -0
  12. package/dist/cli/doctor/checks/optional.d.ts +2 -0
  13. package/dist/cli/doctor/checks/plugin.d.ts +2 -0
  14. package/dist/cli/doctor/checks/rtk.d.ts +2 -0
  15. package/dist/cli/doctor/checks/runtime.d.ts +2 -0
  16. package/dist/cli/doctor/checks/tmux.d.ts +2 -0
  17. package/dist/cli/doctor/format.d.ts +3 -0
  18. package/dist/cli/doctor/index.d.ts +9 -0
  19. package/dist/cli/doctor/types.d.ts +24 -0
  20. package/dist/cli/index.d.ts +14 -0
  21. package/dist/cli/install/index.d.ts +12 -0
  22. package/dist/cli/setup/config-writer.d.ts +12 -0
  23. package/dist/cli/setup/config-writer.test.d.ts +1 -0
  24. package/dist/cli/setup/constants.d.ts +8 -0
  25. package/dist/cli/setup/deps.d.ts +8 -0
  26. package/dist/cli/setup/deps.test.d.ts +1 -0
  27. package/dist/cli/setup/index.d.ts +8 -0
  28. package/dist/cli/setup/index.test.d.ts +1 -0
  29. package/dist/cli/setup/opencode-sync.d.ts +9 -0
  30. package/dist/cli/setup/opencode-sync.test.d.ts +1 -0
  31. package/dist/cli/setup/prompts.d.ts +4 -0
  32. package/dist/cli/setup/prompts.test.d.ts +1 -0
  33. package/dist/cli/setup/types.d.ts +26 -0
  34. package/dist/cli.js +18983 -0
  35. package/dist/config/index.d.ts +1 -1
  36. package/dist/config/schema/evolution.d.ts +89 -0
  37. package/dist/config/schema/experimental.d.ts +1 -1
  38. package/dist/config/schema/headroom.d.ts +23 -0
  39. package/dist/config/schema/hooks.d.ts +7 -1
  40. package/dist/config/schema/matrixx-config.d.ts +60 -8
  41. package/dist/config/schema/morpheus.d.ts +8 -0
  42. package/dist/config/schema.d.ts +3 -3
  43. package/dist/create-hooks.d.ts +6 -1
  44. package/dist/features/background-agent/error-helpers.d.ts +0 -2
  45. package/dist/features/builtin-commands/templates/cleanup-tasks.d.ts +1 -0
  46. package/dist/features/builtin-commands/templates/evolution.d.ts +1 -0
  47. package/dist/features/builtin-commands/templates/task-list.d.ts +1 -0
  48. package/dist/features/builtin-commands/types.d.ts +1 -1
  49. package/dist/features/evolution/compressor/index.d.ts +5 -0
  50. package/dist/features/evolution/compressor/interface.d.ts +5 -0
  51. package/dist/features/evolution/compressor/llm.d.ts +12 -0
  52. package/dist/features/evolution/evaluator.d.ts +11 -0
  53. package/dist/features/evolution/index.d.ts +7 -0
  54. package/dist/features/evolution/pipeline.d.ts +7 -0
  55. package/dist/features/evolution/store.d.ts +22 -0
  56. package/dist/features/evolution/types.d.ts +51 -0
  57. package/dist/features/evolution/writer.d.ts +20 -0
  58. package/dist/features/task-storage/storage.d.ts +12 -2
  59. package/dist/features/task-storage/types.d.ts +3 -2
  60. package/dist/features/task-toast-manager/types.d.ts +2 -2
  61. package/dist/hooks/anthropic-context-window-limit-recovery/message-builder.d.ts +0 -1
  62. package/dist/hooks/anthropic-context-window-limit-recovery/tool-part-types.d.ts +2 -1
  63. package/dist/hooks/compaction-todo-preserver/hook.d.ts +13 -0
  64. package/dist/hooks/compaction-todo-preserver/index.d.ts +1 -1
  65. package/dist/hooks/evolution-compressor/index.d.ts +15 -0
  66. package/dist/hooks/evolution-hitl/index.d.ts +12 -0
  67. package/dist/hooks/evolution-quality-gate/index.d.ts +6 -0
  68. package/dist/hooks/evolution-watcher/index.d.ts +21 -0
  69. package/dist/hooks/evolution-watcher/utils.d.ts +5 -0
  70. package/dist/hooks/index.d.ts +7 -1
  71. package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
  72. package/dist/hooks/keyword-detector/constants.d.ts +1 -1
  73. package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
  74. package/dist/hooks/keyword-detector/ultrawork/deepseek.d.ts +16 -0
  75. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +5 -2
  76. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +12 -0
  77. package/dist/hooks/keyword-detector/ultrawork/glm.d.ts +11 -0
  78. package/dist/hooks/keyword-detector/ultrawork/gpt5.2.d.ts +4 -7
  79. package/dist/hooks/keyword-detector/ultrawork/index.d.ts +11 -3
  80. package/dist/hooks/keyword-detector/ultrawork/mimo.d.ts +16 -0
  81. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +17 -5
  82. package/dist/hooks/matrix-loop/with-timeout.d.ts +1 -1
  83. package/dist/hooks/mcp-startup-notification/index.d.ts +9 -0
  84. package/dist/hooks/session-recovery/types.d.ts +2 -1
  85. package/dist/hooks/task-continuation-enforcer/abort-detection.d.ts +4 -0
  86. package/dist/hooks/task-continuation-enforcer/constants.d.ts +10 -0
  87. package/dist/hooks/task-continuation-enforcer/continuation-injection.d.ts +12 -0
  88. package/dist/hooks/task-continuation-enforcer/countdown.d.ts +14 -0
  89. package/dist/hooks/task-continuation-enforcer/handler.d.ts +16 -0
  90. package/dist/hooks/task-continuation-enforcer/idle-event.d.ts +11 -0
  91. package/dist/hooks/task-continuation-enforcer/index.d.ts +6 -0
  92. package/dist/hooks/task-continuation-enforcer/message-directory.d.ts +1 -0
  93. package/dist/hooks/task-continuation-enforcer/non-idle-events.d.ts +6 -0
  94. package/dist/hooks/task-continuation-enforcer/session-state.d.ts +10 -0
  95. package/dist/hooks/task-continuation-enforcer/todo.d.ts +5 -0
  96. package/dist/hooks/task-continuation-enforcer/types.d.ts +60 -0
  97. package/dist/hooks/task-edit-guard/constants.d.ts +2 -0
  98. package/dist/hooks/task-edit-guard/hook.d.ts +2 -0
  99. package/dist/hooks/task-edit-guard/index.d.ts +2 -0
  100. package/dist/hooks/think-mode/types.d.ts +3 -0
  101. package/dist/index.js +9302 -6408
  102. package/dist/matrixx.schema.json +5425 -0
  103. package/dist/mcp/index.d.ts +10 -1
  104. package/dist/mcp/mcp-startup-state.d.ts +4 -0
  105. package/dist/mcp/mcp-validator.d.ts +13 -0
  106. package/dist/plugin/hooks/create-continuation-hooks.d.ts +4 -1
  107. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -1
  108. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
  109. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +3 -2
  110. package/dist/plugin-handlers/agent-config-handler.d.ts +1 -0
  111. package/dist/shared/delay.d.ts +1 -0
  112. package/dist/shared/error-formatting.d.ts +1 -0
  113. package/dist/shared/format-bytes.d.ts +1 -0
  114. package/dist/shared/format-bytes.test.d.ts +1 -0
  115. package/dist/shared/index.d.ts +7 -9
  116. package/dist/shared/is-abort-error.test.d.ts +1 -0
  117. package/dist/shared/model-resolution-pipeline.d.ts +26 -1
  118. package/dist/shared/opencode-config-dir.d.ts +13 -2
  119. package/dist/shared/sentinels.d.ts +2 -0
  120. package/dist/shared/session-state.d.ts +15 -0
  121. package/dist/shared/status-types.d.ts +1 -0
  122. package/dist/shared/system-directive.d.ts +1 -0
  123. package/dist/shared/task-system-gating.d.ts +3 -0
  124. package/dist/shared/task-system-gating.test.d.ts +1 -0
  125. package/dist/shared/with-timeout.d.ts +1 -0
  126. package/dist/shared/with-timeout.test.d.ts +1 -0
  127. package/dist/tools/background-task/delay.d.ts +1 -1
  128. package/dist/tools/index.d.ts +2 -1
  129. package/dist/tools/pdf-extract-figures/index.d.ts +1 -0
  130. package/dist/tools/pdf-extract-figures/tools.d.ts +11 -0
  131. package/dist/tools/task/index.d.ts +1 -1
  132. package/dist/tools/task/task-cleanup.d.ts +4 -0
  133. package/dist/tools/task/task-cleanup.test.d.ts +1 -0
  134. package/dist/tools/task/task-get.d.ts +2 -1
  135. package/dist/tools/task/task-list.d.ts +2 -1
  136. package/dist/tools/task/types.d.ts +7 -5
  137. package/package.json +16 -4
  138. package/dist/config/schema/model-capabilities.d.ts +0 -8
  139. package/dist/hooks/runtime-fallback/is-abort-error.d.ts +0 -1
  140. package/dist/hooks/todo-description-override/description.d.ts +0 -1
  141. package/dist/hooks/todo-description-override/hook.d.ts +0 -8
  142. package/dist/hooks/todo-description-override/index.d.ts +0 -1
  143. package/dist/shared/is-object.d.ts +0 -1
  144. package/dist/shared/model-resolution-types.d.ts +0 -27
  145. package/dist/shared/model-resolver.d.ts +0 -24
  146. package/dist/shared/opencode-config-dir-types.d.ts +0 -13
  147. package/dist/shared/session-model-state.d.ts +0 -6
  148. package/dist/shared/session-temperature-store.d.ts +0 -3
  149. package/dist/shared/session-tools-store.d.ts +0 -3
  150. package/dist/tools/task/todo-sync.d.ts +0 -16
  151. /package/dist/{hooks/architect → shared}/is-abort-error.d.ts +0 -0
@@ -1,4 +1,6 @@
1
1
  import type { MatrixxConfig } from "../config/schema";
2
+ import { type McpCreationFailure } from "./mcp-validator";
3
+ export type { McpCreationFailure } from "./mcp-validator";
2
4
  export { type McpName, McpNameSchema } from "./types";
3
5
  type RemoteMcpConfig = {
4
6
  type: "remote";
@@ -13,4 +15,11 @@ type LocalMcpConfig = {
13
15
  enabled: boolean;
14
16
  };
15
17
  type BuiltinMcpConfig = RemoteMcpConfig | LocalMcpConfig;
16
- export declare function createBuiltinMcps(disabledMcps?: string[], config?: MatrixxConfig): Record<string, BuiltinMcpConfig>;
18
+ export interface CreateBuiltinMcpsOptions {
19
+ isCommandAvailable?: (command: string) => boolean;
20
+ }
21
+ export interface CreateBuiltinMcpsResult {
22
+ mcps: Record<string, BuiltinMcpConfig>;
23
+ failures: McpCreationFailure[];
24
+ }
25
+ export declare function createBuiltinMcps(disabledMcps?: string[], config?: MatrixxConfig, options?: CreateBuiltinMcpsOptions): CreateBuiltinMcpsResult;
@@ -0,0 +1,4 @@
1
+ import type { McpCreationFailure } from "./mcp-validator";
2
+ export declare function setMcpStartupFailures(failures: McpCreationFailure[]): void;
3
+ export declare function getMcpStartupFailures(): McpCreationFailure[];
4
+ export declare function _resetMcpStartupFailuresForTesting(): void;
@@ -0,0 +1,13 @@
1
+ import type { WebsearchConfig } from "../config/schema";
2
+ export interface McpCreationFailure {
3
+ name: string;
4
+ error: string;
5
+ }
6
+ export type McpValidationResult = {
7
+ ok: true;
8
+ } | {
9
+ ok: false;
10
+ error: string;
11
+ };
12
+ export declare function validateWebsearchConfig(config?: WebsearchConfig): McpValidationResult;
13
+ export declare function isCommandAvailable(command: string): boolean;
@@ -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, createPlanPersister, createStopContinuationGuardHook, createTodoContinuationEnforcer } from "../../hooks";
3
+ import { createArchitectHook, createBackgroundNotificationHook, createCompactionContextInjector, createCompactionTodoPreserverHook, createEvolutionCompressorHook, createEvolutionHitlHook, createPlanPersister, createStopContinuationGuardHook, createTaskContinuationEnforcer, createTodoContinuationEnforcer } from "../../hooks";
4
4
  import type { PluginContext } from "../types";
5
5
  import { createUnstableAgentBabysitter } from "../unstable-agent-babysitter";
6
6
  export type ContinuationHooks = {
@@ -8,10 +8,13 @@ export type ContinuationHooks = {
8
8
  compactionContextInjector: ReturnType<typeof createCompactionContextInjector> | null;
9
9
  compactionTodoPreserver: ReturnType<typeof createCompactionTodoPreserverHook> | null;
10
10
  todoContinuationEnforcer: ReturnType<typeof createTodoContinuationEnforcer> | null;
11
+ taskContinuationEnforcer: ReturnType<typeof createTaskContinuationEnforcer> | null;
11
12
  unstableAgentBabysitter: ReturnType<typeof createUnstableAgentBabysitter> | null;
12
13
  backgroundNotificationHook: ReturnType<typeof createBackgroundNotificationHook> | null;
13
14
  architectHook: ReturnType<typeof createArchitectHook> | null;
14
15
  planPersister: ReturnType<typeof createPlanPersister> | null;
16
+ evolutionCompressor: ReturnType<typeof createEvolutionCompressorHook> | null;
17
+ evolutionHitl: ReturnType<typeof createEvolutionHitlHook> | null;
15
18
  };
16
19
  type SessionRecovery = {
17
20
  setOnAbortCallback: (callback: (sessionID: string) => void) => void;
@@ -25,12 +25,13 @@ export declare function createCoreHooks(args: {
25
25
  envFileWriteGuard: ReturnType<typeof import("../../hooks").createEnvFileWriteGuardHook> | null;
26
26
  jsonErrorRecovery: ReturnType<typeof import("../../hooks").createJsonErrorRecoveryHook> | null;
27
27
  bashFileReadGuard: ReturnType<typeof import("../../hooks").createBashFileReadGuardHook> | null;
28
- todoDescriptionOverride: ReturnType<typeof import("../../hooks").createTodoDescriptionOverrideHook> | null;
29
28
  readImageResizer: ReturnType<typeof import("../../hooks").createReadImageResizerHook> | null;
30
29
  webfetchRedirectGuard: ReturnType<typeof import("../../hooks").createWebFetchRedirectGuardHook> | null;
31
30
  hashlineEditDiffEnhancer: ReturnType<typeof import("../../hooks").createHashlineEditDiffEnhancerHook> | null;
32
31
  qualityGate: ReturnType<typeof import("../../hooks").createQualityGateHook> | null;
33
32
  taskNotepad: ReturnType<typeof import("../../hooks").createTaskNotepadHook> | null;
33
+ taskEditGuard: ReturnType<typeof import("../../hooks").createTaskEditGuardHook> | null;
34
+ evolutionWatcher: ReturnType<typeof import("../../hooks").createEvolutionWatcherHook> | null;
34
35
  contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
35
36
  preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
36
37
  sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
@@ -52,4 +53,5 @@ export declare function createCoreHooks(args: {
52
53
  anthropicEffort: ReturnType<typeof import("../../hooks/anthropic-effort").createAnthropicEffortHook> | null;
53
54
  runtimeFallback: ReturnType<typeof import("../../hooks").createRuntimeFallbackHook> | null;
54
55
  rtkBashRewriter: ReturnType<typeof import("../../hooks").createRtkBashRewriterHook> | null;
56
+ mcpStartupNotification: ReturnType<typeof import("../../hooks").createMcpStartupNotificationHook> | null;
55
57
  };
@@ -1,5 +1,5 @@
1
1
  import type { HookName, MatrixxConfig } from "../../config";
2
- import { createAgentUsageReminderHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createContextWindowMonitorHook, createDelegateTaskRetryHook, createEditErrorRecoveryHook, createInteractiveBashSessionHook, createMatrixLoopHook, createMouseNotepadHook, createNonInteractiveEnvHook, createOracleMdOnlyHook, createPreemptiveCompactionHook, createQuestionLabelTruncatorHook, createRtkBashRewriterHook, createRuntimeFallbackHook, createSessionNotification, createSessionRecoveryHook, createStartWorkHook, createTaskResumeInfoHook, createThinkModeHook } from "../../hooks";
2
+ import { createAgentUsageReminderHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createContextWindowMonitorHook, createDelegateTaskRetryHook, createEditErrorRecoveryHook, createInteractiveBashSessionHook, createMatrixLoopHook, createMcpStartupNotificationHook, createMouseNotepadHook, createNonInteractiveEnvHook, createOracleMdOnlyHook, createPreemptiveCompactionHook, createQuestionLabelTruncatorHook, createRtkBashRewriterHook, createRuntimeFallbackHook, createSessionNotification, createSessionRecoveryHook, createStartWorkHook, createTaskResumeInfoHook, createThinkModeHook } from "../../hooks";
3
3
  import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
4
4
  import type { PluginContext } from "../types";
5
5
  export type SessionHooks = {
@@ -24,6 +24,7 @@ export type SessionHooks = {
24
24
  anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null;
25
25
  runtimeFallback: ReturnType<typeof createRuntimeFallbackHook> | null;
26
26
  rtkBashRewriter: ReturnType<typeof createRtkBashRewriterHook> | null;
27
+ mcpStartupNotification: ReturnType<typeof createMcpStartupNotificationHook> | null;
27
28
  };
28
29
  export declare function createSessionHooks(args: {
29
30
  ctx: PluginContext;
@@ -1,5 +1,5 @@
1
1
  import type { HookName, MatrixxConfig } from "../../config";
2
- import { createBashFileReadGuardHook, createCommentCheckerHooks, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createEnvFileWriteGuardHook, createHashlineEditDiffEnhancerHook, createHashlineReadEnhancerHook, createJsonErrorRecoveryHook, createQualityGateHook, createReadImageResizerHook, createRulesInjectorHook, createSecretLeakGuardHook, createTaskNotepadHook, createTasksTodowriteDisablerHook, createTodoDescriptionOverrideHook, createToolOutputTruncatorHook, createWebFetchRedirectGuardHook, createWriteExistingFileGuardHook } from "../../hooks";
2
+ import { createBashFileReadGuardHook, createCommentCheckerHooks, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createEnvFileWriteGuardHook, createEvolutionWatcherHook, createHashlineEditDiffEnhancerHook, createHashlineReadEnhancerHook, createJsonErrorRecoveryHook, 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
  commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
@@ -15,12 +15,13 @@ export type ToolGuardHooks = {
15
15
  envFileWriteGuard: ReturnType<typeof createEnvFileWriteGuardHook> | null;
16
16
  jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
17
17
  bashFileReadGuard: ReturnType<typeof createBashFileReadGuardHook> | null;
18
- todoDescriptionOverride: ReturnType<typeof createTodoDescriptionOverrideHook> | null;
19
18
  readImageResizer: ReturnType<typeof createReadImageResizerHook> | null;
20
19
  webfetchRedirectGuard: ReturnType<typeof createWebFetchRedirectGuardHook> | null;
21
20
  hashlineEditDiffEnhancer: ReturnType<typeof createHashlineEditDiffEnhancerHook> | null;
22
21
  qualityGate: ReturnType<typeof createQualityGateHook> | null;
23
22
  taskNotepad: ReturnType<typeof createTaskNotepadHook> | null;
23
+ taskEditGuard: ReturnType<typeof createTaskEditGuardHook> | null;
24
+ evolutionWatcher: ReturnType<typeof createEvolutionWatcherHook> | null;
24
25
  };
25
26
  export declare function createToolGuardHooks(args: {
26
27
  ctx: PluginContext;
@@ -2,6 +2,7 @@ import type { MatrixxConfig } from "../config";
2
2
  import type { PluginComponents } from "./plugin-components-loader";
3
3
  export declare function setAvailableToolNames(names: string[]): void;
4
4
  export declare function getAvailableToolNames(): string[];
5
+ export declare function injectContextDiscipline(availableToolNames: string[], agents: Record<string, Record<string, unknown>>): void;
5
6
  export declare function applyAgentConfig(params: {
6
7
  config: Record<string, unknown>;
7
8
  pluginConfig: MatrixxConfig;
@@ -0,0 +1 @@
1
+ export declare function delay(ms: number): Promise<void>;
@@ -25,3 +25,4 @@ export interface ErrorContext {
25
25
  * Replaces the `?? "pending"` anti-pattern across matrixx background task tools.
26
26
  */
27
27
  export declare function formatDetailedError(error: unknown, ctx: ErrorContext): string;
28
+ export declare function getErrorMessage(error: unknown): string;
@@ -0,0 +1 @@
1
+ export declare function formatBytes(bytes: number): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,34 +1,30 @@
1
1
  export * from "./agent-tool-restrictions";
2
2
  export * from "./agent-variant";
3
3
  export * from "./binary-downloader";
4
- export * from "./code-patterns";
5
- export * from "./code-patterns";
6
4
  export * from "./command-executor";
7
5
  export * from "./config-errors";
8
6
  export * from "./connected-providers-cache";
9
7
  export * from "./data-path";
10
8
  export * from "./deep-merge";
9
+ export * from "./delay";
11
10
  export * from "./dynamic-truncator";
12
11
  export * from "./external-plugin-detector";
13
12
  export * from "./file-reference-resolver";
14
13
  export * from "./file-utils";
14
+ export * from "./format-bytes";
15
15
  export * from "./format-duration";
16
16
  export * from "./frontmatter";
17
17
  export * from "./git-worktree";
18
- export * from "./is-object";
18
+ export * from "./is-abort-error";
19
19
  export * from "./jsonc-parser";
20
20
  export * from "./logger";
21
21
  export * from "./migration";
22
22
  export * from "./model-availability";
23
23
  export * from "./model-requirements";
24
- export { resolveModelPipeline } from "./model-resolution-pipeline";
25
- export type { ModelResolutionProvenance, ModelResolutionRequest, ModelResolutionResult, } from "./model-resolution-types";
26
- export * from "./model-resolver";
27
- export * from "./model-sanitizer";
24
+ export { type ModelResolutionProvenance, type ModelResolutionRequest, type ModelResolutionResult, normalizeModel, resolveModelPipeline, } from "./model-resolution-pipeline";
28
25
  export * from "./model-suggestion-retry";
29
26
  export * from "./normalize-sdk-response";
30
27
  export * from "./opencode-config-dir";
31
- export type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths, } from "./opencode-config-dir-types";
32
28
  export * from "./opencode-http-api";
33
29
  export * from "./opencode-message-dir";
34
30
  export * from "./opencode-server-auth";
@@ -38,14 +34,16 @@ export * from "./opencode-version";
38
34
  export * from "./permission-compat";
39
35
  export * from "./port-utils";
40
36
  export * from "./safe-create-hook";
37
+ export * from "./sentinels";
41
38
  export * from "./session-cursor";
42
39
  export * from "./session-directory-resolver";
43
40
  export * from "./session-utils";
44
41
  export * from "./shell-env";
42
+ export * from "./status-types";
45
43
  export * from "./system-directive";
46
44
  export * from "./tmux";
47
45
  export * from "./token-cache";
48
- export * from "./tool-guards";
49
46
  export * from "./transcript-path";
50
47
  export * from "./truncate-description";
48
+ export * from "./with-timeout";
51
49
  export * from "./zip-extractor";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,27 @@
1
- import type { ModelResolutionRequest, ModelResolutionResult } from "./model-resolution-types";
1
+ import type { FallbackEntry } from "./model-requirements";
2
+ export type ModelResolutionRequest = {
3
+ intent?: {
4
+ globalOverrideModel?: string;
5
+ uiSelectedModel?: string;
6
+ userModel?: string;
7
+ categoryDefaultModel?: string;
8
+ };
9
+ constraints: {
10
+ availableModels: Set<string>;
11
+ connectedProviders?: string[];
12
+ };
13
+ policy?: {
14
+ fallbackChain?: FallbackEntry[];
15
+ systemDefaultModel?: string;
16
+ };
17
+ };
18
+ export type ModelResolutionProvenance = "override" | "category-default" | "provider-fallback" | "system-default";
19
+ export type ModelResolutionResult = {
20
+ model: string;
21
+ provenance: ModelResolutionProvenance;
22
+ variant?: string;
23
+ attempted?: string[];
24
+ reason?: string;
25
+ };
26
+ export declare function normalizeModel(model?: string): string | undefined;
2
27
  export declare function resolveModelPipeline(request: ModelResolutionRequest): ModelResolutionResult | undefined;
@@ -1,5 +1,16 @@
1
- import type { OpenCodeConfigDirOptions, OpenCodeConfigPaths } from "./opencode-config-dir-types";
2
- export type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths, } from "./opencode-config-dir-types";
1
+ export type OpenCodeBinaryType = "opencode" | "opencode-desktop";
2
+ export type OpenCodeConfigDirOptions = {
3
+ binary: OpenCodeBinaryType;
4
+ version?: string | null;
5
+ checkExisting?: boolean;
6
+ };
7
+ export type OpenCodeConfigPaths = {
8
+ configDir: string;
9
+ configJson: string;
10
+ configJsonc: string;
11
+ packageJson: string;
12
+ matrixxConfig: string;
13
+ };
3
14
  export declare const TAURI_APP_IDENTIFIER = "ai.opencode.desktop";
4
15
  export declare const TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
5
16
  export declare function isDevBuild(version: string | null | undefined): boolean;
@@ -0,0 +1,2 @@
1
+ export declare const NOT_CACHED: unique symbol;
2
+ export declare const FALSE_PENDING_RETRY: unique symbol;
@@ -0,0 +1,15 @@
1
+ export declare function setSessionTemperature(sessionID: string, temperature: number): void;
2
+ export declare function getSessionTemperature(sessionID: string): number | undefined;
3
+ export declare function clearSessionTemperature(sessionID: string): void;
4
+ export declare function setSessionTools(sessionID: string, tools: Record<string, boolean>): void;
5
+ export declare function getSessionTools(sessionID: string): Record<string, boolean> | undefined;
6
+ export declare function clearSessionTools(): void;
7
+ /**
8
+ * Per-session model tracking.
9
+ */
10
+ type SessionModel = {
11
+ providerID: string;
12
+ modelID: string;
13
+ };
14
+ export declare function getSessionModel(sessionID: string): SessionModel | undefined;
15
+ export {};
@@ -0,0 +1 @@
1
+ export type TaskStatus = "pending" | "running" | "completed" | "error";
@@ -34,6 +34,7 @@ export declare function hasSystemReminder(text: string): boolean;
34
34
  export declare function removeSystemReminders(text: string): string;
35
35
  export declare const SystemDirectiveTypes: {
36
36
  readonly TODO_CONTINUATION: "TODO CONTINUATION";
37
+ readonly TASK_CONTINUATION: "TASK CONTINUATION";
37
38
  readonly MATRIX_LOOP: "MATRIX LOOP";
38
39
  readonly MISSION_CONTINUATION: "MISSION CONTINUATION";
39
40
  readonly DELEGATION_REQUIRED: "DELEGATION REQUIRED";
@@ -0,0 +1,3 @@
1
+ import type { MatrixxConfig } from "../config/schema";
2
+ export declare const TASK_SYSTEM_DEFAULT: true;
3
+ export declare function isTaskSystemEnabled(config: Partial<MatrixxConfig> | undefined | null): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, errorMessage?: string): Promise<T>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- export declare function delay(ms: number): Promise<void>;
1
+ export { delay } from "../../shared/delay";
@@ -8,6 +8,7 @@ export { createGlobTools } from "./glob";
8
8
  export { createGrepTools } from "./grep";
9
9
  export { createHandoffTools } from "./handoff";
10
10
  export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
11
+ export { createPdfExtractFiguresTool } from "./pdf-extract-figures";
11
12
  export { createSessionManagerTools } from "./session-manager";
12
13
  export { sessionExists } from "./session-manager/storage";
13
14
  export { createSkillTool } from "./skill";
@@ -22,6 +23,6 @@ export { createDelegateAgent } from "./delegate-agent";
22
23
  export { createDelegateTask } from "./delegate-task";
23
24
  export { createHashlineEditTool } from "./hashline-edit";
24
25
  export { createLookAt } from "./look-at";
25
- export { createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, } from "./task";
26
+ export { createTaskCleanupTool, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, } from "./task";
26
27
  export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
27
28
  export declare const builtinTools: Record<string, ToolDefinition>;
@@ -0,0 +1 @@
1
+ export { createPdfExtractFiguresTool } from "./tools";
@@ -0,0 +1,11 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ export interface PdfExtractFiguresArgs {
3
+ file_path: string;
4
+ output_dir?: string;
5
+ page?: number;
6
+ min_width?: number;
7
+ min_height?: number;
8
+ min_area?: number;
9
+ json_only?: boolean;
10
+ }
11
+ export declare function createPdfExtractFiguresTool(): Record<string, ToolDefinition>;
@@ -1,6 +1,6 @@
1
+ export { createTaskCleanupTool } from "./task-cleanup";
1
2
  export { createTaskCreateTool } from "./task-create";
2
3
  export { createTaskGetTool } from "./task-get";
3
4
  export { createTaskList } from "./task-list";
4
5
  export { createTaskUpdateTool } from "./task-update";
5
- export type { TodoInfo } from "./todo-sync";
6
6
  export type { TaskCreateInput, TaskDeleteInput, TaskGetInput, TaskListInput, TaskObject, TaskStatus, TaskUpdateInput } from "./types";
@@ -0,0 +1,4 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
3
+ import type { MatrixxConfig } from "../../config/schema";
4
+ export declare function createTaskCleanupTool(config: Partial<MatrixxConfig>, ctx?: PluginInput): ToolDefinition;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
1
2
  import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
3
  import type { MatrixxConfig } from "../../config/schema";
3
- export declare function createTaskGetTool(config: Partial<MatrixxConfig>): ToolDefinition;
4
+ export declare function createTaskGetTool(config: Partial<MatrixxConfig>, ctx?: PluginInput): ToolDefinition;
@@ -1,3 +1,4 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
1
2
  import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
3
  import type { MatrixxConfig } from "../../config/schema";
3
- export declare function createTaskList(config: Partial<MatrixxConfig>): ToolDefinition;
4
+ export declare function createTaskList(config: Partial<MatrixxConfig>, ctx?: PluginInput): ToolDefinition;
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export declare const TaskStatusSchema: z.ZodEnum<{
3
3
  deleted: "deleted";
4
- completed: "completed";
5
4
  pending: "pending";
5
+ completed: "completed";
6
6
  in_progress: "in_progress";
7
7
  }>;
8
8
  export type TaskStatus = z.infer<typeof TaskStatusSchema>;
@@ -12,8 +12,8 @@ export declare const TaskObjectSchema: z.ZodObject<{
12
12
  description: z.ZodString;
13
13
  status: z.ZodEnum<{
14
14
  deleted: "deleted";
15
- completed: "completed";
16
15
  pending: "pending";
16
+ completed: "completed";
17
17
  in_progress: "in_progress";
18
18
  }>;
19
19
  activeForm: z.ZodOptional<z.ZodString>;
@@ -24,6 +24,7 @@ export declare const TaskObjectSchema: z.ZodObject<{
24
24
  repoURL: z.ZodOptional<z.ZodString>;
25
25
  parentID: z.ZodOptional<z.ZodString>;
26
26
  threadID: z.ZodString;
27
+ projectRoot: z.ZodOptional<z.ZodString>;
27
28
  }, z.core.$strict>;
28
29
  export type TaskObject = z.infer<typeof TaskObjectSchema>;
29
30
  export declare const TaskSchema: z.ZodObject<{
@@ -32,8 +33,8 @@ export declare const TaskSchema: z.ZodObject<{
32
33
  description: z.ZodString;
33
34
  status: z.ZodEnum<{
34
35
  deleted: "deleted";
35
- completed: "completed";
36
36
  pending: "pending";
37
+ completed: "completed";
37
38
  in_progress: "in_progress";
38
39
  }>;
39
40
  activeForm: z.ZodOptional<z.ZodString>;
@@ -44,6 +45,7 @@ export declare const TaskSchema: z.ZodObject<{
44
45
  repoURL: z.ZodOptional<z.ZodString>;
45
46
  parentID: z.ZodOptional<z.ZodString>;
46
47
  threadID: z.ZodString;
48
+ projectRoot: z.ZodOptional<z.ZodString>;
47
49
  }, z.core.$strict>;
48
50
  export type Task = TaskObject;
49
51
  export declare const TaskCreateInputSchema: z.ZodObject<{
@@ -61,8 +63,8 @@ export type TaskCreateInput = z.infer<typeof TaskCreateInputSchema>;
61
63
  export declare const TaskListInputSchema: z.ZodObject<{
62
64
  status: z.ZodOptional<z.ZodEnum<{
63
65
  deleted: "deleted";
64
- completed: "completed";
65
66
  pending: "pending";
67
+ completed: "completed";
66
68
  in_progress: "in_progress";
67
69
  }>>;
68
70
  parentID: z.ZodOptional<z.ZodString>;
@@ -78,8 +80,8 @@ export declare const TaskUpdateInputSchema: z.ZodObject<{
78
80
  description: z.ZodOptional<z.ZodString>;
79
81
  status: z.ZodOptional<z.ZodEnum<{
80
82
  deleted: "deleted";
81
- completed: "completed";
82
83
  pending: "pending";
84
+ completed: "completed";
83
85
  in_progress: "in_progress";
84
86
  }>>;
85
87
  activeForm: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-matrixx",
3
- "version": "2.5.0",
3
+ "version": "2.6.1",
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",
@@ -8,6 +8,10 @@
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "bin": {
12
+ "opencode-matrixx": "dist/cli.js",
13
+ "matrixx": "dist/cli.js"
14
+ },
11
15
  "exports": {
12
16
  ".": {
13
17
  "types": "./dist/index.d.ts",
@@ -16,7 +20,9 @@
16
20
  "./schema.json": "./dist/matrixx.schema.json"
17
21
  },
18
22
  "scripts": {
19
- "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun run build:schema",
23
+ "build": "bun run build:plugin && bun run build:cli && tsc --emitDeclarationOnly && bun run build:schema",
24
+ "build:plugin": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external \"opencode/*\" --external \"@opencode-ai/core/*\" --external effect --external \"effect/*\"",
25
+ "build:cli": "bun build src/cli/index.ts --outfile dist/cli.js --target bun --format esm && chmod +x dist/cli.js",
20
26
  "build:schema": "bun run script/build-schema.ts",
21
27
  "clean": "rm -rf dist",
22
28
  "prepublishOnly": "bun run clean && bun run build",
@@ -24,7 +30,8 @@
24
30
  "lint": "biome check src/",
25
31
  "lint:fix": "biome check --write src/",
26
32
  "ci": "bash script/run-ci.sh",
27
- "test": "bash script/run-ci.sh"
33
+ "test": "bash script/run-ci.sh",
34
+ "matrixx": "bun run bin/matrixx.ts"
28
35
  },
29
36
  "keywords": [
30
37
  "opencode",
@@ -58,6 +65,7 @@
58
65
  "dependencies": {
59
66
  "@ast-grep/cli": "^0.40.0",
60
67
  "@ast-grep/napi": "^0.40.0",
68
+ "@clack/prompts": "^1.7.0",
61
69
  "@code-yeongyu/comment-checker": "^0.6.1",
62
70
  "@cucumber/gherkin": "^34.0.0",
63
71
  "@modelcontextprotocol/sdk": "^1.25.1",
@@ -94,5 +102,9 @@
94
102
  "@ast-grep/cli",
95
103
  "@ast-grep/napi",
96
104
  "@code-yeongyu/comment-checker"
97
- ]
105
+ ],
106
+ "publishConfig": {
107
+ "access": "public",
108
+ "provenance": true
109
+ }
98
110
  }
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ModelCapabilitiesConfigSchema: z.ZodObject<{
3
- enabled: z.ZodOptional<z.ZodBoolean>;
4
- auto_refresh_on_start: z.ZodOptional<z.ZodBoolean>;
5
- refresh_timeout_ms: z.ZodOptional<z.ZodNumber>;
6
- source_url: z.ZodOptional<z.ZodString>;
7
- }, z.core.$strip>;
8
- export type ModelCapabilitiesConfig = z.infer<typeof ModelCapabilitiesConfigSchema>;
@@ -1 +0,0 @@
1
- export declare function isAbortError(error: unknown): boolean;
@@ -1 +0,0 @@
1
- export declare const TODOWRITE_DESCRIPTION = "Manage your todo list with ATOMIC, single-responsibility items.\n\nRULES:\n- One todo = one specific, verifiable action (not \"Update everything\" or \"Fix issues\")\n- Each todo must be completable in isolation \u2014 no vague catch-alls\n- Todos must be nameable with a single precise phrase\n- Mark in_progress BEFORE starting work, completed IMMEDIATELY after finishing\n- Only ONE todo in_progress at a time\n\nANTI-PATTERNS (will be rejected by reviewers):\n- \"Update X and Y and Z\" \u2192 SPLIT into 3 separate todos\n- \"Fix issues\" \u2192 SPECIFY which file, function, or behavior\n- \"Refactor\" \u2192 SPECIFY what is being refactored and to what end\n- \"Improve\" \u2192 SPECIFY the measurable outcome\n\nSTATUS TRANSITIONS:\n pending \u2192 in_progress \u2192 completed\n pending \u2192 cancelled (if no longer needed)\n\nNever batch-complete todos. Mark each one complete the moment it is done.";
@@ -1,8 +0,0 @@
1
- export declare function createTodoDescriptionOverrideHook(): {
2
- "tool.definition": (input: {
3
- toolID: string;
4
- }, output: {
5
- description: string;
6
- parameters: unknown;
7
- }) => Promise<void>;
8
- };
@@ -1 +0,0 @@
1
- export { createTodoDescriptionOverrideHook } from "./hook";
@@ -1 +0,0 @@
1
- export declare function isObject(value: unknown): value is Record<string, unknown>;
@@ -1,27 +0,0 @@
1
- import type { FallbackEntry } from "./model-requirements";
2
- export type ModelResolutionRequest = {
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;
7
- uiSelectedModel?: string;
8
- userModel?: string;
9
- categoryDefaultModel?: string;
10
- };
11
- constraints: {
12
- availableModels: Set<string>;
13
- connectedProviders?: string[];
14
- };
15
- policy?: {
16
- fallbackChain?: FallbackEntry[];
17
- systemDefaultModel?: string;
18
- };
19
- };
20
- export type ModelResolutionProvenance = "override" | "category-default" | "provider-fallback" | "system-default";
21
- export type ModelResolutionResult = {
22
- model: string;
23
- provenance: ModelResolutionProvenance;
24
- variant?: string;
25
- attempted?: string[];
26
- reason?: string;
27
- };
@@ -1,24 +0,0 @@
1
- import type { FallbackEntry } from "./model-requirements";
2
- import type { ModelResolutionProvenance } from "./model-resolution-types";
3
- export type ModelResolutionInput = {
4
- userModel?: string;
5
- inheritedModel?: string;
6
- systemDefault?: string;
7
- };
8
- /** @deprecated Use ModelResolutionProvenance from model-resolution-types.ts */
9
- export type ModelSource = ModelResolutionProvenance;
10
- export type ModelResolutionResult = {
11
- model: string;
12
- source: ModelResolutionProvenance;
13
- variant?: string;
14
- };
15
- export type ExtendedModelResolutionInput = {
16
- uiSelectedModel?: string;
17
- userModel?: string;
18
- categoryDefaultModel?: string;
19
- fallbackChain?: FallbackEntry[];
20
- availableModels: Set<string>;
21
- systemDefaultModel?: string;
22
- };
23
- export declare function resolveModel(input: ModelResolutionInput): string | undefined;
24
- export declare function resolveModelWithFallback(input: ExtendedModelResolutionInput): ModelResolutionResult | undefined;
@@ -1,13 +0,0 @@
1
- export type OpenCodeBinaryType = "opencode" | "opencode-desktop";
2
- export type OpenCodeConfigDirOptions = {
3
- binary: OpenCodeBinaryType;
4
- version?: string | null;
5
- checkExisting?: boolean;
6
- };
7
- export type OpenCodeConfigPaths = {
8
- configDir: string;
9
- configJson: string;
10
- configJsonc: string;
11
- packageJson: string;
12
- matrixxConfig: string;
13
- };
@@ -1,6 +0,0 @@
1
- type SessionModel = {
2
- providerID: string;
3
- modelID: string;
4
- };
5
- export declare function getSessionModel(sessionID: string): SessionModel | undefined;
6
- export {};
@@ -1,3 +0,0 @@
1
- export declare function setSessionTemperature(sessionID: string, temperature: number): void;
2
- export declare function getSessionTemperature(sessionID: string): number | undefined;
3
- export declare function clearSessionTemperature(sessionID: string): void;
@@ -1,3 +0,0 @@
1
- export declare function setSessionTools(sessionID: string, tools: Record<string, boolean>): void;
2
- export declare function getSessionTools(sessionID: string): Record<string, boolean> | undefined;
3
- export declare function clearSessionTools(): void;