opencode-matrixx 2.6.5 → 2.6.6

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 (33) hide show
  1. package/dist/agents/oracle/behavioral-summary.d.ts +1 -1
  2. package/dist/agents/oracle/high-accuracy-mode.d.ts +1 -1
  3. package/dist/agents/oracle/interview-mode.d.ts +1 -1
  4. package/dist/agents/oracle/plan-generation.d.ts +1 -1
  5. package/dist/agents/oracle/plan-template.d.ts +1 -1
  6. package/dist/agents/oracle/system-prompt.d.ts +1 -1
  7. package/dist/cli.js +14 -6
  8. package/dist/config/schema/hooks.d.ts +1 -0
  9. package/dist/config/schema/matrixx-config.d.ts +1 -0
  10. package/dist/create-hooks.d.ts +1 -0
  11. package/dist/features/background-agent/handle-index.d.ts +63 -0
  12. package/dist/features/background-agent/handle-index.test.d.ts +1 -0
  13. package/dist/features/background-agent/index.d.ts +1 -0
  14. package/dist/features/background-agent/manager-handles.test.d.ts +1 -0
  15. package/dist/features/background-agent/manager.d.ts +12 -0
  16. package/dist/hooks/background-task-blocker/hook.d.ts +10 -0
  17. package/dist/hooks/background-task-blocker/index.d.ts +1 -0
  18. package/dist/hooks/index.d.ts +1 -0
  19. package/dist/index.js +278 -54
  20. package/dist/matrixx.schema.json +1 -0
  21. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  22. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  23. package/dist/shared/context-mode-prompt.d.ts +12 -0
  24. package/dist/shared/context-mode-prompt.test.d.ts +1 -0
  25. package/dist/shared/index.d.ts +1 -0
  26. package/dist/tools/background-task/constants.d.ts +0 -1
  27. package/dist/tools/background-task/index.d.ts +1 -1
  28. package/dist/tools/background-task/tools.d.ts +0 -1
  29. package/dist/tools/background-task/types.d.ts +0 -5
  30. package/dist/tools/delegate-task/sync-task.test.d.ts +1 -0
  31. package/dist/tools/delegate-task/timing.test.d.ts +1 -0
  32. package/package.json +1 -1
  33. package/dist/tools/background-task/create-background-task.d.ts +0 -3
