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 @@
1
+ {"version":3,"file":"run-ending-locator.d.ts","sourceRoot":"","sources":["../src/run-ending-locator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAkB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,aAAa,CAAC;AAErG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,WAAW,CAAC;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3F;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAe7I;AAED,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,GAAG,UAAU,CAAC;AAEtF,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CAAE;AAClE,oFAAoF;GAClF;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,GAC3E,eAAe,CAajB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAiEvG"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isProjectExecutionRoot = isProjectExecutionRoot;
4
+ exports.locateRunCheckout = locateRunCheckout;
5
+ exports.makeRunEndedReader = makeRunEndedReader;
6
+ const node_fs_1 = require("node:fs");
7
+ const node_os_1 = require("node:os");
8
+ const node_path_1 = require("node:path");
9
+ const core_1 = require("@looply/core");
10
+ const git_driver_1 = require("./git-driver");
11
+ const ledger_store_1 = require("./ledger-store");
12
+ const run_ended_1 = require("./run-ended");
13
+ const run_start_marks_1 = require("./run-start-marks");
14
+ const trusted_git_1 = require("./trusted-git");
15
+ const workspace_1 = require("./workspace");
16
+ /**
17
+ * Whether `checkout` is a place this project's runs execute: its main checkout,
18
+ * or a workspace under its own workspaces root that is (still) a checkout of
19
+ * the same repository.
20
+ */
21
+ function isProjectExecutionRoot(cwd, checkout, home = (0, node_os_1.homedir)()) {
22
+ const main = (0, node_path_1.resolve)((0, trusted_git_1.mainWorktreeRoot)(cwd) ?? cwd);
23
+ const wanted = (0, node_path_1.resolve)(checkout);
24
+ if (wanted === main)
25
+ return { ok: true };
26
+ const root = (0, node_path_1.resolve)((0, workspace_1.workspacesRoot)(cwd, home));
27
+ const rel = (0, node_path_1.relative)(root, wanted);
28
+ if (rel === '' || rel.startsWith('..') || (0, node_path_1.isAbsolute)(rel)) {
29
+ return { ok: false, because: `${checkout} is not this project's checkout and not under its workspaces root` };
30
+ }
31
+ // A workspace that still exists must be a checkout of THIS repository. One
32
+ // that no longer exists cannot be read anyway, and the ledger read says so.
33
+ if ((0, node_fs_1.existsSync)(wanted) && (0, trusted_git_1.repoIdentityPath)(wanted) !== (0, trusted_git_1.repoIdentityPath)(cwd)) {
34
+ return { ok: false, because: `${checkout} is not a checkout of this repository` };
35
+ }
36
+ return { ok: true };
37
+ }
38
+ /** The checkout the project's records say this run executes in, if any. */
39
+ function locateRunCheckout(runId, records) {
40
+ const rec = records.record !== null && records.record.kind !== 'unreadable' ? records.record : null;
41
+ const fromRecord = rec?.record.workspace;
42
+ const fromMark = records.mark?.workspace;
43
+ if (fromRecord !== undefined && fromMark !== undefined && (0, node_path_1.resolve)(fromRecord) !== (0, node_path_1.resolve)(fromMark)) {
44
+ return {
45
+ kind: 'ambiguous',
46
+ because: `run ${runId} is recorded in two checkouts (${fromRecord} and ${fromMark})`,
47
+ };
48
+ }
49
+ const checkout = fromRecord ?? fromMark;
50
+ if (checkout === undefined)
51
+ return { kind: 'legacy' };
52
+ return { kind: 'located', checkout, liveness: rec === null ? 'released' : rec.kind };
53
+ }
54
+ /**
55
+ * The daemon's `runEnded` dependency, over the real records.
56
+ *
57
+ * ONE factory, used by the daemon and by the end-to-end proof alike, so the
58
+ * proof exercises the reader the daemon actually runs rather than a stand-in
59
+ * that happens to agree.
60
+ */
61
+ function makeRunEndedReader(deps) {
62
+ const fs = deps.fs ?? ledger_store_1.nodeLedgerFs;
63
+ const home = deps.home ?? (0, node_os_1.homedir)();
64
+ const projectState = (0, git_driver_1.projectStateDir)(deps.cwd);
65
+ const marks = deps.marks ?? (() => new run_start_marks_1.RunStartMarks(projectState, ledger_store_1.nodeLedgerFs));
66
+ const registry = deps.registry ?? (() => new workspace_1.RunRegistry(projectState, deps.probe ?? workspace_1.nodeProbe));
67
+ return async (runId) => {
68
+ if (runId === '')
69
+ return { ok: false, because: 'no run was named' };
70
+ let record = null;
71
+ for (const entry of registry().list()) {
72
+ if (entry.kind === 'unreadable')
73
+ continue;
74
+ if (entry.record.runId === runId) {
75
+ record = entry;
76
+ break;
77
+ }
78
+ }
79
+ const m = marks();
80
+ await m.load();
81
+ const where = locateRunCheckout(runId, { record, mark: m.findByRun(runId) });
82
+ if (where.kind === 'ambiguous')
83
+ return { ok: false, because: where.because };
84
+ if (where.kind === 'legacy')
85
+ return collapse(await (0, run_ended_1.readRunEnded)(projectState, fs, runId));
86
+ const allowed = isProjectExecutionRoot(deps.cwd, where.checkout, home);
87
+ if (!allowed.ok)
88
+ return { ok: false, because: `cannot read run ${runId}'s ledger: ${allowed.because}` };
89
+ const stateDir = (0, git_driver_1.executionStateDir)(where.checkout);
90
+ let text;
91
+ try {
92
+ text = await fs.readFile(`${stateDir}/events.jsonl`);
93
+ }
94
+ catch (e) {
95
+ return { ok: false, because: `the run ledger could not be read (${e.message})` };
96
+ }
97
+ const events = text === null || text.length === 0 ? [] : (0, core_1.parseLines)(text).events;
98
+ let started = false;
99
+ for (const e of events) {
100
+ if (e.runId !== runId)
101
+ continue;
102
+ if (e.kind === 'run.ended')
103
+ return { ok: true, ended: true };
104
+ if (e.kind === 'run.started')
105
+ started = true;
106
+ }
107
+ if (started)
108
+ return { ok: true, ended: false };
109
+ // No trace of this run on the ledger it executes in.
110
+ switch (where.liveness) {
111
+ case 'active':
112
+ // Registered and alive: it has not reached `run.started` yet.
113
+ return { ok: true, ended: false };
114
+ case 'unknown':
115
+ return { ok: false, because: `run ${runId} has not written to its ledger and its process cannot be judged` };
116
+ case 'orphaned':
117
+ case 'released':
118
+ return {
119
+ ok: false,
120
+ because: `run ${runId} is gone and left no ending on its ledger at ${where.checkout} — ` +
121
+ 'waiting for stale-run recovery to close it',
122
+ };
123
+ default: {
124
+ const never = where.liveness;
125
+ throw new Error(`no answer for liveness ${String(never)}`);
126
+ }
127
+ }
128
+ };
129
+ }
130
+ function collapse(out) {
131
+ return out.ok ? { ok: true, ended: out.ended } : { ok: false, because: out.because };
132
+ }
133
+ //# sourceMappingURL=run-ending-locator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-ending-locator.js","sourceRoot":"","sources":["../src/run-ending-locator.ts"],"names":[],"mappings":";;AA8FA,wDAeC;AAYD,8CAgBC;AASD,gDAiEC;AAnND,qCAAqC;AACrC,qCAAkC;AAClC,yCAA0D;AAC1D,uCAA0C;AAC1C,6CAAkE;AAClE,iDAA6D;AAC7D,2CAAiE;AACjE,uDAAkD;AAClD,+CAAmE;AACnE,2CAAqG;AAgFrG;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,GAAW,EAAE,QAAgB,EAAE,OAAe,IAAA,iBAAO,GAAE;IAC5F,MAAM,IAAI,GAAG,IAAA,mBAAO,EAAC,IAAA,8BAAgB,EAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,IAAA,mBAAO,EAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,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AAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,GAAoB;IACpC,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;AACvF,CAAC"}
@@ -0,0 +1,459 @@
1
+ import type { RunRefusalCode } from '@looply/core';
2
+ import { type LeaseState } from './run-lease';
3
+ /**
4
+ * Starting one of the CLI's long jobs — a run, a scan — because the phone
5
+ * asked for it.
6
+ *
7
+ * The daemon acks a command only when it carried it out, so the whole question
8
+ * here is when a spawned job counts as started. It is *not* the moment `spawn`
9
+ * returns: node reports a missing or unrunnable binary asynchronously, through
10
+ * an `error` event a tick later, so acking on the handle alone shows the phone
11
+ * a tick for a job that never existed. A job that starts and dies immediately —
12
+ * a bad `--hours`, a config the CLI refuses — is the same lie with extra steps.
13
+ * So the launcher watches the child for a settling window and reports started
14
+ * only if nothing came back saying otherwise.
15
+ */
16
+ /** The slice of a child process the launcher needs; callbacks may fire in any order. */
17
+ export interface LaunchHandle {
18
+ pid: number | undefined;
19
+ /** `code` is null when the process died to a signal rather than exiting. */
20
+ onExit(cb: (code: number | null) => void): void;
21
+ /** Spawn-level failure: the run could not be started at all. */
22
+ onError(cb: (err: Error) => void): void;
23
+ /** Stop the parent waiting on this child, so the daemon can exit without it. */
24
+ release(): void;
25
+ }
26
+ export interface RunLauncherDeps {
27
+ spawn(args: readonly string[]): LaunchHandle;
28
+ sleep(ms: number): Promise<void>;
29
+ /** How long to watch for a spawn failure before calling the child up. */
30
+ settleMs?: number;
31
+ /**
32
+ * Durable proof that a given request's run actually started.
33
+ *
34
+ * Absent in callers that cannot read it; then a run can never be PROVEN and
35
+ * the request simply stays outstanding. That is the safe degradation — it
36
+ * delays an answer, and can never duplicate a run, because the lease is what
37
+ * stops a second runner.
38
+ */
39
+ provenStart?(requestId: string): Promise<{
40
+ runId: string;
41
+ } | null>;
42
+ /**
43
+ * What the durable run lease says about this working tree, if anything.
44
+ *
45
+ * Advisory only — the run process is what actually takes the lease, and it
46
+ * refuses itself if it cannot. This exists so the daemon can answer the phone
47
+ * honestly instead of spawning a child that exits a moment later with a
48
+ * message nobody sees. It also survives a daemon restart, which the
49
+ * in-memory map above cannot: that is the whole duplicate-runner window.
50
+ */
51
+ peekLease?(): Promise<LeaseState>;
52
+ /**
53
+ * The lease of ONE checkout, for a run the coordinator placed there.
54
+ *
55
+ * 🔴 `peekLease()` ANSWERS ABOUT THE PROJECT'S OWN CHECKOUT AND NOTHING ELSE,
56
+ * so asking it about a second workspace asks the wrong file: a live run in the
57
+ * main checkout refused a launch into an empty workspace beside it. That is
58
+ * the single-run behaviour which made N-way scheduling impossible however the
59
+ * scheduler decided.
60
+ *
61
+ * Optional: a launcher without it cannot place runs in workspaces, and behaves
62
+ * exactly as it always has.
63
+ */
64
+ peekLeaseAt?(workspace: string): Promise<LeaseState>;
65
+ /**
66
+ * Why this request's run refused, in the run's OWN words — and which refusal
67
+ * it was.
68
+ *
69
+ * The child is spawned with `stdio: 'ignore'`, so the only thing this process
70
+ * can observe of it is an exit code — and exit 3 says "terminal", not why.
71
+ * The run writes its reason down where a reader can find it; this reads it.
72
+ *
73
+ * The `code` is what makes a refusal actionable by something other than a
74
+ * person. It is optional because a mark written before 6D2A has none, and
75
+ * because a refusal that cannot be read at all still degrades to the plainer
76
+ * wording below. A missing reason costs a sentence; a missing CODE costs the
77
+ * right to conclude anything from the refusal, which is exactly the caution
78
+ * the caller should exercise.
79
+ */
80
+ refusalOf?(requestId: string): Promise<{
81
+ reason: string;
82
+ code?: RunRefusalCode;
83
+ } | null>;
84
+ }
85
+ export type LaunchResult =
86
+ /**
87
+ * PROVEN. Durable evidence says this command's run crossed the accepted start
88
+ * boundary — `run.started` is in the ledger and the mark names this command.
89
+ *
90
+ * Nothing else may report this. A child that is merely alive has proven
91
+ * nothing: a goal-bound run resolves its goal, takes the lease, adopts items
92
+ * and verifies drafts before a Run exists, and every one of those can still
93
+ * end without one, minutes later.
94
+ */
95
+ {
96
+ started: true;
97
+ already: boolean;
98
+ pid: number | undefined;
99
+ runId?: string;
100
+ }
101
+ /**
102
+ * A child for this command is alive and has not yet proven anything.
103
+ *
104
+ * The honest middle state, and the one the old contract was missing: it
105
+ * collapsed this into `started: true` after 750ms and let the daemon ack a
106
+ * command terminally on it. Left queued, so the next poll can ask again — and
107
+ * the launcher will not spawn a second child for the same request.
108
+ */
109
+ | {
110
+ started: false;
111
+ waiting: true;
112
+ reason: string;
113
+ /**
114
+ * The child that was created, when one was.
115
+ *
116
+ * A run is held to proof, so a successful spawn reports `waiting` rather
117
+ * than `started` — the run has not begun until the ledger says so. That
118
+ * left the caller unable to tell "a child is starting" from "no child was
119
+ * made", which are opposite answers for anything counting tries. The pid
120
+ * is the only honest evidence, so it travels with the answer.
121
+ */
122
+ spawnedPid?: number;
123
+ } | {
124
+ started: false;
125
+ reason: string;
126
+ }
127
+ /**
128
+ * Refused for a reason retrying cannot fix. Distinct from `started: false`,
129
+ * which redelivers: since commands became genuinely redeliverable, a refusal
130
+ * offered again every three seconds for an hour is a storm, not a service.
131
+ *
132
+ * `terminal` MEANS "stop asking on this cycle". It does NOT mean the goal is
133
+ * finished, and the difference is the whole of 6D2A's caution: three of the
134
+ * sites that set it are machine-local CONTENTION — a clash with a live run,
135
+ * a lease that cannot be probed — which are true right now and false ten
136
+ * minutes from now. Only a refusal the RUN ITSELF made carries a `code`, and
137
+ * only a code may be turned into a statement about the goal. See
138
+ * {@link asStartResult}.
139
+ */
140
+ | {
141
+ started: false;
142
+ reason: string;
143
+ terminal: true;
144
+ code?: RunRefusalCode;
145
+ };
146
+ /**
147
+ * WHO ASKED FOR THIS START, AND UNDER WHAT AUTHORITY.
148
+ *
149
+ * The two are genuinely different acts and the machine must not lose track of
150
+ * which it is carrying out. A person tapping Start authorizes ONE run, and the
151
+ * server has a durable row for it that must be acked. A controller spending
152
+ * ordinal N of a grant authorizes one run too, but there is no row, nothing to
153
+ * ack, and no person in the loop at that instant — the person's act was
154
+ * authorizing the grant, earlier.
155
+ *
156
+ * Modelled as a discriminated union rather than an optional field so that every
157
+ * Start has to say which it is. The alternative — an optional `controllerId`
158
+ * beside an optional `commandId` — permits both, permits neither, and makes
159
+ * "who authorized this" a question with four answers instead of two.
160
+ */
161
+ export type StartOrigin =
162
+ /**
163
+ * A person tapped Start. `commandId` is the server row to answer.
164
+ *
165
+ * No attempt number, deliberately. A human Start is already bounded by the
166
+ * server's one-hour redelivery window, and giving it a second, smaller cap
167
+ * would change a path that has worked for phases in a way nobody asked for.
168
+ */
169
+ {
170
+ kind: 'human-command';
171
+ commandId: string;
172
+ }
173
+ /**
174
+ * A controller spent one bounded ordinal of a grant a person authorized
175
+ * earlier.
176
+ *
177
+ * `attempt` counts tries at THIS request, not requests. Attempts 1, 2 and 3
178
+ * of ordinal N all carry the same `requestId`: they are three tries at
179
+ * establishing one Start, not three Starts, and every durable fact about it
180
+ * is filed under the one id. It is required here because an autonomous Start
181
+ * has no server row and therefore no redelivery window to bound it.
182
+ */
183
+ | {
184
+ kind: 'autonomy';
185
+ controllerId: string;
186
+ ordinal: number;
187
+ attempt: number;
188
+ };
189
+ /**
190
+ * ONE ATTEMPT TO START A BOUNDED RUN.
191
+ *
192
+ * `requestId` is the durable identity of the attempt and the key under which
193
+ * every durable fact about it is filed: the lease's `startedByCommandId`, the
194
+ * start mark that proves a Run began, the refusal mark that says why one did
195
+ * not. It is deliberately opaque to everything below this line — the launcher,
196
+ * the child, the marks and the lease all treat it as a string, and none of them
197
+ * asks where it came from.
198
+ *
199
+ * For a human Start it IS the command id, which keeps every existing record
200
+ * readable and every existing behaviour identical. For an autonomous Start it
201
+ * is `autonomyStartId(controllerId, ordinal)`, which is derived rather than
202
+ * minted, so two daemons that both decide ordinal N is due compute the same
203
+ * string and file their facts in the same place.
204
+ */
205
+ export interface StartRequest extends StartPayload {
206
+ requestId: string;
207
+ origin: StartOrigin;
208
+ /**
209
+ * WHICH CHECKOUT THIS RUN IS FOR.
210
+ *
211
+ * 🔴 WITHOUT IT THE LAUNCHER IS SINGLE-RUN BY CONSTRUCTION, whatever the
212
+ * scheduler decides. `live` was keyed by the literal string `'run'`, so a
213
+ * second launch found the first and reported "already going"; and the lease
214
+ * check below peeked THE lease — the project's — so a second launch was
215
+ * refused by a run in a different checkout entirely. `decideSchedule` has
216
+ * been assigning a workspace per start since it was written
217
+ * (`ObservedPremise.workspace`) and nothing carried it here.
218
+ *
219
+ * ⚠️ ABSENT IS THE WHOLE OF THE COMPATIBILITY GUARANTEE. With no workspace
220
+ * the job key is `'run'`, the lease peeked is the project's, and no `--in` is
221
+ * passed — byte-identical to every launch this has ever made. Simple Mode and
222
+ * the phone's Start are unchanged.
223
+ */
224
+ workspace?: string;
225
+ }
226
+ /**
227
+ * WHAT CAME OF ONE ATTEMPT, as something other than a person can read it.
228
+ *
229
+ * {@link LaunchResult} is shaped for the daemon's command handler, which has
230
+ * only ever needed to answer "ack, refuse, or leave it queued". A controller
231
+ * needs a sharper question answered: may I conclude something about the GOAL
232
+ * from this?
233
+ *
234
+ * The line that matters runs between `refused` and `blocked`. A `refused` came
235
+ * from the run itself deciding, in a `RunRefused` carrying a code, that this
236
+ * Start will not produce a Run — that is a statement about the work. A
237
+ * `blocked` is the machine saying "not now": a clash with a live run, a lease
238
+ * it cannot probe, a mark it could not read. Both are terminal for THIS poll;
239
+ * only the first may ever become "the goal is satisfied".
240
+ */
241
+ export type StartResult =
242
+ /** Durable proof: `run.started` is in the ledger and the mark names this request. */
243
+ {
244
+ kind: 'run-started';
245
+ runId: string;
246
+ }
247
+ /** A child is alive for this request and has proven nothing yet. Ask again. */
248
+ | {
249
+ kind: 'pending';
250
+ reason: string;
251
+ }
252
+ /** The RUN decided. Only this arm may drive a statement about the goal. */
253
+ | {
254
+ kind: 'refused';
255
+ code: RunRefusalCode;
256
+ reason: string;
257
+ }
258
+ /** The machine could not start it NOW. Never a statement about the goal. */
259
+ | {
260
+ kind: 'blocked';
261
+ reason: string;
262
+ }
263
+ /** The attempt failed and may be retried under whatever bound the caller holds. */
264
+ | {
265
+ kind: 'failed';
266
+ reason: string;
267
+ };
268
+ /**
269
+ * The same answer, restated for a caller that must decide rather than report.
270
+ *
271
+ * A pure projection, so there is exactly one implementation of "what happened"
272
+ * and this is a view onto it — not a second opinion. The daemon's command
273
+ * handler keeps reading {@link LaunchResult} directly and is untouched.
274
+ *
275
+ * The two rules worth stating out loud:
276
+ *
277
+ * A terminal result with NO code is `blocked`, never `refused`. That covers
278
+ * every contention case and also the case where the run did refuse but its
279
+ * mark could not be read — in which case the honest answer is "I do not know
280
+ * why", and a caller that may end a person's grant on the strength of this
281
+ * must not be handed a guess.
282
+ *
283
+ * `started: true` without a runId is `pending`, not `run-started`. For a run
284
+ * that can only ever be true of a job held to no proof contract, and a
285
+ * controller that treated it as a Run would wait for an ending that no
286
+ * ledger will ever carry.
287
+ */
288
+ export declare function asStartResult(r: LaunchResult): StartResult;
289
+ /** What the command handler needs from a launcher, so it can be stubbed. */
290
+ export interface RunStarter {
291
+ start(req: StartRequest): Promise<LaunchResult>;
292
+ /**
293
+ * Optional for the same reason `starter` itself is optional on the handler: a
294
+ * caller that can spawn a run but not a scan must leave `scan` unacked rather
295
+ * than ack something it never did.
296
+ */
297
+ scan?(): Promise<LaunchResult>;
298
+ }
299
+ /**
300
+ * Long enough for an ENOENT or an argument the CLI refuses outright to come
301
+ * back, short enough that the phone's tap still feels answered.
302
+ */
303
+ export declare const DEFAULT_SETTLE_MS = 750;
304
+ export declare class RunLauncher implements RunStarter {
305
+ private readonly deps;
306
+ /**
307
+ * Job name → the child believed to still be running. Absent once it exits.
308
+ *
309
+ * It remembers `goalId` because "a run is already going" is no longer a
310
+ * complete answer: a second start-run naming a DIFFERENT goal is a different
311
+ * request, and answering it with the run that is already here would ack a goal
312
+ * that never ran.
313
+ */
314
+ private readonly live;
315
+ /**
316
+ * How a child this launcher spawned actually ended, by the command that asked
317
+ * for it.
318
+ *
319
+ * The child is detached and unref'd, so `launch` has long returned by the time
320
+ * it exits — and under the old contract nobody ever read the exit code again.
321
+ * A run that refuses its goal after a second of preflight exits 3, and this is
322
+ * what carries that answer to the next poll.
323
+ *
324
+ * In memory only, and deliberately: it is an optimisation, not the record. A
325
+ * daemon restart forgets, relaunches once, and the child refuses again — one
326
+ * wasted spawn rather than a wrong ack.
327
+ */
328
+ private readonly ended;
329
+ constructor(deps: RunLauncherDeps);
330
+ /**
331
+ * What to tell the daemon a terminal refusal was, given what this process saw.
332
+ *
333
+ * `fallback` is what the launcher can see by itself — an exit code — and it
334
+ * is what shipped before the run could say more. The run's own reason is
335
+ * preferred whenever it left one for THIS command: the whole point is that
336
+ * "the run exited — exit 3" and "this goal's work is done" are not the same
337
+ * answer to somebody waiting on their phone.
338
+ *
339
+ * Keyed by command id, so a refusal can only ever be reported against the
340
+ * request that produced it. Never throws: a reason that cannot be read leaves
341
+ * the refusal exactly as truthful as it was, just less specific.
342
+ */
343
+ private refusalMark;
344
+ /**
345
+ * Is any run live in this process?
346
+ *
347
+ * ⚠️ ANY CHECKOUT, NOT ONLY THE MAIN ONE. Job keys are `run` for an unplaced
348
+ * run and `run:<workspace>` for one a coordinator placed, and a caller asking
349
+ * "is a run going" means any of them.
350
+ */
351
+ isRunning(): boolean;
352
+ start(req: StartRequest): Promise<LaunchResult>;
353
+ /**
354
+ * `looply scan`, as a child, so the lens passes stream into the ledger and
355
+ * reach the phone rather than being twenty silent minutes.
356
+ */
357
+ scan(): Promise<LaunchResult>;
358
+ private launch;
359
+ }
360
+ /**
361
+ * Just enough of a Start to tell two of them apart.
362
+ *
363
+ * Named for what it is: this pair is compared, never executed. The thing that
364
+ * IS executed is {@link StartRequest} below, and conflating the two is how the
365
+ * launcher came to describe a server command row in a comment about identity.
366
+ */
367
+ export interface StartIdentity {
368
+ /** The execution identity of the request. See {@link StartRequest.requestId}. */
369
+ commandId?: string | undefined;
370
+ goalId?: string | undefined;
371
+ }
372
+ /**
373
+ * Whether an already-running job answers the Start that just arrived.
374
+ *
375
+ * "A run is already going here" used to be a complete answer, and it was: both
376
+ * callers had asked for a run to be in progress, and one was. A goal makes it
377
+ * incomplete, and `itemIds` makes goal identity insufficient too — these are
378
+ * DIFFERENT requests:
379
+ *
380
+ * C1 goal G, items [A] C2 goal G, items [B]
381
+ *
382
+ * C2 is not satisfied because a G-bound run happens to exist; it asked for work
383
+ * that run will never pick. So the identity of a Start is its REQUEST, not its
384
+ * goal.
385
+ *
386
+ * That is sound for a human Start because the command row is durable and its
387
+ * payload cannot mutate after creation — the only writes to an existing row are
388
+ * the ack and the expiry sweep — so one command id means one unchanging request.
389
+ * It is sound for an autonomous Start for a different reason with the same
390
+ * force: `autonomyStartId(C, N)` is derived from a controller id and an ordinal
391
+ * whose reservation receipt is created with O_EXCL and never rewritten, so one
392
+ * request id there also means one unchanging request. Neither depends on the
393
+ * other, and the launcher does not need to know which it is holding.
394
+ *
395
+ * Returns the refusal text, or `null` when the live run genuinely satisfies it.
396
+ */
397
+ export declare function refuseStart(want: StartIdentity, live: StartIdentity): string | null;
398
+ /**
399
+ * Everything a start-run payload is allowed to say, narrowed for the machine.
400
+ *
401
+ * The mirror of the server's `normaliseStart`, and deliberately not trusting
402
+ * it. The payload travels phone → server → Json column → Redis → daemon
403
+ * untyped, and this process may be an older or newer build than the one that
404
+ * wrote the row.
405
+ */
406
+ export interface StartPayload {
407
+ hours?: number;
408
+ goalId?: string;
409
+ goalVersion?: number;
410
+ itemIds?: string[];
411
+ /**
412
+ * The answer this Start is picking up, when a person is starting again after
413
+ * one.
414
+ *
415
+ * AN ID AND NOTHING ELSE. The run resolves it against the server itself, for
416
+ * the same reason it resolves its own goal: the daemon CARRIES these values
417
+ * and the run process is what decides whether they still mean anything.
418
+ * Sending the action, the wording or the outcome down argv would be a second,
419
+ * unverified copy of a decision — and argv is also length-capped and publicly
420
+ * visible, which is why the adoption list is bounded a few lines below.
421
+ *
422
+ * NEVER SET BY A MODEL, and never by the phone: it comes from the gate that
423
+ * read the server, and it is claimed exclusively before this Start exists.
424
+ */
425
+ resumedFromApprovalId?: string;
426
+ governedApprovalId?: string;
427
+ }
428
+ /**
429
+ * How many items one Start may adopt.
430
+ *
431
+ * The adoption list travels to the run process on its command line, and an
432
+ * argv that exceeds the OS limit produces a spawn failure rather than a
433
+ * refusal — a command nobody can carry out and nobody can read. A bound the
434
+ * daemon states is better than one the kernel enforces.
435
+ */
436
+ export declare const MAX_ADOPTED_ITEMS = 200;
437
+ /**
438
+ * What a start-run payload asks for, or why this build will not carry it out.
439
+ *
440
+ * ONE reader, deliberately. A second narrowing somewhere else is how a
441
+ * malformed goal silently becomes an UNBOUND run — which would work the whole
442
+ * queue while the phone waits for a goal that never binds. A value that is
443
+ * present but unusable is never "no goal": the whole point of the union is
444
+ * that the caller cannot accidentally treat the two the same way.
445
+ *
446
+ * `hours` is the exception and stays lenient, because the config carries a
447
+ * budget to fall back on. Nothing falls back for a goal.
448
+ */
449
+ export type StartRead = {
450
+ ok: true;
451
+ start: StartPayload;
452
+ } | {
453
+ ok: false;
454
+ problem: string;
455
+ };
456
+ export declare function readStartPayload(payload: unknown): StartRead;
457
+ export declare function hoursFromPayload(payload: unknown): number | undefined;
458
+ export declare function nodeRunLauncher(cwd: string, stateDir?: string): RunLauncher;
459
+ //# sourceMappingURL=run-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-launcher.d.ts","sourceRoot":"","sources":["../src/run-launcher.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzF;;;;;;;;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