opencode-orchestrator 1.2.34 → 1.2.36

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 (281) hide show
  1. package/README.md +91 -41
  2. package/dist/core/agents/agent-registry.d.ts +28 -0
  3. package/dist/core/agents/concurrency.d.ts +38 -0
  4. package/dist/core/agents/config.d.ts +9 -0
  5. package/dist/core/agents/consts/index.d.ts +4 -0
  6. package/dist/core/agents/index.d.ts +2 -3
  7. package/dist/core/agents/interfaces/session-pool.interface.d.ts +0 -7
  8. package/dist/core/agents/manager/event-handler.d.ts +35 -0
  9. package/dist/core/agents/manager/index.d.ts +10 -0
  10. package/dist/core/agents/manager/task-cleaner.d.ts +29 -0
  11. package/dist/core/agents/manager/task-launcher.d.ts +35 -0
  12. package/dist/core/agents/manager/task-poller.d.ts +28 -0
  13. package/dist/core/agents/manager/task-resumer.d.ts +18 -0
  14. package/dist/core/agents/manager.d.ts +41 -9
  15. package/dist/core/agents/persistence/task-wal.d.ts +26 -0
  16. package/dist/core/agents/session-pool.d.ts +0 -10
  17. package/dist/core/agents/task-store.d.ts +54 -0
  18. package/dist/core/cache/constants.d.ts +2 -2
  19. package/dist/core/cleanup/cleanup-scheduler.d.ts +11 -0
  20. package/dist/core/context/context-window-monitor.d.ts +66 -0
  21. package/dist/core/context/index.d.ts +6 -0
  22. package/dist/core/loop/formatters.d.ts +17 -0
  23. package/dist/core/loop/interfaces/index.d.ts +5 -0
  24. package/dist/core/loop/interfaces/todo-stats.d.ts +11 -0
  25. package/dist/core/loop/interfaces/todo.d.ts +13 -0
  26. package/dist/core/loop/interfaces.d.ts +7 -0
  27. package/dist/core/loop/mission-loop-handler.d.ts +25 -0
  28. package/dist/core/loop/mission-loop.d.ts +48 -0
  29. package/dist/core/loop/parser.d.ts +8 -0
  30. package/dist/core/loop/stats.d.ts +24 -0
  31. package/dist/core/loop/todo-continuation.d.ts +39 -0
  32. package/dist/core/loop/todo-enforcer.d.ts +9 -0
  33. package/dist/core/loop/todo-manager.d.ts +22 -0
  34. package/dist/core/loop/types/index.d.ts +5 -0
  35. package/dist/core/loop/types/todo-priority.d.ts +4 -0
  36. package/dist/core/loop/types/todo-status.d.ts +4 -0
  37. package/dist/core/loop/verification.d.ts +22 -0
  38. package/dist/core/memory/interfaces.d.ts +33 -0
  39. package/dist/core/memory/memory-manager.d.ts +40 -0
  40. package/dist/core/metrics/collector.d.ts +27 -0
  41. package/dist/core/notification/os-notify/index.d.ts +7 -0
  42. package/dist/core/notification/os-notify/notifier.d.ts +7 -0
  43. package/dist/core/notification/os-notify/platform-resolver.d.ts +7 -0
  44. package/dist/core/notification/os-notify/platform.d.ts +7 -0
  45. package/dist/core/notification/os-notify/sound-player.d.ts +7 -0
  46. package/dist/core/notification/os-notify/todo-checker.d.ts +5 -0
  47. package/dist/core/notification/task-toast-manager.d.ts +127 -0
  48. package/dist/core/notification/toast-core.d.ts +36 -0
  49. package/dist/core/notification/toast.d.ts +9 -0
  50. package/dist/core/orchestrator/index.d.ts +6 -0
  51. package/dist/core/orchestrator/interfaces/index.d.ts +4 -0
  52. package/dist/core/orchestrator/interfaces/session-state.d.ts +11 -0
  53. package/dist/core/orchestrator/session-manager.d.ts +31 -0
  54. package/dist/core/orchestrator/state.d.ts +10 -0
  55. package/dist/core/orchestrator/types/index.d.ts +4 -0
  56. package/dist/core/orchestrator/types/task-status.d.ts +5 -0
  57. package/dist/core/plugins/interfaces.d.ts +30 -0
  58. package/dist/core/plugins/plugin-manager.d.ts +21 -0
  59. package/dist/core/progress/calculator.d.ts +11 -0
  60. package/dist/core/progress/formatters.d.ts +20 -0
  61. package/dist/core/progress/interfaces/index.d.ts +8 -0
  62. package/dist/core/progress/interfaces/progress-snapshot.d.ts +15 -0
  63. package/dist/core/progress/interfaces/snapshot-input.d.ts +13 -0
  64. package/dist/core/progress/interfaces/step-progress.d.ts +7 -0
  65. package/dist/core/progress/interfaces/task-progress.d.ts +10 -0
  66. package/dist/core/progress/interfaces/todo-progress.d.ts +9 -0
  67. package/dist/core/progress/interfaces.d.ts +6 -0
  68. package/dist/core/progress/progress-notifier.d.ts +14 -0
  69. package/dist/core/progress/state-broadcaster.d.ts +29 -0
  70. package/dist/core/progress/store.d.ts +28 -0
  71. package/dist/core/progress/tracker.d.ts +11 -0
  72. package/dist/core/queue/async-queue.d.ts +46 -0
  73. package/dist/core/queue/async-utils.d.ts +20 -0
  74. package/dist/core/queue/index.d.ts +8 -0
  75. package/dist/core/queue/work-pool.d.ts +19 -0
  76. package/dist/core/recovery/auto-recovery.d.ts +9 -0
  77. package/dist/core/recovery/constants.d.ts +9 -0
  78. package/dist/core/recovery/handler.d.ts +27 -0
  79. package/dist/core/recovery/interfaces/error-context.d.ts +11 -0
  80. package/dist/core/recovery/interfaces/error-pattern.d.ts +10 -0
  81. package/dist/core/recovery/interfaces/index.d.ts +8 -0
  82. package/dist/core/recovery/interfaces/recovery-action.d.ts +25 -0
  83. package/dist/core/recovery/interfaces/recovery-record.d.ts +10 -0
  84. package/dist/core/recovery/interfaces/recovery-stats.d.ts +9 -0
  85. package/dist/core/recovery/interfaces.d.ts +6 -0
  86. package/dist/core/recovery/patterns.d.ts +8 -0
  87. package/dist/core/recovery/retry.d.ts +59 -0
  88. package/dist/core/recovery/session-recovery.d.ts +30 -0
  89. package/dist/core/session/interfaces/context-stats.d.ts +9 -0
  90. package/dist/core/session/interfaces/index.d.ts +8 -0
  91. package/dist/core/session/interfaces/shared-context.d.ts +15 -0
  92. package/dist/core/session/interfaces/shared-decision.d.ts +10 -0
  93. package/dist/core/session/interfaces/shared-document.d.ts +9 -0
  94. package/dist/core/session/interfaces/shared-finding.d.ts +10 -0
  95. package/dist/core/session/interfaces.d.ts +6 -0
  96. package/dist/core/session/shared-context.d.ts +8 -0
  97. package/dist/core/session/store.d.ts +44 -0
  98. package/dist/core/session/summary.d.ts +7 -0
  99. package/dist/core/sync/todo-parser.d.ts +5 -0
  100. package/dist/core/sync/todo-sync-service.d.ts +35 -0
  101. package/dist/core/task/interfaces/index.d.ts +8 -0
  102. package/dist/core/task/interfaces/task-hierarchy.d.ts +9 -0
  103. package/dist/core/task/interfaces/task-input.d.ts +11 -0
  104. package/dist/core/task/interfaces/task-node.d.ts +20 -0
  105. package/dist/core/task/interfaces/task-progress.d.ts +11 -0
  106. package/dist/core/task/interfaces.d.ts +6 -0
  107. package/dist/core/task/parser.d.ts +8 -0
  108. package/dist/core/task/scheduler.d.ts +12 -0
  109. package/dist/core/task/store.d.ts +32 -0
  110. package/dist/core/task/summary.d.ts +7 -0
  111. package/dist/core/task/task-decomposer.d.ts +10 -0
  112. package/dist/core/todo/todo-manager.d.ts +28 -0
  113. package/dist/hooks/compatibility/external-plugin.d.ts +10 -0
  114. package/dist/hooks/constants.d.ts +27 -0
  115. package/dist/hooks/custom/agent-ui.d.ts +20 -0
  116. package/dist/hooks/custom/memory-gate.d.ts +21 -0
  117. package/dist/hooks/custom/metrics.d.ts +14 -0
  118. package/dist/hooks/custom/resource-control.d.ts +13 -0
  119. package/dist/hooks/custom/secret-scanner.d.ts +19 -0
  120. package/dist/hooks/custom/strict-role-guard.d.ts +21 -0
  121. package/dist/hooks/custom/user-activity.d.ts +11 -0
  122. package/dist/hooks/features/mission-loop.d.ts +18 -0
  123. package/dist/hooks/features/sanity-check.d.ts +15 -0
  124. package/dist/hooks/index.d.ts +5 -0
  125. package/dist/hooks/registry.d.ts +37 -0
  126. package/dist/hooks/types.d.ts +72 -0
  127. package/dist/index.d.ts +8 -0
  128. package/dist/index.js +27219 -6229
  129. package/dist/plugin-handlers/assistant-done-handler.d.ts +12 -0
  130. package/dist/plugin-handlers/chat-message-handler.d.ts +30 -0
  131. package/dist/plugin-handlers/config-handler.d.ts +9 -0
  132. package/dist/plugin-handlers/event-handler.d.ts +18 -0
  133. package/dist/plugin-handlers/index.d.ts +9 -0
  134. package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +12 -0
  135. package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +12 -0
  136. package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +14 -0
  137. package/dist/plugin-handlers/interfaces/index.d.ts +12 -0
  138. package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +14 -0
  139. package/dist/plugin-handlers/interfaces/session-compacting.d.ts +19 -0
  140. package/dist/plugin-handlers/interfaces/session-state.d.ts +15 -0
  141. package/dist/plugin-handlers/interfaces/system-transform.d.ts +17 -0
  142. package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +8 -0
  143. package/dist/plugin-handlers/interfaces/tool-hook.d.ts +14 -0
  144. package/dist/plugin-handlers/session-compacting-handler.d.ts +14 -0
  145. package/dist/plugin-handlers/system-transform-handler.d.ts +14 -0
  146. package/dist/plugin-handlers/tool-execute-handler.d.ts +14 -0
  147. package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +8 -0
  148. package/dist/scripts/postinstall.js +29 -125
  149. package/dist/shared/command/index.d.ts +0 -1
  150. package/dist/shared/constants/system-messages.d.ts +4 -4
  151. package/dist/shared/core/constants/index.d.ts +0 -4
  152. package/dist/shared/core/constants/paths.d.ts +16 -10
  153. package/dist/shared/errors/constants/error-patterns.d.ts +13 -0
  154. package/dist/shared/errors/constants/error-type.d.ts +13 -0
  155. package/dist/shared/errors/constants/index.d.ts +5 -0
  156. package/dist/shared/errors/detection.d.ts +5 -0
  157. package/dist/shared/errors/index.d.ts +7 -0
  158. package/dist/shared/errors/retry.d.ts +7 -0
  159. package/dist/shared/errors/types/error-pattern-type.d.ts +5 -0
  160. package/dist/shared/errors/types/index.d.ts +4 -0
  161. package/dist/shared/index.d.ts +9 -7
  162. package/dist/shared/loop/constants/index.d.ts +7 -0
  163. package/dist/shared/loop/constants/labels.d.ts +33 -0
  164. package/dist/shared/loop/constants/loop.d.ts +17 -0
  165. package/dist/shared/loop/constants/mission-control.d.ts +20 -0
  166. package/dist/shared/loop/constants/todo-status.d.ts +9 -0
  167. package/dist/shared/loop/index.d.ts +6 -0
  168. package/dist/shared/loop/interfaces/index.d.ts +6 -0
  169. package/dist/shared/loop/interfaces/mission-loop.d.ts +29 -0
  170. package/dist/shared/loop/interfaces/todo-stats.d.ts +11 -0
  171. package/dist/shared/loop/interfaces/todo.d.ts +13 -0
  172. package/dist/shared/loop/types/index.d.ts +5 -0
  173. package/dist/shared/loop/types/todo-priority.d.ts +4 -0
  174. package/dist/shared/loop/types/todo-status.d.ts +4 -0
  175. package/dist/shared/message/constants/index.d.ts +8 -0
  176. package/dist/shared/message/constants/message-roles.d.ts +23 -0
  177. package/dist/shared/message/constants/part-types.d.ts +13 -0
  178. package/dist/shared/message/constants/plugin-hooks.d.ts +15 -0
  179. package/dist/shared/message/constants/prompts.d.ts +8 -0
  180. package/dist/shared/message/constants/slash-commands.d.ts +21 -0
  181. package/dist/shared/message/index.d.ts +4 -0
  182. package/dist/shared/notification/constants/index.d.ts +3 -0
  183. package/dist/shared/notification/constants/toast-duration.d.ts +19 -0
  184. package/dist/shared/notification/constants/toast-variants.d.ts +10 -0
  185. package/dist/shared/notification/constants/tui.const.d.ts +24 -0
  186. package/dist/shared/notification/index.d.ts +7 -0
  187. package/dist/shared/notification/interfaces/index.d.ts +6 -0
  188. package/dist/shared/notification/interfaces/task-toast.interface.d.ts +18 -0
  189. package/dist/shared/notification/interfaces/toast-message.d.ts +13 -0
  190. package/dist/shared/notification/interfaces/toast-options.d.ts +10 -0
  191. package/dist/shared/notification/os-notify/constants/index.d.ts +6 -0
  192. package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +11 -0
  193. package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +11 -0
  194. package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +5 -0
  195. package/dist/shared/notification/os-notify/index.d.ts +6 -0
  196. package/dist/shared/notification/os-notify/interfaces/index.d.ts +5 -0
  197. package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +15 -0
  198. package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +13 -0
  199. package/dist/shared/notification/os-notify/types/index.d.ts +4 -0
  200. package/dist/shared/notification/os-notify/types/notification-commands.d.ts +5 -0
  201. package/dist/shared/notification/presets/index.d.ts +9 -0
  202. package/dist/shared/notification/presets/mission.d.ts +5 -0
  203. package/dist/shared/notification/presets/parallel.d.ts +6 -0
  204. package/dist/shared/notification/presets/session.d.ts +6 -0
  205. package/dist/shared/notification/presets/task-lifecycle.d.ts +7 -0
  206. package/dist/shared/notification/presets/tools.d.ts +6 -0
  207. package/dist/shared/notification/presets/warnings.d.ts +7 -0
  208. package/dist/shared/notification/types/index.d.ts +4 -0
  209. package/dist/shared/notification/types/toast-variant.d.ts +4 -0
  210. package/dist/shared/os/constants/index.d.ts +4 -0
  211. package/dist/shared/{core/constants/os.d.ts → os/constants/platform.d.ts} +3 -4
  212. package/dist/shared/os/index.d.ts +5 -0
  213. package/dist/shared/os/types/index.d.ts +4 -0
  214. package/dist/shared/os/types/platform.d.ts +5 -0
  215. package/dist/shared/prompt/constants/mandates.d.ts +1 -1
  216. package/dist/shared/prompt/constants/tags.d.ts +0 -4
  217. package/dist/shared/prompt/index.d.ts +0 -1
  218. package/dist/shared/recovery/constants/history.d.ts +11 -0
  219. package/dist/shared/recovery/constants/index.d.ts +6 -0
  220. package/dist/shared/recovery/constants/recovery-level.d.ts +15 -0
  221. package/dist/shared/recovery/constants/recovery.d.ts +13 -0
  222. package/dist/shared/recovery/index.d.ts +6 -0
  223. package/dist/shared/recovery/interfaces/error-context.d.ts +11 -0
  224. package/dist/shared/recovery/interfaces/index.d.ts +5 -0
  225. package/dist/shared/recovery/interfaces/recovery-record.d.ts +10 -0
  226. package/dist/shared/recovery/types/index.d.ts +4 -0
  227. package/dist/shared/recovery/types/recovery-action.d.ts +4 -0
  228. package/dist/shared/session/constants/events/index.d.ts +0 -5
  229. package/dist/shared/session/constants/index.d.ts +0 -2
  230. package/dist/shared/session/index.d.ts +0 -1
  231. package/dist/shared/task/constants/parallel-task.d.ts +4 -5
  232. package/dist/shared/todo/index.d.ts +4 -0
  233. package/dist/shared/todo/interfaces/index.d.ts +12 -0
  234. package/dist/shared/verification/constants/categories.d.ts +95 -0
  235. package/dist/shared/verification/constants/checklist.d.ts +16 -0
  236. package/dist/shared/verification/constants/index.d.ts +7 -0
  237. package/dist/shared/verification/constants/patterns.d.ts +19 -0
  238. package/dist/shared/verification/constants/signals.d.ts +10 -0
  239. package/dist/shared/verification/index.d.ts +8 -0
  240. package/dist/shared/verification/interfaces/checklist-item.d.ts +21 -0
  241. package/dist/shared/verification/interfaces/checklist-verification-result.d.ts +24 -0
  242. package/dist/shared/verification/interfaces/index.d.ts +7 -0
  243. package/dist/shared/verification/interfaces/verification-checklist.d.ts +19 -0
  244. package/dist/shared/verification/interfaces/verification-result.d.ts +29 -0
  245. package/dist/shared/verification/types/checklist-category.d.ts +18 -0
  246. package/dist/shared/verification/types/index.d.ts +4 -0
  247. package/dist/tools/parallel/list-agents.d.ts +1 -1
  248. package/dist/tools/parallel/show-metrics.d.ts +10 -0
  249. package/dist/tools/parallel/update-todo.d.ts +7 -0
  250. package/dist/tools/slashCommand.d.ts +1 -1
  251. package/dist/utils/common.d.ts +5 -3
  252. package/dist/utils/compatibility/claude.d.ts +9 -0
  253. package/dist/utils/formatting/elapsed-time.d.ts +4 -0
  254. package/dist/utils/formatting/index.d.ts +5 -0
  255. package/dist/utils/formatting/timestamp.d.ts +4 -0
  256. package/dist/utils/parsing/index.d.ts +4 -0
  257. package/dist/utils/parsing/slash-command.d.ts +7 -0
  258. package/dist/utils/sanity/checker.d.ts +8 -0
  259. package/dist/utils/sanity/constants/escalation-prompt.d.ts +4 -0
  260. package/dist/utils/sanity/constants/index.d.ts +6 -0
  261. package/dist/utils/sanity/constants/recovery-prompt.d.ts +4 -0
  262. package/dist/utils/sanity/constants/severity.d.ts +8 -0
  263. package/dist/utils/sanity/index.d.ts +7 -0
  264. package/dist/utils/sanity/interfaces/index.d.ts +4 -0
  265. package/dist/utils/sanity/interfaces/sanity-result.d.ts +9 -0
  266. package/dist/utils/sanity/types/index.d.ts +4 -0
  267. package/dist/utils/sanity/types/severity.d.ts +5 -0
  268. package/package.json +3 -3
  269. package/dist/core/agents/adaptive-concurrency.d.ts +0 -57
  270. package/dist/core/agents/unified-task-executor.d.ts +0 -27
  271. package/dist/core/mission/mission-controller.d.ts +0 -53
  272. package/dist/core/resource/resource-tracker.d.ts +0 -61
  273. package/dist/shared/command/constants/names.d.ts +0 -8
  274. package/dist/shared/core/constants/labels.d.ts +0 -12
  275. package/dist/shared/core/constants/mission.d.ts +0 -8
  276. package/dist/shared/core/constants/signals.d.ts +0 -22
  277. package/dist/shared/prompt/constants/prompts.d.ts +0 -7
  278. package/dist/shared/session/constants/events/hook-events.d.ts +0 -9
  279. package/dist/shared/session/constants/message.d.ts +0 -15
  280. package/dist/shared/session/constants/status.d.ts +0 -9
  281. /package/dist/{shared/task/constants/task-status.d.ts → core/agents/consts/task-status.const.d.ts} +0 -0
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Sanity Constants Index
3
+ */
4
+ export * from "./severity.js";
5
+ export * from "./recovery-prompt.js";
6
+ export * from "./escalation-prompt.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Recovery Prompt Constant
3
+ */
4
+ export declare const RECOVERY_PROMPT = "<anomaly_recovery>\nSYSTEM NOTICE: Previous output was malformed (gibberish/loop detected).\n\n\n<recovery_protocol>\n1. DISCARD the corrupted output completely - do not reference it\n2. RECALL the original mission objective\n3. IDENTIFY the last confirmed successful step\n4. RESTART with a simpler, more focused approach\n</recovery_protocol>\n\n<instructions>\n- If a sub-agent produced bad output: try a different agent or simpler task\n- If stuck in a loop: break down the task into smaller pieces\n- If context seems corrupted: call Reviewer to restore context\n- THINK in English for maximum stability\n</instructions>\n\nWhat was the original task? Proceed from the last known good state.\n</anomaly_recovery>";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Sanity Severity Constants
3
+ */
4
+ export declare const SEVERITY: {
5
+ readonly OK: "ok";
6
+ readonly WARNING: "warning";
7
+ readonly CRITICAL: "critical";
8
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Output Sanity Check Domain
3
+ */
4
+ export * from "./constants/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./types/index.js";
7
+ export * from "./checker.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Sanity Interfaces Index
3
+ */
4
+ export * from "./sanity-result.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sanity Result Interface
3
+ */
4
+ import type { Severity } from "../types/severity.js";
5
+ export interface SanityResult {
6
+ isHealthy: boolean;
7
+ reason?: string;
8
+ severity: Severity;
9
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Sanity Types Index
3
+ */
4
+ export * from "./severity.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Severity Type
3
+ */
4
+ import { SEVERITY } from "../constants/severity.js";
5
+ export type Severity = (typeof SEVERITY)[keyof typeof SEVERITY];
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.34",
5
+ "version": "1.2.36",
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.36",
74
- "@opencode-ai/sdk": "^1.1.36",
73
+ "@opencode-ai/plugin": "^1.1.35",
74
+ "@opencode-ai/sdk": "^1.1.35",
75
75
  "zod": "^4.3.6"
76
76
  },
77
77
  "devDependencies": {
@@ -1,57 +0,0 @@
1
- export interface AdaptiveConcurrencyConfig {
2
- /** Global maximum concurrent tasks across all agents */
3
- globalMax: number;
4
- /** Minimum slots per agent */
5
- perAgentMin: number;
6
- /** Maximum slots per agent */
7
- perAgentMax: number;
8
- /** Success rate threshold to scale up slots (0.0 - 1.0) */
9
- scaleUpThreshold: number;
10
- /** Success rate threshold to scale down slots (0.0 - 1.0) */
11
- scaleDownThreshold: number;
12
- /** How often to adjust limits (ms) */
13
- adjustmentInterval: number;
14
- }
15
- /**
16
- * Dynamically adjusts agent concurrency limits based on performance metrics.
17
- * Now acts as a full controller with acquire/release.
18
- */
19
- export declare class AdaptiveConcurrencyController {
20
- private config;
21
- private currentLimits;
22
- private activeCount;
23
- private metrics;
24
- private adjustmentTimer;
25
- private waiters;
26
- constructor(config?: Partial<AdaptiveConcurrencyConfig>);
27
- /**
28
- * Acquire a concurrency slot for an agent.
29
- * Blocks if limit reached.
30
- */
31
- acquire(agent: string): Promise<void>;
32
- /**
33
- * Release a concurrency slot.
34
- */
35
- release(agent: string): void;
36
- private canAcquire;
37
- /**
38
- * Get the current limit for a specific agent.
39
- */
40
- getLimit(agent: string): number;
41
- /**
42
- * Report task execution result for adaptive calculation.
43
- */
44
- reportResult(agent: string, success: boolean, latencyMs?: number): void;
45
- /**
46
- * Starts the periodic adjustment cycle.
47
- */
48
- private startAdjustmentCycle;
49
- /**
50
- * Adjusts agent limits based on accumulated metrics.
51
- */
52
- private adjustLimits;
53
- /**
54
- * Stops the controller and cleans up.
55
- */
56
- cleanup(): void;
57
- }
@@ -1,27 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { ParallelTask } from "./interfaces/parallel-task.interface.js";
3
- import type { LaunchInput } from "./interfaces/launch-input.interface.js";
4
- import { AdaptiveConcurrencyController } from "./adaptive-concurrency.js";
5
- import { SessionPool } from "./session-pool.js";
6
- type OpencodeClient = PluginInput["client"];
7
- /**
8
- * Simplified Unified Task Executor
9
- * Leveraging AdaptiveConcurrencyController and ResourceTracker
10
- */
11
- export declare class UnifiedTaskExecutor {
12
- private client;
13
- private sessionPool;
14
- private adaptiveConcurrency;
15
- private tasks;
16
- constructor(client: OpencodeClient, sessionPool: SessionPool, adaptive: AdaptiveConcurrencyController);
17
- launch(input: LaunchInput): Promise<ParallelTask>;
18
- /**
19
- * Handle events for task completion detection
20
- */
21
- handleEvent(event: any): Promise<void>;
22
- private completeTask;
23
- getTask(taskId: string): ParallelTask | undefined;
24
- getAllTasks(): ParallelTask[];
25
- getTasksByParent(parentID: string): ParallelTask[];
26
- }
27
- export {};
@@ -1,53 +0,0 @@
1
- import type { PluginInput } from '@opencode-ai/plugin';
2
- /**
3
- * Native Todo interface from OpenCode SDK
4
- */
5
- export interface NativeTodo {
6
- id: string;
7
- content: string;
8
- status: 'pending' | 'in_progress' | 'completed' | 'cancelled';
9
- priority: 'high' | 'medium' | 'low';
10
- }
11
- interface MissionState {
12
- id: string;
13
- sessionID: string;
14
- prompt: string;
15
- status: 'active' | 'completed' | 'failed';
16
- iteration: number;
17
- maxIterations: number;
18
- startedAt: string;
19
- lastTodoHash?: string;
20
- stagnationCount: number;
21
- }
22
- /**
23
- * MissionController
24
- * Handles the main autonomous loop using OpenCode Native APIs.
25
- */
26
- export declare class MissionController {
27
- private state;
28
- private client;
29
- constructor(input: PluginInput);
30
- /**
31
- * Starts a new mission by creating a session and sending the commander prompt.
32
- */
33
- start(prompt: string): Promise<string>;
34
- /**
35
- * Fetches native Todos for the current session.
36
- */
37
- getTodos(): Promise<NativeTodo[]>;
38
- /**
39
- * Moves to the next iteration if needed.
40
- * Called primarily when session becomes IDLE.
41
- */
42
- nextIteration(): Promise<{
43
- continue: boolean;
44
- prompt?: string;
45
- reason?: string;
46
- }>;
47
- buildCommanderPrompt(objective: string): string;
48
- buildContinuationPrompt(pending: NativeTodo[], intervention?: string): string;
49
- private buildStagnationIntervention;
50
- private hashTodos;
51
- getState(): MissionState | null;
52
- }
53
- export {};
@@ -1,61 +0,0 @@
1
- export declare enum ResourceType {
2
- SESSION = "session",
3
- TIMER = "timer",
4
- INTERVAL = "interval",
5
- FILE_HANDLE = "file_handle",
6
- MEMORY = "memory"
7
- }
8
- interface TrackedResource {
9
- id: string;
10
- type: ResourceType;
11
- sessionID?: string;
12
- createdAt: number;
13
- metadata?: Record<string, unknown>;
14
- cleanup: () => Promise<void> | void;
15
- }
16
- /**
17
- * Centralized tracker for all resources that need explicit cleanup.
18
- * Ensures that resources tied to a specific session are cleaned up when the session ends.
19
- */
20
- export declare class ResourceTracker {
21
- private static _instance;
22
- private resources;
23
- private sessionResources;
24
- private constructor();
25
- static getInstance(): ResourceTracker;
26
- /**
27
- * Start tracking a resource.
28
- */
29
- track(resource: TrackedResource): void;
30
- /**
31
- * Release a specific resource by ID.
32
- */
33
- release(id: string): Promise<boolean>;
34
- /**
35
- * Release all resources associated with a specific sessionID.
36
- */
37
- releaseAllForSession(sessionID: string): Promise<number>;
38
- /**
39
- * Release all resources of a specific type.
40
- */
41
- releaseByType(type: ResourceType): Promise<number>;
42
- /**
43
- * Periodic GC for stale resources (e.g. leaked timers).
44
- */
45
- cleanupStale(maxAgeMs: number): Promise<number>;
46
- /**
47
- * Shutdown the tracker and release all managed resources.
48
- */
49
- shutdown(): Promise<void>;
50
- /**
51
- * Get current resource statistics.
52
- */
53
- getStats(): {
54
- total: number;
55
- byType: Record<string, number>;
56
- bySessions: number;
57
- };
58
- }
59
- export declare function trackTimer(timer: NodeJS.Timeout, sessionID?: string): string;
60
- export declare function trackInterval(interval: NodeJS.Timeout, sessionID?: string): string;
61
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * Command Names
3
- */
4
- export declare const COMMAND_NAMES: {
5
- readonly TASK: "task";
6
- readonly PLAN: "plan";
7
- readonly AGENTS: "agents";
8
- };
@@ -1,12 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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,22 +0,0 @@
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,7 +0,0 @@
1
- /**
2
- * Common Prompts
3
- */
4
- export declare const PROMPTS: {
5
- CONTINUE_DEFAULT: string;
6
- DONE_DEFAULT: string;
7
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * Hook events
3
- */
4
- export declare const HOOK_EVENTS: {
5
- readonly PRE_TOOL: "hook.pre_tool";
6
- readonly POST_TOOL: "hook.post_tool";
7
- readonly CHAT: "hook.chat";
8
- readonly DONE: "hook.done";
9
- };
@@ -1,15 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
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
- };