opencode-orchestrator 1.2.32 → 1.2.34

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 (263) hide show
  1. package/README.md +41 -91
  2. package/dist/core/agents/adaptive-concurrency.d.ts +57 -0
  3. package/dist/core/agents/index.d.ts +3 -2
  4. package/dist/core/agents/interfaces/session-pool.interface.d.ts +7 -0
  5. package/dist/core/agents/manager.d.ts +8 -36
  6. package/dist/core/agents/session-pool.d.ts +5 -0
  7. package/dist/core/agents/unified-task-executor.d.ts +10 -92
  8. package/dist/index.js +3924 -19410
  9. package/dist/shared/command/constants/names.d.ts +8 -0
  10. package/dist/shared/command/index.d.ts +1 -0
  11. package/dist/shared/constants/system-messages.d.ts +3 -3
  12. package/dist/shared/core/constants/index.d.ts +4 -0
  13. package/dist/shared/index.d.ts +7 -8
  14. package/dist/shared/prompt/index.d.ts +1 -0
  15. package/dist/shared/session/constants/index.d.ts +2 -0
  16. package/dist/shared/session/index.d.ts +1 -0
  17. package/dist/tools/parallel/list-agents.d.ts +1 -1
  18. package/dist/utils/common.d.ts +3 -5
  19. package/package.json +3 -3
  20. package/dist/core/agents/agent-registry.d.ts +0 -28
  21. package/dist/core/agents/concurrency.d.ts +0 -41
  22. package/dist/core/agents/config.d.ts +0 -10
  23. package/dist/core/agents/consts/index.d.ts +0 -4
  24. package/dist/core/agents/manager/event-handler.d.ts +0 -35
  25. package/dist/core/agents/manager/index.d.ts +0 -10
  26. package/dist/core/agents/manager/task-cleaner.d.ts +0 -29
  27. package/dist/core/agents/manager/task-launcher.d.ts +0 -35
  28. package/dist/core/agents/manager/task-poller.d.ts +0 -30
  29. package/dist/core/agents/manager/task-resumer.d.ts +0 -18
  30. package/dist/core/agents/persistence/task-wal.d.ts +0 -26
  31. package/dist/core/agents/task-store.d.ts +0 -54
  32. package/dist/core/cleanup/cleanup-scheduler.d.ts +0 -11
  33. package/dist/core/context/context-window-monitor.d.ts +0 -66
  34. package/dist/core/context/index.d.ts +0 -6
  35. package/dist/core/loop/continuation-lock.d.ts +0 -57
  36. package/dist/core/loop/formatters.d.ts +0 -17
  37. package/dist/core/loop/interfaces/index.d.ts +0 -5
  38. package/dist/core/loop/interfaces/todo-stats.d.ts +0 -11
  39. package/dist/core/loop/interfaces/todo.d.ts +0 -13
  40. package/dist/core/loop/interfaces.d.ts +0 -7
  41. package/dist/core/loop/mission-loop-handler.d.ts +0 -25
  42. package/dist/core/loop/mission-loop.d.ts +0 -48
  43. package/dist/core/loop/parser.d.ts +0 -8
  44. package/dist/core/loop/stats.d.ts +0 -24
  45. package/dist/core/loop/todo-continuation.d.ts +0 -39
  46. package/dist/core/loop/todo-enforcer.d.ts +0 -9
  47. package/dist/core/loop/todo-manager.d.ts +0 -22
  48. package/dist/core/loop/types/index.d.ts +0 -5
  49. package/dist/core/loop/types/todo-priority.d.ts +0 -4
  50. package/dist/core/loop/types/todo-status.d.ts +0 -4
  51. package/dist/core/loop/verification.d.ts +0 -27
  52. package/dist/core/memory/interfaces.d.ts +0 -33
  53. package/dist/core/memory/memory-manager.d.ts +0 -40
  54. package/dist/core/metrics/collector.d.ts +0 -27
  55. package/dist/core/notification/os-notify/index.d.ts +0 -7
  56. package/dist/core/notification/os-notify/notifier.d.ts +0 -7
  57. package/dist/core/notification/os-notify/platform-resolver.d.ts +0 -7
  58. package/dist/core/notification/os-notify/platform.d.ts +0 -7
  59. package/dist/core/notification/os-notify/sound-player.d.ts +0 -7
  60. package/dist/core/notification/os-notify/todo-checker.d.ts +0 -5
  61. package/dist/core/notification/task-toast-manager.d.ts +0 -127
  62. package/dist/core/notification/toast-core.d.ts +0 -36
  63. package/dist/core/notification/toast.d.ts +0 -9
  64. package/dist/core/orchestrator/index.d.ts +0 -6
  65. package/dist/core/orchestrator/interfaces/index.d.ts +0 -4
  66. package/dist/core/orchestrator/interfaces/session-state.d.ts +0 -11
  67. package/dist/core/orchestrator/session-manager.d.ts +0 -31
  68. package/dist/core/orchestrator/state.d.ts +0 -10
  69. package/dist/core/orchestrator/types/index.d.ts +0 -4
  70. package/dist/core/orchestrator/types/task-status.d.ts +0 -5
  71. package/dist/core/plugins/interfaces.d.ts +0 -30
  72. package/dist/core/plugins/plugin-manager.d.ts +0 -21
  73. package/dist/core/progress/calculator.d.ts +0 -11
  74. package/dist/core/progress/formatters.d.ts +0 -20
  75. package/dist/core/progress/interfaces/index.d.ts +0 -8
  76. package/dist/core/progress/interfaces/progress-snapshot.d.ts +0 -15
  77. package/dist/core/progress/interfaces/snapshot-input.d.ts +0 -13
  78. package/dist/core/progress/interfaces/step-progress.d.ts +0 -7
  79. package/dist/core/progress/interfaces/task-progress.d.ts +0 -10
  80. package/dist/core/progress/interfaces/todo-progress.d.ts +0 -9
  81. package/dist/core/progress/interfaces.d.ts +0 -6
  82. package/dist/core/progress/progress-notifier.d.ts +0 -14
  83. package/dist/core/progress/state-broadcaster.d.ts +0 -29
  84. package/dist/core/progress/store.d.ts +0 -28
  85. package/dist/core/progress/tracker.d.ts +0 -11
  86. package/dist/core/queue/async-queue.d.ts +0 -46
  87. package/dist/core/queue/async-utils.d.ts +0 -20
  88. package/dist/core/queue/index.d.ts +0 -8
  89. package/dist/core/queue/work-pool.d.ts +0 -19
  90. package/dist/core/recovery/auto-recovery.d.ts +0 -9
  91. package/dist/core/recovery/constants.d.ts +0 -9
  92. package/dist/core/recovery/handler.d.ts +0 -27
  93. package/dist/core/recovery/interfaces/error-context.d.ts +0 -11
  94. package/dist/core/recovery/interfaces/error-pattern.d.ts +0 -10
  95. package/dist/core/recovery/interfaces/index.d.ts +0 -8
  96. package/dist/core/recovery/interfaces/recovery-action.d.ts +0 -25
  97. package/dist/core/recovery/interfaces/recovery-record.d.ts +0 -10
  98. package/dist/core/recovery/interfaces/recovery-stats.d.ts +0 -9
  99. package/dist/core/recovery/interfaces.d.ts +0 -6
  100. package/dist/core/recovery/patterns.d.ts +0 -8
  101. package/dist/core/recovery/retry.d.ts +0 -59
  102. package/dist/core/recovery/session-recovery.d.ts +0 -30
  103. package/dist/core/session/interfaces/context-stats.d.ts +0 -9
  104. package/dist/core/session/interfaces/index.d.ts +0 -8
  105. package/dist/core/session/interfaces/shared-context.d.ts +0 -15
  106. package/dist/core/session/interfaces/shared-decision.d.ts +0 -10
  107. package/dist/core/session/interfaces/shared-document.d.ts +0 -9
  108. package/dist/core/session/interfaces/shared-finding.d.ts +0 -10
  109. package/dist/core/session/interfaces.d.ts +0 -6
  110. package/dist/core/session/session-health.d.ts +0 -93
  111. package/dist/core/session/shared-context.d.ts +0 -8
  112. package/dist/core/session/store.d.ts +0 -44
  113. package/dist/core/session/summary.d.ts +0 -7
  114. package/dist/core/sync/todo-parser.d.ts +0 -5
  115. package/dist/core/sync/todo-sync-service.d.ts +0 -42
  116. package/dist/core/task/interfaces/index.d.ts +0 -8
  117. package/dist/core/task/interfaces/task-hierarchy.d.ts +0 -9
  118. package/dist/core/task/interfaces/task-input.d.ts +0 -11
  119. package/dist/core/task/interfaces/task-node.d.ts +0 -20
  120. package/dist/core/task/interfaces/task-progress.d.ts +0 -11
  121. package/dist/core/task/interfaces.d.ts +0 -6
  122. package/dist/core/task/parser.d.ts +0 -8
  123. package/dist/core/task/scheduler.d.ts +0 -12
  124. package/dist/core/task/store.d.ts +0 -32
  125. package/dist/core/task/summary.d.ts +0 -7
  126. package/dist/core/task/task-decomposer.d.ts +0 -10
  127. package/dist/core/todo/todo-manager.d.ts +0 -36
  128. package/dist/hooks/compatibility/external-plugin.d.ts +0 -10
  129. package/dist/hooks/constants.d.ts +0 -27
  130. package/dist/hooks/custom/agent-ui.d.ts +0 -20
  131. package/dist/hooks/custom/memory-gate.d.ts +0 -21
  132. package/dist/hooks/custom/metrics.d.ts +0 -14
  133. package/dist/hooks/custom/resource-control.d.ts +0 -13
  134. package/dist/hooks/custom/secret-scanner.d.ts +0 -19
  135. package/dist/hooks/custom/strict-role-guard.d.ts +0 -21
  136. package/dist/hooks/custom/user-activity.d.ts +0 -11
  137. package/dist/hooks/features/mission-loop.d.ts +0 -18
  138. package/dist/hooks/features/sanity-check.d.ts +0 -15
  139. package/dist/hooks/index.d.ts +0 -5
  140. package/dist/hooks/registry.d.ts +0 -37
  141. package/dist/hooks/types.d.ts +0 -72
  142. package/dist/plugin-handlers/assistant-done-handler.d.ts +0 -12
  143. package/dist/plugin-handlers/chat-message-handler.d.ts +0 -30
  144. package/dist/plugin-handlers/config-handler.d.ts +0 -9
  145. package/dist/plugin-handlers/event-handler.d.ts +0 -18
  146. package/dist/plugin-handlers/index.d.ts +0 -9
  147. package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +0 -12
  148. package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +0 -12
  149. package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +0 -14
  150. package/dist/plugin-handlers/interfaces/index.d.ts +0 -12
  151. package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +0 -14
  152. package/dist/plugin-handlers/interfaces/session-compacting.d.ts +0 -19
  153. package/dist/plugin-handlers/interfaces/session-state.d.ts +0 -15
  154. package/dist/plugin-handlers/interfaces/system-transform.d.ts +0 -17
  155. package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +0 -8
  156. package/dist/plugin-handlers/interfaces/tool-hook.d.ts +0 -14
  157. package/dist/plugin-handlers/session-compacting-handler.d.ts +0 -14
  158. package/dist/plugin-handlers/system-transform-handler.d.ts +0 -14
  159. package/dist/plugin-handlers/tool-execute-handler.d.ts +0 -14
  160. package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +0 -8
  161. package/dist/shared/errors/constants/error-patterns.d.ts +0 -13
  162. package/dist/shared/errors/constants/error-type.d.ts +0 -13
  163. package/dist/shared/errors/constants/index.d.ts +0 -5
  164. package/dist/shared/errors/detection.d.ts +0 -5
  165. package/dist/shared/errors/index.d.ts +0 -7
  166. package/dist/shared/errors/retry.d.ts +0 -7
  167. package/dist/shared/errors/types/error-pattern-type.d.ts +0 -5
  168. package/dist/shared/errors/types/index.d.ts +0 -4
  169. package/dist/shared/loop/constants/index.d.ts +0 -7
  170. package/dist/shared/loop/constants/labels.d.ts +0 -33
  171. package/dist/shared/loop/constants/loop.d.ts +0 -17
  172. package/dist/shared/loop/constants/mission-control.d.ts +0 -20
  173. package/dist/shared/loop/constants/todo-status.d.ts +0 -9
  174. package/dist/shared/loop/index.d.ts +0 -6
  175. package/dist/shared/loop/interfaces/index.d.ts +0 -6
  176. package/dist/shared/loop/interfaces/mission-loop.d.ts +0 -29
  177. package/dist/shared/loop/interfaces/todo-stats.d.ts +0 -11
  178. package/dist/shared/loop/interfaces/todo.d.ts +0 -13
  179. package/dist/shared/loop/types/index.d.ts +0 -5
  180. package/dist/shared/loop/types/todo-priority.d.ts +0 -4
  181. package/dist/shared/loop/types/todo-status.d.ts +0 -4
  182. package/dist/shared/message/constants/index.d.ts +0 -8
  183. package/dist/shared/message/constants/message-roles.d.ts +0 -23
  184. package/dist/shared/message/constants/part-types.d.ts +0 -13
  185. package/dist/shared/message/constants/plugin-hooks.d.ts +0 -15
  186. package/dist/shared/message/constants/prompts.d.ts +0 -8
  187. package/dist/shared/message/constants/slash-commands.d.ts +0 -21
  188. package/dist/shared/message/index.d.ts +0 -4
  189. package/dist/shared/notification/constants/index.d.ts +0 -3
  190. package/dist/shared/notification/constants/toast-duration.d.ts +0 -19
  191. package/dist/shared/notification/constants/toast-variants.d.ts +0 -10
  192. package/dist/shared/notification/constants/tui.const.d.ts +0 -24
  193. package/dist/shared/notification/index.d.ts +0 -7
  194. package/dist/shared/notification/interfaces/index.d.ts +0 -6
  195. package/dist/shared/notification/interfaces/task-toast.interface.d.ts +0 -18
  196. package/dist/shared/notification/interfaces/toast-message.d.ts +0 -13
  197. package/dist/shared/notification/interfaces/toast-options.d.ts +0 -10
  198. package/dist/shared/notification/os-notify/constants/index.d.ts +0 -6
  199. package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +0 -11
  200. package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +0 -11
  201. package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +0 -5
  202. package/dist/shared/notification/os-notify/index.d.ts +0 -6
  203. package/dist/shared/notification/os-notify/interfaces/index.d.ts +0 -5
  204. package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +0 -15
  205. package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +0 -13
  206. package/dist/shared/notification/os-notify/types/index.d.ts +0 -4
  207. package/dist/shared/notification/os-notify/types/notification-commands.d.ts +0 -5
  208. package/dist/shared/notification/presets/index.d.ts +0 -9
  209. package/dist/shared/notification/presets/mission.d.ts +0 -5
  210. package/dist/shared/notification/presets/parallel.d.ts +0 -6
  211. package/dist/shared/notification/presets/session.d.ts +0 -6
  212. package/dist/shared/notification/presets/task-lifecycle.d.ts +0 -7
  213. package/dist/shared/notification/presets/tools.d.ts +0 -6
  214. package/dist/shared/notification/presets/warnings.d.ts +0 -7
  215. package/dist/shared/notification/types/index.d.ts +0 -4
  216. package/dist/shared/notification/types/toast-variant.d.ts +0 -4
  217. package/dist/shared/os/constants/index.d.ts +0 -4
  218. package/dist/shared/os/constants/platform.d.ts +0 -9
  219. package/dist/shared/os/index.d.ts +0 -5
  220. package/dist/shared/os/types/index.d.ts +0 -4
  221. package/dist/shared/os/types/platform.d.ts +0 -5
  222. package/dist/shared/recovery/constants/history.d.ts +0 -11
  223. package/dist/shared/recovery/constants/index.d.ts +0 -6
  224. package/dist/shared/recovery/constants/recovery-level.d.ts +0 -15
  225. package/dist/shared/recovery/constants/recovery.d.ts +0 -13
  226. package/dist/shared/recovery/index.d.ts +0 -6
  227. package/dist/shared/recovery/interfaces/error-context.d.ts +0 -11
  228. package/dist/shared/recovery/interfaces/index.d.ts +0 -5
  229. package/dist/shared/recovery/interfaces/recovery-record.d.ts +0 -10
  230. package/dist/shared/recovery/types/index.d.ts +0 -4
  231. package/dist/shared/recovery/types/recovery-action.d.ts +0 -4
  232. package/dist/shared/verification/constants/categories.d.ts +0 -95
  233. package/dist/shared/verification/constants/checklist.d.ts +0 -16
  234. package/dist/shared/verification/constants/index.d.ts +0 -7
  235. package/dist/shared/verification/constants/patterns.d.ts +0 -19
  236. package/dist/shared/verification/constants/signals.d.ts +0 -10
  237. package/dist/shared/verification/index.d.ts +0 -8
  238. package/dist/shared/verification/interfaces/checklist-item.d.ts +0 -21
  239. package/dist/shared/verification/interfaces/checklist-verification-result.d.ts +0 -24
  240. package/dist/shared/verification/interfaces/index.d.ts +0 -7
  241. package/dist/shared/verification/interfaces/verification-checklist.d.ts +0 -19
  242. package/dist/shared/verification/interfaces/verification-result.d.ts +0 -29
  243. package/dist/shared/verification/types/checklist-category.d.ts +0 -18
  244. package/dist/shared/verification/types/index.d.ts +0 -4
  245. package/dist/tools/parallel/show-metrics.d.ts +0 -10
  246. package/dist/tools/parallel/update-todo.d.ts +0 -7
  247. package/dist/utils/compatibility/claude.d.ts +0 -9
  248. package/dist/utils/formatting/elapsed-time.d.ts +0 -4
  249. package/dist/utils/formatting/index.d.ts +0 -5
  250. package/dist/utils/formatting/timestamp.d.ts +0 -4
  251. package/dist/utils/parsing/index.d.ts +0 -4
  252. package/dist/utils/parsing/slash-command.d.ts +0 -7
  253. package/dist/utils/sanity/checker.d.ts +0 -8
  254. package/dist/utils/sanity/constants/escalation-prompt.d.ts +0 -4
  255. package/dist/utils/sanity/constants/index.d.ts +0 -6
  256. package/dist/utils/sanity/constants/recovery-prompt.d.ts +0 -4
  257. package/dist/utils/sanity/constants/severity.d.ts +0 -8
  258. package/dist/utils/sanity/index.d.ts +0 -7
  259. package/dist/utils/sanity/interfaces/index.d.ts +0 -4
  260. package/dist/utils/sanity/interfaces/sanity-result.d.ts +0 -9
  261. package/dist/utils/sanity/types/index.d.ts +0 -4
  262. package/dist/utils/sanity/types/severity.d.ts +0 -5
  263. /package/dist/{core/agents/consts/task-status.const.d.ts → shared/task/constants/task-status.d.ts} +0 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Command Names
