looply-cli 0.0.0-stage → 0.2.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 (785) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +137 -3
  3. package/dist/.src-hash +1 -0
  4. package/dist/acceptance-observe.d.ts +108 -0
  5. package/dist/acceptance-observe.d.ts.map +1 -0
  6. package/dist/acceptance-observe.js +152 -0
  7. package/dist/acceptance-observe.js.map +1 -0
  8. package/dist/agent-cmd.d.ts +131 -0
  9. package/dist/agent-cmd.d.ts.map +1 -0
  10. package/dist/agent-cmd.js +154 -0
  11. package/dist/agent-cmd.js.map +1 -0
  12. package/dist/agent-contained.d.ts +114 -0
  13. package/dist/agent-contained.d.ts.map +1 -0
  14. package/dist/agent-contained.js +292 -0
  15. package/dist/agent-contained.js.map +1 -0
  16. package/dist/agent-driver.d.ts +130 -0
  17. package/dist/agent-driver.d.ts.map +1 -0
  18. package/dist/agent-driver.js +170 -0
  19. package/dist/agent-driver.js.map +1 -0
  20. package/dist/agent-envelope.d.ts +94 -0
  21. package/dist/agent-envelope.d.ts.map +1 -0
  22. package/dist/agent-envelope.js +214 -0
  23. package/dist/agent-envelope.js.map +1 -0
  24. package/dist/agent-exec.d.ts +182 -0
  25. package/dist/agent-exec.d.ts.map +1 -0
  26. package/dist/agent-exec.js +125 -0
  27. package/dist/agent-exec.js.map +1 -0
  28. package/dist/agent-runtime.d.ts +23 -0
  29. package/dist/agent-runtime.d.ts.map +1 -0
  30. package/dist/agent-runtime.js +143 -0
  31. package/dist/agent-runtime.js.map +1 -0
  32. package/dist/approval-gate-read.d.ts +66 -0
  33. package/dist/approval-gate-read.d.ts.map +1 -0
  34. package/dist/approval-gate-read.js +138 -0
  35. package/dist/approval-gate-read.js.map +1 -0
  36. package/dist/approval-resolution.d.ts +87 -0
  37. package/dist/approval-resolution.d.ts.map +1 -0
  38. package/dist/approval-resolution.js +100 -0
  39. package/dist/approval-resolution.js.map +1 -0
  40. package/dist/approval-resumes.d.ts +102 -0
  41. package/dist/approval-resumes.d.ts.map +1 -0
  42. package/dist/approval-resumes.js +167 -0
  43. package/dist/approval-resumes.js.map +1 -0
  44. package/dist/ask-brain.d.ts +167 -0
  45. package/dist/ask-brain.d.ts.map +1 -0
  46. package/dist/ask-brain.js +355 -0
  47. package/dist/ask-brain.js.map +1 -0
  48. package/dist/autonomy-authority.d.ts +80 -0
  49. package/dist/autonomy-authority.d.ts.map +1 -0
  50. package/dist/autonomy-authority.js +82 -0
  51. package/dist/autonomy-authority.js.map +1 -0
  52. package/dist/autonomy-controller.d.ts +321 -0
  53. package/dist/autonomy-controller.d.ts.map +1 -0
  54. package/dist/autonomy-controller.js +517 -0
  55. package/dist/autonomy-controller.js.map +1 -0
  56. package/dist/autonomy-store.d.ts +327 -0
  57. package/dist/autonomy-store.d.ts.map +1 -0
  58. package/dist/autonomy-store.js +581 -0
  59. package/dist/autonomy-store.js.map +1 -0
  60. package/dist/autonomy-tick.d.ts +257 -0
  61. package/dist/autonomy-tick.d.ts.map +1 -0
  62. package/dist/autonomy-tick.js +616 -0
  63. package/dist/autonomy-tick.js.map +1 -0
  64. package/dist/bin.d.ts +3 -0
  65. package/dist/bin.d.ts.map +1 -0
  66. package/dist/bin.js +2719 -0
  67. package/dist/bin.js.map +1 -0
  68. package/dist/brain-advice.d.ts +21 -0
  69. package/dist/brain-advice.d.ts.map +1 -0
  70. package/dist/brain-advice.js +51 -0
  71. package/dist/brain-advice.js.map +1 -0
  72. package/dist/candidate-replay-runtime.d.ts +125 -0
  73. package/dist/candidate-replay-runtime.d.ts.map +1 -0
  74. package/dist/candidate-replay-runtime.js +188 -0
  75. package/dist/candidate-replay-runtime.js.map +1 -0
  76. package/dist/checkout-carry.d.ts +76 -0
  77. package/dist/checkout-carry.d.ts.map +1 -0
  78. package/dist/checkout-carry.js +125 -0
  79. package/dist/checkout-carry.js.map +1 -0
  80. package/dist/citation-readers.d.ts +26 -0
  81. package/dist/citation-readers.d.ts.map +1 -0
  82. package/dist/citation-readers.js +102 -0
  83. package/dist/citation-readers.js.map +1 -0
  84. package/dist/command-receipts.d.ts +79 -0
  85. package/dist/command-receipts.d.ts.map +1 -0
  86. package/dist/command-receipts.js +143 -0
  87. package/dist/command-receipts.js.map +1 -0
  88. package/dist/command-runner.d.ts +32 -0
  89. package/dist/command-runner.d.ts.map +1 -0
  90. package/dist/command-runner.js +108 -0
  91. package/dist/command-runner.js.map +1 -0
  92. package/dist/compatible-sets.d.ts +67 -0
  93. package/dist/compatible-sets.d.ts.map +1 -0
  94. package/dist/compatible-sets.js +81 -0
  95. package/dist/compatible-sets.js.map +1 -0
  96. package/dist/compile-check.d.ts +31 -0
  97. package/dist/compile-check.d.ts.map +1 -0
  98. package/dist/compile-check.js +34 -0
  99. package/dist/compile-check.js.map +1 -0
  100. package/dist/compile-store.d.ts +16 -0
  101. package/dist/compile-store.d.ts.map +1 -0
  102. package/dist/compile-store.js +21 -0
  103. package/dist/compile-store.js.map +1 -0
  104. package/dist/completion.d.ts +106 -0
  105. package/dist/completion.d.ts.map +1 -0
  106. package/dist/completion.js +131 -0
  107. package/dist/completion.js.map +1 -0
  108. package/dist/config.d.ts +549 -0
  109. package/dist/config.d.ts.map +1 -0
  110. package/dist/config.js +763 -0
  111. package/dist/config.js.map +1 -0
  112. package/dist/control-file.d.ts +142 -0
  113. package/dist/control-file.d.ts.map +1 -0
  114. package/dist/control-file.js +144 -0
  115. package/dist/control-file.js.map +1 -0
  116. package/dist/coordinator-state.d.ts +131 -0
  117. package/dist/coordinator-state.d.ts.map +1 -0
  118. package/dist/coordinator-state.js +380 -0
  119. package/dist/coordinator-state.js.map +1 -0
  120. package/dist/coordinator.d.ts +95 -0
  121. package/dist/coordinator.d.ts.map +1 -0
  122. package/dist/coordinator.js +97 -0
  123. package/dist/coordinator.js.map +1 -0
  124. package/dist/cursor-store.d.ts +53 -0
  125. package/dist/cursor-store.d.ts.map +1 -0
  126. package/dist/cursor-store.js +98 -0
  127. package/dist/cursor-store.js.map +1 -0
  128. package/dist/daemon-cmd.d.ts +239 -0
  129. package/dist/daemon-cmd.d.ts.map +1 -0
  130. package/dist/daemon-cmd.js +1751 -0
  131. package/dist/daemon-cmd.js.map +1 -0
  132. package/dist/daemon-lock.d.ts +140 -0
  133. package/dist/daemon-lock.d.ts.map +1 -0
  134. package/dist/daemon-lock.js +352 -0
  135. package/dist/daemon-lock.js.map +1 -0
  136. package/dist/daemon-recovery.d.ts +78 -0
  137. package/dist/daemon-recovery.d.ts.map +1 -0
  138. package/dist/daemon-recovery.js +161 -0
  139. package/dist/daemon-recovery.js.map +1 -0
  140. package/dist/daemon.d.ts +368 -0
  141. package/dist/daemon.d.ts.map +1 -0
  142. package/dist/daemon.js +601 -0
  143. package/dist/daemon.js.map +1 -0
  144. package/dist/declared-response-shape.d.ts +93 -0
  145. package/dist/declared-response-shape.d.ts.map +1 -0
  146. package/dist/declared-response-shape.js +200 -0
  147. package/dist/declared-response-shape.js.map +1 -0
  148. package/dist/declared-surfaces.d.ts +16 -0
  149. package/dist/declared-surfaces.d.ts.map +1 -0
  150. package/dist/declared-surfaces.js +19 -0
  151. package/dist/declared-surfaces.js.map +1 -0
  152. package/dist/depends-review.d.ts +113 -0
  153. package/dist/depends-review.d.ts.map +1 -0
  154. package/dist/depends-review.js +110 -0
  155. package/dist/depends-review.js.map +1 -0
  156. package/dist/doctor.d.ts +91 -0
  157. package/dist/doctor.d.ts.map +1 -0
  158. package/dist/doctor.js +71 -0
  159. package/dist/doctor.js.map +1 -0
  160. package/dist/edge-approval.d.ts +105 -0
  161. package/dist/edge-approval.d.ts.map +1 -0
  162. package/dist/edge-approval.js +100 -0
  163. package/dist/edge-approval.js.map +1 -0
  164. package/dist/evidence-cache.d.ts +45 -0
  165. package/dist/evidence-cache.d.ts.map +1 -0
  166. package/dist/evidence-cache.js +90 -0
  167. package/dist/evidence-cache.js.map +1 -0
  168. package/dist/evidence-cmd.d.ts +133 -0
  169. package/dist/evidence-cmd.d.ts.map +1 -0
  170. package/dist/evidence-cmd.js +347 -0
  171. package/dist/evidence-cmd.js.map +1 -0
  172. package/dist/evidence-facts.d.ts +40 -0
  173. package/dist/evidence-facts.d.ts.map +1 -0
  174. package/dist/evidence-facts.js +114 -0
  175. package/dist/evidence-facts.js.map +1 -0
  176. package/dist/exclusive-lock.d.ts +52 -0
  177. package/dist/exclusive-lock.d.ts.map +1 -0
  178. package/dist/exclusive-lock.js +150 -0
  179. package/dist/exclusive-lock.js.map +1 -0
  180. package/dist/exec-domains.d.ts +140 -0
  181. package/dist/exec-domains.d.ts.map +1 -0
  182. package/dist/exec-domains.js +287 -0
  183. package/dist/exec-domains.js.map +1 -0
  184. package/dist/exemption-store.d.ts +197 -0
  185. package/dist/exemption-store.d.ts.map +1 -0
  186. package/dist/exemption-store.js +266 -0
  187. package/dist/exemption-store.js.map +1 -0
  188. package/dist/explicit-start-gate.d.ts +96 -0
  189. package/dist/explicit-start-gate.d.ts.map +1 -0
  190. package/dist/explicit-start-gate.js +103 -0
  191. package/dist/explicit-start-gate.js.map +1 -0
  192. package/dist/fs-trouble.d.ts +70 -0
  193. package/dist/fs-trouble.d.ts.map +1 -0
  194. package/dist/fs-trouble.js +98 -0
  195. package/dist/fs-trouble.js.map +1 -0
  196. package/dist/gate.d.ts +278 -0
  197. package/dist/gate.d.ts.map +1 -0
  198. package/dist/gate.js +278 -0
  199. package/dist/gate.js.map +1 -0
  200. package/dist/git-driver.d.ts +519 -0
  201. package/dist/git-driver.d.ts.map +1 -0
  202. package/dist/git-driver.js +900 -0
  203. package/dist/git-driver.js.map +1 -0
  204. package/dist/git-push-executor.d.ts +41 -0
  205. package/dist/git-push-executor.d.ts.map +1 -0
  206. package/dist/git-push-executor.js +142 -0
  207. package/dist/git-push-executor.js.map +1 -0
  208. package/dist/glob.d.ts +26 -0
  209. package/dist/glob.d.ts.map +1 -0
  210. package/dist/glob.js +93 -0
  211. package/dist/glob.js.map +1 -0
  212. package/dist/goal-adaptive.d.ts +295 -0
  213. package/dist/goal-adaptive.d.ts.map +1 -0
  214. package/dist/goal-adaptive.js +393 -0
  215. package/dist/goal-adaptive.js.map +1 -0
  216. package/dist/goal-compile.d.ts +342 -0
  217. package/dist/goal-compile.d.ts.map +1 -0
  218. package/dist/goal-compile.js +444 -0
  219. package/dist/goal-compile.js.map +1 -0
  220. package/dist/goal-depends-executor.d.ts +55 -0
  221. package/dist/goal-depends-executor.d.ts.map +1 -0
  222. package/dist/goal-depends-executor.js +202 -0
  223. package/dist/goal-depends-executor.js.map +1 -0
  224. package/dist/goal-execution-evidence.d.ts +135 -0
  225. package/dist/goal-execution-evidence.d.ts.map +1 -0
  226. package/dist/goal-execution-evidence.js +159 -0
  227. package/dist/goal-execution-evidence.js.map +1 -0
  228. package/dist/goal-gap.d.ts +140 -0
  229. package/dist/goal-gap.d.ts.map +1 -0
  230. package/dist/goal-gap.js +197 -0
  231. package/dist/goal-gap.js.map +1 -0
  232. package/dist/goal-met-target.d.ts +98 -0
  233. package/dist/goal-met-target.d.ts.map +1 -0
  234. package/dist/goal-met-target.js +92 -0
  235. package/dist/goal-met-target.js.map +1 -0
  236. package/dist/goal-ownership.d.ts +416 -0
  237. package/dist/goal-ownership.d.ts.map +1 -0
  238. package/dist/goal-ownership.js +576 -0
  239. package/dist/goal-ownership.js.map +1 -0
  240. package/dist/goal-runs.d.ts +82 -0
  241. package/dist/goal-runs.d.ts.map +1 -0
  242. package/dist/goal-runs.js +120 -0
  243. package/dist/goal-runs.js.map +1 -0
  244. package/dist/goal-store.d.ts +146 -0
  245. package/dist/goal-store.d.ts.map +1 -0
  246. package/dist/goal-store.js +294 -0
  247. package/dist/goal-store.js.map +1 -0
  248. package/dist/goal-view.d.ts +156 -0
  249. package/dist/goal-view.d.ts.map +1 -0
  250. package/dist/goal-view.js +499 -0
  251. package/dist/goal-view.js.map +1 -0
  252. package/dist/governed-approvals.d.ts +152 -0
  253. package/dist/governed-approvals.d.ts.map +1 -0
  254. package/dist/governed-approvals.js +246 -0
  255. package/dist/governed-approvals.js.map +1 -0
  256. package/dist/governed-broker.d.ts +169 -0
  257. package/dist/governed-broker.d.ts.map +1 -0
  258. package/dist/governed-broker.js +196 -0
  259. package/dist/governed-broker.js.map +1 -0
  260. package/dist/governed-run.d.ts +220 -0
  261. package/dist/governed-run.d.ts.map +1 -0
  262. package/dist/governed-run.js +406 -0
  263. package/dist/governed-run.js.map +1 -0
  264. package/dist/grant-reconcile.d.ts +63 -0
  265. package/dist/grant-reconcile.d.ts.map +1 -0
  266. package/dist/grant-reconcile.js +121 -0
  267. package/dist/grant-reconcile.js.map +1 -0
  268. package/dist/index-for-head.d.ts +56 -0
  269. package/dist/index-for-head.d.ts.map +1 -0
  270. package/dist/index-for-head.js +103 -0
  271. package/dist/index-for-head.js.map +1 -0
  272. package/dist/index.d.ts +39 -0
  273. package/dist/index.d.ts.map +1 -0
  274. package/dist/index.js +55 -0
  275. package/dist/index.js.map +1 -0
  276. package/dist/init-detect.d.ts +39 -0
  277. package/dist/init-detect.d.ts.map +1 -0
  278. package/dist/init-detect.js +188 -0
  279. package/dist/init-detect.js.map +1 -0
  280. package/dist/integration-deps.d.ts +62 -0
  281. package/dist/integration-deps.d.ts.map +1 -0
  282. package/dist/integration-deps.js +251 -0
  283. package/dist/integration-deps.js.map +1 -0
  284. package/dist/integration-runtime.d.ts +458 -0
  285. package/dist/integration-runtime.d.ts.map +1 -0
  286. package/dist/integration-runtime.js +681 -0
  287. package/dist/integration-runtime.js.map +1 -0
  288. package/dist/integration.d.ts +45 -0
  289. package/dist/integration.d.ts.map +1 -0
  290. package/dist/integration.js +87 -0
  291. package/dist/integration.js.map +1 -0
  292. package/dist/integrator.d.ts +84 -0
  293. package/dist/integrator.d.ts.map +1 -0
  294. package/dist/integrator.js +193 -0
  295. package/dist/integrator.js.map +1 -0
  296. package/dist/lane-claims.d.ts +174 -0
  297. package/dist/lane-claims.d.ts.map +1 -0
  298. package/dist/lane-claims.js +218 -0
  299. package/dist/lane-claims.js.map +1 -0
  300. package/dist/lane-coverage.d.ts +87 -0
  301. package/dist/lane-coverage.d.ts.map +1 -0
  302. package/dist/lane-coverage.js +129 -0
  303. package/dist/lane-coverage.js.map +1 -0
  304. package/dist/ledger-replay.d.ts +115 -0
  305. package/dist/ledger-replay.d.ts.map +1 -0
  306. package/dist/ledger-replay.js +155 -0
  307. package/dist/ledger-replay.js.map +1 -0
  308. package/dist/ledger-store.d.ts +68 -0
  309. package/dist/ledger-store.d.ts.map +1 -0
  310. package/dist/ledger-store.js +111 -0
  311. package/dist/ledger-store.js.map +1 -0
  312. package/dist/loop-safety-observer.d.ts +132 -0
  313. package/dist/loop-safety-observer.d.ts.map +1 -0
  314. package/dist/loop-safety-observer.js +76 -0
  315. package/dist/loop-safety-observer.js.map +1 -0
  316. package/dist/loop-safety-store.d.ts +339 -0
  317. package/dist/loop-safety-store.d.ts.map +1 -0
  318. package/dist/loop-safety-store.js +800 -0
  319. package/dist/loop-safety-store.js.map +1 -0
  320. package/dist/machine-store.d.ts +54 -0
  321. package/dist/machine-store.d.ts.map +1 -0
  322. package/dist/machine-store.js +149 -0
  323. package/dist/machine-store.js.map +1 -0
  324. package/dist/mcp-main.d.ts +2 -0
  325. package/dist/mcp-main.d.ts.map +1 -0
  326. package/dist/mcp-main.js +116 -0
  327. package/dist/mcp-main.js.map +1 -0
  328. package/dist/mcp-server.d.ts +72 -0
  329. package/dist/mcp-server.d.ts.map +1 -0
  330. package/dist/mcp-server.js +259 -0
  331. package/dist/mcp-server.js.map +1 -0
  332. package/dist/model-routing.d.ts +75 -0
  333. package/dist/model-routing.d.ts.map +1 -0
  334. package/dist/model-routing.js +108 -0
  335. package/dist/model-routing.js.map +1 -0
  336. package/dist/model-transport.d.ts +188 -0
  337. package/dist/model-transport.d.ts.map +1 -0
  338. package/dist/model-transport.js +625 -0
  339. package/dist/model-transport.js.map +1 -0
  340. package/dist/notify-cadence.d.ts +55 -0
  341. package/dist/notify-cadence.d.ts.map +1 -0
  342. package/dist/notify-cadence.js +68 -0
  343. package/dist/notify-cadence.js.map +1 -0
  344. package/dist/notify-channel.d.ts +69 -0
  345. package/dist/notify-channel.d.ts.map +1 -0
  346. package/dist/notify-channel.js +151 -0
  347. package/dist/notify-channel.js.map +1 -0
  348. package/dist/notify.d.ts +71 -0
  349. package/dist/notify.d.ts.map +1 -0
  350. package/dist/notify.js +125 -0
  351. package/dist/notify.js.map +1 -0
  352. package/dist/observation-inventory.d.ts +65 -0
  353. package/dist/observation-inventory.d.ts.map +1 -0
  354. package/dist/observation-inventory.js +139 -0
  355. package/dist/observation-inventory.js.map +1 -0
  356. package/dist/owned-children.d.ts +45 -0
  357. package/dist/owned-children.d.ts.map +1 -0
  358. package/dist/owned-children.js +64 -0
  359. package/dist/owned-children.js.map +1 -0
  360. package/dist/packet-for-goal.d.ts +19 -0
  361. package/dist/packet-for-goal.d.ts.map +1 -0
  362. package/dist/packet-for-goal.js +32 -0
  363. package/dist/packet-for-goal.js.map +1 -0
  364. package/dist/pair-cmd.d.ts +85 -0
  365. package/dist/pair-cmd.d.ts.map +1 -0
  366. package/dist/pair-cmd.js +205 -0
  367. package/dist/pair-cmd.js.map +1 -0
  368. package/dist/partial-asker.d.ts +96 -0
  369. package/dist/partial-asker.d.ts.map +1 -0
  370. package/dist/partial-asker.js +117 -0
  371. package/dist/partial-asker.js.map +1 -0
  372. package/dist/pdf-text-lines.d.ts +17 -0
  373. package/dist/pdf-text-lines.d.ts.map +1 -0
  374. package/dist/pdf-text-lines.js +70 -0
  375. package/dist/pdf-text-lines.js.map +1 -0
  376. package/dist/pdf-text-worker.d.ts +2 -0
  377. package/dist/pdf-text-worker.d.ts.map +1 -0
  378. package/dist/pdf-text-worker.js +81 -0
  379. package/dist/pdf-text-worker.js.map +1 -0
  380. package/dist/pdf-text.d.ts +56 -0
  381. package/dist/pdf-text.d.ts.map +1 -0
  382. package/dist/pdf-text.js +64 -0
  383. package/dist/pdf-text.js.map +1 -0
  384. package/dist/pending-action.d.ts +154 -0
  385. package/dist/pending-action.d.ts.map +1 -0
  386. package/dist/pending-action.js +148 -0
  387. package/dist/pending-action.js.map +1 -0
  388. package/dist/preemptor.d.ts +40 -0
  389. package/dist/preemptor.d.ts.map +1 -0
  390. package/dist/preemptor.js +49 -0
  391. package/dist/preemptor.js.map +1 -0
  392. package/dist/programme-mode.d.ts +29 -0
  393. package/dist/programme-mode.d.ts.map +1 -0
  394. package/dist/programme-mode.js +50 -0
  395. package/dist/programme-mode.js.map +1 -0
  396. package/dist/progress-view.d.ts +14 -0
  397. package/dist/progress-view.d.ts.map +1 -0
  398. package/dist/progress-view.js +114 -0
  399. package/dist/progress-view.js.map +1 -0
  400. package/dist/project-graph-builder.d.ts +81 -0
  401. package/dist/project-graph-builder.d.ts.map +1 -0
  402. package/dist/project-graph-builder.js +246 -0
  403. package/dist/project-graph-builder.js.map +1 -0
  404. package/dist/project-graph-runtime.d.ts +86 -0
  405. package/dist/project-graph-runtime.d.ts.map +1 -0
  406. package/dist/project-graph-runtime.js +112 -0
  407. package/dist/project-graph-runtime.js.map +1 -0
  408. package/dist/project-index-builder.d.ts +96 -0
  409. package/dist/project-index-builder.d.ts.map +1 -0
  410. package/dist/project-index-builder.js +298 -0
  411. package/dist/project-index-builder.js.map +1 -0
  412. package/dist/project-index-facts.d.ts +51 -0
  413. package/dist/project-index-facts.d.ts.map +1 -0
  414. package/dist/project-index-facts.js +117 -0
  415. package/dist/project-index-facts.js.map +1 -0
  416. package/dist/project-index-store.d.ts +97 -0
  417. package/dist/project-index-store.d.ts.map +1 -0
  418. package/dist/project-index-store.js +140 -0
  419. package/dist/project-index-store.js.map +1 -0
  420. package/dist/project-memory-store.d.ts +127 -0
  421. package/dist/project-memory-store.d.ts.map +1 -0
  422. package/dist/project-memory-store.js +302 -0
  423. package/dist/project-memory-store.js.map +1 -0
  424. package/dist/proposal-store.d.ts +14 -0
  425. package/dist/proposal-store.d.ts.map +1 -0
  426. package/dist/proposal-store.js +19 -0
  427. package/dist/proposal-store.js.map +1 -0
  428. package/dist/prover.d.ts +80 -0
  429. package/dist/prover.d.ts.map +1 -0
  430. package/dist/prover.js +137 -0
  431. package/dist/prover.js.map +1 -0
  432. package/dist/provider-identity-store.d.ts +34 -0
  433. package/dist/provider-identity-store.d.ts.map +1 -0
  434. package/dist/provider-identity-store.js +72 -0
  435. package/dist/provider-identity-store.js.map +1 -0
  436. package/dist/provider-identity.d.ts +104 -0
  437. package/dist/provider-identity.d.ts.map +1 -0
  438. package/dist/provider-identity.js +167 -0
  439. package/dist/provider-identity.js.map +1 -0
  440. package/dist/provider-limit.d.ts +79 -0
  441. package/dist/provider-limit.d.ts.map +1 -0
  442. package/dist/provider-limit.js +148 -0
  443. package/dist/provider-limit.js.map +1 -0
  444. package/dist/provider-preflight.d.ts +171 -0
  445. package/dist/provider-preflight.d.ts.map +1 -0
  446. package/dist/provider-preflight.js +395 -0
  447. package/dist/provider-preflight.js.map +1 -0
  448. package/dist/provider-state.d.ts +120 -0
  449. package/dist/provider-state.d.ts.map +1 -0
  450. package/dist/provider-state.js +182 -0
  451. package/dist/provider-state.js.map +1 -0
  452. package/dist/providers.d.ts +132 -0
  453. package/dist/providers.d.ts.map +1 -0
  454. package/dist/providers.js +161 -0
  455. package/dist/providers.js.map +1 -0
  456. package/dist/publication-recorder.d.ts +117 -0
  457. package/dist/publication-recorder.d.ts.map +1 -0
  458. package/dist/publication-recorder.js +124 -0
  459. package/dist/publication-recorder.js.map +1 -0
  460. package/dist/pursuit-delivery.d.ts +24 -0
  461. package/dist/pursuit-delivery.d.ts.map +1 -0
  462. package/dist/pursuit-delivery.js +38 -0
  463. package/dist/pursuit-delivery.js.map +1 -0
  464. package/dist/queue-store.d.ts +132 -0
  465. package/dist/queue-store.d.ts.map +1 -0
  466. package/dist/queue-store.js +185 -0
  467. package/dist/queue-store.js.map +1 -0
  468. package/dist/queue-summary.d.ts +14 -0
  469. package/dist/queue-summary.d.ts.map +1 -0
  470. package/dist/queue-summary.js +82 -0
  471. package/dist/queue-summary.js.map +1 -0
  472. package/dist/queue-view.d.ts +20 -0
  473. package/dist/queue-view.d.ts.map +1 -0
  474. package/dist/queue-view.js +163 -0
  475. package/dist/queue-view.js.map +1 -0
  476. package/dist/queue-write-lease.d.ts +106 -0
  477. package/dist/queue-write-lease.d.ts.map +1 -0
  478. package/dist/queue-write-lease.js +282 -0
  479. package/dist/queue-write-lease.js.map +1 -0
  480. package/dist/rails-home.d.ts +162 -0
  481. package/dist/rails-home.d.ts.map +1 -0
  482. package/dist/rails-home.js +452 -0
  483. package/dist/rails-home.js.map +1 -0
  484. package/dist/rails-migrations.d.ts +75 -0
  485. package/dist/rails-migrations.d.ts.map +1 -0
  486. package/dist/rails-migrations.js +199 -0
  487. package/dist/rails-migrations.js.map +1 -0
  488. package/dist/rails-stores.d.ts +49 -0
  489. package/dist/rails-stores.d.ts.map +1 -0
  490. package/dist/rails-stores.js +100 -0
  491. package/dist/rails-stores.js.map +1 -0
  492. package/dist/reaper.d.ts +69 -0
  493. package/dist/reaper.d.ts.map +1 -0
  494. package/dist/reaper.js +152 -0
  495. package/dist/reaper.js.map +1 -0
  496. package/dist/record-store.d.ts +36 -0
  497. package/dist/record-store.d.ts.map +1 -0
  498. package/dist/record-store.js +78 -0
  499. package/dist/record-store.js.map +1 -0
  500. package/dist/recovery-io.d.ts +50 -0
  501. package/dist/recovery-io.d.ts.map +1 -0
  502. package/dist/recovery-io.js +122 -0
  503. package/dist/recovery-io.js.map +1 -0
  504. package/dist/recovery.d.ts +146 -0
  505. package/dist/recovery.d.ts.map +1 -0
  506. package/dist/recovery.js +110 -0
  507. package/dist/recovery.js.map +1 -0
  508. package/dist/redraw.d.ts +34 -0
  509. package/dist/redraw.d.ts.map +1 -0
  510. package/dist/redraw.js +62 -0
  511. package/dist/redraw.js.map +1 -0
  512. package/dist/rejected-evidence.d.ts +255 -0
  513. package/dist/rejected-evidence.d.ts.map +1 -0
  514. package/dist/rejected-evidence.js +324 -0
  515. package/dist/rejected-evidence.js.map +1 -0
  516. package/dist/report-cmd.d.ts +32 -0
  517. package/dist/report-cmd.d.ts.map +1 -0
  518. package/dist/report-cmd.js +201 -0
  519. package/dist/report-cmd.js.map +1 -0
  520. package/dist/repos-cmd.d.ts +80 -0
  521. package/dist/repos-cmd.d.ts.map +1 -0
  522. package/dist/repos-cmd.js +240 -0
  523. package/dist/repos-cmd.js.map +1 -0
  524. package/dist/request-body-shape.d.ts +93 -0
  525. package/dist/request-body-shape.d.ts.map +1 -0
  526. package/dist/request-body-shape.js +407 -0
  527. package/dist/request-body-shape.js.map +1 -0
  528. package/dist/requirement-claims.d.ts +89 -0
  529. package/dist/requirement-claims.d.ts.map +1 -0
  530. package/dist/requirement-claims.js +92 -0
  531. package/dist/requirement-claims.js.map +1 -0
  532. package/dist/retention-apply-runtime.d.ts +105 -0
  533. package/dist/retention-apply-runtime.d.ts.map +1 -0
  534. package/dist/retention-apply-runtime.js +269 -0
  535. package/dist/retention-apply-runtime.js.map +1 -0
  536. package/dist/reverify.d.ts +41 -0
  537. package/dist/reverify.d.ts.map +1 -0
  538. package/dist/reverify.js +69 -0
  539. package/dist/reverify.js.map +1 -0
  540. package/dist/round-records.d.ts +65 -0
  541. package/dist/round-records.d.ts.map +1 -0
  542. package/dist/round-records.js +61 -0
  543. package/dist/round-records.js.map +1 -0
  544. package/dist/round-runner.d.ts +924 -0
  545. package/dist/round-runner.d.ts.map +1 -0
  546. package/dist/round-runner.js +1693 -0
  547. package/dist/round-runner.js.map +1 -0
  548. package/dist/run-approval.d.ts +180 -0
  549. package/dist/run-approval.d.ts.map +1 -0
  550. package/dist/run-approval.js +199 -0
  551. package/dist/run-approval.js.map +1 -0
  552. package/dist/run-cmd.d.ts +359 -0
  553. package/dist/run-cmd.d.ts.map +1 -0
  554. package/dist/run-cmd.js +4418 -0
  555. package/dist/run-cmd.js.map +1 -0
  556. package/dist/run-delivery.d.ts +71 -0
  557. package/dist/run-delivery.d.ts.map +1 -0
  558. package/dist/run-delivery.js +104 -0
  559. package/dist/run-delivery.js.map +1 -0
  560. package/dist/run-ended.d.ts +75 -0
  561. package/dist/run-ended.d.ts.map +1 -0
  562. package/dist/run-ended.js +27 -0
  563. package/dist/run-ended.js.map +1 -0
  564. package/dist/run-ending-locator.d.ts +125 -0
  565. package/dist/run-ending-locator.d.ts.map +1 -0
  566. package/dist/run-ending-locator.js +133 -0
  567. package/dist/run-ending-locator.js.map +1 -0
  568. package/dist/run-launcher.d.ts +459 -0
  569. package/dist/run-launcher.d.ts.map +1 -0
  570. package/dist/run-launcher.js +652 -0
  571. package/dist/run-launcher.js.map +1 -0
  572. package/dist/run-lease.d.ts +208 -0
  573. package/dist/run-lease.d.ts.map +1 -0
  574. package/dist/run-lease.js +301 -0
  575. package/dist/run-lease.js.map +1 -0
  576. package/dist/run-refusal-marks.d.ts +189 -0
  577. package/dist/run-refusal-marks.d.ts.map +1 -0
  578. package/dist/run-refusal-marks.js +249 -0
  579. package/dist/run-refusal-marks.js.map +1 -0
  580. package/dist/run-start-marks.d.ts +153 -0
  581. package/dist/run-start-marks.d.ts.map +1 -0
  582. package/dist/run-start-marks.js +269 -0
  583. package/dist/run-start-marks.js.map +1 -0
  584. package/dist/scan-cmd.d.ts +14 -0
  585. package/dist/scan-cmd.d.ts.map +1 -0
  586. package/dist/scan-cmd.js +270 -0
  587. package/dist/scan-cmd.js.map +1 -0
  588. package/dist/scan-events.d.ts +50 -0
  589. package/dist/scan-events.d.ts.map +1 -0
  590. package/dist/scan-events.js +91 -0
  591. package/dist/scan-events.js.map +1 -0
  592. package/dist/scan.d.ts +191 -0
  593. package/dist/scan.d.ts.map +1 -0
  594. package/dist/scan.js +417 -0
  595. package/dist/scan.js.map +1 -0
  596. package/dist/scope-rule.d.ts +148 -0
  597. package/dist/scope-rule.d.ts.map +1 -0
  598. package/dist/scope-rule.js +121 -0
  599. package/dist/scope-rule.js.map +1 -0
  600. package/dist/self-repo-id.d.ts +18 -0
  601. package/dist/self-repo-id.d.ts.map +1 -0
  602. package/dist/self-repo-id.js +70 -0
  603. package/dist/self-repo-id.js.map +1 -0
  604. package/dist/server-client.d.ts +766 -0
  605. package/dist/server-client.d.ts.map +1 -0
  606. package/dist/server-client.js +475 -0
  607. package/dist/server-client.js.map +1 -0
  608. package/dist/session-adapter-runtime.d.ts +195 -0
  609. package/dist/session-adapter-runtime.d.ts.map +1 -0
  610. package/dist/session-adapter-runtime.js +373 -0
  611. package/dist/session-adapter-runtime.js.map +1 -0
  612. package/dist/session-checkpoint-runtime.d.ts +62 -0
  613. package/dist/session-checkpoint-runtime.d.ts.map +1 -0
  614. package/dist/session-checkpoint-runtime.js +268 -0
  615. package/dist/session-checkpoint-runtime.js.map +1 -0
  616. package/dist/session-control-transport.d.ts +106 -0
  617. package/dist/session-control-transport.d.ts.map +1 -0
  618. package/dist/session-control-transport.js +232 -0
  619. package/dist/session-control-transport.js.map +1 -0
  620. package/dist/session-observation-store.d.ts +98 -0
  621. package/dist/session-observation-store.d.ts.map +1 -0
  622. package/dist/session-observation-store.js +155 -0
  623. package/dist/session-observation-store.js.map +1 -0
  624. package/dist/session-observe-runtime.d.ts +123 -0
  625. package/dist/session-observe-runtime.d.ts.map +1 -0
  626. package/dist/session-observe-runtime.js +317 -0
  627. package/dist/session-observe-runtime.js.map +1 -0
  628. package/dist/session-store.d.ts +98 -0
  629. package/dist/session-store.d.ts.map +1 -0
  630. package/dist/session-store.js +116 -0
  631. package/dist/session-store.js.map +1 -0
  632. package/dist/sessions-cmd.d.ts +202 -0
  633. package/dist/sessions-cmd.d.ts.map +1 -0
  634. package/dist/sessions-cmd.js +609 -0
  635. package/dist/sessions-cmd.js.map +1 -0
  636. package/dist/settings-overlay.d.ts +53 -0
  637. package/dist/settings-overlay.d.ts.map +1 -0
  638. package/dist/settings-overlay.js +175 -0
  639. package/dist/settings-overlay.js.map +1 -0
  640. package/dist/setup-prompt.d.ts +34 -0
  641. package/dist/setup-prompt.d.ts.map +1 -0
  642. package/dist/setup-prompt.js +92 -0
  643. package/dist/setup-prompt.js.map +1 -0
  644. package/dist/setup.d.ts +103 -0
  645. package/dist/setup.d.ts.map +1 -0
  646. package/dist/setup.js +283 -0
  647. package/dist/setup.js.map +1 -0
  648. package/dist/shared-grants.d.ts +164 -0
  649. package/dist/shared-grants.d.ts.map +1 -0
  650. package/dist/shared-grants.js +242 -0
  651. package/dist/shared-grants.js.map +1 -0
  652. package/dist/signals.d.ts +55 -0
  653. package/dist/signals.d.ts.map +1 -0
  654. package/dist/signals.js +85 -0
  655. package/dist/signals.js.map +1 -0
  656. package/dist/source-cmd.d.ts +201 -0
  657. package/dist/source-cmd.d.ts.map +1 -0
  658. package/dist/source-cmd.js +684 -0
  659. package/dist/source-cmd.js.map +1 -0
  660. package/dist/source-verdict.d.ts +99 -0
  661. package/dist/source-verdict.d.ts.map +1 -0
  662. package/dist/source-verdict.js +182 -0
  663. package/dist/source-verdict.js.map +1 -0
  664. package/dist/spend-ledger.d.ts +350 -0
  665. package/dist/spend-ledger.d.ts.map +1 -0
  666. package/dist/spend-ledger.js +546 -0
  667. package/dist/spend-ledger.js.map +1 -0
  668. package/dist/stale-run-sweep.d.ts +79 -0
  669. package/dist/stale-run-sweep.d.ts.map +1 -0
  670. package/dist/stale-run-sweep.js +116 -0
  671. package/dist/stale-run-sweep.js.map +1 -0
  672. package/dist/start-attempts.d.ts +385 -0
  673. package/dist/start-attempts.d.ts.map +1 -0
  674. package/dist/start-attempts.js +613 -0
  675. package/dist/start-attempts.js.map +1 -0
  676. package/dist/status-cmd.d.ts +28 -0
  677. package/dist/status-cmd.d.ts.map +1 -0
  678. package/dist/status-cmd.js +116 -0
  679. package/dist/status-cmd.js.map +1 -0
  680. package/dist/stop-follow-up.d.ts +107 -0
  681. package/dist/stop-follow-up.d.ts.map +1 -0
  682. package/dist/stop-follow-up.js +172 -0
  683. package/dist/stop-follow-up.js.map +1 -0
  684. package/dist/surface-lease.d.ts +118 -0
  685. package/dist/surface-lease.d.ts.map +1 -0
  686. package/dist/surface-lease.js +485 -0
  687. package/dist/surface-lease.js.map +1 -0
  688. package/dist/sync.d.ts +54 -0
  689. package/dist/sync.d.ts.map +1 -0
  690. package/dist/sync.js +93 -0
  691. package/dist/sync.js.map +1 -0
  692. package/dist/syncing-ledger.d.ts +45 -0
  693. package/dist/syncing-ledger.d.ts.map +1 -0
  694. package/dist/syncing-ledger.js +53 -0
  695. package/dist/syncing-ledger.js.map +1 -0
  696. package/dist/temp-fixtures.d.ts +68 -0
  697. package/dist/temp-fixtures.d.ts.map +1 -0
  698. package/dist/temp-fixtures.js +38 -0
  699. package/dist/temp-fixtures.js.map +1 -0
  700. package/dist/token-window.d.ts +84 -0
  701. package/dist/token-window.d.ts.map +1 -0
  702. package/dist/token-window.js +143 -0
  703. package/dist/token-window.js.map +1 -0
  704. package/dist/tool-bridge.d.ts +177 -0
  705. package/dist/tool-bridge.d.ts.map +1 -0
  706. package/dist/tool-bridge.js +329 -0
  707. package/dist/tool-bridge.js.map +1 -0
  708. package/dist/tool-call-record.d.ts +197 -0
  709. package/dist/tool-call-record.d.ts.map +1 -0
  710. package/dist/tool-call-record.js +276 -0
  711. package/dist/tool-call-record.js.map +1 -0
  712. package/dist/tool-protocol.d.ts +135 -0
  713. package/dist/tool-protocol.d.ts.map +1 -0
  714. package/dist/tool-protocol.js +104 -0
  715. package/dist/tool-protocol.js.map +1 -0
  716. package/dist/tool-worker.d.ts +3 -0
  717. package/dist/tool-worker.d.ts.map +1 -0
  718. package/dist/tool-worker.js +478 -0
  719. package/dist/tool-worker.js.map +1 -0
  720. package/dist/toolchain-mirror.d.ts +86 -0
  721. package/dist/toolchain-mirror.d.ts.map +1 -0
  722. package/dist/toolchain-mirror.js +307 -0
  723. package/dist/toolchain-mirror.js.map +1 -0
  724. package/dist/trusted-git.d.ts +243 -0
  725. package/dist/trusted-git.d.ts.map +1 -0
  726. package/dist/trusted-git.js +920 -0
  727. package/dist/trusted-git.js.map +1 -0
  728. package/dist/ui.d.ts +76 -0
  729. package/dist/ui.d.ts.map +1 -0
  730. package/dist/ui.js +118 -0
  731. package/dist/ui.js.map +1 -0
  732. package/dist/untrusted-exec.d.ts +275 -0
  733. package/dist/untrusted-exec.d.ts.map +1 -0
  734. package/dist/untrusted-exec.js +479 -0
  735. package/dist/untrusted-exec.js.map +1 -0
  736. package/dist/untrusted-gate.d.ts +73 -0
  737. package/dist/untrusted-gate.d.ts.map +1 -0
  738. package/dist/untrusted-gate.js +226 -0
  739. package/dist/untrusted-gate.js.map +1 -0
  740. package/dist/uploader.d.ts +153 -0
  741. package/dist/uploader.d.ts.map +1 -0
  742. package/dist/uploader.js +204 -0
  743. package/dist/uploader.js.map +1 -0
  744. package/dist/verifier.d.ts +66 -0
  745. package/dist/verifier.d.ts.map +1 -0
  746. package/dist/verifier.js +170 -0
  747. package/dist/verifier.js.map +1 -0
  748. package/dist/verify-apply.d.ts +26 -0
  749. package/dist/verify-apply.d.ts.map +1 -0
  750. package/dist/verify-apply.js +36 -0
  751. package/dist/verify-apply.js.map +1 -0
  752. package/dist/verify-cmd.d.ts +44 -0
  753. package/dist/verify-cmd.d.ts.map +1 -0
  754. package/dist/verify-cmd.js +125 -0
  755. package/dist/verify-cmd.js.map +1 -0
  756. package/dist/verify-pass.d.ts +73 -0
  757. package/dist/verify-pass.d.ts.map +1 -0
  758. package/dist/verify-pass.js +103 -0
  759. package/dist/verify-pass.js.map +1 -0
  760. package/dist/welcome.d.ts +43 -0
  761. package/dist/welcome.d.ts.map +1 -0
  762. package/dist/welcome.js +116 -0
  763. package/dist/welcome.js.map +1 -0
  764. package/dist/workspace-provisioner.d.ts +65 -0
  765. package/dist/workspace-provisioner.d.ts.map +1 -0
  766. package/dist/workspace-provisioner.js +66 -0
  767. package/dist/workspace-provisioner.js.map +1 -0
  768. package/dist/workspace-quarantine.d.ts +64 -0
  769. package/dist/workspace-quarantine.d.ts.map +1 -0
  770. package/dist/workspace-quarantine.js +156 -0
  771. package/dist/workspace-quarantine.js.map +1 -0
  772. package/dist/workspace-residue-sweep.d.ts +113 -0
  773. package/dist/workspace-residue-sweep.d.ts.map +1 -0
  774. package/dist/workspace-residue-sweep.js +158 -0
  775. package/dist/workspace-residue-sweep.js.map +1 -0
  776. package/dist/workspace.d.ts +639 -0
  777. package/dist/workspace.d.ts.map +1 -0
  778. package/dist/workspace.js +2026 -0
  779. package/dist/workspace.js.map +1 -0
  780. package/package.json +54 -6
  781. package/win/CredProbe.cs +64 -0
  782. package/win/FakeClaude.cs +56 -0
  783. package/win/HandleProbe.cs +116 -0
  784. package/win/TokenProbe.cs +53 -0
  785. package/win/appcontainer.ps1 +500 -0
