opencode-orchestrator 1.5.1 → 1.6.0

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 (560) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +21 -2
  3. package/dist/agents/commander.d.ts +1 -1
  4. package/dist/agents/definitions.d.ts +1 -1
  5. package/dist/agents/prompts/01_philosophy/anti_hallucination.d.ts +0 -0
  6. package/dist/agents/prompts/01_philosophy/core.d.ts +0 -0
  7. package/dist/agents/prompts/01_philosophy/execution_assurance.d.ts +0 -0
  8. package/dist/agents/prompts/01_philosophy/index.d.ts +0 -0
  9. package/dist/agents/prompts/01_philosophy/metadata.d.ts +0 -0
  10. package/dist/agents/prompts/01_philosophy/modularity.d.ts +0 -0
  11. package/dist/agents/prompts/02_discovery/agents/discovery_commander.d.ts +0 -0
  12. package/dist/agents/prompts/02_discovery/agents/discovery_planner.d.ts +0 -0
  13. package/dist/agents/prompts/02_discovery/agents/index.d.ts +0 -0
  14. package/dist/agents/prompts/02_discovery/discovery_core.d.ts +0 -0
  15. package/dist/agents/prompts/02_discovery/discovery_environment.d.ts +0 -0
  16. package/dist/agents/prompts/02_discovery/discovery_skills.d.ts +0 -0
  17. package/dist/agents/prompts/02_discovery/discovery_workspace.d.ts +0 -0
  18. package/dist/agents/prompts/02_discovery/index.d.ts +0 -0
  19. package/dist/agents/prompts/03_planning/agents/index.d.ts +0 -0
  20. package/dist/agents/prompts/03_planning/agents/planning_commander.d.ts +0 -0
  21. package/dist/agents/prompts/03_planning/agents/planning_planner.d.ts +0 -0
  22. package/dist/agents/prompts/03_planning/agents/planning_reviewer.d.ts +0 -0
  23. package/dist/agents/prompts/03_planning/index.d.ts +0 -0
  24. package/dist/agents/prompts/03_planning/planning_core.d.ts +0 -0
  25. package/dist/agents/prompts/03_planning/planning_decomposition.d.ts +0 -0
  26. package/dist/agents/prompts/03_planning/planning_file_planning.d.ts +0 -0
  27. package/dist/agents/prompts/03_planning/planning_parallel.d.ts +0 -0
  28. package/dist/agents/prompts/03_planning/planning_research.d.ts +0 -0
  29. package/dist/agents/prompts/03_planning/planning_todo_format.d.ts +0 -0
  30. package/dist/agents/prompts/03_planning/planning_todo_rules.d.ts +0 -0
  31. package/dist/agents/prompts/03_planning/planning_todo_sync.d.ts +0 -0
  32. package/dist/agents/prompts/04_execution/agents/execution_commander.d.ts +0 -0
  33. package/dist/agents/prompts/04_execution/agents/execution_worker.d.ts +0 -0
  34. package/dist/agents/prompts/04_execution/agents/index.d.ts +0 -0
  35. package/dist/agents/prompts/04_execution/execution_core.d.ts +0 -0
  36. package/dist/agents/prompts/04_execution/execution_delegation.d.ts +0 -0
  37. package/dist/agents/prompts/04_execution/execution_error_handling.d.ts +0 -0
  38. package/dist/agents/prompts/04_execution/execution_file_assignment.d.ts +0 -0
  39. package/dist/agents/prompts/04_execution/execution_hyper_parallel.d.ts +0 -0
  40. package/dist/agents/prompts/04_execution/execution_isolation.d.ts +0 -0
  41. package/dist/agents/prompts/04_execution/execution_quality.d.ts +0 -0
  42. package/dist/agents/prompts/04_execution/execution_strategy.d.ts +0 -0
  43. package/dist/agents/prompts/04_execution/execution_tdd.d.ts +0 -0
  44. package/dist/agents/prompts/04_execution/execution_workflow.d.ts +0 -0
  45. package/dist/agents/prompts/04_execution/index.d.ts +0 -0
  46. package/dist/agents/prompts/05_verification/agents/index.d.ts +0 -0
  47. package/dist/agents/prompts/05_verification/agents/verification_commander.d.ts +0 -0
  48. package/dist/agents/prompts/05_verification/agents/verification_reviewer.d.ts +0 -0
  49. package/dist/agents/prompts/05_verification/index.d.ts +0 -0
  50. package/dist/agents/prompts/05_verification/verification_async_monitoring.d.ts +0 -0
  51. package/dist/agents/prompts/05_verification/verification_build.d.ts +0 -0
  52. package/dist/agents/prompts/05_verification/verification_core.d.ts +0 -0
  53. package/dist/agents/prompts/05_verification/verification_evidence.d.ts +0 -0
  54. package/dist/agents/prompts/05_verification/verification_integration.d.ts +0 -0
  55. package/dist/agents/prompts/05_verification/verification_strategy.d.ts +0 -0
  56. package/dist/agents/prompts/05_verification/verification_sync_check.d.ts +0 -0
  57. package/dist/agents/prompts/05_verification/verification_sync_handling.d.ts +0 -0
  58. package/dist/agents/prompts/05_verification/verification_test.d.ts +0 -0
  59. package/dist/agents/prompts/06_mission/agents/index.d.ts +0 -0
  60. package/dist/agents/prompts/06_mission/agents/mission_commander.d.ts +0 -0
  61. package/dist/agents/prompts/06_mission/index.d.ts +0 -0
  62. package/dist/agents/prompts/06_mission/mission_completion_conditions.d.ts +0 -0
  63. package/dist/agents/prompts/06_mission/mission_core.d.ts +0 -0
  64. package/dist/agents/prompts/06_mission/mission_lifecycle.d.ts +0 -0
  65. package/dist/agents/prompts/06_mission/mission_loop_continuation.d.ts +0 -0
  66. package/dist/agents/prompts/06_mission/mission_recovery.d.ts +0 -0
  67. package/dist/agents/prompts/06_mission/mission_status_tracking.d.ts +0 -0
  68. package/dist/agents/prompts/07_agents/commander/commander_forbidden.d.ts +0 -0
  69. package/dist/agents/prompts/07_agents/commander/commander_identity.d.ts +0 -0
  70. package/dist/agents/prompts/07_agents/commander/commander_mandate.d.ts +0 -0
  71. package/dist/agents/prompts/07_agents/commander/commander_required.d.ts +0 -0
  72. package/dist/agents/prompts/07_agents/commander/commander_role.d.ts +0 -0
  73. package/dist/agents/prompts/07_agents/commander/index.d.ts +0 -0
  74. package/dist/agents/prompts/07_agents/planner/index.d.ts +0 -0
  75. package/dist/agents/prompts/07_agents/planner/planner_forbidden.d.ts +0 -0
  76. package/dist/agents/prompts/07_agents/planner/planner_identity.d.ts +0 -0
  77. package/dist/agents/prompts/07_agents/planner/planner_mandate.d.ts +0 -0
  78. package/dist/agents/prompts/07_agents/planner/planner_required.d.ts +0 -0
  79. package/dist/agents/prompts/07_agents/reviewer/index.d.ts +0 -0
  80. package/dist/agents/prompts/07_agents/reviewer/reviewer_forbidden.d.ts +0 -0
  81. package/dist/agents/prompts/07_agents/reviewer/reviewer_identity.d.ts +0 -0
  82. package/dist/agents/prompts/07_agents/reviewer/reviewer_mandate.d.ts +0 -0
  83. package/dist/agents/prompts/07_agents/reviewer/reviewer_required.d.ts +0 -0
  84. package/dist/agents/prompts/07_agents/worker/index.d.ts +0 -0
  85. package/dist/agents/prompts/07_agents/worker/worker_forbidden.d.ts +0 -0
  86. package/dist/agents/prompts/07_agents/worker/worker_identity.d.ts +0 -0
  87. package/dist/agents/prompts/07_agents/worker/worker_mandate.d.ts +0 -0
  88. package/dist/agents/prompts/07_agents/worker/worker_required.d.ts +0 -0
  89. package/dist/agents/prompts/08_tools/agents/index.d.ts +0 -0
  90. package/dist/agents/prompts/08_tools/agents/tools_reviewer.d.ts +0 -0
  91. package/dist/agents/prompts/08_tools/agents/tools_worker.d.ts +0 -0
  92. package/dist/agents/prompts/08_tools/index.d.ts +0 -0
  93. package/dist/agents/prompts/08_tools/tools_ast.d.ts +0 -0
  94. package/dist/agents/prompts/08_tools/tools_code_editing.d.ts +0 -0
  95. package/dist/agents/prompts/08_tools/tools_core.d.ts +0 -0
  96. package/dist/agents/prompts/08_tools/tools_lsp.d.ts +0 -0
  97. package/dist/agents/prompts/08_tools/tools_search.d.ts +0 -0
  98. package/dist/agents/prompts/08_tools/tools_testing.d.ts +0 -0
  99. package/dist/agents/prompts/index.d.ts +0 -0
  100. package/dist/agents/prompts/registry.d.ts +39 -0
  101. package/dist/agents/subagents/planner.d.ts +1 -1
  102. package/dist/agents/subagents/reviewer.d.ts +1 -1
  103. package/dist/agents/subagents/worker.d.ts +1 -1
  104. package/dist/core/agents/agent-registry.d.ts +1 -1
  105. package/dist/core/agents/concurrency-config.d.ts +0 -0
  106. package/dist/core/agents/concurrency-token.d.ts +0 -0
  107. package/dist/core/agents/concurrency.d.ts +2 -2
  108. package/dist/core/agents/config.d.ts +0 -0
  109. package/dist/core/agents/consts/index.d.ts +0 -0
  110. package/dist/core/agents/consts/task-status.const.d.ts +2 -2
  111. package/dist/core/agents/format.d.ts +0 -0
  112. package/dist/core/agents/index.d.ts +0 -0
  113. package/dist/core/agents/interfaces/index.d.ts +3 -3
  114. package/dist/core/agents/interfaces/launch-input.interface.d.ts +0 -0
  115. package/dist/core/agents/interfaces/resume-input.interface.d.ts +0 -0
  116. package/dist/core/agents/interfaces/session-pool.interface.d.ts +0 -0
  117. package/dist/core/agents/logger.d.ts +0 -0
  118. package/dist/core/agents/manager/event-handler.d.ts +0 -0
  119. package/dist/core/agents/manager/index.d.ts +0 -0
  120. package/dist/core/agents/manager/task-cleaner.d.ts +0 -0
  121. package/dist/core/agents/manager/task-launcher.d.ts +0 -0
  122. package/dist/core/agents/manager/task-poller.d.ts +0 -0
  123. package/dist/core/agents/manager/task-resumer.d.ts +0 -0
  124. package/dist/core/agents/manager.d.ts +0 -0
  125. package/dist/core/agents/session-pool.d.ts +0 -0
  126. package/dist/core/agents/task-store.d.ts +0 -0
  127. package/dist/core/agents/types/index.d.ts +0 -0
  128. package/dist/core/agents/types/parallel-task-status.type.d.ts +0 -0
  129. package/dist/core/cache/constants.d.ts +0 -0
  130. package/dist/core/cache/document-cache.d.ts +0 -0
  131. package/dist/core/cache/index.d.ts +0 -0
  132. package/dist/core/cache/interfaces/cache-document-entry.d.ts +0 -0
  133. package/dist/core/cache/interfaces/cache-list-entry.d.ts +0 -0
  134. package/dist/core/cache/interfaces/cache-metadata.d.ts +0 -0
  135. package/dist/core/cache/interfaces/cache-stats.d.ts +0 -0
  136. package/dist/core/cache/interfaces/cached-document.d.ts +0 -0
  137. package/dist/core/cache/interfaces/index.d.ts +0 -0
  138. package/dist/core/cache/interfaces.d.ts +0 -0
  139. package/dist/core/cache/operations.d.ts +0 -0
  140. package/dist/core/cache/utils.d.ts +0 -0
  141. package/dist/core/cleanup/cleanup-scheduler.d.ts +0 -0
  142. package/dist/core/commands/index.d.ts +0 -0
  143. package/dist/core/commands/interfaces/background-task.d.ts +0 -0
  144. package/dist/core/commands/interfaces/index.d.ts +0 -0
  145. package/dist/core/commands/interfaces/run-background-options.d.ts +0 -0
  146. package/dist/core/commands/manager.d.ts +0 -0
  147. package/dist/core/commands/types/background-task-status.d.ts +0 -0
  148. package/dist/core/commands/types/index.d.ts +0 -0
  149. package/dist/core/config/options-schema.d.ts +37 -0
  150. package/dist/core/config/plugin-options.d.ts +0 -0
  151. package/dist/core/context/context-window-monitor.d.ts +0 -0
  152. package/dist/core/context/index.d.ts +0 -0
  153. package/dist/core/knowledge/context-provider.d.ts +1 -1
  154. package/dist/core/knowledge/graph-parser.d.ts +0 -0
  155. package/dist/core/knowledge/hybrid-search.d.ts +2 -1
  156. package/dist/core/knowledge/index.d.ts +0 -0
  157. package/dist/core/knowledge/memory-consolidation.d.ts +0 -0
  158. package/dist/core/knowledge/mission-memory.d.ts +1 -1
  159. package/dist/core/knowledge/retrieval-weights.d.ts +29 -0
  160. package/dist/core/knowledge/safety-guards.d.ts +0 -0
  161. package/dist/core/knowledge/scratchpad.d.ts +0 -0
  162. package/dist/core/knowledge/tag-indexer.d.ts +0 -0
  163. package/dist/core/loop/circuit-breaker.d.ts +0 -0
  164. package/dist/core/loop/compaction-guard.d.ts +0 -0
  165. package/dist/core/loop/evidence.d.ts +22 -0
  166. package/dist/core/loop/formatters.d.ts +0 -0
  167. package/dist/core/loop/interfaces/index.d.ts +0 -0
  168. package/dist/core/loop/interfaces/todo-stats.d.ts +0 -0
  169. package/dist/core/loop/interfaces/todo.d.ts +0 -0
  170. package/dist/core/loop/interfaces.d.ts +0 -0
  171. package/dist/core/loop/mission-ledger.d.ts +0 -0
  172. package/dist/core/loop/mission-loop-handler.d.ts +0 -0
  173. package/dist/core/loop/mission-loop.d.ts +3 -1
  174. package/dist/core/loop/mission-runtime-options.d.ts +0 -0
  175. package/dist/core/loop/parser.d.ts +0 -0
  176. package/dist/core/loop/progress-tracker.d.ts +0 -0
  177. package/dist/core/loop/session-state-store.d.ts +0 -0
  178. package/dist/core/loop/stats.d.ts +0 -0
  179. package/dist/core/loop/todo-continuation.d.ts +0 -0
  180. package/dist/core/loop/todo-enforcer.d.ts +0 -0
  181. package/dist/core/loop/todo-manager.d.ts +0 -0
  182. package/dist/core/loop/types/index.d.ts +0 -0
  183. package/dist/core/loop/types/todo-priority.d.ts +0 -0
  184. package/dist/core/loop/types/todo-status.d.ts +0 -0
  185. package/dist/core/loop/verification.d.ts +0 -0
  186. package/dist/core/memory/interfaces.d.ts +0 -0
  187. package/dist/core/memory/memory-manager.d.ts +0 -0
  188. package/dist/core/metrics/collector.d.ts +0 -0
  189. package/dist/core/notification/os-notify/index.d.ts +0 -0
  190. package/dist/core/notification/os-notify/notifier.d.ts +0 -0
  191. package/dist/core/notification/os-notify/platform-resolver.d.ts +0 -0
  192. package/dist/core/notification/os-notify/platform.d.ts +0 -0
  193. package/dist/core/notification/os-notify/sound-player.d.ts +0 -0
  194. package/dist/core/notification/os-notify/todo-checker.d.ts +0 -0
  195. package/dist/core/notification/task-toast-manager.d.ts +0 -0
  196. package/dist/core/notification/toast-core.d.ts +0 -0
  197. package/dist/core/notification/toast-sanitizer.d.ts +0 -0
  198. package/dist/core/notification/toast.d.ts +0 -0
  199. package/dist/core/orchestrator/index.d.ts +0 -0
  200. package/dist/core/orchestrator/interfaces/index.d.ts +0 -0
  201. package/dist/core/orchestrator/interfaces/session-state.d.ts +0 -0
  202. package/dist/core/orchestrator/session-manager.d.ts +0 -0
  203. package/dist/core/orchestrator/state.d.ts +0 -0
  204. package/dist/core/orchestrator/types/index.d.ts +0 -0
  205. package/dist/core/orchestrator/types/task-status.d.ts +1 -1
  206. package/dist/core/plugins/interfaces.d.ts +0 -0
  207. package/dist/core/plugins/plugin-manager.d.ts +0 -0
  208. package/dist/core/pool/buffer-pool.d.ts +0 -0
  209. package/dist/core/pool/object-pool.d.ts +0 -0
  210. package/dist/core/pool/string-pool.d.ts +0 -0
  211. package/dist/core/pool/task-pool.d.ts +1 -1
  212. package/dist/core/progress/calculator.d.ts +0 -0
  213. package/dist/core/progress/formatters.d.ts +0 -0
  214. package/dist/core/progress/interfaces/index.d.ts +0 -0
  215. package/dist/core/progress/interfaces/progress-snapshot.d.ts +0 -0
  216. package/dist/core/progress/interfaces/snapshot-input.d.ts +0 -0
  217. package/dist/core/progress/interfaces/step-progress.d.ts +0 -0
  218. package/dist/core/progress/interfaces/task-progress.d.ts +0 -0
  219. package/dist/core/progress/interfaces/todo-progress.d.ts +0 -0
  220. package/dist/core/progress/interfaces.d.ts +0 -0
  221. package/dist/core/progress/progress-notifier.d.ts +0 -0
  222. package/dist/core/progress/state-broadcaster.d.ts +0 -0
  223. package/dist/core/progress/store.d.ts +0 -0
  224. package/dist/core/progress/tracker.d.ts +0 -0
  225. package/dist/core/queue/async-queue.d.ts +0 -0
  226. package/dist/core/queue/async-utils.d.ts +0 -0
  227. package/dist/core/queue/index.d.ts +0 -0
  228. package/dist/core/queue/work-pool.d.ts +0 -0
  229. package/dist/core/queue/work-stealing-deque.d.ts +0 -0
  230. package/dist/core/queue/worker-pool.d.ts +0 -0
  231. package/dist/core/recovery/auto-recovery.d.ts +0 -0
  232. package/dist/core/recovery/constants.d.ts +0 -0
  233. package/dist/core/recovery/handler.d.ts +0 -0
  234. package/dist/core/recovery/interfaces/error-context.d.ts +0 -0
  235. package/dist/core/recovery/interfaces/error-pattern.d.ts +0 -0
  236. package/dist/core/recovery/interfaces/index.d.ts +0 -0
  237. package/dist/core/recovery/interfaces/recovery-action.d.ts +0 -0
  238. package/dist/core/recovery/interfaces/recovery-record.d.ts +0 -0
  239. package/dist/core/recovery/interfaces/recovery-stats.d.ts +0 -0
  240. package/dist/core/recovery/interfaces.d.ts +0 -0
  241. package/dist/core/recovery/patterns.d.ts +0 -0
  242. package/dist/core/recovery/retry.d.ts +0 -0
  243. package/dist/core/recovery/session-recovery.d.ts +0 -0
  244. package/dist/core/session/interfaces/context-stats.d.ts +0 -0
  245. package/dist/core/session/interfaces/index.d.ts +0 -0
  246. package/dist/core/session/interfaces/shared-context.d.ts +0 -0
  247. package/dist/core/session/interfaces/shared-decision.d.ts +0 -0
  248. package/dist/core/session/interfaces/shared-document.d.ts +0 -0
  249. package/dist/core/session/interfaces/shared-finding.d.ts +0 -0
  250. package/dist/core/session/interfaces.d.ts +0 -0
  251. package/dist/core/session/shared-context.d.ts +0 -0
  252. package/dist/core/session/store.d.ts +0 -0
  253. package/dist/core/session/summary.d.ts +0 -0
  254. package/dist/core/sync/todo-parser.d.ts +0 -0
  255. package/dist/core/sync/todo-sync-service.d.ts +0 -0
  256. package/dist/core/task/interfaces/index.d.ts +0 -0
  257. package/dist/core/task/interfaces/task-hierarchy.d.ts +0 -0
  258. package/dist/core/task/interfaces/task-input.d.ts +0 -0
  259. package/dist/core/task/interfaces/task-node.d.ts +1 -1
  260. package/dist/core/task/interfaces/task-progress.d.ts +0 -0
  261. package/dist/core/task/interfaces.d.ts +0 -0
  262. package/dist/core/task/parser.d.ts +0 -0
  263. package/dist/core/task/scheduler.d.ts +0 -0
  264. package/dist/core/task/store.d.ts +0 -0
  265. package/dist/core/task/summary.d.ts +0 -0
  266. package/dist/core/task/task-decomposer.d.ts +0 -0
  267. package/dist/core/todo/todo-manager.d.ts +0 -0
  268. package/dist/hooks/compatibility/external-plugin.d.ts +0 -0
  269. package/dist/hooks/constants.d.ts +0 -0
  270. package/dist/hooks/custom/agent-ui.d.ts +0 -0
  271. package/dist/hooks/custom/memory-gate.d.ts +0 -0
  272. package/dist/hooks/custom/metrics.d.ts +0 -0
  273. package/dist/hooks/custom/resource-control.d.ts +0 -0
  274. package/dist/hooks/custom/secret-scanner.d.ts +0 -0
  275. package/dist/hooks/custom/strict-role-guard.d.ts +0 -0
  276. package/dist/hooks/custom/user-activity.d.ts +0 -0
  277. package/dist/hooks/features/mission-loop.d.ts +0 -0
  278. package/dist/hooks/features/sanity-check.d.ts +0 -0
  279. package/dist/hooks/index.d.ts +0 -0
  280. package/dist/hooks/registry.d.ts +0 -0
  281. package/dist/hooks/types.d.ts +0 -0
  282. package/dist/index.d.ts +0 -0
  283. package/dist/index.js +966 -1423
  284. package/dist/index.js.map +7 -0
  285. package/dist/plugin-handlers/assistant-done-handler.d.ts +0 -0
  286. package/dist/plugin-handlers/chat-message-handler.d.ts +0 -0
  287. package/dist/plugin-handlers/config-handler.d.ts +0 -0
  288. package/dist/plugin-handlers/event-handler.d.ts +0 -0
  289. package/dist/plugin-handlers/index.d.ts +0 -0
  290. package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +0 -0
  291. package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +0 -0
  292. package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +0 -0
  293. package/dist/plugin-handlers/interfaces/index.d.ts +0 -0
  294. package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +0 -0
  295. package/dist/plugin-handlers/interfaces/session-compacting.d.ts +0 -0
  296. package/dist/plugin-handlers/interfaces/session-state.d.ts +0 -0
  297. package/dist/plugin-handlers/interfaces/system-transform.d.ts +0 -0
  298. package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +0 -0
  299. package/dist/plugin-handlers/interfaces/tool-hook.d.ts +0 -0
  300. package/dist/plugin-handlers/session-compacting-handler.d.ts +0 -0
  301. package/dist/plugin-handlers/system-transform-handler.d.ts +0 -0
  302. package/dist/plugin-handlers/tool-execute-handler.d.ts +0 -0
  303. package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +0 -0
  304. package/dist/scripts/postinstall.js +1 -0
  305. package/dist/scripts/postinstall.js.map +7 -0
  306. package/dist/scripts/preuninstall.js +1 -0
  307. package/dist/scripts/preuninstall.js.map +7 -0
  308. package/dist/shared/agent/{constants/names.d.ts → constants.d.ts} +5 -2
  309. package/dist/shared/agent/index.d.ts +3 -4
  310. package/dist/shared/agent/types.d.ts +27 -0
  311. package/dist/shared/agent/{utils/index.d.ts → utils.d.ts} +1 -1
  312. package/dist/shared/cache/constants.d.ts +27 -0
  313. package/dist/shared/cache/index.d.ts +1 -1
  314. package/dist/shared/command/index.d.ts +1 -2
  315. package/dist/shared/command/{interfaces/background-task.d.ts → types.d.ts} +14 -2
  316. package/dist/shared/constants/security-patterns.d.ts +0 -0
  317. package/dist/shared/constants/system-messages.d.ts +0 -0
  318. package/dist/shared/core/constants.d.ts +322 -0
  319. package/dist/shared/core/index.d.ts +1 -1
  320. package/dist/shared/core/poolable.d.ts +0 -0
  321. package/dist/shared/errors/constants.d.ts +24 -0
  322. package/dist/shared/errors/detection.d.ts +1 -1
  323. package/dist/shared/errors/index.d.ts +1 -2
  324. package/dist/shared/errors/retry.d.ts +1 -1
  325. package/dist/shared/index.d.ts +0 -0
  326. package/dist/shared/lifecycle/index.d.ts +0 -0
  327. package/dist/shared/lifecycle/registration.d.ts +0 -0
  328. package/dist/shared/lifecycle/shutdown-manager.d.ts +0 -0
  329. package/dist/shared/loop/constants.d.ts +88 -0
  330. package/dist/shared/loop/index.d.ts +2 -3
  331. package/dist/shared/loop/{interfaces/mission-loop.d.ts → types.d.ts} +34 -0
  332. package/dist/shared/message/constants.d.ts +75 -0
  333. package/dist/shared/message/index.d.ts +1 -1
  334. package/dist/shared/notification/{constants/tui.const.d.ts → constants.d.ts} +28 -0
  335. package/dist/shared/notification/index.d.ts +3 -4
  336. package/dist/shared/notification/os-notify/constants.d.ts +30 -0
  337. package/dist/shared/notification/os-notify/index.d.ts +2 -3
  338. package/dist/shared/notification/os-notify/types.d.ts +36 -0
  339. package/dist/shared/notification/presets.d.ts +37 -0
  340. package/dist/shared/notification/types.d.ts +46 -0
  341. package/dist/shared/os/{constants/platform.d.ts → constants.d.ts} +1 -1
  342. package/dist/shared/os/index.d.ts +2 -2
  343. package/dist/shared/os/types.d.ts +5 -0
  344. package/dist/shared/prompt/constants.d.ts +449 -0
  345. package/dist/shared/prompt/index.d.ts +1 -1
  346. package/dist/shared/recovery/constants.d.ts +39 -0
  347. package/dist/shared/recovery/index.d.ts +2 -3
  348. package/dist/shared/recovery/types.d.ts +26 -0
  349. package/dist/shared/session/constants.d.ts +80 -0
  350. package/dist/shared/session/index.d.ts +1 -1
  351. package/dist/shared/task/{constants/parallel-task.d.ts → constants.d.ts} +28 -1
  352. package/dist/shared/task/index.d.ts +2 -3
  353. package/dist/shared/task/types.d.ts +69 -0
  354. package/dist/shared/tool/constants.d.ts +105 -0
  355. package/dist/shared/tool/index.d.ts +3 -2
  356. package/dist/shared/tool/{constants/tool-names.d.ts → tool-names.d.ts} +0 -0
  357. package/dist/shared/tool/types.d.ts +117 -0
  358. package/dist/shared/verification/{constants/categories.d.ts → constants.d.ts} +45 -0
  359. package/dist/shared/verification/index.d.ts +2 -5
  360. package/dist/shared/verification/types.d.ts +112 -0
  361. package/dist/tools/ast/index.d.ts +0 -0
  362. package/dist/tools/background-cmd/check.d.ts +0 -0
  363. package/dist/tools/background-cmd/index.d.ts +0 -0
  364. package/dist/tools/background-cmd/kill.d.ts +0 -0
  365. package/dist/tools/background-cmd/list.d.ts +0 -0
  366. package/dist/tools/background-cmd/run.d.ts +0 -0
  367. package/dist/tools/callAgent.d.ts +0 -0
  368. package/dist/tools/lsp/diagnostics-cache.d.ts +0 -0
  369. package/dist/tools/lsp/index.d.ts +0 -0
  370. package/dist/tools/parallel/cancel-task.d.ts +0 -0
  371. package/dist/tools/parallel/delegate-task.d.ts +0 -0
  372. package/dist/tools/parallel/get-task-result.d.ts +0 -0
  373. package/dist/tools/parallel/index.d.ts +0 -0
  374. package/dist/tools/parallel/list-agents.d.ts +0 -0
  375. package/dist/tools/parallel/list-tasks.d.ts +0 -0
  376. package/dist/tools/parallel/show-metrics.d.ts +0 -0
  377. package/dist/tools/parallel/update-todo.d.ts +0 -0
  378. package/dist/tools/registry.d.ts +0 -0
  379. package/dist/tools/rust-pool.d.ts +0 -0
  380. package/dist/tools/rust.d.ts +0 -0
  381. package/dist/tools/search.d.ts +0 -0
  382. package/dist/tools/slashCommand.d.ts +0 -0
  383. package/dist/tools/web/cache-docs.d.ts +0 -0
  384. package/dist/tools/web/codesearch.d.ts +0 -0
  385. package/dist/tools/web/index.d.ts +0 -0
  386. package/dist/tools/web/webfetch.d.ts +0 -0
  387. package/dist/tools/web/websearch.d.ts +0 -0
  388. package/dist/utils/binary.d.ts +0 -0
  389. package/dist/utils/common.d.ts +0 -0
  390. package/dist/utils/compatibility/claude.d.ts +0 -0
  391. package/dist/utils/formatting/elapsed-time.d.ts +0 -0
  392. package/dist/utils/formatting/index.d.ts +0 -0
  393. package/dist/utils/formatting/timestamp.d.ts +0 -0
  394. package/dist/utils/parsing/index.d.ts +0 -0
  395. package/dist/utils/parsing/safe-json.d.ts +17 -0
  396. package/dist/utils/parsing/slash-command.d.ts +0 -0
  397. package/dist/utils/sanity/checker.d.ts +0 -0
  398. package/dist/utils/sanity/constants/escalation-prompt.d.ts +0 -0
  399. package/dist/utils/sanity/constants/index.d.ts +0 -0
  400. package/dist/utils/sanity/constants/recovery-prompt.d.ts +0 -0
  401. package/dist/utils/sanity/constants/severity.d.ts +0 -0
  402. package/dist/utils/sanity/index.d.ts +0 -0
  403. package/dist/utils/sanity/interfaces/index.d.ts +0 -0
  404. package/dist/utils/sanity/interfaces/sanity-result.d.ts +0 -0
  405. package/dist/utils/sanity/types/index.d.ts +0 -0
  406. package/dist/utils/sanity/types/severity.d.ts +0 -0
  407. package/opencode-orchestrator.schema.json +75 -0
  408. package/package.json +4 -2
  409. package/scripts/run-install-hook.mjs +66 -66
  410. package/dist/shared/agent/constants/index.d.ts +0 -4
  411. package/dist/shared/agent/interfaces/agent-definition.d.ts +0 -10
  412. package/dist/shared/agent/interfaces/concurrency-config.d.ts +0 -9
  413. package/dist/shared/agent/interfaces/index.d.ts +0 -5
  414. package/dist/shared/agent/types/agent-name.d.ts +0 -5
  415. package/dist/shared/agent/types/index.d.ts +0 -4
  416. package/dist/shared/cache/constants/cache-actions.d.ts +0 -10
  417. package/dist/shared/cache/constants/cache.d.ts +0 -11
  418. package/dist/shared/cache/constants/filter-status.d.ts +0 -12
  419. package/dist/shared/cache/constants/index.d.ts +0 -8
  420. package/dist/shared/command/interfaces/index.d.ts +0 -5
  421. package/dist/shared/command/interfaces/run-background-options.d.ts +0 -9
  422. package/dist/shared/command/types/background-task-status.d.ts +0 -4
  423. package/dist/shared/command/types/index.d.ts +0 -4
  424. package/dist/shared/core/constants/cli.d.ts +0 -26
  425. package/dist/shared/core/constants/id-prefix.d.ts +0 -14
  426. package/dist/shared/core/constants/index.d.ts +0 -15
  427. package/dist/shared/core/constants/lifecycle.d.ts +0 -22
  428. package/dist/shared/core/constants/limits.d.ts +0 -19
  429. package/dist/shared/core/constants/logging.d.ts +0 -39
  430. package/dist/shared/core/constants/memory-hooks.d.ts +0 -70
  431. package/dist/shared/core/constants/memory-limits.d.ts +0 -12
  432. package/dist/shared/core/constants/paths.d.ts +0 -21
  433. package/dist/shared/core/constants/phases.d.ts +0 -47
  434. package/dist/shared/core/constants/status-labels.d.ts +0 -34
  435. package/dist/shared/core/constants/time.d.ts +0 -8
  436. package/dist/shared/core/constants/wal-actions.d.ts +0 -10
  437. package/dist/shared/errors/constants/error-patterns.d.ts +0 -13
  438. package/dist/shared/errors/constants/error-type.d.ts +0 -13
  439. package/dist/shared/errors/constants/index.d.ts +0 -5
  440. package/dist/shared/errors/types/error-pattern-type.d.ts +0 -5
  441. package/dist/shared/errors/types/index.d.ts +0 -4
  442. package/dist/shared/loop/constants/index.d.ts +0 -8
  443. package/dist/shared/loop/constants/labels.d.ts +0 -33
  444. package/dist/shared/loop/constants/loop.d.ts +0 -17
  445. package/dist/shared/loop/constants/mission-control.d.ts +0 -20
  446. package/dist/shared/loop/constants/task-status.d.ts +0 -9
  447. package/dist/shared/loop/constants/todo-status.d.ts +0 -9
  448. package/dist/shared/loop/interfaces/index.d.ts +0 -6
  449. package/dist/shared/loop/interfaces/todo-stats.d.ts +0 -11
  450. package/dist/shared/loop/interfaces/todo.d.ts +0 -13
  451. package/dist/shared/loop/types/index.d.ts +0 -5
  452. package/dist/shared/loop/types/todo-priority.d.ts +0 -4
  453. package/dist/shared/loop/types/todo-status.d.ts +0 -4
  454. package/dist/shared/message/constants/index.d.ts +0 -8
  455. package/dist/shared/message/constants/message-roles.d.ts +0 -23
  456. package/dist/shared/message/constants/part-types.d.ts +0 -13
  457. package/dist/shared/message/constants/plugin-hooks.d.ts +0 -19
  458. package/dist/shared/message/constants/prompts.d.ts +0 -8
  459. package/dist/shared/message/constants/slash-commands.d.ts +0 -21
  460. package/dist/shared/notification/constants/index.d.ts +0 -3
  461. package/dist/shared/notification/constants/toast-duration.d.ts +0 -19
  462. package/dist/shared/notification/constants/toast-variants.d.ts +0 -10
  463. package/dist/shared/notification/interfaces/index.d.ts +0 -6
  464. package/dist/shared/notification/interfaces/task-toast.interface.d.ts +0 -18
  465. package/dist/shared/notification/interfaces/toast-message.d.ts +0 -13
  466. package/dist/shared/notification/interfaces/toast-options.d.ts +0 -10
  467. package/dist/shared/notification/os-notify/constants/index.d.ts +0 -6
  468. package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +0 -11
  469. package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +0 -11
  470. package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +0 -5
  471. package/dist/shared/notification/os-notify/interfaces/index.d.ts +0 -5
  472. package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +0 -15
  473. package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +0 -13
  474. package/dist/shared/notification/os-notify/types/index.d.ts +0 -4
  475. package/dist/shared/notification/os-notify/types/notification-commands.d.ts +0 -5
  476. package/dist/shared/notification/presets/index.d.ts +0 -9
  477. package/dist/shared/notification/presets/mission.d.ts +0 -5
  478. package/dist/shared/notification/presets/parallel.d.ts +0 -6
  479. package/dist/shared/notification/presets/session.d.ts +0 -6
  480. package/dist/shared/notification/presets/task-lifecycle.d.ts +0 -7
  481. package/dist/shared/notification/presets/tools.d.ts +0 -6
  482. package/dist/shared/notification/presets/warnings.d.ts +0 -7
  483. package/dist/shared/notification/types/index.d.ts +0 -4
  484. package/dist/shared/notification/types/toast-variant.d.ts +0 -4
  485. package/dist/shared/os/constants/index.d.ts +0 -4
  486. package/dist/shared/os/types/index.d.ts +0 -4
  487. package/dist/shared/os/types/platform.d.ts +0 -5
  488. package/dist/shared/prompt/constants/architecture.d.ts +0 -64
  489. package/dist/shared/prompt/constants/index.d.ts +0 -9
  490. package/dist/shared/prompt/constants/mandates.d.ts +0 -26
  491. package/dist/shared/prompt/constants/philosophy.d.ts +0 -29
  492. package/dist/shared/prompt/constants/scouts.d.ts +0 -32
  493. package/dist/shared/prompt/constants/status.d.ts +0 -83
  494. package/dist/shared/prompt/constants/tags.d.ts +0 -215
  495. package/dist/shared/recovery/constants/history.d.ts +0 -11
  496. package/dist/shared/recovery/constants/index.d.ts +0 -6
  497. package/dist/shared/recovery/constants/recovery-level.d.ts +0 -15
  498. package/dist/shared/recovery/constants/recovery.d.ts +0 -13
  499. package/dist/shared/recovery/interfaces/error-context.d.ts +0 -11
  500. package/dist/shared/recovery/interfaces/index.d.ts +0 -5
  501. package/dist/shared/recovery/interfaces/recovery-record.d.ts +0 -10
  502. package/dist/shared/recovery/types/index.d.ts +0 -4
  503. package/dist/shared/recovery/types/recovery-action.d.ts +0 -4
  504. package/dist/shared/session/constants/events/document-events.d.ts +0 -7
  505. package/dist/shared/session/constants/events/index.d.ts +0 -30
  506. package/dist/shared/session/constants/events/message-events.d.ts +0 -6
  507. package/dist/shared/session/constants/events/mission-events.d.ts +0 -8
  508. package/dist/shared/session/constants/events/session-events.d.ts +0 -13
  509. package/dist/shared/session/constants/events/special-events.d.ts +0 -6
  510. package/dist/shared/session/constants/events/task-events.d.ts +0 -9
  511. package/dist/shared/session/constants/events/todo-events.d.ts +0 -8
  512. package/dist/shared/session/constants/index.d.ts +0 -4
  513. package/dist/shared/task/base-task.d.ts +0 -31
  514. package/dist/shared/task/constants/background-status.d.ts +0 -10
  515. package/dist/shared/task/constants/background-task.d.ts +0 -10
  516. package/dist/shared/task/constants/index.d.ts +0 -8
  517. package/dist/shared/task/constants/metadata-keys.d.ts +0 -10
  518. package/dist/shared/task/interfaces/index.d.ts +0 -7
  519. package/dist/shared/task/interfaces/launch-input.d.ts +0 -11
  520. package/dist/shared/task/interfaces/parallel-task.d.ts +0 -28
  521. package/dist/shared/task/interfaces/resume-input.d.ts +0 -16
  522. package/dist/shared/task/interfaces/task-progress.d.ts +0 -9
  523. package/dist/shared/task/types/index.d.ts +0 -4
  524. package/dist/shared/task/types/parallel-task-status.d.ts +0 -4
  525. package/dist/shared/tool/constants/common/index.d.ts +0 -7
  526. package/dist/shared/tool/constants/common/labels.d.ts +0 -16
  527. package/dist/shared/tool/constants/common/languages.d.ts +0 -9
  528. package/dist/shared/tool/constants/common/output-labels.d.ts +0 -20
  529. package/dist/shared/tool/constants/common/sources.d.ts +0 -8
  530. package/dist/shared/tool/constants/index.d.ts +0 -8
  531. package/dist/shared/tool/constants/lsp/index.d.ts +0 -5
  532. package/dist/shared/tool/constants/lsp/lsp-severity-labels.d.ts +0 -9
  533. package/dist/shared/tool/constants/lsp/lsp-severity.d.ts +0 -9
  534. package/dist/shared/tool/constants/parallel/index.d.ts +0 -5
  535. package/dist/shared/tool/constants/parallel/logging.d.ts +0 -6
  536. package/dist/shared/tool/constants/parallel/parameters.d.ts +0 -19
  537. package/dist/shared/tool/constants/tool-output.d.ts +0 -9
  538. package/dist/shared/tool/interfaces/ast/ast-replace-result.d.ts +0 -8
  539. package/dist/shared/tool/interfaces/ast/ast-search-result.d.ts +0 -13
  540. package/dist/shared/tool/interfaces/ast/index.d.ts +0 -5
  541. package/dist/shared/tool/interfaces/index.d.ts +0 -6
  542. package/dist/shared/tool/interfaces/lsp/index.d.ts +0 -7
  543. package/dist/shared/tool/interfaces/lsp/lsp-command-result.d.ts +0 -8
  544. package/dist/shared/tool/interfaces/lsp/lsp-diagnostic.d.ts +0 -11
  545. package/dist/shared/tool/interfaces/lsp/lsp-rename-location.d.ts +0 -9
  546. package/dist/shared/tool/interfaces/lsp/lsp-rename-result.d.ts +0 -9
  547. package/dist/shared/tool/interfaces/parallel/index.d.ts +0 -5
  548. package/dist/shared/tool/interfaces/parallel/poll-result.d.ts +0 -10
  549. package/dist/shared/tool/interfaces/parallel/session-client.d.ts +0 -47
  550. package/dist/shared/verification/constants/checklist.d.ts +0 -16
  551. package/dist/shared/verification/constants/index.d.ts +0 -7
  552. package/dist/shared/verification/constants/patterns.d.ts +0 -19
  553. package/dist/shared/verification/constants/signals.d.ts +0 -10
  554. package/dist/shared/verification/interfaces/checklist-item.d.ts +0 -21
  555. package/dist/shared/verification/interfaces/checklist-verification-result.d.ts +0 -24
  556. package/dist/shared/verification/interfaces/index.d.ts +0 -7
  557. package/dist/shared/verification/interfaces/verification-checklist.d.ts +0 -19
  558. package/dist/shared/verification/interfaces/verification-result.d.ts +0 -29
  559. package/dist/shared/verification/types/checklist-category.d.ts +0 -18
  560. package/dist/shared/verification/types/index.d.ts +0 -4
