opencode-matrixx 2.6.6 → 2.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cli.js +51 -4
  2. package/dist/config/schema/background-task.d.ts +37 -0
  3. package/dist/config/schema/dcp.d.ts +46 -0
  4. package/dist/config/schema/matrixx-config.d.ts +32 -0
  5. package/dist/features/background-agent/admission.d.ts +24 -0
  6. package/dist/features/background-agent/concurrency.d.ts +9 -0
  7. package/dist/features/background-agent/constants.d.ts +13 -0
  8. package/dist/features/background-agent/handle-index.d.ts +12 -0
  9. package/dist/features/background-agent/manager.d.ts +59 -4
  10. package/dist/features/background-agent/notification-builder.d.ts +1 -0
  11. package/dist/features/background-agent/reconcile.d.ts +33 -0
  12. package/dist/features/background-agent/revive.d.ts +39 -0
  13. package/dist/features/background-agent/session-output.d.ts +40 -0
  14. package/dist/features/background-agent/task-history.d.ts +20 -0
  15. package/dist/features/background-agent/types.d.ts +21 -1
  16. package/dist/features/background-agent/wake-scheduler.d.ts +47 -0
  17. package/dist/features/background-agent/wallclock.d.ts +37 -0
  18. package/dist/features/bdd/schema.d.ts +5 -5
  19. package/dist/hooks/context-mode-enforcer/constants.d.ts +1 -1
  20. package/dist/index.js +1909 -716
  21. package/dist/matrixx.schema.json +165 -3
  22. package/dist/plugin-handlers/agent-config-handler.d.ts +2 -1
  23. package/dist/shared/context-mode-enforcement.d.ts +35 -0
  24. package/dist/shared/index.d.ts +1 -1
  25. package/dist/shared/revive-outcome.d.ts +15 -0
  26. package/dist/shared/saturated-outcome.d.ts +18 -0
  27. package/dist/shared/wallclock-outcome.d.ts +18 -0
  28. package/dist/tools/background-task/constants.d.ts +1 -0
  29. package/dist/tools/background-task/create-background-revive.d.ts +3 -0
  30. package/dist/tools/background-task/index.d.ts +1 -1
  31. package/dist/tools/background-task/tools.d.ts +1 -0
  32. package/dist/tools/background-task/types.d.ts +9 -0
  33. package/dist/tools/dcp-switch-profile/tools.d.ts +1 -0
  34. package/dist/tools/index.d.ts +1 -1
  35. package/package.json +1 -1
  36. package/dist/shared/context-mode-prompt.d.ts +0 -12
  37. package/dist/shared/context-mode-prompt.test.d.ts +0 -1
@@ -4063,6 +4063,27 @@
4063
4063
  "turns": 4
4064
4064
  }
4065
4065
  }
4066
+ },
4067
+ "brutal": {
4068
+ "pruneNotification": "off",
4069
+ "compress": {
4070
+ "maxContextLimit": "15%",
4071
+ "minContextLimit": "10%",
4072
+ "nudgeFrequency": 1,
4073
+ "nudgeForce": "strong",
4074
+ "iterationNudgeThreshold": 1
4075
+ },
4076
+ "turnProtection": {
4077
+ "enabled": false
4078
+ },
4079
+ "experimental": {
4080
+ "allowSubAgents": false
4081
+ },
4082
+ "strategies": {
4083
+ "purgeErrors": {
4084
+ "turns": 1
4085
+ }
4086
+ }
4066
4087
  }
4067
4088
  },
4068
4089
  "type": "object",
@@ -4184,6 +4205,46 @@
4184
4205
  "default_profile": {
4185
4206
  "type": "string"
4186
4207
  },
