opencode-matrixx 2.5.0 → 2.6.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 (102) hide show
  1. package/README.md +181 -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/index.d.ts +10 -0
  6. package/dist/cli/doctor/checks/mcp.d.ts +2 -0
  7. package/dist/cli/doctor/checks/optional.d.ts +2 -0
  8. package/dist/cli/doctor/checks/plugin.d.ts +2 -0
  9. package/dist/cli/doctor/checks/runtime.d.ts +2 -0
  10. package/dist/cli/doctor/format.d.ts +3 -0
  11. package/dist/cli/doctor/index.d.ts +9 -0
  12. package/dist/cli/doctor/types.d.ts +24 -0
  13. package/dist/cli/index.d.ts +13 -0
  14. package/dist/cli/install/index.d.ts +12 -0
  15. package/dist/cli.js +927 -0
  16. package/dist/config/index.d.ts +1 -1
  17. package/dist/config/schema/evolution.d.ts +89 -0
  18. package/dist/config/schema/headroom.d.ts +23 -0
  19. package/dist/config/schema/hooks.d.ts +6 -0
  20. package/dist/config/schema/matrixx-config.d.ts +54 -6
  21. package/dist/config/schema.d.ts +3 -3
  22. package/dist/create-hooks.d.ts +5 -0
  23. package/dist/features/background-agent/error-helpers.d.ts +0 -2
  24. package/dist/features/builtin-commands/templates/evolution.d.ts +1 -0
  25. package/dist/features/builtin-commands/types.d.ts +1 -1
  26. package/dist/features/evolution/compressor/index.d.ts +5 -0
  27. package/dist/features/evolution/compressor/interface.d.ts +5 -0
  28. package/dist/features/evolution/compressor/llm.d.ts +12 -0
  29. package/dist/features/evolution/evaluator.d.ts +11 -0
  30. package/dist/features/evolution/index.d.ts +7 -0
  31. package/dist/features/evolution/pipeline.d.ts +7 -0
  32. package/dist/features/evolution/store.d.ts +22 -0
  33. package/dist/features/evolution/types.d.ts +51 -0
  34. package/dist/features/evolution/writer.d.ts +20 -0
  35. package/dist/features/task-storage/types.d.ts +2 -2
  36. package/dist/features/task-toast-manager/types.d.ts +2 -2
  37. package/dist/hooks/anthropic-context-window-limit-recovery/message-builder.d.ts +0 -1
  38. package/dist/hooks/anthropic-context-window-limit-recovery/tool-part-types.d.ts +2 -1
  39. package/dist/hooks/evolution-compressor/index.d.ts +15 -0
  40. package/dist/hooks/evolution-hitl/index.d.ts +12 -0
  41. package/dist/hooks/evolution-quality-gate/index.d.ts +6 -0
  42. package/dist/hooks/evolution-watcher/index.d.ts +21 -0
  43. package/dist/hooks/evolution-watcher/utils.d.ts +5 -0
  44. package/dist/hooks/index.d.ts +6 -0
  45. package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
  46. package/dist/hooks/keyword-detector/constants.d.ts +1 -1
  47. package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
  48. package/dist/hooks/keyword-detector/ultrawork/deepseek.d.ts +16 -0
  49. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +5 -2
  50. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +12 -0
  51. package/dist/hooks/keyword-detector/ultrawork/glm.d.ts +11 -0
  52. package/dist/hooks/keyword-detector/ultrawork/gpt5.2.d.ts +4 -7
  53. package/dist/hooks/keyword-detector/ultrawork/index.d.ts +11 -3
  54. package/dist/hooks/keyword-detector/ultrawork/mimo.d.ts +16 -0
  55. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +17 -5
  56. package/dist/hooks/matrix-loop/with-timeout.d.ts +1 -1
  57. package/dist/hooks/mcp-startup-notification/index.d.ts +9 -0
  58. package/dist/hooks/session-recovery/types.d.ts +2 -1
  59. package/dist/hooks/task-todo-mirror/constants.d.ts +3 -0
  60. package/dist/hooks/task-todo-mirror/hook.d.ts +43 -0
  61. package/dist/hooks/task-todo-mirror/index.d.ts +2 -0
  62. package/dist/hooks/think-mode/types.d.ts +3 -0
  63. package/dist/index.js +6136 -3867
  64. package/dist/matrixx.schema.json +5412 -0
  65. package/dist/mcp/index.d.ts +10 -1
  66. package/dist/mcp/mcp-startup-state.d.ts +4 -0
  67. package/dist/mcp/mcp-validator.d.ts +13 -0
  68. package/dist/plugin/hooks/create-continuation-hooks.d.ts +3 -1
  69. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  70. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
  71. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +3 -1
  72. package/dist/plugin-handlers/agent-config-handler.d.ts +1 -0
  73. package/dist/shared/delay.d.ts +1 -0
  74. package/dist/shared/error-formatting.d.ts +1 -0
  75. package/dist/shared/format-bytes.d.ts +1 -0
  76. package/dist/shared/format-bytes.test.d.ts +1 -0
  77. package/dist/shared/index.d.ts +7 -9
  78. package/dist/shared/is-abort-error.test.d.ts +1 -0
  79. package/dist/shared/model-resolution-pipeline.d.ts +26 -1
  80. package/dist/shared/opencode-config-dir.d.ts +13 -2
  81. package/dist/shared/sentinels.d.ts +2 -0
  82. package/dist/shared/session-state.d.ts +15 -0
  83. package/dist/shared/status-types.d.ts +1 -0
  84. package/dist/shared/with-timeout.d.ts +1 -0
  85. package/dist/shared/with-timeout.test.d.ts +1 -0
  86. package/dist/tools/background-task/delay.d.ts +1 -1
  87. package/dist/tools/index.d.ts +1 -0
  88. package/dist/tools/pdf-extract-figures/index.d.ts +1 -0
  89. package/dist/tools/pdf-extract-figures/tools.d.ts +11 -0
  90. package/dist/tools/task/todo-sync.d.ts +1 -1
  91. package/dist/tools/task/types.d.ts +5 -5
  92. package/package.json +15 -4
  93. package/dist/config/schema/model-capabilities.d.ts +0 -8
  94. package/dist/hooks/runtime-fallback/is-abort-error.d.ts +0 -1
  95. package/dist/shared/is-object.d.ts +0 -1
  96. package/dist/shared/model-resolution-types.d.ts +0 -27
  97. package/dist/shared/model-resolver.d.ts +0 -24
  98. package/dist/shared/opencode-config-dir-types.d.ts +0 -13
  99. package/dist/shared/session-model-state.d.ts +0 -6
  100. package/dist/shared/session-temperature-store.d.ts +0 -3
  101. package/dist/shared/session-tools-store.d.ts +0 -3
  102. /package/dist/{hooks/architect → shared}/is-abort-error.d.ts +0 -0
