opencode-orchestrator 1.2.21 → 1.2.23

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 (271) 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/core/mission/mission-controller.d.ts +53 -0
  9. package/dist/core/resource/resource-tracker.d.ts +61 -0
  10. package/dist/index.d.ts +0 -8
  11. package/dist/index.js +6533 -27677
  12. package/dist/shared/constants/system-messages.d.ts +3 -3
  13. package/dist/shared/core/constants/index.d.ts +4 -0
  14. package/dist/shared/core/constants/labels.d.ts +12 -0
  15. package/dist/shared/core/constants/mission.d.ts +8 -0
  16. package/dist/shared/{os/constants/platform.d.ts → core/constants/os.d.ts} +4 -3
  17. package/dist/shared/core/constants/signals.d.ts +22 -0
  18. package/dist/shared/index.d.ts +6 -8
  19. package/dist/shared/prompt/constants/prompts.d.ts +7 -0
  20. package/dist/shared/prompt/constants/tags.d.ts +4 -0
  21. package/dist/shared/prompt/index.d.ts +1 -0
  22. package/dist/shared/session/constants/index.d.ts +2 -0
  23. package/dist/shared/session/constants/message.d.ts +15 -0
  24. package/dist/shared/session/constants/status.d.ts +9 -0
  25. package/dist/shared/session/index.d.ts +1 -0
  26. package/dist/tools/parallel/list-agents.d.ts +1 -1
  27. package/dist/utils/common.d.ts +3 -5
  28. package/package.json +3 -3
  29. package/dist/core/agents/agent-registry.d.ts +0 -28
  30. package/dist/core/agents/concurrency.d.ts +0 -41
  31. package/dist/core/agents/config.d.ts +0 -10
  32. package/dist/core/agents/consts/index.d.ts +0 -4
  33. package/dist/core/agents/manager/event-handler.d.ts +0 -35
  34. package/dist/core/agents/manager/index.d.ts +0 -10
  35. package/dist/core/agents/manager/task-cleaner.d.ts +0 -29
  36. package/dist/core/agents/manager/task-launcher.d.ts +0 -35
  37. package/dist/core/agents/manager/task-poller.d.ts +0 -30
  38. package/dist/core/agents/manager/task-resumer.d.ts +0 -18
  39. package/dist/core/agents/persistence/task-wal.d.ts +0 -26
  40. package/dist/core/agents/task-store.d.ts +0 -54
  41. package/dist/core/cleanup/cleanup-scheduler.d.ts +0 -11
  42. package/dist/core/context/context-window-monitor.d.ts +0 -66
  43. package/dist/core/context/index.d.ts +0 -6
  44. package/dist/core/loop/continuation-lock.d.ts +0 -57
  45. package/dist/core/loop/formatters.d.ts +0 -17
  46. package/dist/core/loop/interfaces/index.d.ts +0 -5
  47. package/dist/core/loop/interfaces/todo-stats.d.ts +0 -11
  48. package/dist/core/loop/interfaces/todo.d.ts +0 -13
  49. package/dist/core/loop/interfaces.d.ts +0 -7
  50. package/dist/core/loop/mission-loop-handler.d.ts +0 -25
  51. package/dist/core/loop/mission-loop.d.ts +0 -48
  52. package/dist/core/loop/parser.d.ts +0 -8
  53. package/dist/core/loop/stats.d.ts +0 -24
  54. package/dist/core/loop/todo-continuation.d.ts +0 -39
  55. package/dist/core/loop/todo-enforcer.d.ts +0 -9
  56. package/dist/core/loop/todo-manager.d.ts +0 -22
  57. package/dist/core/loop/types/index.d.ts +0 -5
  58. package/dist/core/loop/types/todo-priority.d.ts +0 -4
  59. package/dist/core/loop/types/todo-status.d.ts +0 -4
  60. package/dist/core/loop/verification.d.ts +0 -27
  61. package/dist/core/memory/interfaces.d.ts +0 -33
  62. package/dist/core/memory/memory-manager.d.ts +0 -40
  63. package/dist/core/metrics/collector.d.ts +0 -27
  64. package/dist/core/notification/os-notify/index.d.ts +0 -7
  65. package/dist/core/notification/os-notify/notifier.d.ts +0 -7
  66. package/dist/core/notification/os-notify/platform-resolver.d.ts +0 -7
  67. package/dist/core/notification/os-notify/platform.d.ts +0 -7
  68. package/dist/core/notification/os-notify/sound-player.d.ts +0 -7
  69. package/dist/core/notification/os-notify/todo-checker.d.ts +0 -5
  70. package/dist/core/notification/task-toast-manager.d.ts +0 -127
  71. package/dist/core/notification/toast-core.d.ts +0 -36
  72. package/dist/core/notification/toast.d.ts +0 -9
  73. package/dist/core/orchestrator/index.d.ts +0 -6
  74. package/dist/core/orchestrator/interfaces/index.d.ts +0 -4
  75. package/dist/core/orchestrator/interfaces/session-state.d.ts +0 -11
  76. package/dist/core/orchestrator/session-manager.d.ts +0 -31
  77. package/dist/core/orchestrator/state.d.ts +0 -10
  78. package/dist/core/orchestrator/types/index.d.ts +0 -4
  79. package/dist/core/orchestrator/types/task-status.d.ts +0 -5
  80. package/dist/core/plugins/interfaces.d.ts +0 -30
  81. package/dist/core/plugins/plugin-manager.d.ts +0 -21
  82. package/dist/core/progress/calculator.d.ts +0 -11
  83. package/dist/core/progress/formatters.d.ts +0 -20
  84. package/dist/core/progress/interfaces/index.d.ts +0 -8
  85. package/dist/core/progress/interfaces/progress-snapshot.d.ts +0 -15
  86. package/dist/core/progress/interfaces/snapshot-input.d.ts +0 -13
  87. package/dist/core/progress/interfaces/step-progress.d.ts +0 -7
  88. package/dist/core/progress/interfaces/task-progress.d.ts +0 -10
  89. package/dist/core/progress/interfaces/todo-progress.d.ts +0 -9
  90. package/dist/core/progress/interfaces.d.ts +0 -6
  91. package/dist/core/progress/progress-notifier.d.ts +0 -14
  92. package/dist/core/progress/state-broadcaster.d.ts +0 -29
  93. package/dist/core/progress/store.d.ts +0 -28
  94. package/dist/core/progress/tracker.d.ts +0 -11
  95. package/dist/core/queue/async-queue.d.ts +0 -46
  96. package/dist/core/queue/async-utils.d.ts +0 -20
  97. package/dist/core/queue/index.d.ts +0 -8
  98. package/dist/core/queue/work-pool.d.ts +0 -19
  99. package/dist/core/recovery/auto-recovery.d.ts +0 -9
  100. package/dist/core/recovery/constants.d.ts +0 -9
  101. package/dist/core/recovery/handler.d.ts +0 -27
  102. package/dist/core/recovery/interfaces/error-context.d.ts +0 -11
  103. package/dist/core/recovery/interfaces/error-pattern.d.ts +0 -10
  104. package/dist/core/recovery/interfaces/index.d.ts +0 -8
  105. package/dist/core/recovery/interfaces/recovery-action.d.ts +0 -25
  106. package/dist/core/recovery/interfaces/recovery-record.d.ts +0 -10
  107. package/dist/core/recovery/interfaces/recovery-stats.d.ts +0 -9
  108. package/dist/core/recovery/interfaces.d.ts +0 -6
  109. package/dist/core/recovery/patterns.d.ts +0 -8
  110. package/dist/core/recovery/retry.d.ts +0 -59
  111. package/dist/core/recovery/session-recovery.d.ts +0 -30
  112. package/dist/core/session/interfaces/context-stats.d.ts +0 -9
  113. package/dist/core/session/interfaces/index.d.ts +0 -8
  114. package/dist/core/session/interfaces/shared-context.d.ts +0 -15
  115. package/dist/core/session/interfaces/shared-decision.d.ts +0 -10
  116. package/dist/core/session/interfaces/shared-document.d.ts +0 -9
  117. package/dist/core/session/interfaces/shared-finding.d.ts +0 -10
  118. package/dist/core/session/interfaces.d.ts +0 -6
  119. package/dist/core/session/session-health.d.ts +0 -93
  120. package/dist/core/session/shared-context.d.ts +0 -8
  121. package/dist/core/session/store.d.ts +0 -44
  122. package/dist/core/session/summary.d.ts +0 -7
  123. package/dist/core/sync/todo-parser.d.ts +0 -5
  124. package/dist/core/sync/todo-sync-service.d.ts +0 -42
  125. package/dist/core/task/interfaces/index.d.ts +0 -8
  126. package/dist/core/task/interfaces/task-hierarchy.d.ts +0 -9
  127. package/dist/core/task/interfaces/task-input.d.ts +0 -11
  128. package/dist/core/task/interfaces/task-node.d.ts +0 -20
  129. package/dist/core/task/interfaces/task-progress.d.ts +0 -11
  130. package/dist/core/task/interfaces.d.ts +0 -6
  131. package/dist/core/task/parser.d.ts +0 -8
  132. package/dist/core/task/scheduler.d.ts +0 -12
  133. package/dist/core/task/store.d.ts +0 -32
  134. package/dist/core/task/summary.d.ts +0 -7
  135. package/dist/core/task/task-decomposer.d.ts +0 -10
  136. package/dist/core/todo/todo-manager.d.ts +0 -36
  137. package/dist/hooks/compatibility/external-plugin.d.ts +0 -10
  138. package/dist/hooks/constants.d.ts +0 -27
  139. package/dist/hooks/custom/agent-ui.d.ts +0 -20
  140. package/dist/hooks/custom/memory-gate.d.ts +0 -21
  141. package/dist/hooks/custom/metrics.d.ts +0 -14
  142. package/dist/hooks/custom/resource-control.d.ts +0 -13
  143. package/dist/hooks/custom/secret-scanner.d.ts +0 -19
  144. package/dist/hooks/custom/strict-role-guard.d.ts +0 -21
  145. package/dist/hooks/custom/user-activity.d.ts +0 -11
  146. package/dist/hooks/features/mission-loop.d.ts +0 -18
  147. package/dist/hooks/features/sanity-check.d.ts +0 -15
  148. package/dist/hooks/index.d.ts +0 -5
  149. package/dist/hooks/registry.d.ts +0 -37
  150. package/dist/hooks/types.d.ts +0 -72
  151. package/dist/plugin-handlers/assistant-done-handler.d.ts +0 -12
  152. package/dist/plugin-handlers/chat-message-handler.d.ts +0 -30
  153. package/dist/plugin-handlers/config-handler.d.ts +0 -9
  154. package/dist/plugin-handlers/event-handler.d.ts +0 -18
  155. package/dist/plugin-handlers/index.d.ts +0 -9
  156. package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +0 -12
  157. package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +0 -12
  158. package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +0 -14
  159. package/dist/plugin-handlers/interfaces/index.d.ts +0 -12
  160. package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +0 -14
  161. package/dist/plugin-handlers/interfaces/session-compacting.d.ts +0 -19
  162. package/dist/plugin-handlers/interfaces/session-state.d.ts +0 -15
  163. package/dist/plugin-handlers/interfaces/system-transform.d.ts +0 -17
  164. package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +0 -8
  165. package/dist/plugin-handlers/interfaces/tool-hook.d.ts +0 -14
  166. package/dist/plugin-handlers/session-compacting-handler.d.ts +0 -14
  167. package/dist/plugin-handlers/system-transform-handler.d.ts +0 -14
  168. package/dist/plugin-handlers/tool-execute-handler.d.ts +0 -14
  169. package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +0 -8
  170. package/dist/shared/errors/constants/error-patterns.d.ts +0 -13
  171. package/dist/shared/errors/constants/error-type.d.ts +0 -13
  172. package/dist/shared/errors/constants/index.d.ts +0 -5
  173. package/dist/shared/errors/detection.d.ts +0 -5
  174. package/dist/shared/errors/index.d.ts +0 -7
  175. package/dist/shared/errors/retry.d.ts +0 -7
  176. package/dist/shared/errors/types/error-pattern-type.d.ts +0 -5
  177. package/dist/shared/errors/types/index.d.ts +0 -4
  178. package/dist/shared/loop/constants/index.d.ts +0 -7
  179. package/dist/shared/loop/constants/labels.d.ts +0 -33
  180. package/dist/shared/loop/constants/loop.d.ts +0 -17
  181. package/dist/shared/loop/constants/mission-control.d.ts +0 -20
  182. package/dist/shared/loop/constants/todo-status.d.ts +0 -9
  183. package/dist/shared/loop/index.d.ts +0 -6
  184. package/dist/shared/loop/interfaces/index.d.ts +0 -6
  185. package/dist/shared/loop/interfaces/mission-loop.d.ts +0 -29
  186. package/dist/shared/loop/interfaces/todo-stats.d.ts +0 -11
  187. package/dist/shared/loop/interfaces/todo.d.ts +0 -13
  188. package/dist/shared/loop/types/index.d.ts +0 -5
  189. package/dist/shared/loop/types/todo-priority.d.ts +0 -4
  190. package/dist/shared/loop/types/todo-status.d.ts +0 -4
  191. package/dist/shared/message/constants/index.d.ts +0 -8
  192. package/dist/shared/message/constants/message-roles.d.ts +0 -23
  193. package/dist/shared/message/constants/part-types.d.ts +0 -13
  194. package/dist/shared/message/constants/plugin-hooks.d.ts +0 -15
  195. package/dist/shared/message/constants/prompts.d.ts +0 -8
  196. package/dist/shared/message/constants/slash-commands.d.ts +0 -21
  197. package/dist/shared/message/index.d.ts +0 -4
  198. package/dist/shared/notification/constants/index.d.ts +0 -3
  199. package/dist/shared/notification/constants/toast-duration.d.ts +0 -19
  200. package/dist/shared/notification/constants/toast-variants.d.ts +0 -10
  201. package/dist/shared/notification/constants/tui.const.d.ts +0 -24
  202. package/dist/shared/notification/index.d.ts +0 -7
  203. package/dist/shared/notification/interfaces/index.d.ts +0 -6
  204. package/dist/shared/notification/interfaces/task-toast.interface.d.ts +0 -18
  205. package/dist/shared/notification/interfaces/toast-message.d.ts +0 -13
  206. package/dist/shared/notification/interfaces/toast-options.d.ts +0 -10
  207. package/dist/shared/notification/os-notify/constants/index.d.ts +0 -6
  208. package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +0 -11
  209. package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +0 -11
  210. package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +0 -5
  211. package/dist/shared/notification/os-notify/index.d.ts +0 -6
  212. package/dist/shared/notification/os-notify/interfaces/index.d.ts +0 -5
  213. package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +0 -15
  214. package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +0 -13
  215. package/dist/shared/notification/os-notify/types/index.d.ts +0 -4
  216. package/dist/shared/notification/os-notify/types/notification-commands.d.ts +0 -5
  217. package/dist/shared/notification/presets/index.d.ts +0 -9
  218. package/dist/shared/notification/presets/mission.d.ts +0 -5
  219. package/dist/shared/notification/presets/parallel.d.ts +0 -6
  220. package/dist/shared/notification/presets/session.d.ts +0 -6
  221. package/dist/shared/notification/presets/task-lifecycle.d.ts +0 -7
  222. package/dist/shared/notification/presets/tools.d.ts +0 -6
  223. package/dist/shared/notification/presets/warnings.d.ts +0 -7
  224. package/dist/shared/notification/types/index.d.ts +0 -4
  225. package/dist/shared/notification/types/toast-variant.d.ts +0 -4
  226. package/dist/shared/os/constants/index.d.ts +0 -4
  227. package/dist/shared/os/index.d.ts +0 -5
  228. package/dist/shared/os/types/index.d.ts +0 -4
  229. package/dist/shared/os/types/platform.d.ts +0 -5
  230. package/dist/shared/recovery/constants/history.d.ts +0 -11
  231. package/dist/shared/recovery/constants/index.d.ts +0 -6
  232. package/dist/shared/recovery/constants/recovery-level.d.ts +0 -15
  233. package/dist/shared/recovery/constants/recovery.d.ts +0 -13
  234. package/dist/shared/recovery/index.d.ts +0 -6
  235. package/dist/shared/recovery/interfaces/error-context.d.ts +0 -11
  236. package/dist/shared/recovery/interfaces/index.d.ts +0 -5
  237. package/dist/shared/recovery/interfaces/recovery-record.d.ts +0 -10
  238. package/dist/shared/recovery/types/index.d.ts +0 -4
  239. package/dist/shared/recovery/types/recovery-action.d.ts +0 -4
  240. package/dist/shared/verification/constants/categories.d.ts +0 -95
  241. package/dist/shared/verification/constants/checklist.d.ts +0 -16
  242. package/dist/shared/verification/constants/index.d.ts +0 -7
  243. package/dist/shared/verification/constants/patterns.d.ts +0 -19
  244. package/dist/shared/verification/constants/signals.d.ts +0 -10
  245. package/dist/shared/verification/index.d.ts +0 -8
  246. package/dist/shared/verification/interfaces/checklist-item.d.ts +0 -21
  247. package/dist/shared/verification/interfaces/checklist-verification-result.d.ts +0 -24
  248. package/dist/shared/verification/interfaces/index.d.ts +0 -7
  249. package/dist/shared/verification/interfaces/verification-checklist.d.ts +0 -19
  250. package/dist/shared/verification/interfaces/verification-result.d.ts +0 -29
  251. package/dist/shared/verification/types/checklist-category.d.ts +0 -18
  252. package/dist/shared/verification/types/index.d.ts +0 -4
  253. package/dist/tools/parallel/show-metrics.d.ts +0 -10
  254. package/dist/tools/parallel/update-todo.d.ts +0 -7
  255. package/dist/utils/compatibility/claude.d.ts +0 -9
  256. package/dist/utils/formatting/elapsed-time.d.ts +0 -4
  257. package/dist/utils/formatting/index.d.ts +0 -5
  258. package/dist/utils/formatting/timestamp.d.ts +0 -4
  259. package/dist/utils/parsing/index.d.ts +0 -4
  260. package/dist/utils/parsing/slash-command.d.ts +0 -7
  261. package/dist/utils/sanity/checker.d.ts +0 -8
  262. package/dist/utils/sanity/constants/escalation-prompt.d.ts +0 -4
  263. package/dist/utils/sanity/constants/index.d.ts +0 -6
  264. package/dist/utils/sanity/constants/recovery-prompt.d.ts +0 -4
  265. package/dist/utils/sanity/constants/severity.d.ts +0 -8
  266. package/dist/utils/sanity/index.d.ts +0 -7
  267. package/dist/utils/sanity/interfaces/index.d.ts +0 -4
  268. package/dist/utils/sanity/interfaces/sanity-result.d.ts +0 -9
  269. package/dist/utils/sanity/types/index.d.ts +0 -4
  270. package/dist/utils/sanity/types/severity.d.ts +0 -5
  271. /package/dist/{core/agents/consts/task-status.const.d.ts → shared/task/constants/task-status.d.ts} +0 -0
