opencode-matrixx 2.6.4 → 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 (78) 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/setup/index.d.ts +1 -0
  8. package/dist/cli/setup/preset-wizard.d.ts +36 -0
  9. package/dist/cli/setup/types.d.ts +5 -0
  10. package/dist/cli.js +499 -64
  11. package/dist/config/index.d.ts +0 -1
  12. package/dist/config/migrations/model-migration.d.ts +1 -2
  13. package/dist/config/preset-applier.d.ts +17 -0
  14. package/dist/config/schema/agent-overrides.d.ts +0 -133
  15. package/dist/config/schema/categories.d.ts +0 -14
  16. package/dist/config/schema/commands.d.ts +1 -1
  17. package/dist/config/schema/hooks.d.ts +1 -0
  18. package/dist/config/schema/matrixx-config.d.ts +29 -144
  19. package/dist/config/schema/model-config.d.ts +0 -22
  20. package/dist/config/schema/model-presets.d.ts +40 -0
  21. package/dist/config/schema/task.d.ts +6 -0
  22. package/dist/config/schema/tasks.d.ts +25 -0
  23. package/dist/config/schema.d.ts +3 -0
  24. package/dist/create-hooks.d.ts +1 -0
  25. package/dist/features/background-agent/handle-index.d.ts +63 -0
  26. package/dist/features/background-agent/handle-index.test.d.ts +1 -0
  27. package/dist/features/background-agent/index.d.ts +1 -0
  28. package/dist/features/background-agent/manager-handles.test.d.ts +1 -0
  29. package/dist/features/background-agent/manager.d.ts +12 -0
  30. package/dist/features/builtin-commands/templates/preset.d.ts +1 -0
  31. package/dist/features/builtin-commands/types.d.ts +1 -1
  32. package/dist/features/preset-state/index.d.ts +1 -0
  33. package/dist/features/preset-state/manager.d.ts +5 -0
  34. package/dist/features/session-state/state.d.ts +6 -0
  35. package/dist/features/task-storage/types.d.ts +2 -0
  36. package/dist/hooks/background-task-blocker/hook.d.ts +10 -0
  37. package/dist/hooks/background-task-blocker/index.d.ts +1 -0
  38. package/dist/hooks/index.d.ts +1 -0
  39. package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
  40. package/dist/hooks/task-continuation-enforcer/continuation-injection.test.d.ts +1 -0
  41. package/dist/hooks/task-continuation-enforcer/staleness.d.ts +7 -1
  42. package/dist/hooks/task-continuation-enforcer/todo.d.ts +8 -0
  43. package/dist/hooks/task-continuation-enforcer/todo.test.d.ts +1 -0
  44. package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +1 -1
  45. package/dist/index.js +923 -624
  46. package/dist/matrixx.schema.json +114 -244
  47. package/dist/mcp/types.d.ts +1 -1
  48. package/dist/mcp/{grep-app.d.ts → white-rabbit.d.ts} +1 -1
  49. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  50. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  51. package/dist/shared/config-errors.d.ts +3 -0
  52. package/dist/shared/context-mode-prompt.d.ts +12 -0
  53. package/dist/shared/context-mode-prompt.test.d.ts +1 -0
  54. package/dist/shared/index.d.ts +1 -0
  55. package/dist/shared/merge-categories.d.ts +1 -16
  56. package/dist/shared/task-system-gating.d.ts +10 -0
  57. package/dist/tools/background-task/constants.d.ts +0 -1
  58. package/dist/tools/background-task/index.d.ts +1 -1
  59. package/dist/tools/background-task/tools.d.ts +0 -1
  60. package/dist/tools/background-task/types.d.ts +0 -5
  61. package/dist/tools/delegate-task/categories.d.ts +3 -18
  62. package/dist/tools/delegate-task/complexity-constants.d.ts +2 -7
  63. package/dist/tools/delegate-task/executor-types.d.ts +7 -2
  64. package/dist/tools/delegate-task/sync-task.test.d.ts +1 -0
  65. package/dist/tools/delegate-task/timing.d.ts +5 -0
  66. package/dist/tools/delegate-task/timing.test.d.ts +1 -0
  67. package/dist/tools/delegate-task/types.d.ts +5 -2
  68. package/dist/tools/index.d.ts +1 -0
  69. package/dist/tools/preset/index.d.ts +1 -0
  70. package/dist/tools/preset/tools.d.ts +7 -0
  71. package/dist/tools/task/constants.d.ts +1 -0
  72. package/package.json +1 -1
  73. package/dist/config/presets.d.ts +0 -4
  74. package/dist/config/resolve-tiers.d.ts +0 -32
  75. package/dist/features/builtin-commands/templates/profile.d.ts +0 -1
  76. package/dist/shared/model-tiers.d.ts +0 -44
  77. package/dist/shared/tier-resolver.d.ts +0 -26
  78. package/dist/tools/background-task/create-background-task.d.ts +0 -3
