opencode-matrixx 2.6.2 → 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 +0 -2
- package/dist/cli.js +24 -11
- 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 +4 -8
- package/dist/config/schema/matrixx-config.d.ts +27 -9
- package/dist/config/schema/morpheus.d.ts +0 -2
- package/dist/config/schema/security.d.ts +49 -0
- package/dist/create-hooks.d.ts +2 -4
- 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 +2 -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/ulw-bootstrap.test.d.ts +1 -0
- package/dist/index.js +5052 -5315
- package/dist/matrixx.schema.json +146 -73
- package/dist/plugin/hooks/create-core-hooks.d.ts +2 -4
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -4
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +1 -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/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
>
|
|
2
2
|
> [](https://github.com/klpanagi/opencode-matrixx)
|
|
3
3
|
>
|
|
4
|
-
> Matrixx is **highly inspired by** [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) — the project that pioneered the "oh-my-zsh for OpenCode" concept.
|
|
5
|
-
> Full credit to [code-yeongyu](https://github.com/code-yeongyu) for the original vision.
|
|
6
4
|
>
|
|
7
5
|
|
|
8
6
|
<div align="center">
|
package/dist/cli.js
CHANGED
|
@@ -16121,6 +16121,8 @@ var ExperimentalConfigSchema = exports_external.object({
|
|
|
16121
16121
|
truncate_all_tool_outputs: exports_external.boolean().optional(),
|
|
16122
16122
|
task_system: exports_external.boolean().optional().default(true),
|
|
16123
16123
|
plugin_load_timeout_ms: exports_external.number().min(1000).optional(),
|
|
16124
|
+
context_warning_threshold: exports_external.number().min(0.1).max(0.95).optional(),
|
|
16125
|
+
preemptive_compaction_threshold: exports_external.number().min(0.1).max(0.95).optional(),
|
|
16124
16126
|
safe_hook_creation: exports_external.boolean().optional(),
|
|
16125
16127
|
hashline_edit: exports_external.boolean().optional()
|
|
16126
16128
|
});
|
|
@@ -16134,21 +16136,18 @@ var HeadroomConfigSchema = exports_external.object({
|
|
|
16134
16136
|
});
|
|
16135
16137
|
|
|
16136
16138
|
// src/config/schema/hooks.ts
|
|
16137
|
-
var
|
|
16139
|
+
var HookNameEnum = exports_external.enum([
|
|
16138
16140
|
"task-continuation-enforcer",
|
|
16139
16141
|
"todo-continuation-enforcer",
|
|
16140
16142
|
"context-window-monitor",
|
|
16141
16143
|
"session-recovery",
|
|
16142
16144
|
"session-notification",
|
|
16143
16145
|
"comment-checker",
|
|
16144
|
-
"grep-output-truncator",
|
|
16145
16146
|
"tool-output-truncator",
|
|
16146
|
-
"question-label-truncator",
|
|
16147
16147
|
"directory-agents-injector",
|
|
16148
|
-
"directory-readme-injector",
|
|
16149
16148
|
"empty-task-response-detector",
|
|
16150
16149
|
"think-mode",
|
|
16151
|
-
"
|
|
16150
|
+
"context-window-limit-recovery",
|
|
16152
16151
|
"preemptive-compaction",
|
|
16153
16152
|
"rules-injector",
|
|
16154
16153
|
"background-notification",
|
|
@@ -16179,6 +16178,7 @@ var HookNameSchema = exports_external.enum([
|
|
|
16179
16178
|
"anthropic-effort",
|
|
16180
16179
|
"hashline-read-enhancer",
|
|
16181
16180
|
"secret-leak-guard",
|
|
16181
|
+
"input-secret-guard",
|
|
16182
16182
|
"env-context-injector",
|
|
16183
16183
|
"env-file-write-guard",
|
|
16184
16184
|
"json-error-recovery",
|
|
@@ -16192,15 +16192,16 @@ var HookNameSchema = exports_external.enum([
|
|
|
16192
16192
|
"task-notepad",
|
|
16193
16193
|
"design-intent-preserver",
|
|
16194
16194
|
"rtk-bash-rewriter",
|
|
16195
|
-
"mcp-startup-notification",
|
|
16196
16195
|
"evolution-watcher",
|
|
16197
16196
|
"evolution-compressor",
|
|
16198
|
-
"evolution-quality-gate",
|
|
16199
16197
|
"evolution-hitl",
|
|
16200
16198
|
"context-mode-enforcer",
|
|
16201
|
-
"task-edit-guard",
|
|
16202
16199
|
"task-edit-guard"
|
|
16203
16200
|
]);
|
|
16201
|
+
var HookNameSchema = exports_external.union([
|
|
16202
|
+
HookNameEnum,
|
|
16203
|
+
exports_external.literal("anthropic-context-window-limit-recovery").transform(() => "context-window-limit-recovery")
|
|
16204
|
+
]);
|
|
16204
16205
|
|
|
16205
16206
|
// src/config/schema/matrix-loop.ts
|
|
16206
16207
|
var MatrixLoopConfigSchema = exports_external.object({
|
|
@@ -16219,7 +16220,6 @@ var MatrixxSelfConfigSkillConfigSchema = exports_external.object({
|
|
|
16219
16220
|
var MorpheusTasksConfigSchema = exports_external.object({
|
|
16220
16221
|
storage_path: exports_external.string().optional(),
|
|
16221
16222
|
task_list_id: exports_external.string().optional(),
|
|
16222
|
-
claude_code_compat: exports_external.boolean().default(false),
|
|
16223
16223
|
scope: exports_external.enum(["global", "project"]).default("project").optional().describe("Task storage scope: project \u2192 .matrixx/tasks per project (default), global \u2192 ~/.config/opencode/tasks/{listId}")
|
|
16224
16224
|
});
|
|
16225
16225
|
var MorpheusConfigSchema = exports_external.object({
|
|
@@ -16288,10 +16288,23 @@ var DependencyAuditConfigSchema = exports_external.object({
|
|
|
16288
16288
|
enabled: exports_external.boolean().default(false),
|
|
16289
16289
|
on_package_change: exports_external.boolean().default(true)
|
|
16290
16290
|
});
|
|
16291
|
+
var InputSecretGuardModeSchema = exports_external.enum(["prompt", "block", "off"]);
|
|
16292
|
+
var InputSecretGuardConfigSchema = exports_external.object({
|
|
16293
|
+
enabled: exports_external.boolean().default(true),
|
|
16294
|
+
mode: InputSecretGuardModeSchema.default("prompt"),
|
|
16295
|
+
blocklist_mode: exports_external.enum(["prompt", "block"]).default("prompt"),
|
|
16296
|
+
warnlist_mode: exports_external.enum(["prompt", "off"]).default("prompt"),
|
|
16297
|
+
allowlist_patterns: exports_external.array(exports_external.string()).optional(),
|
|
16298
|
+
detection: exports_external.object({
|
|
16299
|
+
entropy_threshold: exports_external.number().min(0).max(8).default(4.5),
|
|
16300
|
+
max_scan_bytes: exports_external.number().int().min(1024).max(256 * 1024).default(64 * 1024)
|
|
16301
|
+
}).optional()
|
|
16302
|
+
});
|
|
16291
16303
|
var SecurityConfigSchema = exports_external.object({
|
|
16292
16304
|
secret_scanning: SecretScanningConfigSchema.optional(),
|
|
16293
16305
|
env_file_guard: EnvFileGuardConfigSchema.optional(),
|
|
16294
|
-
dependency_audit: DependencyAuditConfigSchema.optional()
|
|
16306
|
+
dependency_audit: DependencyAuditConfigSchema.optional(),
|
|
16307
|
+
input_secret_guard: InputSecretGuardConfigSchema.optional()
|
|
16295
16308
|
});
|
|
16296
16309
|
|
|
16297
16310
|
// src/config/schema/skills.ts
|
|
@@ -18819,7 +18832,7 @@ Run with --yes to overwrite without prompt.`;
|
|
|
18819
18832
|
const lines = [
|
|
18820
18833
|
"",
|
|
18821
18834
|
"\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510",
|
|
18822
|
-
|
|
18835
|
+
`\u2502 Matrixx Setup Complete${dry.padEnd(12)}\u2502`,
|
|
18823
18836
|
"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518",
|
|
18824
18837
|
"",
|
|
18825
18838
|
report,
|
|
@@ -6,6 +6,8 @@ export declare const ExperimentalConfigSchema: z.ZodObject<{
|
|
|
6
6
|
truncate_all_tool_outputs: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
task_system: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
8
|
plugin_load_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
context_warning_threshold: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
preemptive_compaction_threshold: z.ZodOptional<z.ZodNumber>;
|
|
9
11
|
safe_hook_creation: z.ZodOptional<z.ZodBoolean>;
|
|
10
12
|
hashline_edit: z.ZodOptional<z.ZodBoolean>;
|
|
11
13
|
}, z.core.$strip>;
|
|
@@ -12,7 +12,7 @@ import { z } from "zod";
|
|
|
12
12
|
* so the proxy sits transparently in front of the transport.
|
|
13
13
|
* - Native transport integration is deferred until the compaction hook
|
|
14
14
|
* stabilizes (Headroom #76 collision risk with
|
|
15
|
-
*
|
|
15
|
+
* context-window-limit-recovery).
|
|
16
16
|
*/
|
|
17
17
|
export declare const HeadroomConfigSchema: z.ZodObject<{
|
|
18
18
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const HookNameSchema: z.ZodEnum<{
|
|
2
|
+
export declare const HookNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
3
3
|
architect: "architect";
|
|
4
4
|
"quality-gate": "quality-gate";
|
|
5
5
|
"matrix-loop": "matrix-loop";
|
|
@@ -12,14 +12,11 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
12
12
|
"session-recovery": "session-recovery";
|
|
13
13
|
"session-notification": "session-notification";
|
|
14
14
|
"comment-checker": "comment-checker";
|
|
15
|
-
"grep-output-truncator": "grep-output-truncator";
|
|
16
15
|
"tool-output-truncator": "tool-output-truncator";
|
|
17
|
-
"question-label-truncator": "question-label-truncator";
|
|
18
16
|
"directory-agents-injector": "directory-agents-injector";
|
|
19
|
-
"directory-readme-injector": "directory-readme-injector";
|
|
20
17
|
"empty-task-response-detector": "empty-task-response-detector";
|
|
21
18
|
"think-mode": "think-mode";
|
|
22
|
-
"
|
|
19
|
+
"context-window-limit-recovery": "context-window-limit-recovery";
|
|
23
20
|
"preemptive-compaction": "preemptive-compaction";
|
|
24
21
|
"rules-injector": "rules-injector";
|
|
25
22
|
"background-notification": "background-notification";
|
|
@@ -47,6 +44,7 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
47
44
|
"anthropic-effort": "anthropic-effort";
|
|
48
45
|
"hashline-read-enhancer": "hashline-read-enhancer";
|
|
49
46
|
"secret-leak-guard": "secret-leak-guard";
|
|
47
|
+
"input-secret-guard": "input-secret-guard";
|
|
50
48
|
"env-context-injector": "env-context-injector";
|
|
51
49
|
"env-file-write-guard": "env-file-write-guard";
|
|
52
50
|
"json-error-recovery": "json-error-recovery";
|
|
@@ -59,10 +57,8 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
59
57
|
"task-notepad": "task-notepad";
|
|
60
58
|
"design-intent-preserver": "design-intent-preserver";
|
|
61
59
|
"rtk-bash-rewriter": "rtk-bash-rewriter";
|
|
62
|
-
"mcp-startup-notification": "mcp-startup-notification";
|
|
63
|
-
"evolution-quality-gate": "evolution-quality-gate";
|
|
64
60
|
"evolution-hitl": "evolution-hitl";
|
|
65
61
|
"context-mode-enforcer": "context-mode-enforcer";
|
|
66
62
|
"task-edit-guard": "task-edit-guard";
|
|
67
|
-
}>;
|
|
63
|
+
}>, z.ZodPipe<z.ZodLiteral<"anthropic-context-window-limit-recovery">, z.ZodTransform<"context-window-limit-recovery", "anthropic-context-window-limit-recovery">>]>;
|
|
68
64
|
export type HookName = z.infer<typeof HookNameSchema>;
|
|
@@ -67,7 +67,7 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
67
67
|
"bdd-frontend": "bdd-frontend";
|
|
68
68
|
"bdd-tests": "bdd-tests";
|
|
69
69
|
}>>>;
|
|
70
|
-
disabled_hooks: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
70
|
+
disabled_hooks: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
71
71
|
architect: "architect";
|
|
72
72
|
"quality-gate": "quality-gate";
|
|
73
73
|
"matrix-loop": "matrix-loop";
|
|
@@ -80,14 +80,11 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
80
80
|
"session-recovery": "session-recovery";
|
|
81
81
|
"session-notification": "session-notification";
|
|
82
82
|
"comment-checker": "comment-checker";
|
|
83
|
-
"grep-output-truncator": "grep-output-truncator";
|
|
84
83
|
"tool-output-truncator": "tool-output-truncator";
|
|
85
|
-
"question-label-truncator": "question-label-truncator";
|
|
86
84
|
"directory-agents-injector": "directory-agents-injector";
|
|
87
|
-
"directory-readme-injector": "directory-readme-injector";
|
|
88
85
|
"empty-task-response-detector": "empty-task-response-detector";
|
|
89
86
|
"think-mode": "think-mode";
|
|
90
|
-
"
|
|
87
|
+
"context-window-limit-recovery": "context-window-limit-recovery";
|
|
91
88
|
"preemptive-compaction": "preemptive-compaction";
|
|
92
89
|
"rules-injector": "rules-injector";
|
|
93
90
|
"background-notification": "background-notification";
|
|
@@ -115,6 +112,7 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
115
112
|
"anthropic-effort": "anthropic-effort";
|
|
116
113
|
"hashline-read-enhancer": "hashline-read-enhancer";
|
|
117
114
|
"secret-leak-guard": "secret-leak-guard";
|
|
115
|
+
"input-secret-guard": "input-secret-guard";
|
|
118
116
|
"env-context-injector": "env-context-injector";
|
|
119
117
|
"env-file-write-guard": "env-file-write-guard";
|
|
120
118
|
"json-error-recovery": "json-error-recovery";
|
|
@@ -127,12 +125,10 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
127
125
|
"task-notepad": "task-notepad";
|
|
128
126
|
"design-intent-preserver": "design-intent-preserver";
|
|
129
127
|
"rtk-bash-rewriter": "rtk-bash-rewriter";
|
|
130
|
-
"mcp-startup-notification": "mcp-startup-notification";
|
|
131
|
-
"evolution-quality-gate": "evolution-quality-gate";
|
|
132
128
|
"evolution-hitl": "evolution-hitl";
|
|
133
129
|
"context-mode-enforcer": "context-mode-enforcer";
|
|
134
130
|
"task-edit-guard": "task-edit-guard";
|
|
135
|
-
}>>>;
|
|
131
|
+
}>, z.ZodPipe<z.ZodLiteral<"anthropic-context-window-limit-recovery">, z.ZodTransform<"context-window-limit-recovery", "anthropic-context-window-limit-recovery">>]>>>;
|
|
136
132
|
disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
137
133
|
"bdd-contract": "bdd-contract";
|
|
138
134
|
"bdd-backend": "bdd-backend";
|
|
@@ -1691,6 +1687,8 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
1691
1687
|
truncate_all_tool_outputs: z.ZodOptional<z.ZodBoolean>;
|
|
1692
1688
|
task_system: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1693
1689
|
plugin_load_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
1690
|
+
context_warning_threshold: z.ZodOptional<z.ZodNumber>;
|
|
1691
|
+
preemptive_compaction_threshold: z.ZodOptional<z.ZodNumber>;
|
|
1694
1692
|
safe_hook_creation: z.ZodOptional<z.ZodBoolean>;
|
|
1695
1693
|
hashline_edit: z.ZodOptional<z.ZodBoolean>;
|
|
1696
1694
|
}, z.core.$strip>>;
|
|
@@ -1858,7 +1856,6 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
1858
1856
|
tasks: z.ZodOptional<z.ZodObject<{
|
|
1859
1857
|
storage_path: z.ZodOptional<z.ZodString>;
|
|
1860
1858
|
task_list_id: z.ZodOptional<z.ZodString>;
|
|
1861
|
-
claude_code_compat: z.ZodDefault<z.ZodBoolean>;
|
|
1862
1859
|
scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1863
1860
|
project: "project";
|
|
1864
1861
|
global: "global";
|
|
@@ -1893,6 +1890,27 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
|
|
|
1893
1890
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1894
1891
|
on_package_change: z.ZodDefault<z.ZodBoolean>;
|
|
1895
1892
|
}, z.core.$strip>>;
|
|
1893
|
+
input_secret_guard: z.ZodOptional<z.ZodObject<{
|
|
1894
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1895
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
1896
|
+
prompt: "prompt";
|
|
1897
|
+
off: "off";
|
|
1898
|
+
block: "block";
|
|
1899
|
+
}>>;
|
|
1900
|
+
blocklist_mode: z.ZodDefault<z.ZodEnum<{
|
|
1901
|
+
prompt: "prompt";
|
|
1902
|
+
block: "block";
|
|
1903
|
+
}>>;
|
|
1904
|
+
warnlist_mode: z.ZodDefault<z.ZodEnum<{
|
|
1905
|
+
prompt: "prompt";
|
|
1906
|
+
off: "off";
|
|
1907
|
+
}>>;
|
|
1908
|
+
allowlist_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1909
|
+
detection: z.ZodOptional<z.ZodObject<{
|
|
1910
|
+
entropy_threshold: z.ZodDefault<z.ZodNumber>;
|
|
1911
|
+
max_scan_bytes: z.ZodDefault<z.ZodNumber>;
|
|
1912
|
+
}, z.core.$strip>>;
|
|
1913
|
+
}, z.core.$strip>>;
|
|
1896
1914
|
}, z.core.$strip>>;
|
|
1897
1915
|
runtime_fallback: z.ZodOptional<z.ZodObject<{
|
|
1898
1916
|
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
declare const MorpheusTasksConfigSchema: z.ZodObject<{
|
|
3
3
|
storage_path: z.ZodOptional<z.ZodString>;
|
|
4
4
|
task_list_id: z.ZodOptional<z.ZodString>;
|
|
5
|
-
claude_code_compat: z.ZodDefault<z.ZodBoolean>;
|
|
6
5
|
scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
7
6
|
project: "project";
|
|
8
7
|
global: "global";
|
|
@@ -12,7 +11,6 @@ export declare const MorpheusConfigSchema: z.ZodObject<{
|
|
|
12
11
|
tasks: z.ZodOptional<z.ZodObject<{
|
|
13
12
|
storage_path: z.ZodOptional<z.ZodString>;
|
|
14
13
|
task_list_id: z.ZodOptional<z.ZodString>;
|
|
15
|
-
claude_code_compat: z.ZodDefault<z.ZodBoolean>;
|
|
16
14
|
scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
17
15
|
project: "project";
|
|
18
16
|
global: "global";
|
|
@@ -12,6 +12,32 @@ declare const EnvFileGuardConfigSchema: z.ZodObject<{
|
|
|
12
12
|
blocked_patterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
13
13
|
allowed_paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
|
+
declare const InputSecretGuardModeSchema: z.ZodEnum<{
|
|
16
|
+
prompt: "prompt";
|
|
17
|
+
off: "off";
|
|
18
|
+
block: "block";
|
|
19
|
+
}>;
|
|
20
|
+
declare const InputSecretGuardConfigSchema: z.ZodObject<{
|
|
21
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
prompt: "prompt";
|
|
24
|
+
off: "off";
|
|
25
|
+
block: "block";
|
|
26
|
+
}>>;
|
|
27
|
+
blocklist_mode: z.ZodDefault<z.ZodEnum<{
|
|
28
|
+
prompt: "prompt";
|
|
29
|
+
block: "block";
|
|
30
|
+
}>>;
|
|
31
|
+
warnlist_mode: z.ZodDefault<z.ZodEnum<{
|
|
32
|
+
prompt: "prompt";
|
|
33
|
+
off: "off";
|
|
34
|
+
}>>;
|
|
35
|
+
allowlist_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
detection: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
entropy_threshold: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
max_scan_bytes: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
15
41
|
export declare const SecurityConfigSchema: z.ZodObject<{
|
|
16
42
|
secret_scanning: z.ZodOptional<z.ZodObject<{
|
|
17
43
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -30,8 +56,31 @@ export declare const SecurityConfigSchema: z.ZodObject<{
|
|
|
30
56
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
31
57
|
on_package_change: z.ZodDefault<z.ZodBoolean>;
|
|
32
58
|
}, z.core.$strip>>;
|
|
59
|
+
input_secret_guard: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
62
|
+
prompt: "prompt";
|
|
63
|
+
off: "off";
|
|
64
|
+
block: "block";
|
|
65
|
+
}>>;
|
|
66
|
+
blocklist_mode: z.ZodDefault<z.ZodEnum<{
|
|
67
|
+
prompt: "prompt";
|
|
68
|
+
block: "block";
|
|
69
|
+
}>>;
|
|
70
|
+
warnlist_mode: z.ZodDefault<z.ZodEnum<{
|
|
71
|
+
prompt: "prompt";
|
|
72
|
+
off: "off";
|
|
73
|
+
}>>;
|
|
74
|
+
allowlist_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
detection: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
entropy_threshold: z.ZodDefault<z.ZodNumber>;
|
|
77
|
+
max_scan_bytes: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
33
80
|
}, z.core.$strip>;
|
|
34
81
|
export type SecurityConfig = z.infer<typeof SecurityConfigSchema>;
|
|
35
82
|
export type SecretScanningConfig = z.infer<typeof SecretScanningConfigSchema>;
|
|
36
83
|
export type EnvFileGuardConfig = z.infer<typeof EnvFileGuardConfigSchema>;
|
|
84
|
+
export type InputSecretGuardConfig = z.infer<typeof InputSecretGuardConfigSchema>;
|
|
85
|
+
export type InputSecretGuardMode = z.infer<typeof InputSecretGuardModeSchema>;
|
|
37
86
|
export {};
|
package/dist/create-hooks.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare function createHooks(args: {
|
|
|
26
26
|
planPersister: ReturnType<typeof import("./hooks").createPlanPersister> | null;
|
|
27
27
|
evolutionCompressor: ReturnType<typeof import("./hooks").createEvolutionCompressorHook> | null;
|
|
28
28
|
evolutionHitl: ReturnType<typeof import("./hooks").createEvolutionHitlHook> | null;
|
|
29
|
+
inputSecretGuard: ReturnType<typeof import("./hooks").createInputSecretGuardHook> | null;
|
|
29
30
|
keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
|
|
30
31
|
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
31
32
|
envContextInjector: ReturnType<typeof import("./hooks").createEnvContextInjectorHook> | null;
|
|
@@ -35,7 +36,6 @@ export declare function createHooks(args: {
|
|
|
35
36
|
commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
|
|
36
37
|
toolOutputTruncator: ReturnType<typeof import("./hooks").createToolOutputTruncatorHook> | null;
|
|
37
38
|
directoryAgentsInjector: ReturnType<typeof import("./hooks").createDirectoryAgentsInjectorHook> | null;
|
|
38
|
-
directoryReadmeInjector: ReturnType<typeof import("./hooks").createDirectoryReadmeInjectorHook> | null;
|
|
39
39
|
emptyTaskResponseDetector: ReturnType<typeof import("./hooks").createEmptyTaskResponseDetectorHook> | null;
|
|
40
40
|
rulesInjector: ReturnType<typeof import("./hooks").createRulesInjectorHook> | null;
|
|
41
41
|
tasksTodowriteDisabler: ReturnType<typeof import("./hooks").createTasksTodowriteDisablerHook> | null;
|
|
@@ -58,7 +58,7 @@ export declare function createHooks(args: {
|
|
|
58
58
|
sessionRecovery: ReturnType<typeof import("./hooks").createSessionRecoveryHook> | null;
|
|
59
59
|
sessionNotification: ReturnType<typeof import("./hooks").createSessionNotification> | null;
|
|
60
60
|
thinkMode: ReturnType<typeof import("./hooks").createThinkModeHook> | null;
|
|
61
|
-
|
|
61
|
+
contextWindowLimitRecovery: ReturnType<typeof import("./hooks").createContextWindowLimitRecoveryHook> | null;
|
|
62
62
|
autoUpdateChecker: ReturnType<typeof import("./hooks").createAutoUpdateCheckerHook> | null;
|
|
63
63
|
agentUsageReminder: ReturnType<typeof import("./hooks").createAgentUsageReminderHook> | null;
|
|
64
64
|
nonInteractiveEnv: ReturnType<typeof import("./hooks").createNonInteractiveEnvHook> | null;
|
|
@@ -69,10 +69,8 @@ export declare function createHooks(args: {
|
|
|
69
69
|
startWork: ReturnType<typeof import("./hooks").createStartWorkHook> | null;
|
|
70
70
|
oracleMdOnly: ReturnType<typeof import("./hooks").createOracleMdOnlyHook> | null;
|
|
71
71
|
mouseNotepad: ReturnType<typeof import("./hooks").createMouseNotepadHook> | null;
|
|
72
|
-
questionLabelTruncator: ReturnType<typeof import("./hooks").createQuestionLabelTruncatorHook>;
|
|
73
72
|
taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook>;
|
|
74
73
|
anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
|
|
75
74
|
runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
|
|
76
75
|
rtkBashRewriter: ReturnType<typeof import("./hooks").createRtkBashRewriterHook> | null;
|
|
77
|
-
mcpStartupNotification: ReturnType<typeof import("./hooks").createMcpStartupNotificationHook> | null;
|
|
78
76
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { executeCompact, getLastAssistant } from "./executor";
|
|
2
|
+
export * from "./message-builder";
|
|
3
|
+
export { parseAnthropicTokenLimitError, parseTokenLimitError } from "./parser";
|
|
4
|
+
export type { AnthropicContextWindowLimitRecoveryOptions, ContextWindowLimitRecoveryOptions } from "./recovery-hook";
|
|
5
|
+
export { createAnthropicContextWindowLimitRecoveryHook, createContextWindowLimitRecoveryHook } from "./recovery-hook";
|
|
6
|
+
export * from "./recovery-strategy";
|
|
7
|
+
export * from "./state";
|
|
8
|
+
export type { AutoCompactState, ParsedTokenLimitError, TruncateState } from "./types";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const TOKEN_LIMIT_PATTERNS: RegExp[];
|
|
2
|
+
export declare const TOKEN_LIMIT_KEYWORDS: string[];
|
|
3
|
+
export declare const THINKING_BLOCK_ERROR_PATTERNS: RegExp[];
|
|
4
|
+
export declare const MESSAGE_INDEX_PATTERN: RegExp;
|
|
5
|
+
export declare function extractTokensFromMessage(message: string): {
|
|
6
|
+
current: number;
|
|
7
|
+
max: number;
|
|
8
|
+
} | null;
|
|
9
|
+
export declare function extractMessageIndex(text: string): number | undefined;
|
|
10
|
+
export declare function isThinkingBlockError(text: string): boolean;
|
|
11
|
+
export declare function isTokenLimitError(text: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ParsedTokenLimitError } from "./types";
|
|
2
|
+
export { extractMessageIndex, extractTokensFromMessage, isThinkingBlockError, isTokenLimitError, MESSAGE_INDEX_PATTERN, THINKING_BLOCK_ERROR_PATTERNS, TOKEN_LIMIT_KEYWORDS, TOKEN_LIMIT_PATTERNS } from "./parser-patterns";
|
|
3
|
+
export interface GenericErrorData {
|
|
4
|
+
type: "error";
|
|
5
|
+
error: {
|
|
6
|
+
type: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
request_id?: string;
|
|
10
|
+
}
|
|
11
|
+
/** @deprecated use GenericErrorData */
|
|
12
|
+
export type AnthropicErrorData = GenericErrorData;
|
|
13
|
+
export declare function parseTokenLimitError(err: unknown): ParsedTokenLimitError | null;
|
|
14
|
+
/** @deprecated use parseTokenLimitError */
|
|
15
|
+
export declare const parseAnthropicTokenLimitError: typeof parseTokenLimitError;
|
|
@@ -11,3 +11,5 @@ export declare function createAnthropicContextWindowLimitRecoveryHook(ctx: Plugi
|
|
|
11
11
|
};
|
|
12
12
|
}) => Promise<void>;
|
|
13
13
|
};
|
|
14
|
+
export type ContextWindowLimitRecoveryOptions = AnthropicContextWindowLimitRecoveryOptions;
|
|
15
|
+
export declare const createContextWindowLimitRecoveryHook: typeof createAnthropicContextWindowLimitRecoveryHook;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { truncateUntilTargetTokens } from "./target-token-truncation";
|
|
2
|
+
export type { AggressiveTruncateResult, ToolResultInfo } from "./tool-part-types";
|
|
3
|
+
export { countTruncatedResults, countTruncatedResultsFromSDK, findLargestToolResult, findToolResultsBySize, findToolResultsBySizeFromSDK, getTotalToolOutputSize, getTotalToolOutputSizeFromSDK, TRUNCATION_MESSAGE, truncateToolResult, truncateToolResultAsync, } from "./tool-result-store";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { ToolResultInfo } from "./tool-part-types";
|
|
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.]";
|
|
3
4
|
type OpencodeClient = PluginInput["client"];
|
|
4
5
|
interface SDKToolPart {
|
|
5
6
|
id: string;
|
|
@@ -18,6 +19,15 @@ interface SDKToolPart {
|
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
21
|
}
|
|
22
|
+
export declare function findToolResultsBySize(sessionID: string): ToolResultInfo[];
|
|
23
|
+
export declare function findLargestToolResult(sessionID: string): ToolResultInfo | null;
|
|
24
|
+
export declare function truncateToolResult(partPath: string): {
|
|
25
|
+
success: boolean;
|
|
26
|
+
toolName?: string;
|
|
27
|
+
originalSize?: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function getTotalToolOutputSize(sessionID: string): number;
|
|
30
|
+
export declare function countTruncatedResults(sessionID: string): number;
|
|
21
31
|
export declare function findToolResultsBySizeFromSDK(client: OpencodeClient, sessionID: string): Promise<ToolResultInfo[]>;
|
|
22
32
|
export declare function truncateToolResultAsync(client: OpencodeClient, sessionID: string, messageID: string, partId: string, part: SDKToolPart): Promise<{
|
|
23
33
|
success: boolean;
|
|
@@ -30,7 +30,7 @@ export declare const RETRY_CONFIG: {
|
|
|
30
30
|
readonly maxDelayMs: 30000;
|
|
31
31
|
};
|
|
32
32
|
export declare const TRUNCATE_CONFIG: {
|
|
33
|
-
readonly maxTruncateAttempts:
|
|
33
|
+
readonly maxTruncateAttempts: 5;
|
|
34
34
|
readonly minOutputSizeToTruncate: 500;
|
|
35
35
|
readonly targetTokenRatio: 0.5;
|
|
36
36
|
readonly charsPerToken: 4;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
|
|
2
|
+
import type { MatrixxConfig } from "../config";
|
|
3
|
+
import type { ExperimentalConfig } from "../config/schema/experimental";
|
|
4
|
+
export declare function createContextWindowMonitorHook(_ctx: PluginInput, pluginConfig?: MatrixxConfig | {
|
|
5
|
+
experimental?: ExperimentalConfig;
|
|
6
|
+
}): {
|
|
3
7
|
"tool.execute.after": (input: {
|
|
4
8
|
tool: string;
|
|
5
9
|
sessionID: string;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { createAgentUsageReminderHook } from "./agent-usage-reminder";
|
|
2
|
-
export { type AnthropicContextWindowLimitRecoveryOptions, createAnthropicContextWindowLimitRecoveryHook } from "./anthropic-context-window-limit-recovery";
|
|
3
2
|
export { createArchitectHook } from "./architect";
|
|
4
3
|
export { createAutoSlashCommandHook } from "./auto-slash-command";
|
|
5
4
|
export { createAutoUpdateCheckerHook } from "./auto-update-checker";
|
|
@@ -10,11 +9,11 @@ export { createCommentCheckerHooks } from "./comment-checker";
|
|
|
10
9
|
export { createCompactionContextInjector } from "./compaction-context-injector";
|
|
11
10
|
export { createCompactionTodoPreserverHook } from "./compaction-todo-preserver";
|
|
12
11
|
export { createContextModeEnforcerHook } from "./context-mode-enforcer";
|
|
12
|
+
export { type ContextWindowLimitRecoveryOptions, type ContextWindowLimitRecoveryOptions as AnthropicContextWindowLimitRecoveryOptions, createContextWindowLimitRecoveryHook, createContextWindowLimitRecoveryHook as createAnthropicContextWindowLimitRecoveryHook } from "./context-window-limit-recovery";
|
|
13
13
|
export { createContextWindowMonitorHook } from "./context-window-monitor";
|
|
14
14
|
export { createDelegateTaskRetryHook } from "./delegate-task-retry";
|
|
15
15
|
export { createDesignIntentPreserverHook } from "./design-intent-preserver";
|
|
16
16
|
export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
17
|
-
export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector";
|
|
18
17
|
export { createEditErrorRecoveryHook } from "./edit-error-recovery";
|
|
19
18
|
export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
|
|
20
19
|
export { createEnvContextInjectorHook } from "./env-context-injector";
|
|
@@ -25,18 +24,17 @@ export { passesQualityGate } from "./evolution-quality-gate";
|
|
|
25
24
|
export { createEvolutionWatcherHook } from "./evolution-watcher";
|
|
26
25
|
export { createHashlineEditDiffEnhancerHook } from "./hashline-edit-diff-enhancer";
|
|
27
26
|
export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
|
|
27
|
+
export { createInputSecretGuardHook } from "./input-secret-guard";
|
|
28
28
|
export { createInteractiveBashSessionHook } from "./interactive-bash-session";
|
|
29
29
|
export { createJsonErrorRecoveryHook } from "./json-error-recovery";
|
|
30
30
|
export { createKeywordDetectorHook } from "./keyword-detector";
|
|
31
31
|
export { createMatrixLoopHook, type MatrixLoopHook } from "./matrix-loop";
|
|
32
|
-
export { createMcpStartupNotificationHook } from "./mcp-startup-notification";
|
|
33
32
|
export { createMouseNotepadHook } from "./mouse-notepad";
|
|
34
33
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
35
34
|
export { createOracleMdOnlyHook } from "./oracle-md-only";
|
|
36
35
|
export { createPlanPersister } from "./plan-persister";
|
|
37
36
|
export { createPreemptiveCompactionHook } from "./preemptive-compaction";
|
|
38
37
|
export { createQualityGateHook } from "./quality-gate/hook";
|
|
39
|
-
export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
|
|
40
38
|
export { createReadImageResizerHook } from "./read-image-resizer";
|
|
41
39
|
export { createRtkBashRewriterHook } from "./rtk-bash-rewriter";
|
|
42
40
|
export { createRulesInjectorHook } from "./rules-injector";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Rule {
|
|
2
|
+
id: string;
|
|
3
|
+
pattern: string;
|
|
4
|
+
description: string;
|
|
5
|
+
severity: "block" | "warn";
|
|
6
|
+
}
|
|
7
|
+
export type RuleSeverity = "block" | "warn";
|
|
8
|
+
export type DetectionRule = Rule;
|
|
9
|
+
export declare const BLOCKLIST_RULES: Rule[];
|
|
10
|
+
export declare const WARNLIST_HEURISTICS: Rule[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { hashFinding, redactMatch } from "./redactor";
|
|
2
|
+
export type Finding = {
|
|
3
|
+
ruleId: string;
|
|
4
|
+
match: string;
|
|
5
|
+
redacted: string;
|
|
6
|
+
severity: "block" | "warn";
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
export type CompiledRule = {
|
|
11
|
+
id: string;
|
|
12
|
+
severity: "block" | "warn";
|
|
13
|
+
regex: RegExp;
|
|
14
|
+
};
|
|
15
|
+
export declare function shannonEntropy(token: string): number;
|
|
16
|
+
export declare function compileRules(): CompiledRule[];
|
|
17
|
+
export declare function detectSecrets(text: string, opts?: {
|
|
18
|
+
maxScanBytes?: number;
|
|
19
|
+
allowlist?: string[];
|
|
20
|
+
entropyThreshold?: number;
|
|
21
|
+
}): Finding[];
|
|
22
|
+
export { hashFinding, redactMatch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { InputSecretGuardConfig } from "../../config/schema/security";
|
|
3
|
+
export declare function createInputSecretGuardHook(ctx: PluginInput, cfg?: InputSecretGuardConfig): {
|
|
4
|
+
"chat.message": (input: {
|
|
5
|
+
sessionID: string;
|
|
6
|
+
agent?: string;
|
|
7
|
+
model?: {
|
|
8
|
+
providerID: string;
|
|
9
|
+
modelID: string;
|
|
10
|
+
};
|
|
11
|
+
}, output: {
|
|
12
|
+
message: Record<string, unknown>;
|
|
13
|
+
parts: Array<{
|
|
14
|
+
type: string;
|
|
15
|
+
text?: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createInputSecretGuardHook } from "./hook";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isSessionAllowed(sessionID: string, hash: string): boolean;
|
|
2
|
+
export declare function allowOnce(sessionID: string, hash: string): void;
|
|
3
|
+
export declare function allowSession(sessionID: string, hash: string): void;
|
|
4
|
+
export declare function consumeOneShot(sessionID: string, hash: string): boolean;
|
|
5
|
+
export declare function clearSession(sessionID: string): void;
|
|
6
|
+
export declare function clearAll(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|