4208
+ "handoffCompression": {
4209
+ "default": {
4210
+ "enabled": true,
4211
+ "maxMessages": 6,
4212
+ "keepFirst": 2,
4213
+ "keepLast": 3
4214
+ },
4215
+ "type": "object",
4216
+ "properties": {
4217
+ "enabled": {
4218
+ "default": true,
4219
+ "type": "boolean"
4220
+ },
4221
+ "maxMessages": {
4222
+ "default": 6,
4223
+ "type": "integer",
4224
+ "minimum": 1,
4225
+ "maximum": 9007199254740991
4226
+ },
4227
+ "keepFirst": {
4228
+ "default": 2,
4229
+ "type": "integer",
4230
+ "minimum": 0,
4231
+ "maximum": 9007199254740991
4232
+ },
4233
+ "keepLast": {
4234
+ "default": 3,
4235
+ "type": "integer",
4236
+ "minimum": 0,
4237
+ "maximum": 9007199254740991
4238
+ }
4239
+ },
4240
+ "required": [
4241
+ "enabled",
4242
+ "maxMessages",
4243
+ "keepFirst",
4244
+ "keepLast"
4245
+ ],
4246
+ "additionalProperties": false
4247
+ },
4187
4248
  "base": {
4188
4249
  "default": {
4189
4250
  "autoUpdate": false,
@@ -4217,7 +4278,10 @@
4217
4278
  "enabled": false,
4218
4279
  "automaticStrategies": true
4219
4280
  },
4220
- "protectedFilePatterns": []
4281
+ "protectedFilePatterns": [],
4282
+ "experimental": {
4283
+ "allowSubAgents": true
4284
+ }
4221
4285
  },
4222
4286
  "type": "object",
4223
4287
  "properties": {
@@ -4436,6 +4500,18 @@
4436
4500
  "items": {
4437
4501
  "type": "string"
4438
4502
  }
4503
+ },
4504
+ "experimental": {
4505
+ "default": {
4506
+ "allowSubAgents": true
4507
+ },
4508
+ "type": "object",
4509
+ "properties": {
4510
+ "allowSubAgents": {
4511
+ "type": "boolean"
4512
+ }
4513
+ },
4514
+ "additionalProperties": false
4439
4515
  }
4440
4516
  },
4441
4517
  "required": [
@@ -4446,7 +4522,8 @@
4446
4522
  "strategies",
4447
4523
  "commands",
4448
4524
  "manualMode",
4449
- "protectedFilePatterns"
4525
+ "protectedFilePatterns",
4526
+ "experimental"
4450
4527
  ],
4451
4528
  "additionalProperties": false
4452
4529
  }
@@ -4454,6 +4531,7 @@
4454
4531
  "required": [
4455
4532
  "enabled",
4456
4533
  "profiles",
4534
+ "handoffCompression",
4457
4535
  "base"
4458
4536
  ],
4459
4537
  "additionalProperties": false
@@ -4678,6 +4756,91 @@
4678
4756
  }
4679
4757
  },
4680
4758
  "additionalProperties": false
4759
+ },
4760
+ "admissionTimeoutMs": {
4761
+ "anyOf": [
4762
+ {
4763
+ "type": "number",
4764
+ "const": 0
4765
+ },
4766
+ {
4767
+ "type": "number",
4768
+ "minimum": 60000
4769
+ }
4770
+ ]
4771
+ },
4772
+ "nestedAdmission": {
4773
+ "type": "object",
4774
+ "properties": {
4775
+ "enabled": {
4776
+ "type": "boolean"
4777
+ },
4778
+ "mode": {
4779
+ "type": "string",
4780
+ "enum": [
4781
+ "bypass",
4782
+ "reserve"
4783
+ ]
4784
+ },
4785
+ "maxDepth": {
4786
+ "type": "integer",
4787
+ "minimum": 1,
4788
+ "maximum": 5
4789
+ }
4790
+ },
4791
+ "additionalProperties": false
4792
+ },
4793
+ "wakeScheduler": {
4794
+ "type": "object",
4795
+ "properties": {
4796
+ "enabled": {
4797
+ "type": "boolean"
4798
+ },
4799
+ "intervalMs": {
4800
+ "type": "number",
4801
+ "minimum": 60000
4802
+ }
4803
+ },
4804
+ "additionalProperties": false
4805
+ },
4806
+ "jobBoard": {
4807
+ "type": "object",
4808
+ "properties": {
4809
+ "enabled": {
4810
+ "type": "boolean"
4811
+ },
4812
+ "strategy": {
4813
+ "type": "string",
4814
+ "enum": [
4815
+ "latest",
4816
+ "checkpoint-compatible"
4817
+ ]
4818
+ },
4819
+ "maxRetainedSnapshots": {
4820
+ "type": "integer",
4821
+ "minimum": 1,
4822
+ "maximum": 100
4823
+ }
4824
+ },
4825
+ "additionalProperties": false
4826
+ },
4827
+ "wallClockTimeoutMs": {
4828
+ "anyOf": [
4829
+ {
4830
+ "type": "number",
4831
+ "const": 0
4832
+ },
4833
+ {
4834
+ "type": "integer",
4835
+ "minimum": 60000,
4836
+ "maximum": 2147483647
4837
+ }
4838
+ ]
4839
+ },
4840
+ "wallClockAbortGraceMs": {
4841
+ "type": "integer",
4842
+ "minimum": 1000,
4843
+ "maximum": 60000
4681
4844
  }