@@ -5,28 +5,6 @@ export declare const ModelFallbackEntrySchema: z.ZodObject<{
5
5
  variant: z.ZodOptional<z.ZodString>;
6
6
  }, z.core.$strip>;
7
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
8
  export declare const ComplexityDowngradesSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
31
9
  export type ComplexityDowngrades = z.infer<typeof ComplexityDowngradesSchema>;
32
10
  export declare const AgentModelRequirementsSchema: z.ZodObject<{
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ /** A single model assignment inside a preset (agent or category). */
3
+ export declare const ModelPresetEntrySchema: z.ZodObject<{
4
+ model: z.ZodString;
5
+ variant: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export type ModelPresetEntry = z.infer<typeof ModelPresetEntrySchema>;
8
+ /**
9
+ * A named static model preset — explicit provider/model bundles per
10
+ * agent/category. Applied with fill-in semantics (never overwrites an
11
+ * explicit `model` on the target config entry).
12
+ */
13
+ export declare const ModelPresetSchema: z.ZodObject<{
14
+ default_model: z.ZodOptional<z.ZodString>;
15
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
16
+ model: z.ZodString;
17
+ variant: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>>;
19
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
20
+ model: z.ZodString;
21
+ variant: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>>>;
23
+ }, z.core.$strip>;
24
+ export type ModelPreset = z.infer<typeof ModelPresetSchema>;
25
+ /** Registry of named presets keyed by preset name. */
26
+ export declare const ModelPresetsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
27
+ default_model: z.ZodOptional<z.ZodString>;
28
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
29
+ model: z.ZodString;
30
+ variant: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>>;
32
+ categories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
33
+ model: z.ZodString;
34
+ variant: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>>>;
36
+ }, z.core.$strip>>;
37
+ export type ModelPresets = z.infer<typeof ModelPresetsSchema>;
38
+ /** Name of the active preset in `model_presets`. */
39
+ export declare const ActivePresetSchema: z.ZodString;
40
+ export type ActivePreset = z.infer<typeof ActivePresetSchema>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ /** Task system configuration schema */
3
+ export declare const TaskConfigSchema: z.ZodObject<{
4
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
5
+ }, z.core.$strip>;
6
+ export type TaskConfig = z.infer<typeof TaskConfigSchema>;
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Canonical task-system configuration. Single home for everything
4
+ * task-related: master switch, storage, enforcer behavior, poll timeout.
5
+ *
6
+ * Legacy locations still parse (backward compat) and act as fallback
7
+ * with LOWER precedence — explicit `tasks.*` always wins:
8
+ * - `experimental.task_system` / `new_task_system_enabled` → `tasks.enabled`
9
+ * - `morpheus.tasks.*` → `tasks.*` (same key names)
10
+ * - `task.pollTimeoutMs` → `tasks.pollTimeoutMs`
11
+ * See `resolveTasksConfig()` in `src/shared/task-system-gating.ts`.
12
+ */
13
+ export declare const TasksConfigSchema: z.ZodObject<{
14
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
15
+ scope: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
16
+ project: "project";
17
+ global: "global";
18
+ }>>>;
19
+ storage_path: z.ZodOptional<z.ZodString>;
20
+ task_list_id: z.ZodOptional<z.ZodString>;
21
+ stale_after_hours: z.ZodOptional<z.ZodNumber>;
22
+ session_scoped: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
23
+ pollTimeoutMs: z.ZodOptional<z.ZodNumber>;
24
+ }, z.core.$strip>;
25
+ export type TasksConfig = z.infer<typeof TasksConfigSchema>;
@@ -20,6 +20,7 @@ export * from "./schema/matrix-loop";
20
20
  export * from "./schema/matrixx-config";
