@ashlr/hub 2.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 (477) hide show
  1. package/CHANGELOG.md +1158 -0
  2. package/LICENSE +21 -0
  3. package/README.md +833 -0
  4. package/bin/ashlr +8 -0
  5. package/dist/api/core.d.ts +28 -0
  6. package/dist/api/core.js +42 -0
  7. package/dist/api/core.js.map +1 -0
  8. package/dist/api/index.d.ts +9 -0
  9. package/dist/api/index.js +9 -0
  10. package/dist/api/index.js.map +1 -0
  11. package/dist/api/plugin.d.ts +12 -0
  12. package/dist/api/plugin.js +13 -0
  13. package/dist/api/plugin.js.map +1 -0
  14. package/dist/api/types.d.ts +9 -0
  15. package/dist/api/types.js +9 -0
  16. package/dist/api/types.js.map +1 -0
  17. package/dist/cli/args.d.ts +20 -0
  18. package/dist/cli/args.js +23 -0
  19. package/dist/cli/args.js.map +1 -0
  20. package/dist/cli/ask.d.ts +22 -0
  21. package/dist/cli/ask.js +240 -0
  22. package/dist/cli/ask.js.map +1 -0
  23. package/dist/cli/audit.d.ts +26 -0
  24. package/dist/cli/audit.js +199 -0
  25. package/dist/cli/audit.js.map +1 -0
  26. package/dist/cli/backlog.d.ts +26 -0
  27. package/dist/cli/backlog.js +322 -0
  28. package/dist/cli/backlog.js.map +1 -0
  29. package/dist/cli/completions.d.ts +18 -0
  30. package/dist/cli/completions.js +156 -0
  31. package/dist/cli/completions.js.map +1 -0
  32. package/dist/cli/daemon.d.ts +31 -0
  33. package/dist/cli/daemon.js +334 -0
  34. package/dist/cli/daemon.js.map +1 -0
  35. package/dist/cli/demo-sandbox.d.ts +78 -0
  36. package/dist/cli/demo-sandbox.js +227 -0
  37. package/dist/cli/demo-sandbox.js.map +1 -0
  38. package/dist/cli/demo.d.ts +76 -0
  39. package/dist/cli/demo.js +285 -0
  40. package/dist/cli/demo.js.map +1 -0
  41. package/dist/cli/digest.d.ts +46 -0
  42. package/dist/cli/digest.js +352 -0
  43. package/dist/cli/digest.js.map +1 -0
  44. package/dist/cli/doctor-init.d.ts +28 -0
  45. package/dist/cli/doctor-init.js +335 -0
  46. package/dist/cli/doctor-init.js.map +1 -0
  47. package/dist/cli/genome.d.ts +62 -0
  48. package/dist/cli/genome.js +1061 -0
  49. package/dist/cli/genome.js.map +1 -0
  50. package/dist/cli/gh.d.ts +27 -0
  51. package/dist/cli/gh.js +322 -0
  52. package/dist/cli/gh.js.map +1 -0
  53. package/dist/cli/goals.d.ts +55 -0
  54. package/dist/cli/goals.js +667 -0
  55. package/dist/cli/goals.js.map +1 -0
  56. package/dist/cli/health.d.ts +56 -0
  57. package/dist/cli/health.js +407 -0
  58. package/dist/cli/health.js.map +1 -0
  59. package/dist/cli/help.d.ts +51 -0
  60. package/dist/cli/help.js +436 -0
  61. package/dist/cli/help.js.map +1 -0
  62. package/dist/cli/inbox.d.ts +28 -0
  63. package/dist/cli/inbox.js +589 -0
  64. package/dist/cli/inbox.js.map +1 -0
  65. package/dist/cli/index.d.ts +41 -0
  66. package/dist/cli/index.js +1208 -0
  67. package/dist/cli/index.js.map +1 -0
  68. package/dist/cli/knowledge.d.ts +33 -0
  69. package/dist/cli/knowledge.js +575 -0
  70. package/dist/cli/knowledge.js.map +1 -0
  71. package/dist/cli/mcp.d.ts +26 -0
  72. package/dist/cli/mcp.js +487 -0
  73. package/dist/cli/mcp.js.map +1 -0
  74. package/dist/cli/models.d.ts +26 -0
  75. package/dist/cli/models.js +435 -0
  76. package/dist/cli/models.js.map +1 -0
  77. package/dist/cli/new.d.ts +32 -0
  78. package/dist/cli/new.js +565 -0
  79. package/dist/cli/new.js.map +1 -0
  80. package/dist/cli/notify.d.ts +20 -0
  81. package/dist/cli/notify.js +188 -0
  82. package/dist/cli/notify.js.map +1 -0
  83. package/dist/cli/onboard.d.ts +85 -0
  84. package/dist/cli/onboard.js +305 -0
  85. package/dist/cli/onboard.js.map +1 -0
  86. package/dist/cli/open.d.ts +38 -0
  87. package/dist/cli/open.js +86 -0
  88. package/dist/cli/open.js.map +1 -0
  89. package/dist/cli/orient.d.ts +14 -0
  90. package/dist/cli/orient.js +110 -0
  91. package/dist/cli/orient.js.map +1 -0
  92. package/dist/cli/picker.d.ts +21 -0
  93. package/dist/cli/picker.js +177 -0
  94. package/dist/cli/picker.js.map +1 -0
  95. package/dist/cli/plugins.d.ts +21 -0
  96. package/dist/cli/plugins.js +394 -0
  97. package/dist/cli/plugins.js.map +1 -0
  98. package/dist/cli/preflight.d.ts +29 -0
  99. package/dist/cli/preflight.js +131 -0
  100. package/dist/cli/preflight.js.map +1 -0
  101. package/dist/cli/pulse.d.ts +26 -0
  102. package/dist/cli/pulse.js +482 -0
  103. package/dist/cli/pulse.js.map +1 -0
  104. package/dist/cli/reflect.d.ts +42 -0
  105. package/dist/cli/reflect.js +381 -0
  106. package/dist/cli/reflect.js.map +1 -0
  107. package/dist/cli/run.d.ts +29 -0
  108. package/dist/cli/run.js +687 -0
  109. package/dist/cli/run.js.map +1 -0
  110. package/dist/cli/sandbox.d.ts +20 -0
  111. package/dist/cli/sandbox.js +345 -0
  112. package/dist/cli/sandbox.js.map +1 -0
  113. package/dist/cli/seams.d.ts +41 -0
  114. package/dist/cli/seams.js +167 -0
  115. package/dist/cli/seams.js.map +1 -0
  116. package/dist/cli/serve.d.ts +25 -0
  117. package/dist/cli/serve.js +249 -0
  118. package/dist/cli/serve.js.map +1 -0
  119. package/dist/cli/ship.d.ts +33 -0
  120. package/dist/cli/ship.js +433 -0
  121. package/dist/cli/ship.js.map +1 -0
  122. package/dist/cli/spec.d.ts +19 -0
  123. package/dist/cli/spec.js +478 -0
  124. package/dist/cli/spec.js.map +1 -0
  125. package/dist/cli/swarm.d.ts +42 -0
  126. package/dist/cli/swarm.js +1365 -0
  127. package/dist/cli/swarm.js.map +1 -0
  128. package/dist/cli/telemetry.d.ts +26 -0
  129. package/dist/cli/telemetry.js +364 -0
  130. package/dist/cli/telemetry.js.map +1 -0
  131. package/dist/cli/tui.d.ts +17 -0
  132. package/dist/cli/tui.js +52 -0
  133. package/dist/cli/tui.js.map +1 -0
  134. package/dist/cli/ui.d.ts +53 -0
  135. package/dist/cli/ui.js +66 -0
  136. package/dist/cli/ui.js.map +1 -0
  137. package/dist/cli/update.d.ts +38 -0
  138. package/dist/cli/update.js +682 -0
  139. package/dist/cli/update.js.map +1 -0
  140. package/dist/cli/vercel.d.ts +20 -0
  141. package/dist/cli/vercel.js +193 -0
  142. package/dist/cli/vercel.js.map +1 -0
  143. package/dist/cli/verify-safety.d.ts +96 -0
  144. package/dist/cli/verify-safety.js +509 -0
  145. package/dist/cli/verify-safety.js.map +1 -0
  146. package/dist/cli/wire.d.ts +22 -0
  147. package/dist/cli/wire.js +205 -0
  148. package/dist/cli/wire.js.map +1 -0
  149. package/dist/core/classify.d.ts +51 -0
  150. package/dist/core/classify.js +450 -0
  151. package/dist/core/classify.js.map +1 -0
  152. package/dist/core/config.d.ts +63 -0
  153. package/dist/core/config.js +474 -0
  154. package/dist/core/config.js.map +1 -0
  155. package/dist/core/daemon/loop.d.ts +74 -0
  156. package/dist/core/daemon/loop.js +618 -0
  157. package/dist/core/daemon/loop.js.map +1 -0
  158. package/dist/core/daemon/state.d.ts +66 -0
  159. package/dist/core/daemon/state.js +197 -0
  160. package/dist/core/daemon/state.js.map +1 -0
  161. package/dist/core/dashboard.d.ts +40 -0
  162. package/dist/core/dashboard.js +463 -0
  163. package/dist/core/dashboard.js.map +1 -0
  164. package/dist/core/digest/build.d.ts +51 -0
  165. package/dist/core/digest/build.js +230 -0
  166. package/dist/core/digest/build.js.map +1 -0
  167. package/dist/core/digest/deliver.d.ts +47 -0
  168. package/dist/core/digest/deliver.js +230 -0
  169. package/dist/core/digest/deliver.js.map +1 -0
  170. package/dist/core/digest/store.d.ts +57 -0
  171. package/dist/core/digest/store.js +223 -0
  172. package/dist/core/digest/store.js.map +1 -0
  173. package/dist/core/doctor-fix.d.ts +21 -0
  174. package/dist/core/doctor-fix.js +440 -0
  175. package/dist/core/doctor-fix.js.map +1 -0
  176. package/dist/core/doctor.d.ts +18 -0
  177. package/dist/core/doctor.js +806 -0
  178. package/dist/core/doctor.js.map +1 -0
  179. package/dist/core/env-bridge.d.ts +64 -0
  180. package/dist/core/env-bridge.js +103 -0
  181. package/dist/core/env-bridge.js.map +1 -0
  182. package/dist/core/genome/capture.d.ts +49 -0
  183. package/dist/core/genome/capture.js +352 -0
  184. package/dist/core/genome/capture.js.map +1 -0
  185. package/dist/core/genome/consolidate.d.ts +38 -0
  186. package/dist/core/genome/consolidate.js +426 -0
  187. package/dist/core/genome/consolidate.js.map +1 -0
  188. package/dist/core/genome/export.d.ts +29 -0
  189. package/dist/core/genome/export.js +102 -0
  190. package/dist/core/genome/export.js.map +1 -0
  191. package/dist/core/genome/playbook.d.ts +33 -0
  192. package/dist/core/genome/playbook.js +320 -0
  193. package/dist/core/genome/playbook.js.map +1 -0
  194. package/dist/core/genome/recall.d.ts +45 -0
  195. package/dist/core/genome/recall.js +293 -0
  196. package/dist/core/genome/recall.js.map +1 -0
  197. package/dist/core/genome/store.d.ts +62 -0
  198. package/dist/core/genome/store.js +711 -0
  199. package/dist/core/genome/store.js.map +1 -0
  200. package/dist/core/git.d.ts +34 -0
  201. package/dist/core/git.js +115 -0
  202. package/dist/core/git.js.map +1 -0
  203. package/dist/core/goals/advance.d.ts +82 -0
  204. package/dist/core/goals/advance.js +263 -0
  205. package/dist/core/goals/advance.js.map +1 -0
  206. package/dist/core/goals/planner.d.ts +58 -0
  207. package/dist/core/goals/planner.js +233 -0
  208. package/dist/core/goals/planner.js.map +1 -0
  209. package/dist/core/goals/store.d.ts +128 -0
  210. package/dist/core/goals/store.js +442 -0
  211. package/dist/core/goals/store.js.map +1 -0
  212. package/dist/core/inbox/apply.d.ts +36 -0
  213. package/dist/core/inbox/apply.js +407 -0
  214. package/dist/core/inbox/apply.js.map +1 -0
  215. package/dist/core/inbox/notify-proposal.d.ts +13 -0
  216. package/dist/core/inbox/notify-proposal.js +21 -0
  217. package/dist/core/inbox/notify-proposal.js.map +1 -0
  218. package/dist/core/inbox/store.d.ts +67 -0
  219. package/dist/core/inbox/store.js +258 -0
  220. package/dist/core/inbox/store.js.map +1 -0
  221. package/dist/core/index-engine.d.ts +62 -0
  222. package/dist/core/index-engine.js +486 -0
  223. package/dist/core/index-engine.js.map +1 -0
  224. package/dist/core/integrations/desktop-notify.d.ts +18 -0
  225. package/dist/core/integrations/desktop-notify.js +42 -0
  226. package/dist/core/integrations/desktop-notify.js.map +1 -0
  227. package/dist/core/integrations/editors.d.ts +50 -0
  228. package/dist/core/integrations/editors.js +216 -0
  229. package/dist/core/integrations/editors.js.map +1 -0
  230. package/dist/core/integrations/github.d.ts +66 -0
  231. package/dist/core/integrations/github.js +332 -0
  232. package/dist/core/integrations/github.js.map +1 -0
  233. package/dist/core/integrations/identity.d.ts +29 -0
  234. package/dist/core/integrations/identity.js +359 -0
  235. package/dist/core/integrations/identity.js.map +1 -0
  236. package/dist/core/integrations/notify.d.ts +23 -0
  237. package/dist/core/integrations/notify.js +96 -0
  238. package/dist/core/integrations/notify.js.map +1 -0
  239. package/dist/core/integrations/vercel.d.ts +37 -0
  240. package/dist/core/integrations/vercel.js +192 -0
  241. package/dist/core/integrations/vercel.js.map +1 -0
  242. package/dist/core/knowledge/ask.d.ts +34 -0
  243. package/dist/core/knowledge/ask.js +325 -0
  244. package/dist/core/knowledge/ask.js.map +1 -0
  245. package/dist/core/knowledge/graph.d.ts +51 -0
  246. package/dist/core/knowledge/graph.js +564 -0
  247. package/dist/core/knowledge/graph.js.map +1 -0
  248. package/dist/core/knowledge/index.d.ts +74 -0
  249. package/dist/core/knowledge/index.js +586 -0
  250. package/dist/core/knowledge/index.js.map +1 -0
  251. package/dist/core/learn/playbooks.d.ts +84 -0
  252. package/dist/core/learn/playbooks.js +241 -0
  253. package/dist/core/learn/playbooks.js.map +1 -0
  254. package/dist/core/learn/reflect.d.ts +87 -0
  255. package/dist/core/learn/reflect.js +435 -0
  256. package/dist/core/learn/reflect.js.map +1 -0
  257. package/dist/core/learn/store.d.ts +51 -0
  258. package/dist/core/learn/store.js +165 -0
  259. package/dist/core/learn/store.js.map +1 -0
  260. package/dist/core/learn/tuning.d.ts +48 -0
  261. package/dist/core/learn/tuning.js +201 -0
  262. package/dist/core/learn/tuning.js.map +1 -0
  263. package/dist/core/lifecycle/scaffold.d.ts +43 -0
  264. package/dist/core/lifecycle/scaffold.js +260 -0
  265. package/dist/core/lifecycle/scaffold.js.map +1 -0
  266. package/dist/core/lifecycle/ship.d.ts +48 -0
  267. package/dist/core/lifecycle/ship.js +513 -0
  268. package/dist/core/lifecycle/ship.js.map +1 -0
  269. package/dist/core/lifecycle/templates.d.ts +20 -0
  270. package/dist/core/lifecycle/templates.js +605 -0
  271. package/dist/core/lifecycle/templates.js.map +1 -0
  272. package/dist/core/mcp-gateway.d.ts +59 -0
  273. package/dist/core/mcp-gateway.js +385 -0
  274. package/dist/core/mcp-gateway.js.map +1 -0
  275. package/dist/core/mcp-native.d.ts +53 -0
  276. package/dist/core/mcp-native.js +507 -0
  277. package/dist/core/mcp-native.js.map +1 -0
  278. package/dist/core/mcp-registry.d.ts +36 -0
  279. package/dist/core/mcp-registry.js +180 -0
  280. package/dist/core/mcp-registry.js.map +1 -0
  281. package/dist/core/observability/budget-alert.d.ts +18 -0
  282. package/dist/core/observability/budget-alert.js +90 -0
  283. package/dist/core/observability/budget-alert.js.map +1 -0
  284. package/dist/core/observability/estimate.d.ts +27 -0
  285. package/dist/core/observability/estimate.js +188 -0
  286. package/dist/core/observability/estimate.js.map +1 -0
  287. package/dist/core/observability/forecast.d.ts +19 -0
  288. package/dist/core/observability/forecast.js +101 -0
  289. package/dist/core/observability/forecast.js.map +1 -0
  290. package/dist/core/observability/governance.d.ts +28 -0
  291. package/dist/core/observability/governance.js +101 -0
  292. package/dist/core/observability/governance.js.map +1 -0
  293. package/dist/core/observability/otlp.d.ts +88 -0
  294. package/dist/core/observability/otlp.js +217 -0
  295. package/dist/core/observability/otlp.js.map +1 -0
  296. package/dist/core/observability/rollup.d.ts +35 -0
  297. package/dist/core/observability/rollup.js +311 -0
  298. package/dist/core/observability/rollup.js.map +1 -0
  299. package/dist/core/observability/telemetry-sink.d.ts +63 -0
  300. package/dist/core/observability/telemetry-sink.js +350 -0
  301. package/dist/core/observability/telemetry-sink.js.map +1 -0
  302. package/dist/core/observability/usage-source.d.ts +60 -0
  303. package/dist/core/observability/usage-source.js +347 -0
  304. package/dist/core/observability/usage-source.js.map +1 -0
  305. package/dist/core/onboard.d.ts +27 -0
  306. package/dist/core/onboard.js +288 -0
  307. package/dist/core/onboard.js.map +1 -0
  308. package/dist/core/orient.d.ts +23 -0
  309. package/dist/core/orient.js +135 -0
  310. package/dist/core/orient.js.map +1 -0
  311. package/dist/core/phantom.d.ts +23 -0
  312. package/dist/core/phantom.js +279 -0
  313. package/dist/core/phantom.js.map +1 -0
  314. package/dist/core/plugins/host-api.d.ts +29 -0
  315. package/dist/core/plugins/host-api.js +113 -0
  316. package/dist/core/plugins/host-api.js.map +1 -0
  317. package/dist/core/plugins/integrity.d.ts +36 -0
  318. package/dist/core/plugins/integrity.js +73 -0
  319. package/dist/core/plugins/integrity.js.map +1 -0
  320. package/dist/core/plugins/manifest.d.ts +31 -0
  321. package/dist/core/plugins/manifest.js +316 -0
  322. package/dist/core/plugins/manifest.js.map +1 -0
  323. package/dist/core/plugins/registry.d.ts +87 -0
  324. package/dist/core/plugins/registry.js +415 -0
  325. package/dist/core/plugins/registry.js.map +1 -0
  326. package/dist/core/plugins/types.d.ts +182 -0
  327. package/dist/core/plugins/types.js +40 -0
  328. package/dist/core/plugins/types.js.map +1 -0
  329. package/dist/core/plugins/wrappers.d.ts +40 -0
  330. package/dist/core/plugins/wrappers.js +229 -0
  331. package/dist/core/plugins/wrappers.js.map +1 -0
  332. package/dist/core/portfolio/backlog.d.ts +40 -0
  333. package/dist/core/portfolio/backlog.js +177 -0
  334. package/dist/core/portfolio/backlog.js.map +1 -0
  335. package/dist/core/portfolio/scanners.d.ts +21 -0
  336. package/dist/core/portfolio/scanners.js +600 -0
  337. package/dist/core/portfolio/scanners.js.map +1 -0
  338. package/dist/core/providers.d.ts +34 -0
  339. package/dist/core/providers.js +250 -0
  340. package/dist/core/providers.js.map +1 -0
  341. package/dist/core/quality/conventions.d.ts +35 -0
  342. package/dist/core/quality/conventions.js +267 -0
  343. package/dist/core/quality/conventions.js.map +1 -0
  344. package/dist/core/quality/fixes.d.ts +56 -0
  345. package/dist/core/quality/fixes.js +209 -0
  346. package/dist/core/quality/fixes.js.map +1 -0
  347. package/dist/core/quality/health.d.ts +69 -0
  348. package/dist/core/quality/health.js +350 -0
  349. package/dist/core/quality/health.js.map +1 -0
  350. package/dist/core/quality/store.d.ts +56 -0
  351. package/dist/core/quality/store.js +195 -0
  352. package/dist/core/quality/store.js.map +1 -0
  353. package/dist/core/readiness.d.ts +112 -0
  354. package/dist/core/readiness.js +431 -0
  355. package/dist/core/readiness.js.map +1 -0
  356. package/dist/core/run/agent-loop.d.ts +40 -0
  357. package/dist/core/run/agent-loop.js +291 -0
  358. package/dist/core/run/agent-loop.js.map +1 -0
  359. package/dist/core/run/budget.d.ts +47 -0
  360. package/dist/core/run/budget.js +113 -0
  361. package/dist/core/run/budget.js.map +1 -0
  362. package/dist/core/run/engines.d.ts +75 -0
  363. package/dist/core/run/engines.js +199 -0
  364. package/dist/core/run/engines.js.map +1 -0
  365. package/dist/core/run/model-manager.d.ts +64 -0
  366. package/dist/core/run/model-manager.js +339 -0
  367. package/dist/core/run/model-manager.js.map +1 -0
  368. package/dist/core/run/orchestrator.d.ts +100 -0
  369. package/dist/core/run/orchestrator.js +1515 -0
  370. package/dist/core/run/orchestrator.js.map +1 -0
  371. package/dist/core/run/provider-client.d.ts +46 -0
  372. package/dist/core/run/provider-client.js +796 -0
  373. package/dist/core/run/provider-client.js.map +1 -0
  374. package/dist/core/run/retry.d.ts +19 -0
  375. package/dist/core/run/retry.js +68 -0
  376. package/dist/core/run/retry.js.map +1 -0
  377. package/dist/core/run/router.d.ts +50 -0
  378. package/dist/core/run/router.js +257 -0
  379. package/dist/core/run/router.js.map +1 -0
  380. package/dist/core/run/self-heal.d.ts +52 -0
  381. package/dist/core/run/self-heal.js +181 -0
  382. package/dist/core/run/self-heal.js.map +1 -0
  383. package/dist/core/run/streaming.d.ts +31 -0
  384. package/dist/core/run/streaming.js +122 -0
  385. package/dist/core/run/streaming.js.map +1 -0
  386. package/dist/core/run/verify.d.ts +30 -0
  387. package/dist/core/run/verify.js +204 -0
  388. package/dist/core/run/verify.js.map +1 -0
  389. package/dist/core/sandbox/audit.d.ts +31 -0
  390. package/dist/core/sandbox/audit.js +169 -0
  391. package/dist/core/sandbox/audit.js.map +1 -0
  392. package/dist/core/sandbox/policy.d.ts +61 -0
  393. package/dist/core/sandbox/policy.js +211 -0
  394. package/dist/core/sandbox/policy.js.map +1 -0
  395. package/dist/core/sandbox/worktree.d.ts +175 -0
  396. package/dist/core/sandbox/worktree.js +673 -0
  397. package/dist/core/sandbox/worktree.js.map +1 -0
  398. package/dist/core/seams/backlog.d.ts +47 -0
  399. package/dist/core/seams/backlog.js +47 -0
  400. package/dist/core/seams/backlog.js.map +1 -0
  401. package/dist/core/seams/daemon-coordinator.d.ts +72 -0
  402. package/dist/core/seams/daemon-coordinator.js +76 -0
  403. package/dist/core/seams/daemon-coordinator.js.map +1 -0
  404. package/dist/core/seams/genome.d.ts +45 -0
  405. package/dist/core/seams/genome.js +53 -0
  406. package/dist/core/seams/genome.js.map +1 -0
  407. package/dist/core/seams/identity.d.ts +40 -0
  408. package/dist/core/seams/identity.js +44 -0
  409. package/dist/core/seams/identity.js.map +1 -0
  410. package/dist/core/seams/inbox.d.ts +60 -0
  411. package/dist/core/seams/inbox.js +66 -0
  412. package/dist/core/seams/inbox.js.map +1 -0
  413. package/dist/core/seams/index.d.ts +20 -0
  414. package/dist/core/seams/index.js +21 -0
  415. package/dist/core/seams/index.js.map +1 -0
  416. package/dist/core/seams/portfolio.d.ts +50 -0
  417. package/dist/core/seams/portfolio.js +61 -0
  418. package/dist/core/seams/portfolio.js.map +1 -0
  419. package/dist/core/seams/registry.d.ts +42 -0
  420. package/dist/core/seams/registry.js +128 -0
  421. package/dist/core/seams/registry.js.map +1 -0
  422. package/dist/core/seams/run-swarm.d.ts +66 -0
  423. package/dist/core/seams/run-swarm.js +74 -0
  424. package/dist/core/seams/run-swarm.js.map +1 -0
  425. package/dist/core/seams/types.d.ts +123 -0
  426. package/dist/core/seams/types.js +35 -0
  427. package/dist/core/seams/types.js.map +1 -0
  428. package/dist/core/spec/spec-store.d.ts +62 -0
  429. package/dist/core/spec/spec-store.js +359 -0
  430. package/dist/core/spec/spec-store.js.map +1 -0
  431. package/dist/core/swarm/gate.d.ts +45 -0
  432. package/dist/core/swarm/gate.js +114 -0
  433. package/dist/core/swarm/gate.js.map +1 -0
  434. package/dist/core/swarm/planner.d.ts +32 -0
  435. package/dist/core/swarm/planner.js +293 -0
  436. package/dist/core/swarm/planner.js.map +1 -0
  437. package/dist/core/swarm/rollback.d.ts +56 -0
  438. package/dist/core/swarm/rollback.js +266 -0
  439. package/dist/core/swarm/rollback.js.map +1 -0
  440. package/dist/core/swarm/runner.d.ts +62 -0
  441. package/dist/core/swarm/runner.js +1263 -0
  442. package/dist/core/swarm/runner.js.map +1 -0
  443. package/dist/core/swarm/sign.d.ts +71 -0
  444. package/dist/core/swarm/sign.js +362 -0
  445. package/dist/core/swarm/sign.js.map +1 -0
  446. package/dist/core/swarm/store.d.ts +52 -0
  447. package/dist/core/swarm/store.js +195 -0
  448. package/dist/core/swarm/store.js.map +1 -0
  449. package/dist/core/tidy.d.ts +32 -0
  450. package/dist/core/tidy.js +354 -0
  451. package/dist/core/tidy.js.map +1 -0
  452. package/dist/core/tools-registry.d.ts +16 -0
  453. package/dist/core/tools-registry.js +308 -0
  454. package/dist/core/tools-registry.js.map +1 -0
  455. package/dist/core/types.d.ts +2545 -0
  456. package/dist/core/types.js +9 -0
  457. package/dist/core/types.js.map +1 -0
  458. package/dist/core/web/api.d.ts +53 -0
  459. package/dist/core/web/api.js +698 -0
  460. package/dist/core/web/api.js.map +1 -0
  461. package/dist/core/web/public/app.js +1906 -0
  462. package/dist/core/web/public/index.html +721 -0
  463. package/dist/core/web/public/styles.css +2007 -0
  464. package/dist/core/web/server.d.ts +18 -0
  465. package/dist/core/web/server.js +122 -0
  466. package/dist/core/web/server.js.map +1 -0
  467. package/dist/core/web/static.d.ts +18 -0
  468. package/dist/core/web/static.js +122 -0
  469. package/dist/core/web/static.js.map +1 -0
  470. package/dist/tui/app.d.ts +33 -0
  471. package/dist/tui/app.js +350 -0
  472. package/dist/tui/app.js.map +1 -0
  473. package/dist/tui/render.d.ts +20 -0
  474. package/dist/tui/render.js +558 -0
  475. package/dist/tui/render.js.map +1 -0
  476. package/package.json +80 -0
  477. package/schema/config.schema.json +223 -0