@@ -1,3 +1,3 @@
1
1
  export { expandPreset, PRESET_NAMES, type PresetName } from "./presets";
2
- export type { AgentDefinitions, AgentName, AgentOverrideConfig, AgentOverrides, BuiltinCommandName, EnvFileGuardConfig, ExperimentalConfig, HookName, MatrixLoopConfig, MatrixxConfig, McpName, ModelCapabilitiesConfig, MorpheusAgentConfig, MorpheusConfig, MorpheusTasksConfig, RuntimeFallbackConfig, SecretScanningConfig, SecurityConfig, TmuxConfig, TmuxLayout, } from "./schema";
2
+ export type { AgentDefinitions, AgentName, AgentOverrideConfig, AgentOverrides, BuiltinCommandName, EnvFileGuardConfig, ExperimentalConfig, HookName, MatrixLoopConfig, MatrixxConfig, McpName, MorpheusAgentConfig, MorpheusConfig, MorpheusTasksConfig, RuntimeFallbackConfig, SecretScanningConfig, SecurityConfig, TmuxConfig, TmuxLayout, } from "./schema";
3
3
  export { AgentOverrideConfigSchema, AgentOverridesSchema, BuiltinCommandNameSchema, ExperimentalConfigSchema, HookNameSchema, MatrixLoopConfigSchema, MatrixxConfigSchema, McpNameSchema, MorpheusAgentConfigSchema, RuntimeFallbackConfigSchema, SecurityConfigSchema, TmuxConfigSchema, TmuxLayoutSchema, } from "./schema";