21
21
  export * from "./schema/matrixx-self-config";
22
22
  export * from "./schema/model-config";
23
+ export * from "./schema/model-presets";
23
24
  export * from "./schema/morpheus";
24
25
  export * from "./schema/morpheus-agent";
25
26
  export * from "./schema/notification";
@@ -27,6 +28,8 @@ export * from "./schema/rtk";
27
28
  export * from "./schema/runtime-fallback";
28
29
  export * from "./schema/security";
29
30
  export * from "./schema/skills";
31
+ export * from "./schema/task";
32
+ export * from "./schema/tasks";
30
33
  export * from "./schema/tdd-enforcer";
31
34
  export * from "./schema/tmux";
32
35
  export * from "./schema/websearch";
@@ -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 @@
1
+ export declare const PRESET_TEMPLATE = "You are managing the active model preset.\n\nThis command is provided by the Matrixx plugin. It uses the built-in `preset` tool to list, show, or switch model presets \u2014 no external scripts or direct config edits needed.\n\n## Usage\n\n```\n/preset \u2192 List available presets and mark the active one\n/preset list \u2192 List available presets\n/preset show [<name>] \u2192 Show a preset's agent/category model assignments (defaults to active)\n/preset set <name> \u2192 Switch the active preset for the current session (live)\n/preset set <name> --save [--global|--project] \u2192 Also persist active_preset to config\n```\n\n## Step 1: Determine the action\n\nParse the arguments passed to this command:\n\n- No arguments or `list` \u2192 call `preset` with `action: \"list\"`.\n- `show` \u2192 call `preset` with `action: \"show\"` (optionally `name`).\n- `set <name>` \u2192 call `preset` with `action: \"set\"`, `name: \"<name>\"`.\n- `set <name> --save` \u2192 also pass `save: true`; `--global` \u2192 `scope: \"global\"`, `--project` (default) \u2192 `scope: \"project\"`.\n\n## Step 2: Call the built-in `preset` tool\n\nUse the `preset` tool with the resolved arguments. The tool validates the preset name, applies the session overlay (delegate-task categories switch immediately), and \u2014 with `--save` \u2014 persists `active_preset` to the project (`.opencode/matrixx.jsonc`) or global (`~/.config/opencode/matrixx.jsonc`) config.\n\nThe tool handles all validation and file operations \u2014 do NOT edit config files directly.\n\n## Step 3: Confirm and instruct\n\nAfter a successful switch:\n\n1. Report the tool's output to the user.\n2. Note that delegate-task categories use the new preset immediately (session-scoped live switch).\n3. If `--save` was used, tell the user the persisted `active_preset` takes effect for builtin agents on the next session.\n\n## Important constraints\n\n- Use the built-in `preset` tool. Do NOT bypass it by editing config files directly.\n- Do not invent preset names \u2014 if the requested name is unknown, report the available presets and stop.\n- `--save` without a scope defaults to project scope.";
@@ -1,3 +1,3 @@
1
1
  import type { CommandDefinition } from "../command-loader";
2
- export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile" | "evolution" | "cleanup-tasks" | "task-list";
2
+ export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "preset" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile" | "evolution" | "cleanup-tasks" | "task-list";
3
3
  export type BuiltinCommands = Record<string, CommandDefinition>;
@@ -0,0 +1 @@
1
+ export { _resetPresetStateForTesting, clearSessionPreset, getSessionPreset, setSessionPreset, } from "./manager";
@@ -0,0 +1,5 @@
1
+ export declare function setSessionPreset(sessionID: string, presetName: string): void;
2
+ export declare function getSessionPreset(sessionID: string): string | undefined;
3
+ export declare function clearSessionPreset(sessionID: string): void;
4
+ /** @internal */
5
+ export declare function _resetPresetStateForTesting(): void;
@@ -1,6 +1,12 @@
1
1
  export declare const subagentSessions: Set<string>;