package/dist/cli.js CHANGED
@@ -16159,6 +16159,7 @@ var HookNameEnum = exports_external.enum([
16159
16159
  "preemptive-compaction",
16160
16160
  "rules-injector",
16161
16161
  "background-notification",
16162
+ "background-task-blocker",
16162
16163
  "auto-update-checker",
16163
16164
  "startup-toast",
16164
16165
  "keyword-detector",
@@ -16233,11 +16234,14 @@ var ModelFallbackEntrySchema = exports_external.object({
16233
16234
  variant: exports_external.string().optional()
16234
16235
  });
16235
16236
  var complexityDowngradeValueSchema = exports_external.string().refine((s) => {
16236
- if (s.includes("/")) {
16237
- const parts = s.split("/");
16238
- return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0;
16239
- }
16240
- return false;
16237
+ if (!s.includes("/"))
16238
+ return false;
16239
+ if (s.startsWith("/") || s.endsWith("/"))
16240
+ return false;
16241
+ if (s.includes("//"))
16242
+ return false;
16243
+ const parts = s.split("/");
16244
+ return parts.length >= 2 && parts.every((p) => p.length > 0);
16241
16245
  }, { message: "Must be <provider>/<model>" });
16242
16246
  var ComplexityDowngradesSchema = exports_external.record(exports_external.string(), exports_external.record(exports_external.string(), complexityDowngradeValueSchema));
16243
16247
  var AgentModelRequirementsSchema = exports_external.object({
@@ -16263,8 +16267,12 @@ var ModelRequirementsSchema = exports_external.object({
16263
16267
  var providerModelSchema = exports_external.string().refine((s) => {
16264
16268
  if (!s.includes("/"))
16265
16269
  return false;
16270
+ if (s.startsWith("/") || s.endsWith("/"))
16271
+ return false;
16272
+ if (s.includes("//"))
16273
+ return false;
16266
16274
  const parts = s.split("/");
16267
- return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0;
16275
+ return parts.length >= 2 && parts.every((p) => p.length > 0);
16268
16276
  }, { message: "Must be <provider>/<model>" });
16269
16277
  var ModelPresetEntrySchema = exports_external.object({
16270
16278
  model: providerModelSchema,
@@ -20,6 +20,7 @@ export declare const HookNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
20
20
  "preemptive-compaction": "preemptive-compaction";
21
21
  "rules-injector": "rules-injector";
22
22
  "background-notification": "background-notification";
23
+ "background-task-blocker": "background-task-blocker";
23
24
  "auto-update-checker": "auto-update-checker";
24
25
  "startup-toast": "startup-toast";
25
26
  "keyword-detector": "keyword-detector";
@@ -93,6 +93,7 @@ export declare const MatrixxConfigSchema: z.ZodObject<{
93
93
  "preemptive-compaction": "preemptive-compaction";
94
94
  "rules-injector": "rules-injector";
95
95
  "background-notification": "background-notification";
96
+ "background-task-blocker": "background-task-blocker";
96
97
  "auto-update-checker": "auto-update-checker";
97
98
  "startup-toast": "startup-toast";
98
99
  "keyword-detector": "keyword-detector";
@@ -33,6 +33,7 @@ export declare function createHooks(args: {
33
33
  thinkingBlockValidator: ReturnType<typeof import("./hooks").createThinkingBlockValidatorHook> | null;
34
34
  toolPairValidator: ReturnType<typeof import("./hooks").createToolPairValidatorHook> | null;
35
35
  designIntentPreserver: ReturnType<typeof import("./hooks").createDesignIntentPreserverHook> | null;
36
+ backgroundTaskBlocker: ReturnType<typeof import("./hooks").createBackgroundTaskBlockerHook> | null;
36
37
  commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
37
38
  toolOutputTruncator: ReturnType<typeof import("./hooks").createToolOutputTruncatorHook> | null;
38
39
  directoryAgentsInjector: ReturnType<typeof import("./hooks").createDirectoryAgentsInjectorHook> | null;
@@ -0,0 +1,63 @@
1
+ import { z } from "zod";
2
+ import type { BackgroundTask } from "./types";
3
+ /**
4
+ * File-backed handle index for background tasks.
5
+ *
6
+ * Mirrors the `task-storage` pattern: one file per handle under a
7
+ * project-scoped `.matrixx/bg-handles/` directory, written atomically via
8
+ * `tmp + renameSync`. Only a lightweight index is persisted — prompts,
9
+ * progress, results, errors and tool-call windows stay ephemeral.
10
+ *
11
+ * This lets a freshly-created `BackgroundManager` recover previously-created
12
+ * `bg_*` handles after a plugin/process restart.
13
+ */
14
+ export declare const BG_HANDLE_DIR_NAME = "bg-handles";
15
+ export declare const BG_HANDLE_FILE_PREFIX = "bg_";
16
+ export declare const BgHandleSchema: z.ZodObject<{
17
+ taskId: z.ZodString;
18
+ parentSessionID: z.ZodString;
19
+ parentMessageID: z.ZodString;
20
+ description: z.ZodString;
21
+ agent: z.ZodString;
22
+ status: z.ZodEnum<{
23
+ error: "error";
24
+ cancelled: "cancelled";
25
+ interrupt: "interrupt";
26
+ pending: "pending";
27
+ running: "running";
28
+ completed: "completed";
29
+ }>;
30
+ model: z.ZodOptional<z.ZodObject<{
31
+ providerID: z.ZodString;
32
+ modelID: z.ZodString;
33
+ variant: z.ZodOptional<z.ZodString>;
34
+ temperature: z.ZodOptional<z.ZodNumber>;
35
+ }, z.core.$strip>>;
36
+ category: z.ZodOptional<z.ZodString>;
37
+ concurrencyGroup: z.ZodOptional<z.ZodString>;
38
+ queuedAt: z.ZodOptional<z.ZodNumber>;
39
+ startedAt: z.ZodOptional<z.ZodNumber>;
40
+ completedAt: z.ZodOptional<z.ZodNumber>;
41
+ }, z.core.$strict>;
42
+ export type BgHandle = z.infer<typeof BgHandleSchema>;
43
+ /** Project-scoped handle directory: `<project>/.matrixx/bg-handles`. */
44
+ export declare function getBgHandleDir(directory: string): string;
45
+ /** One file per handle id: `<project>/.matrixx/bg-handles/<taskId>.json`. */
46
+ export declare function getHandlePath(directory: string, taskId: string): string;
47
+ /** Project a full task onto the lightweight, persistable handle index. */
48
+ export declare function toHandle(task: BackgroundTask): BgHandle;
49
+ /**
50
+ * Atomically persist a handle: write to a temp file then rename into place.
51
+ * Throws on write failure; callers decide how to surface it.
52
+ */
53
+ export declare function writeHandle(directory: string, task: BackgroundTask): void;
54
+ /** Read and validate every persisted handle. Invalid/corrupt files are skipped. */
55
+ export declare function readHandles(directory: string): BgHandle[];
56
+ /** Remove the handle file for a task id. Returns true when a file was deleted. */
57
+ export declare function deleteHandleFile(directory: string, taskId: string): boolean;
58
+ /**
59
+ * Bounded TTL sweep: delete handle files whose most recent timestamp is older
60
+ * than `ttlMs` (default 30 min). Corrupt/unreadable files are swept too so the
61
+ * directory cannot grow without bound. Returns the number of files removed.
62
+ */
63
+ export declare function sweepStaleHandles(directory: string, ttlMs?: number, now?: number): number;
@@ -1,4 +1,5 @@
1
1
  export { ConcurrencyManager } from "./concurrency";
2
+ export { BG_HANDLE_FILE_PREFIX, type BgHandle, BgHandleSchema, deleteHandleFile, getBgHandleDir, getHandlePath, readHandles, sweepStaleHandles, toHandle, writeHandle, } from "./handle-index";
2
3
  export { BackgroundManager, type OnSubagentSessionCreated, type SubagentSessionCreatedEvent } from "./manager";
3
4
  export { TaskStateManager } from "./state";
4
5
  export { TaskHistory, type TaskHistoryEntry } from "./task-history";
@@ -51,6 +51,18 @@ export declare class BackgroundManager {
51
51
  onShutdown?: () => void;
52
52
  enableParentSessionNotifications?: boolean;
53
53
  });
54
+ /**
55
+ * Persist a lightweight handle for the given task. Called on running and
56
+ * terminal transitions only — never on intermediate progress updates (C8).
57
+ * Best-effort: write failures are logged and never break task lifecycle.
58
+ */
59
+ private persistHandle;
60
+ /**
61
+ * Recover handles persisted by a previous manager/process. Sweeps stale
62
+ * handles first, then loads the remainder into memory. Running handles are
63
+ * marked `"interrupt"` (C6) and no concurrency is re-acquired (C7).
64
+ */
65
+ restoreHandles(): Promise<void>;
54
66
  launch(input: LaunchInput): Promise<BackgroundTask>;
55
67
  private processKey;
56
68
  private startTask;
@@ -0,0 +1,10 @@
1
+ export declare function createBackgroundTaskBlockerHook(): {
2
+ "tool.execute.before": (input: {
3
+ tool: string;
4
+ sessionID: string;
5
+ callID: string;
6
+ }, _output: {
7
+ args: Record<string, unknown>;
8
+ message?: string;
9
+ }) => Promise<void>;
10
+ };
@@ -0,0 +1 @@
1
+ export { createBackgroundTaskBlockerHook } from "./hook";
@@ -3,6 +3,7 @@ export { createArchitectHook } from "./architect";
3
3
  export { createAutoSlashCommandHook } from "./auto-slash-command";
4
4
  export { createAutoUpdateCheckerHook } from "./auto-update-checker";
5
5
  export { createBackgroundNotificationHook } from "./background-notification";
6
+ export { createBackgroundTaskBlockerHook } from "./background-task-blocker";
6
7
  export { createBashFileReadGuardHook } from "./bash-file-read-guard";
7
8
  export { createCategorySkillReminderHook } from "./category-skill-reminder";
8
9
  export { createCommentCheckerHooks } from "./comment-checker";