3
+ */
4
+ export declare const COMMAND_NAMES: {
5
+ readonly TASK: "task";
6
+ readonly PLAN: "plan";
7
+ readonly AGENTS: "agents";
8
+ };
@@ -3,3 +3,4 @@
3
3
  */
4
4
  export * from "./interfaces/index.js";
5
5
  export * from "./types/index.js";
6
+ export { COMMAND_NAMES } from "./constants/names.js";
@@ -4,9 +4,9 @@
4
4
  * Centralized storage for long prompt templates, user messages, and notifications.
5
5
  */
6
6
  export declare const MISSION_MESSAGES: {
7
- readonly START_LOG: "[mission-loop] Detected /task command. Starting mission...";
8
- readonly CANCEL_LOG: "[mission-loop] Detected user cancellation signal.";
9
- readonly COMPLETE_LOG: "[mission-loop] Mission Verified! Finishing loop.";
7
+ readonly START_LOG: "[MissionControl] Detected /task command. Starting mission...";
8
+ readonly CANCEL_LOG: "[MissionControl] Detected user cancellation signal.";
9
+ readonly COMPLETE_LOG: "[MissionControl] Mission Verified! Finishing loop.";
10
10
  readonly TOAST_COMPLETE_TITLE: "Mission Complete";
11
11
  readonly TOAST_COMPLETE_MESSAGE: "Mission verified and finished.";
12
12
  readonly STOP_TRIGGER: "STOP MISSION";
@@ -9,5 +9,9 @@ export { STATUS_LABEL, type TaskStatus } from "./status-labels.js";
9
9
  export { LIMITS } from "./limits.js";
10
10
  export { WAL_ACTIONS } from "./wal-actions.js";
11
11
  export { PHASES } from "./phases.js";
12
+ export * from "./signals.js";
13
+ export * from "./os.js";
14
+ export * from "./labels.js";
15
+ export * from "./mission.js";
12
16
  export { MEMORY_CONSTANTS, HOOK_NAMES, TODO_CONSTANTS, TUI_CONSTANTS } from "./memory-hooks.js";
13
17
  export * from "./cli.js";
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * Shared Module - Central Exports
3
+ * Streamlined for Unified Orchestrator Architecture
3
4
  */
4
5
  export * from "./agent/index.js";
5
6
  export * from "./core/index.js";
6
7
  export * from "./task/index.js";
7
- export * from "./loop/index.js";
8
- export * from "./notification/index.js";
9
- export * from "./recovery/index.js";
10
8
  export * from "./cache/index.js";
11
9
  export * from "./session/index.js";
12
10
  export * from "./command/index.js";
13
11
  export * from "./tool/index.js";
14
- export * from "./message/index.js";
15
- export * from "./os/index.js";
16
- export * from "./verification/index.js";
17
- export * from "./errors/index.js";
18
12
  export * from "./prompt/index.js";
19
- export { TASK_STATUS, TODO_STATUS } from "../core/agents/consts/task-status.const.js";
13
+ export { TASK_STATUS, TODO_STATUS } from "./task/constants/task-status.js";
14
+ export { SESSION_EVENTS } from "./session/index.js";
15
+ export { TOOL_NAMES } from "./tool/index.js";
16
+ export { AGENT_NAMES } from "./agent/index.js";
17
+ export { COMMAND_NAMES } from "./command/index.js";
18
+ export { PROMPT_TAGS } from "./prompt/index.js";
@@ -2,3 +2,4 @@
2
2
  * Prompt Domain
3
3
  */
4
4
  export * from "./constants/index.js";
5
+ export * from "./constants/prompts.js";
@@ -2,3 +2,5 @@
2
2
  * Session constants
3
3
  */
4
4
  export * from "./events/index.js";
5
+ export * from "./message.js";
6
+ export * from "./status.js";
@@ -2,3 +2,4 @@
2
2
  * Session Domain
3
3
  */
4
4
  export * from "./constants/index.js";
5
+ export * from "./constants/message.js";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * list_agents Tool
3
3
  *
4
- * Lists all available agents, including built-in and custom templates.
4
+ * Lists all available agents from the central definition registry.
5
5
  */
6
6
  export declare const createListAgentsTool: () => {
7
7
  description: string;
@@ -1,7 +1,5 @@
1
1
  /**
2
- * Common Utils - Index
3
- *
4
- * Re-exports for backward compatibility.
2
+ * Common Utilities
5
3
  */
6
- export { detectSlashCommand } from "./parsing/index.js";
7
- export { formatTimestamp, formatElapsedTime } from "./formatting/index.js";
4
+ export declare function sleep(ms: number): Promise<void>;
5
+ export declare function safeJsonParse<T>(text: string, fallback: T): T;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "1.2.32",
5
+ "version": "1.2.34",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -70,8 +70,8 @@
70
70
  "node": ">=24"
71
71
  },
72
72
  "dependencies": {
73
- "@opencode-ai/plugin": "^1.1.35",
74
- "@opencode-ai/sdk": "^1.1.35",
73
+ "@opencode-ai/plugin": "^1.1.36",
74
+ "@opencode-ai/sdk": "^1.1.36",
75
75
  "zod": "^4.3.6"
76
76
  },
77
77
  "devDependencies": {
@@ -1,28 +0,0 @@
1
- /**
2
- * Agent Registry - Manages built-in and custom agent definitions
3
- */
4
- import type { AgentDefinition } from "../../shared/agent/interfaces/index.js";
5
- export declare class AgentRegistry {
6
- private static instance;
7
- private agents;
8
- private directory;
9
- private constructor();
10
- static getInstance(): AgentRegistry;
11
- setDirectory(dir: string): void;
12
- /**
13
- * Get agent definition by name
14
- */
15
- getAgent(name: string): AgentDefinition | undefined;
16
- /**
17
- * List all available agent names
18
- */
19
- listAgents(): string[];
20
- /**
21
- * Add or update an agent definition
22
- */
23
- registerAgent(name: string, def: AgentDefinition): void;
24
- /**
25
- * Load custom agents from .opencode/agents.json
26
- */
27
- private loadCustomAgents;
28
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Concurrency Controller
3
- *
4
- * Queue-based rate limiting with support for:
5
- * - Agent-specific limits
6
- * - Provider-specific limits (e.g., anthropic/*, openai/*)
7
- * - Model-specific limits (e.g., anthropic/claude-3-5-sonnet)
8
- */
9
- import type { ConcurrencyConfig } from "./interfaces/concurrency-config.interface.js";
10
- export type { ConcurrencyConfig } from "./interfaces/concurrency-config.interface.js";
11
- export declare class ConcurrencyController {
12
- private counts;
13
- private queues;
14
- private limits;
15
- private config;
16
- private successStreak;
17
- private failureCount;
18
- constructor(config?: ConcurrencyConfig);
19
- setLimit(key: string, limit: number): void;
20
- /**
21
- * Get concurrency limit for a key.
22
- * Priority: explicit limit > model > provider > agent > default
23
- */
24
- getConcurrencyLimit(key: string): number;
25
- getLimit(key: string): number;
26
- acquire(key: string): Promise<void>;
27
- release(key: string): void;
28
- /**
29
- * Report success/failure (for metrics only - auto-scaling DISABLED)
30
- *
31
- * Auto-scaling has been removed for stability. Concurrency is now fixed at 5.
32
- * This method is kept for backwards compatibility and metrics tracking.
33
- */
34
- reportResult(key: string, success: boolean): void;
35
- getQueueLength(key: string): number;
36
- getActiveCount(key: string): number;
37
- /**
38
- * Get formatted concurrency info string (e.g., "2/5 slots")
39
- */
40
- getConcurrencyInfo(key: string): string;
41
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * Parallel Manager Configuration
3
- */
4
- export declare const CONFIG: {
5
- readonly TASK_TTL_MS: number;
6
- readonly CLEANUP_DELAY_MS: number;
7
- readonly MIN_STABILITY_MS: number;
8
- readonly POLL_INTERVAL_MS: 3000;
9
- readonly STABLE_POLLS_REQUIRED: 2;
10
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * Agents Consts Index
3
- */
4
- export { TASK_STATUS } from "./task-status.const.js";
@@ -1,35 +0,0 @@
1
- /**
2
- * Event Handler - Handles OpenCode session events
3
- */
4
- import type { PluginInput } from "@opencode-ai/plugin";
5
- import { TaskStore } from "../task-store.js";
6
- import { ConcurrencyController } from "../concurrency.js";
7
- import type { ParallelTask } from "../interfaces/parallel-task.interface.js";
8
- type OpencodeClient = PluginInput["client"];
9
- export declare class EventHandler {
10
- private client;
11
- private store;
12
- private concurrency;
13
- private findBySession;
14
- private notifyParentIfAllComplete;
15
- private scheduleCleanup;
16
- private validateSessionHasOutput;
17
- private onTaskComplete?;
18
- constructor(client: OpencodeClient, store: TaskStore, concurrency: ConcurrencyController, findBySession: (sessionID: string) => ParallelTask | undefined, notifyParentIfAllComplete: (parentSessionID: string) => Promise<void>, scheduleCleanup: (taskId: string) => void, validateSessionHasOutput: (sessionID: string) => Promise<boolean>, onTaskComplete?: ((task: ParallelTask) => void | Promise<void>) | undefined);
19
- /**
20
- * Handle OpenCode session events for proper resource cleanup.
21
- * Call this from your plugin's event hook.
22
- */
23
- handle(event: {
24
- type: string;
25
- properties?: {
26
- sessionID?: string;
27
- info?: {
28
- id?: string;
29
- };
30
- };
31
- }): void;
32
- private handleSessionIdle;
33
- private handleSessionDeleted;
34
- }
35
- export {};
@@ -1,10 +0,0 @@
1
- /**
2
- * Manager Module Index
3
- *
4
- * Re-exports all manager components
5
- */
6
- export { TaskLauncher } from "./task-launcher.js";
7
- export { TaskResumer } from "./task-resumer.js";
8
- export { TaskPoller } from "./task-poller.js";
9
- export { TaskCleaner } from "./task-cleaner.js";
10
- export { EventHandler } from "./event-handler.js";
@@ -1,29 +0,0 @@
1
- /**
2
- * Task Cleaner - Handles cleanup, expiration, and notifications for tasks
3
- *
4
- * noReply Strategy:
5
- * - Individual task completion: noReply=true (save tokens)
6
- * - All tasks complete: noReply=false (let AI process results)
7
- */
8
- import type { PluginInput } from "@opencode-ai/plugin";
9
- import { TaskStore } from "../task-store.js";
10
- import { ConcurrencyController } from "../concurrency.js";
11
- import { SessionPool } from "../session-pool.js";
12
- type OpencodeClient = PluginInput["client"];
13
- export declare class TaskCleaner {
14
- private client;
15
- private store;
16
- private concurrency;
17
- private sessionPool;
18
- constructor(client: OpencodeClient, store: TaskStore, concurrency: ConcurrencyController, sessionPool: SessionPool);
19
- pruneExpiredTasks(): void;
20
- scheduleCleanup(taskId: string): void;
21
- /**
22
- * Notify parent session when task(s) complete.
23
- * Uses noReply strategy:
24
- * - Individual completion: noReply=true (silent notification, save tokens)
25
- * - All complete: noReply=false (AI should process and report results)
26
- */
27
- notifyParentIfAllComplete(parentSessionID: string): Promise<void>;
28
- }
29
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * Task Launcher - Handles launching new parallel tasks
3
- */
4
- import type { PluginInput } from "@opencode-ai/plugin";
5
- import { ConcurrencyController } from "../concurrency.js";
6
- import { TaskStore } from "../task-store.js";
7
- import type { ParallelTask } from "../interfaces/parallel-task.interface.js";
8
- import type { LaunchInput } from "../interfaces/launch-input.interface.js";
9
- import { SessionPool } from "../session-pool.js";
10
- type OpencodeClient = PluginInput["client"];
11
- export declare class TaskLauncher {
12
- private client;
13
- private directory;
14
- private store;
15
- private concurrency;
16
- private sessionPool;
17
- private onTaskError;
18
- private startPolling;
19
- constructor(client: OpencodeClient, directory: string, store: TaskStore, concurrency: ConcurrencyController, sessionPool: SessionPool, onTaskError: (taskId: string, error: unknown) => void, startPolling: () => void);
20
- /**
21
- * Unified launch method - handles both single and multiple tasks efficiently.
22
- * All session creations happen in parallel immediately.
23
- * Concurrency acquisition and prompt firing happen in the background.
24
- */
25
- launch(inputs: LaunchInput | LaunchInput[]): Promise<ParallelTask | ParallelTask[]>;
26
- /**
27
- * Prepare task: Create session and registration without blocking on concurrency
28
- */
29
- private prepareTask;
30
- /**
31
- * Background execution: Acquire slot and fire prompt with auto-retry
32
- */
33
- private executeBackground;
34
- }
35
- export {};
@@ -1,30 +0,0 @@
1
- /**
2
- * Task Poller - Handles polling and completion detection for running tasks
3
- */
4
- import type { PluginInput } from "@opencode-ai/plugin";
5
- import { TaskStore } from "../task-store.js";
6
- import { ConcurrencyController } from "../concurrency.js";
7
- import type { ParallelTask } from "../interfaces/parallel-task.interface.js";
8
- type OpencodeClient = PluginInput["client"];
9
- export declare class TaskPoller {
10
- private client;
11
- private store;
12
- private concurrency;
13
- private notifyParentIfAllComplete;
14
- private scheduleCleanup;
15
- private pruneExpiredTasks;
16
- private onTaskComplete?;
17
- private onTaskError?;
18
- private pollTimeout?;
19
- private messageCache;
20
- constructor(client: OpencodeClient, store: TaskStore, concurrency: ConcurrencyController, notifyParentIfAllComplete: (parentSessionID: string) => Promise<void>, scheduleCleanup: (taskId: string) => void, pruneExpiredTasks: () => void, onTaskComplete?: ((task: ParallelTask) => void | Promise<void>) | undefined, onTaskError?: ((taskId: string, error: unknown) => void) | undefined);
21
- start(): void;
22
- stop(): void;
23
- isRunning(): boolean;
24
- private scheduleNextPoll;
25
- poll(): Promise<void>;
26
- validateSessionHasOutput(sessionID: string, task?: ParallelTask): Promise<boolean>;
27
- completeTask(task: ParallelTask): Promise<void>;
28
- private updateTaskProgress;
29
- }
30
- export {};
@@ -1,18 +0,0 @@
1
- /**
2
- * Task Resumer - Handles resuming existing parallel task sessions
3
- */
4
- import type { PluginInput } from "@opencode-ai/plugin";
5
- import { TaskStore } from "../task-store.js";
6
- import type { ParallelTask } from "../interfaces/parallel-task.interface.js";
7
- import type { ResumeInput } from "../interfaces/resume-input.interface.js";
8
- type OpencodeClient = PluginInput["client"];
9
- export declare class TaskResumer {
10
- private client;
11
- private store;
12
- private findBySession;
13
- private startPolling;
14
- private notifyParentIfAllComplete;
15
- constructor(client: OpencodeClient, store: TaskStore, findBySession: (sessionID: string) => ParallelTask | undefined, startPolling: () => void, notifyParentIfAllComplete: (parentSessionID: string) => Promise<void>);
16
- resume(input: ResumeInput): Promise<ParallelTask>;
17
- }
18
- export {};
@@ -1,26 +0,0 @@
1
- /**
2
- * Task WAL (Write-Ahead Log)
3
- *
4
- * Handles append-only logging of task state transitions for crash recovery.
5
- */
6
- import { WAL_ACTIONS } from "../../../shared/index.js";
7
- import type { ParallelTask } from "../interfaces/parallel-task.interface.js";
8
- export interface WALEntry {
9
- timestamp: string;
10
- action: keyof typeof WAL_ACTIONS;
11
- taskId: string;
12
- data: Partial<ParallelTask>;
13
- }
14
- export declare class TaskWAL {
15
- private walPath;
16
- private initialized;
17
- constructor(customPath?: string);
18
- init(): Promise<void>;
19
- log(action: WALEntry["action"], task: ParallelTask): Promise<void>;
20
- readAll(): Promise<Map<string, ParallelTask>>;
21
- /**
22
- * Compact the WAL by writing only the current active tasks
23
- */
24
- compact(activeTasks: ParallelTask[]): Promise<void>;
25
- }
26
- export declare const taskWAL: TaskWAL;
@@ -1,54 +0,0 @@
1
- /**
2
- * Task Store - Stores and manages parallel tasks
3
- *
4
- * Features:
5
- * - Automatic garbage collection
6
- * - Memory-safe storage with limits
7
- * - Completed task archiving
8
- */
9
- import type { ParallelTask } from "./interfaces/parallel-task.interface.js";
10
- export declare class TaskStore {
11
- private tasks;
12
- private pendingByParent;
13
- private notifications;
14
- private archivedCount;
15
- set(id: string, task: ParallelTask): void;
16
- get(id: string): ParallelTask | undefined;
17
- getAll(): ParallelTask[];
18
- getRunning(): ParallelTask[];
19
- getByParent(parentSessionID: string): ParallelTask[];
20
- delete(id: string): boolean;
21
- clear(): void;
22
- trackPending(parentSessionID: string, taskId: string): void;
23
- untrackPending(parentSessionID: string, taskId: string): void;
24
- getPendingCount(parentSessionID: string): number;
25
- hasPending(parentSessionID: string): boolean;
26
- queueNotification(task: ParallelTask): void;
27
- getNotifications(parentSessionID: string): ParallelTask[];
28
- clearNotifications(parentSessionID: string): void;
29
- cleanEmptyNotifications(): void;
30
- clearNotificationsForTask(taskId: string): void;
31
- /**
32
- * Get memory statistics
33
- */
34
- getStats(): {
35
- tasksInMemory: number;
36
- runningTasks: number;
37
- archivedTasks: number;
38
- notificationQueues: number;
39
- pendingParents: number;
40
- };
41
- /**
42
- * Garbage collect completed tasks
43
- * Archives old completed tasks to disk
44
- */
45
- gc(): Promise<number>;
46
- /**
47
- * Archive tasks to disk for later analysis
48
- */
49
- private archiveTasks;
50
- /**
51
- * Force cleanup of all completed tasks
52
- */
53
- forceCleanup(): number;
54
- }
@@ -1,11 +0,0 @@
1
- export declare class CleanupScheduler {
2
- private intervals;
3
- private directory;
4
- constructor(directory: string);
5
- start(): void;
6
- private schedule;
7
- stop(): void;
8
- compactWAL(): Promise<void>;
9
- cleanDocs(): Promise<void>;
10
- rotateHistory(): Promise<void>;
11
- }
@@ -1,66 +0,0 @@
1
- /**
2
- * Context Window Monitor
3
- *
4
- * Monitors context window usage and alerts when thresholds are exceeded.
5
- *
6
- * Thresholds:
7
- * - 70%: Info alert - "Still plenty of headroom"
8
- * - 85%: Warning - Consider compaction
9
- * - 95%: Critical - Immediate action needed
10
- */
11
- export declare const CONTEXT_THRESHOLDS: {
12
- /** Info level - remind agent there's still room */
13
- readonly INFO: 0.7;
14
- /** Warning level - consider compaction soon */
15
- readonly WARNING: 0.85;
16
- /** Critical level - immediate action needed */
17
- readonly CRITICAL: 0.95;
18
- };
19
- export declare const CONTEXT_MONITOR_CONFIG: {
20
- /** Default max tokens for most models */
21
- readonly DEFAULT_MAX_TOKENS: 200000;
22
- /** Check interval in milliseconds */
23
- readonly CHECK_INTERVAL_MS: 30000;
24
- /** Minimum time between alerts (ms) */
25
- readonly ALERT_COOLDOWN_MS: 60000;
26
- };
27
- export interface MonitorState {
28
- lastAlertTime: number;
29
- lastAlertLevel: "info" | "warning" | "critical" | null;
30
- isMonitoring: boolean;
31
- intervalId?: ReturnType<typeof setInterval>;
32
- }
33
- export declare function getMonitorState(sessionID: string): MonitorState;
34
- /**
35
- * Calculate context usage percentage
36
- */
37
- export declare function calculateUsage(usedTokens: number, maxTokens: number): number;
38
- /**
39
- * Get alert level based on usage
40
- */
41
- export declare function getAlertLevel(usage: number): "info" | "warning" | "critical" | null;
42
- /**
43
- * Format usage for display
44
- */
45
- export declare function formatUsage(usage: number, usedTokens: number, maxTokens: number): string;
46
- /**
47
- * Check context window usage and alert if needed
48
- */
49
- export declare function checkContextWindow(sessionID: string, usedTokens: number, maxTokens?: number): void;
50
- /**
51
- * Get injection prompt for context-aware agents
52
- * This reminds agents about context status when usage is high
53
- */
54
- export declare function getContextInjection(usedTokens: number, maxTokens?: number): string | null;
55
- /**
56
- * Cleanup session state
57
- */
58
- export declare function cleanupSession(sessionID: string): void;
59
- /**
60
- * Get current monitor status for debugging
61
- */
62
- export declare function getMonitorStatus(sessionID: string): {
63
- lastAlertTime: number;
64
- lastAlertLevel: string | null;
65
- isMonitoring: boolean;
66
- } | null;
@@ -1,6 +0,0 @@
1
- /**
2
- * Context Module
3
- *
4
- * Context window monitoring and management utilities.
5
- */
6
- export { checkContextWindow, getContextInjection, cleanupSession, getMonitorStatus, calculateUsage, getAlertLevel, formatUsage, CONTEXT_THRESHOLDS, CONTEXT_MONITOR_CONFIG, } from "./context-window-monitor.js";
@@ -1,57 +0,0 @@
1
- /**
2
- * Continuation Lock - Ensures single execution of continuation logic
3
- *
4
- * Prevents simultaneous execution of Mission Loop and Todo Continuation systems.
5
- * This resolves infinite loading issues caused by duplicate prompt injections.
6
- *
7
- * @example
8
- * if (!tryAcquireContinuationLock(sessionID)) {
9
- * return; // Another system is already processing
10
- * }
11
- * try {
12
- * // continuation logic
13
- * } finally {
14
- * releaseContinuationLock(sessionID);
15
- * }
16
- */
17
- interface ContinuationLockState {
18
- acquired: boolean;
19
- timestamp: number;
20
- source?: string;
21
- }
22
- /**
23
- * Try to acquire the continuation lock
24
- *
25
- * @param sessionID - Session ID
26
- * @param source - Source requesting the lock (for debugging)
27
- * @returns true if acquired, false otherwise
28
- */
29
- export declare function tryAcquireContinuationLock(sessionID: string, source?: string): boolean;
30
- /**
31
- * Release the continuation lock
32
- *
33
- * @param sessionID - Session ID
34
- */
35
- export declare function releaseContinuationLock(sessionID: string): void;
36
- /**
37
- * Check if the lock is currently active
38
- *
39
- * @param sessionID - Session ID
40
- * @returns true if lock is held
41
- */
42
- export declare function hasContinuationLock(sessionID: string): boolean;
43
- /**
44
- * Cleanup lock when session is cleaned up
45
- *
46
- * @param sessionID - Session ID
47
- */
48
- export declare function cleanupContinuationLock(sessionID: string): void;
49
- /**
50
- * Clear all locks (for testing)
51
- */
52
- export declare function clearAllLocks(): void;
53
- /**
54
- * Get lock status (for debugging)
55
- */
56
- export declare function getLockStatus(sessionID: string): ContinuationLockState | undefined;
57
- export {};
@@ -1,17 +0,0 @@
1
- /**
2
- * Todo Formatters - Format output strings
3
- */
4
- import type { Todo } from "./interfaces.js";
5
- /**
6
- * Format progress string
7
- */
8
- export declare function formatProgress(todos: Todo[]): string;
9
- /**
10
- * Generate continuation prompt when todos remain
11
- * Enforces parallel dispatch when multiple independent tasks exist
12
- */
13
- export declare function generateContinuationPrompt(todos: Todo[]): string;
14
- /**
15
- * Generate completion message
16
- */
17
- export declare function generateCompletionMessage(todos: Todo[]): string;
@@ -1,5 +0,0 @@
1
- /**
2
- * Loop Interfaces - Index
3
- */
4
- export type { Todo } from "./todo.js";
5
- export type { TodoStats } from "./todo-stats.js";
@@ -1,11 +0,0 @@
1
- /**
2
- * Todo Stats Interface
3
- */
4
- export interface TodoStats {
5
- total: number;
6
- pending: number;
7
- inProgress: number;
8
- completed: number;
9
- cancelled: number;
10
- percentComplete: number;
11
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Todo Interface
3
- */
4
- import type { TodoStatus, TodoPriority } from "../types/index.js";
5
- export interface Todo {
6
- id: string;
7
- content: string;
8
- status: TodoStatus;
9
- priority: TodoPriority;
10
- parentId?: string;
11
- createdAt: Date;
12
- completedAt?: Date;
13
- }