2
2
  export declare function registerSubagentSession(sessionID: string, parentSessionID: string): void;
3
+ export declare function unregisterSubagentSession(sessionID: string): void;
3
4
  export declare function getParentSessionID(subagentSessionID: string): string | undefined;
5
+ /**
6
+ * Live subagent session IDs registered under the given parent session.
7
+ * Only sessions still present in `subagentSessions` (i.e. not yet
8
+ * unregistered on task end) are returned.
9
+ */
4
10
  export declare function getSubagentSessionIDs(parentSessionID: string): string[];
5
11
  export declare function setMainSession(id: string | undefined): void;
6
12
  export declare function getMainSessionID(): string | undefined;
@@ -21,6 +21,8 @@ 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
+ repoURL: z.ZodOptional<z.ZodString>;
25
+ parentID: z.ZodOptional<z.ZodString>;
24
26
  threadID: z.ZodOptional<z.ZodString>;
25
27
  projectRoot: z.ZodOptional<z.ZodString>;
26
28
  }, z.core.$strict>;
@@ -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";
@@ -1,5 +1,5 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
- export declare const JSON_ERROR_TOOL_EXCLUDE_LIST: readonly ["bash", "read", "glob", "grep", "webfetch", "look_at", "grep_app_searchgithub", "websearch_web_search_exa"];
2
+ export declare const JSON_ERROR_TOOL_EXCLUDE_LIST: readonly ["bash", "read", "glob", "grep", "webfetch", "look_at", "white_rabbit_searchgithub", "websearch_web_search_exa"];
3
3
  export declare const JSON_ERROR_PATTERNS: readonly RegExp[];
4
4
  export declare const JSON_ERROR_REMINDER = "\n[JSON PARSE ERROR - IMMEDIATE ACTION REQUIRED]\n\nYou sent invalid JSON arguments to a tool. STOP and do this NOW:\n\n1. DO NOT retry with the same malformed JSON\n2. CORRECT the JSON syntax \u2014 check for: missing quotes, trailing commas, unmatched braces\n3. RETRY the tool call with valid JSON arguments\n\nThis usually means you garbled a string parameter or forgot to escape a character.\n";