4682
4845
  },
4683
4846
  "additionalProperties": false
@@ -5206,7 +5369,6 @@
5206
5369
  },
5207
5370
  "blocked_tools": {
5208
5371
  "default": [
5209
- "read",
5210
5372
  "grep",
5211
5373
  "glob"
5212
5374
  ],
@@ -1,8 +1,9 @@
1
1
  import type { MatrixxConfig } from "../config";
2
+ import { type ContextModeConfigInput } from "../shared/context-mode-enforcement";
2
3
  import type { PluginComponents } from "./plugin-components-loader";
3
4
  export declare function setAvailableToolNames(names: string[]): void;
4
5
  export declare function getAvailableToolNames(): string[];
5
- export declare function injectContextDiscipline(availableToolNames: string[], agents: Record<string, Record<string, unknown>>): void;
6
+ export declare function injectContextDiscipline(availableToolNames: string[], agents: Record<string, Record<string, unknown>>, contextMode?: ContextModeConfigInput): void;
6
7
  export declare function applyAgentConfig(params: {
7
8
  config: Record<string, unknown>;
8
9
  pluginConfig: MatrixxConfig;
@@ -0,0 +1,35 @@
1
+ /** Canonical default — hook, constants, and schema must all agree on this. */
2
+ export declare const CONTEXT_MODE_DEFAULT_BLOCKED_TOOLS: readonly ["grep", "glob"];
3
+ export interface ContextModeEnforcement {
4
+ enabled: boolean;
5
+ enforce: boolean;
6
+ blockedTools: string[];
7
+ }
8
+ export interface ContextModeConfigInput {
9
+ enabled?: boolean;
10
+ enforce?: boolean;
11
+ blocked_tools?: string[];
12
+ }
13
+ /**
14
+ * Single source of truth for context-mode enforcement state.
15
+ * Both the context-mode-enforcer hook (block decision) and the agent prompt
16
+ * builders (guidance text) derive from this — prompt and hook can never
17
+ * disagree because they read the same resolved flags.
18
+ */
19
+ export declare function resolveContextModeEnforcement(contextMode: ContextModeConfigInput | undefined): ContextModeEnforcement;
20
+ /** Exact tool-name match for the raw search tools (mirrors the hook's check). */
21
+ export declare function hasGrepGlobToolNames(toolNames: readonly string[]): boolean;
22
+ /**
23
+ * Whether agent prompts may advertise a grep/glob fallback.
24
+ * Usable = registered AND not blocked. Under enforce:true the hook throws on
25
+ * grep/glob, so the prompt must never offer them — it must name the working
26
+ * substitute (ctx_batch_execute / ctx_execute running `rg`) instead.
27
+ */
28
+ export declare function resolveGrepGlobUsable(toolNames: readonly string[], contextMode?: ContextModeConfigInput): boolean;
29
+ export declare function _setDisciplinePathForTesting(p: string | null | undefined): void;
30
+ export declare function setContextModeForPrompts(contextMode: ContextModeConfigInput | undefined): void;
31
+ export declare function getContextModeForPrompts(): ContextModeConfigInput | undefined;
32
+ export declare function _resetContextModeEnforcementForTesting(): void;
33
+ export declare function willBlockGrepGlob(contextMode: ContextModeConfigInput | undefined): boolean;
34
+ export declare function resolveContextModeDisciplinePath(): string | null;
35
+ export declare function hasWorkingSubstitute(): boolean;
@@ -4,7 +4,7 @@ export * from "./binary-downloader";
4
4
  export * from "./command-executor";
5
5
  export * from "./config-errors";
6
6
  export * from "./connected-providers-cache";
7
- export * from "./context-mode-prompt";
7
+ export * from "./context-mode-enforcement";
8
8
  export * from "./data-path";
9
9
  export * from "./deep-merge";
10
10
  export * from "./delay";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Revive-outcome helpers shared by the background task revive tools.
3
+ *
4
+ * A revive either produces a fresh session for a terminal task or is refused
5
+ * with a machine-readable reason. These helpers turn either case into a
6
+ * human-readable, non-throwing outcome for the revive tools.
7
+ *
8
+ * The status and reason are typed as `string` on purpose: this module lives
9
+ * in `src/shared` and must not depend on `BackgroundTaskStatus`
10
+ * or `ReviveBlockReason` from the background-agent feature.
11
+ */
12
+ export declare const UNREVIVABLE_REASONS: readonly ["active", "uncertain", "no-session", "unknown-task", "expired"];
13
+ export declare function isUnrevivableReason(reason: string): boolean;
14
+ export declare function formatReviveOutcome(taskId: string, sessionID: string, status: string): string;
15
+ export declare function formatUnrevivable(taskId: string, reason: string, detail?: string): string;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Launch-outcome helpers shared by the background task launch tools.
3
+ *
4
+ * A launch can terminate without ever producing a session. T7 made a saturated
5
+ * queue admission produce a terminal `stopped` task with
6
+ * `terminalReason: "queue-saturated"` (nested depth-exceeded produces
7
+ * `terminalReason: "nested-depth-exceeded"`). These helpers turn that terminal
8
+ * state into a machine-readable, non-throwing outcome for the launch tools.
9
+ *
10
+ * The status is typed as `string` on purpose: this module must not import from
11
+ * `src/features/**`, so it cannot depend on `BackgroundTaskStatus`.
12
+ */
13
+ export declare const LAUNCH_TERMINAL_STATUSES: readonly ["error", "cancelled", "interrupt", "stopped", "statusUncertain"];
14
+ export type LaunchTerminalStatus = (typeof LAUNCH_TERMINAL_STATUSES)[number];
15
+ export declare function isLaunchTerminalStatus(status: string): status is LaunchTerminalStatus;
16
+ export declare function isQueueSaturated(status: string, terminalReason: string | undefined): boolean;
17
+ export declare function formatSaturatedOutcome(taskId: string): string;
18
+ export declare function formatLaunchFailure(taskId: string, status: string): string;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Wall-clock outcome helpers shared by the background agent wall-clock supervisor.
3
+ *
4
+ * A wall-clock timeout terminates a running task that exceeds its elapsed-time bound
5
+ * measured from `startedAt`. This module formats the human-readable + machine-readable
6
+ * outcome payload (mirroring saturated-outcome.ts / revive-outcome.ts).
7
+ *
8
+ * The status and reason are typed as `string` on purpose: this module lives in
9
+ * `src/shared` and must not depend on `BackgroundTaskStatus` or any type from
10
+ * `src/features/**`.
11
+ */
12
+ export declare function formatWallclockTimeout(taskId: string, elapsedMs: number, limitMs: number): string;
13
+ /**
14
+ * Checks whether the given status and terminal reason pair indicates a
15
+ * wall-clock timeout. Uses raw strings so this module never imports
16
+ * from src/features/**.
17
+ */
18
+ export declare function isWallclockTimeout(status: string, terminalReason: string | undefined): boolean;
@@ -1,2 +1,3 @@
1
1
  export declare const BACKGROUND_OUTPUT_DESCRIPTION = "Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed.";
2
2
  export declare const BACKGROUND_CANCEL_DESCRIPTION = "Cancel running background task(s). Use all=true to cancel ALL before final answer.";
3
+ export declare const BACKGROUND_REVIVE_DESCRIPTION = "Revive a retained terminal background task with a NEW instruction.\n\nCall with no arguments (or list=true) to DISCOVER revivable tasks.\n\nRevivable: cancelled, stopped, interrupt, error, completed \u2014 provided the task still has a session ID.\nNot revivable: pending/running (still active \u2014 use background_output), statusUncertain (unknown liveness \u2014 pass force=true to acknowledge), and tasks that never produced a session (e.g. queue-saturated).\n\nHandles are retained for 30 minutes, so revive works after a task was pruned or the plugin restarted.";
@@ -0,0 +1,3 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import type { BackgroundReviveManager } from "./types";
3
+ export declare function createBackgroundRevive(manager: BackgroundReviveManager, directory: string): ToolDefinition;
@@ -1,3 +1,3 @@
1
1
  export * from "./constants";
2
- export { createBackgroundCancel, createBackgroundOutput, } from "./tools";
2
+ export { createBackgroundCancel, createBackgroundOutput, createBackgroundRevive, } from "./tools";
3
3
  export type * from "./types";
@@ -1,3 +1,4 @@
1
1
  export type { BackgroundCancelClient, BackgroundOutputClient, BackgroundOutputManager, BackgroundOutputMessage, BackgroundOutputMessagesResult, } from "./clients";
2
2
  export { createBackgroundCancel } from "./create-background-cancel";
3
3
  export { createBackgroundOutput } from "./create-background-output";
4
+ export { createBackgroundRevive } from "./create-background-revive";
@@ -13,6 +13,14 @@ export interface BackgroundCancelArgs {
13
13
  taskId?: string;
14
14
  all?: boolean;
15
15
  }
16
+ export interface BackgroundReviveArgs {
17
+ taskId?: string;
18
+ session_id?: string;
19
+ prompt?: string;
20
+ list?: boolean;
21
+ force?: boolean;
22
+ parentSessionID?: string;
23
+ }
16
24
  export type BackgroundOutputMessage = {
17
25
  info?: {
18
26
  role?: string;
@@ -54,6 +62,7 @@ export type BackgroundCancelClient = {
54
62
  };
55
63
  };
56
64
  export type BackgroundOutputManager = Pick<import("../../features/background-agent").BackgroundManager, "getTask">;
65
+ export type BackgroundReviveManager = Pick<import("../../features/background-agent").BackgroundManager, "revive" | "listRevivable">;
57
66
  export type ToolContextWithMetadata = {
58
67
  sessionID: string;
59
68
  messageID: string;
@@ -5,4 +5,5 @@ export interface DcpSwitchProfileOptions {
5
5
  dcp?: DcpConfig;
6
6
  };
7
7
  }
8
+ export declare function deepMergeProfile(builtin: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown>;
8
9
  export declare function createDcpSwitchProfileTool(options?: DcpSwitchProfileOptions): Record<string, ToolDefinition>;
@@ -30,5 +30,5 @@ export { createDelegateTask } from "./delegate-task";
30
30
  export { createHashlineEditTool } from "./hashline-edit";
31
31
  export { createLookAt } from "./look-at";
32
32
  export { createTaskCleanupTool, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, } from "./task";
33
- export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
33
+ export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient, directory: string): Record<string, ToolDefinition>;
34
34
  export declare const builtinTools: Record<string, ToolDefinition>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-matrixx",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
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,12 +0,0 @@
1
- export interface ContextModeToolGuidance {
2
- searchGuidance: string;
3
- readGuidance: string;
4
- analysisGuidance: string;
5
- }
6
- /**
7
- * Returns context-mode-aware tool guidance for subagent prompts.
8
- * When `enforce` is true, raw grep/glob/read/bash-cat are blocked by the
9
- * context-mode-enforcer hook, so guidance routes to ctx_* tools instead.
10
- * When `enforce` is false, legacy tool guidance is preserved.
11
- */
12
- export declare function getContextModeToolGuidance(enforce: boolean): ContextModeToolGuidance;
@@ -1 +0,0 @@
1
- export {};