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
@@ -0,0 +1,47 @@
1
+ export interface WakeSchedulerConfig {
2
+ enabled?: boolean;
3
+ intervalMs?: number;
4
+ }
5
+ export interface WakeParentState {
6
+ hasPendingChildren: boolean;
7
+ hasUndeliveredNotifications: boolean;
8
+ hasUnfinishedTodos?: boolean;
9
+ }
10
+ export declare const WAKE_REMINDER_TEXT = "<system-reminder>\n[BACKGROUND WAKE]\n\nOne or more background tasks for this session are still running or have undelivered results.\nUse background_output with the task ID to retrieve results when ready.\nDo NOT poll - continue productive work.\n</system-reminder>";
11
+ export declare function isWakeSchedulerEnabled(cfg?: WakeSchedulerConfig): boolean;
12
+ export declare function resolveWakeIntervalMs(cfg?: WakeSchedulerConfig): number;
13
+ export declare function shouldWakeForParent(state: WakeParentState): boolean;
14
+ export declare function nextWakeDelay(lastWakeAtMs: number, intervalMs: number, nowMs?: number): number;
15
+ export declare class WakeTracker {
16
+ private stagnantByParent;
17
+ recordWake(parentSessionID: string, progressed: boolean): boolean;
18
+ resetOnActivity(parentSessionID: string): void;
19
+ stagnantCount(parentSessionID: string): number;
20
+ }
21
+ export type WakeTimerHandle = ReturnType<typeof setTimeout>;
22
+ export type WakeScheduleTimer = (callback: () => void, delayMs: number) => WakeTimerHandle;
23
+ export type WakeClearTimer = (handle: WakeTimerHandle) => void;
24
+ export interface WakeRegistration {
25
+ intervalMs: number;
26
+ readState: () => WakeParentState;
27
+ deliverWake: () => void | Promise<void>;
28
+ }
29
+ export declare class WakeScheduler {
30
+ private timers;
31
+ private registrations;
32
+ private snapshots;
33
+ private readonly tracker;
34
+ private readonly scheduleTimer;
35
+ private readonly clearTimer;
36
+ constructor(deps?: {
37
+ scheduleTimer?: WakeScheduleTimer;
38
+ clearTimer?: WakeClearTimer;
39
+ });
40
+ private armTimer;
41
+ schedule(parentSessionID: string, registration: WakeRegistration): void;
42
+ clear(parentSessionID: string): void;
43
+ dispose(): void;
44
+ hasScheduledWake(parentSessionID: string): boolean;
45
+ private clearTimerFor;
46
+ private tick;
47
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Wall-clock supervisor: fire-once elapsed-time bound for running background tasks.
3
+ *
4
+ * Staleness is activity-based; this module is elapsed-time-based. Each armed entry
5
+ * fires its callback exactly once when `startedAtMs + timeoutMs` passes, no matter
6
+ * how busy or productive the task looks. A timeout of `0` or `undefined` means OFF
7
+ * and arms nothing.
8
+ *
9
+ * Grace contract (manager-owned, pinned here): on fire the manager aborts the
10
+ * session once, waits `wallClockAbortGraceMs`, then marks the task terminal —
11
+ * unless the task completed naturally during grace, in which case the natural
12
+ * outcome wins and the pending mark is cancelled.
13
+ *
14
+ * This module must not import from manager/client/fs — pure timers only. It mirrors
15
+ * the settled-flag lifecycle of `acquireWithDeadline` in `concurrency.ts`.
16
+ */
17
+ /** Maximum delay accepted by `setTimeout` (2^31-1 ms); enforced by schema max too. */
18
+ export declare const MAX_WALLCLOCK_TIMEOUT_MS = 2147483647;
19
+ /** Context delivered to the fire callback exactly once per armed deadline. */
20
+ export interface WallclockFireContext {
21
+ taskId: string;
22
+ elapsedMs: number;
23
+ limitMs: number;
24
+ }
25
+ export type WallclockFireCallback = (ctx: WallclockFireContext) => void;
26
+ /** Pure remaining-time math: deadline minus now (negative when already expired). */
27
+ export declare function remainingMs(startedAtMs: number, timeoutMs: number, nowMs?: number): number;
28
+ /** OFF (`0`/`undefined`) never arms; any other value is an active elapsed-time bound. */
29
+ export declare function isWallclockEnabled(timeoutMs: number | undefined): timeoutMs is number;
30
+ export declare class WallclockSupervisor {
31
+ private entries;
32
+ arm(taskId: string, startedAtMs: number, timeoutMs: number | undefined, onFire: WallclockFireCallback): void;
33
+ disarm(taskId: string): boolean;
34
+ disarmAll(): void;
35
+ size(): number;
36
+ getDeadlineAt(taskId: string): number | undefined;
37
+ }
@@ -86,8 +86,8 @@ export declare const HttpMethodSchema: z.ZodEnum<{
86
86
  }>;
87
87
  export declare const ResponseFormatSchema: z.ZodEnum<{
88
88
  binary: "binary";
89
- json: "json";
90
89
  text: "text";
90
+ json: "json";
91
91
  html: "html";
92
92
  xml: "xml";
93
93
  }>;
@@ -118,8 +118,8 @@ export declare const ApiResponseSchema: z.ZodObject<{
118
118
  status: z.ZodNumber;
119
119
  format: z.ZodEnum<{
120
120
  binary: "binary";
121
- json: "json";
122
121
  text: "text";
122
+ json: "json";
123
123
  html: "html";
124
124
  xml: "xml";
125
125
  }>;
@@ -174,8 +174,8 @@ export declare const ApiAnnotationsSchema: z.ZodObject<{
174
174
  status: z.ZodNumber;
175
175
  format: z.ZodEnum<{
176
176
  binary: "binary";
177
- json: "json";
178
177
  text: "text";
178
+ json: "json";
179
179
  html: "html";
180
180
  xml: "xml";
181
181
  }>;
@@ -236,8 +236,8 @@ export declare const ContractAnnotationsSchema: z.ZodObject<{
236
236
  status: z.ZodNumber;
237
237
  format: z.ZodEnum<{
238
238
  binary: "binary";
239
- json: "json";
240
239
  text: "text";
240
+ json: "json";
241
241
  html: "html";
242
242
  xml: "xml";
243
243
  }>;
@@ -366,8 +366,8 @@ export declare const ContractSchema: z.ZodObject<{
366
366
  status: z.ZodNumber;
367
367
  format: z.ZodEnum<{
368
368
  binary: "binary";
369
- json: "json";
370
369
  text: "text";
370
+ json: "json";
371
371
  html: "html";
372
372
  xml: "xml";
373
373
  }>;
@@ -1,6 +1,6 @@
1
1
  export declare const HOOK_NAME = "context-mode-enforcer";
2
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
- 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.";
3
+ export declare const BLOCK_MESSAGE_GREP_GLOB: string;
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"];
6
6
  export declare const WARN_ONLY_TOOLS: readonly ["read"];