opencode-matrixx 2.6.1 → 2.6.3
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.
- package/README.md +12 -12
- package/dist/cli.js +63 -10
- package/dist/config/schema/context-mode.d.ts +7 -0
- package/dist/config/schema/experimental.d.ts +2 -0
- package/dist/config/schema/headroom.d.ts +1 -1
- package/dist/config/schema/hooks.d.ts +5 -8
- package/dist/config/schema/matrixx-config.d.ts +33 -9
- package/dist/config/schema/morpheus.d.ts +0 -2
- package/dist/config/schema/security.d.ts +49 -0
- package/dist/config/schema.d.ts +1 -0
- package/dist/create-hooks.d.ts +3 -4
- package/dist/hooks/context-mode-enforcer/constants.d.ts +6 -0
- package/dist/hooks/context-mode-enforcer/hook.d.ts +3 -0
- package/dist/hooks/context-mode-enforcer/index.d.ts +1 -0
- package/dist/hooks/context-window-limit-recovery/index.d.ts +8 -0
- package/dist/hooks/context-window-limit-recovery/parser-patterns.d.ts +11 -0
- package/dist/hooks/context-window-limit-recovery/parser.d.ts +15 -0
- package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/recovery-hook.d.ts +2 -0
- package/dist/hooks/context-window-limit-recovery/storage.d.ts +3 -0
- package/dist/hooks/{anthropic-context-window-limit-recovery/tool-result-storage-sdk.d.ts → context-window-limit-recovery/tool-result-store.d.ts} +10 -0
- package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/types.d.ts +1 -1
- package/dist/hooks/context-window-monitor.d.ts +5 -1
- package/dist/hooks/index.d.ts +3 -4
- package/dist/hooks/input-secret-guard/detection-rules.d.ts +10 -0
- package/dist/hooks/input-secret-guard/detector.d.ts +22 -0
- package/dist/hooks/input-secret-guard/detector.test.d.ts +1 -0
- package/dist/hooks/input-secret-guard/hook.d.ts +19 -0
- package/dist/hooks/input-secret-guard/hook.test.d.ts +1 -0
- package/dist/hooks/input-secret-guard/index.d.ts +1 -0
- package/dist/hooks/input-secret-guard/redactor.d.ts +2 -0
- package/dist/hooks/input-secret-guard/redactor.test.d.ts +1 -0
- package/dist/hooks/input-secret-guard/session-allow-cache.d.ts +6 -0
- package/dist/hooks/input-secret-guard/session-allow-cache.test.d.ts +1 -0
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +2 -9
- package/dist/hooks/preemptive-compaction-trigger.d.ts +1 -1
- package/dist/hooks/rules-injector/constants.d.ts +0 -1
- package/dist/hooks/rules-injector/parser.d.ts +0 -1
- package/dist/hooks/rules-injector/rule-file-finder.d.ts +2 -4
- package/dist/hooks/rules-injector/types.d.ts +2 -3
- package/dist/hooks/task-continuation-enforcer/constants.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/countdown.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/idle-event.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/ulw-bootstrap.test.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/countdown.test.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/idle-event.test.d.ts +1 -0
- package/dist/index.js +9688 -9855
- package/dist/matrixx.schema.json +176 -72
- package/dist/plugin/hooks/create-core-hooks.d.ts +3 -4
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -4
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
- package/dist/shared/context-limit-resolver.d.ts +1 -0
- package/dist/shared/context-limits.d.ts +36 -0
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/migration/hook-names.d.ts +1 -0
- package/dist/shared/model-sanitizer.d.ts +1 -1
- package/package.json +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/empty-content-recovery-sdk.d.ts +0 -11
- package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +0 -8
- package/dist/hooks/anthropic-context-window-limit-recovery/message-storage-directory.d.ts +0 -3
- package/dist/hooks/anthropic-context-window-limit-recovery/parser.d.ts +0 -2
- package/dist/hooks/anthropic-context-window-limit-recovery/storage-paths.d.ts +0 -3
- package/dist/hooks/anthropic-context-window-limit-recovery/storage.d.ts +0 -4
- package/dist/hooks/anthropic-context-window-limit-recovery/tool-result-storage.d.ts +0 -10
- package/dist/hooks/directory-readme-injector/constants.d.ts +0 -2
- package/dist/hooks/directory-readme-injector/finder.d.ts +0 -5
- package/dist/hooks/directory-readme-injector/hook.d.ts +0 -6
- package/dist/hooks/directory-readme-injector/index.d.ts +0 -1
- package/dist/hooks/directory-readme-injector/injector.d.ts +0 -16
- package/dist/hooks/directory-readme-injector/storage.d.ts +0 -1
- package/dist/hooks/mcp-startup-notification/index.d.ts +0 -9
- package/dist/hooks/question-label-truncator/hook.d.ts +0 -7
- package/dist/hooks/question-label-truncator/index.d.ts +0 -1
- package/dist/shared/migration/agent-category.d.ts +0 -19
- package/dist/shared/migration/agent-names.d.ts +0 -6
- package/dist/shared/migration/config-migration.d.ts +0 -1
- package/dist/shared/migration/model-versions.d.ts +0 -13
- package/dist/shared/migration.d.ts +0 -5
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/aggressive-truncation-strategy.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/client.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/empty-content-recovery.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/executor.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/message-builder.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/recovery-strategy.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/state.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/summarize-retry-strategy.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/target-token-truncation.d.ts +0 -0
- /package/dist/hooks/{anthropic-context-window-limit-recovery → context-window-limit-recovery}/tool-part-types.d.ts +0 -0
package/dist/matrixx.schema.json
CHANGED
|
@@ -104,71 +104,73 @@
|
|
|
104
104
|
"disabled_hooks": {
|
|
105
105
|
"type": "array",
|
|
106
106
|
"items": {
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
107
|
+
"anyOf": [
|
|
108
|
+
{
|
|
109
|
+
"type": "string",
|
|
110
|
+
"enum": [
|
|
111
|
+
"task-continuation-enforcer",
|
|
112
|
+
"todo-continuation-enforcer",
|
|
113
|
+
"context-window-monitor",
|
|
114
|
+
"session-recovery",
|
|
115
|
+
"session-notification",
|
|
116
|
+
"comment-checker",
|
|
117
|
+
"tool-output-truncator",
|
|
118
|
+
"directory-agents-injector",
|
|
119
|
+
"empty-task-response-detector",
|
|
120
|
+
"think-mode",
|
|
121
|
+
"context-window-limit-recovery",
|
|
122
|
+
"preemptive-compaction",
|
|
123
|
+
"rules-injector",
|
|
124
|
+
"background-notification",
|
|
125
|
+
"auto-update-checker",
|
|
126
|
+
"startup-toast",
|
|
127
|
+
"keyword-detector",
|
|
128
|
+
"agent-usage-reminder",
|
|
129
|
+
"non-interactive-env",
|
|
130
|
+
"interactive-bash-session",
|
|
131
|
+
"thinking-block-validator",
|
|
132
|
+
"matrix-loop",
|
|
133
|
+
"category-skill-reminder",
|
|
134
|
+
"compaction-context-injector",
|
|
135
|
+
"compaction-todo-preserver",
|
|
136
|
+
"auto-slash-command",
|
|
137
|
+
"edit-error-recovery",
|
|
138
|
+
"delegate-task-retry",
|
|
139
|
+
"oracle-md-only",
|
|
140
|
+
"plan-persister",
|
|
141
|
+
"mouse-notepad",
|
|
142
|
+
"start-work",
|
|
143
|
+
"architect",
|
|
144
|
+
"unstable-agent-babysitter",
|
|
145
|
+
"task-resume-info",
|
|
146
|
+
"stop-continuation-guard",
|
|
147
|
+
"tasks-todowrite-disabler",
|
|
148
|
+
"write-existing-file-guard",
|
|
149
|
+
"anthropic-effort",
|
|
150
|
+
"hashline-read-enhancer",
|
|
151
|
+
"secret-leak-guard",
|
|
152
|
+
"input-secret-guard",
|
|
153
|
+
"env-context-injector",
|
|
154
|
+
"env-file-write-guard",
|
|
155
|
+
"json-error-recovery",
|
|
156
|
+
"bash-file-read-guard",
|
|
157
|
+
"runtime-fallback",
|
|
158
|
+
"read-image-resizer",
|
|
159
|
+
"webfetch-redirect-guard",
|
|
160
|
+
"hashline-edit-diff-enhancer",
|
|
161
|
+
"tool-pair-validator",
|
|
162
|
+
"quality-gate",
|
|
163
|
+
"task-notepad",
|
|
164
|
+
"design-intent-preserver",
|
|
165
|
+
"rtk-bash-rewriter",
|
|
166
|
+
"evolution-watcher",
|
|
167
|
+
"evolution-compressor",
|
|
168
|
+
"evolution-hitl",
|
|
169
|
+
"context-mode-enforcer",
|
|
170
|
+
"task-edit-guard"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{}
|
|
172
174
|
]
|
|
173
175
|
}
|
|
174
176
|
},
|
|
@@ -4070,6 +4072,16 @@
|
|
|
4070
4072
|
"type": "number",
|
|
4071
4073
|
"minimum": 1000
|
|
4072
4074
|
},
|
|
4075
|
+
"context_warning_threshold": {
|
|
4076
|
+
"type": "number",
|
|
4077
|
+
"minimum": 0.1,
|
|
4078
|
+
"maximum": 0.95
|
|
4079
|
+
},
|
|
4080
|
+
"preemptive_compaction_threshold": {
|
|
4081
|
+
"type": "number",
|
|
4082
|
+
"minimum": 0.1,
|
|
4083
|
+
"maximum": 0.95
|
|
4084
|
+
},
|
|
4073
4085
|
"safe_hook_creation": {
|
|
4074
4086
|
"type": "boolean"
|
|
4075
4087
|
},
|
|
@@ -4895,10 +4907,6 @@
|
|
|
4895
4907
|
"task_list_id": {
|
|
4896
4908
|
"type": "string"
|
|
4897
4909
|
},
|
|
4898
|
-
"claude_code_compat": {
|
|
4899
|
-
"default": false,
|
|
4900
|
-
"type": "boolean"
|
|
4901
|
-
},
|
|
4902
4910
|
"scope": {
|
|
4903
4911
|
"description": "Task storage scope: project → .matrixx/tasks per project (default), global → ~/.config/opencode/tasks/{listId}",
|
|
4904
4912
|
"default": "project",
|
|
@@ -4909,9 +4917,6 @@
|
|
|
4909
4917
|
]
|
|
4910
4918
|
}
|
|
4911
4919
|
},
|
|
4912
|
-
"required": [
|
|
4913
|
-
"claude_code_compat"
|
|
4914
|
-
],
|
|
4915
4920
|
"additionalProperties": false
|
|
4916
4921
|
}
|
|
4917
4922
|
},
|
|
@@ -5058,6 +5063,75 @@
|
|
|
5058
5063
|
"on_package_change"
|
|
5059
5064
|
],
|
|
5060
5065
|
"additionalProperties": false
|
|
5066
|
+
},
|
|
5067
|
+
"input_secret_guard": {
|
|
5068
|
+
"type": "object",
|
|
5069
|
+
"properties": {
|
|
5070
|
+
"enabled": {
|
|
5071
|
+
"default": true,
|
|
5072
|
+
"type": "boolean"
|
|
5073
|
+
},
|
|
5074
|
+
"mode": {
|
|
5075
|
+
"default": "prompt",
|
|
5076
|
+
"type": "string",
|
|
5077
|
+
"enum": [
|
|
5078
|
+
"prompt",
|
|
5079
|
+
"block",
|
|
5080
|
+
"off"
|
|
5081
|
+
]
|
|
5082
|
+
},
|
|
5083
|
+
"blocklist_mode": {
|
|
5084
|
+
"default": "prompt",
|
|
5085
|
+
"type": "string",
|
|
5086
|
+
"enum": [
|
|
5087
|
+
"prompt",
|
|
5088
|
+
"block"
|
|
5089
|
+
]
|
|
5090
|
+
},
|
|
5091
|
+
"warnlist_mode": {
|
|
5092
|
+
"default": "prompt",
|
|
5093
|
+
"type": "string",
|
|
5094
|
+
"enum": [
|
|
5095
|
+
"prompt",
|
|
5096
|
+
"off"
|
|
5097
|
+
]
|
|
5098
|
+
},
|
|
5099
|
+
"allowlist_patterns": {
|
|
5100
|
+
"type": "array",
|
|
5101
|
+
"items": {
|
|
5102
|
+
"type": "string"
|
|
5103
|
+
}
|
|
5104
|
+
},
|
|
5105
|
+
"detection": {
|
|
5106
|
+
"type": "object",
|
|
5107
|
+
"properties": {
|
|
5108
|
+
"entropy_threshold": {
|
|
5109
|
+
"default": 4.5,
|
|
5110
|
+
"type": "number",
|
|
5111
|
+
"minimum": 0,
|
|
5112
|
+
"maximum": 8
|
|
5113
|
+
},
|
|
5114
|
+
"max_scan_bytes": {
|
|
5115
|
+
"default": 65536,
|
|
5116
|
+
"type": "integer",
|
|
5117
|
+
"minimum": 1024,
|
|
5118
|
+
"maximum": 262144
|
|
5119
|
+
}
|
|
5120
|
+
},
|
|
5121
|
+
"required": [
|
|
5122
|
+
"entropy_threshold",
|
|
5123
|
+
"max_scan_bytes"
|
|
5124
|
+
],
|
|
5125
|
+
"additionalProperties": false
|
|
5126
|
+
}
|
|
5127
|
+
},
|
|
5128
|
+
"required": [
|
|
5129
|
+
"enabled",
|
|
5130
|
+
"mode",
|
|
5131
|
+
"blocklist_mode",
|
|
5132
|
+
"warnlist_mode"
|
|
5133
|
+
],
|
|
5134
|
+
"additionalProperties": false
|
|
5061
5135
|
}
|
|
5062
5136
|
},
|
|
5063
5137
|
"additionalProperties": false
|
|
@@ -5157,6 +5231,36 @@
|
|
|
5157
5231
|
],
|
|
5158
5232
|
"additionalProperties": false
|
|
5159
5233
|
},
|
|
5234
|
+
"context_mode": {
|
|
5235
|
+
"type": "object",
|
|
5236
|
+
"properties": {
|
|
5237
|
+
"enabled": {
|
|
5238
|
+
"default": true,
|
|
5239
|
+
"type": "boolean"
|
|
5240
|
+
},
|
|
5241
|
+
"enforce": {
|
|
5242
|
+
"default": false,
|
|
5243
|
+
"type": "boolean"
|
|
5244
|
+
},
|
|
5245
|
+
"blocked_tools": {
|
|
5246
|
+
"default": [
|
|
5247
|
+
"read",
|
|
5248
|
+
"grep",
|
|
5249
|
+
"glob"
|
|
5250
|
+
],
|
|
5251
|
+
"type": "array",
|
|
5252
|
+
"items": {
|
|
5253
|
+
"type": "string"
|
|
5254
|
+
}
|
|
5255
|
+
}
|
|
5256
|
+
},
|
|
5257
|
+
"required": [
|
|
5258
|
+
"enabled",
|
|
5259
|
+
"enforce",
|
|
5260
|
+
"blocked_tools"
|
|
5261
|
+
],
|
|
5262
|
+
"additionalProperties": false
|
|
5263
|
+
},
|
|
5160
5264
|
"rtk": {
|
|
5161
5265
|
"type": "object",
|
|
5162
5266
|
"properties": {
|
|
@@ -6,6 +6,7 @@ export declare function createCoreHooks(args: {
|
|
|
6
6
|
isHookEnabled: (hookName: HookName) => boolean;
|
|
7
7
|
safeHookEnabled: boolean;
|
|
8
8
|
}): {
|
|
9
|
+
inputSecretGuard: ReturnType<typeof import("../../hooks").createInputSecretGuardHook> | null;
|
|
9
10
|
keywordDetector: ReturnType<typeof import("../../hooks").createKeywordDetectorHook> | null;
|
|
10
11
|
contextInjectorMessagesTransform: ReturnType<typeof import("../../features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
11
12
|
envContextInjector: ReturnType<typeof import("../../hooks").createEnvContextInjectorHook> | null;
|
|
@@ -15,7 +16,6 @@ export declare function createCoreHooks(args: {
|
|
|
15
16
|
commentChecker: ReturnType<typeof import("../../hooks").createCommentCheckerHooks> | null;
|
|
16
17
|
toolOutputTruncator: ReturnType<typeof import("../../hooks").createToolOutputTruncatorHook> | null;
|
|
17
18
|
directoryAgentsInjector: ReturnType<typeof import("../../hooks").createDirectoryAgentsInjectorHook> | null;
|
|
18
|
-
directoryReadmeInjector: ReturnType<typeof import("../../hooks").createDirectoryReadmeInjectorHook> | null;
|
|
19
19
|
emptyTaskResponseDetector: ReturnType<typeof import("../../hooks").createEmptyTaskResponseDetectorHook> | null;
|
|
20
20
|
rulesInjector: ReturnType<typeof import("../../hooks").createRulesInjectorHook> | null;
|
|
21
21
|
tasksTodowriteDisabler: ReturnType<typeof import("../../hooks").createTasksTodowriteDisablerHook> | null;
|
|
@@ -25,6 +25,7 @@ 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
|
+
contextModeEnforcer: ReturnType<typeof import("../../hooks").createContextModeEnforcerHook> | null;
|
|
28
29
|
readImageResizer: ReturnType<typeof import("../../hooks").createReadImageResizerHook> | null;
|
|
29
30
|
webfetchRedirectGuard: ReturnType<typeof import("../../hooks").createWebFetchRedirectGuardHook> | null;
|
|
30
31
|
hashlineEditDiffEnhancer: ReturnType<typeof import("../../hooks").createHashlineEditDiffEnhancerHook> | null;
|
|
@@ -37,7 +38,7 @@ export declare function createCoreHooks(args: {
|
|
|
37
38
|
sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
|
|
38
39
|
sessionNotification: ReturnType<typeof import("../../hooks").createSessionNotification> | null;
|
|
39
40
|
thinkMode: ReturnType<typeof import("../../hooks").createThinkModeHook> | null;
|
|
40
|
-
|
|
41
|
+
contextWindowLimitRecovery: ReturnType<typeof import("../../hooks").createContextWindowLimitRecoveryHook> | null;
|
|
41
42
|
autoUpdateChecker: ReturnType<typeof import("../../hooks").createAutoUpdateCheckerHook> | null;
|
|
42
43
|
agentUsageReminder: ReturnType<typeof import("../../hooks").createAgentUsageReminderHook> | null;
|
|
43
44
|
nonInteractiveEnv: ReturnType<typeof import("../../hooks").createNonInteractiveEnvHook> | null;
|
|
@@ -48,10 +49,8 @@ export declare function createCoreHooks(args: {
|
|
|
48
49
|
startWork: ReturnType<typeof import("../../hooks").createStartWorkHook> | null;
|
|
49
50
|
oracleMdOnly: ReturnType<typeof import("../../hooks").createOracleMdOnlyHook> | null;
|
|
50
51
|
mouseNotepad: ReturnType<typeof import("../../hooks").createMouseNotepadHook> | null;
|
|
51
|
-
questionLabelTruncator: ReturnType<typeof import("../../hooks").createQuestionLabelTruncatorHook>;
|
|
52
52
|
taskResumeInfo: ReturnType<typeof import("../../hooks").createTaskResumeInfoHook>;
|
|
53
53
|
anthropicEffort: ReturnType<typeof import("../../hooks/anthropic-effort").createAnthropicEffortHook> | null;
|
|
54
54
|
runtimeFallback: ReturnType<typeof import("../../hooks").createRuntimeFallbackHook> | null;
|
|
55
55
|
rtkBashRewriter: ReturnType<typeof import("../../hooks").createRtkBashRewriterHook> | null;
|
|
56
|
-
mcpStartupNotification: ReturnType<typeof import("../../hooks").createMcpStartupNotificationHook> | null;
|
|
57
56
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HookName, MatrixxConfig } from "../../config";
|
|
2
|
-
import { createAgentUsageReminderHook,
|
|
2
|
+
import { createAgentUsageReminderHook, createAutoUpdateCheckerHook, createContextWindowLimitRecoveryHook, createContextWindowMonitorHook, createDelegateTaskRetryHook, createEditErrorRecoveryHook, createInteractiveBashSessionHook, createMatrixLoopHook, createMouseNotepadHook, createNonInteractiveEnvHook, createOracleMdOnlyHook, createPreemptiveCompactionHook, 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 = {
|
|
@@ -8,7 +8,7 @@ export type SessionHooks = {
|
|
|
8
8
|
sessionRecovery: ReturnType<typeof createSessionRecoveryHook> | null;
|
|
9
9
|
sessionNotification: ReturnType<typeof createSessionNotification> | null;
|
|
10
10
|
thinkMode: ReturnType<typeof createThinkModeHook> | null;
|
|
11
|
-
|
|
11
|
+
contextWindowLimitRecovery: ReturnType<typeof createContextWindowLimitRecoveryHook> | null;
|
|
12
12
|
autoUpdateChecker: ReturnType<typeof createAutoUpdateCheckerHook> | null;
|
|
13
13
|
agentUsageReminder: ReturnType<typeof createAgentUsageReminderHook> | null;
|
|
14
14
|
nonInteractiveEnv: ReturnType<typeof createNonInteractiveEnvHook> | null;
|
|
@@ -19,12 +19,10 @@ export type SessionHooks = {
|
|
|
19
19
|
startWork: ReturnType<typeof createStartWorkHook> | null;
|
|
20
20
|
oracleMdOnly: ReturnType<typeof createOracleMdOnlyHook> | null;
|
|
21
21
|
mouseNotepad: ReturnType<typeof createMouseNotepadHook> | null;
|
|
22
|
-
questionLabelTruncator: ReturnType<typeof createQuestionLabelTruncatorHook>;
|
|
23
22
|
taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook>;
|
|
24
23
|
anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null;
|
|
25
24
|
runtimeFallback: ReturnType<typeof createRuntimeFallbackHook> | null;
|
|
26
25
|
rtkBashRewriter: ReturnType<typeof createRtkBashRewriterHook> | null;
|
|
27
|
-
mcpStartupNotification: ReturnType<typeof createMcpStartupNotificationHook> | null;
|
|
28
26
|
};
|
|
29
27
|
export declare function createSessionHooks(args: {
|
|
30
28
|
ctx: PluginContext;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { HookName, MatrixxConfig } from "../../config";
|
|
2
|
-
import { createBashFileReadGuardHook, createCommentCheckerHooks,
|
|
2
|
+
import { createBashFileReadGuardHook, createCommentCheckerHooks, createContextModeEnforcerHook, createDirectoryAgentsInjectorHook, 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;
|
|
6
6
|
toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
|
|
7
7
|
directoryAgentsInjector: ReturnType<typeof createDirectoryAgentsInjectorHook> | null;
|
|
8
|
-
directoryReadmeInjector: ReturnType<typeof createDirectoryReadmeInjectorHook> | null;
|
|
9
8
|
emptyTaskResponseDetector: ReturnType<typeof createEmptyTaskResponseDetectorHook> | null;
|
|
10
9
|
rulesInjector: ReturnType<typeof createRulesInjectorHook> | null;
|
|
11
10
|
tasksTodowriteDisabler: ReturnType<typeof createTasksTodowriteDisablerHook> | null;
|
|
@@ -15,6 +14,7 @@ export type ToolGuardHooks = {
|
|
|
15
14
|
envFileWriteGuard: ReturnType<typeof createEnvFileWriteGuardHook> | null;
|
|
16
15
|
jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
|
|
17
16
|
bashFileReadGuard: ReturnType<typeof createBashFileReadGuardHook> | null;
|
|
17
|
+
contextModeEnforcer: ReturnType<typeof createContextModeEnforcerHook> | null;
|
|
18
18
|
readImageResizer: ReturnType<typeof createReadImageResizerHook> | null;
|
|
19
19
|
webfetchRedirectGuard: ReturnType<typeof createWebFetchRedirectGuardHook> | null;
|
|
20
20
|
hashlineEditDiffEnhancer: ReturnType<typeof createHashlineEditDiffEnhancerHook> | null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { MatrixxConfig } from "../../config";
|
|
2
2
|
import { createContextInjectorMessagesTransformHook } from "../../features/context-injector";
|
|
3
3
|
import { createDesignIntentPreserverHook, createEnvContextInjectorHook, createKeywordDetectorHook, createThinkingBlockValidatorHook, createToolPairValidatorHook } from "../../hooks";
|
|
4
|
+
import { createInputSecretGuardHook } from "../../hooks/input-secret-guard";
|
|
4
5
|
import type { PluginContext } from "../types";
|
|
5
6
|
export type TransformHooks = {
|
|
7
|
+
inputSecretGuard: ReturnType<typeof createInputSecretGuardHook> | null;
|
|
6
8
|
keywordDetector: ReturnType<typeof createKeywordDetectorHook> | null;
|
|
7
9
|
contextInjectorMessagesTransform: ReturnType<typeof createContextInjectorMessagesTransformHook>;
|
|
8
10
|
envContextInjector: ReturnType<typeof createEnvContextInjectorHook> | null;
|
|
@@ -2,4 +2,5 @@ export type ContextLimitModelCacheState = {
|
|
|
2
2
|
anthropicContext1MEnabled: boolean;
|
|
3
3
|
modelContextLimitsCache?: Map<string, number>;
|
|
4
4
|
};
|
|
5
|
+
export declare function isAnthropicProvider(providerID: string): boolean;
|
|
5
6
|
export declare function resolveActualContextLimit(providerID: string, modelID: string, modelCacheState?: ContextLimitModelCacheState): number | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ExperimentalConfig } from "../config/schema/experimental";
|
|
2
|
+
import type { ContextLimitModelCacheState } from "./context-limit-resolver";
|
|
3
|
+
import { isAnthropicProvider, resolveActualContextLimit } from "./context-limit-resolver";
|
|
4
|
+
/**
|
|
5
|
+
* Single source for context window thresholds and limit defaults.
|
|
6
|
+
* Boundary: monitor 70% warn (read-only) → preemptive 78% (proactive) → recovery (reactive, error-parse only).
|
|
7
|
+
* Shared constants consumed via context-limits.ts + token-cache.ts.
|
|
8
|
+
*
|
|
9
|
+
* Thresholds:
|
|
10
|
+
* - CONTEXT_WARNING_THRESHOLD (0.70) — read-only monitor warning, Anthropic only.
|
|
11
|
+
* - PREEMPTIVE_COMPACTION_THRESHOLD (0.78) — proactive compaction trigger.
|
|
12
|
+
* Limits:
|
|
13
|
+
* - ANTHROPIC_DISPLAY_LIMIT (1_000_000) — UI display cap for Anthropic 1M context.
|
|
14
|
+
* - DEFAULT_ANTHROPIC_ACTUAL_LIMIT (200_000) — fallback when 1M not enabled.
|
|
15
|
+
* - DEFAULT_NON_ANTHROPIC_FALLBACK_LIMIT (128_000) — generic LLM fallback.
|
|
16
|
+
*
|
|
17
|
+
* Re-exports isAnthropicProvider + resolveActualContextLimit from resolver for single import surface.
|
|
18
|
+
*/
|
|
19
|
+
/** Warn threshold for monitor (read-only, does not trigger compaction). */
|
|
20
|
+
export declare const CONTEXT_WARNING_THRESHOLD: 0.7;
|
|
21
|
+
/** Proactive compaction threshold (preemptive-compaction trigger). */
|
|
22
|
+
export declare const PREEMPTIVE_COMPACTION_THRESHOLD: 0.78;
|
|
23
|
+
/** Default actual limit for Anthropic without 1M enabled. */
|
|
24
|
+
export declare const DEFAULT_ANTHROPIC_ACTUAL_LIMIT: 200000;
|
|
25
|
+
/** Generic fallback for non-Anthropic providers. */
|
|
26
|
+
export declare const DEFAULT_NON_ANTHROPIC_FALLBACK_LIMIT: 128000;
|
|
27
|
+
/** Display limit for Anthropic 1M UI. */
|
|
28
|
+
export declare const ANTHROPIC_DISPLAY_LIMIT: 1000000;
|
|
29
|
+
export type { ContextLimitModelCacheState };
|
|
30
|
+
export { isAnthropicProvider, resolveActualContextLimit };
|
|
31
|
+
/** Wrapper around resolveActualContextLimit for display vs actual semantics. */
|
|
32
|
+
export declare function getActualLimit(providerID: string, modelID: string, modelCacheState?: ContextLimitModelCacheState): number | null;
|
|
33
|
+
/** Display limit is fixed 1M for Anthropic UI; actual may be smaller. */
|
|
34
|
+
export declare function getDisplayLimit(): number;
|
|
35
|
+
export declare function resolveWarningThreshold(experimental?: ExperimentalConfig): number;
|
|
36
|
+
export declare function resolvePreemptiveThreshold(experimental?: ExperimentalConfig): number;
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ export * from "./git-worktree";
|
|
|
18
18
|
export * from "./is-abort-error";
|
|
19
19
|
export * from "./jsonc-parser";
|
|
20
20
|
export * from "./logger";
|
|
21
|
-
export * from "./migration";
|
|
22
21
|
export * from "./model-availability";
|
|
23
22
|
export * from "./model-requirements";
|
|
24
23
|
export { type ModelResolutionProvenance, type ModelResolutionRequest, type ModelResolutionResult, normalizeModel, resolveModelPipeline, } from "./model-resolution-pipeline";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-matrixx",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Client } from "./client";
|
|
2
|
-
export declare function fixEmptyMessagesWithSDK(params: {
|
|
3
|
-
sessionID: string;
|
|
4
|
-
client: Client;
|
|
5
|
-
placeholderText: string;
|
|
6
|
-
messageIndex?: number;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
fixed: boolean;
|
|
9
|
-
fixedMessageIds: string[];
|
|
10
|
-
scannedEmptyCount: number;
|
|
11
|
-
}>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { executeCompact, getLastAssistant } from "./executor";
|
|
2
|
-
export * from "./message-builder";
|
|
3
|
-
export { parseAnthropicTokenLimitError } from "./parser";
|
|
4
|
-
export type { AnthropicContextWindowLimitRecoveryOptions } from "./recovery-hook";
|
|
5
|
-
export { createAnthropicContextWindowLimitRecoveryHook } from "./recovery-hook";
|
|
6
|
-
export * from "./recovery-strategy";
|
|
7
|
-
export * from "./state";
|
|
8
|
-
export type { AutoCompactState, ParsedTokenLimitError, TruncateState } from "./types";
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { MESSAGE_STORAGE, PART_STORAGE } from "../../shared";
|
|
2
|
-
export { MESSAGE_STORAGE as MESSAGE_STORAGE_DIR, PART_STORAGE as PART_STORAGE_DIR };
|
|
3
|
-
export declare const TRUNCATION_MESSAGE = "[TOOL RESULT TRUNCATED - Context limit exceeded. Original output was too large and has been truncated to recover the session. Please re-run this tool if you need the full output.]";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { truncateUntilTargetTokens } from "./target-token-truncation";
|
|
2
|
-
export type { AggressiveTruncateResult, ToolResultInfo } from "./tool-part-types";
|
|
3
|
-
export { countTruncatedResults, findLargestToolResult, findToolResultsBySize, getTotalToolOutputSize, truncateToolResult, } from "./tool-result-storage";
|
|
4
|
-
export { countTruncatedResultsFromSDK, findToolResultsBySizeFromSDK, getTotalToolOutputSizeFromSDK, truncateToolResultAsync, } from "./tool-result-storage-sdk";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ToolResultInfo } from "./tool-part-types";
|
|
2
|
-
export declare function findToolResultsBySize(sessionID: string): ToolResultInfo[];
|
|
3
|
-
export declare function findLargestToolResult(sessionID: string): ToolResultInfo | null;
|
|
4
|
-
export declare function truncateToolResult(partPath: string): {
|
|
5
|
-
success: boolean;
|
|
6
|
-
toolName?: string;
|
|
7
|
-
originalSize?: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function getTotalToolOutputSize(sessionID: string): number;
|
|
10
|
-
export declare function countTruncatedResults(sessionID: string): number;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
export declare function createDirectoryReadmeInjectorHook(ctx: PluginInput): {
|
|
3
|
-
"tool.execute.before": (input: import("../directory-injector/factory").ToolExecuteInput, output: import("../directory-injector/factory").ToolExecuteBeforeOutput) => Promise<void>;
|
|
4
|
-
"tool.execute.after": (input: import("../directory-injector/factory").ToolExecuteInput, output: import("../directory-injector/factory").ToolExecuteOutput) => Promise<void>;
|
|
5
|
-
event: ({ event }: import("../directory-injector/factory").EventInput) => Promise<void>;
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createDirectoryReadmeInjectorHook } from "./hook";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type { createDynamicTruncator } from "../../shared/dynamic-truncator";
|
|
3
|
-
type DynamicTruncator = ReturnType<typeof createDynamicTruncator>;
|
|
4
|
-
export declare function processFilePathForReadmeInjection(input: {
|
|
5
|
-
ctx: PluginInput;
|
|
6
|
-
truncator: DynamicTruncator;
|
|
7
|
-
sessionCaches: Map<string, Set<string>>;
|
|
8
|
-
filePath: string;
|
|
9
|
-
sessionID: string;
|
|
10
|
-
output: {
|
|
11
|
-
title: string;
|
|
12
|
-
output: string;
|
|
13
|
-
metadata: unknown;
|
|
14
|
-
};
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const loadInjectedPaths: (sessionID: string) => Set<string>, saveInjectedPaths: (sessionID: string, paths: Set<string>) => void, clearInjectedPaths: (sessionID: string) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createQuestionLabelTruncatorHook } from "./hook";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated LEGACY MIGRATION ONLY
|
|
3
|
-
*
|
|
4
|
-
* This map exists solely for migrating old configs that used hardcoded model strings.
|
|
5
|
-
* It maps legacy model strings to semantic category names, allowing users to migrate
|
|
6
|
-
* from explicit model configs to category-based configs.
|
|
7
|
-
*
|
|
8
|
-
* DO NOT add new entries here. New agents should use:
|
|
9
|
-
* - Category-based config (preferred): { category: "red-pill" }
|
|
10
|
-
* - Or inherit from OpenCode's config.model
|
|
11
|
-
*
|
|
12
|
-
* This map will be removed in a future major version once migration period ends.
|
|
13
|
-
*/
|
|
14
|
-
export declare const MODEL_TO_CATEGORY_MAP: Record<string, string>;
|
|
15
|
-
export declare function migrateAgentConfigToCategory(config: Record<string, unknown>): {
|
|
16
|
-
migrated: Record<string, unknown>;
|
|
17
|
-
changed: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare function shouldDeleteAgentConfig(config: Record<string, unknown>, category: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function migrateConfigFile(configPath: string, rawConfig: Record<string, unknown>): boolean;
|