@@ -0,0 +1,89 @@
1
+ import { z } from "zod";
2
+ export declare const EvolutionWatcherConfigSchema: z.ZodDefault<z.ZodObject<{
3
+ maxArgChars: z.ZodDefault<z.ZodNumber>;
4
+ maxOutputChars: z.ZodDefault<z.ZodNumber>;
5
+ skipTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
6
+ }, z.core.$strip>>;
7
+ export type EvolutionWatcherConfig = z.infer<typeof EvolutionWatcherConfigSchema>;
8
+ export declare const EvolutionCompressorConfigSchema: z.ZodDefault<z.ZodObject<{
9
+ provider: z.ZodDefault<z.ZodEnum<{
10
+ llm: "llm";
11
+ "dspy-gepa": "dspy-gepa";
12
+ }>>;
13
+ model: z.ZodOptional<z.ZodString>;
14
+ minTraces: z.ZodDefault<z.ZodNumber>;
15
+ maxInputTokens: z.ZodDefault<z.ZodNumber>;
16
+ trigger: z.ZodDefault<z.ZodEnum<{
17
+ compacting: "compacting";
18
+ idle: "idle";
19
+ both: "both";
20
+ }>>;
21
+ }, z.core.$strip>>;
22
+ export type EvolutionCompressorConfig = z.infer<typeof EvolutionCompressorConfigSchema>;
23
+ export declare const EvolutionWriterConfigSchema: z.ZodDefault<z.ZodObject<{
24
+ outputDir: z.ZodDefault<z.ZodString>;
25
+ globalSkills: z.ZodDefault<z.ZodBoolean>;
26
+ allowToolGeneration: z.ZodDefault<z.ZodBoolean>;
27
+ allowAgentGeneration: z.ZodDefault<z.ZodBoolean>;
28
+ }, z.core.$strip>>;
29
+ export type EvolutionWriterConfig = z.infer<typeof EvolutionWriterConfigSchema>;
30
+ export declare const EvolutionGovernanceConfigSchema: z.ZodDefault<z.ZodObject<{
31
+ requireApproval: z.ZodDefault<z.ZodBoolean>;
32
+ autoPromote: z.ZodDefault<z.ZodBoolean>;
33
+ autoPromoteThreshold: z.ZodDefault<z.ZodNumber>;
34
+ minConfidence: z.ZodDefault<z.ZodNumber>;
35
+ }, z.core.$strip>>;
36
+ export type EvolutionGovernanceConfig = z.infer<typeof EvolutionGovernanceConfigSchema>;
37
+ export declare const EvolutionRetentionConfigSchema: z.ZodDefault<z.ZodObject<{
38
+ traceDays: z.ZodDefault<z.ZodNumber>;
39
+ maxPending: z.ZodDefault<z.ZodNumber>;
40
+ }, z.core.$strip>>;
41
+ export type EvolutionRetentionConfig = z.infer<typeof EvolutionRetentionConfigSchema>;
42
+ export declare const EvolutionBudgetConfigSchema: z.ZodDefault<z.ZodObject<{
43
+ maxCompressionsPerHour: z.ZodDefault<z.ZodNumber>;
44
+ maxCostCentsPerDay: z.ZodDefault<z.ZodNumber>;
45
+ }, z.core.$strip>>;
46
+ export type EvolutionBudgetConfig = z.infer<typeof EvolutionBudgetConfigSchema>;
47
+ export declare const EvolutionConfigSchema: z.ZodObject<{
48
+ enabled: z.ZodDefault<z.ZodBoolean>;
49
+ watcher: z.ZodDefault<z.ZodObject<{
50
+ maxArgChars: z.ZodDefault<z.ZodNumber>;
51
+ maxOutputChars: z.ZodDefault<z.ZodNumber>;
52
+ skipTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
53
+ }, z.core.$strip>>;
54
+ compressor: z.ZodDefault<z.ZodObject<{
55
+ provider: z.ZodDefault<z.ZodEnum<{
56
+ llm: "llm";
57
+ "dspy-gepa": "dspy-gepa";
58
+ }>>;
59
+ model: z.ZodOptional<z.ZodString>;
60
+ minTraces: z.ZodDefault<z.ZodNumber>;
61
+ maxInputTokens: z.ZodDefault<z.ZodNumber>;
62
+ trigger: z.ZodDefault<z.ZodEnum<{
63
+ compacting: "compacting";
64
+ idle: "idle";
65
+ both: "both";
66
+ }>>;
67
+ }, z.core.$strip>>;
68
+ writer: z.ZodDefault<z.ZodObject<{
69
+ outputDir: z.ZodDefault<z.ZodString>;
70
+ globalSkills: z.ZodDefault<z.ZodBoolean>;
71
+ allowToolGeneration: z.ZodDefault<z.ZodBoolean>;
72
+ allowAgentGeneration: z.ZodDefault<z.ZodBoolean>;
73
+ }, z.core.$strip>>;
74
+ governance: z.ZodDefault<z.ZodObject<{
75
+ requireApproval: z.ZodDefault<z.ZodBoolean>;
76
+ autoPromote: z.ZodDefault<z.ZodBoolean>;
77
+ autoPromoteThreshold: z.ZodDefault<z.ZodNumber>;
78
+ minConfidence: z.ZodDefault<z.ZodNumber>;
79
+ }, z.core.$strip>>;
80
+ retention: z.ZodDefault<z.ZodObject<{
81
+ traceDays: z.ZodDefault<z.ZodNumber>;
82
+ maxPending: z.ZodDefault<z.ZodNumber>;
83
+ }, z.core.$strip>>;
84
+ budget: z.ZodDefault<z.ZodObject<{
85
+ maxCompressionsPerHour: z.ZodDefault<z.ZodNumber>;
86
+ maxCostCentsPerDay: z.ZodDefault<z.ZodNumber>;
87
+ }, z.core.$strip>>;
88
+ }, z.core.$strip>;
89
+ export type EvolutionConfig = z.infer<typeof EvolutionConfigSchema>;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Headroom network-proxy compression configuration.
4
+ *
5
+ * Headroom is an external network-proxy that compresses LLM traffic
6
+ * (CacheAligner → ContentRouter → CCR pipeline). Matrixx does NOT
7
+ * implement compression itself — it only detects/disciplines when
8
+ * Headroom is active.
9
+ *
10
+ * - Opt-in via `enabled: true` (default: false).
11
+ * - Recommended usage is `HEADROOM_WRAP=1 headroom wrap -- <command>`
12
+ * so the proxy sits transparently in front of the transport.
13
+ * - Native transport integration is deferred until the compaction hook
14
+ * stabilizes (Headroom #76 collision risk with
15
+ * anthropic-context-window-limit-recovery).
16
+ */
17
+ export declare const HeadroomConfigSchema: z.ZodObject<{
18
+ enabled: z.ZodDefault<z.ZodBoolean>;
19
+ proxyUrl: z.ZodOptional<z.ZodString>;
20
+ project: z.ZodOptional<z.ZodString>;
21
+ backend: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ export type HeadroomConfig = z.infer<typeof HeadroomConfigSchema>;
@@ -4,6 +4,8 @@ export declare const HookNameSchema: z.ZodEnum<{
4
4
  "quality-gate": "quality-gate";
5
5
  "matrix-loop": "matrix-loop";
6
6
  "start-work": "start-work";
7
+ "evolution-watcher": "evolution-watcher";
8
+ "evolution-compressor": "evolution-compressor";
7
9
  "todo-continuation-enforcer": "todo-continuation-enforcer";
8
10
  "context-window-monitor": "context-window-monitor";
9
11
  "session-recovery": "session-recovery";
@@ -55,7 +57,11 @@ export declare const HookNameSchema: z.ZodEnum<{
55
57
  "hashline-edit-diff-enhancer": "hashline-edit-diff-enhancer";
56
58
  "tool-pair-validator": "tool-pair-validator";
57
59
  "task-notepad": "task-notepad";
60
+ "task-todo-mirror": "task-todo-mirror";
58
61
  "design-intent-preserver": "design-intent-preserver";
59
62
  "rtk-bash-rewriter": "rtk-bash-rewriter";
63
+ "mcp-startup-notification": "mcp-startup-notification";
64
+ "evolution-quality-gate": "evolution-quality-gate";
65
+ "evolution-hitl": "evolution-hitl";
60
66
  }>;
61
67
  export type HookName = z.infer<typeof HookNameSchema>;
@@ -72,6 +72,8 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
72
72
  "quality-gate": "quality-gate";
73
73
  "matrix-loop": "matrix-loop";
74
74
  "start-work": "start-work";
75
+ "evolution-watcher": "evolution-watcher";
76
+ "evolution-compressor": "evolution-compressor";
75
77
  "todo-continuation-enforcer": "todo-continuation-enforcer";
76
78
  "context-window-monitor": "context-window-monitor";
77
79
  "session-recovery": "session-recovery";
@@ -123,8 +125,12 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
123
125
  "hashline-edit-diff-enhancer": "hashline-edit-diff-enhancer";
124
126
  "tool-pair-validator": "tool-pair-validator";
125
127
  "task-notepad": "task-notepad";
128
+ "task-todo-mirror": "task-todo-mirror";
126
129
  "design-intent-preserver": "design-intent-preserver";
127
130
  "rtk-bash-rewriter": "rtk-bash-rewriter";
131
+ "mcp-startup-notification": "mcp-startup-notification";
132
+ "evolution-quality-gate": "evolution-quality-gate";
133
+ "evolution-hitl": "evolution-hitl";
128
134
  }>>>;
129
135
  disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
130
136
  "bdd-contract": "bdd-contract";
@@ -1892,21 +1898,63 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
1892
1898
  notify_on_fallback: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1893
1899
  }, z.core.$strip>>;