5
5
  export declare function createJsonErrorRecoveryHook(_ctx: PluginInput): {
@@ -1,8 +1,9 @@
1
1
  import type { MatrixxConfig } from "../../config/schema";
2
+ import type { Task } from "../../features/task-storage/types";
2
3
  export declare const DEFAULT_STALE_AFTER_HOURS = 24;
3
4
  /**
4
5
  * Resolve the stale threshold (ms) from plugin config.
5
- * `morpheus.tasks.stale_after_hours` (default 24h) — a pending task whose
6
+ * `tasks.stale_after_hours` (default 24h, legacy `morpheus.tasks.stale_after_hours`) — a pending task whose
6
7
  * task file has had no write activity for longer than this is "stale".
7
8
  */
8
9
  export declare function getStaleAfterMs(config?: Partial<MatrixxConfig>): number;
@@ -12,5 +13,10 @@ export declare function getStaleAfterMs(config?: Partial<MatrixxConfig>): number
12
13
  */
13
14
  export declare function getTaskAgeMs(taskPath: string): number | null;
14
15
  export declare function isTaskStale(taskPath: string, staleAfterMs: number): boolean;
16
+ /**
17
+ * Filter incomplete tasks down to the ones that are still fresh (not stale).
18
+ * A task whose file cannot be stat'ed is treated as fresh (not stale).
19
+ */
20
+ export declare function filterFreshIncompleteTasks(tasks: Task[], taskDir: string, staleAfterMs: number): Task[];
15
21
  /** Human-readable age, e.g. "3h", "2d". */
16
22
  export declare function formatTaskAge(ageMs: number): string;
@@ -6,9 +6,17 @@ export declare function getIncompleteTasks(tasks: Task[]): Task[];
6
6
  export declare function getIncompleteTaskCount(tasks: Task[]): number;
7
7
  export interface SessionFilterOptions {
8
8
  sessionID: string;
9
+ /** LIVE subagent session ids (dead/unregistered subagents are excluded). */
9
10
  subagentIDs: string[];
10
11
  sessionScoped?: boolean;
11
12
  }
13
+ /**
14
+ * Drop subtasks whose parent task is already resolved (completed/deleted).
15
+ * A task is dropped only when its `parentID` resolves to a task in the full
16
+ * input array whose status is "completed" or "deleted". Tasks without a
17
+ * parentID, or whose parent is missing from the input, are kept.
18
+ */
19
+ export declare function dropSubtasksWithResolvedParent(tasks: Task[]): Task[];
12
20
  /**
13
21
  * Filter tasks by session scope.
14
22
  * - When sessionScoped=false: all tasks pass through (opt-out / legacy behavior)
@@ -1,3 +1,3 @@
1
1
  export declare const HOOK_NAME = "tasks-todowrite-disabler";
2
2
  export declare const BLOCKED_TOOLS: string[];
3
- export declare const REPLACEMENT_MESSAGE = "TodoRead/TodoWrite are DISABLED because experimental.task_system is enabled.\n\n**ACTION REQUIRED**: RE-REGISTER what you were about to write as Todo using Task tools NOW. Then ASSIGN yourself and START WORKING immediately.\n\n**Use these tools instead:**\n- TaskCreate: Create new task with auto-generated ID\n- TaskUpdate: Update status, assign owner, add dependencies\n- TaskList: List active tasks with dependency info\n- TaskGet: Get full task details\n\n**Workflow:**\n1. TaskCreate({ subject: \"your task description\" })\n2. TaskUpdate({ id: \"T-xxx\", status: \"in_progress\", owner: \"your-thread-id\" })\n3. DO THE WORK\n4. TaskUpdate({ id: \"T-xxx\", status: \"completed\" })\n\nCRITICAL: 1 task = 1 task. Fire independent tasks concurrently.\n\n**STOP! DO NOT START WORKING DIRECTLY - NO MATTER HOW SMALL THE TASK!**\nEven if the task seems trivial (1 line fix, simple edit, quick change), you MUST:\n1. FIRST register it with TaskCreate\n2. THEN mark it in_progress\n3. ONLY THEN do the actual work\n4. FINALLY mark it completed\n\n**WHY?** Task tracking = visibility = accountability. Skipping registration = invisible work = chaos.\n\nDO NOT retry TodoWrite. Convert to TaskCreate NOW.";
3
+ export declare const REPLACEMENT_MESSAGE = "TodoRead/TodoWrite are DISABLED because tasks.enabled is true.\n\n**ACTION REQUIRED**: RE-REGISTER what you were about to write as Todo using Task tools NOW. Then ASSIGN yourself and START WORKING immediately.\n\n**Use these tools instead:**\n- TaskCreate: Create new task with auto-generated ID\n- TaskUpdate: Update status, assign owner, add dependencies\n- TaskList: List active tasks with dependency info\n- TaskGet: Get full task details\n\n**Workflow:**\n1. TaskCreate({ subject: \"your task description\" })\n2. TaskUpdate({ id: \"T-xxx\", status: \"in_progress\", owner: \"your-thread-id\" })\n3. DO THE WORK\n4. TaskUpdate({ id: \"T-xxx\", status: \"completed\" })\n\nCRITICAL: 1 task = 1 task. Fire independent tasks concurrently.\n\n**STOP! DO NOT START WORKING DIRECTLY - NO MATTER HOW SMALL THE TASK!**\nEven if the task seems trivial (1 line fix, simple edit, quick change), you MUST:\n1. FIRST register it with TaskCreate\n2. THEN mark it in_progress\n3. ONLY THEN do the actual work\n4. FINALLY mark it completed\n\n**WHY?** Task tracking = visibility = accountability. Skipping registration = invisible work = chaos.\n\nDO NOT retry TodoWrite. Convert to TaskCreate NOW.";