smol-symphony 0.2.0 → 0.3.1

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 (540) hide show
  1. package/AGENTS.md +41 -22
  2. package/DESIGN.md +494 -273
  3. package/README.md +109 -57
  4. package/SPEC.md +33 -24
  5. package/WORKFLOW.minimal.yaml +34 -0
  6. package/{WORKFLOW.template.md → WORKFLOW.template.yaml} +409 -256
  7. package/WORKFLOW.yaml +487 -0
  8. package/assets/skills/symphony-issues/SKILL.md +136 -0
  9. package/assets/symphony-mise.system.toml +68 -0
  10. package/dist/bin/symphony.js +22 -786
  11. package/dist/bin/symphony.js.map +1 -1
  12. package/dist/core/actions/context.js +109 -0
  13. package/dist/core/actions/context.js.map +1 -0
  14. package/dist/{actions/parsing.js → core/actions/parse.js} +33 -114
  15. package/dist/core/actions/parse.js.map +1 -0
  16. package/dist/core/actions/plan.js +197 -0
  17. package/dist/core/actions/plan.js.map +1 -0
  18. package/dist/core/actions/predicates.js +111 -0
  19. package/dist/core/actions/predicates.js.map +1 -0
  20. package/dist/core/actions/run-fold.js +248 -0
  21. package/dist/core/actions/run-fold.js.map +1 -0
  22. package/dist/core/actions/template.js +118 -0
  23. package/dist/core/actions/template.js.map +1 -0
  24. package/dist/core/cli/args.js +116 -0
  25. package/dist/core/cli/args.js.map +1 -0
  26. package/dist/core/coerce.js +75 -0
  27. package/dist/core/coerce.js.map +1 -0
  28. package/dist/core/credential/account-id.js +20 -0
  29. package/dist/core/credential/account-id.js.map +1 -0
  30. package/dist/core/credential/adapter-config.js +136 -0
  31. package/dist/core/credential/adapter-config.js.map +1 -0
  32. package/dist/core/credential/availability.js +98 -0
  33. package/dist/core/credential/availability.js.map +1 -0
  34. package/dist/core/credential/extract.js +228 -0
  35. package/dist/core/credential/extract.js.map +1 -0
  36. package/dist/core/credential/fake-creds.js +171 -0
  37. package/dist/core/credential/fake-creds.js.map +1 -0
  38. package/dist/core/credential/identity.js +125 -0
  39. package/dist/core/credential/identity.js.map +1 -0
  40. package/dist/core/credential/shape.js +230 -0
  41. package/dist/core/credential/shape.js.map +1 -0
  42. package/dist/core/credential/strings.js +15 -0
  43. package/dist/core/credential/strings.js.map +1 -0
  44. package/dist/core/doctor/checks.js +303 -0
  45. package/dist/core/doctor/checks.js.map +1 -0
  46. package/dist/core/git/result.js +107 -0
  47. package/dist/core/git/result.js.map +1 -0
  48. package/dist/core/http/decisions.js +225 -0
  49. package/dist/core/http/decisions.js.map +1 -0
  50. package/dist/{http.js → core/http/render.js} +472 -738
  51. package/dist/core/http/render.js.map +1 -0
  52. package/dist/{http-handlers.js → core/http/routes.js} +52 -87
  53. package/dist/core/http/routes.js.map +1 -0
  54. package/dist/core/http/views.js +181 -0
  55. package/dist/core/http/views.js.map +1 -0
  56. package/dist/core/image/managed-image.js +95 -0
  57. package/dist/core/image/managed-image.js.map +1 -0
  58. package/dist/core/issue/file.js +149 -0
  59. package/dist/core/issue/file.js.map +1 -0
  60. package/dist/core/issue/parse.js +210 -0
  61. package/dist/core/issue/parse.js.map +1 -0
  62. package/dist/core/mcp/dispatch.js +239 -0
  63. package/dist/core/mcp/dispatch.js.map +1 -0
  64. package/dist/core/mcp/post-move.js +92 -0
  65. package/dist/core/mcp/post-move.js.map +1 -0
  66. package/dist/core/mcp/protocol.js +293 -0
  67. package/dist/core/mcp/protocol.js.map +1 -0
  68. package/dist/core/mcp/url.js +162 -0
  69. package/dist/core/mcp/url.js.map +1 -0
  70. package/dist/core/path.js +63 -0
  71. package/dist/core/path.js.map +1 -0
  72. package/dist/core/reconcile/image-decide.js +48 -0
  73. package/dist/core/reconcile/image-decide.js.map +1 -0
  74. package/dist/core/reconcile/ledger.js +142 -0
  75. package/dist/core/reconcile/ledger.js.map +1 -0
  76. package/dist/core/reconcile/pr-classify.js +62 -0
  77. package/dist/core/reconcile/pr-classify.js.map +1 -0
  78. package/dist/{reconciler → core/reconcile}/pr-decide.js +25 -12
  79. package/dist/core/reconcile/pr-decide.js.map +1 -0
  80. package/dist/core/reconcile/pr-loop.js +161 -0
  81. package/dist/core/reconcile/pr-loop.js.map +1 -0
  82. package/dist/core/reconcile/pr-notes.js +35 -0
  83. package/dist/core/reconcile/pr-notes.js.map +1 -0
  84. package/dist/core/reconcile/vm-decide.js +70 -0
  85. package/dist/core/reconcile/vm-decide.js.map +1 -0
  86. package/dist/core/reconcile/vm-reap.js +207 -0
  87. package/dist/core/reconcile/vm-reap.js.map +1 -0
  88. package/dist/core/reconcile/workspace-decide.js +162 -0
  89. package/dist/core/reconcile/workspace-decide.js.map +1 -0
  90. package/dist/core/runlog/summary.js +231 -0
  91. package/dist/core/runlog/summary.js.map +1 -0
  92. package/dist/core/runner/dispatch-config.js +95 -0
  93. package/dist/core/runner/dispatch-config.js.map +1 -0
  94. package/dist/core/runner/injection.js +61 -0
  95. package/dist/core/runner/injection.js.map +1 -0
  96. package/dist/core/runner/mise.js +210 -0
  97. package/dist/core/runner/mise.js.map +1 -0
  98. package/dist/core/runner/prompt.js +720 -0
  99. package/dist/core/runner/prompt.js.map +1 -0
  100. package/dist/core/runner/turn.js +242 -0
  101. package/dist/core/runner/turn.js.map +1 -0
  102. package/dist/core/runner/vm-plan.js +390 -0
  103. package/dist/core/runner/vm-plan.js.map +1 -0
  104. package/dist/core/schedule/admission.js +123 -0
  105. package/dist/core/schedule/admission.js.map +1 -0
  106. package/dist/core/schedule/circuit-breaker.js +111 -0
  107. package/dist/core/schedule/circuit-breaker.js.map +1 -0
  108. package/dist/core/schedule/eligibility.js +83 -0
  109. package/dist/core/schedule/eligibility.js.map +1 -0
  110. package/dist/core/schedule/reconcile-issue.js +82 -0
  111. package/dist/core/schedule/reconcile-issue.js.map +1 -0
  112. package/dist/core/schedule/retry.js +96 -0
  113. package/dist/core/schedule/retry.js.map +1 -0
  114. package/dist/core/schedule/sleep-cycle.js +133 -0
  115. package/dist/core/schedule/sleep-cycle.js.map +1 -0
  116. package/dist/core/schedule/slots.js +124 -0
  117. package/dist/core/schedule/slots.js.map +1 -0
  118. package/dist/core/schedule/tick.js +553 -0
  119. package/dist/core/schedule/tick.js.map +1 -0
  120. package/dist/core/schedule/token-fold.js +181 -0
  121. package/dist/core/schedule/token-fold.js.map +1 -0
  122. package/dist/core/state-resolve.js +86 -0
  123. package/dist/core/state-resolve.js.map +1 -0
  124. package/dist/core/vm-guards.js +278 -0
  125. package/dist/core/vm-guards.js.map +1 -0
  126. package/dist/core/workflow/derive.js +107 -0
  127. package/dist/core/workflow/derive.js.map +1 -0
  128. package/dist/core/workflow/parse.js +687 -0
  129. package/dist/core/workflow/parse.js.map +1 -0
  130. package/dist/core/workflow/prompt-probe.js +78 -0
  131. package/dist/core/workflow/prompt-probe.js.map +1 -0
  132. package/dist/core/workflow/validate.js +189 -0
  133. package/dist/core/workflow/validate.js.map +1 -0
  134. package/dist/core/workspace-key.js +19 -0
  135. package/dist/core/workspace-key.js.map +1 -0
  136. package/dist/shell/actions-runner.js +356 -0
  137. package/dist/shell/actions-runner.js.map +1 -0
  138. package/dist/shell/adapter/adapter-registry.js +45 -0
  139. package/dist/shell/adapter/adapter-registry.js.map +1 -0
  140. package/dist/shell/adapter/clock-random.js +96 -0
  141. package/dist/shell/adapter/clock-random.js.map +1 -0
  142. package/dist/shell/adapter/gondolin-dispatch-helpers.js +158 -0
  143. package/dist/shell/adapter/gondolin-dispatch-helpers.js.map +1 -0
  144. package/dist/shell/adapter/gondolin-dispatch.js +385 -0
  145. package/dist/shell/adapter/gondolin-dispatch.js.map +1 -0
  146. package/dist/shell/adapter/gondolin-image-converter.js +233 -0
  147. package/dist/shell/adapter/gondolin-image-converter.js.map +1 -0
  148. package/dist/shell/adapter/gondolin-image-fetch.js +180 -0
  149. package/dist/shell/adapter/gondolin-image-fetch.js.map +1 -0
  150. package/dist/shell/adapter/launcher-asset.js +57 -0
  151. package/dist/shell/adapter/launcher-asset.js.map +1 -0
  152. package/dist/shell/adapter/mise-config-asset.js +65 -0
  153. package/dist/shell/adapter/mise-config-asset.js.map +1 -0
  154. package/dist/shell/adapter/workflow-loader.js +304 -0
  155. package/dist/shell/adapter/workflow-loader.js.map +1 -0
  156. package/dist/shell/cli/doctor.js +268 -0
  157. package/dist/shell/cli/doctor.js.map +1 -0
  158. package/dist/shell/effect-interpreter-families.js +314 -0
  159. package/dist/shell/effect-interpreter-families.js.map +1 -0
  160. package/dist/shell/effect-interpreter.js +29 -0
  161. package/dist/shell/effect-interpreter.js.map +1 -0
  162. package/dist/shell/interp/acp-frame.js +137 -0
  163. package/dist/shell/interp/acp-frame.js.map +1 -0
  164. package/dist/shell/interp/acp-ws-conn.js +320 -0
  165. package/dist/shell/interp/acp-ws-conn.js.map +1 -0
  166. package/dist/shell/interp/acp-ws-frames.js +159 -0
  167. package/dist/shell/interp/acp-ws-frames.js.map +1 -0
  168. package/dist/shell/interp/acp-ws.js +197 -0
  169. package/dist/shell/interp/acp-ws.js.map +1 -0
  170. package/dist/shell/interp/acp.js +319 -0
  171. package/dist/shell/interp/acp.js.map +1 -0
  172. package/dist/shell/interp/credential-defaults.js +128 -0
  173. package/dist/shell/interp/credential-defaults.js.map +1 -0
  174. package/dist/shell/interp/credential-hooks.js +149 -0
  175. package/dist/shell/interp/credential-hooks.js.map +1 -0
  176. package/dist/shell/interp/credential-registry.js +226 -0
  177. package/dist/shell/interp/credential-registry.js.map +1 -0
  178. package/dist/shell/interp/credential.js +103 -0
  179. package/dist/shell/interp/credential.js.map +1 -0
  180. package/dist/shell/interp/gh.js +163 -0
  181. package/dist/shell/interp/gh.js.map +1 -0
  182. package/dist/shell/interp/git.js +28 -0
  183. package/dist/shell/interp/git.js.map +1 -0
  184. package/dist/shell/interp/log.js +213 -0
  185. package/dist/shell/interp/log.js.map +1 -0
  186. package/dist/shell/interp/process.js +178 -0
  187. package/dist/shell/interp/process.js.map +1 -0
  188. package/dist/shell/interp/runlog.js +193 -0
  189. package/dist/shell/interp/runlog.js.map +1 -0
  190. package/dist/shell/interp/timer.js +64 -0
  191. package/dist/shell/interp/timer.js.map +1 -0
  192. package/dist/shell/interp/tracker-disk.js +99 -0
  193. package/dist/shell/interp/tracker-disk.js.map +1 -0
  194. package/dist/shell/interp/tracker-parse.js +71 -0
  195. package/dist/shell/interp/tracker-parse.js.map +1 -0
  196. package/dist/shell/interp/tracker-scan.js +238 -0
  197. package/dist/shell/interp/tracker-scan.js.map +1 -0
  198. package/dist/shell/interp/tracker-write.js +91 -0
  199. package/dist/shell/interp/tracker-write.js.map +1 -0
  200. package/dist/shell/interp/tracker.js +41 -0
  201. package/dist/shell/interp/tracker.js.map +1 -0
  202. package/dist/shell/interp/tty.js +48 -0
  203. package/dist/shell/interp/tty.js.map +1 -0
  204. package/dist/shell/interp/vm.js +199 -0
  205. package/dist/shell/interp/vm.js.map +1 -0
  206. package/dist/shell/interp/workspace.js +310 -0
  207. package/dist/shell/interp/workspace.js.map +1 -0
  208. package/dist/shell/main-acp.js +78 -0
  209. package/dist/shell/main-acp.js.map +1 -0
  210. package/dist/shell/main-adapters.js +222 -0
  211. package/dist/shell/main-adapters.js.map +1 -0
  212. package/dist/shell/main-credential.js +122 -0
  213. package/dist/shell/main-credential.js.map +1 -0
  214. package/dist/shell/main-doctor.js +22 -0
  215. package/dist/shell/main-doctor.js.map +1 -0
  216. package/dist/shell/main-entry.js +46 -0
  217. package/dist/shell/main-entry.js.map +1 -0
  218. package/dist/shell/main-http-csrf.js +45 -0
  219. package/dist/shell/main-http-csrf.js.map +1 -0
  220. package/dist/shell/main-http-handler.js +389 -0
  221. package/dist/shell/main-http-handler.js.map +1 -0
  222. package/dist/shell/main-http-mcp.js +122 -0
  223. package/dist/shell/main-http-mcp.js.map +1 -0
  224. package/dist/shell/main-http-views.js +253 -0
  225. package/dist/shell/main-http-views.js.map +1 -0
  226. package/dist/shell/main-http.js +76 -0
  227. package/dist/shell/main-http.js.map +1 -0
  228. package/dist/shell/main-loops.js +130 -0
  229. package/dist/shell/main-loops.js.map +1 -0
  230. package/dist/shell/main-mcp.js +129 -0
  231. package/dist/shell/main-mcp.js.map +1 -0
  232. package/dist/shell/main-orchestrator.js +120 -0
  233. package/dist/shell/main-orchestrator.js.map +1 -0
  234. package/dist/shell/main-preflight.js +43 -0
  235. package/dist/shell/main-preflight.js.map +1 -0
  236. package/dist/shell/main-reconcilers-helpers.js +244 -0
  237. package/dist/shell/main-reconcilers-helpers.js.map +1 -0
  238. package/dist/shell/main-reconcilers-pr.js +148 -0
  239. package/dist/shell/main-reconcilers-pr.js.map +1 -0
  240. package/dist/shell/main-reconcilers.js +225 -0
  241. package/dist/shell/main-reconcilers.js.map +1 -0
  242. package/dist/shell/main-runner.js +355 -0
  243. package/dist/shell/main-runner.js.map +1 -0
  244. package/dist/shell/main-scaffold.js +116 -0
  245. package/dist/shell/main-scaffold.js.map +1 -0
  246. package/dist/shell/main-shutdown.js +115 -0
  247. package/dist/shell/main-shutdown.js.map +1 -0
  248. package/dist/shell/main-startup.js +48 -0
  249. package/dist/shell/main-startup.js.map +1 -0
  250. package/dist/shell/main-substrates.js +43 -0
  251. package/dist/shell/main-substrates.js.map +1 -0
  252. package/dist/shell/main.js +385 -0
  253. package/dist/shell/main.js.map +1 -0
  254. package/dist/shell/orchestrator-feedback.js +69 -0
  255. package/dist/shell/orchestrator-feedback.js.map +1 -0
  256. package/dist/shell/orchestrator-image.js +167 -0
  257. package/dist/shell/orchestrator-image.js.map +1 -0
  258. package/dist/shell/orchestrator-loop.js +468 -0
  259. package/dist/shell/orchestrator-loop.js.map +1 -0
  260. package/dist/shell/orchestrator-reconcile.js +36 -0
  261. package/dist/shell/orchestrator-reconcile.js.map +1 -0
  262. package/dist/shell/reconciler-loop.js +228 -0
  263. package/dist/shell/reconciler-loop.js.map +1 -0
  264. package/dist/shell/runner-loop-turn.js +301 -0
  265. package/dist/shell/runner-loop-turn.js.map +1 -0
  266. package/dist/shell/runner-loop.js +338 -0
  267. package/dist/shell/runner-loop.js.map +1 -0
  268. package/dist/shell/server/http.js +208 -0
  269. package/dist/shell/server/http.js.map +1 -0
  270. package/dist/shell/server/mcp-runtime-effects.js +237 -0
  271. package/dist/shell/server/mcp-runtime-effects.js.map +1 -0
  272. package/dist/shell/server/mcp-runtime.js +99 -0
  273. package/dist/shell/server/mcp-runtime.js.map +1 -0
  274. package/dist/shell/workspace-key.js +14 -0
  275. package/dist/shell/workspace-key.js.map +1 -0
  276. package/dist/types/acp.js +8 -0
  277. package/dist/types/acp.js.map +1 -0
  278. package/dist/types/actions/plan.js +6 -0
  279. package/dist/types/actions/plan.js.map +1 -0
  280. package/dist/types/actions/predicates.js +6 -0
  281. package/dist/types/actions/predicates.js.map +1 -0
  282. package/dist/types/actions/run-fold.js +8 -0
  283. package/dist/types/actions/run-fold.js.map +1 -0
  284. package/dist/types/actions.js +7 -0
  285. package/dist/types/actions.js.map +1 -0
  286. package/dist/types/adapter/clock-random.js +4 -0
  287. package/dist/types/adapter/clock-random.js.map +1 -0
  288. package/dist/types/adapter/gondolin-image-converter.js +5 -0
  289. package/dist/types/adapter/gondolin-image-converter.js.map +1 -0
  290. package/dist/types/adapter/gondolin-image-fetch.js +5 -0
  291. package/dist/types/adapter/gondolin-image-fetch.js.map +1 -0
  292. package/dist/types/adapter/workflow-loader.js +4 -0
  293. package/dist/types/adapter/workflow-loader.js.map +1 -0
  294. package/dist/types/cli/args.js +8 -0
  295. package/dist/types/cli/args.js.map +1 -0
  296. package/dist/types/config.js +8 -0
  297. package/dist/types/config.js.map +1 -0
  298. package/dist/types/credential-interp.js +6 -0
  299. package/dist/types/credential-interp.js.map +1 -0
  300. package/dist/types/credentials.js +10 -0
  301. package/dist/types/credentials.js.map +1 -0
  302. package/dist/types/doctor.js +7 -0
  303. package/dist/types/doctor.js.map +1 -0
  304. package/dist/types/domain.js +7 -0
  305. package/dist/types/domain.js.map +1 -0
  306. package/dist/types/effect.js +15 -0
  307. package/dist/types/effect.js.map +1 -0
  308. package/dist/types/errors.js +39 -0
  309. package/dist/types/errors.js.map +1 -0
  310. package/dist/types/http/decisions.js +6 -0
  311. package/dist/types/http/decisions.js.map +1 -0
  312. package/dist/types/http/render.js +10 -0
  313. package/dist/types/http/render.js.map +1 -0
  314. package/dist/types/http/views.js +6 -0
  315. package/dist/types/http/views.js.map +1 -0
  316. package/dist/types/http.js +9 -0
  317. package/dist/types/http.js.map +1 -0
  318. package/dist/types/image/managed-image.js +7 -0
  319. package/dist/types/image/managed-image.js.map +1 -0
  320. package/dist/types/interp/effect-interpreter.js +8 -0
  321. package/dist/types/interp/effect-interpreter.js.map +1 -0
  322. package/dist/types/interp/tracker.js +7 -0
  323. package/dist/types/interp/tracker.js.map +1 -0
  324. package/dist/types/issue/file.js +6 -0
  325. package/dist/types/issue/file.js.map +1 -0
  326. package/dist/types/issue/parse.js +8 -0
  327. package/dist/types/issue/parse.js.map +1 -0
  328. package/dist/types/main-acp.js +13 -0
  329. package/dist/types/main-acp.js.map +1 -0
  330. package/dist/types/main-adapters.js +5 -0
  331. package/dist/types/main-adapters.js.map +1 -0
  332. package/dist/types/main-credential.js +21 -0
  333. package/dist/types/main-credential.js.map +1 -0
  334. package/dist/types/main-doctor.js +6 -0
  335. package/dist/types/main-doctor.js.map +1 -0
  336. package/dist/types/main-http-handler.js +12 -0
  337. package/dist/types/main-http-handler.js.map +1 -0
  338. package/dist/types/main-http.js +5 -0
  339. package/dist/types/main-http.js.map +1 -0
  340. package/dist/types/main-loops.js +5 -0
  341. package/dist/types/main-loops.js.map +1 -0
  342. package/dist/types/main-mcp.js +12 -0
  343. package/dist/types/main-mcp.js.map +1 -0
  344. package/dist/types/main-orchestrator.js +5 -0
  345. package/dist/types/main-orchestrator.js.map +1 -0
  346. package/dist/types/main-reconcilers.js +11 -0
  347. package/dist/types/main-reconcilers.js.map +1 -0
  348. package/dist/types/main-runner.js +13 -0
  349. package/dist/types/main-runner.js.map +1 -0
  350. package/dist/types/main-startup.js +5 -0
  351. package/dist/types/main-startup.js.map +1 -0
  352. package/dist/types/main-substrates.js +5 -0
  353. package/dist/types/main-substrates.js.map +1 -0
  354. package/dist/types/mcp/dispatch.js +4 -0
  355. package/dist/types/mcp/dispatch.js.map +1 -0
  356. package/dist/types/mcp/post-move.js +7 -0
  357. package/dist/types/mcp/post-move.js.map +1 -0
  358. package/dist/types/mcp.js +9 -0
  359. package/dist/types/mcp.js.map +1 -0
  360. package/dist/types/ports.js +12 -0
  361. package/dist/types/ports.js.map +1 -0
  362. package/dist/types/reconcile/image-decide.js +5 -0
  363. package/dist/types/reconcile/image-decide.js.map +1 -0
  364. package/dist/types/reconcile/ledger.js +7 -0
  365. package/dist/types/reconcile/ledger.js.map +1 -0
  366. package/dist/types/reconcile/pr-loop.js +8 -0
  367. package/dist/types/reconcile/pr-loop.js.map +1 -0
  368. package/dist/types/reconcile/vm-reap.js +8 -0
  369. package/dist/types/reconcile/vm-reap.js.map +1 -0
  370. package/dist/types/reconcile/workspace-decide.js +7 -0
  371. package/dist/types/reconcile/workspace-decide.js.map +1 -0
  372. package/dist/types/reconcile.js +9 -0
  373. package/dist/types/reconcile.js.map +1 -0
  374. package/dist/types/runlog.js +7 -0
  375. package/dist/types/runlog.js.map +1 -0
  376. package/dist/types/runner/actions-runner.js +12 -0
  377. package/dist/types/runner/actions-runner.js.map +1 -0
  378. package/dist/types/runner/gondolin-dispatch.js +5 -0
  379. package/dist/types/runner/gondolin-dispatch.js.map +1 -0
  380. package/dist/types/runner/injection.js +6 -0
  381. package/dist/types/runner/injection.js.map +1 -0
  382. package/dist/types/runner/runner-loop.js +5 -0
  383. package/dist/types/runner/runner-loop.js.map +1 -0
  384. package/dist/types/runner/turn.js +4 -0
  385. package/dist/types/runner/turn.js.map +1 -0
  386. package/dist/types/runner/vm-plan.js +4 -0
  387. package/dist/types/runner/vm-plan.js.map +1 -0
  388. package/dist/types/runtime.js +9 -0
  389. package/dist/types/runtime.js.map +1 -0
  390. package/dist/types/schedule/admission.js +7 -0
  391. package/dist/types/schedule/admission.js.map +1 -0
  392. package/dist/types/schedule/circuit-breaker.js +2 -0
  393. package/dist/types/schedule/circuit-breaker.js.map +1 -0
  394. package/dist/types/schedule/eligibility.js +9 -0
  395. package/dist/types/schedule/eligibility.js.map +1 -0
  396. package/dist/types/schedule/orchestrator-loop.js +10 -0
  397. package/dist/types/schedule/orchestrator-loop.js.map +1 -0
  398. package/dist/types/schedule/sleep-cycle.js +4 -0
  399. package/dist/types/schedule/sleep-cycle.js.map +1 -0
  400. package/dist/types/schedule/slots.js +8 -0
  401. package/dist/types/schedule/slots.js.map +1 -0
  402. package/dist/types/schedule/tick.js +9 -0
  403. package/dist/types/schedule/tick.js.map +1 -0
  404. package/dist/types/server/mcp-runtime.js +8 -0
  405. package/dist/types/server/mcp-runtime.js.map +1 -0
  406. package/dist/types/workflow/parse.js +4 -0
  407. package/dist/types/workflow/parse.js.map +1 -0
  408. package/package.json +22 -10
  409. package/patches/@earendil-works+gondolin+0.12.0.patch +173 -0
  410. package/prompts/Reflect.md +91 -0
  411. package/prompts/Review.md +97 -0
  412. package/prompts/Todo.md +96 -0
  413. package/prompts/_footer.md +41 -0
  414. package/prompts/_preamble.md +42 -0
  415. package/prompts-minimal/Todo.md +26 -0
  416. package/scripts/postinstall.mjs +63 -0
  417. package/scripts/vm-agent.mjs +312 -90
  418. package/WORKFLOW.md +0 -744
  419. package/dist/acp-bridge.js +0 -324
  420. package/dist/acp-bridge.js.map +0 -1
  421. package/dist/actions/cache.js +0 -191
  422. package/dist/actions/cache.js.map +0 -1
  423. package/dist/actions/effects.js +0 -41
  424. package/dist/actions/effects.js.map +0 -1
  425. package/dist/actions/executor.js +0 -570
  426. package/dist/actions/executor.js.map +0 -1
  427. package/dist/actions/index.js +0 -13
  428. package/dist/actions/index.js.map +0 -1
  429. package/dist/actions/parsing.js.map +0 -1
  430. package/dist/actions/predicate-env.js +0 -27
  431. package/dist/actions/predicate-env.js.map +0 -1
  432. package/dist/actions/predicates.js +0 -49
  433. package/dist/actions/predicates.js.map +0 -1
  434. package/dist/actions/templating.js +0 -66
  435. package/dist/actions/templating.js.map +0 -1
  436. package/dist/actions/types.js +0 -15
  437. package/dist/actions/types.js.map +0 -1
  438. package/dist/agent/acp.js +0 -473
  439. package/dist/agent/acp.js.map +0 -1
  440. package/dist/agent/adapter-names.js +0 -159
  441. package/dist/agent/adapter-names.js.map +0 -1
  442. package/dist/agent/adapters.js +0 -511
  443. package/dist/agent/adapters.js.map +0 -1
  444. package/dist/agent/credential-extractors.js +0 -342
  445. package/dist/agent/credential-extractors.js.map +0 -1
  446. package/dist/agent/credential-secrets.js +0 -628
  447. package/dist/agent/credential-secrets.js.map +0 -1
  448. package/dist/agent/credential-ticker.js +0 -57
  449. package/dist/agent/credential-ticker.js.map +0 -1
  450. package/dist/agent/gondolin-creds-staging.js +0 -356
  451. package/dist/agent/gondolin-creds-staging.js.map +0 -1
  452. package/dist/agent/gondolin-dispatch.js +0 -375
  453. package/dist/agent/gondolin-dispatch.js.map +0 -1
  454. package/dist/agent/gondolin.js +0 -124
  455. package/dist/agent/gondolin.js.map +0 -1
  456. package/dist/agent/runner-decisions.js +0 -134
  457. package/dist/agent/runner-decisions.js.map +0 -1
  458. package/dist/agent/runner.js +0 -1456
  459. package/dist/agent/runner.js.map +0 -1
  460. package/dist/agent/tool-call-summary.js +0 -102
  461. package/dist/agent/tool-call-summary.js.map +0 -1
  462. package/dist/agent/vm-acp-mapping.js +0 -73
  463. package/dist/agent/vm-acp-mapping.js.map +0 -1
  464. package/dist/agent/vm-guards.js +0 -262
  465. package/dist/agent/vm-guards.js.map +0 -1
  466. package/dist/agent/vm-port.js +0 -22
  467. package/dist/agent/vm-port.js.map +0 -1
  468. package/dist/agent/vm-process-registry.js +0 -79
  469. package/dist/agent/vm-process-registry.js.map +0 -1
  470. package/dist/bin/cli-args.js +0 -105
  471. package/dist/bin/cli-args.js.map +0 -1
  472. package/dist/errors.js +0 -15
  473. package/dist/errors.js.map +0 -1
  474. package/dist/http-disk.js +0 -135
  475. package/dist/http-disk.js.map +0 -1
  476. package/dist/http-handlers.js.map +0 -1
  477. package/dist/http.js.map +0 -1
  478. package/dist/issues.js +0 -178
  479. package/dist/issues.js.map +0 -1
  480. package/dist/logging.js +0 -203
  481. package/dist/logging.js.map +0 -1
  482. package/dist/mcp.js +0 -706
  483. package/dist/mcp.js.map +0 -1
  484. package/dist/memory.js +0 -85
  485. package/dist/memory.js.map +0 -1
  486. package/dist/orchestrator-decisions.js +0 -331
  487. package/dist/orchestrator-decisions.js.map +0 -1
  488. package/dist/orchestrator.js +0 -1569
  489. package/dist/orchestrator.js.map +0 -1
  490. package/dist/prompt.js +0 -65
  491. package/dist/prompt.js.map +0 -1
  492. package/dist/reconciler/cache.js +0 -65
  493. package/dist/reconciler/cache.js.map +0 -1
  494. package/dist/reconciler/index.js +0 -448
  495. package/dist/reconciler/index.js.map +0 -1
  496. package/dist/reconciler/ledger.js +0 -131
  497. package/dist/reconciler/ledger.js.map +0 -1
  498. package/dist/reconciler/pr-adapters.js +0 -174
  499. package/dist/reconciler/pr-adapters.js.map +0 -1
  500. package/dist/reconciler/pr-decide.js.map +0 -1
  501. package/dist/reconciler/pr.js +0 -422
  502. package/dist/reconciler/pr.js.map +0 -1
  503. package/dist/reconciler/types.js +0 -12
  504. package/dist/reconciler/types.js.map +0 -1
  505. package/dist/reconciler/vm.js +0 -243
  506. package/dist/reconciler/vm.js.map +0 -1
  507. package/dist/reconciler/workspace-defaults.js +0 -83
  508. package/dist/reconciler/workspace-defaults.js.map +0 -1
  509. package/dist/reconciler/workspace.js +0 -272
  510. package/dist/reconciler/workspace.js.map +0 -1
  511. package/dist/runlog.js +0 -403
  512. package/dist/runlog.js.map +0 -1
  513. package/dist/scaffold.js +0 -165
  514. package/dist/scaffold.js.map +0 -1
  515. package/dist/trackers/local.js +0 -445
  516. package/dist/trackers/local.js.map +0 -1
  517. package/dist/trackers/types.js +0 -10
  518. package/dist/trackers/types.js.map +0 -1
  519. package/dist/types.js +0 -3
  520. package/dist/types.js.map +0 -1
  521. package/dist/util/clock.js +0 -12
  522. package/dist/util/clock.js.map +0 -1
  523. package/dist/util/crypto.js +0 -25
  524. package/dist/util/crypto.js.map +0 -1
  525. package/dist/util/frontmatter.js +0 -70
  526. package/dist/util/frontmatter.js.map +0 -1
  527. package/dist/util/fs-issues.js +0 -22
  528. package/dist/util/fs-issues.js.map +0 -1
  529. package/dist/util/process.js +0 -152
  530. package/dist/util/process.js.map +0 -1
  531. package/dist/util/workspace-key.js +0 -10
  532. package/dist/util/workspace-key.js.map +0 -1
  533. package/dist/workflow-loader.js +0 -147
  534. package/dist/workflow-loader.js.map +0 -1
  535. package/dist/workflow.js +0 -822
  536. package/dist/workflow.js.map +0 -1
  537. package/dist/workspace-types.js +0 -8
  538. package/dist/workspace-types.js.map +0 -1
  539. package/dist/workspace.js +0 -443
  540. package/dist/workspace.js.map +0 -1