@@ -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";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * UI and Loop Labels
3
+ */
4
+ export declare const LOOP_LABELS: {
5
+ readonly WAIT: "⏳";
6
+ readonly RUN: "🚀";
7
+ readonly DONE: "✅";
8
+ readonly ERROR: "❌";
9
+ readonly CANCEL: "⏹️";
10
+ readonly INFO: "ℹ️";
11
+ readonly STATUS_TITLE: "Status";
12
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Mission Control Constants
3
+ */
4
+ export declare const MISSION_CONTROL: {
5
+ readonly LOG_SOURCE: "MissionControl";
6
+ readonly MAX_ITERATIONS: 50;
7
+ readonly DEFAULT_TIMEOUT: number;
8
+ };
@@ -1,9 +1,10 @@
1
1
  /**
2
- * OS Platform Constants
2
+ * OS Constants
3
3
  */
4
4
  export declare const PLATFORM: {
5
- readonly DARWIN: "darwin";
5
+ readonly MAC: "darwin";
6
+ readonly WINDOWS: "win32";
6
7
  readonly LINUX: "linux";
7
8
  readonly WIN32: "win32";
8
- readonly UNSUPPORTED: "unsupported";
9
+ readonly DARWIN: "darwin";
9
10
  };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Signals and Shared Constants
3
+ */
4
+ export declare const VERIFICATION_SIGNALS: {
5
+ PASS: string;
6
+ FAIL: string;
7
+ FINAL_PASS: string;
8
+ STAGNATED: string;
9
+ };
10
+ export declare const RECOVERY_LEVEL: {
11
+ RETRIABLE: string;
12
+ FATAL: string;
13
+ CONTEXT_RESET: string;
14
+ DECOMPOSE: string;
15
+ RE_PLAN: string;
16
+ ASK_USER: string;
17
+ };
18
+ export declare const RECOVERY_PRINCIPLE: {
19
+ FAIL_SAFE: string;
20
+ FAIL_FAST: string;
21
+ GRACEFUL_DEGRADATION: string;
22
+ };
@@ -1,19 +1,17 @@
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 { PROMPT_TAGS } from "./prompt/index.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Common Prompts
3
+ */
4
+ export declare const PROMPTS: {
5
+ CONTINUE_DEFAULT: string;
6
+ DONE_DEFAULT: string;
7
+ };
@@ -197,6 +197,10 @@ export declare const PROMPT_TAGS: {
197
197
  readonly open: "<mission_loop>";
198
198
  readonly close: "</mission_loop>";
199
199
  };
200
+ readonly MISSION: {
201
+ readonly open: "<mission>";
202
+ readonly close: "</mission>";
203
+ };
200
204
  readonly TODO_CONTINUATION: {
201
205
  readonly open: "<todo_continuation>";
202
206
  readonly close: "</todo_continuation>";
@@ -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";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Message Constants
3
+ */
4
+ export declare const MESSAGE_ROLES: {
5
+ readonly SYSTEM: "system";
6
+ readonly USER: "user";
7
+ readonly ASSISTANT: "assistant";
8
+ };
9
+ export declare const PART_TYPES: {
10
+ readonly TEXT: "text";
11
+ readonly TOOL: "tool";
12
+ readonly REASONING: "reasoning";
13
+ readonly IMAGE: "image";
14
+ readonly TOOL_USE: "tool_use";
15
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Session Status Constants
3
+ */
4
+ export declare const SESSION_STATUS: {
5
+ readonly IDLE: "idle";
6
+ readonly BUSY: "busy";
7
+ readonly ERROR: "error";
8
+ readonly DELETED: "deleted";
9
+ };
@@ -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.21",
5
+ "version": "1.2.23",
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";