opencode-matrixx 2.6.12 → 2.6.14

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 (151) hide show
  1. package/README.md +25 -21
  2. package/dist/agents/architect/default.d.ts +1 -1
  3. package/dist/agents/architect/gpt.d.ts +1 -1
  4. package/dist/agents/builtin-agents/architect-agent.d.ts +0 -1
  5. package/dist/agents/builtin-agents/general-agents.d.ts +0 -1
  6. package/dist/agents/builtin-agents/keymaker-agent.d.ts +0 -1
  7. package/dist/agents/builtin-agents/morpheus-agent.d.ts +0 -1
  8. package/dist/agents/builtin-agents.d.ts +1 -1
  9. package/dist/agents/dynamic-agent-prompt-builder.d.ts +4 -4
  10. package/dist/agents/keymaker.d.ts +1 -1
  11. package/dist/agents/model-directives.d.ts +7 -0
  12. package/dist/agents/morpheus.d.ts +1 -1
  13. package/dist/agents/mouse/agent.d.ts +2 -2
  14. package/dist/agents/mouse/deepseek.d.ts +1 -1
  15. package/dist/agents/mouse/default.d.ts +1 -1
  16. package/dist/agents/mouse/gpt.d.ts +1 -1
  17. package/dist/agents/mouse/mimo.d.ts +1 -1
  18. package/dist/agents/mouse/qwen.d.ts +1 -1
  19. package/dist/agents/mouse/shared.d.ts +3 -3
  20. package/dist/agents/oracle/plan-generation.d.ts +1 -1
  21. package/dist/agents/seraph.d.ts +1 -1
  22. package/dist/cli.js +17 -10
  23. package/dist/config/schema/dcp.d.ts +15 -11
  24. package/dist/config/schema/experimental.d.ts +1 -1
  25. package/dist/config/schema/hooks.d.ts +4 -5
  26. package/dist/config/schema/matrixx-config.d.ts +8 -6
  27. package/dist/config/schema/tasks.d.ts +5 -1
  28. package/dist/create-hooks.d.ts +3 -4
  29. package/dist/features/background-agent/manager.d.ts +5 -2
  30. package/dist/features/background-agent/reconcile.d.ts +8 -1
  31. package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
  32. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  33. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
  34. package/dist/features/builtin-commands/templates/remove-deadcode.d.ts +1 -1
  35. package/dist/features/builtin-commands/templates/stop-continuation.d.ts +1 -1
  36. package/dist/features/session-state/state.d.ts +3 -0
  37. package/dist/features/task-session-scope/ancestry.d.ts +23 -0
  38. package/dist/features/task-session-scope/index.d.ts +2 -0
  39. package/dist/features/task-session-scope/session-task-pending.d.ts +83 -0
  40. package/dist/hooks/architect/system-reminder-templates.d.ts +1 -1
  41. package/dist/hooks/dcp-nudge-sanitizer/constants.d.ts +2 -0
  42. package/dist/hooks/dcp-nudge-sanitizer/hook.d.ts +25 -0
  43. package/dist/hooks/dcp-nudge-sanitizer/index.d.ts +1 -0
  44. package/dist/hooks/index.d.ts +3 -5
  45. package/dist/hooks/keyword-detector/ultrawork/deepseek.d.ts +1 -1
  46. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
  47. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
  48. package/dist/hooks/keyword-detector/ultrawork/glm.d.ts +1 -1
  49. package/dist/hooks/keyword-detector/ultrawork/mimo.d.ts +1 -1
  50. package/dist/hooks/nudge-loop-breaker/constants.d.ts +9 -0
  51. package/dist/hooks/nudge-loop-breaker/hook.d.ts +18 -0
  52. package/dist/hooks/nudge-loop-breaker/index.d.ts +1 -0
  53. package/dist/hooks/nudge-loop-breaker/session-state.d.ts +11 -0
  54. package/dist/hooks/plan-persister/hook.d.ts +1 -1
  55. package/dist/hooks/session-notification-scheduler.d.ts +1 -1
  56. package/dist/hooks/session-notification.d.ts +9 -2
  57. package/dist/hooks/task-continuation-enforcer/handler.d.ts +0 -1
  58. package/dist/hooks/task-continuation-enforcer/index.d.ts +0 -1
  59. package/dist/hooks/task-continuation-enforcer/staleness.d.ts +10 -0
  60. package/dist/hooks/task-continuation-enforcer/todo.d.ts +2 -1
  61. package/dist/hooks/task-continuation-enforcer/types.d.ts +0 -8
  62. package/dist/hooks/task-notepad-writer/constants.d.ts +42 -0
  63. package/dist/hooks/task-notepad-writer/hook.d.ts +14 -0
  64. package/dist/hooks/task-notepad-writer/index.d.ts +2 -0
  65. package/dist/hooks/task-notepad-writer/notepad-path.d.ts +36 -0
  66. package/dist/index.js +1834 -2138
  67. package/dist/matrixx.schema.json +69 -18
  68. package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -3
  69. package/dist/plugin/hooks/create-core-hooks.d.ts +2 -2
  70. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -3
  71. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
  72. package/dist/plugin-handlers/task-permissions.d.ts +48 -0
  73. package/dist/shared/dcp-switch-profile.d.ts +12 -0
  74. package/dist/shared/logger.d.ts +1 -0
  75. package/dist/shared/system-directive.d.ts +0 -1
  76. package/dist/shared/task-system-gating.d.ts +24 -4
  77. package/dist/tools/session-manager/constants.d.ts +1 -1
  78. package/dist/tools/session-manager/storage.d.ts +44 -0
  79. package/dist/tools/session-manager/tools.d.ts +2 -1
  80. package/dist/tools/task/create-one.d.ts +21 -0
  81. package/dist/tools/task/types.d.ts +56 -1
  82. package/package.json +1 -1
  83. package/dist/cli/setup/config-writer.test.d.ts +0 -1
  84. package/dist/cli/setup/deps.test.d.ts +0 -1
  85. package/dist/cli/setup/index.test.d.ts +0 -1
  86. package/dist/cli/setup/opencode-sync.test.d.ts +0 -1
  87. package/dist/cli/setup/prompts.test.d.ts +0 -1
  88. package/dist/features/background-agent/handle-index.test.d.ts +0 -1
  89. package/dist/features/background-agent/manager-handles.test.d.ts +0 -1
  90. package/dist/features/knowledge-hub/loader.test.d.ts +0 -1
  91. package/dist/features/knowledge-hub/resolver.test.d.ts +0 -1
  92. package/dist/features/mission-state/plan-storage.test.d.ts +0 -1
  93. package/dist/features/mission-state/reconcile.test.d.ts +0 -1
  94. package/dist/features/session-state/state.test.d.ts +0 -1
  95. package/dist/hooks/compaction-todo-preserver/hook.d.ts +0 -24
  96. package/dist/hooks/compaction-todo-preserver/index.d.ts +0 -2
  97. package/dist/hooks/input-secret-guard/detector.test.d.ts +0 -1
  98. package/dist/hooks/input-secret-guard/hook.test.d.ts +0 -1
  99. package/dist/hooks/input-secret-guard/redactor.test.d.ts +0 -1
  100. package/dist/hooks/input-secret-guard/session-allow-cache.test.d.ts +0 -1
  101. package/dist/hooks/interactive-bash-session/hook.test.d.ts +0 -1
  102. package/dist/hooks/knowledge-hub-guard/hook.test.d.ts +0 -1
  103. package/dist/hooks/knowledge-hub-injector/hook.test.d.ts +0 -1
  104. package/dist/hooks/knowledge-hub-search-nudge/hook.test.d.ts +0 -1
  105. package/dist/hooks/plan-persister/task-sync.test.d.ts +0 -1
  106. package/dist/hooks/rtk-bash-rewriter/hook.test.d.ts +0 -1
  107. package/dist/hooks/session-todo-status.d.ts +0 -2
  108. package/dist/hooks/stop-continuation-guard/repro.test.d.ts +0 -1
  109. package/dist/hooks/task-continuation-enforcer/awaiting-user.test.d.ts +0 -1
  110. package/dist/hooks/task-continuation-enforcer/continuation-injection.test.d.ts +0 -1
  111. package/dist/hooks/task-continuation-enforcer/countdown.test.d.ts +0 -1
  112. package/dist/hooks/task-continuation-enforcer/idle-event.test.d.ts +0 -1
  113. package/dist/hooks/task-continuation-enforcer/staleness.test.d.ts +0 -1
  114. package/dist/hooks/task-continuation-enforcer/todo.test.d.ts +0 -1
  115. package/dist/hooks/task-continuation-enforcer/ulw-bootstrap.test.d.ts +0 -1
  116. package/dist/hooks/task-notepad/constants.d.ts +0 -10
  117. package/dist/hooks/task-notepad/hook.d.ts +0 -12
  118. package/dist/hooks/task-notepad/index.d.ts +0 -3
  119. package/dist/hooks/task-notepad/types.d.ts +0 -16
  120. package/dist/hooks/tasks-todowrite-disabler/constants.d.ts +0 -3
  121. package/dist/hooks/tasks-todowrite-disabler/hook.d.ts +0 -14
  122. package/dist/hooks/tasks-todowrite-disabler/index.d.ts +0 -2
  123. package/dist/hooks/todo-continuation-enforcer/abort-detection.d.ts +0 -4
  124. package/dist/hooks/todo-continuation-enforcer/awaiting-user.test.d.ts +0 -1
  125. package/dist/hooks/todo-continuation-enforcer/constants.d.ts +0 -10
  126. package/dist/hooks/todo-continuation-enforcer/continuation-injection.d.ts +0 -12
  127. package/dist/hooks/todo-continuation-enforcer/countdown.d.ts +0 -14
  128. package/dist/hooks/todo-continuation-enforcer/countdown.test.d.ts +0 -1
  129. package/dist/hooks/todo-continuation-enforcer/handler.d.ts +0 -15
  130. package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +0 -11
  131. package/dist/hooks/todo-continuation-enforcer/idle-event.test.d.ts +0 -1
  132. package/dist/hooks/todo-continuation-enforcer/index.d.ts +0 -4
  133. package/dist/hooks/todo-continuation-enforcer/message-directory.d.ts +0 -1
  134. package/dist/hooks/todo-continuation-enforcer/non-idle-events.d.ts +0 -6
  135. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +0 -10
  136. package/dist/hooks/todo-continuation-enforcer/todo.d.ts +0 -2
  137. package/dist/hooks/todo-continuation-enforcer/types.d.ts +0 -61
  138. package/dist/shared/format-bytes.test.d.ts +0 -1
  139. package/dist/shared/is-abort-error.test.d.ts +0 -1
  140. package/dist/shared/task-system-gating.test.d.ts +0 -1
  141. package/dist/shared/with-timeout.test.d.ts +0 -1
  142. package/dist/tools/delegate-task/poll-timeout-outcome.test.d.ts +0 -1
  143. package/dist/tools/delegate-task/prompt-builder.tdd.test.d.ts +0 -1
  144. package/dist/tools/delegate-task/sync-task.test.d.ts +0 -1
  145. package/dist/tools/delegate-task/tdd-enforcement.test.d.ts +0 -1
  146. package/dist/tools/delegate-task/timing.test.d.ts +0 -1
  147. package/dist/tools/evolution/query-actions.test.d.ts +0 -1
  148. package/dist/tools/evolution/tools.test.d.ts +0 -1
  149. package/dist/tools/github-search/result-formatter.test.d.ts +0 -1
  150. package/dist/tools/knowledge-hub-confirm/tools.test.d.ts +0 -1
  151. package/dist/tools/task/task-cleanup.test.d.ts +0 -1