@@ -0,0 +1,625 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BUILT_IN_PROVIDER_ENV = exports.MAX_TRANSPORT_OUTPUT_CHARS = void 0;
4
+ exports.providerSessionDir = providerSessionDir;
5
+ exports.mcpConfigJson = mcpConfigJson;
6
+ exports.mcpMainPath = mcpMainPath;
7
+ exports.isBuiltInProvider = isBuiltInProvider;
8
+ exports.claudeMediatedArgv = claudeMediatedArgv;
9
+ exports.allowedToolArgs = allowedToolArgs;
10
+ exports.makeMediatedAgentRunner = makeMediatedAgentRunner;
11
+ const node_child_process_1 = require("node:child_process");
12
+ const node_crypto_1 = require("node:crypto");
13
+ const node_fs_1 = require("node:fs");
14
+ const node_os_1 = require("node:os");
15
+ const node_path_1 = require("node:path");
16
+ const agent_exec_1 = require("./agent-exec");
17
+ const agent_runtime_1 = require("./agent-runtime");
18
+ const agent_contained_1 = require("./agent-contained");
19
+ const exec_domains_1 = require("./exec-domains");
20
+ const untrusted_exec_1 = require("./untrusted-exec");
21
+ /** Which shell a configured provider's line is handed to. See the launch below. */
22
+ const WIN_HOST = process.platform === 'win32';
23
+ const provider_state_1 = require("./provider-state");
24
+ const tool_bridge_1 = require("./tool-bridge");
25
+ const agent_envelope_1 = require("./agent-envelope");
26
+ const spend_ledger_1 = require("./spend-ledger");
27
+ const model_routing_1 = require("./model-routing");
28
+ /**
29
+ * THE MODEL RUNS HERE; THE MODEL'S TOOLS DO NOT.
30
+ *
31
+ * Two phases of work established that the packaged provider cannot run inside
32
+ * an AppContainer — it spawns a child with piped stdio during startup, libuv
33
+ * implements that as a named pipe, and a container cannot create one — and that
34
+ * a restricted token cannot withhold the user's own files. So the provider
35
+ * process runs as the daemon user, and the boundary moves off the process and
36
+ * onto the CAPABILITY:
37
+ *
38
+ * the model gets no host tools at all. Every capability it can call is a
39
+ * Looply MCP tool, and each of those executes inside the container.
40
+ *
41
+ * WHAT THIS DOES AND DOES NOT CLAIM. It does not claim the provider binary is
42
+ * sandboxed — it is not, and a hostile provider executable could read what the
43
+ * user can read. That is supply-chain containment and belongs to a later phase.
44
+ * What is true here is narrower and is the Phase-7 property: model-callable
45
+ * authority is mediated, and Looply hands the transport no governed credential
46
+ * through its environment, arguments, configuration, working directory, or tool
47
+ * surface.
48
+ *
49
+ * THE FIVE CHANNELS. Those are the five ways authority could leak from Looply
50
+ * into the transport, and each is closed deliberately here: the environment is
51
+ * built up rather than inherited, the arguments carry no secret, the MCP config
52
+ * names only our own bridge, the working directory is sterile, and the provider
53
+ * state is a credential copy and nothing else.
54
+ */
55
+ /**
56
+ * How much of the transport's own output the daemon will hold.
57
+ *
58
+ * 🔴 THE PROVIDER IS THE UNCONTAINED PROCESS, AND THIS WAS UNBOUNDED. Every
59
+ * chunk of its stdout and stderr was appended to one string with no ceiling, so
60
+ * the process this phase is ABOUT could exhaust the daemon's memory by talking.
61
+ * The container bounds what a contained child hands back; nothing bounded this,
62
+ * and this is the one that is not contained.
63
+ *
64
+ * ⚠️ THE TAIL IS WHAT MATTERS HERE, WHICH IS THE OPPOSITE OF THE CONTAINED CASE.
65
+ * A provider's answer is its LAST line — the JSON envelope readers parse with
66
+ * `.filter(startsWith('{')).pop()` — so dropping the front preserves the answer
67
+ * and dropping the back would destroy it. A gate step is the other way round,
68
+ * and `untrusted-exec.ts` keeps both ends for that reason.
69
+ */
70
+ exports.MAX_TRANSPORT_OUTPUT_CHARS = 4 * 1024 * 1024;
71
+ /**
72
+ * The provider's working directory: somewhere with nothing in it.
73
+ *
74
+ * NOT THE PROJECT, and this is load-bearing rather than tidy. Even with every
75
+ * built-in tool disabled, a coding CLI discovers things about the directory it
76
+ * starts in — configuration, ignore files, repository state. The transport is
77
+ * meant to learn about the project through the prompt and through tool results,
78
+ * and through nothing else, so it is started somewhere that has no project in
79
+ * it to discover.
80
+ *
81
+ * Per project and per role, so two sessions never share provider state.
82
+ */
83
+ function providerSessionDir(projectDir, role, home = (0, node_os_1.homedir)()) {
84
+ const digest = (0, node_crypto_1.createHash)('sha256').update(`${projectDir}|${role}`, 'utf8').digest('hex').slice(0, 16);
85
+ const dir = (0, node_path_1.join)(home, '.looply', 'provider-sessions', `${role}-${digest}`);
86
+ (0, node_fs_1.mkdirSync)(dir, { recursive: true });
87
+ return dir;
88
+ }
89
+ /** The MCP configuration the provider is given: exactly one server, ours. */
90
+ function mcpConfigJson(launch) {
91
+ return JSON.stringify({
92
+ mcpServers: {
93
+ [launch.name]: { command: launch.command, args: launch.args },
94
+ },
95
+ });
96
+ }
97
+ /**
98
+ * Where the bridge entry point lives.
99
+ *
100
+ * Beside this file once compiled. Under the test runner this module is loaded
101
+ * from `src`, where there is no compiled entry — and it must be the compiled
102
+ * one either way, since that is what the provider will actually spawn. Falling
103
+ * back to the sibling `dist` keeps the tests driving production's artefact.
104
+ */
105
+ function mcpMainPath(deps = {}) {
106
+ if (deps.mcpMain !== undefined)
107
+ return deps.mcpMain;
108
+ const beside = (0, node_path_1.join)(__dirname, 'mcp-main.js');
109
+ return (0, node_fs_1.existsSync)(beside) ? beside : (0, node_path_1.join)(__dirname, '..', 'dist', 'mcp-main.js');
110
+ }
111
+ /**
112
+ * The command line for one mediated turn.
113
+ *
114
+ * `--tools ""` is the mechanism that matters, and it was read off the installed
115
+ * CLI rather than assumed: it takes the list of available tools FROM THE
116
+ * BUILT-IN SET, and an empty value disables all of them. Without it the model
117
+ * would keep its own Read, Write, Edit, Glob, Grep and Bash, every one of which
118
+ * runs as the daemon, and the entire bridge would be decoration beside them.
119
+ *
120
+ * `--strict-mcp-config` then makes the supplied configuration the only one, so
121
+ * no server from the user's profile or a plugin becomes a capability by
122
+ * accident.
123
+ */
124
+ /**
125
+ * Whether `spec` names the built-in provider — the one whose `--output-format
126
+ * json` envelope is written by the CLI around the model's text, rather than a
127
+ * configured command whose whole stdout is the model's to write. Only the
128
+ * former's envelope is read for cost, and only the former's is unwrapped by the
129
+ * round; a configured provider is driven exactly as it always was.
130
+ */
131
+ function isBuiltInProvider(spec) {
132
+ return spec.command === agent_exec_1.DEFAULT_AGENT.command;
133
+ }
134
+ function claudeMediatedArgv(launch, format) {
135
+ return [
136
+ '-p',
137
+ '--output-format',
138
+ format,
139
+ // Every built-in host tool, off.
140
+ '--tools',
141
+ '',
142
+ // Only the servers named below; nothing ambient.
143
+ '--strict-mcp-config',
144
+ '--mcp-config',
145
+ mcpConfigJson(launch),
146
+ ];
147
+ }
148
+ /**
149
+ * Names the model is allowed to call, spelled the way the provider spells them.
150
+ *
151
+ * Belt and braces beside `--tools ""`: if a future version changed what an
152
+ * empty built-in set means, this still names the only acceptable surface.
153
+ */
154
+ function allowedToolArgs(role, launch) {
155
+ const names = tool_bridge_1.TOOL_POLICIES[role].tools.map((t) => `mcp__${launch.name}__${t}`);
156
+ return ['--allowedTools', names.join(',')];
157
+ }
158
+ /** The environment variables a configured provider is handed, by name. */
159
+ function forwarded(spec, reserved) {
160
+ const out = {};
161
+ for (const name of spec.env ?? []) {
162
+ if (reserved(name))
163
+ continue;
164
+ const v = process.env[name];
165
+ if (typeof v === 'string' && v.length > 0)
166
+ out[name] = v;
167
+ }
168
+ return out;
169
+ }
170
+ /** `LOOPLY_` is Looply's own; the transport never receives one. */
171
+ function isReserved(name) {
172
+ return /^LOOPLY_/i.test(name.trim());
173
+ }
174
+ /**
175
+ * What the BUILT-IN provider is told about how it may load its tools.
176
+ *
177
+ * 🔴 WITHOUT THIS THE MODEL HAD NO TOOLS, AND SAID SO WITH FABRICATIONS.
178
+ * Claude Code can DEFER MCP tool schemas behind its own built-in `ToolSearch`
179
+ * tool, loading them only when the model asks. Looply passes `--tools ""`,
180
+ * which removes every built-in — `ToolSearch` with them — so a deferred
181
+ * `mcp__looply__read` was listed and could never be called. The switch is
182
+ * remote: the provider's cached flag `tengu_deferred_stub_tool` flipped on
183
+ * under an UNCHANGED 2.1.208 binary and an unchanged argv.
184
+ *
185
+ * MEASURED, LIVE, 2026-09-24: across 95 provider sessions on this profile,
186
+ * every tool-using session was from 2026-09-15; today three verifier turns in
187
+ * a row called nothing. Two narrated a tool call as text ("⚡ Tool use:
188
+ * Bash", then a fabricated `<system-reminder>`) and returned no verdict; the
189
+ * third, run straight into the binary with the seam out of the path, answered
190
+ * `stale` citing `src/split.ts:1` — a file that does not exist anywhere in
191
+ * the tree. A verifier that invents its evidence is worse than one that fails.
192
+ *
193
+ * `ENABLE_TOOL_SEARCH=false` is the binary's own switch back to "standard":
194
+ * MCP tools loaded up front, as they were. It adds NO host tool — the
195
+ * alternative, letting `ToolSearch` through `--tools`, would be the first
196
+ * built-in the mediated provider was ever allowed.
197
+ *
198
+ * ⚠️ BUILT-IN ONLY. A configured provider is somebody else's binary; it
199
+ * declares how its own tools are turned off (`no_host_tools`) and is told
200
+ * nothing it did not ask for.
201
+ */
202
+ exports.BUILT_IN_PROVIDER_ENV = Object.freeze({
203
+ ENABLE_TOOL_SEARCH: 'false',
204
+ });
205
+ /**
206
+ * An {@link AgentInvoke} that runs the model outside the container and its
207
+ * tools inside one.
208
+ *
209
+ * Fails closed in every direction it can: no provider runtime, no run; no
210
+ * bridge, no run; a configured provider that cannot speak the tool protocol,
211
+ * no run. None of them ever falls back to letting the model touch the host
212
+ * directly, which is the outcome this whole arc exists to prevent.
213
+ */
214
+ function makeMediatedAgentRunner(projectDir, role, spec = agent_exec_1.DEFAULT_AGENT, deps = {},
215
+ /**
216
+ * The registry that stops this outliving the run that started it.
217
+ *
218
+ * 🔴 THE LIVE PROVIDER WAS NOT OWNED. The timeout below reaps it, and that
219
+ * covers a transport that hangs — but not a run that ENDS while one is in
220
+ * flight. `OwnedChildren` exists for exactly that, its docblock claims "a
221
+ * Ctrl-C, a `looply stop`" among what it covers, and the one process it most
222
+ * needed to hold was never adopted into it.
223
+ *
224
+ * The hazard is already recorded a few lines below, in `killTree`'s own
225
+ * docblock: stopping a round mid-turn "left a live stub and a live bridge
226
+ * behind, still holding a project, for as long as the machine stayed up".
227
+ * That was observed. This is the half that was missing.
228
+ *
229
+ * Optional, so every existing caller and fixture keeps working — but the
230
+ * production one passes it.
231
+ */
232
+ owned) {
233
+ const now = deps.now ?? (() => Date.now());
234
+ const spawnFn = deps.spawnFn ?? node_child_process_1.spawn;
235
+ const requested = deps.format ?? 'text';
236
+ // Whether the stream this transport reads carries an envelope the MODEL did
237
+ // not write. Decided once, from the spec, and read where the cost is parsed.
238
+ const builtIn = isBuiltInProvider(spec);
239
+ /**
240
+ * 🔴 EVERY MODEL INVOCATION IN THIS SYSTEM COMES THROUGH HERE, WHICH IS WHY
241
+ * THE SPEND RECORD IS WRITTEN HERE AND NOWHERE ELSE.
242
+ *
243
+ * `envelope.ts` opens by saying a budget over numbers nobody counts is
244
+ * theatre. It was describing its own tree: the parser read `total_cost_usd`,
245
+ * `unwrapEnvelope` dropped it, and no file anywhere appended a spend record —
246
+ * so `withinEnvelope`'s dollar ceiling had nothing on the other side of the
247
+ * comparison.
248
+ *
249
+ * ⚠️ AND THE ROUND IS RECORDED TOO, WITH NO DOLLARS. The round asks for
250
+ * `--output-format text` and gets no envelope, so the most expensive path in
251
+ * the system can report no cost at all. Recording the invocation with `usd`
252
+ * ABSENT makes the window's total unmeasurable rather than cheap, and
253
+ * `withinEnvelope` refuses on unmeasurable. Skipping those invocations
254
+ * instead would have produced a tidy $0.00 for a night of work.
255
+ */
256
+ const record = (0, spend_ledger_1.recordingSpend)(role, now, deps.home, deps.runId);
257
+ const invoke = async (prompt, timeoutMs) => {
258
+ const started = now();
259
+ const fail = (why) => ({
260
+ ok: false,
261
+ timedOut: false,
262
+ ms: now() - started,
263
+ output: why,
264
+ });
265
+ const sessionDir = providerSessionDir(projectDir, role, deps.home);
266
+ const mcpMain = mcpMainPath(deps);
267
+ if (!(0, node_fs_1.existsSync)(mcpMain)) {
268
+ return fail(`the agent did not run: no tool bridge at ${mcpMain}`);
269
+ }
270
+ const launch = {
271
+ name: 'looply',
272
+ command: deps.bridgeNode ?? process.execPath,
273
+ // THE DAEMON'S HOME, TOLD RATHER THAN INHERITED. The bridge is trusted
274
+ // code, but the provider launches it and it inherits the provider's
275
+ // environment — in which HOME points at the sterile session directory. A
276
+ // bridge that believed that would build itself a fresh 80 MB toolchain
277
+ // mirror inside the session on every single round.
278
+ // AND THE RUN, FOR THE SAME REASON THE HOME IS TOLD. `LOOPLY_` is
279
+ // stripped from the provider's environment and this is spawned by the
280
+ // provider, so argv is the only channel. The run id is what turns the
281
+ // bridge's record of what it served on: absent for a scan or a verify,
282
+ // which are charged as themselves and have no run to attach a record to.
283
+ args: [mcpMain, projectDir, role, deps.home ?? (0, node_os_1.homedir)(), deps.runId ?? ''],
284
+ };
285
+ let executable;
286
+ let argv;
287
+ /** Set only on the mediated path; the provider's own profile. */
288
+ let claudeConfigDir = null;
289
+ // Where a CONFIGURED transport's runtime lives, so its command can be
290
+ // resolved. This is what `agent.runtime` means now: provider runtime
291
+ // requirements, declared by a person, NOT project filesystem authority. It
292
+ // keeps every check it had — forbidden roots, physical resolution, and the
293
+ // refusal of anything inside the worktree.
294
+ let runtimePath = [];
295
+ // `cmd /c` does not parse the escaping Node applies to arguments, so a
296
+ // configured line containing a quoted path arrives mangled. The line is one
297
+ // argument by contract, so it is passed through verbatim and quoted here.
298
+ let verbatim = false;
299
+ if (spec.command === agent_exec_1.DEFAULT_AGENT.command) {
300
+ /**
301
+ * An explicitly configured executable stands in for the package lookup,
302
+ * and ONLY for the lookup — every mediating flag below is unchanged.
303
+ * `claudePackageDir` finds a Claude Code installed as an npm package
304
+ * beside node; an installation that lives elsewhere is still the same
305
+ * provider and still takes the same mediation.
306
+ */
307
+ const pkg = spec.executable !== undefined
308
+ ? ''
309
+ : deps.packageDir === undefined
310
+ ? (0, agent_contained_1.claudePackageDir)()
311
+ : deps.packageDir;
312
+ if (pkg === null)
313
+ return fail('the agent did not run: no provider runtime was found');
314
+ /**
315
+ * 🔴 AN EXPLICIT EXECUTABLE IS CHECKED BEFORE IT IS BELIEVED.
316
+ *
317
+ * It must be ABSOLUTE — a relative path resolves against whatever cwd the
318
+ * daemon happens to hold — it must EXIST, so a typo fails here with the
319
+ * path in the message rather than as an opaque spawn error, and it must
320
+ * NOT live inside the worktree. That last one is the point: the model can
321
+ * write to the project, so an executable inside it would be an executable
322
+ * the model can replace, and Looply would be launching its own provider
323
+ * from model-authored bytes.
324
+ */
325
+ if (spec.executable !== undefined) {
326
+ const exe = spec.executable;
327
+ if (!(0, node_path_1.isAbsolute)(exe)) {
328
+ return fail(`the agent did not run: agent.executable must be an absolute path (${exe})`);
329
+ }
330
+ if (!(0, node_fs_1.existsSync)(exe)) {
331
+ return fail(`the agent did not run: no provider executable at ${exe}`);
332
+ }
333
+ const inside = (0, agent_runtime_1.checkRuntimeGrants)([(0, node_path_1.dirname)(exe)], undefined, projectDir);
334
+ if (!inside.ok)
335
+ return fail(`the agent did not run: ${inside.because}`);
336
+ }
337
+ // The SAME composition `doctor` asks about. Two copies of this path would let
338
+ // a readiness check answer honestly about a binary nobody is going to run.
339
+ executable = spec.executable ?? (0, provider_state_1.providerExecutableFor)(pkg);
340
+ /**
341
+ * 🔴 THE PROVIDER AUTHENTICATES ITSELF NOW. Looply used to copy the
342
+ * operator's credential into this session directory on every launch; it
343
+ * points at a persistent profile instead and holds nothing.
344
+ *
345
+ * The profile comes from the DAEMON'S HOME, never from project config —
346
+ * `.looply/config.yaml` lives inside the worktree the model may edit, and
347
+ * a worker that could name this directory could point it at one it wrote.
348
+ */
349
+ claudeConfigDir = (0, provider_state_1.providerProfileDir)({ home: deps.home });
350
+ /**
351
+ * ⚠️ CHECKED IN THE SAME PROFILE AND ENVIRONMENT THE RUN WILL USE, or it
352
+ * answers a different question — the mistake `doctor --provider` was
353
+ * repaired for once already. It costs no model turn: `auth status` is
354
+ * local and prints the profile's own state.
355
+ */
356
+ const ready = (deps.checkAuth ?? provider_state_1.checkProviderAuth)(executable, { ...(0, exec_domains_1.buildProviderEnv)(sessionDir), CLAUDE_CONFIG_DIR: claudeConfigDir }, { home: deps.home });
357
+ if (!ready.ok) {
358
+ // The reason is carried through rather than flattened: only one of the
359
+ // five means "log in", and telling somebody to re-authenticate when the
360
+ // executable is missing wastes their afternoon.
361
+ return fail(`the agent did not run: provider_${ready.reason} — ${ready.because}`);
362
+ }
363
+ // The role's model and effort sit between the mediation flags and the
364
+ // tool allowlist: nothing configured means nothing added, so a project
365
+ // that says nothing about models gets the invocation it always did.
366
+ argv = [
367
+ ...claudeMediatedArgv(launch, requested),
368
+ // The prover is a TOOL role, not a model role: it runs the model the
369
+ // implementer's routing names, exactly as it did while it borrowed the
370
+ // implementer's transport. Only its tools narrowed.
371
+ ...(0, model_routing_1.modelArgs)(role === 'prover' ? 'implementer' : role, spec),
372
+ ...allowedToolArgs(role, launch),
373
+ ];
374
+ }
375
+ else {
376
+ // A CONFIGURED PROVIDER must be able to take its tools from us. There is
377
+ // no fallback to host tools: a transport that cannot be mediated is a
378
+ // transport Looply will not drive.
379
+ const declared = (0, agent_runtime_1.checkRuntimeGrants)(spec.runtime ?? [], undefined, projectDir);
380
+ if (!declared.ok)
381
+ return fail(`the agent did not run: ${declared.because}`);
382
+ // `agent.command` is a shell line by contract, as it has been since the
383
+ // gate's steps. It runs through the shell so that contract still holds,
384
+ // but the shell itself is named explicitly rather than left to `spawn`.
385
+ /**
386
+ * ⚠️ THE FALLBACK OMITTED `Windows` — it read `?? 'C:'`, so with no
387
+ * SystemRoot this looked for `C:\\System32\\cmd.exe`. Absolute, and wrong:
388
+ * the shell would simply not be found, and a configured provider would
389
+ * fail to launch for a reason naming no cause. Three spellings of this
390
+ * fallback exist in the package; this was the only one missing a segment.
391
+ */
392
+ /**
393
+ * 🔴 REFUSED UNLESS ITS TOOLS ARE DECLARED OFF.
394
+ *
395
+ * The comment three lines above has always said "there is no fallback to
396
+ * host tools: a transport that cannot be mediated is a transport Looply
397
+ * will not drive". Until now that was a statement of intent with nothing
398
+ * enforcing it: the default branch appended `allowedToolArgs` and this
399
+ * one appended nothing, so a configured provider ran through `cmd.exe`
400
+ * with its own file, shell and network tools fully enabled.
401
+ *
402
+ * ⚠️ LOOPLY CANNOT INVENT THE FLAG. It does not know what turns an
403
+ * unknown binary's tools off, and a guessed flag that silently does
404
+ * nothing reads exactly like one that works. So the person declares it
405
+ * and this refuses without it — which is the "or the launch is refused"
406
+ * half of the rule, and the only honest half available.
407
+ */
408
+ const suppression = spec.noHostTools ?? [];
409
+ if (suppression.length === 0) {
410
+ return fail('the agent did not run: this provider is configured but does not say how its own tools are ' +
411
+ 'turned off. Looply gives a model no host tools, and it cannot guess the flag for a binary ' +
412
+ 'it does not know — set `agent.no_host_tools` to the arguments that disable them.');
413
+ }
414
+ /**
415
+ * 🔴 THE PLATFORM'S OWN SHELL, WHICH IS WHAT THE DEP COMMENT HAS ALWAYS
416
+ * CLAIMED THIS READS — and it read Windows' shell on every platform.
417
+ *
418
+ * Off Windows the spawn failed with `ENOENT` on
419
+ * `C:\Windows/System32/cmd.exe`, so no configured provider could be
420
+ * launched at all: a turn died before the prompt reached it, and every
421
+ * suite that drives a real `looply run` — round, coordinator, lifecycle,
422
+ * closure, admission — failed with a message naming a path that does not
423
+ * exist on the host.
424
+ *
425
+ * ⚠️ IT CHANGES NOTHING ABOUT TRUST. This transport is deliberately NOT
426
+ * contained on any platform — the comment above says why: a packaged
427
+ * provider spawns children with piped stdio, which an AppContainer cannot
428
+ * create — so the boundary that matters is the GATE's, and the gate still
429
+ * refuses rather than falling back where there is no container to make. The
430
+ * declared suppression arguments are appended here whatever the shell is,
431
+ * and a provider that declares none is still refused above.
432
+ *
433
+ * `/bin/sh` rather than `$SHELL`: the environment handed to this child is
434
+ * built rather than inherited, and a person's interactive shell is not a
435
+ * contract. `sh -c <line>` takes the line as ONE argument, which is the
436
+ * same contract `cmd /d /s /c "<line>"` satisfies.
437
+ */
438
+ const shell = deps.shell ?? (WIN_HOST ? (0, node_path_1.join)((0, untrusted_exec_1.systemRoot)(), 'System32', 'cmd.exe') : '/bin/sh');
439
+ executable = shell;
440
+ /**
441
+ * ⚠️ THE DECLARED ARGUMENTS ARE APPENDED, so a configured provider is
442
+ * mediated by the same shape the default one is: a command line plus the
443
+ * arguments that leave the model with nothing but Looply's tools.
444
+ */
445
+ const line = [spec.command, ...suppression].join(' ');
446
+ argv = WIN_HOST ? ['/d', '/s', '/c', '"' + line + '"'] : ['-c', line];
447
+ // `windowsVerbatimArguments` is a Windows spawn option and the quoting it
448
+ // preserves is cmd's; `sh -c` needs neither.
449
+ verbatim = WIN_HOST;
450
+ runtimePath = declared.paths;
451
+ }
452
+ const base = (0, exec_domains_1.buildProviderEnv)(sessionDir, forwarded(spec, isReserved));
453
+ const env = {
454
+ ...base,
455
+ ...(runtimePath.length === 0
456
+ ? {}
457
+ : { PATH: [...runtimePath, base['PATH'] ?? ''].filter((p) => p.length > 0).join(';') }),
458
+ // How a configured transport is told where its tools are. Claude reads
459
+ // the same thing off its command line; this is the provider-neutral
460
+ // spelling of it, and it names only Looply's own bridge.
461
+ LOOPLY_MCP_CONFIG: mcpConfigJson(launch),
462
+ LOOPLY_MCP_TOOLS: tool_bridge_1.TOOL_POLICIES[role].tools.map((t) => `mcp__${launch.name}__${t}`).join(','),
463
+ // The provider's persistent profile. Added to a scrubbed environment that
464
+ // is BUILT UP rather than inherited, so this is one named variable, not a
465
+ // loosening of what else crosses.
466
+ ...(claudeConfigDir === null ? {} : { CLAUDE_CONFIG_DIR: claudeConfigDir, ...exports.BUILT_IN_PROVIDER_ENV }),
467
+ };
468
+ return await new Promise((resolve) => {
469
+ let out = '';
470
+ let droppedChars = 0;
471
+ /**
472
+ * Keeps the TAIL: see `MAX_TRANSPORT_OUTPUT_CHARS`. Trimmed on the way in
473
+ * rather than at the end, because holding it all and slicing afterwards
474
+ * would be the very allocation this prevents.
475
+ */
476
+ const absorb = (chunk) => {
477
+ out += chunk;
478
+ if (out.length > exports.MAX_TRANSPORT_OUTPUT_CHARS) {
479
+ const over = out.length - exports.MAX_TRANSPORT_OUTPUT_CHARS;
480
+ out = out.slice(over);
481
+ droppedChars += over;
482
+ }
483
+ };
484
+ const collected = () => droppedChars === 0
485
+ ? out
486
+ : `… ${droppedChars} characters of transport output dropped, over the ${exports.MAX_TRANSPORT_OUTPUT_CHARS}-character bound …\n${out}`;
487
+ let done = false;
488
+ let timer;
489
+ const child = spawnFn(executable, argv, {
490
+ cwd: sessionDir,
491
+ // Cast, not spread. `ProcessEnv` is declared with a REQUIRED NODE_ENV
492
+ // by a type package elsewhere in this tree, and the tempting fix —
493
+ // starting from `process.env` — is exactly the inheritance this file
494
+ // exists to prevent.
495
+ env: env,
496
+ stdio: ['pipe', 'pipe', 'pipe'],
497
+ // NEVER `shell: true`. The executable and its arguments are named
498
+ // explicitly; the one place a shell is involved is a configured
499
+ // provider's own line, where cmd is named outright above.
500
+ shell: false,
501
+ ...(verbatim ? { windowsVerbatimArguments: true } : {}),
502
+ });
503
+ // Given back the moment it settles, so a finished transport is not killed
504
+ // later by a shutdown that still believes it is running.
505
+ let release;
506
+ if (owned && child.pid !== undefined) {
507
+ const pid = child.pid;
508
+ release = owned.adopt({
509
+ pid,
510
+ label: `model transport (${role})`,
511
+ kill: () => killTree(pid),
512
+ });
513
+ }
514
+ const finish = (r) => {
515
+ if (done)
516
+ return;
517
+ done = true;
518
+ release?.();
519
+ if (timer !== undefined)
520
+ clearTimeout(timer);
521
+ resolve(r);
522
+ };
523
+ child.stdout?.on('data', (d) => absorb(d.toString('utf8')));
524
+ child.stderr?.on('data', (d) => absorb(d.toString('utf8')));
525
+ child.on('error', (e) => finish(fail(`the agent did not run: ${e.message}`)));
526
+ child.stdin?.on('error', () => undefined);
527
+ child.on('exit', (code) => finish({ ok: code === 0, timedOut: false, ms: now() - started, output: collected() }));
528
+ timer = setTimeout(() => {
529
+ killTree(child.pid);
530
+ finish({ ok: false, timedOut: true, ms: now() - started, output: collected() });
531
+ }, timeoutMs);
532
+ try {
533
+ child.stdin?.end(prompt);
534
+ }
535
+ catch {
536
+ /* a transport that exited before reading its prompt is an exit, not a crash */
537
+ }
538
+ });
539
+ };
540
+ return async (prompt, timeoutMs) => {
541
+ const r = await invoke(prompt, timeoutMs);
542
+ /**
543
+ * 🔴 ONLY THE JSON PATH HAS AN ENVELOPE — AND ON THE TEXT PATH THE MODEL
544
+ * WOULD HAVE BEEN WRITING ITS OWN SPEND RECORD.
545
+ *
546
+ * The round runs with `--output-format text`, so the whole stream is model
547
+ * prose. The first version of this parsed it anyway, which means a model
548
+ * that emits `{"type":"result","subtype":"success","total_cost_usd":0.0}`
549
+ * anywhere in its transcript writes a line into the machine's durable spend
550
+ * ledger — the file a dollar ceiling is meant to read. An agent's assertion
551
+ * is never authoritative about what happened; that is the invariant the
552
+ * whole two-key rule rests on, and this was it being broken about money.
553
+ *
554
+ * ⚠️ AND THE TEXT PATH IS STILL RECORDED, WITHOUT DOLLARS. Skipping it
555
+ * would leave the most expensive path in the system out of the ledger
556
+ * entirely and total a night of rounds at $0.00. An unmeasured invocation
557
+ * makes the whole window unmeasurable, which `withinEnvelope` refuses on.
558
+ *
559
+ * ⚠️ AND NOT PARSING IT IS ALSO WHAT MAKES THE ROUND CHEAP AGAIN. The
560
+ * parse is quadratic in the number of unclosed braces (see
561
+ * `agent-envelope.ts` — 110 seconds on 2 MB before it was bounded), and
562
+ * this line was running it on every round transcript.
563
+ */
564
+ /**
565
+ * 🔴 AND ONLY FOR THE BUILT-IN PROVIDER, WHOSE ENVELOPE THE CLI WRITES.
566
+ *
567
+ * Found by the closure acceptance check the moment the round moved to the
568
+ * JSON path: a CONFIGURED provider is an arbitrary command, and its stdout
569
+ * is the model's own stream — `output_format_flag` may be empty, and
570
+ * nothing between the model and this parser writes an envelope the model
571
+ * cannot forge. The check's stub printed `{"type":"result",
572
+ * "total_cost_usd":99999}` in its prose and the parser dutifully made it a
573
+ * ledger row. With Claude Code on `--output-format json` the model's text
574
+ * sits INSIDE the envelope's `result` string, escaped, so the last object
575
+ * on the stream is the CLI's own; that is the only stream this trusts.
576
+ * A configured provider's invocation is recorded with `usd` absent —
577
+ * unmeasured, never zero — exactly as the text path always was.
578
+ */
579
+ const format = builtIn ? requested : 'text';
580
+ const env = format === 'json' ? (0, agent_envelope_1.parseAgentEnvelope)(r.output ?? '') : null;
581
+ record({ ms: r.ms, ...(env?.cost === undefined ? {} : { cost: env.cost }) });
582
+ return r;
583
+ };
584
+ }
585
+ /**
586
+ * Kill the transport AND everything under it.
587
+ *
588
+ * `child.kill()` is not enough. A configured provider is launched through the
589
+ * shell, so the tree is cmd -> provider -> bridge, and killing the top of it
590
+ * leaves the rest running. This was observed rather than imagined: stopping a
591
+ * round mid-turn left a live stub and a live bridge behind, still holding a
592
+ * project, for as long as the machine stayed up — and they went on contending
593
+ * for container profiles with every run afterwards.
594
+ *
595
+ * The contained half was already safe: each contained process is held in a job
596
+ * object that dies with it. This is about the trusted processes above it.
597
+ */
598
+ function killTree(pid) {
599
+ if (pid === undefined)
600
+ return;
601
+ try {
602
+ if (process.platform === 'win32') {
603
+ /**
604
+ * ABSOLUTE, and with a cwd looply owns.
605
+ *
606
+ * A bare name here inherits `process.cwd()`, which for a run IS the
607
+ * project directory — and Windows searches the cwd before PATH, so the
608
+ * contained agent (granted write over that directory) could put a
609
+ * `taskkill.exe` there and have the daemon run it. Same rule as the git
610
+ * binary; the name is different and the consequence is identical.
611
+ */
612
+ const system32 = (0, node_path_1.join)((0, untrusted_exec_1.systemRoot)(), 'System32');
613
+ (0, node_child_process_1.spawn)((0, node_path_1.join)(system32, 'taskkill.exe'), ['/PID', String(pid), '/T', '/F'], {
614
+ stdio: 'ignore',
615
+ cwd: system32,
616
+ });
617
+ return;
618
+ }
619
+ process.kill(pid);
620
+ }
621
+ catch {
622
+ /* already gone */
623
+ }
624
+ }
625
+ //# sourceMappingURL=model-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-transport.js","sourceRoot":"","sources":["../src/model-transport.ts"],"names":[],"mappings":";;;AAsFA,gDAKC;AAGD,sCAMC;AAUD,kCAIC;AA6CD,8CAEC;AAED,gDAaC;AAQD,0CAGC;AA2DD,0DAmYC;AAznBD,2DAA2C;AAC3C,6CAAyC;AACzC,qCAAgD;AAChD,qCAAkC;AAClC,yCAAsD;AACtD,6CAA+E;AAC/E,mDAAqD;AACrD,uDAAqD;AACrD,iDAAkD;AAClD,qDAA8C;AAE9C,mFAAmF;AACnF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE9C,qDAAgG;AAChG,+CAA6D;AAE7D,qDAAsD;AACtD,iDAAgD;AAChD,mDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;GAcG;AACU,QAAA,0BAA0B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAU1D;;;;;;;;;;;GAWG;AACH,SAAgB,kBAAkB,CAAC,UAAkB,EAAE,IAAc,EAAE,OAAe,IAAA,iBAAO,GAAE;IAC7F,MAAM,MAAM,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,IAAI,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvG,MAAM,GAAG,GAAG,IAAA,gBAAI,EAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,GAAG,IAAI,IAAI,MAAM,EAAE,CAAC,CAAC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