package/dist/index.js CHANGED
@@ -1,5 +1,15 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
3
13
  var __esm = (fn, res, err) => function __init() {
4
14
  if (err) throw err[0];
5
15
  try {
@@ -8,29 +18,45 @@ var __esm = (fn, res, err) => function __init() {
8
18
  throw err = [e], e;
9
19
  }
10
20
  };
21
+ var __commonJS = (cb, mod) => function __require2() {
22
+ try {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ } catch (e) {
25
+ throw mod = 0, e;
26
+ }
27
+ };
11
28
  var __export = (target, all) => {
12
29
  for (var name in all)
13
30
  __defProp(target, name, { get: all[name], enumerable: true });
14
31
  };
15
-
16
- // src/shared/agent/interfaces/index.ts
17
- var init_interfaces = __esm({
18
- "src/shared/agent/interfaces/index.ts"() {
19
- "use strict";
32
+ var __copyProps = (to, from, except, desc) => {
33
+ if (from && typeof from === "object" || typeof from === "function") {
34
+ for (let key of __getOwnPropNames(from))
35
+ if (!__hasOwnProp.call(to, key) && key !== except)
36
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
37
  }
21
- });
38
+ return to;
39
+ };
40
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
41
+ // If the importer is in node compatibility mode or this is not an ESM
42
+ // file that has been converted to a CommonJS file using a Babel-
43
+ // compatible transform (i.e. "__esModule" has not been set), then set
44
+ // "default" to the CommonJS "module.exports" for node compatibility.
45
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
46
+ mod
47
+ ));
22
48
 