@@ -13,7 +13,7 @@ export declare function createIdleNotificationScheduler(options: {
13
13
  ctx: PluginInput;
14
14
  platform: Platform;
15
15
  config: SessionNotificationConfig;
16
- hasIncompleteTodos: (ctx: PluginInput, sessionID: string) => Promise<boolean>;
16
+ hasIncompleteTaskWork: (ctx: PluginInput, sessionID: string) => Promise<boolean>;
17
17
  send: (ctx: PluginInput, platform: Platform, title: string, message: string) => Promise<void>;
18
18
  playSound: (ctx: PluginInput, platform: Platform, soundPath: string) => Promise<void>;
19
19
  }): {
@@ -1,4 +1,5 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { MatrixxConfig } from "../config/schema";
2
3
  interface SessionNotificationConfig {
3
4
  title?: string;
4
5
  message?: string;
@@ -6,12 +7,18 @@ interface SessionNotificationConfig {
6
7
  soundPath?: string;
7
8
  /** Delay in ms before sending notification to confirm session is still idle (default: 1500) */
8
9
  idleConfirmationDelay?: number;
9
- /** Skip notification if there are incomplete todos (default: true) */
10
+ /** Skip notification if the session (or one of its subagents) still has pending work in the file-backed task store (default: true) */
10
11
  skipIfIncompleteTodos?: boolean;
11
12
  /** Maximum number of sessions to track before cleanup (default: 100) */
12
13
  maxTrackedSessions?: number;
13
14
  }
14
- export declare function createSessionNotification(ctx: PluginInput, config?: SessionNotificationConfig): ({ event }: {
15
+ export declare function createSessionNotification(ctx: PluginInput, config?: SessionNotificationConfig,
16
+ /**
17
+ * The plugin config is a separate parameter, not part of `SessionNotificationConfig`:
18
+ * only `tasks.*` is read here, and widening the hook-local config would blur a
19
+ * presentation-only shape into a carrier for task-storage settings.
20
+ */
21
+ pluginConfig?: Partial<MatrixxConfig>): ({ event }: {
15
22
  event: {
16
23
  type: string;
17
24
  properties?: unknown;
@@ -15,4 +15,3 @@ export declare function createTaskContinuationHandler(args: {
15
15
  properties?: unknown;
16
16
  };
17
17
  }) => Promise<void>;
18
- export declare const createTodoContinuationHandler: typeof createTaskContinuationHandler;
@@ -3,4 +3,3 @@ import type { TaskContinuationEnforcer, TaskContinuationEnforcerOptions } from "
3
3
  export { createTaskContinuationHandler } from "./handler";
4
4
  export type { TaskContinuationEnforcer, TaskContinuationEnforcerOptions } from "./types";
5
5
  export declare function createTaskContinuationEnforcer(ctx: PluginInput, options?: TaskContinuationEnforcerOptions): TaskContinuationEnforcer;
6
- export declare const createTodoContinuationEnforcer: typeof createTaskContinuationEnforcer;
@@ -1,12 +1,22 @@
1
1
  import type { MatrixxConfig } from "../../config/schema";
2
2
  import type { Task } from "../../features/task-storage/types";
3
3
  export declare const DEFAULT_STALE_AFTER_HOURS = 24;
4
+ export { DEFAULT_BACKGROUND_STALE_AFTER_HOURS } from "../../shared/task-system-gating";
4
5
  /**
5
6
  * Resolve the stale threshold (ms) from plugin config.
6
7
  * `tasks.stale_after_hours` (default 24h, legacy `morpheus.tasks.stale_after_hours`) — a pending task whose
7
8
  * task file has had no write activity for longer than this is "stale".
8
9
  */
9
10
  export declare function getStaleAfterMs(config?: Partial<MatrixxConfig>): number;
11
+ /**
12
+ * Resolve the background completion-gate threshold (ms) from plugin config.
13
+ * `tasks.background_stale_after_hours` (default 2h, canonical only) — the same
14
+ * mtime basis as `getStaleAfterMs`, but a much shorter window because a task
15
+ * held `pending`/`in_progress` with no file activity is a far stronger signal
16
+ * when it is blocking a background handle than when it is merely delaying a
17
+ * continuation nudge. The enforcer's 24h default deliberately stays at 24.
18
+ */
19
+ export declare function getBackgroundStaleAfterMs(config?: Partial<MatrixxConfig>): number;
10
20
  /**
11
21
  * Age of a task file in ms since last write (mtime). Returns null when the
12
22
  * file cannot be stat'ed (missing/unreadable) — callers treat null as "not stale".
@@ -20,9 +20,10 @@ export declare function dropSubtasksWithResolvedParent(tasks: Task[]): Task[];
20
20
  /**
21
21
  * Filter tasks by session scope.
22
22
  * - When sessionScoped=false: all tasks pass through (opt-out / legacy behavior)
23
- * - Pre-migration tasks (no threadID) are always included for backward compatibility
24
23
  * - Current session's tasks (threadID === sessionID) are included
25
24
  * - Subagent session tasks (threadID in subagentIDs) are included
25
+ * - Tasks with no threadID are excluded: threadID is required by TaskObjectSchema, so
26
+ * an unattributed task cannot be attributed and is not claimed by any session
26
27
  * - All other tasks are excluded
27
28
  */
28
29
  export declare function filterTasksBySession(tasks: Task[], options: SessionFilterOptions): Task[];
@@ -20,14 +20,6 @@ export interface TaskContinuationEnforcer {
20
20
  cancelAllCountdowns: () => void;
21
21
  isAwaitingUser: (sessionID: string) => boolean;
22
22
  }
23
- export type TodoContinuationEnforcerOptions = TaskContinuationEnforcerOptions;
24
- export type TodoContinuationEnforcer = TaskContinuationEnforcer;
25
- export interface Todo {
26
- content: string;
27
- status: string;
28
- priority: string;
29
- id?: string;
30
- }
31
23
  export interface SessionState {
32
24
  countdownTimer?: ReturnType<typeof setTimeout>;
33
25
  countdownInterval?: ReturnType<typeof setInterval>;
@@ -0,0 +1,42 @@
1
+ export declare const HOOK_NAME = "task-notepad-writer";
2
+ export declare const MATRIXX_DIR_NAME = ".matrixx";
3
+ export declare const PLANS_SUBDIR = "plans";
4
+ export declare const NOTEPADS_SUBDIR = "notepads";
5
+ export declare const PLAN_EXTENSION = ".md";
6
+ export declare const NOTEPAD_EXTENSION = ".md";
7
+ export declare const ADHOC_BUCKET = "adhoc";
8
+ export declare const TASK_CREATE_TOOL = "task_create";
9
+ export declare const TASK_UPDATE_TOOL = "task_update";
10
+ export declare const COMPLETED_STATUS = "completed";
11
+ export declare const DEFAULT_PRIORITY = "medium";
12
+ export declare const COMPLETION_SECTION_TITLE = "## Completion";
13
+ export declare const PLAN_NAME_METADATA_KEY = "planName";
14
+ export declare const SLUG_MAX_LENGTH = 60;
15
+ export declare const NOTEPAD_SECTIONS: readonly [{
16
+ readonly heading: "## Findings";
17
+ readonly body: "(Record what you learn about this code as you work — patterns, conventions, gotchas, useful references.)";
18
+ }, {
19
+ readonly heading: "## Blockers";
20
+ readonly body: "(Anything blocking progress. Be specific: file path, line, error, workaround if any.)";
21
+ }, {
22
+ readonly heading: "## Questions";
23
+ readonly body: "(Open questions to revisit later. Don't lose them when context compacts.)";
24
+ }, {
25
+ readonly heading: "## Results";
26
+ readonly body: "(Summary on completion. What changed, what was verified, what remains.)";
27
+ }];
28
+ /**
29
+ * The header's `**Task ID**: <id>` line is the durable idempotency marker: it
30
+ * lives inside the file, so a lookup finds the same notepad across process
31
+ * restarts, with no in-memory bookkeeping to lose.
32
+ */
33
+ export declare function taskIdMarkerLine(taskId: string): string;
34
+ export declare function taskIdMarkerPresent(content: string, taskId: string): boolean;
35
+ export declare function renderNotepad(input: {
36
+ subject: string;
37
+ taskId: string;
38
+ priority?: string | undefined;
39
+ status?: string | undefined;
40
+ startedAt: string;
41
+ }): string;
42
+ export declare function renderCompletionStamp(completedAt: string): string;
@@ -0,0 +1,14 @@
1
+ import { type TaskNotepadWriterContext } from "./notepad-path";
2
+ export interface ToolAfterInput {
3
+ tool: string;
4
+ sessionID: string;
5
+ callID: string;
6
+ }
7
+ export interface ToolAfterOutput {
8
+ title: string;
9
+ output: string;
10
+ metadata?: Record<string, unknown>;
11
+ }
12
+ export declare function createTaskNotepadWriterHook(ctx: TaskNotepadWriterContext): {
13
+ "tool.execute.after": (input: ToolAfterInput, output: ToolAfterOutput | undefined) => Promise<void>;
14
+ };
@@ -0,0 +1,2 @@
1
+ export { createTaskNotepadWriterHook, type ToolAfterInput, type ToolAfterOutput } from "./hook";
2
+ export type { TaskNotepadWriterContext } from "./notepad-path";
@@ -0,0 +1,36 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { MatrixxConfig } from "../../config/schema";
3
+ export type TaskNotepadWriterContext = PluginInput & {
4
+ config?: Partial<MatrixxConfig>;
5
+ };
6
+ export interface NotepadTask {
7
+ id: string;
8
+ subject: string;
9
+ metadata?: Record<string, unknown> | undefined;
10
+ status?: string | undefined;
11
+ priority?: string | undefined;
12
+ }
13
+ export type BucketReason = "plan-file-exists" | "no-plan-name" | "plan-file-missing";
14
+ export interface NotepadResolution {
15
+ bucketDir: string;
16
+ filePath: string;
17
+ reason: BucketReason;
18
+ }
19
+ export declare function notepadsRootFor(directory: string): string;
20
+ export declare function extractPlanName(task: NotepadTask): string | null;
21
+ export declare function slugifySubject(subject: string, fallback: string): string;
22
+ export declare function countNotepadFiles(bucketDir: string): number;
23
+ export declare function resolveNotepadPath(input: {
24
+ ctx: TaskNotepadWriterContext;
25
+ task: NotepadTask;
26
+ notepadRoot: string;
27
+ }): NotepadResolution;
28
+ export declare function findExistingNotepadForTask(bucketDir: string, taskId: string): string | null;
29
+ export declare function findNotepadForTask(input: {
30
+ ctx: TaskNotepadWriterContext;
31
+ task: NotepadTask;
32
+ notepadRoot: string;
33
+ }): {
34
+ filePath: string;
35
+ bucketDir: string;
36
+ } | null;