@@ -0,0 +1,442 @@
1
+ /**
2
+ * store.ts — M28: Goal record persistence for `ashlr goals`.
3
+ *
4
+ * Persists one Goal per file at ~/.ashlr/goals/<id>.json (atomic write-then-
5
+ * rename), mirroring the learn/quality/inbox store pattern.
6
+ *
7
+ * GUARDRAILS (paramount — see docs/contracts/CONTRACT-M28.md):
8
+ * - PURE PERSISTENCE / READ-MOSTLY: this module NEVER runs a swarm, NEVER
9
+ * authors a spec, NEVER touches a user repo working tree, NEVER emits an
10
+ * outward action (no applyProposal, no setStatus(approved), no git push, no
11
+ * createPr, no deploy). It only reads/writes JSON under ~/.ashlr/goals/.
12
+ * - LOCAL-FIRST: writes ONLY under ~/.ashlr/goals/. Zero network.
13
+ * - Atomic write: <id>.json.tmp then rename (POSIX-atomic).
14
+ * - Never throws on read paths: list/load swallow errors and return safe
15
+ * defaults ([] / null) so callers remain unblocked.
16
+ * - No secrets stored: Goal/Milestone carry metadata + ids only.
17
+ * - No new runtime deps; node builtins only.
18
+ */
19
+ import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, unlinkSync, writeFileSync, } from 'node:fs';
20
+ import { createHash } from 'node:crypto';
21
+ import { join } from 'node:path';
22
+ import { goalsDir } from '../config.js';
23
+ // Re-export so existing importers of `goalsDir` from the store keep working;
24
+ // the canonical definition now lives in config.ts (single source of truth for
25
+ // the ~/.ashlr root). Re-resolved from homedir() at call time so tests that
26
+ // relocate HOME still work.
27
+ export { goalsDir };
28
+ // ---------------------------------------------------------------------------
29
+ // Bounded list cap — never read more than this many goal files at once.
30
+ // ---------------------------------------------------------------------------
31
+ const MAX_LIST = 200;
32
+ // ---------------------------------------------------------------------------
33
+ // Injectable clock (test determinism)
34
+ // ---------------------------------------------------------------------------
35
+ //
36
+ // All timestamp stamping flows through nowIso(). Tests pass an explicit `now`
37
+ // (ISO string) so metric/test paths are fully deterministic — there is NO
38
+ // hidden nondeterminism in a stamped record.
39
+ /** Current ISO timestamp, or the explicit override when provided (test seam). */
40
+ function nowIso(now) {
41
+ return now ?? new Date().toISOString();
42
+ }
43
+ // ---------------------------------------------------------------------------
44
+ // Path helpers (re-resolved at call time so tests can relocate HOME)
45
+ // ---------------------------------------------------------------------------
46
+ /**
47
+ * Absolute path to a specific goal file. Validates the id charset (mirrors the
48
+ * swarm store) so the store is self-defending against path traversal
49
+ * regardless of how a caller derived the id. Allowed: word chars, dot, hyphen.
50
+ *
51
+ * @throws when `id` contains anything outside [\w.-].
52
+ */
53
+ function goalPath(dir, id) {
54
+ if (!/^[\w.-]+$/.test(id))
55
+ throw new Error(`Invalid goal id: ${id}`);
56
+ return join(dir, `${id}.json`);
57
+ }
58
+ /** Ensure the goals directory exists, silently creating it if needed. */
59
+ function ensureDir(dir) {
60
+ try {
61
+ if (!existsSync(dir))
62
+ mkdirSync(dir, { recursive: true });
63
+ }
64
+ catch {
65
+ /* best-effort */
66
+ }
67
+ }
68
+ // ---------------------------------------------------------------------------
69
+ // ID generation
70
+ // ---------------------------------------------------------------------------
71
+ /**
72
+ * Derive a stable slug from text: lowercase, words joined with hyphens, max 48
73
+ * chars, alphanumeric + hyphens only (mirrors spec-store's slugify).
74
+ */
75
+ function slugify(text) {
76
+ return text
77
+ .toLowerCase()
78
+ .replace(/[^a-z0-9\s-]/g, '')
79
+ .trim()
80
+ .replace(/\s+/g, '-')
81
+ .replace(/-+/g, '-')
82
+ .slice(0, 48)
83
+ .replace(/-$/, '');
84
+ }
85
+ /**
86
+ * Generate a stable, readable, filename-safe goal id derived from the
87
+ * objective (slug + short hash), mirroring spec-store's generateSpecId so two
88
+ * similar objectives don't silently collide.
89
+ */
90
+ function generateGoalId(objective) {
91
+ const slug = slugify(objective) || 'goal';
92
+ const hash = createHash('sha256').update(objective).digest('hex').slice(0, 6);
93
+ return `${slug}-${hash}`;
94
+ }
95
+ /** Generate a stable milestone id unique within its goal (e.g. `${goalId}-m<order>`). */
96
+ function generateMilestoneId(goalId, order) {
97
+ return `${goalId}-m${order}`;
98
+ }
99
+ // ---------------------------------------------------------------------------
100
+ // Structural validation
101
+ // ---------------------------------------------------------------------------
102
+ /** Light type-guard so we never return garbage from the store. */
103
+ function isValidGoal(parsed) {
104
+ if (typeof parsed !== 'object' || parsed === null)
105
+ return false;
106
+ const g = parsed;
107
+ return (typeof g['id'] === 'string' &&
108
+ typeof g['objective'] === 'string' &&
109
+ typeof g['status'] === 'string' &&
110
+ Array.isArray(g['milestones']));
111
+ }
112
+ // ---------------------------------------------------------------------------
113
+ // Status roll-up — derive a goal's status from its milestones.
114
+ // ---------------------------------------------------------------------------
115
+ /**
116
+ * Re-roll a goal's status from its milestones. Preserves an explicit human
117
+ * 'paused' / 'archived' (those are sticky human states the mutators set/clear
118
+ * directly). Otherwise: 'planning' when no milestones, 'done' when every
119
+ * non-skipped milestone is 'done', else 'active'.
120
+ */
121
+ function rollGoalStatus(goal) {
122
+ if (goal.status === 'paused' || goal.status === 'archived')
123
+ return goal.status;
124
+ if (goal.milestones.length === 0)
125
+ return 'planning';
126
+ const live = goal.milestones.filter((m) => m.status !== 'skipped');
127
+ if (live.length > 0 && live.every((m) => m.status === 'done'))
128
+ return 'done';
129
+ return 'active';
130
+ }
131
+ /** Sort milestones in place by ascending `order` (stable). */
132
+ function sortMilestones(goal) {
133
+ goal.milestones.sort((a, b) => a.order - b.order);
134
+ }
135
+ // ---------------------------------------------------------------------------
136
+ // CRUD — Goal records
137
+ // ---------------------------------------------------------------------------
138
+ /**
139
+ * Create a new Goal from an objective, persist it, and return it.
140
+ *
141
+ * Assigns a fresh id, status 'planning', empty milestones, and createdAt/
142
+ * updatedAt timestamps. `project` (when given) MUST already be a resolved,
143
+ * ENROLLED absolute repo path — enrollment is enforced by the CLI/advance
144
+ * path, NOT here; this is pure persistence.
145
+ *
146
+ * NEVER runs a swarm, authors a spec, or emits an outward action. Best-effort
147
+ * persistence (returns the in-memory Goal even if the write fails).
148
+ */
149
+ export function createGoal(objective, opts) {
150
+ const now = nowIso(opts?.now);
151
+ const goal = {
152
+ id: generateGoalId(objective),
153
+ objective,
154
+ project: opts?.project ?? null,
155
+ status: 'planning',
156
+ milestones: [],
157
+ createdAt: now,
158
+ updatedAt: now,
159
+ };
160
+ saveGoal(goal, { now });
161
+ return goal;
162
+ }
163
+ /**
164
+ * Load a single Goal by id. Returns null when absent, unreadable, or malformed.
165
+ * Read-only. Never throws.
166
+ */
167
+ export function loadGoal(id) {
168
+ try {
169
+ const file = goalPath(goalsDir(), id);
170
+ if (!existsSync(file))
171
+ return null;
172
+ const parsed = JSON.parse(readFileSync(file, 'utf8'));
173
+ if (!isValidGoal(parsed))
174
+ return null;
175
+ sortMilestones(parsed);
176
+ return parsed;
177
+ }
178
+ catch {
179
+ return null;
180
+ }
181
+ }
182
+ /**
183
+ * List all persisted Goals, most-recent first by updatedAt (bounded MAX_LIST).
184
+ * Skips .tmp sidecars and unreadable/corrupt files. Read-only. Never throws.
185
+ */
186
+ export function listGoals(filter) {
187
+ try {
188
+ const dir = goalsDir();
189
+ if (!existsSync(dir))
190
+ return [];
191
+ const files = readdirSync(dir)
192
+ .filter((f) => f.endsWith('.json') && !f.endsWith('.tmp'))
193
+ .slice(0, MAX_LIST);
194
+ const goals = [];
195
+ for (const f of files) {
196
+ try {
197
+ const parsed = JSON.parse(readFileSync(join(dir, f), 'utf8'));
198
+ if (isValidGoal(parsed)) {
199
+ sortMilestones(parsed);
200
+ goals.push(parsed);
201
+ }
202
+ }
203
+ catch {
204
+ /* skip corrupt file */
205
+ }
206
+ }
207
+ const filtered = filter?.status !== undefined ? goals.filter((g) => g.status === filter.status) : goals;
208
+ // Newest-first by updatedAt; tiebreak on id so same-ms records order stably.
209
+ filtered.sort((a, b) => {
210
+ if (a.updatedAt < b.updatedAt)
211
+ return 1;
212
+ if (a.updatedAt > b.updatedAt)
213
+ return -1;
214
+ if (a.id < b.id)
215
+ return 1;
216
+ if (a.id > b.id)
217
+ return -1;
218
+ return 0;
219
+ });
220
+ return filtered;
221
+ }
222
+ catch {
223
+ return [];
224
+ }
225
+ }
226
+ /**
227
+ * Persist a Goal record atomically (tmp-write + rename). Bumps updatedAt.
228
+ * Best-effort; never throws (mirrors the swarm/inbox stores).
229
+ */
230
+ export function saveGoal(goal, opts) {
231
+ try {
232
+ const dir = goalsDir();
233
+ ensureDir(dir);
234
+ goal.updatedAt = nowIso(opts?.now);
235
+ sortMilestones(goal);
236
+ const target = goalPath(dir, goal.id);
237
+ const tmp = `${target}.tmp`;
238
+ writeFileSync(tmp, JSON.stringify(goal, null, 2), 'utf8');
239
+ renameSync(tmp, target);
240
+ }
241
+ catch {
242
+ /* best-effort persistence */
243
+ }
244
+ }
245
+ /**
246
+ * Delete a Goal record by id. Idempotent — deleting an absent goal is a no-op.
247
+ * Pure FS under ~/.ashlr/goals; never touches a user repo. Never throws.
248
+ */
249
+ export function deleteGoal(id) {
250
+ try {
251
+ unlinkSync(goalPath(goalsDir(), id));
252
+ }
253
+ catch {
254
+ /* idempotent no-op */
255
+ }
256
+ }
257
+ // ---------------------------------------------------------------------------
258
+ // Milestone mutators — the human's STEERING controls.
259
+ //
260
+ // Each mutator loads the goal, mutates milestones IN MEMORY, re-sorts by order,
261
+ // re-rolls the goal status, and saveGoal()s. None of them runs a swarm or
262
+ // emits an outward action — they are pure local edits to the plan.
263
+ // ---------------------------------------------------------------------------
264
+ /**
265
+ * Append a new Milestone to a Goal (status 'pending', specId/swarmId/proposalId
266
+ * null) at the end of the current order. Returns the updated Goal, or null if
267
+ * the goal does not exist. Used by planner.decomposeGoal to materialize a plan.
268
+ */
269
+ export function addMilestone(goalId, milestone, opts) {
270
+ const goal = loadGoal(goalId);
271
+ if (!goal)
272
+ return null;
273
+ const now = nowIso(opts?.now);
274
+ const nextOrder = goal.milestones.length === 0
275
+ ? 0
276
+ : Math.max(...goal.milestones.map((m) => m.order)) + 1;
277
+ goal.milestones.push({
278
+ id: generateMilestoneId(goalId, nextOrder),
279
+ title: milestone.title,
280
+ detail: milestone.detail,
281
+ order: nextOrder,
282
+ status: 'pending',
283
+ specId: null,
284
+ swarmId: null,
285
+ proposalId: null,
286
+ createdAt: now,
287
+ updatedAt: now,
288
+ });
289
+ goal.status = rollGoalStatus(goal);
290
+ saveGoal(goal, { now });
291
+ return goal;
292
+ }
293
+ /**
294
+ * Set a milestone's status (and optionally link swarmId/proposalId/specId).
295
+ * This is the ONLY way the advance path records progress (pending ->
296
+ * in-progress -> proposed, or -> blocked). Returns the updated Goal, or null
297
+ * if not found.
298
+ *
299
+ * NOTE: this mutates the M28 Goal record ONLY — it NEVER calls inbox setStatus
300
+ * and NEVER approves/applies the linked proposal.
301
+ */
302
+ export function updateMilestoneStatus(goalId, milestoneId, status, link) {
303
+ const goal = loadGoal(goalId);
304
+ if (!goal)
305
+ return null;
306
+ const m = goal.milestones.find((x) => x.id === milestoneId);
307
+ if (!m)
308
+ return null;
309
+ const now = nowIso(link?.now);
310
+ m.status = status;
311
+ if (link) {
312
+ if (link.swarmId !== undefined)
313
+ m.swarmId = link.swarmId;
314
+ if (link.proposalId !== undefined)
315
+ m.proposalId = link.proposalId;
316
+ if (link.specId !== undefined)
317
+ m.specId = link.specId;
318
+ }
319
+ m.updatedAt = now;
320
+ goal.status = rollGoalStatus(goal);
321
+ saveGoal(goal, { now });
322
+ return goal;
323
+ }
324
+ /**
325
+ * Clear ALL of a goal's milestones, returning it to a fresh, unplanned state
326
+ * (status re-rolled to 'planning'). Used by the CLI `goals plan --replace` to
327
+ * support an explicit, destructive re-plan WITHOUT duplicating the milestone
328
+ * set. Pure local edit under ~/.ashlr/goals — never runs a swarm, never touches
329
+ * a user repo, never approves/applies a proposal. Returns the updated Goal, or
330
+ * null if not found.
331
+ */
332
+ export function clearMilestones(goalId, opts) {
333
+ const goal = loadGoal(goalId);
334
+ if (!goal)
335
+ return null;
336
+ goal.milestones = [];
337
+ goal.status = rollGoalStatus(goal);
338
+ saveGoal(goal, { now: opts?.now });
339
+ return goal;
340
+ }
341
+ /**
342
+ * Reorder a goal's milestones to match the given id sequence (any ids omitted
343
+ * keep their relative order after the listed ones). Rewrites `order` keys and
344
+ * re-sorts. Returns the updated Goal, or null if not found.
345
+ */
346
+ export function reorderMilestones(goalId, orderedIds, opts) {
347
+ const goal = loadGoal(goalId);
348
+ if (!goal)
349
+ return null;
350
+ const rank = new Map();
351
+ orderedIds.forEach((id, i) => rank.set(id, i));
352
+ // Listed ids first (in the given order), then the rest in their current order.
353
+ const reordered = [...goal.milestones].sort((a, b) => {
354
+ const ra = rank.has(a.id) ? rank.get(a.id) : Number.MAX_SAFE_INTEGER;
355
+ const rb = rank.has(b.id) ? rank.get(b.id) : Number.MAX_SAFE_INTEGER;
356
+ if (ra !== rb)
357
+ return ra - rb;
358
+ return a.order - b.order;
359
+ });
360
+ reordered.forEach((m, i) => {
361
+ m.order = i;
362
+ });
363
+ goal.milestones = reordered;
364
+ saveGoal(goal, { now: opts?.now });
365
+ return goal;
366
+ }
367
+ /**
368
+ * Pause a single milestone (status 'paused') or, when milestoneId is omitted,
369
+ * pause the WHOLE goal (goal.status 'paused' — no milestone advances). A paused
370
+ * milestone is skipped by nextActionableMilestone(). Returns updated Goal/null.
371
+ */
372
+ export function pauseMilestone(goalId, milestoneId, opts) {
373
+ const goal = loadGoal(goalId);
374
+ if (!goal)
375
+ return null;
376
+ const now = nowIso(opts?.now);
377
+ if (milestoneId) {
378
+ const m = goal.milestones.find((x) => x.id === milestoneId);
379
+ if (!m)
380
+ return null;
381
+ m.status = 'paused';
382
+ m.updatedAt = now;
383
+ goal.status = rollGoalStatus(goal);
384
+ }
385
+ else {
386
+ goal.status = 'paused';
387
+ }
388
+ saveGoal(goal, { now });
389
+ return goal;
390
+ }
391
+ /**
392
+ * Resume a milestone back to 'pending' or, when milestoneId is omitted, resume
393
+ * the WHOLE goal (re-roll goal.status). A milestone is resumable when it is
394
+ * 'paused' (human steering) OR 'blocked' (a prior advance that threw / needs
395
+ * recovery) — both transition back to 'pending' so it can be re-advanced. This
396
+ * is the recovery path out of the 'blocked' state the advance error-handler
397
+ * sets. Returns updated Goal/null.
398
+ */
399
+ export function resumeMilestone(goalId, milestoneId, opts) {
400
+ const goal = loadGoal(goalId);
401
+ if (!goal)
402
+ return null;
403
+ const now = nowIso(opts?.now);
404
+ if (milestoneId) {
405
+ const m = goal.milestones.find((x) => x.id === milestoneId);
406
+ if (!m)
407
+ return null;
408
+ if (m.status === 'paused' || m.status === 'blocked') {
409
+ m.status = 'pending';
410
+ m.updatedAt = now;
411
+ }
412
+ if (goal.status !== 'archived')
413
+ goal.status = rollGoalStatus(goal);
414
+ }
415
+ else {
416
+ // Resume the whole goal: clear the sticky 'paused' so rollGoalStatus recomputes.
417
+ if (goal.status === 'paused')
418
+ goal.status = 'planning';
419
+ goal.status = rollGoalStatus(goal);
420
+ }
421
+ saveGoal(goal, { now });
422
+ return goal;
423
+ }
424
+ /**
425
+ * Skip a milestone permanently (status 'skipped'); it is excluded from progress
426
+ * denominators and never advanced. Returns updated Goal, or null if not found.
427
+ */
428
+ export function skipMilestone(goalId, milestoneId, opts) {
429
+ const goal = loadGoal(goalId);
430
+ if (!goal)
431
+ return null;
432
+ const m = goal.milestones.find((x) => x.id === milestoneId);
433
+ if (!m)
434
+ return null;
435
+ const now = nowIso(opts?.now);
436
+ m.status = 'skipped';
437
+ m.updatedAt = now;
438
+ goal.status = rollGoalStatus(goal);
439
+ saveGoal(goal, { now });
440
+ return goal;
441
+ }
442
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/core/goals/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,6EAA6E;AAC7E,8EAA8E;AAC9E,4EAA4E;AAC5E,4BAA4B;AAC5B,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAE9E,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,8EAA8E;AAC9E,sCAAsC;AACtC,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,6CAA6C;AAE7C,iFAAiF;AACjF,SAAS,MAAM,CAAC,GAAY;IAC1B,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACzC,CAAC;AAED,8EAA8E;AAC9E,qEAAqE;AACrE,8EAA8E;AAE9E;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,GAAW,EAAE,EAAU;IACvC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,GAAG,EAAE,G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,GAAG,GAAG,CAAC;QACpB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU;YAAE,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;SAAM,CAAC;QACN,iFAAiF;QACjF,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;YAAE,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IACD,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAc,EACd,WAAmB,EACnB,IAAuB;IAEvB,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAW,CAAC,CAAC;IAC5D,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC,CAAC,MAAM,GAAG,SAAS,CAAC;IACrB,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;IAClB,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * core/inbox/apply.ts — The ONLY outward mutation path in v2 (M23).
3
+ *
4
+ * applyProposal is the single funnel for every outward action. It is called
5
+ * ONLY from `cli/inbox.ts` after the user explicitly runs `inbox approve <id>`
6
+ * (with confirm or --yes). It is NEVER called automatically, never on create,
7
+ * never on list/show, never by the daemon.
8
+ *
9
+ * GUARDRAILS:
10
+ * - REFUSE unless proposal exists AND status==='approved' AND confirmed===true.
11
+ * - assertMayMutate(repo) before any mutation (enrollment + kill switch).
12
+ * - 'patch': apply diff on a NEW branch (ashlr/proposal/<id>) off HEAD.
13
+ * NEVER touch the user's current branch/index/working tree.
14
+ * NEVER force. NEVER push. Local only.
15
+ * - 'pr': branch + commit, then the gated M18 createPr.
16
+ * - 'deploy': gated ship path.
17
+ * - 'note': no-op record.
18
+ * - Every attempt is audited. Status set to 'applied'/'failed' + result.
19
+ * - Never throws out — all failures returned as ApplyResult.
20
+ * - No secrets in proposals/audit.
21
+ * - No new runtime deps; node builtins only.
22
+ */
23
+ import type { ApplyResult } from '../types.js';
24
+ /**
25
+ * Apply an approved proposal. This is the ONLY outward mutation path in v2.
26
+ *
27
+ * REFUSES (ok:false, mutates nothing) unless ALL hold:
28
+ * 1. Proposal exists (loadProposal !== null)
29
+ * 2. proposal.status === 'approved'
30
+ * 3. opts.confirmed === true
31
+ *
32
+ * Never throws — all failures returned as ApplyResult with status 'failed'.
33
+ */
34
+ export declare function applyProposal(id: string, opts: {
35
+ confirmed: boolean;
36
+ }): Promise<ApplyResult>;