23
- // src/shared/agent/types/index.ts
49
+ // src/shared/agent/types.ts
24
50
  var init_types = __esm({
25
- "src/shared/agent/types/index.ts"() {
51
+ "src/shared/agent/types.ts"() {
26
52
  "use strict";
27
53
  }
28
54
  });
29
55
 
30
- // src/shared/agent/constants/names.ts
56
+ // src/shared/agent/constants.ts
31
57
  var AGENT_NAMES;
32
- var init_names = __esm({
33
- "src/shared/agent/constants/names.ts"() {
58
+ var init_constants = __esm({
59
+ "src/shared/agent/constants.ts"() {
34
60
  "use strict";
35
61
  AGENT_NAMES = {
36
62
  COMMANDER: "Commander",
@@ -42,15 +68,7 @@ var init_names = __esm({
42
68
  }
43
69
  });
44
70
 
45
- // src/shared/agent/constants/index.ts
46
- var init_constants = __esm({
47
- "src/shared/agent/constants/index.ts"() {
48
- "use strict";
49
- init_names();
50
- }
51
- });
52
-
53
- // src/shared/agent/utils/index.ts
71
+ // src/shared/agent/utils.ts
54
72
  function getStatusIndicator(status) {
55
73
  const statusMap = {
56
74
  pending: "[P]",
@@ -65,7 +83,7 @@ function getStatusIndicator(status) {
65
83
  return statusMap[status.toLowerCase()] ?? "[?]";
66
84
  }
67
85
  var init_utils = __esm({
68
- "src/shared/agent/utils/index.ts"() {
86
+ "src/shared/agent/utils.ts"() {
69
87
  "use strict";
70
88
  }
71
89
  });
@@ -74,31 +92,99 @@ var init_utils = __esm({
74
92
  var init_agent = __esm({
75
93
  "src/shared/agent/index.ts"() {
76
94
  "use strict";
77
- init_interfaces();
78
95
  init_types();
79
96
  init_constants();
80
97
  init_utils();
81
98
  }
82
99
  });
83
100
 
84
- // src/shared/core/constants/time.ts
85
- var TIME;
86
- var init_time = __esm({
87
- "src/shared/core/constants/time.ts"() {
101
+ // src/shared/tool/tool-names.ts
102
+ var TOOL_NAMES;
103
+ var init_tool_names = __esm({
104
+ "src/shared/tool/tool-names.ts"() {
88
105
  "use strict";
89
- TIME = {
90
- SECOND: 1e3,
91
- MINUTE: 60 * 1e3,
92
- HOUR: 60 * 60 * 1e3
106
+ TOOL_NAMES = {
107
+ // Parallel task tools
108
+ DELEGATE_TASK: "delegate_task",
109
+ GET_TASK_RESULT: "get_task_result",
110
+ LIST_TASKS: "list_tasks",
111
+ CANCEL_TASK: "cancel_task",
112
+ LIST_AGENTS: "list_agents",
113
+ SHOW_METRICS: "show_metrics",
114
+ UPDATE_TODO: "update_todo",
115
+ // Background command tools
116
+ RUN_BACKGROUND: "run_background",
117
+ CHECK_BACKGROUND: "check_background",
118
+ LIST_BACKGROUND: "list_background",
119
+ KILL_BACKGROUND: "kill_background",
120
+ // Command tools
121
+ RUN_COMMAND: "run_command",
122
+ // Search tools
123
+ GREP_SEARCH: "grep_search",
124
+ GLOB_SEARCH: "glob_search",
125
+ MGREP: "mgrep",
126
+ SED_REPLACE: "sed_replace",
127
+ // Diff & Compare tools
128
+ DIFF: "diff",
129
+ // JSON tools
130
+ JQ: "jq",
131
+ // HTTP tools
132
+ HTTP: "http",
133
+ // File tools
134
+ FILE_STATS: "file_stats",
135
+ // Git tools
136
+ GIT_DIFF: "git_diff",
137
+ GIT_STATUS: "git_status",
138
+ // Web tools
139
+ WEBFETCH: "webfetch",
140
+ WEBSEARCH: "websearch",
141
+ CODESEARCH: "codesearch",
142
+ CACHE_DOCS: "cache_docs",
143
+ // LSP tools
144
+ LSP_DIAGNOSTICS: "lsp_diagnostics",
145
+ // AST tools
146
+ AST_SEARCH: "ast_search",
147
+ AST_REPLACE: "ast_replace",
148
+ // Other tools
149
+ CALL_AGENT: "call_agent",
150
+ SLASHCOMMAND: "slashcommand",
151
+ SKILL: "skill"
93
152
  };
94
153
  }
95
154
  });
96
155
 
97
- // src/shared/core/constants/id-prefix.ts
98
- var ID_PREFIX;
99
- var init_id_prefix = __esm({
100
- "src/shared/core/constants/id-prefix.ts"() {
156
+ // src/shared/core/constants.ts
157
+ var TIME, MEMORY_LIMITS, CLI_NAME, ID_PREFIX, PATHS, PHASES, LIMITS, STATUS_LABEL, LOG_PREFIX, SHUTDOWN_HANDLERS, MEMORY_CONSTANTS, HOOK_NAMES, TODO_CONSTANTS;
158
+ var init_constants2 = __esm({
159
+ "src/shared/core/constants.ts"() {
101
160
  "use strict";
161
+ init_tool_names();
162
+ TIME = {
163
+ SECOND: 1e3,
164
+ MINUTE: 60 * 1e3,
165
+ HOUR: 60 * 60 * 1e3
166
+ };
167
+ MEMORY_LIMITS = {
168
+ MAX_TASKS_IN_MEMORY: 1e3,
169
+ MAX_NOTIFICATIONS_PER_PARENT: 100,
170
+ MAX_EVENT_HISTORY: 100,
171
+ MAX_TOAST_HISTORY: 50,
172
+ MAX_PROGRESS_HISTORY_PER_SESSION: 100,
173
+ ARCHIVE_AGE_MS: 30 * TIME.MINUTE,
174
+ ERROR_CLEANUP_AGE_MS: 10 * TIME.MINUTE
175
+ };
176
+ CLI_NAME = {
177
+ NPX: "npx",
178
+ TSC: "tsc",
179
+ ESLINT: "eslint",
180
+ RG: "rg",
181
+ SED: "sed",
182
+ AST_GREP: "ast-grep",
183
+ GIT: "git",
184
+ JQ: "jq",
185
+ NODE: "node",
186
+ SH: "sh"
187
+ };
102
188
  ID_PREFIX = {
103
189
  TASK: "task_",
104
190
  JOB: "job_",
@@ -107,14 +193,6 @@ var init_id_prefix = __esm({
107
193
  UNIT_TEST: "UT-",
108
194
  WORKER: "wrk_"
109
195
  };
110
- }
111
- });
112
-
113
- // src/shared/core/constants/paths.ts
114
- var PATHS;
115
- var init_paths = __esm({
116
- "src/shared/core/constants/paths.ts"() {
117
- "use strict";
118
196
  PATHS = {
119
197
  OPENCODE: ".opencode",
120
198
  DOCS: ".opencode/docs",
@@ -136,103 +214,6 @@ var init_paths = __esm({
136
214
  AGENTS_CONFIG: ".opencode/agents.json",
137
215
  PLUGINS: ".opencode/plugins"
138
216
  };
139
- }
140
- });
141
-
142
- // src/shared/core/constants/memory-limits.ts
143
- var MEMORY_LIMITS;
144
- var init_memory_limits = __esm({
145
- "src/shared/core/constants/memory-limits.ts"() {
146
- "use strict";
147
- init_time();
148
- MEMORY_LIMITS = {
149
- MAX_TASKS_IN_MEMORY: 1e3,
150
- MAX_NOTIFICATIONS_PER_PARENT: 100,
151
- MAX_EVENT_HISTORY: 100,
152
- MAX_TOAST_HISTORY: 50,
153
- MAX_PROGRESS_HISTORY_PER_SESSION: 100,
154
- ARCHIVE_AGE_MS: 30 * TIME.MINUTE,
155
- ERROR_CLEANUP_AGE_MS: 10 * TIME.MINUTE
156
- };
157
- }
158
- });
159
-
160
- // src/shared/core/constants/status-labels.ts
161
- var STATUS_LABEL;
162
- var init_status_labels = __esm({
163
- "src/shared/core/constants/status-labels.ts"() {
164
- "use strict";
165
- STATUS_LABEL = {
166
- // Basic States
167
- PENDING: "pending",
168
- QUEUED: "queued",
169
- RUNNING: "running",
170
- IN_PROGRESS: "in_progress",
171
- COMPLETED: "completed",
172
- DONE: "done",
173
- SUCCESS: "success",
174
- // Failure States
175
- FAILED: "failed",
176
- ERROR: "error",
177
- TIMEOUT: "timeout",
178
- CANCELLED: "cancelled",
179
- BLOCKED: "blocked",
180
- // Test/Audit Results
181
- PASS: "pass",
182
- FAIL: "fail",
183
- SKIP: "skip",
184
- // Quality/Cleanliness
185
- CLEAN: "clean",
186
- OK: "ok",
187
- VERIFIED: "verified",
188
- // Analysis/Diagnostic
189
- WARNING: "warning",
190
- INFO: "info",
191
- HINT: "hint",
192
- ALL: "all",
193
- HIGH: "high",
194
- MEDIUM: "medium",
195
- LOW: "low"
196
- };
197
- }
198
- });
199
-
200
- // src/shared/core/constants/limits.ts
201
- var LIMITS;
202
- var init_limits = __esm({
203
- "src/shared/core/constants/limits.ts"() {
204
- "use strict";
205
- LIMITS = {
206
- /** Maximum mission loop iterations */
207
- MAX_ITERATIONS: 1e9,
208
- /** Default scan limit for file listing */
209
- DEFAULT_SCAN_LIMIT: 20,
210
- /** Max message history to check for conclusion */
211
- CONCLUDE_CHECK_HISTORY: 3,
212
- /** Max concurrent tasks per agent */
213
- MAX_TASKS_PER_AGENT: 10,
214
- /** Default history/list limit for UI */
215
- DEFAULT_LIST_LIMIT: 20,
216
- /** Default progress bar width */
217
- DEFAULT_PROGRESS_WIDTH: 20,
218
- /** Maximum time for atomic task (minutes) */
219
- TASK_TIME_LIMIT_MIN: 10
220
- };
221
- }
222
- });
223
-
224
- // src/shared/core/constants/wal-actions.ts
225
- var init_wal_actions = __esm({
226
- "src/shared/core/constants/wal-actions.ts"() {
227
- "use strict";
228
- }
229
- });
230
-
231
- // src/shared/core/constants/phases.ts
232
- var PHASES;
233
- var init_phases = __esm({
234
- "src/shared/core/constants/phases.ts"() {
235
- "use strict";
236
217
  PHASES = {
237
218
  PHASE_0: {
238
219
  ID: "PHASE_0",
@@ -277,70 +258,99 @@ var init_phases = __esm({
277
258
  MANDATORY: true
278
259
  }
279
260
  };
280
- }
281
- });
282
-
283
- // src/shared/tool/constants/tool-names.ts
284
- var TOOL_NAMES;
285
- var init_tool_names = __esm({
286
- "src/shared/tool/constants/tool-names.ts"() {
287
- "use strict";
288
- TOOL_NAMES = {
289
- // Parallel task tools
290
- DELEGATE_TASK: "delegate_task",
291
- GET_TASK_RESULT: "get_task_result",
292
- LIST_TASKS: "list_tasks",
293
- CANCEL_TASK: "cancel_task",
294
- LIST_AGENTS: "list_agents",
295
- SHOW_METRICS: "show_metrics",
296
- UPDATE_TODO: "update_todo",
297
- // Background command tools
298
- RUN_BACKGROUND: "run_background",
299
- CHECK_BACKGROUND: "check_background",
300
- LIST_BACKGROUND: "list_background",
301
- KILL_BACKGROUND: "kill_background",
302
- // Command tools
303
- RUN_COMMAND: "run_command",
304
- // Search tools
305
- GREP_SEARCH: "grep_search",
306
- GLOB_SEARCH: "glob_search",
307
- MGREP: "mgrep",
308
- SED_REPLACE: "sed_replace",
309
- // Diff & Compare tools
310
- DIFF: "diff",
311
- // JSON tools
312
- JQ: "jq",
313
- // HTTP tools
314
- HTTP: "http",
315
- // File tools
316
- FILE_STATS: "file_stats",
317
- // Git tools
318
- GIT_DIFF: "git_diff",
319
- GIT_STATUS: "git_status",
320
- // Web tools
321
- WEBFETCH: "webfetch",
322
- WEBSEARCH: "websearch",
323
- CODESEARCH: "codesearch",
324
- CACHE_DOCS: "cache_docs",
325
- // LSP tools
326
- LSP_DIAGNOSTICS: "lsp_diagnostics",
327
- // AST tools
328
- AST_SEARCH: "ast_search",
329
- AST_REPLACE: "ast_replace",
330
- // Other tools
331
- CALL_AGENT: "call_agent",
332
- SLASHCOMMAND: "slashcommand",
333
- SKILL: "skill"
261
+ LIMITS = {
262
+ /** Maximum mission loop iterations */
263
+ MAX_ITERATIONS: 1e9,
264
+ /** Default scan limit for file listing */
265
+ DEFAULT_SCAN_LIMIT: 20,
266
+ /** Max message history to check for conclusion */
267
+ CONCLUDE_CHECK_HISTORY: 3,
268
+ /** Max concurrent tasks per agent */
269
+ MAX_TASKS_PER_AGENT: 10,
270
+ /** Default history/list limit for UI */
271
+ DEFAULT_LIST_LIMIT: 20,
272
+ /** Default progress bar width */
273
+ DEFAULT_PROGRESS_WIDTH: 20,
274
+ /** Maximum time for atomic task (minutes) */
275
+ TASK_TIME_LIMIT_MIN: 10
276
+ };
277
+ STATUS_LABEL = {
278
+ // Basic States
279
+ PENDING: "pending",
280
+ QUEUED: "queued",
281
+ RUNNING: "running",
282
+ IN_PROGRESS: "in_progress",
283
+ COMPLETED: "completed",
284
+ DONE: "done",
285
+ SUCCESS: "success",
286
+ // Failure States
287
+ FAILED: "failed",
288
+ ERROR: "error",
289
+ TIMEOUT: "timeout",
290
+ CANCELLED: "cancelled",
291
+ BLOCKED: "blocked",
292
+ // Test/Audit Results
293
+ PASS: "pass",
294
+ FAIL: "fail",
295
+ SKIP: "skip",
296
+ // Quality/Cleanliness
297
+ CLEAN: "clean",
298
+ OK: "ok",
299
+ VERIFIED: "verified",
300
+ // Analysis/Diagnostic
301
+ WARNING: "warning",
302
+ INFO: "info",
303
+ HINT: "hint",
304
+ ALL: "all",
305
+ HIGH: "high",
306
+ MEDIUM: "medium",
307
+ LOW: "low"
308
+ };
309
+ LOG_PREFIX = {
310
+ /** Rust Tool pool operations */
311
+ RUST_TOOL: "RustTool",
312
+ RUST_POOL: "RustPool",
313
+ /** LSP diagnostics caching */
314
+ DIAGNOSTICS_CACHE: "DiagnosticsCache",
315
+ /** Context window monitoring */
316
+ CONTEXT_WINDOW_MONITOR: "context-window-monitor",
317
+ /** Memory management */
318
+ MEMORY_MANAGER: "MemoryManager",
319
+ /** Plugin system */
320
+ PLUGIN_MANAGER: "PluginManager",
321
+ /** OS notifications */
322
+ SESSION_NOTIFY: "session-notify",
323
+ /** Session recovery */
324
+ SESSION_RECOVERY: "session-recovery",
325
+ /** Lifecycle management */
326
+ SHUTDOWN_MANAGER: "ShutdownManager",
327
+ /** Agent registry */
328
+ AGENT_REGISTRY: "AgentRegistry",
329
+ /** Task synchronization */
330
+ TODO_SYNC: "TodoSync",
331
+ /** Cleanup scheduler */
332
+ CLEANUP_SCHEDULER: "CleanupScheduler",
333
+ /** Background task management */
334
+ BACKGROUND_TASK_MANAGER: "BackgroundTaskManager",
335
+ /** Parallel agent management */
336
+ PARALLEL_AGENT_MANAGER: "ParallelAgentManager",
337
+ /** File watching */
338
+ FILE_WATCHER: "FileWatcher"
339
+ };
340
+ SHUTDOWN_HANDLERS = {
341
+ /** TodoSyncService - Syncs TODO state via file watching */
342
+ TODO_SYNC_SERVICE: "TodoSyncService",
343
+ /** CleanupScheduler - Manages periodic cleanup tasks */
344
+ CLEANUP_SCHEDULER: "CleanupScheduler",
345
+ /** RustToolPool - Manages Rust tool instances */
346
+ RUST_TOOL_POOL: "RustToolPool",
347
+ /** BackgroundTaskManager - Manages background command execution */
348
+ BACKGROUND_TASK_MANAGER: "BackgroundTaskManager",
349
+ /** ParallelAgentManager - Manages parallel agent task execution */
350
+ PARALLEL_AGENT_MANAGER: "ParallelAgentManager",
351
+ /** PluginManager - Manages dynamic plugin lifecycle */
352
+ PLUGIN_MANAGER: "PluginManager"
334
353
  };
335
- }
336
- });
337
-
338
- // src/shared/core/constants/memory-hooks.ts
339
- var MEMORY_CONSTANTS, HOOK_NAMES, TODO_CONSTANTS;
340
- var init_memory_hooks = __esm({
341
- "src/shared/core/constants/memory-hooks.ts"() {
342
- "use strict";
343
- init_tool_names();
344
354
  MEMORY_CONSTANTS = {
345
355
  ID_PREFIX: "mem_",
346
356
  LEVELS: {
@@ -407,106 +417,6 @@ var init_memory_hooks = __esm({
407
417
  }
408
418
  });
409
419
 
410
- // src/shared/core/constants/lifecycle.ts
411
- var SHUTDOWN_HANDLERS;
412
- var init_lifecycle = __esm({
413
- "src/shared/core/constants/lifecycle.ts"() {
414
- "use strict";
415
- SHUTDOWN_HANDLERS = {
416
- /** TodoSyncService - Syncs TODO state via file watching */
417
- TODO_SYNC_SERVICE: "TodoSyncService",
418
- /** CleanupScheduler - Manages periodic cleanup tasks */
419
- CLEANUP_SCHEDULER: "CleanupScheduler",
420
- /** RustToolPool - Manages Rust tool instances */
421
- RUST_TOOL_POOL: "RustToolPool",
422
- /** BackgroundTaskManager - Manages background command execution */
423
- BACKGROUND_TASK_MANAGER: "BackgroundTaskManager",
424
- /** ParallelAgentManager - Manages parallel agent task execution */
425
- PARALLEL_AGENT_MANAGER: "ParallelAgentManager",
426
- /** PluginManager - Manages dynamic plugin lifecycle */
427
- PLUGIN_MANAGER: "PluginManager"
428
- };
429
- }
430
- });
431
-
432
- // src/shared/core/constants/logging.ts
433
- var LOG_PREFIX;
434
- var init_logging = __esm({
435
- "src/shared/core/constants/logging.ts"() {
436
- "use strict";
437
- LOG_PREFIX = {
438
- /** Rust Tool pool operations */
439
- RUST_TOOL: "RustTool",
440
- RUST_POOL: "RustPool",
441
- /** LSP diagnostics caching */
442
- DIAGNOSTICS_CACHE: "DiagnosticsCache",
443
- /** Context window monitoring */
444
- CONTEXT_WINDOW_MONITOR: "context-window-monitor",
445
- /** Memory management */
446
- MEMORY_MANAGER: "MemoryManager",
447
- /** Plugin system */
448
- PLUGIN_MANAGER: "PluginManager",
449
- /** OS notifications */
450
- SESSION_NOTIFY: "session-notify",
451
- /** Session recovery */
452
- SESSION_RECOVERY: "session-recovery",
453
- /** Lifecycle management */
454
- SHUTDOWN_MANAGER: "ShutdownManager",
455
- /** Agent registry */
456
- AGENT_REGISTRY: "AgentRegistry",
457
- /** Task synchronization */
458
- TODO_SYNC: "TodoSync",
459
- /** Cleanup scheduler */
460
- CLEANUP_SCHEDULER: "CleanupScheduler",
461
- /** Background task management */
462
- BACKGROUND_TASK_MANAGER: "BackgroundTaskManager",
463
- /** Parallel agent management */
464
- PARALLEL_AGENT_MANAGER: "ParallelAgentManager",
465
- /** File watching */
466
- FILE_WATCHER: "FileWatcher"
467
- };
468
- }
469
- });
470
-
471
- // src/shared/core/constants/cli.ts
472
- var CLI_NAME;
473
- var init_cli = __esm({
474
- "src/shared/core/constants/cli.ts"() {
475
- "use strict";
476
- CLI_NAME = {
477
- NPX: "npx",
478
- TSC: "tsc",
479
- ESLINT: "eslint",
480
- RG: "rg",
481
- SED: "sed",
482
- AST_GREP: "ast-grep",
483
- GIT: "git",
484
- JQ: "jq",
485
- NODE: "node",
486
- SH: "sh"
487
- };
488
- }
489
- });
490
-
491
- // src/shared/core/constants/index.ts
492
- var init_constants2 = __esm({
493
- "src/shared/core/constants/index.ts"() {
494
- "use strict";
495
- init_time();
496
- init_id_prefix();
497
- init_paths();
498
- init_memory_limits();
499
- init_status_labels();
500
- init_limits();
501
- init_wal_actions();
502
- init_phases();
503
- init_memory_hooks();
504
- init_lifecycle();
505
- init_logging();
506
- init_cli();
507
- }
508
- });
509
-
510
420
  // src/shared/core/index.ts
511
421
  var init_core = __esm({
512
422
  "src/shared/core/index.ts"() {
@@ -515,12 +425,32 @@ var init_core = __esm({
515
425
  }
516
426
  });
517
427
 
518
- // src/shared/task/constants/parallel-task.ts
519
- var PARALLEL_LABEL, PARALLEL_TASK;
520
- var init_parallel_task = __esm({
521
- "src/shared/task/constants/parallel-task.ts"() {
428
+ // src/shared/task/constants.ts
429
+ var BACKGROUND_STATUS, BACKGROUND_TASK, TASK_METADATA, PARALLEL_LABEL, PARALLEL_TASK;
430
+ var init_constants3 = __esm({
431
+ "src/shared/task/constants.ts"() {
522
432
  "use strict";
523
- init_time();
433
+ init_constants2();
434
+ BACKGROUND_STATUS = {
435
+ RUNNING: "running",
436
+ DONE: "done",
437
+ ERROR: "error",
438
+ TIMEOUT: "timeout"
439
+ };
440
+ BACKGROUND_TASK = {
441
+ DEFAULT_TIMEOUT_MS: 5 * TIME.MINUTE,
442
+ MAX_OUTPUT_LENGTH: 1e4,
443
+ MAX_CONCURRENT: 5,
444
+ POLL_INTERVAL_MS: 500,
445
+ RETRY_COOLDOWN_MS: 30 * TIME.SECOND
446
+ };
447
+ TASK_METADATA = {
448
+ PARALLEL: "parallel",
449
+ PARALLEL_GROUP: "parallel_group",
450
+ DEPENDS: "depends",
451
+ AGENT: "agent",
452
+ SIZE: "size"
453
+ };
524
454
  PARALLEL_LABEL = "parallel";
525
455
  PARALLEL_TASK = {
526
456
  // Task lifecycle (24 hours for long tasks)
@@ -569,72 +499,9 @@ var init_parallel_task = __esm({
569
499
  }
570
500
  });
571
501
 
572
- // src/shared/task/constants/background-task.ts
573
- var BACKGROUND_TASK;
574
- var init_background_task = __esm({
575
- "src/shared/task/constants/background-task.ts"() {
576
- "use strict";
577
- init_time();
578
- BACKGROUND_TASK = {
579
- DEFAULT_TIMEOUT_MS: 5 * TIME.MINUTE,
580
- MAX_OUTPUT_LENGTH: 1e4,
581
- MAX_CONCURRENT: 5,
582
- POLL_INTERVAL_MS: 500,
583
- RETRY_COOLDOWN_MS: 30 * TIME.SECOND
584
- };
585
- }
586
- });
587
-
588
- // src/shared/task/constants/background-status.ts
589
- var BACKGROUND_STATUS;
590
- var init_background_status = __esm({
591
- "src/shared/task/constants/background-status.ts"() {
592
- "use strict";
593
- BACKGROUND_STATUS = {
594
- RUNNING: "running",
595
- DONE: "done",
596
- ERROR: "error",
597
- TIMEOUT: "timeout"
598
- };
599
- }
600
- });
601
-
602
- // src/shared/task/constants/metadata-keys.ts
603
- var TASK_METADATA;
604
- var init_metadata_keys = __esm({
605
- "src/shared/task/constants/metadata-keys.ts"() {
606
- "use strict";
607
- TASK_METADATA = {
608
- PARALLEL: "parallel",
609
- PARALLEL_GROUP: "parallel_group",
610
- DEPENDS: "depends",
611
- AGENT: "agent",
612
- SIZE: "size"
613
- };
614
- }
615
- });
616
-
617
- // src/shared/task/constants/index.ts
618
- var init_constants3 = __esm({
619
- "src/shared/task/constants/index.ts"() {
620
- "use strict";
621
- init_parallel_task();
622
- init_background_task();
623
- init_background_status();
624
- init_metadata_keys();
625
- }
626
- });
627
-
628
- // src/shared/task/interfaces/index.ts
629
- var init_interfaces2 = __esm({
630
- "src/shared/task/interfaces/index.ts"() {
631
- "use strict";
632
- }
633
- });
634
-
635
- // src/shared/task/types/index.ts
502
+ // src/shared/task/types.ts
636
503
  var init_types2 = __esm({
637
- "src/shared/task/types/index.ts"() {
504
+ "src/shared/task/types.ts"() {
638
505
  "use strict";
639
506
  }
640
507
  });
@@ -644,18 +511,16 @@ var init_task = __esm({
644
511
  "src/shared/task/index.ts"() {
645
512
  "use strict";
646
513
  init_constants3();
647
- init_interfaces2();
648
514
  init_types2();
649
515
  }
650
516
  });
651
517
 
652
- // src/shared/loop/constants/loop.ts
653
- var LOOP;
654
- var init_loop = __esm({
655
- "src/shared/loop/constants/loop.ts"() {
518
+ // src/shared/loop/constants.ts
519
+ var LOOP, MISSION_CONTROL, TASK_STATUS, TODO_STATUS, LOOP_LABELS;
520
+ var init_constants4 = __esm({
521
+ "src/shared/loop/constants.ts"() {
656
522
  "use strict";
657
- init_time();
658
- init_limits();
523
+ init_constants2();
659
524
  LOOP = {
660
525
  /** Countdown seconds before auto-continuation */
661
526
  COUNTDOWN_SECONDS: 3,
@@ -670,15 +535,6 @@ var init_loop = __esm({
670
535
  /** Rust tool timeout */
671
536
  RUST_TOOL_TIMEOUT_MS: 60 * TIME.SECOND
672
537
  };
673
- }
674
- });
675
-
676
- // src/shared/loop/constants/mission-control.ts
677
- var MISSION_CONTROL;
678
- var init_mission_control = __esm({
679
- "src/shared/loop/constants/mission-control.ts"() {
680
- "use strict";
681
- init_limits();
682
538
  MISSION_CONTROL = {
683
539
  DEFAULT_MAX_ITERATIONS: LIMITS.MAX_ITERATIONS,
684
540
  DEFAULT_COUNTDOWN_SECONDS: 3,
@@ -687,15 +543,6 @@ var init_mission_control = __esm({
687
543
  CANCEL_COMMAND: "/cancel",
688
544
  LOG_SOURCE: "mission-loop"
689
545
  };
690
- }
691
- });
692
-
693
- // src/shared/loop/constants/task-status.ts
694
- var TASK_STATUS;
695
- var init_task_status = __esm({
696
- "src/shared/loop/constants/task-status.ts"() {
697
- "use strict";
698
- init_status_labels();
699
546
  TASK_STATUS = {
700
547
  PENDING: STATUS_LABEL.PENDING,
701
548
  RUNNING: STATUS_LABEL.RUNNING,
@@ -705,29 +552,12 @@ var init_task_status = __esm({
705
552
  TIMEOUT: STATUS_LABEL.TIMEOUT,
706
553
  CANCELLED: STATUS_LABEL.CANCELLED
707
554
  };
708
- }
709
- });
710
-
711
- // src/shared/loop/constants/todo-status.ts
712
- var TODO_STATUS;
713
- var init_todo_status = __esm({
714
- "src/shared/loop/constants/todo-status.ts"() {
715
- "use strict";
716
- init_status_labels();
717
555
  TODO_STATUS = {
718
556
  PENDING: STATUS_LABEL.PENDING,
719
557
  IN_PROGRESS: STATUS_LABEL.IN_PROGRESS,
720
558
  COMPLETED: STATUS_LABEL.COMPLETED,
721
559
  CANCELLED: STATUS_LABEL.CANCELLED
722
560
  };
723
- }
724
- });
725
-
726
- // src/shared/loop/constants/labels.ts
727
- var LOOP_LABELS;
728
- var init_labels = __esm({
729
- "src/shared/loop/constants/labels.ts"() {
730
- "use strict";
731
561
  LOOP_LABELS = {
732
562
  // Progress
733
563
  PROGRESS_PREFIX: "[TODO Progress]:",
@@ -767,72 +597,28 @@ var init_labels = __esm({
767
597
  }
768
598
  });
769
599
 
770
- // src/shared/loop/constants/index.ts
771
- var init_constants4 = __esm({
772
- "src/shared/loop/constants/index.ts"() {
773
- "use strict";
774
- init_loop();
775
- init_mission_control();
776
- init_task_status();
777
- init_todo_status();
778
- init_labels();
779
- }
780
- });
781
-
782
- // src/shared/loop/interfaces/todo.ts
783
- var init_todo = __esm({
784
- "src/shared/loop/interfaces/todo.ts"() {
785
- "use strict";
786
- }
787
- });
788
-
789
- // src/shared/loop/interfaces/todo-stats.ts
790
- var init_todo_stats = __esm({
791
- "src/shared/loop/interfaces/todo-stats.ts"() {
792
- "use strict";
793
- }
794
- });
795
-
796
- // src/shared/loop/interfaces/mission-loop.ts
797
- var init_mission_loop = __esm({
798
- "src/shared/loop/interfaces/mission-loop.ts"() {
799
- "use strict";
800
- }
801
- });
802
-
803
- // src/shared/loop/interfaces/index.ts
804
- var init_interfaces3 = __esm({
805
- "src/shared/loop/interfaces/index.ts"() {
806
- "use strict";
807
- init_todo();
808
- init_todo_stats();
809
- init_mission_loop();
810
- }
811
- });
812
-
813
- // src/shared/loop/types/index.ts
600
+ // src/shared/loop/types.ts
814
601
  var init_types3 = __esm({
815
- "src/shared/loop/types/index.ts"() {
602
+ "src/shared/loop/types.ts"() {
816
603
  "use strict";
817
604
  }
818
605
  });
819
606
 
820
607
  // src/shared/loop/index.ts
821
- var init_loop2 = __esm({
608
+ var init_loop = __esm({
822
609
  "src/shared/loop/index.ts"() {
823
610
  "use strict";
824
611
  init_constants4();
825
- init_interfaces3();
826
612
  init_types3();
827
613
  }
828
614
  });
829
615
 
830
- // src/shared/notification/constants/toast-duration.ts
831
- var TOAST_DURATION;
832
- var init_toast_duration = __esm({
833
- "src/shared/notification/constants/toast-duration.ts"() {
616
+ // src/shared/notification/constants.ts
617
+ var TOAST_DURATION, TOAST_VARIANTS, TUI_ICONS, TUI_BLOCKS, TUI_TAGS, TUI_MESSAGES;
618
+ var init_constants5 = __esm({
619
+ "src/shared/notification/constants.ts"() {
834
620
  "use strict";
835
- init_time();
621
+ init_constants2();
836
622
  TOAST_DURATION = {
837
623
  /** Extra short: 1.5 seconds */
838
624
  EXTRA_SHORT: 1500,
@@ -849,14 +635,12 @@ var init_toast_duration = __esm({
849
635
  /** Persistent: 0 (stays until dismissed) */
850
636
  PERSISTENT: 0
851
637
  };
852
- }
853
- });
854
-
855
- // src/shared/notification/constants/tui.const.ts
856
- var TUI_ICONS, TUI_BLOCKS, TUI_TAGS, TUI_MESSAGES;
857
- var init_tui_const = __esm({
858
- "src/shared/notification/constants/tui.const.ts"() {
859
- "use strict";
638
+ TOAST_VARIANTS = {
639
+ INFO: "info",
640
+ SUCCESS: "success",
641
+ WARNING: "warning",
642
+ ERROR: "error"
643
+ };
860
644
  TUI_ICONS = {
861
645
  RUNNING: "\u26A1",
862
646
  QUEUED: "\u23F3",
@@ -881,48 +665,9 @@ var init_tui_const = __esm({
881
665
  }
882
666
  });
883
667
 
884
- // src/shared/notification/constants/toast-variants.ts
885
- var TOAST_VARIANTS;
886
- var init_toast_variants = __esm({
887
- "src/shared/notification/constants/toast-variants.ts"() {
888
- "use strict";
889
- TOAST_VARIANTS = {
890
- INFO: "info",
891
- SUCCESS: "success",
892
- WARNING: "warning",
893
- ERROR: "error"
894
- };
895
- }
896
- });
897
-
898
- // src/shared/notification/constants/index.ts
899
- var init_constants5 = __esm({
900
- "src/shared/notification/constants/index.ts"() {
901
- "use strict";
902
- init_toast_duration();
903
- init_tui_const();
904
- init_toast_variants();
905
- }
906
- });
907
-
908
- // src/shared/notification/interfaces/task-toast.interface.ts
909
- var init_task_toast_interface = __esm({
910
- "src/shared/notification/interfaces/task-toast.interface.ts"() {
911
- "use strict";
912
- }
913
- });
914
-
915
- // src/shared/notification/interfaces/index.ts
916
- var init_interfaces4 = __esm({
917
- "src/shared/notification/interfaces/index.ts"() {
918
- "use strict";
919
- init_task_toast_interface();
920
- }
921
- });
922
-
923
- // src/shared/notification/types/index.ts
668
+ // src/shared/notification/types.ts
924
669
  var init_types4 = __esm({
925
- "src/shared/notification/types/index.ts"() {
670
+ "src/shared/notification/types.ts"() {
926
671
  "use strict";
927
672
  }
928
673
  });
@@ -1073,13 +818,36 @@ var init_toast_core = __esm({
1073
818
  }
1074
819
  });
1075
820
 
1076
- // src/shared/notification/presets/task-lifecycle.ts
1077
- var taskStarted, taskCompleted, taskFailed, allTasksComplete;
1078
- var init_task_lifecycle = __esm({
1079
- "src/shared/notification/presets/task-lifecycle.ts"() {
821
+ // src/shared/notification/presets.ts
822
+ var presets_exports = {};
823
+ __export(presets_exports, {
824
+ allTasksComplete: () => allTasksComplete,
825
+ concurrencyAcquired: () => concurrencyAcquired,
826
+ concurrencyReleased: () => concurrencyReleased,
827
+ documentCached: () => documentCached,
828
+ errorRecovery: () => errorRecovery,
829
+ missionComplete: () => missionComplete,
830
+ missionStarted: () => missionStarted,
831
+ parallelTasksLaunched: () => parallelTasksLaunched,
832
+ researchStarted: () => researchStarted,
833
+ sessionCompleted: () => sessionCompleted,
834
+ sessionCreated: () => sessionCreated,
835
+ sessionResumed: () => sessionResumed,
836
+ taskCompleted: () => taskCompleted,
837
+ taskFailed: () => taskFailed,
838
+ taskStarted: () => taskStarted,
839
+ toolExecuted: () => toolExecuted,
840
+ warningMaxDepth: () => warningMaxDepth,
841
+ warningMaxRetries: () => warningMaxRetries,
842
+ warningRateLimited: () => warningRateLimited
843
+ });
844
+ var taskStarted, taskCompleted, taskFailed, allTasksComplete, sessionCreated, sessionResumed, sessionCompleted, parallelTasksLaunched, concurrencyAcquired, concurrencyReleased, missionComplete, missionStarted, toolExecuted, documentCached, researchStarted, warningRateLimited, errorRecovery, warningMaxDepth, warningMaxRetries;
845
+ var init_presets = __esm({
846
+ "src/shared/notification/presets.ts"() {
1080
847
  "use strict";
1081
848
  init_toast_core();
1082
849
  init_constants5();
850
+ init_shared();
1083
851
  taskStarted = (taskId, agent) => show({
1084
852
  title: "Task Started",
1085
853
  message: `${agent}: ${taskId}`,
@@ -1104,16 +872,6 @@ var init_task_lifecycle = __esm({
1104
872
  variant: TOAST_VARIANTS.SUCCESS,
1105
873
  duration: 5e3
1106
874
  });
1107
- }
1108
- });
1109
-
1110
- // src/shared/notification/presets/session.ts
1111
- var sessionCreated, sessionResumed, sessionCompleted;
1112
- var init_session = __esm({
1113
- "src/shared/notification/presets/session.ts"() {
1114
- "use strict";
1115
- init_toast_core();
1116
- init_shared();
1117
875
  sessionCreated = (sessionId, agent) => show({
1118
876
  title: "Session Created",
1119
877
  message: `${agent} - ${sessionId.slice(0, 12)}...`,
@@ -1132,16 +890,6 @@ var init_session = __esm({
1132
890
  variant: STATUS_LABEL.SUCCESS,
1133
891
  duration: TOAST_DURATION.MEDIUM
1134
892
  });
1135
- }
1136
- });
1137
-
1138
- // src/shared/notification/presets/parallel.ts
1139
- var parallelTasksLaunched, concurrencyAcquired, concurrencyReleased;
1140
- var init_parallel = __esm({
1141
- "src/shared/notification/presets/parallel.ts"() {
1142
- "use strict";
1143
- init_toast_core();
1144
- init_shared();
1145
893
  parallelTasksLaunched = (count, agents) => show({
1146
894
  title: "Parallel Tasks Launched",
1147
895
  message: `${count} tasks: ${agents.join(", ")}`,
@@ -1160,16 +908,6 @@ var init_parallel = __esm({
1160
908
  variant: "info",
1161
909
  duration: TOAST_DURATION.EXTRA_SHORT
1162
910
  });
1163
- }
1164
- });
1165
-
1166
- // src/shared/notification/presets/mission.ts
1167
- var missionComplete, missionStarted;
1168
- var init_mission = __esm({
1169
- "src/shared/notification/presets/mission.ts"() {
1170
- "use strict";
1171
- init_toast_core();
1172
- init_constants5();
1173
911
  missionComplete = (summary) => show({
1174
912
  title: "Mission Complete",
1175
913
  message: summary,
@@ -1178,20 +916,10 @@ var init_mission = __esm({
1178
916
  });
1179
917
  missionStarted = (description) => show({
1180
918
  title: "Mission Started",
1181
- message: description.slice(0, 100),
1182
- variant: TOAST_VARIANTS.INFO,
1183
- duration: 4e3
1184
- });
1185
- }
1186
- });
1187
-
1188
- // src/shared/notification/presets/tools.ts
1189
- var toolExecuted, documentCached, researchStarted;
1190
- var init_tools = __esm({
1191
- "src/shared/notification/presets/tools.ts"() {
1192
- "use strict";
1193
- init_toast_core();
1194
- init_shared();
919
+ message: description.slice(0, 100),
920
+ variant: TOAST_VARIANTS.INFO,
921
+ duration: 4e3
922
+ });
1195
923
  toolExecuted = (toolName, target) => show({
1196
924
  title: toolName,
1197
925
  message: target.slice(0, 80),
@@ -1210,16 +938,6 @@ var init_tools = __esm({
1210
938
  variant: "info",
1211
939
  duration: TOAST_DURATION.MEDIUM
1212
940
  });
1213
- }
1214
- });
1215
-
1216
- // src/shared/notification/presets/warnings.ts
1217
- var warningRateLimited, errorRecovery, warningMaxDepth, warningMaxRetries;
1218
- var init_warnings = __esm({
1219
- "src/shared/notification/presets/warnings.ts"() {
1220
- "use strict";
1221
- init_toast_core();
1222
- init_shared();
1223
941
  warningRateLimited = () => show({
1224
942
  title: "Rate Limited",
1225
943
  message: "Waiting before retry...",
@@ -1247,58 +965,22 @@ var init_warnings = __esm({
1247
965
  }
1248
966
  });
1249
967
 
1250
- // src/shared/notification/presets/index.ts
1251
- var presets_exports = {};
1252
- __export(presets_exports, {
1253
- allTasksComplete: () => allTasksComplete,
1254
- concurrencyAcquired: () => concurrencyAcquired,
1255
- concurrencyReleased: () => concurrencyReleased,
1256
- documentCached: () => documentCached,
1257
- errorRecovery: () => errorRecovery,
1258
- missionComplete: () => missionComplete,
1259
- missionStarted: () => missionStarted,
1260
- parallelTasksLaunched: () => parallelTasksLaunched,
1261
- researchStarted: () => researchStarted,
1262
- sessionCompleted: () => sessionCompleted,
1263
- sessionCreated: () => sessionCreated,
1264
- sessionResumed: () => sessionResumed,
1265
- taskCompleted: () => taskCompleted,
1266
- taskFailed: () => taskFailed,
1267
- taskStarted: () => taskStarted,
1268
- toolExecuted: () => toolExecuted,
1269
- warningMaxDepth: () => warningMaxDepth,
1270
- warningMaxRetries: () => warningMaxRetries,
1271
- warningRateLimited: () => warningRateLimited
1272
- });
1273
- var init_presets = __esm({
1274
- "src/shared/notification/presets/index.ts"() {
1275
- "use strict";
1276
- init_task_lifecycle();
1277
- init_session();
1278
- init_parallel();
1279
- init_mission();
1280
- init_tools();
1281
- init_warnings();
1282
- }
1283
- });
1284
-
1285
968
  // src/shared/notification/index.ts
1286
969
  var init_notification = __esm({
1287
970
  "src/shared/notification/index.ts"() {
1288
971
  "use strict";
1289
972
  init_constants5();
1290
- init_interfaces4();
1291
973
  init_types4();
1292
974
  init_presets();
1293
975
  }
1294
976
  });
1295
977
 
1296
- // src/shared/recovery/constants/recovery.ts
1297
- var RECOVERY;
1298
- var init_recovery = __esm({
1299
- "src/shared/recovery/constants/recovery.ts"() {
978
+ // src/shared/recovery/constants.ts
979
+ var RECOVERY, HISTORY, RECOVERY_LEVEL, RECOVERY_PRINCIPLE;
980
+ var init_constants6 = __esm({
981
+ "src/shared/recovery/constants.ts"() {
1300
982
  "use strict";
1301
- init_time();
983
+ init_constants2();
1302
984
  RECOVERY = {
1303
985
  /** Maximum recovery attempts per session */
1304
986
  MAX_ATTEMPTS: 3,
@@ -1309,14 +991,6 @@ var init_recovery = __esm({
1309
991
  /** Maximum retry multiplier */
1310
992
  MAX_RETRY_MULTIPLIER: 5
1311
993
  };
1312
- }
1313
- });
1314
-
1315
- // src/shared/recovery/constants/history.ts
1316
- var HISTORY;
1317
- var init_history = __esm({
1318
- "src/shared/recovery/constants/history.ts"() {
1319
- "use strict";
1320
994
  HISTORY = {
1321
995
  /** Recovery history max entries */
1322
996
  MAX_RECOVERY: 100,
@@ -1325,14 +999,6 @@ var init_history = __esm({
1325
999
  /** Progress store max entries */
1326
1000
  MAX_PROGRESS: 100
1327
1001
  };
1328
- }
1329
- });
1330
-
1331
- // src/shared/recovery/constants/recovery-level.ts
1332
- var RECOVERY_LEVEL, RECOVERY_PRINCIPLE;
1333
- var init_recovery_level = __esm({
1334
- "src/shared/recovery/constants/recovery-level.ts"() {
1335
- "use strict";
1336
1002
  RECOVERY_LEVEL = {
1337
1003
  /** Level 1: Split task into smaller units */
1338
1004
  DECOMPOSE: "DECOMPOSE",
@@ -1345,46 +1011,28 @@ var init_recovery_level = __esm({
1345
1011
  }
1346
1012
  });
1347
1013
 
1348
- // src/shared/recovery/constants/index.ts
1349
- var init_constants6 = __esm({
1350
- "src/shared/recovery/constants/index.ts"() {
1351
- "use strict";
1352
- init_recovery();
1353
- init_history();
1354
- init_recovery_level();
1355
- }
1356
- });
1357
-
1358
- // src/shared/recovery/interfaces/index.ts
1359
- var init_interfaces5 = __esm({
1360
- "src/shared/recovery/interfaces/index.ts"() {
1361
- "use strict";
1362
- }
1363
- });
1364
-
1365
- // src/shared/recovery/types/index.ts
1014
+ // src/shared/recovery/types.ts
1366
1015
  var init_types5 = __esm({
1367
- "src/shared/recovery/types/index.ts"() {
1016
+ "src/shared/recovery/types.ts"() {
1368
1017
  "use strict";
1369
1018
  }
1370
1019
  });
1371
1020
 
1372
1021
  // src/shared/recovery/index.ts
1373
- var init_recovery2 = __esm({
1022
+ var init_recovery = __esm({
1374
1023
  "src/shared/recovery/index.ts"() {
1375
1024
  "use strict";
1376
1025
  init_constants6();
1377
- init_interfaces5();
1378
1026
  init_types5();
1379
1027
  }
1380
1028
  });
1381
1029
 
1382
- // src/shared/cache/constants/cache.ts
1383
- var CACHE;
1384
- var init_cache = __esm({
1385
- "src/shared/cache/constants/cache.ts"() {
1030
+ // src/shared/cache/constants.ts
1031
+ var CACHE, CACHE_ACTIONS, FILTER_STATUS;
1032
+ var init_constants7 = __esm({
1033
+ "src/shared/cache/constants.ts"() {
1386
1034
  "use strict";
1387
- init_time();
1035
+ init_constants2();
1388
1036
  CACHE = {
1389
1037
  /** Default cache TTL (24 hours) */
1390
1038
  DEFAULT_TTL_MS: 24 * TIME.HOUR,
@@ -1393,28 +1041,12 @@ var init_cache = __esm({
1393
1041
  /** Session TTL (24 hours for long tasks) */
1394
1042
  SESSION_TTL_MS: 24 * TIME.HOUR
1395
1043
  };
1396
- }
1397
- });
1398
-
1399
- // src/shared/cache/constants/cache-actions.ts
1400
- var CACHE_ACTIONS;
1401
- var init_cache_actions = __esm({
1402
- "src/shared/cache/constants/cache-actions.ts"() {
1403
- "use strict";
1404
1044
  CACHE_ACTIONS = {
1405
1045
  LIST: "list",
1406
1046
  GET: "get",
1407
1047
  CLEAR: "clear",
1408
1048
  STATS: "stats"
1409
1049
  };
1410
- }
1411
- });
1412
-
1413
- // src/shared/cache/constants/filter-status.ts
1414
- var FILTER_STATUS;
1415
- var init_filter_status = __esm({
1416
- "src/shared/cache/constants/filter-status.ts"() {
1417
- "use strict";
1418
1050
  FILTER_STATUS = {
1419
1051
  ALL: "all",
1420
1052
  RUNNING: "running",
@@ -1426,28 +1058,18 @@ var init_filter_status = __esm({
1426
1058
  }
1427
1059
  });
1428
1060
 
1429
- // src/shared/cache/constants/index.ts
1430
- var init_constants7 = __esm({
1431
- "src/shared/cache/constants/index.ts"() {
1432
- "use strict";
1433
- init_cache();
1434
- init_cache_actions();
1435
- init_filter_status();
1436
- }
1437
- });
1438
-
1439
1061
  // src/shared/cache/index.ts
1440
- var init_cache2 = __esm({
1062
+ var init_cache = __esm({
1441
1063
  "src/shared/cache/index.ts"() {
1442
1064
  "use strict";
1443
1065
  init_constants7();
1444
1066
  }
1445
1067
  });
1446
1068
 
1447
- // src/shared/session/constants/events/task-events.ts
1448
- var TASK_EVENTS;
1449
- var init_task_events = __esm({
1450
- "src/shared/session/constants/events/task-events.ts"() {
1069
+ // src/shared/session/constants.ts
1070
+ var TASK_EVENTS, TODO_EVENTS, SESSION_EVENTS, DOCUMENT_EVENTS, MISSION_EVENTS, MESSAGE_EVENTS, SPECIAL_EVENTS, EVENT_TYPES;
1071
+ var init_constants8 = __esm({
1072
+ "src/shared/session/constants.ts"() {
1451
1073
  "use strict";
1452
1074
  TASK_EVENTS = {
1453
1075
  STARTED: "task.started",
@@ -1455,27 +1077,11 @@ var init_task_events = __esm({
1455
1077
  FAILED: "task.failed",
1456
1078
  CANCELLED: "task.cancelled"
1457
1079
  };
1458
- }
1459
- });
1460
-
1461
- // src/shared/session/constants/events/todo-events.ts
1462
- var TODO_EVENTS;
1463
- var init_todo_events = __esm({
1464
- "src/shared/session/constants/events/todo-events.ts"() {
1465
- "use strict";
1466
1080
  TODO_EVENTS = {
1467
1081
  CREATED: "todo.created",
1468
1082
  UPDATED: "todo.updated",
1469
1083
  COMPLETED: "todo.completed"
1470
1084
  };
1471
- }
1472
- });
1473
-
1474
- // src/shared/session/constants/events/session-events.ts
1475
- var SESSION_EVENTS;
1476
- var init_session_events = __esm({
1477
- "src/shared/session/constants/events/session-events.ts"() {
1478
- "use strict";
1479
1085
  SESSION_EVENTS = {
1480
1086
  IDLE: "session.idle",
1481
1087
  STATUS: "session.status",
@@ -1486,75 +1092,21 @@ var init_session_events = __esm({
1486
1092
  DELETED: "session.deleted",
1487
1093
  CREATED: "session.created"
1488
1094
  };
1489
- }
1490
- });
1491
-
1492
- // src/shared/session/constants/events/document-events.ts
1493
- var DOCUMENT_EVENTS;
1494
- var init_document_events = __esm({
1495
- "src/shared/session/constants/events/document-events.ts"() {
1496
- "use strict";
1497
1095
  DOCUMENT_EVENTS = {
1498
1096
  CACHED: "document.cached",
1499
1097
  EXPIRED: "document.expired"
1500
1098
  };
1501
- }
1502
- });
1503
-
1504
- // src/shared/session/constants/events/mission-events.ts
1505
- var MISSION_EVENTS;
1506
- var init_mission_events = __esm({
1507
- "src/shared/session/constants/events/mission-events.ts"() {
1508
- "use strict";
1509
1099
  MISSION_EVENTS = {
1510
1100
  COMPLETE: "mission.complete",
1511
1101
  FAILED: "mission.failed",
1512
1102
  ALL_TASKS_COMPLETE: "all_tasks.complete"
1513
1103
  };
1514
- }
1515
- });
1516
-
1517
- // src/shared/session/constants/events/message-events.ts
1518
- var MESSAGE_EVENTS;
1519
- var init_message_events = __esm({
1520
- "src/shared/session/constants/events/message-events.ts"() {
1521
- "use strict";
1522
1104
  MESSAGE_EVENTS = {
1523
1105
  UPDATED: "message.updated"
1524
1106
  };
1525
- }
1526
- });
1527
-
1528
- // src/shared/session/constants/events/special-events.ts
1529
- var SPECIAL_EVENTS;
1530
- var init_special_events = __esm({
1531
- "src/shared/session/constants/events/special-events.ts"() {
1532
- "use strict";
1533
1107
  SPECIAL_EVENTS = {
1534
1108
  WILDCARD: "*"
1535
1109
  };
1536
- }
1537
- });
1538
-
1539
- // src/shared/session/constants/events/index.ts
1540
- var EVENT_TYPES;
1541
- var init_events = __esm({
1542
- "src/shared/session/constants/events/index.ts"() {
1543
- "use strict";
1544
- init_task_events();
1545
- init_todo_events();
1546
- init_session_events();
1547
- init_document_events();
1548
- init_mission_events();
1549
- init_message_events();
1550
- init_special_events();
1551
- init_task_events();
1552
- init_todo_events();
1553
- init_session_events();
1554
- init_document_events();
1555
- init_mission_events();
1556
- init_message_events();
1557
- init_special_events();
1558
1110
  EVENT_TYPES = {
1559
1111
  ...TASK_EVENTS,
1560
1112
  ...TODO_EVENTS,
@@ -1567,32 +1119,17 @@ var init_events = __esm({
1567
1119
  }
1568
1120
  });
1569
1121
 
1570
- // src/shared/session/constants/index.ts
1571
- var init_constants8 = __esm({
1572
- "src/shared/session/constants/index.ts"() {
1573
- "use strict";
1574
- init_events();
1575
- }
1576
- });
1577
-
1578
1122
  // src/shared/session/index.ts
1579
- var init_session2 = __esm({
1123
+ var init_session = __esm({
1580
1124
  "src/shared/session/index.ts"() {
1581
1125
  "use strict";
1582
1126
  init_constants8();
1583
1127
  }
1584
1128
  });
1585
1129
 
1586
- // src/shared/command/interfaces/index.ts
1587
- var init_interfaces6 = __esm({
1588
- "src/shared/command/interfaces/index.ts"() {
1589
- "use strict";
1590
- }
1591
- });
1592
-
1593
- // src/shared/command/types/index.ts
1130
+ // src/shared/command/types.ts
1594
1131
  var init_types6 = __esm({
1595
- "src/shared/command/types/index.ts"() {
1132
+ "src/shared/command/types.ts"() {
1596
1133
  "use strict";
1597
1134
  }
1598
1135
  });
@@ -1601,38 +1138,33 @@ var init_types6 = __esm({
1601
1138
  var init_command = __esm({
1602
1139
  "src/shared/command/index.ts"() {
1603
1140
  "use strict";
1604
- init_interfaces6();
1605
1141
  init_types6();
1606
1142
  }
1607
1143
  });
1608
1144
 
1609
- // src/shared/tool/constants/tool-output.ts
1610
- var init_tool_output = __esm({
1611
- "src/shared/tool/constants/tool-output.ts"() {
1612
- "use strict";
1613
- }
1614
- });
1615
-
1616
- // src/shared/tool/constants/lsp/lsp-severity.ts
1617
- var LSP_SEVERITY;
1618
- var init_lsp_severity = __esm({
1619
- "src/shared/tool/constants/lsp/lsp-severity.ts"() {
1145
+ // src/shared/tool/constants.ts
1146
+ var OUTPUT_LABEL, TOOL_LABEL, LSP_SEVERITY, LSP_SEVERITY_LABELS, PARALLEL_LOG, PARALLEL_PARAMS;
1147
+ var init_constants9 = __esm({
1148
+ "src/shared/tool/constants.ts"() {
1620
1149
  "use strict";
1621
- LSP_SEVERITY = {
1622
- ERROR: 1,
1623
- WARNING: 2,
1624
- INFO: 3,
1625
- HINT: 4
1150
+ init_constants2();
1151
+ OUTPUT_LABEL = {
1152
+ ERROR: "[ERROR]",
1153
+ WARNING: "[WARNING]",
1154
+ INFO: "[INFO]",
1155
+ DONE: "[DONE]",
1156
+ OK: "[OK]",
1157
+ SPAWNED: "[SPAWNED]",
1158
+ RESUME: "[RESUME]",
1159
+ TIMEOUT: "[TIMEOUT]",
1160
+ RUNNING: "[RUNNING]",
1161
+ CANCELLED: "[CANCELLED]",
1162
+ RESUMED_DONE: "[RESUMED & DONE]",
1163
+ SYNC_START: "[SYNC START]",
1164
+ CACHED: "[CACHED]",
1165
+ JSON_FETCHED: "[JSON FETCHED]",
1166
+ TEXT_FETCHED: "[TEXT FETCHED]"
1626
1167
  };
1627
- }
1628
- });
1629
-
1630
- // src/shared/tool/constants/common/labels.ts
1631
- var TOOL_LABEL;
1632
- var init_labels2 = __esm({
1633
- "src/shared/tool/constants/common/labels.ts"() {
1634
- "use strict";
1635
- init_status_labels();
1636
1168
  TOOL_LABEL = {
1637
1169
  ERROR: STATUS_LABEL.ERROR,
1638
1170
  WARNING: STATUS_LABEL.WARNING,
@@ -1646,50 +1178,21 @@ var init_labels2 = __esm({
1646
1178
  PENDING: STATUS_LABEL.PENDING,
1647
1179
  RUNNING: STATUS_LABEL.RUNNING
1648
1180
  };
1649
- }
1650
- });
1651
-
1652
- // src/shared/tool/constants/lsp/lsp-severity-labels.ts
1653
- var LSP_SEVERITY_LABELS;
1654
- var init_lsp_severity_labels = __esm({
1655
- "src/shared/tool/constants/lsp/lsp-severity-labels.ts"() {
1656
- "use strict";
1657
- init_labels2();
1658
- init_lsp_severity();
1181
+ LSP_SEVERITY = {
1182
+ ERROR: 1,
1183
+ WARNING: 2,
1184
+ INFO: 3,
1185
+ HINT: 4
1186
+ };
1659
1187
  LSP_SEVERITY_LABELS = {
1660
1188
  [LSP_SEVERITY.ERROR]: TOOL_LABEL.ERROR,
1661
1189
  [LSP_SEVERITY.WARNING]: TOOL_LABEL.WARNING,
1662
1190
  [LSP_SEVERITY.INFO]: TOOL_LABEL.INFO,
1663
1191
  [LSP_SEVERITY.HINT]: TOOL_LABEL.HINT
1664
1192
  };
1665
- }
1666
- });
1667
-
1668
- // src/shared/tool/constants/lsp/index.ts
1669
- var init_lsp = __esm({
1670
- "src/shared/tool/constants/lsp/index.ts"() {
1671
- "use strict";
1672
- init_lsp_severity();
1673
- init_lsp_severity_labels();
1674
- }
1675
- });
1676
-
1677
- // src/shared/tool/constants/parallel/logging.ts
1678
- var PARALLEL_LOG;
1679
- var init_logging2 = __esm({
1680
- "src/shared/tool/constants/parallel/logging.ts"() {
1681
- "use strict";
1682
1193
  PARALLEL_LOG = {
1683
1194
  DELEGATE_TASK: "[delegate-task]"
1684
1195
  };
1685
- }
1686
- });
1687
-
1688
- // src/shared/tool/constants/parallel/parameters.ts
1689
- var PARALLEL_PARAMS;
1690
- var init_parameters = __esm({
1691
- "src/shared/tool/constants/parallel/parameters.ts"() {
1692
- "use strict";
1693
1196
  PARALLEL_PARAMS = {
1694
1197
  AGENT: "agent",
1695
1198
  TASK: "task",
@@ -1709,121 +1212,10 @@ var init_parameters = __esm({
1709
1212
  }
1710
1213
  });
1711
1214
 
1712
- // src/shared/tool/constants/parallel/index.ts
1713
- var init_parallel2 = __esm({
1714
- "src/shared/tool/constants/parallel/index.ts"() {
1715
- "use strict";
1716
- init_logging2();
1717
- init_parameters();
1718
- }
1719
- });
1720
-
1721
- // src/shared/tool/constants/common/output-labels.ts
1722
- var OUTPUT_LABEL;
1723
- var init_output_labels = __esm({
1724
- "src/shared/tool/constants/common/output-labels.ts"() {
1725
- "use strict";
1726
- OUTPUT_LABEL = {
1727
- ERROR: "[ERROR]",
1728
- WARNING: "[WARNING]",
1729
- INFO: "[INFO]",
1730
- DONE: "[DONE]",
1731
- OK: "[OK]",
1732
- SPAWNED: "[SPAWNED]",
1733
- RESUME: "[RESUME]",
1734
- TIMEOUT: "[TIMEOUT]",
1735
- RUNNING: "[RUNNING]",
1736
- CANCELLED: "[CANCELLED]",
1737
- RESUMED_DONE: "[RESUMED & DONE]",
1738
- SYNC_START: "[SYNC START]",
1739
- CACHED: "[CACHED]",
1740
- JSON_FETCHED: "[JSON FETCHED]",
1741
- TEXT_FETCHED: "[TEXT FETCHED]"
1742
- };
1743
- }
1744
- });
1745
-
1746
- // src/shared/tool/constants/common/languages.ts
1747
- var init_languages = __esm({
1748
- "src/shared/tool/constants/common/languages.ts"() {
1749
- "use strict";
1750
- }
1751
- });
1752
-
1753
- // src/shared/tool/constants/common/sources.ts
1754
- var init_sources = __esm({
1755
- "src/shared/tool/constants/common/sources.ts"() {
1756
- "use strict";
1757
- }
1758
- });
1759
-
1760
- // src/shared/tool/constants/common/index.ts
1761
- var init_common = __esm({
1762
- "src/shared/tool/constants/common/index.ts"() {
1763
- "use strict";
1764
- init_labels2();
1765
- init_output_labels();
1766
- init_languages();
1767
- init_sources();
1768
- }
1769
- });
1770
-
1771
- // src/shared/tool/constants/index.ts
1772
- var init_constants9 = __esm({
1773
- "src/shared/tool/constants/index.ts"() {
1774
- "use strict";
1775
- init_tool_names();
1776
- init_tool_output();
1777
- init_lsp();
1778
- init_parallel2();
1779
- init_common();
1780
- }
1781
- });
1782
-
1783
- // src/shared/tool/interfaces/lsp/index.ts
1784
- var init_lsp2 = __esm({
1785
- "src/shared/tool/interfaces/lsp/index.ts"() {
1786
- "use strict";
1787
- }
1788
- });
1789
-
1790
- // src/shared/tool/interfaces/parallel/session-client.ts
1791
- var init_session_client = __esm({
1792
- "src/shared/tool/interfaces/parallel/session-client.ts"() {
1793
- "use strict";
1794
- }
1795
- });
1796
-
1797
- // src/shared/tool/interfaces/parallel/poll-result.ts
1798
- var init_poll_result = __esm({
1799
- "src/shared/tool/interfaces/parallel/poll-result.ts"() {
1800
- "use strict";
1801
- }
1802
- });
1803
-
1804
- // src/shared/tool/interfaces/parallel/index.ts
1805
- var init_parallel3 = __esm({
1806
- "src/shared/tool/interfaces/parallel/index.ts"() {
1807
- "use strict";
1808
- init_session_client();
1809
- init_poll_result();
1810
- }
1811
- });
1812
-
1813
- // src/shared/tool/interfaces/ast/index.ts
1814
- var init_ast = __esm({
1815
- "src/shared/tool/interfaces/ast/index.ts"() {
1816
- "use strict";
1817
- }
1818
- });
1819
-
1820
- // src/shared/tool/interfaces/index.ts
1821
- var init_interfaces7 = __esm({
1822
- "src/shared/tool/interfaces/index.ts"() {
1215
+ // src/shared/tool/types.ts
1216
+ var init_types7 = __esm({
1217
+ "src/shared/tool/types.ts"() {
1823
1218
  "use strict";
1824
- init_lsp2();
1825
- init_parallel3();
1826
- init_ast();
1827
1219
  }
1828
1220
  });
1829
1221
 
@@ -1831,15 +1223,16 @@ var init_interfaces7 = __esm({
1831
1223
  var init_tool = __esm({
1832
1224
  "src/shared/tool/index.ts"() {
1833
1225
  "use strict";
1226
+ init_tool_names();
1834
1227
  init_constants9();
1835
- init_interfaces7();
1228
+ init_types7();
1836
1229
  }
1837
1230
  });
1838
1231
 
1839
- // src/shared/message/constants/part-types.ts
1840
- var PART_TYPES;
1841
- var init_part_types = __esm({
1842
- "src/shared/message/constants/part-types.ts"() {
1232
+ // src/shared/message/constants.ts
1233
+ var PART_TYPES, PROMPTS, COMMAND_NAMES, PLUGIN_HOOKS, MESSAGE_ROLES, SESSION_STATUS;
1234
+ var init_constants10 = __esm({
1235
+ "src/shared/message/constants.ts"() {
1843
1236
  "use strict";
1844
1237
  PART_TYPES = {
1845
1238
  TEXT: "text",
@@ -1851,27 +1244,11 @@ var init_part_types = __esm({
1851
1244
  /** Anthropic-style tool invocation */
1852
1245
  TOOL_USE: "tool_use"
1853
1246
  };
1854
- }
1855
- });
1856
-
1857
- // src/shared/message/constants/prompts.ts
1858
- var PROMPTS;
1859
- var init_prompts = __esm({
1860
- "src/shared/message/constants/prompts.ts"() {
1861
- "use strict";
1862
1247
  PROMPTS = {
1863
1248
  CONTINUE: "continue",
1864
1249
  CONTINUE_PREVIOUS: "continue previous work",
1865
1250
  CONTINUE_DEFAULT: "continue from where we left off"
1866
1251
  };
1867
- }
1868
- });
1869
-
1870
- // src/shared/message/constants/slash-commands.ts
1871
- var COMMAND_NAMES;
1872
- var init_slash_commands = __esm({
1873
- "src/shared/message/constants/slash-commands.ts"() {
1874
- "use strict";
1875
1252
  COMMAND_NAMES = {
1876
1253
  TASK: "task",
1877
1254
  PLAN: "plan",
@@ -1879,14 +1256,6 @@ var init_slash_commands = __esm({
1879
1256
  STOP: "stop",
1880
1257
  CANCEL: "cancel"
1881
1258
  };
1882
- }
1883
- });
1884
-
1885
- // src/shared/message/constants/plugin-hooks.ts
1886
- var PLUGIN_HOOKS;
1887
- var init_plugin_hooks = __esm({
1888
- "src/shared/message/constants/plugin-hooks.ts"() {
1889
- "use strict";
1890
1259
  PLUGIN_HOOKS = {
1891
1260
  /** Intercepts user messages before sending to LLM */
1892
1261
  CHAT_MESSAGE: "chat.message",
@@ -1899,14 +1268,6 @@ var init_plugin_hooks = __esm({
1899
1268
  /** Injects dynamic system prompt additions */
1900
1269
  EXPERIMENTAL_CHAT_SYSTEM_TRANSFORM: "experimental.chat.system.transform"
1901
1270
  };
1902
- }
1903
- });
1904
-
1905
- // src/shared/message/constants/message-roles.ts
1906
- var MESSAGE_ROLES, SESSION_STATUS;
1907
- var init_message_roles = __esm({
1908
- "src/shared/message/constants/message-roles.ts"() {
1909
- "use strict";
1910
1271
  MESSAGE_ROLES = {
1911
1272
  /** AI assistant message */
1912
1273
  ASSISTANT: "assistant",
@@ -1922,18 +1283,6 @@ var init_message_roles = __esm({
1922
1283
  }
1923
1284
  });
1924
1285
 
1925
- // src/shared/message/constants/index.ts
1926
- var init_constants10 = __esm({
1927
- "src/shared/message/constants/index.ts"() {
1928
- "use strict";
1929
- init_part_types();
1930
- init_prompts();
1931
- init_slash_commands();
1932
- init_plugin_hooks();
1933
- init_message_roles();
1934
- }
1935
- });
1936
-
1937
1286
  // src/shared/message/index.ts
1938
1287
  var init_message = __esm({
1939
1288
  "src/shared/message/index.ts"() {
@@ -1942,10 +1291,10 @@ var init_message = __esm({
1942
1291
  }
1943
1292
  });
1944
1293
 
1945
- // src/shared/os/constants/platform.ts
1294
+ // src/shared/os/constants.ts
1946
1295
  var PLATFORM;
1947
- var init_platform = __esm({
1948
- "src/shared/os/constants/platform.ts"() {
1296
+ var init_constants11 = __esm({
1297
+ "src/shared/os/constants.ts"() {
1949
1298
  "use strict";
1950
1299
  PLATFORM = {
1951
1300
  DARWIN: "darwin",
@@ -1956,26 +1305,10 @@ var init_platform = __esm({
1956
1305
  }
1957
1306
  });
1958
1307
 
1959
- // src/shared/os/constants/index.ts
1960
- var init_constants11 = __esm({
1961
- "src/shared/os/constants/index.ts"() {
1962
- "use strict";
1963
- init_platform();
1964
- }
1965
- });
1966
-
1967
- // src/shared/os/types/platform.ts
1968
- var init_platform2 = __esm({
1969
- "src/shared/os/types/platform.ts"() {
1970
- "use strict";
1971
- }
1972
- });
1973
-
1974
- // src/shared/os/types/index.ts
1975
- var init_types7 = __esm({
1976
- "src/shared/os/types/index.ts"() {
1308
+ // src/shared/os/types.ts
1309
+ var init_types8 = __esm({
1310
+ "src/shared/os/types.ts"() {
1977
1311
  "use strict";
1978
- init_platform2();
1979
1312
  }
1980
1313
  });
1981
1314
 
@@ -1984,32 +1317,20 @@ var init_os = __esm({
1984
1317
  "src/shared/os/index.ts"() {
1985
1318
  "use strict";
1986
1319
  init_constants11();
1987
- init_types7();
1320
+ init_types8();
1988
1321
  }
1989
1322
  });
1990
1323
 
1991
- // src/shared/verification/constants/checklist.ts
1992
- var CHECKLIST;
1993
- var init_checklist = __esm({
1994
- "src/shared/verification/constants/checklist.ts"() {
1324
+ // src/shared/verification/constants.ts
1325
+ var VERIFICATION_SIGNALS, CHECKLIST_PATTERNS, CHECKLIST, CATEGORY_ID, CATEGORY_LABEL, CATEGORY_DESCRIPTION, CATEGORY_ICON, CHECKLIST_CATEGORIES;
1326
+ var init_constants12 = __esm({
1327
+ "src/shared/verification/constants.ts"() {
1995
1328
  "use strict";
1996
- init_paths();
1997
- CHECKLIST = {
1998
- /** Path to the verification checklist file */
1999
- FILE: `${PATHS.OPENCODE}/verification-checklist.md`,
2000
- /** Minimum required items for valid checklist */
2001
- MIN_ITEMS: 1,
2002
- /** Maximum items to show in error messages */
2003
- MAX_ERROR_ITEMS: 5
1329
+ init_constants2();
1330
+ VERIFICATION_SIGNALS = {
1331
+ /** Trigger for all-encompassing system check at the end of a mission */
1332
+ FINAL_PASS: "Full System Verification"
2004
1333
  };
2005
- }
2006
- });
2007
-
2008
- // src/shared/verification/constants/patterns.ts
2009
- var CHECKLIST_PATTERNS;
2010
- var init_patterns = __esm({
2011
- "src/shared/verification/constants/patterns.ts"() {
2012
- "use strict";
2013
1334
  CHECKLIST_PATTERNS = {
2014
1335
  /** Incomplete item: - [ ] */
2015
1336
  INCOMPLETE: /^[-*]\s*\[\s*\]\s+(.+)$/gm,
@@ -2024,14 +1345,14 @@ var init_patterns = __esm({
2024
1345
  /** Mark as complete indicator (x or X) */
2025
1346
  COMPLETE_MARK: /^x$/i
2026
1347
  };
2027
- }
2028
- });
2029
-
2030
- // src/shared/verification/constants/categories.ts
2031
- var CATEGORY_ID, CATEGORY_LABEL, CATEGORY_DESCRIPTION, CATEGORY_ICON, CHECKLIST_CATEGORIES;
2032
- var init_categories = __esm({
2033
- "src/shared/verification/constants/categories.ts"() {
2034
- "use strict";
1348
+ CHECKLIST = {
1349
+ /** Path to the verification checklist file */
1350
+ FILE: `${PATHS.OPENCODE}/verification-checklist.md`,
1351
+ /** Minimum required items for valid checklist */
1352
+ MIN_ITEMS: 1,
1353
+ /** Maximum items to show in error messages */
1354
+ MAX_ERROR_ITEMS: 5
1355
+ };
2035
1356
  CATEGORY_ID = {
2036
1357
  CODE_QUALITY: "code-quality",
2037
1358
  UNIT_TESTS: "unit-tests",
@@ -2077,39 +1398,9 @@ var init_categories = __esm({
2077
1398
  }
2078
1399
  });
2079
1400
 
2080
- // src/shared/verification/constants/signals.ts
2081
- var VERIFICATION_SIGNALS;
2082
- var init_signals = __esm({
2083
- "src/shared/verification/constants/signals.ts"() {
2084
- "use strict";
2085
- VERIFICATION_SIGNALS = {
2086
- /** Trigger for all-encompassing system check at the end of a mission */
2087
- FINAL_PASS: "Full System Verification"
2088
- };
2089
- }
2090
- });
2091
-
2092
- // src/shared/verification/constants/index.ts
2093
- var init_constants12 = __esm({
2094
- "src/shared/verification/constants/index.ts"() {
2095
- "use strict";
2096
- init_checklist();
2097
- init_patterns();
2098
- init_categories();
2099
- init_signals();
2100
- }
2101
- });
2102
-
2103
- // src/shared/verification/interfaces/index.ts
2104
- var init_interfaces8 = __esm({
2105
- "src/shared/verification/interfaces/index.ts"() {
2106
- "use strict";
2107
- }
2108
- });
2109
-
2110
- // src/shared/verification/types/index.ts
2111
- var init_types8 = __esm({
2112
- "src/shared/verification/types/index.ts"() {
1401
+ // src/shared/verification/types.ts
1402
+ var init_types9 = __esm({
1403
+ "src/shared/verification/types.ts"() {
2113
1404
  "use strict";
2114
1405
  }
2115
1406
  });
@@ -2119,8 +1410,7 @@ var init_verification = __esm({
2119
1410
  "src/shared/verification/index.ts"() {
2120
1411
  "use strict";
2121
1412
  init_constants12();
2122
- init_interfaces8();
2123
- init_types8();
1413
+ init_types9();
2124
1414
  }
2125
1415
  });
2126
1416
 
@@ -2201,17 +1491,17 @@ var init_shutdown_manager = __esm({
2201
1491
  });
2202
1492
 
2203
1493
  // src/shared/lifecycle/index.ts
2204
- var init_lifecycle2 = __esm({
1494
+ var init_lifecycle = __esm({
2205
1495
  "src/shared/lifecycle/index.ts"() {
2206
1496
  "use strict";
2207
1497
  init_shutdown_manager();
2208
1498
  }
2209
1499
  });
2210
1500
 
2211
- // src/shared/errors/constants/error-patterns.ts
2212
- var ERROR_PATTERNS;
2213
- var init_error_patterns = __esm({
2214
- "src/shared/errors/constants/error-patterns.ts"() {
1501
+ // src/shared/errors/constants.ts
1502
+ var ERROR_PATTERNS, ERROR_TYPE;
1503
+ var init_constants13 = __esm({
1504
+ "src/shared/errors/constants.ts"() {
2215
1505
  "use strict";
2216
1506
  ERROR_PATTERNS = {
2217
1507
  TOOL_RESULT_MISSING: /tool_result_missing|tool result.*missing/i,
@@ -2223,14 +1513,6 @@ var init_error_patterns = __esm({
2223
1513
  NETWORK_ERROR: /network|ECONNREFUSED|ETIMEDOUT|fetch failed/i,
2224
1514
  AUTH_ERROR: /unauthorized|401|403|invalid.*token/i
2225
1515
  };
2226
- }
2227
- });
2228
-
2229
- // src/shared/errors/constants/error-type.ts
2230
- var ERROR_TYPE;
2231
- var init_error_type = __esm({
2232
- "src/shared/errors/constants/error-type.ts"() {
2233
- "use strict";
2234
1516
  ERROR_TYPE = {
2235
1517
  TOOL_RESULT_MISSING: "TOOL_RESULT_MISSING",
2236
1518
  THINKING_BLOCK_ORDER: "THINKING_BLOCK_ORDER",
@@ -2244,30 +1526,6 @@ var init_error_type = __esm({
2244
1526
  }
2245
1527
  });
2246
1528
 
2247
- // src/shared/errors/constants/index.ts
2248
- var init_constants13 = __esm({
2249
- "src/shared/errors/constants/index.ts"() {
2250
- "use strict";
2251
- init_error_patterns();
2252
- init_error_type();
2253
- }
2254
- });
2255
-
2256
- // src/shared/errors/types/error-pattern-type.ts
2257
- var init_error_pattern_type = __esm({
2258
- "src/shared/errors/types/error-pattern-type.ts"() {
2259
- "use strict";
2260
- }
2261
- });
2262
-
2263
- // src/shared/errors/types/index.ts
2264
- var init_types9 = __esm({
2265
- "src/shared/errors/types/index.ts"() {
2266
- "use strict";
2267
- init_error_pattern_type();
2268
- }
2269
- });
2270
-
2271
1529
  // src/shared/errors/detection.ts
2272
1530
  function detectErrorType(error95) {
2273
1531
  const errorStr = typeof error95 === "string" ? error95 : error95?.message || error95?.name || String(error95);
@@ -2281,7 +1539,7 @@ function detectErrorType(error95) {
2281
1539
  var init_detection = __esm({
2282
1540
  "src/shared/errors/detection.ts"() {
2283
1541
  "use strict";
2284
- init_error_patterns();
1542
+ init_constants13();
2285
1543
  }
2286
1544
  });
2287
1545
 
@@ -2289,7 +1547,7 @@ var init_detection = __esm({
2289
1547
  var init_retry = __esm({
2290
1548
  "src/shared/errors/retry.ts"() {
2291
1549
  "use strict";
2292
- init_error_type();
1550
+ init_constants13();
2293
1551
  init_recovery();
2294
1552
  }
2295
1553
  });
@@ -2299,89 +1557,118 @@ var init_errors = __esm({
2299
1557
  "src/shared/errors/index.ts"() {
2300
1558
  "use strict";
2301
1559
  init_constants13();
2302
- init_types9();
2303
1560
  init_detection();
2304
1561
  init_retry();
2305
1562
  }
2306
1563
  });
2307
1564
 
2308
- // src/shared/prompt/constants/tags.ts
2309
- var PROMPT_TAGS, wrapTag;
2310
- var init_tags = __esm({
2311
- "src/shared/prompt/constants/tags.ts"() {
1565
+ // src/shared/prompt/constants.ts
1566
+ var AGENT_ROLES, TERMINAL_NODE, SPAWNING_RULES, PHASE_0_DIRECT_DISCOVERY, PHASE_1_THINK_ANALYSIS, PHASE_5_MSVP, HPFA_RULES, AUTONOMOUS_MANDATE, PHILOSOPHY_PHASES, EXECUTION_CYCLE, EXECUTION_CYCLE_STEPS, PHILOSOPHY_TAGLINE, PHILOSOPHY_QUOTE, PHILOSOPHY_LEARN_PRINCIPLE, SCOUT_LABEL, SCOUT_STRUCTURE, SCOUT_STACK, SCOUT_DOCS, SCOUT_INFRA, SCOUT_INTEGRATION, WORK_STATUS, PROMPT_TAGS, wrapTag;
1567
+ var init_constants14 = __esm({
1568
+ "src/shared/prompt/constants.ts"() {
2312
1569
  "use strict";
2313
- PROMPT_TAGS = {
2314
- // === Common ===
2315
- ROLE: { open: "<role>", close: "</role>" },
2316
- IDENTITY: { open: "<identity>", close: "</identity>" },
2317
- FORBIDDEN_ACTIONS: { open: "<forbidden_actions>", close: "</forbidden_actions>" },
2318
- REQUIRED_ACTIONS: { open: "<required_actions>", close: "</required_actions>" },
2319
- VERIFICATION: { open: "<verification>", close: "</verification>" },
2320
- ENVIRONMENT_DISCOVERY: { open: "<environment_discovery>", close: "</environment_discovery>" },
2321
- ANTI_HALLUCINATION: { open: "<anti_hallucination>", close: "</anti_hallucination>" },
2322
- TODO_RULES: { open: "<todo_rules>", close: "</todo_rules>" },
2323
- COMPLETE_SIGNAL: { open: "<complete_signal>", close: "</complete_signal>" },
2324
- SHARED_WORKSPACE: { open: "<shared_workspace>", close: "</shared_workspace>" },
2325
- CORE_PHILOSOPHY: { open: "<core_philosophy>", close: "</core_philosophy>" },
2326
- SYSTEM: { open: "<system>", close: "</system>" },
2327
- TASK: { open: "<task>", close: "</task>" },
2328
- CONTEXT: { open: "<context>", close: "</context>" },
2329
- EXECUTION: { open: "<execution>", close: "</execution>" },
2330
- MODE: { open: "<mode>", close: "</mode>" },
2331
- RESUME: { open: "<resume>", close: "</resume>" },
2332
- SAFETY: { open: "<safety>", close: "</safety>" },
2333
- AST_TOOLS: { open: "<ast_tools>", close: "</ast_tools>" },
2334
- LSP_TOOLS: { open: "<lsp_tools>", close: "</lsp_tools>" },
2335
- SKILLS_CAPABILITIES: { open: "<skills_capabilities>", close: "</skills_capabilities>" },
2336
- DECOMPOSITION_RULES: { open: "<decomposition_rules>", close: "</decomposition_rules>" },
2337
- EXECUTION_ASSURANCE: { open: "<execution_assurance>", close: "</execution_assurance>" },
2338
- // === Commander ===
2339
- TOOLS: { open: "<tools>", close: "</tools>" },
2340
- AGENTS: { open: "<agents>", close: "</agents>" },
2341
- EXECUTION_RULES: { open: "<execution_rules>", close: "</execution_rules>" },
2342
- EXECUTION_STRATEGY: { open: "<execution_strategy>", close: "</execution_strategy>" },
2343
- PARALLEL_EXECUTION: { open: "<parallel_execution>", close: "</parallel_execution>" },
2344
- TODO_FORMAT: { open: "<todo_format>", close: "</todo_format>" },
2345
- SYNC_ISSUE_HANDLING: { open: "<sync_issue_handling>", close: "</sync_issue_handling>" },
2346
- LOOP_CONTINUATION: { open: "<loop_continuation>", close: "</loop_continuation>" },
2347
- RECOVERY: { open: "<recovery>", close: "</recovery>" },
2348
- // === Planner ===
2349
- FILE_LEVEL_PLANNING: { open: "<file_level_planning>", close: "</file_level_planning>" },
2350
- TODO_SYNC: { open: "<todo_sync>", close: "</todo_sync>" },
2351
- PLANNING_FORMAT: { open: "<planning_format>", close: "</planning_format>" },
2352
- RESEARCH_WORKFLOW: { open: "<research_workflow>", close: "</research_workflow>" },
2353
- // === Worker ===
2354
- FILE_ASSIGNMENT: { open: "<file_assignment>", close: "</file_assignment>" },
2355
- TDD_WORKFLOW: { open: "<tdd_workflow>", close: "</tdd_workflow>" },
2356
- ISOLATION_TESTING: { open: "<isolation_testing>", close: "</isolation_testing>" },
2357
- WORKFLOW: { open: "<workflow>", close: "</workflow>" },
2358
- QUALITY_CHECKLIST: { open: "<quality_checklist>", close: "</quality_checklist>" },
2359
- // === Reviewer ===
2360
- SYNC_VERIFICATION: { open: "<sync_verification>", close: "</sync_verification>" },
2361
- ASYNC_MONITORING: { open: "<async_monitoring>", close: "</async_monitoring>" },
2362
- INTEGRATION_TESTING: { open: "<integration_testing>", close: "</integration_testing>" },
2363
- VERIFICATION_PROCESS: { open: "<verification_process>", close: "</verification_process>" },
2364
- TODO_MANAGEMENT: { open: "<todo_management>", close: "</todo_management>" },
2365
- OUTPUT_FORMAT: { open: "<output_format>", close: "</output_format>" },
2366
- // === Mission Loop ===
2367
- MISSION_LOOP: { open: "<mission_loop>", close: "</mission_loop>" },
2368
- TODO_CONTINUATION: { open: "<todo_continuation>", close: "</todo_continuation>" },
2369
- AUTONOMOUS_MODE: { open: "<autonomous_mode>", close: "</autonomous_mode>" }
1570
+ init_agent();
1571
+ init_constants2();
1572
+ init_constants2();
1573
+ AGENT_ROLES = {
1574
+ /** Only Commander can spawn other agents */
1575
+ SPAWNER: AGENT_NAMES.COMMANDER,
1576
+ /** Terminal agents cannot spawn any sub-agents */
1577
+ TERMINAL_AGENTS: [AGENT_NAMES.PLANNER, AGENT_NAMES.WORKER, AGENT_NAMES.REVIEWER]
2370
1578
  };
2371
- wrapTag = (tag, content) => {
2372
- return `${tag.open}
2373
- ${content}
2374
- ${tag.close}`;
1579
+ TERMINAL_NODE = {
1580
+ /** Label for terminal node concept */
1581
+ LABEL: "TERMINAL node",
1582
+ /** Reason why terminal nodes can't spawn */
1583
+ REASON: "prevents infinite recursion",
1584
+ /** What to do instead of spawning */
1585
+ ALTERNATIVE: `Report back to ${AGENT_NAMES.COMMANDER} with specific blockers`
2375
1586
  };
2376
- }
2377
- });
1587
+ SPAWNING_RULES = {
1588
+ /** Who can spawn */
1589
+ SPAWNER_ONLY: `${AGENT_NAMES.COMMANDER} is the ONLY agent who can spawn other agents`,
1590
+ /** What terminal nodes should do */
1591
+ TERMINAL_BEHAVIOR: `Complete your assigned task directly without delegation`,
1592
+ /** Error message for blocked spawn attempts */
1593
+ BLOCKED_MESSAGE: `You are a ${TERMINAL_NODE.LABEL} - ${TERMINAL_NODE.REASON}`
1594
+ };
1595
+ PHASE_0_DIRECT_DISCOVERY = `**Direct Project Discovery**:
1596
+ 0. **FRESH START**: If ${PATHS.TODO} exists, read it to understand progress. If starting a new project, create it.
1597
+ 1. **STRUCTURE**: Deeply map project layout (\`ls -la\`, \`find\`).
1598
+ 2. **ENVIRONMENT**: Identify build/test/lint commands by reading config files (package.json, Cargo.toml, pyproject.toml, etc.).
1599
+ 3. **FRONTIER**: Identify the "Verification Frontier" (CI/CD workflows, Makefile, docker-compose).
1600
+ 4. **CONSOLIDATE**: Sync all environmental findings to ${PATHS.CONTEXT}.`;
1601
+ PHASE_1_THINK_ANALYSIS = `### 1.1 ANALYZE & SCOPE
1602
+ - **Define FULL scope** based on user request and discovered context.
1603
+ - **Hierarchical Breakdown**: Milestones -> Tasks -> Sub-tasks.
2378
1604
 
2379
- // src/shared/prompt/constants/status.ts
2380
- var WORK_STATUS;
2381
- var init_status = __esm({
2382
- "src/shared/prompt/constants/status.ts"() {
2383
- "use strict";
2384
- init_status_labels();
1605
+ ### 1.2 STRATEGIC DECOMPOSITION
1606
+ - **Independent Items**: Identify what can run in parallel.
1607
+ - **Dependency Map**: Clearly define \`depends:\` links.
1608
+
1609
+ ### 1.3 DELEGATION
1610
+ - **Parallel Workers**: Assign workers for independent branches.
1611
+ - **Granular Review**: Assign reviewers for verification.`;
1612
+ PHASE_5_MSVP = `1. **UNIT VERIFICATION**: Every sub-task must be verified by tool output.
1613
+ 2. **HIERARCHICAL ROLL-UP**: A task is complete only when all its sub-tasks pass.
1614
+ 3. **AUTONOMOUS COMPLETION**: No stopping until every \`[ ]\` in ${PATHS.TODO} is converted to \`[x]\`.
1615
+ 4. **LOOP PERSISTENCE**: The system will automatically restart this session if work remains.`;
1616
+ HPFA_RULES = `1. **Commander-Only Spawning**: All agents are spawned by the Commander.
1617
+ 2. **Parallel Branches**: Execute non-dependent milestones/tasks simultaneously.
1618
+ 3. **Recursive Breakdown**: Continue subdividing until tasks are atomic.
1619
+ 4. **Autonomous Termination**: You only finish when the verification checklist and TODOs are 100% complete.`;
1620
+ AUTONOMOUS_MANDATE = `
1621
+ ## AUTONOMOUS COMPLETION MANDATE (MANDATORY)
1622
+ 1. **ZERO TOLERANCE**: Finishing with incomplete \`[ ]\` items is a FAILURE.
1623
+ 2. **FORCED CONTINUATION**: If you stop prematurely, the system will inject a "CONTINUE" prompt and iteration count.
1624
+ 3. **HIERARCHICAL PROOF**: You must provide evidence (tool output) for every \`[x]\` mark.
1625
+ 4. **NO PERMISSION**: Do not ask "Should I continue?". The answer is always YES until \`.opencode/todo.md\` is 100% checked.
1626
+ `;
1627
+ PHILOSOPHY_PHASES = {
1628
+ EXPLORE: "EXPLORE",
1629
+ LEARN: "LEARN",
1630
+ ADAPT: "ADAPT",
1631
+ ACT: "ACT"
1632
+ };
1633
+ EXECUTION_CYCLE = {
1634
+ THINK: "THINK",
1635
+ ACT: "ACT",
1636
+ OBSERVE: "OBSERVE",
1637
+ ADJUST: "ADJUST"
1638
+ };
1639
+ EXECUTION_CYCLE_STEPS = `1. ${EXECUTION_CYCLE.THINK} - Reason about the task
1640
+ 2. ${EXECUTION_CYCLE.ACT} - Execute the work
1641
+ 3. ${EXECUTION_CYCLE.OBSERVE} - Check the result
1642
+ 4. ${EXECUTION_CYCLE.ADJUST} - Fix if needed`;
1643
+ PHILOSOPHY_TAGLINE = "Explore \u2192 Learn \u2192 Adapt \u2192 Act";
1644
+ PHILOSOPHY_QUOTE = "Like an astronaut landing on unknown planets \u2014 never assume, always discover.";
1645
+ PHILOSOPHY_LEARN_PRINCIPLE = "LEARN = DOCUMENT: What you discover, you record. Your learnings become the team's knowledge.";
1646
+ SCOUT_LABEL = "Scout";
1647
+ SCOUT_STRUCTURE = {
1648
+ ID: "STRUCTURE",
1649
+ NAME: `${SCOUT_LABEL}: Structure`,
1650
+ PROMPT: "Analyze the project folder structure. Locate source code (src, lib), tests, and documentation directories. Map out the tree at depth 2-3."
1651
+ };
1652
+ SCOUT_STACK = {
1653
+ ID: "STACK",
1654
+ NAME: `${SCOUT_LABEL}: Stack`,
1655
+ PROMPT: "Identify the technology stack. Parse package.json, Cargo.toml, go.mod, or pyproject.toml. Determine build and test commands."
1656
+ };
1657
+ SCOUT_DOCS = {
1658
+ ID: "DOCS",
1659
+ NAME: `${SCOUT_LABEL}: Docs`,
1660
+ PROMPT: "Digest the project documentation. Read README.md, CONTRIBUTING.md, and any files in docs/ to understand the core architecture and mission."
1661
+ };
1662
+ SCOUT_INFRA = {
1663
+ ID: "INFRA",
1664
+ NAME: `${SCOUT_LABEL}: Infra`,
1665
+ PROMPT: "Detect infrastructure and environment configs. Search for Dockerfiles, CI/CD workflows (.github, .gitlab), and environment variable templates."
1666
+ };
1667
+ SCOUT_INTEGRATION = {
1668
+ ID: "INTEGRATION",
1669
+ NAME: `${SCOUT_LABEL}: Integration`,
1670
+ PROMPT: "Read all modified files and their cross-module dependencies in parallel. Map the actual integration surface and identify potential consistency issues."
1671
+ };
2385
1672
  WORK_STATUS = {
2386
1673
  // File action types
2387
1674
  ACTION: {
@@ -2479,155 +1766,72 @@ var init_status = __esm({
2479
1766
  // 40-60min
2480
1767
  }
2481
1768
  };
2482
- }
2483
- });
2484
-
2485
- // src/shared/prompt/constants/philosophy.ts
2486
- var PHILOSOPHY_PHASES, EXECUTION_CYCLE, EXECUTION_CYCLE_STEPS, PHILOSOPHY_TAGLINE, PHILOSOPHY_QUOTE, PHILOSOPHY_LEARN_PRINCIPLE;
2487
- var init_philosophy = __esm({
2488
- "src/shared/prompt/constants/philosophy.ts"() {
2489
- "use strict";
2490
- PHILOSOPHY_PHASES = {
2491
- EXPLORE: "EXPLORE",
2492
- LEARN: "LEARN",
2493
- ADAPT: "ADAPT",
2494
- ACT: "ACT"
2495
- };
2496
- EXECUTION_CYCLE = {
2497
- THINK: "THINK",
2498
- ACT: "ACT",
2499
- OBSERVE: "OBSERVE",
2500
- ADJUST: "ADJUST"
2501
- };
2502
- EXECUTION_CYCLE_STEPS = `1. ${EXECUTION_CYCLE.THINK} - Reason about the task
2503
- 2. ${EXECUTION_CYCLE.ACT} - Execute the work
2504
- 3. ${EXECUTION_CYCLE.OBSERVE} - Check the result
2505
- 4. ${EXECUTION_CYCLE.ADJUST} - Fix if needed`;
2506
- PHILOSOPHY_TAGLINE = "Explore \u2192 Learn \u2192 Adapt \u2192 Act";
2507
- PHILOSOPHY_QUOTE = "Like an astronaut landing on unknown planets \u2014 never assume, always discover.";
2508
- PHILOSOPHY_LEARN_PRINCIPLE = "LEARN = DOCUMENT: What you discover, you record. Your learnings become the team's knowledge.";
2509
- }
2510
- });
2511
-
2512
- // src/shared/prompt/constants/mandates.ts
2513
- var PHASE_0_DIRECT_DISCOVERY, PHASE_1_THINK_ANALYSIS, PHASE_5_MSVP, HPFA_RULES, AUTONOMOUS_MANDATE;
2514
- var init_mandates = __esm({
2515
- "src/shared/prompt/constants/mandates.ts"() {
2516
- "use strict";
2517
- init_paths();
2518
- PHASE_0_DIRECT_DISCOVERY = `**Direct Project Discovery**:
2519
- 0. **FRESH START**: If ${PATHS.TODO} exists, read it to understand progress. If starting a new project, create it.
2520
- 1. **STRUCTURE**: Deeply map project layout (\`ls -la\`, \`find\`).
2521
- 2. **ENVIRONMENT**: Identify build/test/lint commands by reading config files (package.json, Cargo.toml, pyproject.toml, etc.).
2522
- 3. **FRONTIER**: Identify the "Verification Frontier" (CI/CD workflows, Makefile, docker-compose).
2523
- 4. **CONSOLIDATE**: Sync all environmental findings to ${PATHS.CONTEXT}.`;
2524
- PHASE_1_THINK_ANALYSIS = `### 1.1 ANALYZE & SCOPE
2525
- - **Define FULL scope** based on user request and discovered context.
2526
- - **Hierarchical Breakdown**: Milestones -> Tasks -> Sub-tasks.
2527
-
2528
- ### 1.2 STRATEGIC DECOMPOSITION
2529
- - **Independent Items**: Identify what can run in parallel.
2530
- - **Dependency Map**: Clearly define \`depends:\` links.
2531
-
2532
- ### 1.3 DELEGATION
2533
- - **Parallel Workers**: Assign workers for independent branches.
2534
- - **Granular Review**: Assign reviewers for verification.`;
2535
- PHASE_5_MSVP = `1. **UNIT VERIFICATION**: Every sub-task must be verified by tool output.
2536
- 2. **HIERARCHICAL ROLL-UP**: A task is complete only when all its sub-tasks pass.
2537
- 3. **AUTONOMOUS COMPLETION**: No stopping until every \`[ ]\` in ${PATHS.TODO} is converted to \`[x]\`.
2538
- 4. **LOOP PERSISTENCE**: The system will automatically restart this session if work remains.`;
2539
- HPFA_RULES = `1. **Commander-Only Spawning**: All agents are spawned by the Commander.
2540
- 2. **Parallel Branches**: Execute non-dependent milestones/tasks simultaneously.
2541
- 3. **Recursive Breakdown**: Continue subdividing until tasks are atomic.
2542
- 4. **Autonomous Termination**: You only finish when the verification checklist and TODOs are 100% complete.`;
2543
- AUTONOMOUS_MANDATE = `
2544
- ## AUTONOMOUS COMPLETION MANDATE (MANDATORY)
2545
- 1. **ZERO TOLERANCE**: Finishing with incomplete \`[ ]\` items is a FAILURE.
2546
- 2. **FORCED CONTINUATION**: If you stop prematurely, the system will inject a "CONTINUE" prompt and iteration count.
2547
- 3. **HIERARCHICAL PROOF**: You must provide evidence (tool output) for every \`[x]\` mark.
2548
- 4. **NO PERMISSION**: Do not ask "Should I continue?". The answer is always YES until \`.opencode/todo.md\` is 100% checked.
2549
- `;
2550
- }
2551
- });
2552
-
2553
- // src/shared/prompt/constants/scouts.ts
2554
- var SCOUT_LABEL, SCOUT_STRUCTURE, SCOUT_STACK, SCOUT_DOCS, SCOUT_INFRA, SCOUT_INTEGRATION;
2555
- var init_scouts = __esm({
2556
- "src/shared/prompt/constants/scouts.ts"() {
2557
- "use strict";
2558
- SCOUT_LABEL = "Scout";
2559
- SCOUT_STRUCTURE = {
2560
- ID: "STRUCTURE",
2561
- NAME: `${SCOUT_LABEL}: Structure`,
2562
- PROMPT: "Analyze the project folder structure. Locate source code (src, lib), tests, and documentation directories. Map out the tree at depth 2-3."
2563
- };
2564
- SCOUT_STACK = {
2565
- ID: "STACK",
2566
- NAME: `${SCOUT_LABEL}: Stack`,
2567
- PROMPT: "Identify the technology stack. Parse package.json, Cargo.toml, go.mod, or pyproject.toml. Determine build and test commands."
2568
- };
2569
- SCOUT_DOCS = {
2570
- ID: "DOCS",
2571
- NAME: `${SCOUT_LABEL}: Docs`,
2572
- PROMPT: "Digest the project documentation. Read README.md, CONTRIBUTING.md, and any files in docs/ to understand the core architecture and mission."
2573
- };
2574
- SCOUT_INFRA = {
2575
- ID: "INFRA",
2576
- NAME: `${SCOUT_LABEL}: Infra`,
2577
- PROMPT: "Detect infrastructure and environment configs. Search for Dockerfiles, CI/CD workflows (.github, .gitlab), and environment variable templates."
2578
- };
2579
- SCOUT_INTEGRATION = {
2580
- ID: "INTEGRATION",
2581
- NAME: `${SCOUT_LABEL}: Integration`,
2582
- PROMPT: "Read all modified files and their cross-module dependencies in parallel. Map the actual integration surface and identify potential consistency issues."
2583
- };
2584
- }
2585
- });
2586
-
2587
- // src/shared/prompt/constants/architecture.ts
2588
- var AGENT_ROLES, TERMINAL_NODE, SPAWNING_RULES;
2589
- var init_architecture = __esm({
2590
- "src/shared/prompt/constants/architecture.ts"() {
2591
- "use strict";
2592
- init_names();
2593
- AGENT_ROLES = {
2594
- /** Only Commander can spawn other agents */
2595
- SPAWNER: AGENT_NAMES.COMMANDER,
2596
- /** Terminal agents cannot spawn any sub-agents */
2597
- TERMINAL_AGENTS: [AGENT_NAMES.PLANNER, AGENT_NAMES.WORKER, AGENT_NAMES.REVIEWER]
2598
- };
2599
- TERMINAL_NODE = {
2600
- /** Label for terminal node concept */
2601
- LABEL: "TERMINAL node",
2602
- /** Reason why terminal nodes can't spawn */
2603
- REASON: "prevents infinite recursion",
2604
- /** What to do instead of spawning */
2605
- ALTERNATIVE: `Report back to ${AGENT_NAMES.COMMANDER} with specific blockers`
1769
+ PROMPT_TAGS = {
1770
+ // === Common ===
1771
+ ROLE: { open: "<role>", close: "</role>" },
1772
+ IDENTITY: { open: "<identity>", close: "</identity>" },
1773
+ FORBIDDEN_ACTIONS: { open: "<forbidden_actions>", close: "</forbidden_actions>" },
1774
+ REQUIRED_ACTIONS: { open: "<required_actions>", close: "</required_actions>" },
1775
+ VERIFICATION: { open: "<verification>", close: "</verification>" },
1776
+ ENVIRONMENT_DISCOVERY: { open: "<environment_discovery>", close: "</environment_discovery>" },
1777
+ ANTI_HALLUCINATION: { open: "<anti_hallucination>", close: "</anti_hallucination>" },
1778
+ TODO_RULES: { open: "<todo_rules>", close: "</todo_rules>" },
1779
+ COMPLETE_SIGNAL: { open: "<complete_signal>", close: "</complete_signal>" },
1780
+ SHARED_WORKSPACE: { open: "<shared_workspace>", close: "</shared_workspace>" },
1781
+ CORE_PHILOSOPHY: { open: "<core_philosophy>", close: "</core_philosophy>" },
1782
+ SYSTEM: { open: "<system>", close: "</system>" },
1783
+ TASK: { open: "<task>", close: "</task>" },
1784
+ CONTEXT: { open: "<context>", close: "</context>" },
1785
+ EXECUTION: { open: "<execution>", close: "</execution>" },
1786
+ MODE: { open: "<mode>", close: "</mode>" },
1787
+ RESUME: { open: "<resume>", close: "</resume>" },
1788
+ SAFETY: { open: "<safety>", close: "</safety>" },
1789
+ AST_TOOLS: { open: "<ast_tools>", close: "</ast_tools>" },
1790
+ LSP_TOOLS: { open: "<lsp_tools>", close: "</lsp_tools>" },
1791
+ SKILLS_CAPABILITIES: { open: "<skills_capabilities>", close: "</skills_capabilities>" },
1792
+ DECOMPOSITION_RULES: { open: "<decomposition_rules>", close: "</decomposition_rules>" },
1793
+ EXECUTION_ASSURANCE: { open: "<execution_assurance>", close: "</execution_assurance>" },
1794
+ // === Commander ===
1795
+ TOOLS: { open: "<tools>", close: "</tools>" },
1796
+ AGENTS: { open: "<agents>", close: "</agents>" },
1797
+ EXECUTION_RULES: { open: "<execution_rules>", close: "</execution_rules>" },
1798
+ EXECUTION_STRATEGY: { open: "<execution_strategy>", close: "</execution_strategy>" },
1799
+ PARALLEL_EXECUTION: { open: "<parallel_execution>", close: "</parallel_execution>" },
1800
+ TODO_FORMAT: { open: "<todo_format>", close: "</todo_format>" },
1801
+ SYNC_ISSUE_HANDLING: { open: "<sync_issue_handling>", close: "</sync_issue_handling>" },
1802
+ LOOP_CONTINUATION: { open: "<loop_continuation>", close: "</loop_continuation>" },
1803
+ RECOVERY: { open: "<recovery>", close: "</recovery>" },
1804
+ // === Planner ===
1805
+ FILE_LEVEL_PLANNING: { open: "<file_level_planning>", close: "</file_level_planning>" },
1806
+ TODO_SYNC: { open: "<todo_sync>", close: "</todo_sync>" },
1807
+ PLANNING_FORMAT: { open: "<planning_format>", close: "</planning_format>" },
1808
+ RESEARCH_WORKFLOW: { open: "<research_workflow>", close: "</research_workflow>" },
1809
+ // === Worker ===
1810
+ FILE_ASSIGNMENT: { open: "<file_assignment>", close: "</file_assignment>" },
1811
+ TDD_WORKFLOW: { open: "<tdd_workflow>", close: "</tdd_workflow>" },
1812
+ ISOLATION_TESTING: { open: "<isolation_testing>", close: "</isolation_testing>" },
1813
+ WORKFLOW: { open: "<workflow>", close: "</workflow>" },
1814
+ QUALITY_CHECKLIST: { open: "<quality_checklist>", close: "</quality_checklist>" },
1815
+ // === Reviewer ===
1816
+ SYNC_VERIFICATION: { open: "<sync_verification>", close: "</sync_verification>" },
1817
+ ASYNC_MONITORING: { open: "<async_monitoring>", close: "</async_monitoring>" },
1818
+ INTEGRATION_TESTING: { open: "<integration_testing>", close: "</integration_testing>" },
1819
+ VERIFICATION_PROCESS: { open: "<verification_process>", close: "</verification_process>" },
1820
+ TODO_MANAGEMENT: { open: "<todo_management>", close: "</todo_management>" },
1821
+ OUTPUT_FORMAT: { open: "<output_format>", close: "</output_format>" },
1822
+ // === Mission Loop ===
1823
+ MISSION_LOOP: { open: "<mission_loop>", close: "</mission_loop>" },
1824
+ TODO_CONTINUATION: { open: "<todo_continuation>", close: "</todo_continuation>" },
1825
+ AUTONOMOUS_MODE: { open: "<autonomous_mode>", close: "</autonomous_mode>" }
2606
1826
  };
2607
- SPAWNING_RULES = {
2608
- /** Who can spawn */
2609
- SPAWNER_ONLY: `${AGENT_NAMES.COMMANDER} is the ONLY agent who can spawn other agents`,
2610
- /** What terminal nodes should do */
2611
- TERMINAL_BEHAVIOR: `Complete your assigned task directly without delegation`,
2612
- /** Error message for blocked spawn attempts */
2613
- BLOCKED_MESSAGE: `You are a ${TERMINAL_NODE.LABEL} - ${TERMINAL_NODE.REASON}`
1827
+ wrapTag = (tag, content) => {
1828
+ return `${tag.open}
1829
+ ${content}
1830
+ ${tag.close}`;
2614
1831
  };
2615
1832
  }
2616
1833
  });
2617
1834
 
2618
- // src/shared/prompt/constants/index.ts
2619
- var init_constants14 = __esm({
2620
- "src/shared/prompt/constants/index.ts"() {
2621
- "use strict";
2622
- init_tags();
2623
- init_status();
2624
- init_philosophy();
2625
- init_mandates();
2626
- init_scouts();
2627
- init_architecture();
2628
- }
2629
- });
2630
-
2631
1835
  // src/shared/prompt/index.ts
2632
1836
  var init_prompt = __esm({
2633
1837
  "src/shared/prompt/index.ts"() {
@@ -2643,22 +1847,48 @@ var init_shared = __esm({
2643
1847
  init_agent();
2644
1848
  init_core();
2645
1849
  init_task();
2646
- init_loop2();
1850
+ init_loop();
2647
1851
  init_notification();
2648
- init_recovery2();
2649
- init_cache2();
2650
- init_session2();
1852
+ init_recovery();
1853
+ init_cache();
1854
+ init_session();
2651
1855
  init_command();
2652
1856
  init_tool();
2653
1857
  init_message();
2654
1858
  init_os();
2655
1859
  init_verification();
2656
- init_lifecycle2();
1860
+ init_lifecycle();
2657
1861
  init_errors();
2658
1862
  init_prompt();
2659
1863
  }
2660
1864
  });
2661
1865
 
1866
+ // src/agents/prompts/registry.ts
1867
+ function interpolate(template, vars = {}) {
1868
+ return template.replace(
1869
+ /\{\{(\w+)\}\}/g,
1870
+ (match, key) => Object.prototype.hasOwnProperty.call(vars, key) ? String(vars[key]) : match
1871
+ );
1872
+ }
1873
+ function bodyOf(fragment) {
1874
+ return typeof fragment === "string" ? fragment : fragment.body;
1875
+ }
1876
+ function keptUnderProfile(fragment, profile) {
1877
+ if (profile !== "compact") return true;
1878
+ return typeof fragment === "string" ? true : !fragment.verbose;
1879
+ }
1880
+ function composePrompt(fragments, options = {}) {
1881
+ const profile = options.profile ?? "standard";
1882
+ const separator = options.separator ?? "\n\n";
1883
+ const joined = fragments.filter((fragment) => keptUnderProfile(fragment, profile)).map(bodyOf).join(separator);
1884
+ return interpolate(joined, options.vars);
1885
+ }
1886
+ var init_registry = __esm({
1887
+ "src/agents/prompts/registry.ts"() {
1888
+ "use strict";
1889
+ }
1890
+ });
1891
+
2662
1892
  // src/agents/prompts/01_philosophy/execution_assurance.ts
2663
1893
  var EXECUTION_ASSURANCE;
2664
1894
  var init_execution_assurance = __esm({
@@ -2748,7 +1978,7 @@ var CORE_PHILOSOPHY;
2748
1978
  var init_core2 = __esm({
2749
1979
  "src/agents/prompts/01_philosophy/core.ts"() {
2750
1980
  "use strict";
2751
- init_constants();
1981
+ init_agent();
2752
1982
  init_shared();
2753
1983
  CORE_PHILOSOPHY = `${PROMPT_TAGS.CORE_PHILOSOPHY.open}
2754
1984
  ## Core Philosophy: ${PHILOSOPHY_TAGLINE}
@@ -2816,7 +2046,7 @@ var init_metadata = __esm({
2816
2046
  });
2817
2047
 
2818
2048
  // src/agents/prompts/01_philosophy/index.ts
2819
- var init_philosophy2 = __esm({
2049
+ var init_philosophy = __esm({
2820
2050
  "src/agents/prompts/01_philosophy/index.ts"() {
2821
2051
  "use strict";
2822
2052
  init_execution_assurance();
@@ -3034,7 +2264,7 @@ var SKILLS_CAPABILITIES;
3034
2264
  var init_discovery_skills = __esm({
3035
2265
  "src/agents/prompts/02_discovery/discovery_skills.ts"() {
3036
2266
  "use strict";
3037
- init_tags();
2267
+ init_prompt();
3038
2268
  SKILLS_CAPABILITIES = wrapTag(PROMPT_TAGS.SKILLS_CAPABILITIES, `
3039
2269
  ### AUTONOMOUS SKILL ACQUISITION
3040
2270
  You have the ability to extend your capabilities using the **Skills System**.
@@ -4692,7 +3922,7 @@ var init_mission_commander = __esm({
4692
3922
  });
4693
3923
 
4694
3924
  // src/agents/prompts/06_mission/index.ts
4695
- var init_mission2 = __esm({
3925
+ var init_mission = __esm({
4696
3926
  "src/agents/prompts/06_mission/index.ts"() {
4697
3927
  "use strict";
4698
3928
  init_mission_status_tracking();
@@ -5263,7 +4493,7 @@ var init_tools_worker = __esm({
5263
4493
  });
5264
4494
 
5265
4495
  // src/agents/prompts/08_tools/index.ts
5266
- var init_tools2 = __esm({
4496
+ var init_tools = __esm({
5267
4497
  "src/agents/prompts/08_tools/index.ts"() {
5268
4498
  "use strict";
5269
4499
  init_tools_core();
@@ -5278,16 +4508,16 @@ var init_tools2 = __esm({
5278
4508
  });
5279
4509
 
5280
4510
  // src/agents/prompts/index.ts
5281
- var init_prompts2 = __esm({
4511
+ var init_prompts = __esm({
5282
4512
  "src/agents/prompts/index.ts"() {
5283
4513
  "use strict";
5284
- init_philosophy2();
4514
+ init_philosophy();
5285
4515
  init_shared();
5286
4516
  init_discovery();
5287
4517
  init_planning();
5288
4518
  init_execution();
5289
4519
  init_verification2();
5290
- init_mission2();
4520
+ init_mission();
5291
4521
  init_commander_role();
5292
4522
  init_commander_identity();
5293
4523
  init_commander_forbidden();
@@ -5305,7 +4535,7 @@ var init_prompts2 = __esm({
5305
4535
  init_reviewer_forbidden();
5306
4536
  init_reviewer_required();
5307
4537
  init_reviewer_mandate();
5308
- init_tools2();
4538
+ init_tools();
5309
4539
  }
5310
4540
  });
5311
4541
 
@@ -5318,9 +4548,10 @@ var systemPrompt, commander;
5318
4548
  var init_commander = __esm({
5319
4549
  "src/agents/commander.ts"() {
5320
4550
  "use strict";
5321
- init_constants();
5322
- init_prompts2();
5323
- systemPrompt = [
4551
+ init_agent();
4552
+ init_registry();
4553
+ init_prompts();
4554
+ systemPrompt = composePrompt([
5324
4555
  CORE_PHILOSOPHY,
5325
4556
  COMMANDER_ROLE,
5326
4557
  COMMANDER_IDENTITY,
@@ -5344,7 +4575,7 @@ var init_commander = __esm({
5344
4575
  COMPLETION_CONDITIONS,
5345
4576
  AUTONOMOUS_MANDATE,
5346
4577
  MISSION_STATUS_FORMAT
5347
- ].join("\n\n");
4578
+ ]);
5348
4579
  commander = {
5349
4580
  id: AGENT_NAMES.COMMANDER,
5350
4581
  description: "Commander - orchestrator with parallel execution, loop state, and sync issue handling",
@@ -5355,6 +4586,154 @@ var init_commander = __esm({
5355
4586
  }
5356
4587
  });
5357
4588
 
4589
+ // node_modules/jsonc-parser/lib/umd/main.js
4590
+ var require_main = __commonJS({
4591
+ "node_modules/jsonc-parser/lib/umd/main.js"(exports, module) {
4592
+ (function(factory) {
4593
+ if (typeof module === "object" && typeof module.exports === "object") {
4594
+ var v = factory(__require, exports);
4595
+ if (v !== void 0) module.exports = v;
4596
+ } else if (typeof define === "function" && define.amd) {
4597
+ define(["require", "exports", "./impl/format", "./impl/edit", "./impl/scanner", "./impl/parser"], factory);
4598
+ }
4599
+ })(function(require3, exports2) {
4600
+ "use strict";
4601
+ Object.defineProperty(exports2, "__esModule", { value: true });
4602
+ exports2.applyEdits = exports2.modify = exports2.format = exports2.printParseErrorCode = exports2.ParseErrorCode = exports2.stripComments = exports2.visit = exports2.getNodeValue = exports2.getNodePath = exports2.findNodeAtOffset = exports2.findNodeAtLocation = exports2.parseTree = exports2.parse = exports2.getLocation = exports2.SyntaxKind = exports2.ScanError = exports2.createScanner = void 0;
4603
+ const formatter = require3("./impl/format");
4604
+ const edit = require3("./impl/edit");
4605
+ const scanner = require3("./impl/scanner");
4606
+ const parser = require3("./impl/parser");
4607
+ exports2.createScanner = scanner.createScanner;
4608
+ var ScanError;
4609
+ (function(ScanError2) {
4610
+ ScanError2[ScanError2["None"] = 0] = "None";
4611
+ ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
4612
+ ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
4613
+ ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
4614
+ ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
4615
+ ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
4616
+ ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
4617
+ })(ScanError || (exports2.ScanError = ScanError = {}));
4618
+ var SyntaxKind;
4619
+ (function(SyntaxKind2) {
4620
+ SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
4621
+ SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
4622
+ SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
4623
+ SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
4624
+ SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
4625
+ SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
4626
+ SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
4627
+ SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
4628
+ SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
4629
+ SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
4630
+ SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
4631
+ SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
4632
+ SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
4633
+ SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
4634
+ SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
4635
+ SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
4636
+ SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
4637
+ })(SyntaxKind || (exports2.SyntaxKind = SyntaxKind = {}));
4638
+ exports2.getLocation = parser.getLocation;
4639
+ exports2.parse = parser.parse;
4640
+ exports2.parseTree = parser.parseTree;
4641
+ exports2.findNodeAtLocation = parser.findNodeAtLocation;
4642
+ exports2.findNodeAtOffset = parser.findNodeAtOffset;
4643
+ exports2.getNodePath = parser.getNodePath;
4644
+ exports2.getNodeValue = parser.getNodeValue;
4645
+ exports2.visit = parser.visit;
4646
+ exports2.stripComments = parser.stripComments;
4647
+ var ParseErrorCode;
4648
+ (function(ParseErrorCode2) {
4649
+ ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
4650
+ ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
4651
+ ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
4652
+ ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
4653
+ ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
4654
+ ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
4655
+ ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
4656
+ ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
4657
+ ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
4658
+ ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
4659
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
4660
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
4661
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
4662
+ ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
4663
+ ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
4664
+ ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
4665
+ })(ParseErrorCode || (exports2.ParseErrorCode = ParseErrorCode = {}));
4666
+ function printParseErrorCode(code) {
4667
+ switch (code) {
4668
+ case 1:
4669
+ return "InvalidSymbol";
4670
+ case 2:
4671
+ return "InvalidNumberFormat";
4672
+ case 3:
4673
+ return "PropertyNameExpected";
4674
+ case 4:
4675
+ return "ValueExpected";
4676
+ case 5:
4677
+ return "ColonExpected";
4678
+ case 6:
4679
+ return "CommaExpected";
4680
+ case 7:
4681
+ return "CloseBraceExpected";
4682
+ case 8:
4683
+ return "CloseBracketExpected";
4684
+ case 9:
4685
+ return "EndOfFileExpected";
4686
+ case 10:
4687
+ return "InvalidCommentToken";
4688
+ case 11:
4689
+ return "UnexpectedEndOfComment";
4690
+ case 12:
4691
+ return "UnexpectedEndOfString";
4692
+ case 13:
4693
+ return "UnexpectedEndOfNumber";
4694
+ case 14:
4695
+ return "InvalidUnicode";
4696
+ case 15:
4697
+ return "InvalidEscapeCharacter";
4698
+ case 16:
4699
+ return "InvalidCharacter";
4700
+ }
4701
+ return "<unknown ParseErrorCode>";
4702
+ }
4703
+ exports2.printParseErrorCode = printParseErrorCode;
4704
+ function format(documentText, range, options) {
4705
+ return formatter.format(documentText, range, options);
4706
+ }
4707
+ exports2.format = format;
4708
+ function modify(text, path11, value, options) {
4709
+ return edit.setProperty(text, path11, value, options);
4710
+ }
4711
+ exports2.modify = modify;
4712
+ function applyEdits(text, edits) {
4713
+ let sortedEdits = edits.slice(0).sort((a, b) => {
4714
+ const diff = a.offset - b.offset;
4715
+ if (diff === 0) {
4716
+ return a.length - b.length;
4717
+ }
4718
+ return diff;
4719
+ });
4720
+ let lastModifiedOffset = text.length;
4721
+ for (let i = sortedEdits.length - 1; i >= 0; i--) {
4722
+ let e = sortedEdits[i];
4723
+ if (e.offset + e.length <= lastModifiedOffset) {
4724
+ text = edit.applyEdit(text, e);
4725
+ } else {
4726
+ throw new Error("Overlapping edit");
4727
+ }
4728
+ lastModifiedOffset = e.offset;
4729
+ }
4730
+ return text;
4731
+ }
4732
+ exports2.applyEdits = applyEdits;
4733
+ });
4734
+ }
4735
+ });
4736
+
5358
4737
  // src/core/session/store.ts
5359
4738
  var store_exports = {};
5360
4739
  __export(store_exports, {
@@ -7092,13 +6471,14 @@ var MemoryManager = class _MemoryManager {
7092
6471
  };
7093
6472
 
7094
6473
  // src/agents/definitions.ts
7095
- init_constants();
6474
+ init_agent();
7096
6475
  init_commander();
7097
6476
 
7098
6477
  // src/agents/subagents/planner.ts
7099
- init_constants();
7100
- init_prompts2();
7101
- var systemPrompt2 = [
6478
+ init_agent();
6479
+ init_registry();
6480
+ init_prompts();
6481
+ var systemPrompt2 = composePrompt([
7102
6482
  PLANNER_ROLE,
7103
6483
  MODULARITY_ENFORCEMENT,
7104
6484
  HYPER_PARALLEL_ENFORCEMENT,
@@ -7116,7 +6496,7 @@ var systemPrompt2 = [
7116
6496
  SHARED_AST_TOOLS,
7117
6497
  SKILLS_CAPABILITIES,
7118
6498
  SHARED_WORKSPACE
7119
- ].join("\n\n");
6499
+ ]);
7120
6500
  var planner = {
7121
6501
  id: AGENT_NAMES.PLANNER,
7122
6502
  description: "Planner - file-level planning, TODO creation and sync",
@@ -7126,9 +6506,10 @@ var planner = {
7126
6506
  };
7127
6507
 
7128
6508
  // src/agents/subagents/worker.ts
7129
- init_constants();
7130
- init_prompts2();
7131
- var systemPrompt3 = [
6509
+ init_agent();
6510
+ init_registry();
6511
+ init_prompts();
6512
+ var systemPrompt3 = composePrompt([
7132
6513
  WORKER_ROLE,
7133
6514
  MODULARITY_ENFORCEMENT,
7134
6515
  HYPER_PARALLEL_ENFORCEMENT,
@@ -7148,7 +6529,7 @@ var systemPrompt3 = [
7148
6529
  SKILLS_CAPABILITIES,
7149
6530
  VERIFICATION_REQUIREMENTS,
7150
6531
  SHARED_WORKSPACE
7151
- ].join("\n\n");
6532
+ ]);
7152
6533
  var worker = {
7153
6534
  id: AGENT_NAMES.WORKER,
7154
6535
  description: "Worker - TDD file-level implementation, reads .opencode, follows Commander",
@@ -7158,9 +6539,10 @@ var worker = {
7158
6539
  };
7159
6540
 
7160
6541
  // src/agents/subagents/reviewer.ts
7161
- init_constants();
7162
- init_prompts2();
7163
- var systemPrompt4 = [
6542
+ init_agent();
6543
+ init_registry();
6544
+ init_prompts();
6545
+ var systemPrompt4 = composePrompt([
7164
6546
  REVIEWER_ROLE,
7165
6547
  MODULARITY_ENFORCEMENT,
7166
6548
  HYPER_PARALLEL_ENFORCEMENT,
@@ -7178,7 +6560,7 @@ var systemPrompt4 = [
7178
6560
  SHARED_AST_TOOLS,
7179
6561
  EVIDENCE_FORMAT,
7180
6562
  SHARED_WORKSPACE
7181
- ].join("\n\n");
6563
+ ]);
7182
6564
  var reviewer = {
7183
6565
  id: AGENT_NAMES.REVIEWER,
7184
6566
  description: "Reviewer - async verification, integration testing, sync validation",
@@ -21716,6 +21098,7 @@ function date4(params) {
21716
21098
  config(en_default());
21717
21099
 
21718
21100
  // src/core/agents/agent-registry.ts
21101
+ var import_jsonc_parser = __toESM(require_main(), 1);
21719
21102
  var AgentDefinitionSchema = external_exports.object({
21720
21103
  id: external_exports.string(),
21721
21104
  // ID is required inside the definition object
@@ -21775,7 +21158,7 @@ var AgentRegistry = class _AgentRegistry {
21775
21158
  const agentsConfigPath = path2.join(this.directory, PATHS.AGENTS_CONFIG);
21776
21159
  try {
21777
21160
  const content = await fs2.readFile(agentsConfigPath, "utf-8");
21778
- const customAgents = JSON.parse(content);
21161
+ const customAgents = (0, import_jsonc_parser.parse)(content);
21779
21162
  if (typeof customAgents === "object" && customAgents !== null) {
21780
21163
  for (const [name, def] of Object.entries(customAgents)) {
21781
21164
  const result = AgentDefinitionSchema.safeParse(def);
@@ -21797,10 +21180,10 @@ var AgentRegistry = class _AgentRegistry {
21797
21180
 
21798
21181
  // src/core/agents/manager/task-launcher.ts
21799
21182
  var TaskLauncher = class {
21800
- constructor(client, directory, store, concurrency, sessionPool2, onTaskError, startPolling) {
21183
+ constructor(client, directory, store2, concurrency, sessionPool2, onTaskError, startPolling) {
21801
21184
  this.client = client;
21802
21185
  this.directory = directory;
21803
- this.store = store;
21186
+ this.store = store2;
21804
21187
  this.concurrency = concurrency;
21805
21188
  this.sessionPool = sessionPool2;
21806
21189
  this.onTaskError = onTaskError;
@@ -21975,9 +21358,9 @@ ${action.modifyPrompt}`;
21975
21358
  init_shared();
21976
21359
  init_logger();
21977
21360
  var TaskResumer = class {
21978
- constructor(client, store, findBySession, startPolling, notifyParentIfAllComplete) {
21361
+ constructor(client, store2, findBySession, startPolling, notifyParentIfAllComplete) {
21979
21362
  this.client = client;
21980
- this.store = store;
21363
+ this.store = store2;
21981
21364
  this.findBySession = findBySession;
21982
21365
  this.startPolling = startPolling;
21983
21366
  this.notifyParentIfAllComplete = notifyParentIfAllComplete;
@@ -22132,9 +21515,9 @@ var progressNotifier = ProgressNotifier.getInstance();
22132
21515
  // src/core/agents/manager/task-poller.ts
22133
21516
  var TaskPoller = class {
22134
21517
  // 5s when idle
22135
- constructor(client, store, concurrency, notifyParentIfAllComplete, scheduleCleanup, pruneExpiredTasks, onTaskComplete) {
21518
+ constructor(client, store2, concurrency, notifyParentIfAllComplete, scheduleCleanup, pruneExpiredTasks, onTaskComplete) {
22136
21519
  this.client = client;
22137
- this.store = store;
21520
+ this.store = store2;
22138
21521
  this.concurrency = concurrency;
22139
21522
  this.notifyParentIfAllComplete = notifyParentIfAllComplete;
22140
21523
  this.scheduleCleanup = scheduleCleanup;
@@ -22346,9 +21729,9 @@ init_shared();
22346
21729
  init_logger();
22347
21730
  init_store();
22348
21731
  var TaskCleaner = class {
22349
- constructor(client, store, concurrency, sessionPool2) {
21732
+ constructor(client, store2, concurrency, sessionPool2) {
22350
21733
  this.client = client;
22351
- this.store = store;
21734
+ this.store = store2;
22352
21735
  this.concurrency = concurrency;
22353
21736
  this.sessionPool = sessionPool2;
22354
21737
  }
@@ -22461,9 +21844,9 @@ You will be notified when ALL tasks complete. Continue productive work.`;
22461
21844
  init_shared();
22462
21845
  init_logger();
22463
21846
  var EventHandler = class {
22464
- constructor(client, store, concurrency, findBySession, notifyParentIfAllComplete, scheduleCleanup, validateSessionHasOutput2, onTaskComplete) {
21847
+ constructor(client, store2, concurrency, findBySession, notifyParentIfAllComplete, scheduleCleanup, validateSessionHasOutput2, onTaskComplete) {
22465
21848
  this.client = client;
22466
- this.store = store;
21849
+ this.store = store2;
22467
21850
  this.concurrency = concurrency;
22468
21851
  this.findBySession = findBySession;
22469
21852
  this.notifyParentIfAllComplete = notifyParentIfAllComplete;
@@ -23131,7 +22514,7 @@ var ParallelAgentManager = class _ParallelAgentManager {
23131
22514
  this.poller.stop();
23132
22515
  this.store.clear();
23133
22516
  MemoryManager.getInstance().clearTaskMemory();
23134
- Promise.resolve().then(() => (init_store(), store_exports)).then((store) => store.clearAll()).catch(() => {
22517
+ Promise.resolve().then(() => (init_store(), store_exports)).then((store2) => store2.clearAll()).catch(() => {
23135
22518
  });
23136
22519
  }
23137
22520
  /**
@@ -36437,12 +35820,13 @@ init_logger();
36437
35820
  // src/core/loop/mission-loop.ts
36438
35821
  init_logger();
36439
35822
  init_shared();
35823
+ init_constants6();
36440
35824
  import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, unlinkSync as unlinkSync2, mkdirSync as mkdirSync4 } from "node:fs";
36441
35825
  import { join as join6 } from "node:path";
36442
35826
 
36443
35827
  // src/shared/constants/system-messages.ts
36444
- init_mission_control();
36445
- init_paths();
35828
+ init_constants4();
35829
+ init_constants2();
36446
35830
  var MISSION_MESSAGES = {
36447
35831
  START_LOG: `[${MISSION_CONTROL.LOG_SOURCE}] Detected /task command. Starting mission...`,
36448
35832
  CANCEL_LOG: `[${MISSION_CONTROL.LOG_SOURCE}] Detected user cancellation signal.`,
@@ -36621,6 +36005,35 @@ function parseLedgerLine(line) {
36621
36005
  }
36622
36006
  }
36623
36007
 
36008
+ // src/core/knowledge/retrieval-weights.ts
36009
+ var NEUTRAL_WEIGHTS = { lexical: 1, tag: 1, graph: 1 };
36010
+ var ROLE_WEIGHTS = {
36011
+ // Planner reasons about dependencies/architecture -> favor structure.
36012
+ planner: { lexical: 0.8, tag: 1.1, graph: 1.3 },
36013
+ // Worker implements concrete changes -> favor exact lexical hits.
36014
+ worker: { lexical: 1.3, tag: 1, graph: 0.7 },
36015
+ // Reviewer needs breadth of evidence -> favor tag/topic coverage.
36016
+ reviewer: { lexical: 1, tag: 1.2, graph: 1 },
36017
+ // Commander coordinates -> neutral.
36018
+ commander: { lexical: 1, tag: 1, graph: 1 }
36019
+ };
36020
+ function weightsForRole(role) {
36021
+ if (!role) return NEUTRAL_WEIGHTS;
36022
+ return ROLE_WEIGHTS[role.toLowerCase()] ?? NEUTRAL_WEIGHTS;
36023
+ }
36024
+ function horizonForLevel(level) {
36025
+ switch (level) {
36026
+ case "system":
36027
+ case "project":
36028
+ return "strategic";
36029
+ case "task":
36030
+ return "closure";
36031
+ case "mission":
36032
+ default:
36033
+ return "execution";
36034
+ }
36035
+ }
36036
+
36624
36037
  // src/core/knowledge/mission-memory.ts
36625
36038
  var BRAIN_DIR = join5(PATHS.DOCS, "brain");
36626
36039
  var SCRATCHPAD_FILE = "scratchpad.md";
@@ -36793,6 +36206,7 @@ function buildMemoryNoteContent(state2, entry) {
36793
36206
  `title: "${escapeYaml(`${entry.level} memory ${entry.id}`)}"`,
36794
36207
  "keep: true",
36795
36208
  `level: "${entry.level}"`,
36209
+ `horizon: "${horizonForLevel(entry.level)}"`,
36796
36210
  `importance: ${entry.importance.toFixed(3)}`,
36797
36211
  `session: "${escapeYaml(state2.sessionID)}"`,
36798
36212
  `recorded_at: "${recordedAt}"`,
@@ -36834,6 +36248,7 @@ function capitalize(value) {
36834
36248
 
36835
36249
  // src/core/loop/mission-loop.ts
36836
36250
  var STATE_FILE = MISSION_CONTROL.STATE_FILE;
36251
+ var ESCALATION_STAGNATION_THRESHOLD = 5;
36837
36252
  var DEFAULT_MAX_ITERATIONS = MISSION_CONTROL.DEFAULT_MAX_ITERATIONS;
36838
36253
  var UNKNOWN_STATUS = "unknown";
36839
36254
  function getStateFilePath(directory) {
@@ -36972,7 +36387,28 @@ Next action:
36972
36387
 
36973
36388
  Completion rule:
36974
36389
  Do not declare success while TODO/checklist/sync verification is still failing.
36390
+ Before declaring done, briefly self-account: (1) scope fit vs the objective,
36391
+ (2) what verification ran, (3) any residual risk or follow-on wiring.
36975
36392
  </mission_loop>`;
36393
+ if (context.escalate) {
36394
+ prompt += `
36395
+
36396
+ <escalation reason="repeated_stagnation">
36397
+ Progress has stalled across ${context.stagnation}. Stop blind retries.
36398
+ Follow ${RECOVERY_PRINCIPLE}
36399
+ 1. DECOMPOSE the blocked step into smaller, independently verifiable pieces.
36400
+ 2. RE-PLAN with a different approach if decomposition does not unblock it.
36401
+ 3. If still blocked, summarize the exact blocker and ASK the user for direction.
36402
+ </escalation>`;
36403
+ }
36404
+ if (context.unverifiedChanges > 0) {
36405
+ prompt += `
36406
+
36407
+ <wiring_gate>
36408
+ ${context.unverifiedChanges} changed file(s) this mission have no verification evidence yet.
36409
+ Run the project's tests/build/lint over the changed surface and cite the result before declaring done.
36410
+ </wiring_gate>`;
36411
+ }
36976
36412
  if (state2.iteration > 1) {
36977
36413
  prompt += "\n" + CLEANUP_INSTRUCTION.replace("%ITER%", state2.iteration.toString());
36978
36414
  }
@@ -36981,13 +36417,16 @@ Do not declare success while TODO/checklist/sync verification is still failing.
36981
36417
  function normalizeContinuationContext(state2, input) {
36982
36418
  const verificationSummary = typeof input === "string" ? input : input?.verificationSummary;
36983
36419
  const continuationReason = typeof input === "string" ? void 0 : input?.continuationReason;
36420
+ const unverifiedChanges = typeof input === "string" ? 0 : input?.unverifiedChanges ?? 0;
36984
36421
  const stagnationCount = state2.stagnationCount ?? 0;
36985
36422
  return {
36986
36423
  objective: state2.objective || deriveObjective(state2.prompt),
36987
36424
  progress: state2.lastProgress ?? UNKNOWN_STATUS,
36988
36425
  verification: verificationSummary ?? state2.lastVerificationSummary ?? UNKNOWN_STATUS,
36989
36426
  reason: continuationReason ?? state2.lastContinuationReason ?? "verification_failed",
36990
- stagnation: stagnationCount > 0 ? `${stagnationCount} unchanged check(s)` : "not detected"
36427
+ stagnation: stagnationCount > 0 ? `${stagnationCount} unchanged check(s)` : "not detected",
36428
+ unverifiedChanges,
36429
+ escalate: stagnationCount >= ESCALATION_STAGNATION_THRESHOLD
36991
36430
  };
36992
36431
  }
36993
36432
 
@@ -37641,20 +37080,18 @@ import { exec as exec2 } from "node:child_process";
37641
37080
  import { promisify as promisify2 } from "node:util";
37642
37081
  import { readFileSync as readFileSync5 } from "node:fs";
37643
37082
 
37644
- // src/shared/notification/os-notify/constants/notification-commands.ts
37645
- var NOTIFICATION_COMMANDS = {
37083
+ // src/shared/notification/os-notify/constants.ts
37084
+ var NOTIFICATION_COMMAND_KEYS = {
37646
37085
  OSASCRIPT: "osascript",
37647
- NOTIFY_SEND: "notify-send",
37086
+ NOTIFY_SEND: "notifySend",
37648
37087
  POWERSHELL: "powershell",
37649
37088
  AFPLAY: "afplay",
37650
37089
  PAPLAY: "paplay",
37651
37090
  APLAY: "aplay"
37652
37091
  };
37653
-
37654
- // src/shared/notification/os-notify/constants/notification-command-keys.ts
37655
- var NOTIFICATION_COMMAND_KEYS = {
37092
+ var NOTIFICATION_COMMANDS = {
37656
37093
  OSASCRIPT: "osascript",
37657
- NOTIFY_SEND: "notifySend",
37094
+ NOTIFY_SEND: "notify-send",
37658
37095
  POWERSHELL: "powershell",
37659
37096
  AFPLAY: "afplay",
37660
37097
  PAPLAY: "paplay",
@@ -39575,7 +39012,7 @@ var CleanupScheduler = class {
39575
39012
  };
39576
39013
 
39577
39014
  // src/index.ts
39578
- init_lifecycle2();
39015
+ init_lifecycle();
39579
39016
 
39580
39017
  // src/core/commands/manager.ts
39581
39018
  init_shared();
@@ -40540,6 +39977,47 @@ Safely refactor code across files using syntax patterns.`,
40540
39977
 
40541
39978
  // src/tools/web/webfetch.ts
40542
39979
  init_shared();
39980
+
39981
+ // src/utils/parsing/safe-json.ts
39982
+ function stripCodeFence(input) {
39983
+ const trimmed = input.trim();
39984
+ const fence = /^```[a-zA-Z0-9]*\s*\n([\s\S]*?)\n```$/;
39985
+ const match = trimmed.match(fence);
39986
+ return match ? match[1].trim() : trimmed;
39987
+ }
39988
+ function extractBracketed(input) {
39989
+ const firstObj = input.indexOf("{");
39990
+ const firstArr = input.indexOf("[");
39991
+ const candidates = [firstObj, firstArr].filter((i) => i >= 0);
39992
+ if (candidates.length === 0) return null;
39993
+ const start = Math.min(...candidates);
39994
+ const open = input[start];
39995
+ const close = open === "{" ? "}" : "]";
39996
+ const end = input.lastIndexOf(close);
39997
+ if (end <= start) return null;
39998
+ return input.slice(start, end + 1);
39999
+ }
40000
+ function removeTrailingCommas(input) {
40001
+ return input.replace(/,(\s*[}\]])/g, "$1");
40002
+ }
40003
+ function safeJsonParse(input, fallback = null) {
40004
+ if (typeof input !== "string") return fallback;
40005
+ const cleaned = stripCodeFence(input);
40006
+ if (!cleaned) return fallback;
40007
+ const attempts = [cleaned];
40008
+ const bracketed = extractBracketed(cleaned);
40009
+ if (bracketed && bracketed !== cleaned) attempts.push(bracketed);
40010
+ attempts.push(removeTrailingCommas(bracketed ?? cleaned));
40011
+ for (const candidate of attempts) {
40012
+ try {
40013
+ return JSON.parse(candidate);
40014
+ } catch {
40015
+ }
40016
+ }
40017
+ return fallback;
40018
+ }
40019
+
40020
+ // src/tools/web/webfetch.ts
40543
40021
  function htmlToMarkdown(html) {
40544
40022
  return html.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, "").replace(/<style[^>]*>[\s\S]*?<\/style>/gi, "").replace(/<h1[^>]*>(.*?)<\/h1>/gi, "# $1\n\n").replace(/<h2[^>]*>(.*?)<\/h2>/gi, "## $1\n\n").replace(/<h3[^>]*>(.*?)<\/h3>/gi, "### $1\n\n").replace(/<h4[^>]*>(.*?)<\/h4>/gi, "#### $1\n\n").replace(/<h5[^>]*>(.*?)<\/h5>/gi, "##### $1\n\n").replace(/<h6[^>]*>(.*?)<\/h6>/gi, "###### $1\n\n").replace(/<p[^>]*>(.*?)<\/p>/gi, "$1\n\n").replace(/<pre[^>]*><code[^>]*>([\s\S]*?)<\/code><\/pre>/gi, "```\n$1\n```\n\n").replace(/<code[^>]*>(.*?)<\/code>/gi, "`$1`").replace(/<li[^>]*>(.*?)<\/li>/gi, "- $1\n").replace(/<ul[^>]*>/gi, "\n").replace(/<\/ul>/gi, "\n").replace(/<ol[^>]*>/gi, "\n").replace(/<\/ol>/gi, "\n").replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gi, "[$2]($1)").replace(/<strong[^>]*>(.*?)<\/strong>/gi, "**$1**").replace(/<b[^>]*>(.*?)<\/b>/gi, "**$1**").replace(/<em[^>]*>(.*?)<\/em>/gi, "*$1*").replace(/<i[^>]*>(.*?)<\/i>/gi, "*$1*").replace(/<blockquote[^>]*>([\s\S]*?)<\/blockquote>/gi, "> $1\n\n").replace(/<br\s*\/?>/gi, "\n").replace(/<[^>]+>/g, "").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, " ").replace(/\n{3,}/g, "\n\n").trim();
40545
40023
  }
@@ -40607,7 +40085,8 @@ ${cached3.content}`;
40607
40085
  const contentType = response.headers.get("content-type") || "";
40608
40086
  const html = await response.text();
40609
40087
  if (contentType.includes("application/json")) {
40610
- const content = JSON.stringify(JSON.parse(html), null, 2);
40088
+ const parsed = safeJsonParse(html);
40089
+ const content = parsed !== null ? JSON.stringify(parsed, null, 2) : html;
40611
40090
  if (cache2) {
40612
40091
  const filename = await set3(url3, content, "JSON Response");
40613
40092
  return `${OUTPUT_LABEL.JSON_FETCHED} (cached: ${PATHS.DOCS}/${filename})
@@ -41383,6 +40862,25 @@ function mergeConcurrencyConfig(base, override) {
41383
40862
  };
41384
40863
  }
41385
40864
 
40865
+ // src/core/config/options-schema.ts
40866
+ var D = DEFAULT_MISSION_RUNTIME_OPTIONS;
40867
+ var MissionLoopOptionsSchema = external_exports.object({
40868
+ ledger: external_exports.boolean().catch(D.ledger).default(D.ledger),
40869
+ markdownMemory: external_exports.boolean().catch(D.markdownMemory).default(D.markdownMemory),
40870
+ maxEvidenceEvents: external_exports.number().int().positive().catch(D.maxEvidenceEvents).default(D.maxEvidenceEvents)
40871
+ }).catch({ ...D });
40872
+ var ConcurrencyMap = external_exports.record(external_exports.string(), external_exports.number().int().positive());
40873
+ var OrchestratorOptionsSchema = external_exports.object({
40874
+ agentConcurrency: ConcurrencyMap.optional(),
40875
+ providerConcurrency: ConcurrencyMap.optional(),
40876
+ modelConcurrency: ConcurrencyMap.optional(),
40877
+ defaultConcurrency: external_exports.number().int().positive().optional(),
40878
+ missionLoop: MissionLoopOptionsSchema.optional()
40879
+ }).passthrough();
40880
+ function parseMissionLoopOptions(value) {
40881
+ return MissionLoopOptionsSchema.parse(value);
40882
+ }
40883
+
41386
40884
  // src/core/config/plugin-options.ts
41387
40885
  function parseOrchestratorPluginOptions(options) {
41388
40886
  const source = isRecord4(options) ? options : {};
@@ -41392,21 +40890,7 @@ function parseOrchestratorPluginOptions(options) {
41392
40890
  };
41393
40891
  }
41394
40892
  function readMissionLoopOptions(value) {
41395
- if (!isRecord4(value)) return DEFAULT_MISSION_RUNTIME_OPTIONS;
41396
- return {
41397
- ledger: readBoolean(value.ledger, DEFAULT_MISSION_RUNTIME_OPTIONS.ledger),
41398
- markdownMemory: readBoolean(value.markdownMemory, DEFAULT_MISSION_RUNTIME_OPTIONS.markdownMemory),
41399
- maxEvidenceEvents: readPositiveInteger(
41400
- value.maxEvidenceEvents,
41401
- DEFAULT_MISSION_RUNTIME_OPTIONS.maxEvidenceEvents
41402
- )
41403
- };
41404
- }
41405
- function readBoolean(value, fallback) {
41406
- return typeof value === "boolean" ? value : fallback;
41407
- }
41408
- function readPositiveInteger(value, fallback) {
41409
- return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : fallback;
40893
+ return parseMissionLoopOptions(value);
41410
40894
  }
41411
40895
  function isRecord4(value) {
41412
40896
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -41733,6 +41217,61 @@ function createSessionStateStore() {
41733
41217
  };
41734
41218
  }
41735
41219
 
41220
+ // src/core/loop/evidence.ts
41221
+ var MAX_TRACKED_FILES = 200;
41222
+ var store = /* @__PURE__ */ new Map();
41223
+ var WRITE_TOOLS = /* @__PURE__ */ new Set([
41224
+ "write",
41225
+ "edit",
41226
+ "patch",
41227
+ "multiedit",
41228
+ "multi_patch",
41229
+ "apply_patch",
41230
+ "sed_replace",
41231
+ "ast_replace"
41232
+ ]);
41233
+ var SHELL_TOOLS = /* @__PURE__ */ new Set(["bash", "shell", "run_command", "run_background"]);
41234
+ var VERIFY_HINT = /\b(test|spec|vitest|jest|pytest|build|tsc|typecheck|lint|eslint|clippy|cargo\s+test|npm\s+test|go\s+test|check)\b/i;
41235
+ function ensure(sessionID) {
41236
+ let evidence = store.get(sessionID);
41237
+ if (!evidence) {
41238
+ evidence = { changedFiles: /* @__PURE__ */ new Set(), lastChangeAt: 0, lastVerifyAt: 0 };
41239
+ store.set(sessionID, evidence);
41240
+ }
41241
+ return evidence;
41242
+ }
41243
+ function recordChangedFile(sessionID, filePath, now = Date.now()) {
41244
+ if (!sessionID || !filePath) return;
41245
+ const evidence = ensure(sessionID);
41246
+ if (evidence.changedFiles.size < MAX_TRACKED_FILES) {
41247
+ evidence.changedFiles.add(filePath);
41248
+ }
41249
+ evidence.lastChangeAt = now;
41250
+ }
41251
+ function recordVerification(sessionID, now = Date.now()) {
41252
+ if (!sessionID) return;
41253
+ ensure(sessionID).lastVerifyAt = now;
41254
+ }
41255
+ function recordToolEvidence(sessionID, tool2, args, now = Date.now()) {
41256
+ if (!sessionID || !tool2) return;
41257
+ const name = tool2.toLowerCase();
41258
+ if (WRITE_TOOLS.has(name)) {
41259
+ const candidate = args?.filePath ?? args?.path ?? args?.file;
41260
+ if (typeof candidate === "string") recordChangedFile(sessionID, candidate, now);
41261
+ } else if (SHELL_TOOLS.has(name)) {
41262
+ const command = String(args?.command ?? args?.cmd ?? "");
41263
+ if (VERIFY_HINT.test(command)) recordVerification(sessionID, now);
41264
+ }
41265
+ }
41266
+ function getUnverifiedChangeCount(sessionID) {
41267
+ const evidence = store.get(sessionID);
41268
+ if (!evidence || evidence.changedFiles.size === 0) return 0;
41269
+ return evidence.lastVerifyAt >= evidence.lastChangeAt ? 0 : evidence.changedFiles.size;
41270
+ }
41271
+ function clearEvidence(sessionID) {
41272
+ store.delete(sessionID);
41273
+ }
41274
+
41736
41275
  // src/core/loop/progress-tracker.ts
41737
41276
  init_logger();
41738
41277
  var DEFAULT_STAGNATION_THRESHOLD = 3;
@@ -42095,7 +41634,8 @@ async function injectContinuation2(client, directory, sessionID, loopState, cust
42095
41634
  const continuationReason = customPrompt ? "stagnation_intervention" : loopState.lastContinuationReason;
42096
41635
  let prompt = generateMissionContinuationPrompt(loopState, {
42097
41636
  verificationSummary: summary,
42098
- continuationReason
41637
+ continuationReason,
41638
+ unverifiedChanges: getUnverifiedChangeCount(sessionID)
42099
41639
  });
42100
41640
  if (customPrompt) {
42101
41641
  prompt = `${customPrompt}
@@ -42262,6 +41802,7 @@ function cleanupSession3(sessionID) {
42262
41802
  clearCompactionState(sessionID);
42263
41803
  clearCircuitState(sessionID);
42264
41804
  resetProgress(sessionID);
41805
+ clearEvidence(sessionID);
42265
41806
  }
42266
41807
  function handleSessionCompacted(sessionID) {
42267
41808
  armCompactionGuard(sessionID, Date.now());
@@ -42491,6 +42032,7 @@ function createToolExecuteAfterHandler(ctx) {
42491
42032
  toolOutput
42492
42033
  );
42493
42034
  recordToolCall(toolInput.sessionID, toolInput.tool);
42035
+ recordToolEvidence(toolInput.sessionID, toolInput.tool, toolInput.arguments || {});
42494
42036
  log(`[tool.execute.after] Completed ${toolInput.tool}`, {
42495
42037
  sessionID: toolInput.sessionID,
42496
42038
  step: session.step,
@@ -42738,14 +42280,14 @@ var HybridSearch = class {
42738
42280
  /**
42739
42281
  * Fuse lexical, tag, and graph rankings via RRF to produce a single list.
42740
42282
  */
42741
- search(query, maxResults) {
42283
+ search(query, maxResults, weights) {
42742
42284
  const limit = maxResults ?? DEFAULT_MAX_RESULTS;
42743
42285
  const terms = this.tokenize(query);
42744
42286
  if (terms.length === 0) return [];
42745
42287
  const lexicalRanked = this.lexicalSearch(terms);
42746
42288
  const tagRanked = this.tagSearch(terms);
42747
42289
  const graphRanked = this.graphSearch(terms);
42748
- return this.fuseResults(lexicalRanked, tagRanked, graphRanked, limit);
42290
+ return this.fuseResults(lexicalRanked, tagRanked, graphRanked, limit, weights ?? NEUTRAL_WEIGHTS);
42749
42291
  }
42750
42292
  /**
42751
42293
  * BM25-inspired term-frequency scoring across all indexed documents.
@@ -42817,20 +42359,20 @@ var HybridSearch = class {
42817
42359
  * Reciprocal Rank Fusion: combine three ranked lists into a single ranking.
42818
42360
  * Formula: score(d) = Σ 1/(k + rank_i) for each list where d appears.
42819
42361
  */
42820
- fuseResults(lexical, tags, graph, limit) {
42362
+ fuseResults(lexical, tags, graph, limit, weights) {
42821
42363
  const fused = /* @__PURE__ */ new Map();
42822
- this.addRrfScores(fused, lexical, "lexical");
42823
- this.addRrfScores(fused, tags, "tag");
42824
- this.addRrfScores(fused, graph, "graph");
42364
+ this.addRrfScores(fused, lexical, "lexical", weights.lexical);
42365
+ this.addRrfScores(fused, tags, "tag", weights.tag);
42366
+ this.addRrfScores(fused, graph, "graph", weights.graph);
42825
42367
  return Array.from(fused.entries()).map(([noteName, { score, matchType }]) => ({ noteName, score, matchType })).sort((a, b) => b.score - a.score).slice(0, limit);
42826
42368
  }
42827
42369
  /**
42828
42370
  * Accumulate RRF scores from a single ranked list into the fused map.
42829
42371
  * The matchType is set to the source with the highest individual contribution.
42830
42372
  */
42831
- addRrfScores(fused, ranked, matchType) {
42373
+ addRrfScores(fused, ranked, matchType, weight = 1) {
42832
42374
  for (let i = 0; i < ranked.length; i++) {
42833
- const rrfScore = 1 / (RRF_K + i + 1);
42375
+ const rrfScore = weight * (1 / (RRF_K + i + 1));
42834
42376
  const existing = fused.get(ranked[i]);
42835
42377
  if (existing) {
42836
42378
  existing.score += rrfScore;
@@ -43055,13 +42597,13 @@ var KNOWLEDGE_ROOTS = ["docs", path10.join(".opencode", "docs")];
43055
42597
  var SKIP_SEGMENTS = /* @__PURE__ */ new Set(["node_modules", "dist", "bin", ".git", "archive"]);
43056
42598
  var GENERATED_SCRATCHPAD_PATH = path10.join(".opencode", "docs", "brain", "scratchpad.md");
43057
42599
  var KnowledgeContextProvider = class {
43058
- buildPrompt(directory, query) {
42600
+ buildPrompt(directory, query, role) {
43059
42601
  const normalizedQuery = query.trim();
43060
42602
  if (!normalizedQuery) return null;
43061
42603
  const markdownFiles = this.collectMarkdownFiles(directory);
43062
42604
  if (markdownFiles.length === 0) return null;
43063
42605
  const indexed = this.indexKnowledge(directory, markdownFiles);
43064
- const results = indexed.search.search(normalizedQuery, MAX_RESULTS);
42606
+ const results = indexed.search.search(normalizedQuery, MAX_RESULTS, weightsForRole(role));
43065
42607
  if (results.length === 0) return null;
43066
42608
  return this.formatPrompt(normalizedQuery, results, indexed);
43067
42609
  }
@@ -43366,3 +42908,4 @@ var index_default = OrchestratorPlugin;
43366
42908
  export {
43367
42909
  index_default as default
43368
42910
  };
42911
+ //# sourceMappingURL=index.js.map