@@ -0,0 +1,253 @@
1
+ // FCIS rewrite — HTTP-handler view projections (kind: shell).
2
+ //
3
+ // Sliced out of src/shell/main-http-handler.ts so the router stays under the
4
+ // max-lines budget. These are the thin SHELL projections between the live
5
+ // orchestrator runtime (RunningEntry / RetryEntry) and the pure core http view
6
+ // inputs (PartialInputs / SnapshotInput / IssueDetail*View / HealthView). They
7
+ // shape data only — no routing, no IO — but they live in the shell because they
8
+ // read the live-handle-carrying RunningEntry (which core never holds) and project
9
+ // it into the read-only views core folds over.
10
+ //
11
+ // Imports from src/types/** ONLY (no core — the pure builders arrive injected via
12
+ // HttpHandlerDeps.core).
13
+ import { accessSync, constants as fsConstants } from 'node:fs';
14
+ /**
15
+ * W_OK probe of the tracker root for the dashboard `#health` strip (REF
16
+ * orchestrator.probeTrackerWritable). Tri-state: null when no root is configured,
17
+ * true when writable, false when it exists but is read-only / missing. Best-effort —
18
+ * a probe failure is reported as `false`, never throws into a request. The composition
19
+ * root binds this as `trackerWritable` so the view stays free of fs concerns.
20
+ */
21
+ export function probeTrackerWritable(root) {
22
+ if (!root)
23
+ return null;
24
+ try {
25
+ accessSync(root, fsConstants.W_OK);
26
+ return true;
27
+ }
28
+ catch {
29
+ return false;
30
+ }
31
+ }
32
+ /** Project the declared `states:` block into the compact StateView[] core reads.
33
+ * `allowed_transitions` is carried through so the dashboard move picker can flag
34
+ * off-flow targets (issue 126); absent in the config ⇒ null (open default). */
35
+ export function statesOf(cfg) {
36
+ return Object.entries(cfg.states).map(([name, c]) => ({
37
+ name,
38
+ role: c.role,
39
+ allowed_transitions: c.allowed_transitions ?? null,
40
+ }));
41
+ }
42
+ /** Resolve the local tracker root (the boot gate guarantees it; '' is a safe
43
+ * empty-board fallback the disk reads tolerate). */
44
+ export function trackerRootOf(cfg) {
45
+ return cfg.tracker.root ?? '';
46
+ }
47
+ /** Decode an x-www-form-urlencoded operator-move body (`state`, optional
48
+ * `from_state`) into the object the pure decideMoveTransition reads. */
49
+ export function moveFormBody(raw) {
50
+ const params = new URLSearchParams(raw);
51
+ const out = {};
52
+ for (const key of ['state', 'from_state']) {
53
+ const v = params.get(key);
54
+ if (v !== null)
55
+ out[key] = v;
56
+ }
57
+ return out;
58
+ }
59
+ // Pure basename (the page chrome only needs the workflow filename). The single
60
+ // shell copy of core/path.ts:basename — the shell may not import core, and the
61
+ // line-budgeted composition root does not inject this one-call-site helper, so
62
+ // it is kept here verbatim (canonical home: src/core/path.ts:basename).
63
+ function basenameOf(p) {
64
+ const trimmed = p.replace(/[/\\]+$/, '');
65
+ const idx = Math.max(trimmed.lastIndexOf('/'), trimmed.lastIndexOf('\\'));
66
+ return idx >= 0 ? trimmed.slice(idx + 1) : trimmed;
67
+ }
68
+ /** Project a live RunningEntry into the read-only RunningEntryView core folds over. */
69
+ export function toRunningView(e) {
70
+ return {
71
+ issue_id: e.issue_id,
72
+ identifier: e.identifier,
73
+ issue: e.issue,
74
+ session_id: e.session_id,
75
+ workspace_path: e.workspace_path,
76
+ started_at: e.started_at,
77
+ turn_count: e.turn_count,
78
+ retry_attempt: e.retry_attempt,
79
+ input_tokens: e.input_tokens,
80
+ output_tokens: e.output_tokens,
81
+ total_tokens: e.total_tokens,
82
+ last_event: e.last_event,
83
+ last_event_at: e.last_event_at,
84
+ last_message: e.last_message,
85
+ recent_events: e.recent_events,
86
+ last_error: e.last_error,
87
+ transitioned: e.transitioned,
88
+ steering_requested: e.steering_requested,
89
+ steering_question: e.steering_question,
90
+ steering_context: e.steering_context,
91
+ active_tool_call_count: e.active_tool_calls.size,
92
+ resolved_actor: e.resolved_actor,
93
+ base_branch_at_dispatch: e.base_branch_at_dispatch,
94
+ github_repo_at_dispatch: e.github_repo_at_dispatch,
95
+ tracker_root_at_dispatch: e.tracker_root_at_dispatch,
96
+ cleanup_workspace_on_exit: e.cleanup_workspace_on_exit,
97
+ };
98
+ }
99
+ /** Project a live RunningEntry into the flat RunningRow the HTML render layer reads. */
100
+ function toRunningRow(e) {
101
+ return {
102
+ issue_identifier: e.identifier,
103
+ issue_title: e.issue.title,
104
+ issue_body: e.issue.description ?? '',
105
+ turn_count: e.turn_count,
106
+ last_event: e.last_event,
107
+ last_message: e.last_message,
108
+ tokens: { input_tokens: e.input_tokens, output_tokens: e.output_tokens, total_tokens: e.total_tokens },
109
+ steering_requested: e.steering_requested,
110
+ steering_question: e.steering_question,
111
+ steering_context: e.steering_context,
112
+ };
113
+ }
114
+ /** Project a live RetryEntry into the flat RetryRow the HTML render layer reads. */
115
+ function toRetryRow(e) {
116
+ return {
117
+ issue_identifier: e.identifier,
118
+ attempt: e.attempt,
119
+ due_at: new Date(e.due_at_ms).toISOString(),
120
+ error: e.error,
121
+ kind: e.kind,
122
+ };
123
+ }
124
+ /** Sum the live per-attempt token counters into the aggregate the totals footer reads. */
125
+ export function aggregateTotals(running) {
126
+ let input = 0;
127
+ let output = 0;
128
+ let total = 0;
129
+ for (const e of running) {
130
+ input += e.input_tokens;
131
+ output += e.output_tokens;
132
+ total += e.total_tokens;
133
+ }
134
+ return { input_tokens: input, output_tokens: output, total_tokens: total, seconds_running: 0 };
135
+ }
136
+ /**
137
+ * Gather the per-request projection (live maps + disk listing) every view reads.
138
+ * The dashboard/REST router and the steering-reply handler both project off this,
139
+ * so it lives here (the leaf view module) rather than in either handler.
140
+ */
141
+ export async function project(deps) {
142
+ const cfg = deps.getLiveCfg();
143
+ const diskIssues = await deps.tracker.listIssues(trackerRootOf(cfg));
144
+ return {
145
+ cfg,
146
+ states: statesOf(cfg),
147
+ running: deps.state.runningEntries(),
148
+ retrying: deps.state.retryEntries(),
149
+ diskIssues,
150
+ };
151
+ }
152
+ /** Build the per-request PartialInputs the dashboard + every partial render folds over. */
153
+ export function partialInputs(deps, proj) {
154
+ const totals = deps.core.buildSessionTotalsView(aggregateTotals(proj.running), proj.running.map((r) => r.started_at), deps.clock);
155
+ return {
156
+ workflowName: basenameOf(deps.workflowPath),
157
+ workflowPath: deps.workflowPath,
158
+ trackerRoot: trackerRootOf(proj.cfg),
159
+ states: proj.states,
160
+ snapshot: {
161
+ running: proj.running.map(toRunningRow),
162
+ retrying: proj.retrying.map(toRetryRow),
163
+ session_totals: {
164
+ input_tokens: totals.input_tokens,
165
+ output_tokens: totals.output_tokens,
166
+ total_tokens: totals.total_tokens,
167
+ seconds_running: totals.seconds_running,
168
+ },
169
+ },
170
+ diskIssues: proj.diskIssues,
171
+ };
172
+ }
173
+ /** Build the system-health view for the `#health` strip from the live config + probe. */
174
+ export async function healthView(deps, proj) {
175
+ const cfg = proj.cfg;
176
+ const dispatch = proj.states
177
+ .filter((s) => s.role === 'active')
178
+ .map((s) => {
179
+ const sc = cfg.states[s.name];
180
+ return {
181
+ state: s.name,
182
+ adapter: sc?.adapter ?? cfg.acp.adapter,
183
+ model: sc?.model !== undefined ? sc.model : cfg.acp.model,
184
+ };
185
+ });
186
+ const credentials = deps.credentialHealth ? await deps.credentialHealth() : [];
187
+ return {
188
+ dispatch,
189
+ gondolin_image: cfg.gondolin.image,
190
+ credentials,
191
+ tracker_root: cfg.tracker.root,
192
+ // W_OK probe of the live tracker root (true/false/null) — the dashboard health strip
193
+ // renders `tracker=writable|readonly|unset` off this. Absent probe ⇒ null (unset).
194
+ tracker_root_writable: deps.trackerWritable ? deps.trackerWritable() : null,
195
+ last_poll_at: deps.state.lastPollAtIso(),
196
+ // One-time microVM image build (issue 206) — the health strip renders a banner
197
+ // while the reconcile loop is converting `gondolin.oci_image`, and a persistent
198
+ // failure banner if the conversion threw (dispatch stays held until it's fixed).
199
+ building_image: deps.state.imageBuildState ? deps.state.imageBuildState() : null,
200
+ failed_image: deps.state.imageFailureState ? deps.state.imageFailureState() : null,
201
+ };
202
+ }
203
+ /** Build the §9.3 snapshot DTO core stamps for GET /api/v1/state. */
204
+ export function buildStateDto(deps, proj) {
205
+ const runningViews = proj.running.map(toRunningView);
206
+ const health = deps.core.buildHealthRollup({
207
+ runningCount: proj.running.length,
208
+ claimedCount: deps.state.claimedIds().size,
209
+ retryingCount: proj.retrying.length,
210
+ effectiveCap: proj.cfg.agent.max_concurrent_agents,
211
+ pendingContinuationCount: proj.retrying.filter((r) => r.kind === 'continuation').length,
212
+ memoryAdmissionEnabled: proj.cfg.agent.memory_admission_enabled,
213
+ });
214
+ return deps.core.buildSnapshot({
215
+ running: runningViews,
216
+ retrying: [...proj.retrying],
217
+ totals: aggregateTotals(proj.running),
218
+ health,
219
+ reconcilerResources: [],
220
+ }, deps.clock);
221
+ }
222
+ /** Project a live RunningEntry into the issue-detail (JSON) entry view. */
223
+ export function detailEntryView(e) {
224
+ return {
225
+ issue_id: e.issue_id,
226
+ identifier: e.identifier,
227
+ workspace_path: e.workspace_path,
228
+ session_id: e.session_id,
229
+ turn_count: e.turn_count,
230
+ state: e.issue.state,
231
+ started_at: e.started_at,
232
+ last_event: e.last_event,
233
+ last_message: e.last_message,
234
+ last_event_at: e.last_event_at,
235
+ input_tokens: e.input_tokens,
236
+ output_tokens: e.output_tokens,
237
+ total_tokens: e.total_tokens,
238
+ recent_events: e.recent_events,
239
+ last_error: e.last_error,
240
+ };
241
+ }
242
+ /** Project a live RetryEntry into the issue-detail (JSON) retry view. */
243
+ export function detailRetryView(r) {
244
+ return {
245
+ issue_id: r.issue_id,
246
+ identifier: r.identifier,
247
+ attempt: r.attempt,
248
+ due_at_ms: r.due_at_ms,
249
+ error: r.error,
250
+ kind: r.kind,
251
+ };
252
+ }
253
+ //# sourceMappingURL=main-http-views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-http-views.js","sourceRoot":"","sources":["../../src/shell/main-http-views.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,kFAAkF;AAClF,+CAA+C;AAC/C,EAAE;AACF,kFAAkF;AAClF,yBAAyB;AAEzB,OAAO,EAAE,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAgB/D;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAmB;IACtD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;gFAEgF;AAChF,MAAM,UAAU,QAAQ,CAAC,GAAkB;IACzC,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACpD,IAAI;QACJ,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,mBAAmB,EAAE,CAAC,CAAC,mBAAmB,IAAI,IAAI;KACnD,CAAC,CAAC,CAAC;AACN,CAAC;AAED;qDACqD;AACrD,MAAM,UAAU,aAAa,CAAC,GAAkB;IAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;yEACyE;AACzE,MAAM,UAA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AAa;QAC9B,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,UAAU,EAAE,CAAC,CAAC,UAAU;KACzB,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,CAAa;IAC3C,OAAO;QACL,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,IAAI,EAAE,CAAC,CAAC,IAAI;KACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,76 @@
1
+ // FCIS rewrite — HTTP-bind + MCP-precondition + bail-startup cluster (shell).
2
+ //
3
+ // Sliced out of src/shell/main.ts (per arch-sweep §4c) so the composition root
4
+ // keeps under the max-lines budget. This is the boot-time transport bring-up: bind
5
+ // the unified HTTP listener (dashboard + MCP + the /acp WebSocket the guest dials
6
+ // back on), verify the MCP precondition, and centralize startup-failure cleanup.
7
+ //
8
+ // It imports NO core (only the root may) — the two pure decisions it needs
9
+ // (`resolveHttpPort`, the MCP `buildUrl`) arrive injected as `HttpBindCore`.
10
+ //
11
+ // Shell rule: imports from src/types/** ONLY (+ the sibling http server adapter).
12
+ import process from 'node:process';
13
+ import { createHttpServer } from './server/http.js';
14
+ /**
15
+ * Bind the unified HTTP server. HTTP port precedence: --port > server.port > 0
16
+ * (ephemeral) via core resolveHttpPort. A bind failure routes through bailStartup.
17
+ * Ported from REF bindHttpServer. The dashboard/REST request handler is composed
18
+ * in the root (buildHttpHandler over core http/routes+decisions+views+render) and
19
+ * passed in here; this cluster only owns the transport bring-up + the /acp upgrade.
20
+ */
21
+ export async function bindHttp(graph, cli, core, handle) {
22
+ const cfg = graph.getLiveCfg();
23
+ const requested = core.resolveHttpPort(cli.port, cfg.server.port);
24
+ try {
25
+ const http = createHttpServer({
26
+ handle,
27
+ log: graph.log,
28
+ acpUpgrade: (req, socket, head) => graph.acpWs.handleUpgrade(req, socket, head),
29
+ // Tear the /acp registry down when the listener stops, so upgraded WebSocket
30
+ // sockets don't leak (and hang the drain) across shutdown.
31
+ acpStop: () => graph.acpWs.stop(),
32
+ });
33
+ const { port } = await http.bind(requested, cfg.server.host);
34
+ graph.boundPort = port;
35
+ return http;
36
+ }
37
+ catch (err) {
38
+ return bailStartup(`error: failed to bind HTTP server on ${cfg.server.host}:${requested}: ${err.message}\n`, graph, core);
39
+ }
40
+ }
41
+ /**
42
+ * MCP precondition (REF checkMcpPrecondition): with mcp.enabled (the default),
43
+ * every dispatch needs a reachable MCP URL. Verify at boot that one can be built
44
+ * (core buildUrl over the bound port) rather than failing each per-issue dispatch
45
+ * after VM bring-up costs are sunk. Routes failures through bailStartup.
46
+ */
47
+ export async function checkMcpPrecondition(graph, core) {
48
+ const cfg = graph.getLiveCfg();
49
+ if (!cfg.mcp.enabled)
50
+ return;
51
+ if (graph.http === null || graph.boundPort === null) {
52
+ await bailStartup(`error: mcp.enabled=true but no HTTP server is configured. Symphony itself\n` +
53
+ `must bind a listener (set --port or server.port) so it can serve the MCP\n` +
54
+ `endpoint, even when mcp.host_url points the in-VM agent at a reverse proxy.\n`, graph, core);
55
+ return;
56
+ }
57
+ const probeUrl = core.buildMcpUrl('startup-check', { host: cfg.mcp.host, explicit_host_url: cfg.mcp.explicit_host_url }, graph.boundPort);
58
+ if (probeUrl === null) {
59
+ await bailStartup(`error: mcp.enabled=true but no MCP URL can be constructed. Set --port, ` +
60
+ `server.port, or mcp.host_url so the in-VM agent can reach the symphony MCP endpoint.\n`, graph, core);
61
+ }
62
+ }
63
+ /**
64
+ * Centralized startup-failure cleanup (REF bailStartup): write the message, close
65
+ * any partial HTTP listener + the workflow watcher, flush the log sink, exit
66
+ * non-zero. Returns `never` so call sites narrow away post-call code.
67
+ */
68
+ export async function bailStartup(message, graph, core) {
69
+ process.stderr.write(message);
70
+ if (graph.http)
71
+ await graph.http.stop().catch(() => undefined);
72
+ graph.src.stop();
73
+ await core.closeLog().catch(() => undefined);
74
+ process.exit(1);
75
+ }
76
+ //# sourceMappingURL=main-http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-http.js","sourceRoot":"","sources":["../../src/shell/main-http.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,+EAA+E;AAC/E,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,EAAE;AACF,kFAAkF;AAElF,OAAO,OAAO,MAAM,cAAc,CAAC;AAInC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKpD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,KAAoB,EACpB,GAAQ,EACR,IAAkB,EAClB,MAAkB;IAElB,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,gBAAgB,CAAC;YAC5B,MAAM;YACN,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC;YAC/E,6EAA6E;YAC7E,2DAA2D;YAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;SAClC,CAAC,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IA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OAAO,CAAC,CAAC;IAC9B,IAAI,KAAK,CAAC,IAAI;QAAE,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/D,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,130 @@
1
+ // FCIS rewrite — orchestrator + RUNNER-slice construction for the composition root
2
+ // (kind: shell helper). Sliced out of src/shell/main.ts so the root stays under the
3
+ // max-lines budget. Builds the live per-dispatch runner slice (workspace→VM→ACP→
4
+ // turn-loop→actions pipeline) AND the OrchestratorLoop the runner's `runWorker`
5
+ // drives, wiring the ACP frame-tap fold (per-issue runtime events + token usage)
6
+ // onto the live running entry. Imports NO core (only the root may) — the pure
7
+ // reducer/runner core bundles arrive pre-built in `OrchestratorCore`/`RunnerCoreParts`.
8
+ import { OrchestratorLoop } from './orchestrator-loop.js';
9
+ import { buildOrchestratorDeps, buildTickConfig } from './main-orchestrator.js';
10
+ import { buildPlaceholderEntry } from './main-adapters.js';
11
+ import { buildRunnerSlice } from './main-runner.js';
12
+ import { createAdapterRegistry } from './adapter/adapter-registry.js';
13
+ import { loadLauncherAsset } from './adapter/launcher-asset.js';
14
+ import { loadMiseConfigAsset } from './adapter/mise-config-asset.js';
15
+ import { ensureConvertedImage, probeConvertedImage } from './adapter/gondolin-image-converter.js';
16
+ import { ensureFetchedImage, probeFetchedImage } from './adapter/gondolin-image-fetch.js';
17
+ /**
18
+ * Build the runner slice + the OrchestratorLoop. The runner's `onWorkerExit`
19
+ * forward-references the orchestrator (constructed just after the runner); the
20
+ * closure only fires once an attempt finishes, so the reference is always live.
21
+ */
22
+ export function buildOrchestratorWithRunner(deps) {
23
+ const { adapters: a, core } = deps;
24
+ const orchestratorCore = core.orchestrator;
25
+ // Nest the loose pure-core fns into the RunnerCoreParts bundle the runner closes
26
+ // over (kept here, not in the root, to keep main.ts under its line budget).
27
+ const runnerCore = {
28
+ loop: core.loop,
29
+ actions: core.actions,
30
+ resolveActorString: core.resolveActorString,
31
+ assertNoCredentialMounts: core.assertNoCredentialMounts,
32
+ resolveDispatchConfig: core.resolveDispatchConfig,
33
+ guestMcpUrl: core.guestMcpUrl,
34
+ byoProbeFailureMessage: core.byoProbeFailureMessage,
35
+ // mise toolchain-provisioning deciders (issue 209).
36
+ byoProbeScript: core.byoProbeScript,
37
+ miseInstallFailureMessage: core.miseInstallFailureMessage,
38
+ hasProjectMiseConfig: core.hasProjectMiseConfig,
39
+ };
40
+ let orchestrator;
41
+ // The managed prebuilt-image wiring (issue 224), built once in the root and injected.
42
+ // Its ref keys the fetch routing below + feeds the readiness path; null on an arch
43
+ // with no published asset (the managed source is then inert).
44
+ const managedWiring = deps.managedImageWiring;
45
+ const runner = buildRunnerSlice({
46
+ core: runnerCore,
47
+ ports: {
48
+ interpreter: a.interpreter, workspaces: a.workspace, tracker: a.tracker, baseVm: a.vm, acp: a.acpPort,
49
+ adapters: createAdapterRegistry(), credentialPort: a.credentialPort,
50
+ runlog: a.runlog, log: deps.log, clock: a.clock, random: a.random,
51
+ },
52
+ substrates: deps.substrates,
53
+ getLiveCfg: deps.getLiveCfg,
54
+ getWorkflow: deps.getWorkflow,
55
+ boundMcpPort: deps.boundMcpPort,
56
+ resolvedNodeBin: () => 'node',
57
+ launcherSource: deps.launcherSource,
58
+ miseSystemConfigSource: deps.miseSystemConfigSource,
59
+ readEnv: deps.readEnv,
60
+ // The asset auto-converted from `gondolin.oci_image` (issue 206), resolved at
61
+ // dispatch time. The orchestrator is forward-referenced (assigned just below);
62
+ // this closure only fires once an attempt dispatches, by which point the gate
63
+ // has already held until the build resolved — so the selector is live. Threaded
64
+ // into buildVmPlan, which boots it only when the `gondolin.image` escape hatch
65
+ // is unset, closing the convert→dispatch handoff for the one-key golden path.
66
+ resolveImageSelector: () => orchestrator.effectiveImageSelector(),
67
+ // The worker-exit fold owns the running-entry removal: onWorkerExit drops the
68
+ // entry (freeing its slot) before folding the exit through the reducer, so the
69
+ // composition root just hands the exit event over — no separate removeRunning poke.
70
+ onWorkerExit: (event) => orchestrator.onWorkerExit(event),
71
+ });
72
+ orchestrator = new OrchestratorLoop(buildOrchestratorDeps({
73
+ core: orchestratorCore,
74
+ ports: { interpreter: a.interpreter, timer: a.timer, mem: a.mem, clock: a.clock, tracker: a.tracker },
75
+ // Feed the managed store ref (issue 224) into the tick view; buildTickConfig
76
+ // gates it on `gondolin.managed_image` so it only rides the readiness path when
77
+ // the managed source is the active one. Null on an unsupported arch.
78
+ readConfig: () => buildTickConfig(deps.getLiveCfg(), orchestratorCore, managedWiring?.ref ?? null),
79
+ buildEntry: buildPlaceholderEntry,
80
+ runWorker: runner.runWorker,
81
+ stallTimeoutMs: () => deps.getLiveCfg().acp.stall_timeout_ms,
82
+ // Auto-convert + cache `gondolin.oci_image` on demand (issue 206). The loop
83
+ // fires this as a tracked async on the reducer's `ensure_image` effect and
84
+ // holds VM dispatch until it resolves; a second call for an already-converted
85
+ // digest is a cheap cache hit.
86
+ ensureImage: async (ref) => {
87
+ // Route the managed store ref (issue 224) to the prebuilt-asset FETCHER; every
88
+ // other ref is an `oci_image` for the CONVERTER. Both resolve to a runtime
89
+ // selector the loop threads into the VmPlan when `gondolin.image` is unset.
90
+ if (managedWiring && ref === managedWiring.ref) {
91
+ const fetched = await ensureFetchedImage(managedWiring, { log: deps.log });
92
+ return fetched.selector;
93
+ }
94
+ const cfg = deps.getLiveCfg();
95
+ const converted = await ensureConvertedImage(ref, {
96
+ pullPolicy: cfg.gondolin.oci_pull_policy,
97
+ runtime: cfg.gondolin.oci_runtime,
98
+ log: deps.log,
99
+ });
100
+ // The runtime selector the cached asset boots with — the loop records it so
101
+ // dispatch threads it into the VmPlan when `gondolin.image` is unset.
102
+ return converted.selector;
103
+ },
104
+ // Read-only per-tick readiness probe (issue 206 rework): resolve the ref's
105
+ // CURRENT local digest + its cached selector WITHOUT pulling/building, so the
106
+ // loop's readiness tracks the live digest. A moving tag whose underlying image
107
+ // changed reports not-ready (dropping the stale selector) until reconverted.
108
+ probeImage: (ref) => {
109
+ // Same routing as ensureImage: the managed ref probes the FETCHER's store
110
+ // (read-only, no download), every other ref the CONVERTER's local digest.
111
+ if (managedWiring && ref === managedWiring.ref) {
112
+ const p = probeFetchedImage(managedWiring);
113
+ return { digest: p.digest, selector: p.selector };
114
+ }
115
+ const p = probeConvertedImage(ref, { runtime: deps.getLiveCfg().gondolin.oci_runtime });
116
+ return { digest: p.digest, selector: p.selector };
117
+ },
118
+ }));
119
+ // ACP frame tap → orchestrator folds the per-issue event + token usage onto the
120
+ // live running entry (the dashboard totals + stall-reaper reference read these).
121
+ // These two are SANCTIONED direct folds, not pokes: they fire on the hot path (per
122
+ // tool-call / per turn), each is a pure `core/schedule/token-fold` onto one live
123
+ // entry with no scheduling decision, so they are exempt from the state-poke wall
124
+ // rather than routed through dispatch() — see scripts/check-state-pokes.mjs (issue 203).
125
+ a.acpPort.onEvent((issueId, ev) => orchestrator.reportRuntimeEvent(issueId, ev));
126
+ a.acpPort.onTokenUsage((issueId, usage) => orchestrator.reportTokenUsage(issueId, usage));
127
+ return orchestrator;
128
+ }
129
+ export { loadLauncherAsset, loadMiseConfigAsset };
130
+ //# sourceMappingURL=main-loops.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-loops.js","sourceRoot":"","sources":["../../src/shell/main-loops.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,oFAAoF;AACpF,iFAAiF;AACjF,gFAAgF;AAChF,iFAAiF;AACjF,8EAA8E;AAC9E,wFAAwF;AAGxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,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U,EAAE,CAAC,GAAG,EAAE,EAAE;YAClB,0EAA0E;YAC1E,0EAA0E;YAC1E,IAAI,aAAa,IAAI,GAAG,KAAK,aAAa,CAAC,GAAG,EAAE,CAAC;gBAC/C,MAAM,CAAC,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;gBAC3C,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;YACpD,CAAC;YACD,MAAM,CAAC,GAAG,mBAAmB,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;YACxF,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;QACpD,CAAC;KACF,CAAC,CACH,CAAC;IACF,gFAAgF;IAChF,iFAAiF;IACjF,mFAAmF;IACnF,iFAAiF;IACjF,iFAAiF;IACjF,yFAAyF;IACzF,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1F,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,129 @@
1
+ // FCIS rewrite — MCP control-plane construction for the composition root (shell).
2
+ //
3
+ // Sliced out of src/shell/main.ts (mirroring main-adapters / main-reconcilers /
4
+ // main-http-handler) so the root keeps under the max-lines budget. This builds the
5
+ // per-issue MCP runtime (createMcpRuntime) — the in-VM agent's
6
+ // transition / request_human_steering / propose_issue `tools/call` control plane —
7
+ // plus the single `applyMcpEffect` the central effect interpreter routes the
8
+ // `mcp_tool` family through.
9
+ //
10
+ // It imports NO core (only the root may) — the pure deciders arrive as the
11
+ // injected `McpCore` bundle (validateEnvelope / routeFraming / decideToolCall /
12
+ // foldPostMove + the JSON-RPC error constructors/codes). The IO half is the
13
+ // tracker move/write surface + the deterministic seams (random/crypto/clock).
14
+ //
15
+ // The two effects the runtime actually executes (move_state, write_issue) are
16
+ // driven by ONE `applyMcpEffect`, shared between the runtime's McpEffectExec and
17
+ // the interpreter's `mcp_tool` family so a core-emitted MCP effect and a runtime
18
+ // tools/call land the same tracker IO. write_issue is dispatched WITHOUT an
19
+ // identifier so the tracker's collision-pick assigns the next free numeric id
20
+ // (the §2i overwrite-bug fix) rather than overwriting `<holding>/1.md`.
21
+ //
22
+ // Shell rule: imports from src/types/** ONLY (+ the sibling runtime factory).
23
+ import { createMcpRuntime } from './server/mcp-runtime.js';
24
+ /** Fold the loose pure-CORE deciders the root bound into the McpCore bundle the
25
+ * runtime closes over (keeps the root from hand-building the literal inline). */
26
+ function assembleMcpCore(parts) {
27
+ return {
28
+ validateEnvelope: parts.validateEnvelope,
29
+ extractId: parts.extractId,
30
+ routeFraming: parts.routeFraming,
31
+ makeError: parts.makeError,
32
+ decideToolCall: parts.decideToolCall,
33
+ foldPostMove: parts.foldPostMove,
34
+ IssueNotActive: parts.errorCodes.IssueNotActive,
35
+ InvalidToken: parts.errorCodes.InvalidToken,
36
+ InvalidRequest: parts.errorCodes.InvalidRequest,
37
+ InternalError: parts.errorCodes.InternalError,
38
+ };
39
+ }
40
+ /**
41
+ * Build the single applier the EffectInterpreter's `mcp_tool` family routes one
42
+ * McpEffect through, and the MCP runtime's McpEffectExec.moveState delegates to.
43
+ * It interprets the `move_state` effect against the tracker disk:
44
+ * move_state → tracker.moveIssueToState → { kind:'moved' } | { kind:'move_failed' }
45
+ * `write_issue` (the propose path) carries title/labels/priority but NOT the
46
+ * landing root/state — those are resolved by the runtime's `writeIssue` exec
47
+ * (the pinned tracker root + the live holding state), so a bare write_issue
48
+ * reaching this seam without that context cannot be served; it surfaces an honest
49
+ * move_failed. The remaining McpEffect kinds (stash/await/set/defer) are folded
50
+ * inside the interpreter and have no tracker IO.
51
+ */
52
+ export function buildApplyMcpEffect(tracker) {
53
+ return async (effect) => {
54
+ if (effect.kind === 'move_state') {
55
+ try {
56
+ const moved = await tracker.moveIssueToState(effect.issueId, effect.toState, {
57
+ ...(effect.fromRoot !== null ? { fromRoot: effect.fromRoot } : {}),
58
+ ...(effect.fromState !== null ? { fromState: effect.fromState } : {}),
59
+ notes: effect.notes,
60
+ ...(effect.actor !== null ? { actor: effect.actor } : {}),
61
+ });
62
+ return { kind: 'moved', fromState: moved.fromState, toState: moved.toState, newPath: moved.newPath };
63
+ }
64
+ catch (err) {
65
+ return { kind: 'move_failed', message: err.message };
66
+ }
67
+ }
68
+ // write_issue needs the runtime-resolved landing state + pinned root (it goes
69
+ // through buildMcpRuntime's writeIssue exec); a context-less effect on this
70
+ // seam, plus stash/await/set_transitioned/defer_cleanup, have no tracker IO.
71
+ return { kind: 'move_failed', message: `mcp effect ${effect.kind} has no tracker IO on this seam` };
72
+ };
73
+ }
74
+ /**
75
+ * Build the per-issue MCP runtime + the shared `applyMcpEffect`. The runtime's
76
+ * McpEffectExec drives the SAME tracker IO as the interpreter family, but
77
+ * write_issue carries the resolved landing state + pinned tracker root the bare
78
+ * McpEffect lacks (so the runtime supplies them explicitly here).
79
+ */
80
+ export function buildMcpRuntime(deps) {
81
+ const { core: coreParts, tracker, random, crypto, clock, log, getLiveCfg, derivePrMerge } = deps;
82
+ const core = assembleMcpCore(coreParts);
83
+ const applyMcpEffect = buildApplyMcpEffect(tracker);
84
+ const runtime = createMcpRuntime({
85
+ core,
86
+ random,
87
+ crypto,
88
+ clock,
89
+ log,
90
+ liveStates: () => getLiveCfg().states,
91
+ livePrMerge: () => derivePrMerge(getLiveCfg()),
92
+ exec: {
93
+ // move_state goes through the shared applier verbatim.
94
+ moveState: (effect) => applyMcpEffect(effect),
95
+ // write_issue: the runtime resolved the landing holding state + pinned root,
96
+ // so dispatch an identifier-less tracker write directly (collision-pick id).
97
+ // Stamp the parent provenance (proposed_by from core's `proposedBy`, proposed_at
98
+ // from the injected clock) as front matter so a proposed issue carries its
99
+ // origin the same way the dashboard renders it (finding #5).
100
+ writeIssue: async (effect, proposedAtIso, landingState, trackerRoot) => {
101
+ const written = await tracker.writeIssue({
102
+ family: 'tracker',
103
+ kind: 'write_issue',
104
+ trackerRoot,
105
+ state: landingState,
106
+ title: effect.title,
107
+ ...(effect.description !== null ? { description: effect.description } : {}),
108
+ priority: effect.priority,
109
+ labels: effect.labels,
110
+ extraFrontMatter: { proposed_by: effect.proposedBy, proposed_at: proposedAtIso },
111
+ });
112
+ // The tracker's write_issue always resolves to the write_issue EffectResult
113
+ // variant (it throws on failure); narrow the broad union for the fold.
114
+ if (!('kind' in written) || written.kind !== 'write_issue') {
115
+ return { kind: 'move_failed', message: 'tracker write_issue returned an unexpected result' };
116
+ }
117
+ return { kind: 'written', path: written.path, identifier: written.identifier };
118
+ },
119
+ },
120
+ });
121
+ // The HTTP control-plane surface (`McpHttpSurface`) the dashboard/REST handler
122
+ // dispatches the two agent-facing POST routes to is assembled by the composition
123
+ // root: `runtime.handleJsonRpc` for the bearer-authed tools/call JSON-RPC, plus an
124
+ // interpreter-backed `performSteering` for the steering-reply (the steering Effect
125
+ // can only be performed once the central interpreter — built after this — exists,
126
+ // and `runtime.steering` is injected into that interpreter's `steering` family).
127
+ return { runtime, applyMcpEffect };
128
+ }
129
+ //# sourceMappingURL=main-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-mcp.js","sourceRoot":"","sources":["../../src/shell/main-mcp.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,+DAA+D;AAC/D,mFAAmF;AACnF,6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