1894
1900
  agent_definitions: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1895
- model_capabilities: z.ZodOptional<z.ZodObject<{
1896
- enabled: z.ZodOptional<z.ZodBoolean>;
1897
- auto_refresh_on_start: z.ZodOptional<z.ZodBoolean>;
1898
- refresh_timeout_ms: z.ZodOptional<z.ZodNumber>;
1899
- source_url: z.ZodOptional<z.ZodString>;
1900
- }, z.core.$strip>>;
1901
1901
  matrixx_self_config: z.ZodOptional<z.ZodObject<{
1902
1902
  enabled: z.ZodDefault<z.ZodBoolean>;
1903
1903
  proactive: z.ZodDefault<z.ZodBoolean>;
1904
1904
  }, z.core.$strip>>;
1905
+ headroom: z.ZodOptional<z.ZodObject<{
1906
+ enabled: z.ZodDefault<z.ZodBoolean>;
1907
+ proxyUrl: z.ZodOptional<z.ZodString>;
1908
+ project: z.ZodOptional<z.ZodString>;
1909
+ backend: z.ZodOptional<z.ZodString>;
1910
+ }, z.core.$strip>>;
1905
1911
  rtk: z.ZodOptional<z.ZodObject<{
1906
1912
  enabled: z.ZodDefault<z.ZodBoolean>;
1907
1913
  binary_path: z.ZodOptional<z.ZodString>;
1908
1914
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1909
1915
  }, z.core.$strip>>;
1916
+ evolution: z.ZodOptional<z.ZodObject<{
1917
+ enabled: z.ZodDefault<z.ZodBoolean>;
1918
+ watcher: z.ZodDefault<z.ZodObject<{
1919
+ maxArgChars: z.ZodDefault<z.ZodNumber>;
1920
+ maxOutputChars: z.ZodDefault<z.ZodNumber>;
1921
+ skipTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
1922
+ }, z.core.$strip>>;
1923
+ compressor: z.ZodDefault<z.ZodObject<{
1924
+ provider: z.ZodDefault<z.ZodEnum<{
1925
+ llm: "llm";
1926
+ "dspy-gepa": "dspy-gepa";
1927
+ }>>;
1928
+ model: z.ZodOptional<z.ZodString>;
1929
+ minTraces: z.ZodDefault<z.ZodNumber>;
1930
+ maxInputTokens: z.ZodDefault<z.ZodNumber>;
1931
+ trigger: z.ZodDefault<z.ZodEnum<{
1932
+ compacting: "compacting";
1933
+ idle: "idle";
1934
+ both: "both";
1935
+ }>>;
1936
+ }, z.core.$strip>>;
1937
+ writer: z.ZodDefault<z.ZodObject<{
1938
+ outputDir: z.ZodDefault<z.ZodString>;
1939
+ globalSkills: z.ZodDefault<z.ZodBoolean>;
1940
+ allowToolGeneration: z.ZodDefault<z.ZodBoolean>;
1941
+ allowAgentGeneration: z.ZodDefault<z.ZodBoolean>;
1942
+ }, z.core.$strip>>;
1943
+ governance: z.ZodDefault<z.ZodObject<{
1944
+ requireApproval: z.ZodDefault<z.ZodBoolean>;
1945
+ autoPromote: z.ZodDefault<z.ZodBoolean>;
1946
+ autoPromoteThreshold: z.ZodDefault<z.ZodNumber>;
1947
+ minConfidence: z.ZodDefault<z.ZodNumber>;
1948
+ }, z.core.$strip>>;
1949
+ retention: z.ZodDefault<z.ZodObject<{
1950
+ traceDays: z.ZodDefault<z.ZodNumber>;
1951
+ maxPending: z.ZodDefault<z.ZodNumber>;
1952
+ }, z.core.$strip>>;
1953
+ budget: z.ZodDefault<z.ZodObject<{
1954
+ maxCompressionsPerHour: z.ZodDefault<z.ZodNumber>;
1955
+ maxCostCentsPerDay: z.ZodDefault<z.ZodNumber>;
1956
+ }, z.core.$strip>>;
1957
+ }, z.core.$strip>>;
1910
1958
  _migrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
1911
1959
  }, z.core.$strip>;
1912
1960
  export type MatrixxConfig = z.infer<typeof MatrixxConfigSchema>;
@@ -8,15 +8,15 @@ export * from "./schema/background-task";
8
8
  export * from "./schema/browser-automation";
9
9
  export * from "./schema/categories";
10
10
  export * from "./schema/commands";
11
- export * from "./schema/commands";
12
11
  export * from "./schema/comment-checker";
