opencode-matrixx 2.6.2 → 2.6.4
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/agents/dynamic-agent-prompt-builder.d.ts +5 -3
- package/dist/agents/mouse/agent.d.ts +1 -1
- package/dist/agents/oracle/behavioral-summary.d.ts +1 -1
- package/dist/agents/oracle/identity-constraints.d.ts +1 -1
- package/dist/agents/oracle/plan-generation.d.ts +1 -1
- package/dist/agents/oracle/plan-template.d.ts +1 -1
- package/dist/agents/oracle/system-prompt.d.ts +4 -3
- package/dist/agents/smith.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/cli.js +138 -20
- package/dist/config/migrations/index.d.ts +1 -0
- package/dist/config/migrations/model-migration.d.ts +18 -0
- package/dist/config/resolve-tiers.d.ts +1 -1
- package/dist/config/schema/experimental.d.ts +2 -0
- package/dist/config/schema/failure-counter.d.ts +7 -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 +70 -9
- package/dist/config/schema/model-config.d.ts +81 -0
- package/dist/config/schema/morpheus.d.ts +4 -2
- package/dist/config/schema/security.d.ts +49 -0
- package/dist/config/schema.d.ts +2 -0
- package/dist/create-hooks.d.ts +3 -4
- package/dist/features/background-agent/manager.d.ts +8 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/mission-state/plan-storage.d.ts +1 -0
- package/dist/features/mission-state/plan-storage.test.d.ts +1 -0
- package/dist/features/session-state/state.d.ts +26 -0
- package/dist/features/session-state/state.test.d.ts +1 -0
- package/dist/features/task-storage/types.d.ts +1 -0
- package/dist/hooks/context-mode-enforcer/constants.d.ts +1 -1
- 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/failure-counter/counter.d.ts +7 -0
- package/dist/hooks/failure-counter/counter.test.d.ts +1 -0
- package/dist/hooks/failure-counter/hook.d.ts +18 -0
- package/dist/hooks/failure-counter/index.d.ts +3 -0
- package/dist/hooks/failure-counter/patterns.d.ts +6 -0
- package/dist/hooks/failure-counter/patterns.test.d.ts +1 -0
- 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/interactive-bash-session/hook.test.d.ts +1 -0
- package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/deepseek.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +2 -9
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/glm.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/mimo.d.ts +1 -1
- 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/stop-continuation-guard/hook.d.ts +3 -2
- package/dist/hooks/stop-continuation-guard/repro.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/awaiting-user.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/constants.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/continuation-injection.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/countdown.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/handler.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/idle-event.d.ts +2 -0
- package/dist/hooks/task-continuation-enforcer/staleness.d.ts +16 -0
- package/dist/hooks/task-continuation-enforcer/staleness.test.d.ts +1 -0
- package/dist/hooks/task-continuation-enforcer/todo.d.ts +15 -0
- package/dist/hooks/task-continuation-enforcer/types.d.ts +6 -0
- package/dist/hooks/task-continuation-enforcer/ulw-bootstrap.test.d.ts +1 -0
- package/dist/hooks/task-edit-guard/constants.d.ts +2 -0
- package/dist/hooks/todo-continuation-enforcer/awaiting-user.test.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +3 -0
- package/dist/index.js +36175 -35248
- package/dist/matrixx.schema.json +373 -73
- package/dist/plugin/hooks/create-core-hooks.d.ts +3 -4
- package/dist/plugin/hooks/create-session-hooks.d.ts +3 -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/plugin-handlers/oracle-agent-config-builder.d.ts +2 -1
- package/dist/shared/awaiting-user.d.ts +12 -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/merge-categories.d.ts +12 -1
- package/dist/shared/migration/hook-names.d.ts +1 -0
- package/dist/shared/model-requirements.d.ts +9 -0
- package/dist/shared/model-sanitizer.d.ts +1 -1
- package/dist/shared/model-tiers.d.ts +28 -15
- package/dist/shared/tier-resolver.d.ts +9 -9
- package/dist/tools/delegate-task/categories.d.ts +12 -1
- package/dist/tools/delegate-task/complexity-constants.d.ts +15 -11
- package/dist/tools/delegate-task/executor-types.d.ts +4 -1
- package/dist/tools/delegate-task/index.d.ts +1 -1
- package/dist/tools/delegate-task/types.d.ts +4 -1
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/plan/constants.d.ts +10 -0
- package/dist/tools/plan/index.d.ts +6 -0
- package/dist/tools/plan/plan-create.d.ts +3 -0
- package/dist/tools/plan/plan-delete.d.ts +3 -0
- package/dist/tools/plan/plan-list.d.ts +3 -0
- package/dist/tools/plan/plan-read.d.ts +3 -0
- package/dist/tools/plan/plan-update.d.ts +3 -0
- package/dist/tools/plan/types.d.ts +28 -0
- package/dist/tools/task/constants.d.ts +5 -0
- package/dist/tools/task/types.d.ts +2 -0
- 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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ModelFallbackEntrySchema: z.ZodObject<{
|
|
3
|
+
providers: z.ZodArray<z.ZodString>;
|
|
4
|
+
model: z.ZodString;
|
|
5
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type ModelFallbackEntry = z.infer<typeof ModelFallbackEntrySchema>;
|
|
8
|
+
export declare const TierSpecSchema: z.ZodObject<{
|
|
9
|
+
providerPriority: z.ZodArray<z.ZodString>;
|
|
10
|
+
modelPattern: z.ZodString;
|
|
11
|
+
fallbackTier: z.ZodOptional<z.ZodString>;
|
|
12
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
+
providers: z.ZodArray<z.ZodString>;
|
|
14
|
+
model: z.ZodString;
|
|
15
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type TierSpec = z.infer<typeof TierSpecSchema>;
|
|
19
|
+
export declare const TiersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
20
|
+
providerPriority: z.ZodArray<z.ZodString>;
|
|
21
|
+
modelPattern: z.ZodString;
|
|
22
|
+
fallbackTier: z.ZodOptional<z.ZodString>;
|
|
23
|
+
fallback: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
providers: z.ZodArray<z.ZodString>;
|
|
25
|
+
model: z.ZodString;
|
|
26
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
export type Tiers = z.infer<typeof TiersSchema>;
|
|
30
|
+
export declare const ComplexityDowngradesSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
31
|
+
export type ComplexityDowngrades = z.infer<typeof ComplexityDowngradesSchema>;
|
|
32
|
+
export declare const AgentModelRequirementsSchema: z.ZodObject<{
|
|
33
|
+
fallbackChain: z.ZodArray<z.ZodObject<{
|
|
34
|
+
providers: z.ZodArray<z.ZodString>;
|
|
35
|
+
model: z.ZodString;
|
|
36
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
requiresModel: z.ZodOptional<z.ZodString>;
|
|
39
|
+
requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type AgentModelRequirements = z.infer<typeof AgentModelRequirementsSchema>;
|
|
44
|
+
export declare const CategoryModelRequirementsSchema: z.ZodObject<{
|
|
45
|
+
fallbackChain: z.ZodArray<z.ZodObject<{
|
|
46
|
+
providers: z.ZodArray<z.ZodString>;
|
|
47
|
+
model: z.ZodString;
|
|
48
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
requiresModel: z.ZodOptional<z.ZodString>;
|
|
51
|
+
requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type CategoryModelRequirements = z.infer<typeof CategoryModelRequirementsSchema>;
|
|
56
|
+
export declare const ModelRequirementsSchema: z.ZodObject<{
|
|
57
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
58
|
+
fallbackChain: z.ZodArray<z.ZodObject<{
|
|
59
|
+
providers: z.ZodArray<z.ZodString>;
|
|
60
|
+
model: z.ZodString;
|
|
61
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
requiresModel: z.ZodOptional<z.ZodString>;
|
|
64
|
+
requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>>>;
|
|
68
|
+
categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
69
|
+
fallbackChain: z.ZodArray<z.ZodObject<{
|
|
70
|
+
providers: z.ZodArray<z.ZodString>;
|
|
71
|
+
model: z.ZodString;
|
|
72
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
requiresModel: z.ZodOptional<z.ZodString>;
|
|
75
|
+
requiresAnyModel: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
requiresProvider: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type ModelRequirements = z.infer<typeof ModelRequirementsSchema>;
|
|
81
|
+
export declare const DEFAULT_MODEL_CONFIG: {};
|
|
@@ -2,21 +2,23 @@ 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";
|
|
9
8
|
}>>>;
|
|
9
|
+
stale_after_hours: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
export declare const MorpheusConfigSchema: z.ZodObject<{
|
|
12
13
|
tasks: z.ZodOptional<z.ZodObject<{
|
|
13
14
|
storage_path: z.ZodOptional<z.ZodString>;
|
|
14
15
|
task_list_id: z.ZodOptional<z.ZodString>;
|
|
15
|
-
claude_code_compat: z.ZodDefault<z.ZodBoolean>;
|
|
16
16
|
scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
17
17
|
project: "project";
|
|
18
18
|
global: "global";
|
|
19
19
|
}>>>;
|
|
20
|
+
stale_after_hours: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
20
22
|
}, z.core.$strip>>;
|
|
21
23
|
}, z.core.$strip>;
|
|
22
24
|
export type MorpheusTasksConfig = z.infer<typeof MorpheusTasksConfigSchema>;
|
|
@@ -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/config/schema.d.ts
CHANGED
|
@@ -13,11 +13,13 @@ export * from "./schema/context-mode";
|
|
|
13
13
|
export * from "./schema/dcp";
|
|
14
14
|
export * from "./schema/evolution";
|
|
15
15
|
export * from "./schema/experimental";
|
|
16
|
+
export * from "./schema/failure-counter";
|
|
16
17
|
export * from "./schema/headroom";
|
|
17
18
|
export * from "./schema/hooks";
|
|
18
19
|
export * from "./schema/matrix-loop";
|
|
19
20
|
export * from "./schema/matrixx-config";
|
|
20
21
|
export * from "./schema/matrixx-self-config";
|
|
22
|
+
export * from "./schema/model-config";
|
|
21
23
|
export * from "./schema/morpheus";
|
|
22
24
|
export * from "./schema/morpheus-agent";
|
|
23
25
|
export * from "./schema/notification";
|
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;
|
|
@@ -66,13 +66,12 @@ export declare function createHooks(args: {
|
|
|
66
66
|
matrixLoop: ReturnType<typeof import("./hooks").createMatrixLoopHook> | null;
|
|
67
67
|
editErrorRecovery: ReturnType<typeof import("./hooks").createEditErrorRecoveryHook> | null;
|
|
68
68
|
delegateTaskRetry: ReturnType<typeof import("./hooks").createDelegateTaskRetryHook> | null;
|
|
69
|
+
failureCounter: ReturnType<typeof import("./hooks").createFailureCounterHook> | null;
|
|
69
70
|
startWork: ReturnType<typeof import("./hooks").createStartWorkHook> | null;
|
|
70
71
|
oracleMdOnly: ReturnType<typeof import("./hooks").createOracleMdOnlyHook> | null;
|
|
71
72
|
mouseNotepad: ReturnType<typeof import("./hooks").createMouseNotepadHook> | null;
|
|
72
|
-
questionLabelTruncator: ReturnType<typeof import("./hooks").createQuestionLabelTruncatorHook>;
|
|
73
73
|
taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook>;
|
|
74
74
|
anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
|
|
75
75
|
runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
|
|
76
76
|
rtkBashRewriter: ReturnType<typeof import("./hooks").createRtkBashRewriterHook> | null;
|
|
77
|
-
mcpStartupNotification: ReturnType<typeof import("./hooks").createMcpStartupNotificationHook> | null;
|
|
78
77
|
};
|
|
@@ -137,6 +137,14 @@ export declare class BackgroundManager {
|
|
|
137
137
|
private notifyParentSession;
|
|
138
138
|
private hasRunningTasks;
|
|
139
139
|
private pruneStaleTasksAndNotifications;
|
|
140
|
+
/**
|
|
141
|
+
* True when the subagent session is awaiting user input (unanswered question).
|
|
142
|
+
* The reaper must not kill a task that is legitimately waiting for an answer:
|
|
143
|
+
* its session reports idle and it stops posting progress, but it is not stuck.
|
|
144
|
+
* Ground truth comes from the session message history (hasPendingQuestionMessage);
|
|
145
|
+
* on fetch failure we fail open (return false) so reaping behavior is unchanged.
|
|
146
|
+
*/
|
|
147
|
+
private isSessionAwaitingUser;
|
|
140
148
|
private checkAndInterruptStaleTasks;
|
|
141
149
|
private pollRunningTasks;
|
|
142
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const START_WORK_TEMPLATE = "You are starting a Morpheus work session.\n\n## WHAT TO DO\n\n1. **Find available plans**:
|
|
1
|
+
export declare const START_WORK_TEMPLATE = "You are starting a Morpheus work session.\n\n## WHAT TO DO\n\n1. **Find available plans**: List Oracle-generated plan files via plan_list at `.matrixx/plans/`\n\n2. **Check for active mission state**: Read `.matrixx/mission.json` if it exists\n\n3. **Decision logic**:\n - If `.matrixx/mission.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files via plan_list\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Create/Update mission.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\"\n }\n ```\n\n5. **Read the plan file via plan_read** and start executing tasks according to architect workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update mission.json BEFORE starting work\n- Read the FULL plan file via plan_read before delegating any tasks\n- Follow architect delegation protocols (7-section format)";
|
|
@@ -30,6 +30,7 @@ export declare function writePlanFile(directory: string, planPath: string, conte
|
|
|
30
30
|
* For each `- [ ]` or `- [x]` line, finds the matching todo by content
|
|
31
31
|
* and marks it completed if the todo status is completed/cancelled.
|
|
32
32
|
* Lines without a matching todo keep their current state.
|
|
33
|
+
* Checked boxes are never unchecked — sync only transitions [ ] → [x].
|
|
33
34
|
*/
|
|
34
35
|
export declare function syncCheckboxes(content: string, todos: Array<{
|
|
35
36
|
content: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
export declare const subagentSessions: Set<string>;
|
|
2
|
+
export declare function registerSubagentSession(sessionID: string, parentSessionID: string): void;
|
|
3
|
+
export declare function getParentSessionID(subagentSessionID: string): string | undefined;
|
|
4
|
+
export declare function getSubagentSessionIDs(parentSessionID: string): string[];
|
|
2
5
|
export declare function setMainSession(id: string | undefined): void;
|
|
3
6
|
export declare function getMainSessionID(): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Whether a session.created payload should be tracked as the plugin's main
|
|
9
|
+
* session. Top-level sessions (no parentID) qualify UNLESS they are internal
|
|
10
|
+
* sessions of another plugin (e.g. opencode-mem structured-output capture
|
|
11
|
+
* sessions are top-level with metadata["opencode-mem"].internal === true).
|
|
12
|
+
* Foreign top-level sessions must not hijack main-session tracking.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isMainSessionCandidate(sessionInfo: {
|
|
15
|
+
id?: string;
|
|
16
|
+
parentID?: string;
|
|
17
|
+
metadata?: Record<string, unknown>;
|
|
18
|
+
} | undefined): boolean;
|
|
4
19
|
/** @internal For testing only */
|
|
5
20
|
export declare function _resetForTesting(): void;
|
|
6
21
|
export declare function setSessionAgent(sessionID: string, agent: string): void;
|
|
7
22
|
export declare function updateSessionAgent(sessionID: string, agent: string): void;
|
|
8
23
|
export declare function getSessionAgent(sessionID: string): string | undefined;
|
|
9
24
|
export declare function clearSessionAgent(sessionID: string): void;
|
|
25
|
+
export declare function incFailureCounter(sessionID: string): number;
|
|
26
|
+
export declare function resetFailureCounter(sessionID: string): void;
|
|
27
|
+
export declare function getFailureCount(sessionID: string): number;
|
|
28
|
+
export declare function getFailureState(sessionID: string): {
|
|
29
|
+
count: number;
|
|
30
|
+
lastFailedAt: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
export declare function clearFailureCounter(sessionID: string): void;
|
|
33
|
+
/** @internal For testing only */
|
|
34
|
+
export declare function _resetFailureCountersForTesting(): void;
|
|
35
|
+
export declare function isThresholdReached(sessionID: string, threshold: number): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,6 +21,7 @@ export declare const TaskSchema: z.ZodObject<{
|
|
|
21
21
|
blockedBy: z.ZodArray<z.ZodString>;
|
|
22
22
|
owner: z.ZodOptional<z.ZodString>;
|
|
23
23
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
+
threadID: z.ZodOptional<z.ZodString>;
|
|
24
25
|
projectRoot: z.ZodOptional<z.ZodString>;
|
|
25
26
|
}, z.core.$strict>;
|
|
26
27
|
export type Task = z.infer<typeof TaskSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const HOOK_NAME = "context-mode-enforcer";
|
|
2
|
-
export declare const WARN_MESSAGE_READ = "Use ctx_search / ctx_batch_execute / ctx_execute for analysis \u2014 raw read/grep/glob bypasses FTS5 sandbox and pollutes context. Use Read only with hashline IDs for Edit.";
|
|
2
|
+
export declare const WARN_MESSAGE_READ = "Use ctx_search / ctx_batch_execute / ctx_execute for analysis \u2014 raw read/grep/glob bypasses FTS5 sandbox and pollutes context. Use Read only with hashline IDs for Edit (non-plan paths; .matrixx/plans/*.md must use plan_read/plan_update).";
|
|
3
3
|
export declare const BLOCK_MESSAGE_GREP_GLOB = "Blocked: raw grep/glob is forbidden when context-mode is enforced. Use ctx_search (indexed) \u2192 grep/glob fallback only when ctx_* unavailable, or ctx_batch_execute / ctx_execute for multi-file analysis.";
|
|
4
4
|
export declare const WARN_MESSAGE_BASH_READ = "Use ctx_* / Read tool instead of `cat`/`head`/`tail`/`grep` via bash for analysis. Raw bash file reads bypass sandbox.";
|
|
5
5
|
export declare const DEFAULT_BLOCKED_TOOLS: readonly ["grep", "glob"];
|
|
@@ -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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { clearFailureCounter, getFailureCount, resetFailureCounter } from "../../features/session-state/state";
|
|
2
|
+
export declare const CONTINUATION_COOLDOWN_MS = 30000;
|
|
3
|
+
export interface HandleToolAfterOptions {
|
|
4
|
+
parentSessionID?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function handleToolAfter(sessionID: string, output: string, isSuccess: boolean, options?: HandleToolAfterOptions): void;
|
|
7
|
+
export { clearFailureCounter, getFailureCount, resetFailureCounter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export declare function createFailureCounterHook(_ctx: PluginInput): {
|
|
3
|
+
"tool.execute.after": (input: {
|
|
4
|
+
tool: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
callID: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
event: (input: {
|
|
13
|
+
event: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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";
|
|
@@ -23,20 +22,20 @@ export { createEvolutionCompressorHook } from "./evolution-compressor";
|
|
|
23
22
|
export { createEvolutionHitlHook } from "./evolution-hitl";
|
|
24
23
|
export { passesQualityGate } from "./evolution-quality-gate";
|
|
25
24
|
export { createEvolutionWatcherHook } from "./evolution-watcher";
|
|
25
|
+
export { createFailureCounterHook } from "./failure-counter";
|
|
26
26
|
export { createHashlineEditDiffEnhancerHook } from "./hashline-edit-diff-enhancer";
|
|
27
27
|
export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
|
|
28
|
+
export { createInputSecretGuardHook } from "./input-secret-guard";
|
|
28
29
|
export { createInteractiveBashSessionHook } from "./interactive-bash-session";
|
|
29
30
|
export { createJsonErrorRecoveryHook } from "./json-error-recovery";
|
|
30
31
|
export { createKeywordDetectorHook } from "./keyword-detector";
|
|
31
32
|
export { createMatrixLoopHook, type MatrixLoopHook } from "./matrix-loop";
|
|
32
|
-
export { createMcpStartupNotificationHook } from "./mcp-startup-notification";
|
|
33
33
|
export { createMouseNotepadHook } from "./mouse-notepad";
|
|
34
34
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
35
35
|
export { createOracleMdOnlyHook } from "./oracle-md-only";
|
|
36
36
|
export { createPlanPersister } from "./plan-persister";
|
|
37
37
|
export { createPreemptiveCompactionHook } from "./preemptive-compaction";
|
|
38
38
|
export { createQualityGateHook } from "./quality-gate/hook";
|
|
39
|
-
export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
|
|
40
39
|
export { createReadImageResizerHook } from "./read-image-resizer";
|
|
41
40
|
export { createRtkBashRewriterHook } from "./rtk-bash-rewriter";
|
|
42
41
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 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.";
|
|
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 (if available), 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.";
|
|
@@ -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- 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.";
|
|
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 (if available), ripgrep (rg), ast-grep (sg)\nNEVER stop at first result - be exhaustive.";
|