13
12
  export * from "./schema/dcp";
13
+ export * from "./schema/evolution";
14
14
  export * from "./schema/experimental";
15
- export * from "./schema/experimental";
15
+ export * from "./schema/headroom";
16
16
  export * from "./schema/hooks";
17
17
  export * from "./schema/matrix-loop";
18
18
  export * from "./schema/matrixx-config";
19
- export * from "./schema/model-capabilities";
19
+ export * from "./schema/matrixx-self-config";
20
20
  export * from "./schema/morpheus";
21
21
  export * from "./schema/morpheus-agent";
22
22
  export * from "./schema/notification";
@@ -23,6 +23,8 @@ export declare function createHooks(args: {
23
23
  backgroundNotificationHook: ReturnType<typeof import("./hooks").createBackgroundNotificationHook> | null;
24
24
  architectHook: ReturnType<typeof import("./hooks").createArchitectHook> | null;
25
25
  planPersister: ReturnType<typeof import("./hooks").createPlanPersister> | null;
26
+ evolutionCompressor: ReturnType<typeof import("./hooks").createEvolutionCompressorHook> | null;
27
+ evolutionHitl: ReturnType<typeof import("./hooks").createEvolutionHitlHook> | null;
26
28
  keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
27
29
  contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
28
30
  envContextInjector: ReturnType<typeof import("./hooks").createEnvContextInjectorHook> | null;
@@ -48,6 +50,8 @@ export declare function createHooks(args: {
48
50
  hashlineEditDiffEnhancer: ReturnType<typeof import("./hooks").createHashlineEditDiffEnhancerHook> | null;
49
51
  qualityGate: ReturnType<typeof import("./hooks").createQualityGateHook> | null;
50
52
  taskNotepad: ReturnType<typeof import("./hooks").createTaskNotepadHook> | null;
53
+ evolutionWatcher: ReturnType<typeof import("./hooks").createEvolutionWatcherHook> | null;
54
+ taskTodoMirror: ReturnType<typeof import("./hooks").createTaskTodoMirrorHook> | null;
51
55
  contextWindowMonitor: ReturnType<typeof import("./hooks").createContextWindowMonitorHook> | null;
52
56
  preemptiveCompaction: ReturnType<typeof import("./hooks").createPreemptiveCompactionHook> | null;
53
57
  sessionRecovery: ReturnType<typeof import("./hooks").createSessionRecoveryHook> | null;
@@ -69,4 +73,5 @@ export declare function createHooks(args: {
69
73
  anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
70
74
  runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
71
75
  rtkBashRewriter: ReturnType<typeof import("./hooks").createRtkBashRewriterHook> | null;
76
+ mcpStartupNotification: ReturnType<typeof import("./hooks").createMcpStartupNotificationHook> | null;
72
77
  };
@@ -1,6 +1,4 @@
1
1
  import type { EventProperties } from "./manager";
2
- export declare function formatDuration(start: Date, end?: Date): string;
3
2
  export declare function getErrorText(error: unknown): string;
4
3
  export declare function isAbortedSessionError(error: unknown): boolean;
5
- export declare function isRecord(value: unknown): value is Record<string, unknown>;
6
4
  export declare function getSessionErrorMessage(properties: EventProperties): string | undefined;
@@ -0,0 +1 @@
1
+ export declare const EVOLUTION_TEMPLATE = "# Evolution Command\n\n## Purpose\n\nManage self-evolution proposals staged in `.matrixx/evolution/pending`.\n\n## Commands\n\n- `/evolution list` \u2014 list pending proposals\n- `/evolution approve <slug>` \u2014 promote pending skill to `.opencode/skills/<slug>/SKILL.md`\n- `/evolution reject <slug>` \u2014 discard pending proposal\n- `/evolution audit` \u2014 show last 20 audit entries\n\n---\n\n# PHASE 1: PARSE ARGUMENTS\n\nArguments: $ARGUMENTS\n\n- If empty or \"list\": list pending\n- If \"approve <slug>\" or \"approve <slug> --global\": promote\n- If \"reject <slug>\": discard\n- If \"audit\" or \"log\": show audit\n- Otherwise: show help and list pending\n\n---\n\n# PHASE 2: EXECUTE\n\n## List\n\nUse bash: `ls -1 .matrixx/evolution/pending/*.md 2>/dev/null | xargs -I {} basename {} .md` or `rtk ls .matrixx/evolution/pending`\nFor each slug, read `.matrixx/evolution/pending/<slug>.meta.json` to show confidence, version, derived_from.\nIf none: \"No pending evolution proposals.\"\n\n## Approve\n\n1. Verify `.matrixx/evolution/pending/<slug>.md` exists \u2014 if not, error: \"Pending <slug> not found. Run /evolution list to see available.\"\n2. Copy staged skill:\n - `mkdir -p .opencode/skills/<slug>`\n - `cp .matrixx/evolution/pending/<slug>.md .opencode/skills/<slug>/SKILL.md`\n - Also preserve versioned copy: `mkdir -p .matrixx/evolution/skills/<slug>/versions && cp .matrixx/evolution/pending/<slug>.md .matrixx/evolution/skills/<slug>/SKILL.md`\n3. Append audit: `echo '{\"action\":\"promoted\",\"slug\":\"<slug>\",\"timestamp\":\"'$(date -Iseconds)'\"}' >> .matrixx/evolution/audit.log`\n4. Remove pending: `rm .matrixx/evolution/pending/<slug>.md .matrixx/evolution/pending/<slug>.meta.json`\n5. If argument includes --global, also copy to `~/.agents/skills/<slug>/SKILL.md`\n6. Confirm: \"Promoted <slug> to .opencode/skills/<slug>/SKILL.md \u2014 will be loaded on next session start.\"\n\n## Reject\n\n1. Verify pending exists\n2. `rm .matrixx/evolution/pending/<slug>.md .matrixx/evolution/pending/<slug>.meta.json`\n3. Append audit with action rejected\n4. Confirm: \"Rejected <slug>.\"\n\n## Audit\n\nRead `.matrixx/evolution/audit.log` last 20 lines: `tail -n 20 .matrixx/evolution/audit.log 2>/dev/null || echo \"No audit entries.\"`\n\n---\n\n# CONSTRAINTS\n\n- Use bash/rtk for file ops \u2014 no dedicated evolution tool yet\n- Never invent slug \u2014 read from pending dir\n- Keep operations atomic; report errors clearly\n- Do not modify pending content \u2014 promote as-is after human review\n";
@@ -1,3 +1,3 @@
1
1
  import type { CommandDefinition } from "../command-loader";
2
- export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile";
2
+ export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile" | "evolution";
3
3
  export type BuiltinCommands = Record<string, CommandDefinition>;
@@ -0,0 +1,5 @@
1
+ export * from "./interface";
2
+ export * from "./llm";
3
+ import type { EvolutionCompressorConfig } from "../../../config/schema/evolution";
4
+ import type { Compressor } from "./interface";
5
+ export declare function createCompressor(config: EvolutionCompressorConfig, llmCall?: (prompt: string) => Promise<string>): Compressor;
@@ -0,0 +1,5 @@
1
+ import type { CompressionInput, DistilledKnowledge } from "../types";
2
+ export interface Compressor {
3
+ compress(input: CompressionInput): Promise<DistilledKnowledge>;
4
+ }
5
+ export type { CompressionInput, DistilledKnowledge, TraceRecord } from "../types";
@@ -0,0 +1,12 @@
1
+ import type { EvolutionCompressorConfig } from "../../../config/schema/evolution";
2
+ import type { CompressionInput, DistilledKnowledge } from "../types";
3
+ import type { Compressor } from "./interface";
4
+ export declare class LlmCompressor implements Compressor {
5
+ private config;
6
+ private llmCall?;
7
+ constructor(options: {
8
+ config: EvolutionCompressorConfig;
9
+ llmCall?: (prompt: string) => Promise<string>;
10
+ });
11
+ compress(input: CompressionInput): Promise<DistilledKnowledge>;
12
+ }
@@ -0,0 +1,11 @@
1
+ import type { SkillMeta } from "./types";
2
+ export declare function containsSecretForEval(text: string): boolean;
3
+ export type EvalResult = {
4
+ score: number;
5
+ demoted: boolean;
6
+ };
7
+ export declare function readMeta(slug: string, projectRoot?: string): Promise<SkillMeta | null>;
8
+ export declare function evaluateSkill(slug: string, opts?: {
9
+ threshold?: number;
10
+ projectRoot?: string;
11
+ }): Promise<EvalResult>;
@@ -0,0 +1,7 @@
1
+ export { createCompressor } from "./compressor";
2
+ export { LlmCompressor } from "./compressor/llm";
3
+ export * from "./evaluator";
4
+ export * from "./pipeline";
5
+ export * from "./store";
6
+ export * from "./types";
7
+ export * from "./writer";
@@ -0,0 +1,7 @@
1
+ import type { EvolutionConfig } from "../../config/schema/evolution";
2
+ import type { CompressionInput } from "./types";
3
+ export declare function runEvolutionPipeline(input: CompressionInput, config: EvolutionConfig): Promise<{
4
+ staged?: string;
5
+ promoted?: string;
6
+ reason?: string;
7
+ }>;
@@ -0,0 +1,22 @@
1
+ import type { EvolutionState, TraceRecord } from "./types";
2
+ export declare const EVOLUTION_DIR = ".matrixx/evolution";
3
+ export declare const TRACES_DIR = ".matrixx/evolution/traces";
4
+ export declare const DISTILLED_DIR = ".matrixx/evolution/distilled";
5
+ export declare const SKILLS_DIR = ".matrixx/evolution/skills";
6
+ export declare const PENDING_DIR = ".matrixx/evolution/pending";
7
+ export declare const STATE_FILE = ".matrixx/evolution/state.json";
8
+ export declare const AUDIT_FILE = ".matrixx/evolution/audit.log";
9
+ export declare class TraceStore {
10
+ private ringBuffer;
11
+ private evolutionDir;
12
+ constructor(evolutionDir?: string);
13
+ append(record: TraceRecord): Promise<void>;
14
+ getRecent(count?: number): TraceRecord[];
15
+ readSession(sessionID: string): Promise<TraceRecord[]>;
16
+ getAllTraces(sessionID: string): Promise<TraceRecord[]>;
17
+ cleanup(retentionDays: number): Promise<void>;
18
+ getState(): Promise<EvolutionState>;
19
+ updateState(patch: Partial<EvolutionState>): Promise<void>;
20
+ appendAudit(entry: Record<string, unknown>): Promise<void>;
21
+ }
22
+ export declare const traceStore: TraceStore;
@@ -0,0 +1,51 @@
1
+ export type TraceRecord = {
2
+ id: string;
3
+ sessionID: string;
4
+ callID: string;
5
+ timestamp: string;
6
+ agent: string;
7
+ tool: string;
8
+ args: unknown;
9
+ output: string;
10
+ durationMs: number;
11
+ success: boolean;
12
+ errorType?: string;
13
+ model?: string;
14
+ };
15
+ export type DistilledKnowledge = {
16
+ title: string;
17
+ summary: string;
18
+ patterns: string[];
19
+ pitfalls: string[];
20
+ prerequisites: string[];
21
+ skillDraft?: string;
22
+ confidence: number;
23
+ sourceSessionIDs: string[];
24
+ };
25
+ export type CompressionInput = {
26
+ sessionID: string;
27
+ traces: TraceRecord[];
28
+ messages?: unknown[];
29
+ notepads?: string[];
30
+ handoff?: unknown;
31
+ taskHistory?: unknown[];
32
+ };
33
+ export interface Compressor {
34
+ compress(input: CompressionInput): Promise<DistilledKnowledge>;
35
+ }
36
+ export type EvolutionState = {
37
+ totalTraces: number;
38
+ totalCompressions: number;
39
+ lastCompressionAt?: string;
40
+ lastPromptAt?: string;
41
+ };
42
+ export type SkillMeta = {
43
+ name: string;
44
+ version: string;
45
+ derived_from: string[];
46
+ created_at: string;
47
+ confidence: number;
48
+ eval_score?: number | null;
49
+ tags?: string[];
50
+ prerequisites?: string[];
51
+ };
@@ -0,0 +1,20 @@
1
+ import type { EvolutionWriterConfig } from "../../config/schema/evolution";
2
+ import type { DistilledKnowledge } from "./types";
3
+ export declare class EvolutionWriter {
4
+ private pendingDir;
5
+ private skillsDir;
6
+ private promotedBase;
7
+ private globalBase?;
8
+ constructor(config: EvolutionWriterConfig, projectRoot?: string);
9
+ stage(knowledge: DistilledKnowledge): Promise<{
10
+ slug: string;
11
+ pendingPath: string;
12
+ metaPath: string;
13
+ }>;
14
+ promote(slug: string): Promise<{
15
+ promotedPath: string;
16
+ }>;
17
+ reject(slug: string): Promise<void>;
18
+ listPending(): Promise<string[]>;
19
+ listPromoted(): Promise<string[]>;
20
+ }
@@ -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 TaskSchema: 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>;
@@ -1,9 +1,9 @@
1
- import type { ModelSource } from "../../shared/model-resolver";
1
+ import type { ModelResolutionProvenance } from "../../shared/model-resolution-pipeline";
2
2
  export type TaskStatus = "running" | "queued" | "completed" | "error";
3
3
  export interface ModelFallbackInfo {
4
4
  model: string;
5
5
  type: "user-defined" | "inherited" | "category-default" | "system-default";
6
- source?: ModelSource;
6
+ source?: ModelResolutionProvenance;
7
7
  }
8
8
  export interface TrackedTask {
9
9
  id: string;
@@ -2,6 +2,5 @@ import type { PluginInput } from "@opencode-ai/plugin";
2
2
  export declare const PLACEHOLDER_TEXT = "[user interrupted]";
3
3
  type OpencodeClient = PluginInput["client"];
4
4
  export declare function sanitizeEmptyMessagesBeforeSummarize(sessionID: string, client?: OpencodeClient): Promise<number>;
5
- export declare function formatBytes(bytes: number): string;
6
5
  export declare function getLastAssistant(sessionID: string, client: OpencodeClient, directory: string): Promise<Record<string, unknown> | null>;
7
6
  export {};
@@ -1,3 +1,4 @@
1
+ import type { TaskStatus } from "../../shared/status-types";
1
2
  export interface StoredToolPart {
2
3
  id: string;
3
4
  sessionID: string;
@@ -6,7 +7,7 @@ export interface StoredToolPart {
6
7
  callID: string;
7
8
  tool: string;
8
9
  state: {
9
- status: "pending" | "running" | "completed" | "error";
10
+ status: TaskStatus;
10
11
  input: Record<string, unknown>;
11
12
  output?: string;
12
13
  error?: string;
@@ -0,0 +1,15 @@
1
+ import type { EvolutionConfig } from "../../config/schema/evolution";
2
+ import type { PluginContext } from "../../plugin/types";
3
+ export declare function createEvolutionCompressorHook(a?: PluginContext | EvolutionConfig, b?: EvolutionConfig): {
4
+ event: (input: {
5
+ event: {
6
+ type: string;
7
+ properties?: Record<string, unknown>;
8
+ };
9
+ }) => Promise<void>;
10
+ "experimental.session.compacting": (input: {
11
+ sessionID: string;
12
+ }, _output: {
13
+ context: string[];
14
+ }) => Promise<void>;
15
+ };
@@ -0,0 +1,12 @@
1
+ import type { Message, Part } from "@opencode-ai/sdk";
2
+ type MessageWithParts = {
3
+ info: Message;
4
+ parts: Part[];
5
+ };
6
+ type TransformOutput = {
7
+ messages: MessageWithParts[];
8
+ };
9
+ export declare function createEvolutionHitlHook(a?: unknown, b?: unknown): {
10
+ "experimental.chat.messages.transform": (_input: Record<string, never>, output: TransformOutput) => Promise<void>;
11
+ };
12
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { EvolutionGovernanceConfig } from "../../config/schema/evolution";
2
+ import type { DistilledKnowledge } from "../../features/evolution/types";
3
+ export declare function passesQualityGate(knowledge: DistilledKnowledge, config: EvolutionGovernanceConfig): {
4
+ pass: boolean;
5
+ reason?: string;
6
+ };
@@ -0,0 +1,21 @@
1
+ import type { EvolutionConfig } from "../../config/schema/evolution";
2
+ import type { PluginContext } from "../../plugin/types";
3
+ export { classifySuccess, truncate } from "./utils";
4
+ export declare function createEvolutionWatcherHook(a?: PluginContext | EvolutionConfig, b?: EvolutionConfig): {
5
+ "tool.execute.before": (input: {
6
+ tool: string;
7
+ sessionID: string;
8
+ callID: string;
9
+ }, output: {
10
+ args: Record<string, unknown>;
11
+ }) => Promise<void>;
12
+ "tool.execute.after": (input: {
13
+ tool: string;
14
+ sessionID: string;
15
+ callID: string;
16
+ }, output: {
17
+ title: string;
18
+ output: string;
19
+ metadata: Record<string, unknown>;
20
+ }) => Promise<void>;
21
+ };
@@ -0,0 +1,5 @@
1
+ export declare function truncate(value: string, maxChars: number): string;
2
+ export declare function classifySuccess(tool: string, output: string): {
3
+ success: boolean;
4
+ errorType?: string;
5
+ };
@@ -18,12 +18,17 @@ export { createEditErrorRecoveryHook } from "./edit-error-recovery";
18
18
  export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
19
19
  export { createEnvContextInjectorHook } from "./env-context-injector";
20
20
  export { createEnvFileWriteGuardHook } from "./env-file-write-guard";
21
+ export { createEvolutionCompressorHook } from "./evolution-compressor";
22
+ export { createEvolutionHitlHook } from "./evolution-hitl";
23
+ export { passesQualityGate } from "./evolution-quality-gate";
24
+ export { createEvolutionWatcherHook } from "./evolution-watcher";
21
25
  export { createHashlineEditDiffEnhancerHook } from "./hashline-edit-diff-enhancer";
22
26
  export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
23
27
  export { createInteractiveBashSessionHook } from "./interactive-bash-session";
24
28
  export { createJsonErrorRecoveryHook } from "./json-error-recovery";
25
29
  export { createKeywordDetectorHook } from "./keyword-detector";
26
30
  export { createMatrixLoopHook, type MatrixLoopHook } from "./matrix-loop";
31
+ export { createMcpStartupNotificationHook } from "./mcp-startup-notification";
27
32
  export { createMouseNotepadHook } from "./mouse-notepad";
28
33
  export { createNonInteractiveEnvHook } from "./non-interactive-env";
29
34
  export { createOracleMdOnlyHook } from "./oracle-md-only";
@@ -46,6 +51,7 @@ export { createStartWorkHook } from "./start-work";
46
51
  export { createStopContinuationGuardHook, type StopContinuationGuard } from "./stop-continuation-guard";
47
52
  export { createTaskNotepadHook } from "./task-notepad";
48
53
  export { createTaskResumeInfoHook } from "./task-resume-info";
54
+ export { createTaskTodoMirrorHook } from "./task-todo-mirror";
49
55
  export { createTasksTodowriteDisablerHook } from "./tasks-todowrite-disabler";
50
56
  export { createThinkModeHook } from "./think-mode";
51
57
  export { createThinkingBlockValidatorHook } from "./thinking-block-validator";
@@ -9,4 +9,4 @@
9
9
  * - Vietnamese: phân tích, điều tra, nghiên cứu, kiểm tra, xem xét, chẩn đoán, giải thích, tìm hiểu, gỡ lỗi, tại sao
10
10
  */
11
11
  export declare const ANALYZE_PATTERN: RegExp;
12
- export declare const ANALYZE_MESSAGE = "[analyze-mode]\nANALYSIS MODE. Gather context before diving deep:\n\nCONTEXT GATHERING (parallel):\n- 1-2 explore agents (codebase patterns, implementations)\n- 1-2 librarian agents (if external library involved)\n- Direct tools: Grep, AST-grep, LSP for targeted searches\n\nIF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:\n- **Oracle**: Conventional problems (architecture, debugging, complex logic)\n- **Artistry**: Non-conventional problems (different approach needed)\n\nSYNTHESIZE findings before proceeding.";
12
+ export declare const ANALYZE_MESSAGE = "[analyze-mode]\nANALYSIS MODE. Gather context before diving deep:\n\nCONTEXT GATHERING (parallel):\n- 1-2 trinity agents (codebase patterns, implementations)\n- 1-2 operator agents (if external library involved)\n- Direct tools: Grep, AST-grep, LSP for targeted searches\n\nIF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:\n- **Oracle**: Conventional problems (architecture, debugging, complex logic)\n- **Matrix-bend**: Non-conventional problems (different approach needed)\n\nSYNTHESIZE findings before proceeding.";
@@ -1,4 +1,4 @@
1
- export { CODE_BLOCK_PATTERN, INLINE_CODE_PATTERN } from "../../shared";
1
+ export { CODE_BLOCK_PATTERN, INLINE_CODE_PATTERN } from "../../shared/code-patterns";
2
2
  export { ANALYZE_MESSAGE, ANALYZE_PATTERN } from "./analyze";
3
3
  export { SEARCH_MESSAGE, SEARCH_PATTERN } from "./search";
4
4
  export { getUltraworkMessage, isPlannerAgent } from "./ultrawork";
@@ -9,4 +9,4 @@
9
9
  * - Vietnamese: tìm kiếm, tra cứu, định vị, quét, phát hiện, truy tìm, tìm ra, ở đâu, liệt kê
10
10
  */
11
11
  export declare const SEARCH_PATTERN: RegExp;
12
- export declare const SEARCH_MESSAGE = "[search-mode]\nMAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:\n- explore agents (codebase patterns, file structures, ast-grep)\n- librarian agents (remote repos, official docs, GitHub examples)\nPlus direct tools: Grep, ripgrep (rg), ast-grep (sg)\nNEVER stop at first result - be exhaustive.";
12
+ export declare const SEARCH_MESSAGE = "[search-mode]\nMAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:\n- trinity agents (codebase patterns, file structures, ast-grep)\n- operator agents (remote repos, official docs, GitHub examples)\nPlus direct tools: Grep, ripgrep (rg), ast-grep (sg)\nNEVER stop at first result - be exhaustive.";