@loompad/cli 0.1.0 → 1.1.2

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 (688) hide show
  1. package/ARCHITECTURE.md +96 -11
  2. package/CHANGELOG.md +1054 -0
  3. package/README.md +1473 -44
  4. package/THIRD_PARTY_NOTICES.md +275 -0
  5. package/dist/adapters/antigravity-cli.d.ts +62 -0
  6. package/dist/adapters/antigravity-cli.js +258 -0
  7. package/dist/adapters/antigravity-cli.js.map +1 -0
  8. package/dist/adapters/base.d.ts +61 -9
  9. package/dist/adapters/base.js +266 -15
  10. package/dist/adapters/base.js.map +1 -1
  11. package/dist/adapters/bridges/antigravity.d.ts +9 -12
  12. package/dist/adapters/bridges/antigravity.js +9 -12
  13. package/dist/adapters/bridges/antigravity.js.map +1 -1
  14. package/dist/adapters/echo.d.ts +1 -0
  15. package/dist/adapters/echo.js +59 -3
  16. package/dist/adapters/echo.js.map +1 -1
  17. package/dist/adapters/grok.d.ts +7 -0
  18. package/dist/adapters/grok.js +20 -10
  19. package/dist/adapters/grok.js.map +1 -1
  20. package/dist/adapters/index.d.ts +5 -1
  21. package/dist/adapters/index.js +53 -7
  22. package/dist/adapters/index.js.map +1 -1
  23. package/dist/adapters/model.d.ts +137 -0
  24. package/dist/adapters/model.js +527 -0
  25. package/dist/adapters/model.js.map +1 -0
  26. package/dist/adapters/opencode.d.ts +101 -1
  27. package/dist/adapters/opencode.js +874 -98
  28. package/dist/adapters/opencode.js.map +1 -1
  29. package/dist/cli/doctor.d.ts +32 -0
  30. package/dist/cli/doctor.js +89 -4
  31. package/dist/cli/doctor.js.map +1 -1
  32. package/dist/cli/index.js +2651 -87
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/tui-model.js +3 -1
  35. package/dist/cli/tui-model.js.map +1 -1
  36. package/dist/cli/tui.js +44 -1
  37. package/dist/cli/tui.js.map +1 -1
  38. package/dist/cli/ui.d.ts +2 -0
  39. package/dist/cli/ui.js +13 -0
  40. package/dist/cli/ui.js.map +1 -1
  41. package/dist/core/ades.d.ts +32 -16
  42. package/dist/core/ades.js +57 -20
  43. package/dist/core/ades.js.map +1 -1
  44. package/dist/core/agent-state.d.ts +14 -0
  45. package/dist/core/agent-state.js +32 -0
  46. package/dist/core/agent-state.js.map +1 -0
  47. package/dist/core/approvals.d.ts +33 -0
  48. package/dist/core/approvals.js +29 -0
  49. package/dist/core/approvals.js.map +1 -0
  50. package/dist/core/backup.d.ts +19 -0
  51. package/dist/core/backup.js +86 -0
  52. package/dist/core/backup.js.map +1 -0
  53. package/dist/core/baton.d.ts +2 -2
  54. package/dist/core/baton.js.map +1 -1
  55. package/dist/core/brain-extract.d.ts +17 -0
  56. package/dist/core/brain-extract.js +28 -2
  57. package/dist/core/brain-extract.js.map +1 -1
  58. package/dist/core/brain-index.d.ts +71 -0
  59. package/dist/core/brain-index.js +204 -5
  60. package/dist/core/brain-index.js.map +1 -1
  61. package/dist/core/brain.d.ts +58 -2
  62. package/dist/core/brain.js +79 -1
  63. package/dist/core/brain.js.map +1 -1
  64. package/dist/core/chat-import.d.ts +71 -0
  65. package/dist/core/chat-import.js +419 -0
  66. package/dist/core/chat-import.js.map +1 -0
  67. package/dist/core/checkpoint.d.ts +107 -0
  68. package/dist/core/checkpoint.js +259 -0
  69. package/dist/core/checkpoint.js.map +1 -0
  70. package/dist/core/claude-cli.js +1 -1
  71. package/dist/core/claude-cli.js.map +1 -1
  72. package/dist/core/continuity/artifacts.d.ts +14 -0
  73. package/dist/core/continuity/artifacts.js +118 -0
  74. package/dist/core/continuity/artifacts.js.map +1 -0
  75. package/dist/core/continuity/capabilities.d.ts +65 -0
  76. package/dist/core/continuity/capabilities.js +129 -0
  77. package/dist/core/continuity/capabilities.js.map +1 -0
  78. package/dist/core/continuity/contracts.d.ts +352 -0
  79. package/dist/core/continuity/contracts.js +117 -0
  80. package/dist/core/continuity/contracts.js.map +1 -0
  81. package/dist/core/continuity/engine.d.ts +55 -0
  82. package/dist/core/continuity/engine.js +504 -0
  83. package/dist/core/continuity/engine.js.map +1 -0
  84. package/dist/core/continuity/store.d.ts +73 -0
  85. package/dist/core/continuity/store.js +438 -0
  86. package/dist/core/continuity/store.js.map +1 -0
  87. package/dist/core/conversations.d.ts +19 -0
  88. package/dist/core/conversations.js +87 -0
  89. package/dist/core/conversations.js.map +1 -0
  90. package/dist/core/crew-coordination.d.ts +6 -0
  91. package/dist/core/crew-coordination.js +24 -0
  92. package/dist/core/crew-coordination.js.map +1 -0
  93. package/dist/core/crew-policy.d.ts +18 -0
  94. package/dist/core/crew-policy.js +40 -0
  95. package/dist/core/crew-policy.js.map +1 -0
  96. package/dist/core/crew-protocol.d.ts +64 -0
  97. package/dist/core/crew-protocol.js +146 -0
  98. package/dist/core/crew-protocol.js.map +1 -0
  99. package/dist/core/crew-requests.d.ts +14 -0
  100. package/dist/core/crew-requests.js +22 -0
  101. package/dist/core/crew-requests.js.map +1 -0
  102. package/dist/core/crew.d.ts +395 -0
  103. package/dist/core/crew.js +1857 -0
  104. package/dist/core/crew.js.map +1 -0
  105. package/dist/core/digest.d.ts +40 -0
  106. package/dist/core/digest.js +94 -0
  107. package/dist/core/digest.js.map +1 -0
  108. package/dist/core/distill.js +3 -5
  109. package/dist/core/distill.js.map +1 -1
  110. package/dist/core/eventlog.d.ts +27 -25
  111. package/dist/core/eventlog.js +97 -150
  112. package/dist/core/eventlog.js.map +1 -1
  113. package/dist/core/events/contracts.d.ts +51 -0
  114. package/dist/core/events/contracts.js +2 -0
  115. package/dist/core/events/contracts.js.map +1 -0
  116. package/dist/core/events/jsonl-store.d.ts +23 -0
  117. package/dist/core/events/jsonl-store.js +90 -0
  118. package/dist/core/events/jsonl-store.js.map +1 -0
  119. package/dist/core/events/sqlite-store.d.ts +37 -0
  120. package/dist/core/events/sqlite-store.js +215 -0
  121. package/dist/core/events/sqlite-store.js.map +1 -0
  122. package/dist/core/forecast.d.ts +44 -0
  123. package/dist/core/forecast.js +46 -0
  124. package/dist/core/forecast.js.map +1 -0
  125. package/dist/core/free-pool.d.ts +65 -0
  126. package/dist/core/free-pool.js +171 -0
  127. package/dist/core/free-pool.js.map +1 -0
  128. package/dist/core/git.d.ts +30 -0
  129. package/dist/core/git.js +50 -2
  130. package/dist/core/git.js.map +1 -1
  131. package/dist/core/github-events.d.ts +53 -0
  132. package/dist/core/github-events.js +227 -0
  133. package/dist/core/github-events.js.map +1 -0
  134. package/dist/core/goal-lanes.d.ts +53 -0
  135. package/dist/core/goal-lanes.js +99 -0
  136. package/dist/core/goal-lanes.js.map +1 -0
  137. package/dist/core/hosted.d.ts +27 -0
  138. package/dist/core/hosted.js +50 -0
  139. package/dist/core/hosted.js.map +1 -0
  140. package/dist/core/http-server.d.ts +5 -0
  141. package/dist/core/http-server.js +8 -0
  142. package/dist/core/http-server.js.map +1 -0
  143. package/dist/core/invite-link.d.ts +31 -0
  144. package/dist/core/invite-link.js +45 -0
  145. package/dist/core/invite-link.js.map +1 -0
  146. package/dist/core/loops.d.ts +37 -0
  147. package/dist/core/loops.js +81 -0
  148. package/dist/core/loops.js.map +1 -0
  149. package/dist/core/mcp-catalog.d.ts +182 -0
  150. package/dist/core/mcp-catalog.js +431 -0
  151. package/dist/core/mcp-catalog.js.map +1 -0
  152. package/dist/core/mcp.d.ts +87 -0
  153. package/dist/core/mcp.js +181 -0
  154. package/dist/core/mcp.js.map +1 -0
  155. package/dist/core/memory.d.ts +1 -0
  156. package/dist/core/memory.js +5 -2
  157. package/dist/core/memory.js.map +1 -1
  158. package/dist/core/model-tools.d.ts +97 -0
  159. package/dist/core/model-tools.js +388 -0
  160. package/dist/core/model-tools.js.map +1 -0
  161. package/dist/core/notify.js +19 -1
  162. package/dist/core/notify.js.map +1 -1
  163. package/dist/core/orchestra.d.ts +635 -0
  164. package/dist/core/orchestra.js +2120 -0
  165. package/dist/core/orchestra.js.map +1 -0
  166. package/dist/core/permissions.d.ts +56 -0
  167. package/dist/core/permissions.js +122 -0
  168. package/dist/core/permissions.js.map +1 -0
  169. package/dist/core/preview-proxy.d.ts +70 -0
  170. package/dist/core/preview-proxy.js +563 -0
  171. package/dist/core/preview-proxy.js.map +1 -0
  172. package/dist/core/preview-shot.d.ts +46 -0
  173. package/dist/core/preview-shot.js +109 -0
  174. package/dist/core/preview-shot.js.map +1 -0
  175. package/dist/core/process.d.ts +36 -0
  176. package/dist/core/process.js +168 -0
  177. package/dist/core/process.js.map +1 -0
  178. package/dist/core/prompt-queue.d.ts +136 -0
  179. package/dist/core/prompt-queue.js +269 -0
  180. package/dist/core/prompt-queue.js.map +1 -0
  181. package/dist/core/prompts.d.ts +53 -0
  182. package/dist/core/prompts.js +127 -0
  183. package/dist/core/prompts.js.map +1 -0
  184. package/dist/core/proof.d.ts +82 -0
  185. package/dist/core/proof.js +216 -0
  186. package/dist/core/proof.js.map +1 -0
  187. package/dist/core/provider-text.d.ts +23 -0
  188. package/dist/core/provider-text.js +66 -0
  189. package/dist/core/provider-text.js.map +1 -0
  190. package/dist/core/providers.d.ts +152 -0
  191. package/dist/core/providers.js +343 -0
  192. package/dist/core/providers.js.map +1 -0
  193. package/dist/core/quota.d.ts +33 -0
  194. package/dist/core/quota.js +74 -0
  195. package/dist/core/quota.js.map +1 -0
  196. package/dist/core/recipes.d.ts +50 -0
  197. package/dist/core/recipes.js +99 -0
  198. package/dist/core/recipes.js.map +1 -0
  199. package/dist/core/registry.d.ts +54 -0
  200. package/dist/core/registry.js +62 -5
  201. package/dist/core/registry.js.map +1 -1
  202. package/dist/core/relay-client.d.ts +67 -0
  203. package/dist/core/relay-client.js +184 -0
  204. package/dist/core/relay-client.js.map +1 -0
  205. package/dist/core/relay-protocol.d.ts +140 -0
  206. package/dist/core/relay-protocol.js +189 -0
  207. package/dist/core/relay-protocol.js.map +1 -0
  208. package/dist/core/replay.d.ts +18 -0
  209. package/dist/core/replay.js +191 -0
  210. package/dist/core/replay.js.map +1 -0
  211. package/dist/core/review-triage.d.ts +41 -0
  212. package/dist/core/review-triage.js +124 -0
  213. package/dist/core/review-triage.js.map +1 -0
  214. package/dist/core/router.js +2 -2
  215. package/dist/core/router.js.map +1 -1
  216. package/dist/core/routes.d.ts +39 -3
  217. package/dist/core/routes.js +137 -4
  218. package/dist/core/routes.js.map +1 -1
  219. package/dist/core/run-command.d.ts +14 -0
  220. package/dist/core/run-command.js +45 -0
  221. package/dist/core/run-command.js.map +1 -0
  222. package/dist/core/runner-setup.d.ts +36 -0
  223. package/dist/core/runner-setup.js +114 -0
  224. package/dist/core/runner-setup.js.map +1 -0
  225. package/dist/core/search.js +0 -0
  226. package/dist/core/search.js.map +1 -1
  227. package/dist/core/semantic.d.ts +92 -0
  228. package/dist/core/semantic.js +227 -0
  229. package/dist/core/semantic.js.map +1 -0
  230. package/dist/core/servers.d.ts +115 -0
  231. package/dist/core/servers.js +305 -0
  232. package/dist/core/servers.js.map +1 -0
  233. package/dist/core/setup.js +64 -6
  234. package/dist/core/setup.js.map +1 -1
  235. package/dist/core/shield.d.ts +17 -0
  236. package/dist/core/shield.js +81 -0
  237. package/dist/core/shield.js.map +1 -0
  238. package/dist/core/shift.d.ts +69 -0
  239. package/dist/core/shift.js +120 -0
  240. package/dist/core/shift.js.map +1 -0
  241. package/dist/core/skill-install.d.ts +125 -0
  242. package/dist/core/skill-install.js +328 -0
  243. package/dist/core/skill-install.js.map +1 -0
  244. package/dist/core/skills.d.ts +116 -0
  245. package/dist/core/skills.js +223 -0
  246. package/dist/core/skills.js.map +1 -0
  247. package/dist/core/step-conditions.d.ts +65 -0
  248. package/dist/core/step-conditions.js +102 -0
  249. package/dist/core/step-conditions.js.map +1 -0
  250. package/dist/core/subagents.d.ts +45 -0
  251. package/dist/core/subagents.js +90 -0
  252. package/dist/core/subagents.js.map +1 -0
  253. package/dist/core/team-canon.d.ts +42 -0
  254. package/dist/core/team-canon.js +121 -0
  255. package/dist/core/team-canon.js.map +1 -0
  256. package/dist/core/team-crypto.d.ts +97 -0
  257. package/dist/core/team-crypto.js +175 -0
  258. package/dist/core/team-crypto.js.map +1 -0
  259. package/dist/core/team-hub.d.ts +514 -0
  260. package/dist/core/team-hub.js +964 -0
  261. package/dist/core/team-hub.js.map +1 -0
  262. package/dist/core/team-landing.d.ts +239 -0
  263. package/dist/core/team-landing.js +504 -0
  264. package/dist/core/team-landing.js.map +1 -0
  265. package/dist/core/team-leases.d.ts +44 -0
  266. package/dist/core/team-leases.js +145 -0
  267. package/dist/core/team-leases.js.map +1 -0
  268. package/dist/core/team-memory.d.ts +42 -0
  269. package/dist/core/team-memory.js +84 -0
  270. package/dist/core/team-memory.js.map +1 -0
  271. package/dist/core/team-policy.d.ts +85 -0
  272. package/dist/core/team-policy.js +191 -0
  273. package/dist/core/team-policy.js.map +1 -0
  274. package/dist/core/thread-md.d.ts +6 -0
  275. package/dist/core/thread-md.js +42 -0
  276. package/dist/core/thread-md.js.map +1 -0
  277. package/dist/core/turn-stats.d.ts +61 -0
  278. package/dist/core/turn-stats.js +124 -0
  279. package/dist/core/turn-stats.js.map +1 -0
  280. package/dist/core/updater.d.ts +73 -0
  281. package/dist/core/updater.js +153 -0
  282. package/dist/core/updater.js.map +1 -0
  283. package/dist/core/usage.d.ts +75 -0
  284. package/dist/core/usage.js +163 -0
  285. package/dist/core/usage.js.map +1 -0
  286. package/dist/core/windows-jobs.d.ts +15 -0
  287. package/dist/core/windows-jobs.js +170 -0
  288. package/dist/core/windows-jobs.js.map +1 -0
  289. package/dist/core/worktree-merge.d.ts +57 -0
  290. package/dist/core/worktree-merge.js +123 -0
  291. package/dist/core/worktree-merge.js.map +1 -0
  292. package/dist/core/worktree.d.ts +5 -0
  293. package/dist/core/worktree.js +45 -5
  294. package/dist/core/worktree.js.map +1 -1
  295. package/dist/core/worktrees.d.ts +6 -0
  296. package/dist/core/worktrees.js +21 -0
  297. package/dist/core/worktrees.js.map +1 -0
  298. package/dist/daemon/app-page.d.ts +0 -17
  299. package/dist/daemon/app-page.js +10 -6346
  300. package/dist/daemon/app-page.js.map +1 -1
  301. package/dist/daemon/auth.d.ts +24 -3
  302. package/dist/daemon/auth.js +66 -7
  303. package/dist/daemon/auth.js.map +1 -1
  304. package/dist/daemon/board.d.ts +7 -0
  305. package/dist/daemon/board.js +12 -1
  306. package/dist/daemon/board.js.map +1 -1
  307. package/dist/daemon/brand-icons.d.ts +6 -1
  308. package/dist/daemon/brand-icons.js +11 -3
  309. package/dist/daemon/brand-icons.js.map +1 -1
  310. package/dist/daemon/client.d.ts +665 -1
  311. package/dist/daemon/client.js +381 -3
  312. package/dist/daemon/client.js.map +1 -1
  313. package/dist/daemon/delivery.d.ts +34 -0
  314. package/dist/daemon/delivery.js +63 -0
  315. package/dist/daemon/delivery.js.map +1 -0
  316. package/dist/daemon/deploys.d.ts +62 -0
  317. package/dist/daemon/deploys.js +159 -0
  318. package/dist/daemon/deploys.js.map +1 -0
  319. package/dist/daemon/landing.d.ts +192 -0
  320. package/dist/daemon/landing.js +992 -0
  321. package/dist/daemon/landing.js.map +1 -0
  322. package/dist/daemon/onboard.d.ts +150 -0
  323. package/dist/daemon/onboard.js +390 -0
  324. package/dist/daemon/onboard.js.map +1 -0
  325. package/dist/daemon/proof.d.ts +70 -0
  326. package/dist/daemon/proof.js +172 -0
  327. package/dist/daemon/proof.js.map +1 -0
  328. package/dist/daemon/push.d.ts +19 -1
  329. package/dist/daemon/push.js +90 -3
  330. package/dist/daemon/push.js.map +1 -1
  331. package/dist/daemon/relay.d.ts +82 -0
  332. package/dist/daemon/relay.js +351 -0
  333. package/dist/daemon/relay.js.map +1 -0
  334. package/dist/daemon/routes/agent-discovery.d.ts +4 -0
  335. package/dist/daemon/routes/agent-discovery.js +29 -0
  336. package/dist/daemon/routes/agent-discovery.js.map +1 -0
  337. package/dist/daemon/routes/agent-settings.d.ts +4 -0
  338. package/dist/daemon/routes/agent-settings.js +94 -0
  339. package/dist/daemon/routes/agent-settings.js.map +1 -0
  340. package/dist/daemon/routes/agents.d.ts +4 -0
  341. package/dist/daemon/routes/agents.js +105 -0
  342. package/dist/daemon/routes/agents.js.map +1 -0
  343. package/dist/daemon/routes/alerts.d.ts +4 -0
  344. package/dist/daemon/routes/alerts.js +137 -0
  345. package/dist/daemon/routes/alerts.js.map +1 -0
  346. package/dist/daemon/routes/approvals.d.ts +4 -0
  347. package/dist/daemon/routes/approvals.js +40 -0
  348. package/dist/daemon/routes/approvals.js.map +1 -0
  349. package/dist/daemon/routes/assets.d.ts +3 -0
  350. package/dist/daemon/routes/assets.js +64 -0
  351. package/dist/daemon/routes/assets.js.map +1 -0
  352. package/dist/daemon/routes/board.d.ts +4 -0
  353. package/dist/daemon/routes/board.js +147 -0
  354. package/dist/daemon/routes/board.js.map +1 -0
  355. package/dist/daemon/routes/brain.d.ts +4 -0
  356. package/dist/daemon/routes/brain.js +270 -0
  357. package/dist/daemon/routes/brain.js.map +1 -0
  358. package/dist/daemon/routes/chats.d.ts +4 -0
  359. package/dist/daemon/routes/chats.js +249 -0
  360. package/dist/daemon/routes/chats.js.map +1 -0
  361. package/dist/daemon/routes/clients.d.ts +4 -0
  362. package/dist/daemon/routes/clients.js +49 -0
  363. package/dist/daemon/routes/clients.js.map +1 -0
  364. package/dist/daemon/routes/cloud.d.ts +4 -0
  365. package/dist/daemon/routes/cloud.js +46 -0
  366. package/dist/daemon/routes/cloud.js.map +1 -0
  367. package/dist/daemon/routes/config.d.ts +4 -0
  368. package/dist/daemon/routes/config.js +35 -0
  369. package/dist/daemon/routes/config.js.map +1 -0
  370. package/dist/daemon/routes/context.d.ts +51 -0
  371. package/dist/daemon/routes/context.js +2 -0
  372. package/dist/daemon/routes/context.js.map +1 -0
  373. package/dist/daemon/routes/crews.d.ts +4 -0
  374. package/dist/daemon/routes/crews.js +149 -0
  375. package/dist/daemon/routes/crews.js.map +1 -0
  376. package/dist/daemon/routes/files.d.ts +3 -0
  377. package/dist/daemon/routes/files.js +253 -0
  378. package/dist/daemon/routes/files.js.map +1 -0
  379. package/dist/daemon/routes/git.d.ts +4 -0
  380. package/dist/daemon/routes/git.js +96 -0
  381. package/dist/daemon/routes/git.js.map +1 -0
  382. package/dist/daemon/routes/history.d.ts +4 -0
  383. package/dist/daemon/routes/history.js +101 -0
  384. package/dist/daemon/routes/history.js.map +1 -0
  385. package/dist/daemon/routes/integrations-project.d.ts +3 -0
  386. package/dist/daemon/routes/integrations-project.js +103 -0
  387. package/dist/daemon/routes/integrations-project.js.map +1 -0
  388. package/dist/daemon/routes/integrations.d.ts +3 -0
  389. package/dist/daemon/routes/integrations.js +111 -0
  390. package/dist/daemon/routes/integrations.js.map +1 -0
  391. package/dist/daemon/routes/logs.d.ts +3 -0
  392. package/dist/daemon/routes/logs.js +40 -0
  393. package/dist/daemon/routes/logs.js.map +1 -0
  394. package/dist/daemon/routes/messages.d.ts +4 -0
  395. package/dist/daemon/routes/messages.js +60 -0
  396. package/dist/daemon/routes/messages.js.map +1 -0
  397. package/dist/daemon/routes/observability.d.ts +4 -0
  398. package/dist/daemon/routes/observability.js +247 -0
  399. package/dist/daemon/routes/observability.js.map +1 -0
  400. package/dist/daemon/routes/onboard.d.ts +12 -0
  401. package/dist/daemon/routes/onboard.js +67 -0
  402. package/dist/daemon/routes/onboard.js.map +1 -0
  403. package/dist/daemon/routes/orchestra.d.ts +4 -0
  404. package/dist/daemon/routes/orchestra.js +110 -0
  405. package/dist/daemon/routes/orchestra.js.map +1 -0
  406. package/dist/daemon/routes/pairing.d.ts +4 -0
  407. package/dist/daemon/routes/pairing.js +155 -0
  408. package/dist/daemon/routes/pairing.js.map +1 -0
  409. package/dist/daemon/routes/preview.d.ts +24 -0
  410. package/dist/daemon/routes/preview.js +122 -0
  411. package/dist/daemon/routes/preview.js.map +1 -0
  412. package/dist/daemon/routes/project-actions.d.ts +4 -0
  413. package/dist/daemon/routes/project-actions.js +53 -0
  414. package/dist/daemon/routes/project-actions.js.map +1 -0
  415. package/dist/daemon/routes/project-team.d.ts +4 -0
  416. package/dist/daemon/routes/project-team.js +201 -0
  417. package/dist/daemon/routes/project-team.js.map +1 -0
  418. package/dist/daemon/routes/projects.d.ts +14 -0
  419. package/dist/daemon/routes/projects.js +138 -0
  420. package/dist/daemon/routes/projects.js.map +1 -0
  421. package/dist/daemon/routes/prompts.d.ts +4 -0
  422. package/dist/daemon/routes/prompts.js +44 -0
  423. package/dist/daemon/routes/prompts.js.map +1 -0
  424. package/dist/daemon/routes/proof.d.ts +4 -0
  425. package/dist/daemon/routes/proof.js +22 -0
  426. package/dist/daemon/routes/proof.js.map +1 -0
  427. package/dist/daemon/routes/providers.d.ts +3 -0
  428. package/dist/daemon/routes/providers.js +60 -0
  429. package/dist/daemon/routes/providers.js.map +1 -0
  430. package/dist/daemon/routes/public.d.ts +4 -0
  431. package/dist/daemon/routes/public.js +64 -0
  432. package/dist/daemon/routes/public.js.map +1 -0
  433. package/dist/daemon/routes/queue.d.ts +4 -0
  434. package/dist/daemon/routes/queue.js +140 -0
  435. package/dist/daemon/routes/queue.js.map +1 -0
  436. package/dist/daemon/routes/routing.d.ts +4 -0
  437. package/dist/daemon/routes/routing.js +61 -0
  438. package/dist/daemon/routes/routing.js.map +1 -0
  439. package/dist/daemon/routes/runtime-handler.d.ts +2 -0
  440. package/dist/daemon/routes/runtime-handler.js +63 -0
  441. package/dist/daemon/routes/runtime-handler.js.map +1 -0
  442. package/dist/daemon/routes/search.d.ts +4 -0
  443. package/dist/daemon/routes/search.js +17 -0
  444. package/dist/daemon/routes/search.js.map +1 -0
  445. package/dist/daemon/routes/servers.d.ts +4 -0
  446. package/dist/daemon/routes/servers.js +133 -0
  447. package/dist/daemon/routes/servers.js.map +1 -0
  448. package/dist/daemon/routes/setup.d.ts +3 -0
  449. package/dist/daemon/routes/setup.js +50 -0
  450. package/dist/daemon/routes/setup.js.map +1 -0
  451. package/dist/daemon/routes/shift.d.ts +4 -0
  452. package/dist/daemon/routes/shift.js +30 -0
  453. package/dist/daemon/routes/shift.js.map +1 -0
  454. package/dist/daemon/routes/specs.d.ts +4 -0
  455. package/dist/daemon/routes/specs.js +57 -0
  456. package/dist/daemon/routes/specs.js.map +1 -0
  457. package/dist/daemon/routes/task-delivery.d.ts +4 -0
  458. package/dist/daemon/routes/task-delivery.js +38 -0
  459. package/dist/daemon/routes/task-delivery.js.map +1 -0
  460. package/dist/daemon/routes/team.d.ts +4 -0
  461. package/dist/daemon/routes/team.js +193 -0
  462. package/dist/daemon/routes/team.js.map +1 -0
  463. package/dist/daemon/routes/terminals.d.ts +4 -0
  464. package/dist/daemon/routes/terminals.js +87 -0
  465. package/dist/daemon/routes/terminals.js.map +1 -0
  466. package/dist/daemon/routes/tools.d.ts +4 -0
  467. package/dist/daemon/routes/tools.js +180 -0
  468. package/dist/daemon/routes/tools.js.map +1 -0
  469. package/dist/daemon/routes/updates.d.ts +4 -0
  470. package/dist/daemon/routes/updates.js +89 -0
  471. package/dist/daemon/routes/updates.js.map +1 -0
  472. package/dist/daemon/routes/voice.d.ts +4 -0
  473. package/dist/daemon/routes/voice.js +53 -0
  474. package/dist/daemon/routes/voice.js.map +1 -0
  475. package/dist/daemon/runner.d.ts +186 -0
  476. package/dist/daemon/runner.js +612 -0
  477. package/dist/daemon/runner.js.map +1 -0
  478. package/dist/daemon/runtime/accounting.d.ts +130 -0
  479. package/dist/daemon/runtime/accounting.js +303 -0
  480. package/dist/daemon/runtime/accounting.js.map +1 -0
  481. package/dist/daemon/runtime/agents.d.ts +16 -0
  482. package/dist/daemon/runtime/agents.js +71 -0
  483. package/dist/daemon/runtime/agents.js.map +1 -0
  484. package/dist/daemon/runtime/briefings.d.ts +134 -0
  485. package/dist/daemon/runtime/briefings.js +329 -0
  486. package/dist/daemon/runtime/briefings.js.map +1 -0
  487. package/dist/daemon/runtime/native-usage.d.ts +21 -0
  488. package/dist/daemon/runtime/native-usage.js +71 -0
  489. package/dist/daemon/runtime/native-usage.js.map +1 -0
  490. package/dist/daemon/runtime/queue.d.ts +94 -0
  491. package/dist/daemon/runtime/queue.js +222 -0
  492. package/dist/daemon/runtime/queue.js.map +1 -0
  493. package/dist/daemon/runtime/relay.d.ts +93 -0
  494. package/dist/daemon/runtime/relay.js +240 -0
  495. package/dist/daemon/runtime/relay.js.map +1 -0
  496. package/dist/daemon/runtime/turns.d.ts +202 -0
  497. package/dist/daemon/runtime/turns.js +663 -0
  498. package/dist/daemon/runtime/turns.js.map +1 -0
  499. package/dist/daemon/runtime-support.d.ts +76 -0
  500. package/dist/daemon/runtime-support.js +134 -0
  501. package/dist/daemon/runtime-support.js.map +1 -0
  502. package/dist/daemon/runtime.d.ts +739 -70
  503. package/dist/daemon/runtime.js +2751 -470
  504. package/dist/daemon/runtime.js.map +1 -1
  505. package/dist/daemon/server.d.ts +82 -55
  506. package/dist/daemon/server.js +674 -1435
  507. package/dist/daemon/server.js.map +1 -1
  508. package/dist/daemon/shift.d.ts +70 -0
  509. package/dist/daemon/shift.js +170 -0
  510. package/dist/daemon/shift.js.map +1 -0
  511. package/dist/daemon/specs.d.ts +92 -0
  512. package/dist/daemon/specs.js +285 -0
  513. package/dist/daemon/specs.js.map +1 -0
  514. package/dist/daemon/system.d.ts +208 -0
  515. package/dist/daemon/system.js +557 -0
  516. package/dist/daemon/system.js.map +1 -0
  517. package/dist/daemon/tasks.js +1 -1
  518. package/dist/daemon/team-brain.d.ts +136 -0
  519. package/dist/daemon/team-brain.js +659 -0
  520. package/dist/daemon/team-brain.js.map +1 -0
  521. package/dist/daemon/team-coordinator.d.ts +78 -0
  522. package/dist/daemon/team-coordinator.js +408 -0
  523. package/dist/daemon/team-coordinator.js.map +1 -0
  524. package/dist/daemon/team.d.ts +339 -0
  525. package/dist/daemon/team.js +1433 -0
  526. package/dist/daemon/team.js.map +1 -0
  527. package/dist/daemon/terminals.d.ts +22 -3
  528. package/dist/daemon/terminals.js +236 -16
  529. package/dist/daemon/terminals.js.map +1 -1
  530. package/dist/hub/client.d.ts +120 -0
  531. package/dist/hub/client.js +228 -0
  532. package/dist/hub/client.js.map +1 -0
  533. package/dist/hub/server.d.ts +32 -0
  534. package/dist/hub/server.js +180 -0
  535. package/dist/hub/server.js.map +1 -0
  536. package/dist/hub/supabase-client.d.ts +220 -0
  537. package/dist/hub/supabase-client.js +843 -0
  538. package/dist/hub/supabase-client.js.map +1 -0
  539. package/dist/observability/ask.d.ts +91 -0
  540. package/dist/observability/ask.js +179 -0
  541. package/dist/observability/ask.js.map +1 -0
  542. package/dist/observability/clickhouse.d.ts +33 -0
  543. package/dist/observability/clickhouse.js +48 -0
  544. package/dist/observability/clickhouse.js.map +1 -0
  545. package/dist/observability/decisions.d.ts +176 -0
  546. package/dist/observability/decisions.js +377 -0
  547. package/dist/observability/decisions.js.map +1 -0
  548. package/dist/observability/index.d.ts +89 -0
  549. package/dist/observability/index.js +348 -0
  550. package/dist/observability/index.js.map +1 -0
  551. package/dist/observability/insights.d.ts +151 -0
  552. package/dist/observability/insights.js +319 -0
  553. package/dist/observability/insights.js.map +1 -0
  554. package/dist/observability/logs-query.d.ts +82 -0
  555. package/dist/observability/logs-query.js +102 -0
  556. package/dist/observability/logs-query.js.map +1 -0
  557. package/dist/observability/logs.d.ts +72 -0
  558. package/dist/observability/logs.js +295 -0
  559. package/dist/observability/logs.js.map +1 -0
  560. package/dist/observability/metrics.d.ts +86 -0
  561. package/dist/observability/metrics.js +303 -0
  562. package/dist/observability/metrics.js.map +1 -0
  563. package/dist/observability/otlp.d.ts +127 -0
  564. package/dist/observability/otlp.js +242 -0
  565. package/dist/observability/otlp.js.map +1 -0
  566. package/dist/observability/snapshots.d.ts +43 -0
  567. package/dist/observability/snapshots.js +129 -0
  568. package/dist/observability/snapshots.js.map +1 -0
  569. package/dist/observability/triage.d.ts +49 -0
  570. package/dist/observability/triage.js +284 -0
  571. package/dist/observability/triage.js.map +1 -0
  572. package/dist/providers/adapter.d.ts +50 -0
  573. package/dist/providers/adapter.js +38 -0
  574. package/dist/providers/adapter.js.map +1 -0
  575. package/dist/providers/agent.d.ts +110 -0
  576. package/dist/providers/agent.js +487 -0
  577. package/dist/providers/agent.js.map +1 -0
  578. package/dist/providers/approvals.d.ts +24 -0
  579. package/dist/providers/approvals.js +78 -0
  580. package/dist/providers/approvals.js.map +1 -0
  581. package/dist/providers/attachments.d.ts +20 -0
  582. package/dist/providers/attachments.js +51 -0
  583. package/dist/providers/attachments.js.map +1 -0
  584. package/dist/providers/claude/adapter.d.ts +99 -0
  585. package/dist/providers/claude/adapter.js +790 -0
  586. package/dist/providers/claude/adapter.js.map +1 -0
  587. package/dist/providers/codex/adapter.d.ts +113 -0
  588. package/dist/providers/codex/adapter.js +881 -0
  589. package/dist/providers/codex/adapter.js.map +1 -0
  590. package/dist/providers/codex/instructions.d.ts +11 -0
  591. package/dist/providers/codex/instructions.js +154 -0
  592. package/dist/providers/codex/instructions.js.map +1 -0
  593. package/dist/providers/codex/rpc.d.ts +36 -0
  594. package/dist/providers/codex/rpc.js +104 -0
  595. package/dist/providers/codex/rpc.js.map +1 -0
  596. package/dist/providers/contracts.d.ts +339 -0
  597. package/dist/providers/contracts.js +19 -0
  598. package/dist/providers/contracts.js.map +1 -0
  599. package/dist/providers/directory.d.ts +70 -0
  600. package/dist/providers/directory.js +95 -0
  601. package/dist/providers/directory.js.map +1 -0
  602. package/dist/providers/errors.d.ts +47 -0
  603. package/dist/providers/errors.js +24 -0
  604. package/dist/providers/errors.js.map +1 -0
  605. package/dist/providers/index.d.ts +18 -0
  606. package/dist/providers/index.js +19 -0
  607. package/dist/providers/index.js.map +1 -0
  608. package/dist/providers/ingestion.d.ts +80 -0
  609. package/dist/providers/ingestion.js +330 -0
  610. package/dist/providers/ingestion.js.map +1 -0
  611. package/dist/providers/live.d.ts +22 -0
  612. package/dist/providers/live.js +56 -0
  613. package/dist/providers/live.js.map +1 -0
  614. package/dist/providers/process.d.ts +29 -0
  615. package/dist/providers/process.js +71 -0
  616. package/dist/providers/process.js.map +1 -0
  617. package/dist/providers/reaper.d.ts +33 -0
  618. package/dist/providers/reaper.js +65 -0
  619. package/dist/providers/reaper.js.map +1 -0
  620. package/dist/providers/service.d.ts +87 -0
  621. package/dist/providers/service.js +256 -0
  622. package/dist/providers/service.js.map +1 -0
  623. package/dist/sdk.d.ts +1 -1
  624. package/dist/sdk.js +1 -1
  625. package/dist/sdk.js.map +1 -1
  626. package/dist/types.d.ts +385 -6
  627. package/dist/types.js +1 -0
  628. package/dist/types.js.map +1 -1
  629. package/dist/version.d.ts +7 -0
  630. package/dist/version.js +16 -0
  631. package/dist/version.js.map +1 -0
  632. package/dist/web/app.css +4646 -0
  633. package/dist/web/app.js +22640 -0
  634. package/dist/web/app.js.map +7 -0
  635. package/dist/web/shell.html +39 -0
  636. package/docs/README.md +21 -0
  637. package/docs/SETUP.md +10 -0
  638. package/docs/adapters.md +21 -8
  639. package/docs/brain-continuity.md +186 -0
  640. package/docs/cloud.md +108 -0
  641. package/docs/crews.md +62 -0
  642. package/docs/design-system.md +31 -2
  643. package/docs/integration-notes.md +128 -20
  644. package/docs/loompad.md +105 -0
  645. package/docs/observability.md +220 -0
  646. package/docs/play-store.md +123 -0
  647. package/docs/proposals/agent-teams.md +249 -0
  648. package/docs/proposals/brain-continuity-implementation.md +468 -0
  649. package/docs/proposals/brain-session-continuity.md +623 -0
  650. package/docs/proposals/t3code-port.md +81 -0
  651. package/docs/proposals/t3code-reference.md +95 -0
  652. package/docs/refactoring/AGENT-TEAMS-PROGRESS.md +88 -0
  653. package/docs/refactoring/BOUNDARIES.md +120 -0
  654. package/docs/refactoring/BRAIN-AUDIT.md +176 -0
  655. package/docs/refactoring/BRAIN-NOTES.md +390 -0
  656. package/docs/refactoring/BRAIN-TODO.md +214 -0
  657. package/docs/refactoring/NOTES.md +129 -0
  658. package/docs/refactoring/T3-PORT-NOTES.md +165 -0
  659. package/docs/refactoring/T3-PORT-TODO.md +123 -0
  660. package/docs/refactoring/TODO.md +46 -0
  661. package/docs/refactoring/brain-benchmark-2026-09-28.json +48 -0
  662. package/docs/refactoring/brain-benchmark-audit-2026-09-28.json +48 -0
  663. package/docs/release-notes/v0.2.0.md +35 -0
  664. package/docs/release-notes/v0.2.1.md +59 -0
  665. package/docs/release-notes/v0.2.3.md +77 -0
  666. package/docs/release-notes/v0.2.4.md +128 -0
  667. package/docs/release-notes/v0.2.5.md +153 -0
  668. package/docs/release-notes/v0.2.6.md +62 -0
  669. package/docs/release-notes/v1.0.0.md +120 -0
  670. package/docs/release-notes/v1.0.1.md +77 -0
  671. package/docs/release-notes/v1.1.0.md +71 -0
  672. package/docs/release-notes/v1.1.1.md +38 -0
  673. package/docs/release-notes/v1.1.2.md +21 -0
  674. package/docs/teams-architecture.md +697 -0
  675. package/docs/teams.md +171 -0
  676. package/docs/windows.md +85 -0
  677. package/package.json +22 -9
  678. package/dist/adapters/claude-code.d.ts +0 -26
  679. package/dist/adapters/claude-code.js +0 -209
  680. package/dist/adapters/claude-code.js.map +0 -1
  681. package/dist/adapters/codex.d.ts +0 -51
  682. package/dist/adapters/codex.js +0 -291
  683. package/dist/adapters/codex.js.map +0 -1
  684. package/docs/img/board-linear.png +0 -0
  685. package/docs/img/board-projects.png +0 -0
  686. package/docs/img/brain.png +0 -0
  687. package/docs/img/settings.png +0 -0
  688. package/docs/img/workspace.png +0 -0
@@ -1,40 +1,129 @@
1
- /**
2
- * ProjectRuntime — one live project inside the daemon: its event log, its
3
- * agents, and its baton. All mutations flow through here so the log stays
4
- * the single source of truth.
5
- */
6
- import type { AgentConfig, AnyAgent, ChatInfo, CostSummary, ProjectConfig, ProjectInfo, ProjectStatus, UnifiedMemory } from "../types.js";
7
- import type { RouteState, RouteStepSpec, RouterKind } from "../types.js";
8
1
  import { BatonManager } from "../core/baton.js";
2
+ import { type Hit, type RetrieveOpts } from "../core/brain-index.js";
9
3
  import { Brain } from "../core/brain.js";
4
+ import * as checkpoints from "../core/checkpoint.js";
10
5
  import { EventLog } from "../core/eventlog.js";
11
- import { RouteEngine } from "../core/routes.js";
6
+ import { NativeUsage } from "./runtime/native-usage.js";
7
+ import { OrchestraEngine, type OrchestraCoordinator } from "../core/orchestra.js";
8
+ import { CrewEngine } from "../core/crew.js";
9
+ import { type Loop } from "../core/loops.js";
10
+ import { QuotaRelay } from "./runtime/relay.js";
11
+ import { ProofRunner } from "./proof.js";
12
+ import { NightShift } from "./shift.js";
13
+ import { type PermissionMode } from "../core/permissions.js";
14
+ import { type PreviewProxy } from "../core/preview-proxy.js";
15
+ import { PromptQueue, type QueueCondition, type QueueInput, type QueueItem, type QueueState, type QueueTarget } from "../core/prompt-queue.js";
12
16
  import { type BoardTask } from "../core/registry.js";
17
+ import { RouteEngine } from "../core/routes.js";
18
+ import { Servers } from "../core/servers.js";
19
+ import { type SkillInstallResult } from "../core/skill-install.js";
20
+ import { type SkillCatalogEntry, type SkillManifest } from "../core/skills.js";
21
+ import { type TurnFacts } from "../core/step-conditions.js";
22
+ import { type TeamPolicy } from "../core/team-policy.js";
23
+ import { type MergeOutcome } from "../core/worktree-merge.js";
13
24
  import { type WorkingTree } from "../core/worktree.js";
25
+ import { type AgentDecision, type DecisionStats } from "../observability/decisions.js";
26
+ import type { AgentConfig, AnyAgent, ChatInfo, CostSummary, McpServerConfig, ProjectConfig, ProjectInfo, ProjectStatus, RouteState, RouteStepSpec, RouterKind, UnifiedMemory } from "../types.js";
27
+ import { type GitDelivery } from "../types.js";
28
+ import { ServerFrame, TeamBrainHook } from './runtime-support.js';
29
+ import { type TurnOptions, type TurnResult } from './runtime/turns.js';
30
+ import { ContinuityEngine } from "../core/continuity/engine.js";
31
+ import { HarnessMonitor } from "../core/continuity/capabilities.js";
32
+ import { type LiveFrame } from "../providers/live.js";
33
+ import { type AgentCheck } from "../adapters/base.js";
34
+ import type { LiveText } from "../types.js";
35
+ export { BudgetExceededError, CLOCK_TICK_MS, LOOM_ASK_TIMEOUT_MESSAGE, LOOM_ASK_TIMEOUT_MS, LoomAskTimeoutError, QuarantinedError, type ServerFrame, type TeamBrainHook, activityLine, planModeBriefing, relativeToProject, withLoomAskTimeout } from './runtime-support.js';
14
36
  export declare class ProjectRuntime {
37
+ private readonly accounting;
38
+ private readonly briefings;
39
+ private readonly queueCoordinator;
40
+ private readonly turns;
15
41
  readonly info: ProjectInfo;
16
42
  readonly config: ProjectConfig;
17
43
  readonly log: EventLog;
44
+ private readonly conversations;
18
45
  readonly baton: BatonManager;
19
46
  readonly routes: RouteEngine;
47
+ /** One orchestrator, many parallel workers — see core/orchestra.ts. */
48
+ readonly orchestra: OrchestraEngine;
49
+ /** Agent Teams: crews of agents with roles, one goal at a time (core/crew.ts). */
50
+ readonly crews: CrewEngine;
51
+ /** Loop watch: an agent stuck re-running the same failing command (core/loops.ts). */
52
+ private readonly loops;
53
+ /** agent × chat already nudged since a person last spoke there: a second loop is only reported. */
54
+ private readonly nudged;
55
+ /** agent × chat × command already flagged this turn by the shield. */
56
+ private readonly shielded;
57
+ /** Quota Relay: an agent out of quota mid-task hands its work to the next. */
58
+ readonly relay: QuotaRelay;
59
+ /** Proof: checks an agent's "done" against what ran and a clean re-run of the tests. */
60
+ readonly proofs: ProofRunner;
61
+ /** Night Shift: a line of tasks run while you're away, then one report (daemon/shift.ts). */
62
+ readonly shifts: NightShift;
63
+ /** Adapter kinds installed on this machine, probed once at open. */
64
+ private installedKinds;
20
65
  /** Memory as units — see core/brain.ts. Reads and writes through `log`. */
21
66
  readonly brain: Brain;
22
- private agents;
23
- private startedAgents;
67
+ continuity: ContinuityEngine | null;
68
+ /** Native harness reachability, polled while native continuity is on. */
69
+ readonly harnesses: HarnessMonitor;
70
+ /** Latest context and usage-limit readings from native harnesses. */
71
+ readonly nativeUsage: NativeUsage;
72
+ private readonly agentLifecycle;
73
+ private get agents();
24
74
  private configMtime;
25
- /**
26
- * Which conversation each agent's current turn belongs to. Set when a turn
27
- * starts and left in place afterwards — an agent's trailing events (a late
28
- * run_complete, a diff) still belong to the chat that prompted them.
29
- */
30
- private turnChat;
75
+ private journalFailure;
76
+ /** What you've lined up, run one at a time — see core/prompt-queue.ts. */
77
+ readonly queue: PromptQueue;
78
+ /** This project's dev servers — see core/servers.ts. */
79
+ readonly servers: Servers;
80
+ /** One preview proxy per server — see core/preview-proxy.ts. */
81
+ private proxies;
82
+ private serverListeners;
83
+ private streamListeners;
84
+ private liveListeners;
85
+ /** Streamed text and tool progress from provider agents, coalesced for clients. Not persisted. */
86
+ private readonly live;
31
87
  private constructor();
32
88
  static open(info: ProjectInfo): Promise<ProjectRuntime>;
33
- private costs;
34
- private costsByAgent;
35
89
  private rehydrateCosts;
36
90
  private trackCost;
37
91
  costSummary(): CostSummary;
92
+ budgets(): Record<string, number>;
93
+ setBudget(agentId: string, usdPerDay: number): Record<string, number>;
94
+ spendTodayFor(agentId: string, now?: number): number;
95
+ costSeries(days?: number, now?: number): Array<{
96
+ day: string;
97
+ usd: number;
98
+ turns: number;
99
+ tokensIn: number;
100
+ tokensOut: number;
101
+ byAgent: Record<string, {
102
+ usd: number;
103
+ turns: number;
104
+ tokensIn: number;
105
+ tokensOut: number;
106
+ }>;
107
+ }>;
108
+ budgetStatus(now?: number): Record<string, {
109
+ budgetUsd: number;
110
+ spentTodayUsd: number;
111
+ over: boolean;
112
+ }>;
113
+ private enforceQuarantine;
114
+ private enforceBudget;
115
+ private liftBudgetPause;
116
+ quarantined(): Record<string, {
117
+ reason: string;
118
+ since: number;
119
+ displaced: boolean;
120
+ }>;
121
+ quarantine(agentId: string, reason: string, displaced: boolean, now?: number): void;
122
+ unquarantine(agentId: string): {
123
+ reason: string;
124
+ since: number;
125
+ displaced: boolean;
126
+ } | null;
38
127
  /** Has .loom/config.json changed since this runtime was opened? */
39
128
  configStale(): boolean;
40
129
  /**
@@ -44,6 +133,27 @@ export declare class ProjectRuntime {
44
133
  * on an agent's turn to finish. Nothing is torn down: a role is a name, not
45
134
  * a capability, so no adapter needs restarting.
46
135
  */
136
+ /** An agent's picture: a small PNG/JPEG/WebP data URL, or null to clear. */
137
+ setAgentAvatar(agentId: string, dataUrl: string | null): {
138
+ id: string;
139
+ avatar: string | null;
140
+ } | null;
141
+ /**
142
+ * Ask an agent whether it's ready — installed, signed in, model listed —
143
+ * without sending it a prompt (see AdapterBase.selfCheck).
144
+ */
145
+ checkAgent(agentId: string): Promise<{
146
+ ok: boolean;
147
+ ms: number;
148
+ checks: AgentCheck[];
149
+ } | null>;
150
+ /** Standing instructions for an agent; empty clears them. */
151
+ setAgentInstructions(agentId: string, text: string): {
152
+ id: string;
153
+ instructions: string;
154
+ } | null;
155
+ /** The block an agent's standing instructions ride in, ahead of its turn. */
156
+ agentInstructions(agentId: string): string;
47
157
  setAgentRole(agentId: string, role: string): {
48
158
  id: string;
49
159
  role: string;
@@ -59,6 +169,8 @@ export declare class ProjectRuntime {
59
169
  brain?: {
60
170
  extractor?: "auto" | "off";
61
171
  model?: string;
172
+ semantic?: boolean;
173
+ continuity?: boolean;
62
174
  };
63
175
  projection?: {
64
176
  mode?: "template" | "llm";
@@ -66,6 +178,16 @@ export declare class ProjectRuntime {
66
178
  timeoutMs?: number;
67
179
  };
68
180
  defaultAgent?: string;
181
+ git?: {
182
+ commitPerTurn?: boolean;
183
+ branchPerTask?: boolean;
184
+ worktreePerAgent?: boolean;
185
+ mergeOnHandoff?: boolean;
186
+ delivery?: string;
187
+ };
188
+ safety?: {
189
+ snapshotBeforeRoutes?: boolean;
190
+ };
69
191
  }): ProjectConfig;
70
192
  /**
71
193
  * The slice of config the Settings screen edits, read back for display: the
@@ -78,12 +200,24 @@ export declare class ProjectRuntime {
78
200
  brain: {
79
201
  extractor: "auto" | "off";
80
202
  model: string;
203
+ semantic: boolean;
204
+ continuity: boolean;
81
205
  };
82
206
  projection: {
83
207
  mode: "template" | "llm";
84
208
  model: string;
85
209
  };
86
210
  defaultAgent: string;
211
+ git: {
212
+ commitPerTurn: boolean;
213
+ branchPerTask: boolean;
214
+ worktreePerAgent: boolean;
215
+ mergeOnHandoff: boolean;
216
+ delivery: GitDelivery;
217
+ };
218
+ safety: {
219
+ snapshotBeforeRoutes: boolean;
220
+ };
87
221
  agents: Array<{
88
222
  id: string;
89
223
  kind: string;
@@ -104,7 +238,32 @@ export declare class ProjectRuntime {
104
238
  addAgent(kind: string, opts?: {
105
239
  id?: string;
106
240
  role?: string;
241
+ options?: Record<string, unknown>;
107
242
  }): AgentConfig;
243
+ /**
244
+ * The next free instance id for a kind: `codex`, then `codex-2`, `codex-3`.
245
+ *
246
+ * The bare kind stays the first instance's id so existing projects, configs
247
+ * and route specs that name `codex` keep meaning what they meant.
248
+ */
249
+ private nextInstanceId;
250
+ /** How many instances of each kind the roster holds. */
251
+ instanceCounts(): Record<string, number>;
252
+ /**
253
+ * Where this agent works: its own worktree when the project opted in, the
254
+ * shared tree otherwise.
255
+ *
256
+ * With git.worktreePerAgent on, each adapter gets a sibling checkout on its
257
+ * own branch (agent/<id>), so two agents editing at once cannot collide in
258
+ * the filesystem. The trade is stated where it's decided: merging is
259
+ * MANUAL in this version — the branches are ordinary git branches and
260
+ * `git merge agent/<id>` is the handoff of record. Auto-merge on baton
261
+ * handoff is a different feature with different failure modes (conflicts
262
+ * mid-handoff), deliberately not smuggled in here.
263
+ */
264
+ private agentDirs;
265
+ agentDir(agentId: string): string;
266
+ private ensureAgentWorktree;
108
267
  /**
109
268
  * Create one agent and subscribe to it, exactly as the constructor does.
110
269
  *
@@ -127,18 +286,172 @@ export declare class ProjectRuntime {
127
286
  * Point an agent at a different model.
128
287
  *
129
288
  * The model is read once, when the adapter is constructed (createAgent hands
130
- * it cfg.options), so changing it means building a fresh agent — which drops
131
- * the CLI session the old one was resuming. That's the right behaviour for a
132
- * model switch: continuing one model's conversation on another model is not a
133
- * thing the underlying CLIs support anyway. Refused mid-turn, because swapping
134
- * the process out from under a running turn would strand it.
289
+ * it cfg.options), so changing it means building a fresh adapter instance.
290
+ * Native resume data stays persisted; each adapter decides whether its harness
291
+ * can reuse it. Refused while a turn is preparing or running, because swapping
292
+ * the process out from under that turn would strand it.
135
293
  *
136
294
  * An empty model clears the override, so the CLI falls back to its own default
137
295
  * — the honest "Default" the picker offers.
138
296
  */
139
- setAgentModel(agentId: string, model: string): AgentConfig;
297
+ setAgentModel(agentId: string, model: string, provider?: string): AgentConfig;
298
+ /**
299
+ * A model agent's sampling: temperature (0–2) and the reply's token cap.
300
+ * Null clears one back to the provider's default. Rebuilt like a model
301
+ * switch, because the adapter reads them when it's built.
302
+ */
303
+ setAgentSampling(agentId: string, s: {
304
+ temperature?: number | null;
305
+ maxTokens?: number | null;
306
+ }): AgentConfig;
307
+ /**
308
+ * Choose how much an agent may do without asking: bypass | auto | ask.
309
+ *
310
+ * Same shape as setAgentModel — the mode is read when the adapter is built
311
+ * (it becomes CLI flags, or the env of opencode's server), so the agent is
312
+ * rebuilt. Refused mid-turn for the same reason.
313
+ */
314
+ setAgentPermissions(agentId: string, mode: PermissionMode): AgentConfig;
140
315
  /** Write the roster, without tripping our own staleness check. */
141
316
  private saveConfig;
317
+ /**
318
+ * Where skills live — every layout, not just ours.
319
+ *
320
+ * See core/skills.ts#discoverSkillRoots for the list and the precedence. This
321
+ * used to be two hardcoded directories, which meant a machine with sixty
322
+ * skills in `~/.claude` reported the one that shipped in this repo.
323
+ */
324
+ private skillRoots;
325
+ /** The directory this project's own skills are installed into. */
326
+ private ownSkillsDir;
327
+ /** All available skills with this project's enabled state. */
328
+ getSkills(): SkillManifest[];
329
+ /**
330
+ * The catalog the picker renders: every discoverable skill, without the body.
331
+ *
332
+ * The bodies are the entire point of a skill and also the reason this exists
333
+ * separately from `getSkills()` — a machine with sixty installed skills has
334
+ * megabytes of markdown, and a list screen needs none of it.
335
+ *
336
+ * `installed` means "this file is inside the project directory", which is the
337
+ * same question `removeSkill` asks: those are the only ones Loom put there
338
+ * and the only ones it may delete.
339
+ */
340
+ skillsCatalog(): SkillCatalogEntry[];
341
+ /**
342
+ * Install a skill from a local directory or a git remote, into this project.
343
+ *
344
+ * Throws SkillInstallError for anything the user can fix (bad URL, unsafe id,
345
+ * a name that already exists) — the route turns those into a 400 with the
346
+ * message, because "invalid input" tells you nothing when the real answer is
347
+ * "that repo has no SKILL.md in it".
348
+ */
349
+ installSkill(input: {
350
+ gitUrl?: string;
351
+ dir?: string;
352
+ force?: boolean;
353
+ }): Promise<SkillInstallResult>;
354
+ /**
355
+ * Delete a project-installed skill from disk.
356
+ *
357
+ * Refused for anything outside the project. A skill in `~/.claude/skills` is
358
+ * the user's, shared with every other tool they run, and a project-scoped
359
+ * "remove" button that reached out and deleted it would be a data-loss bug
360
+ * dressed as a feature. The refusal says where the skill actually lives so
361
+ * the answer ("go delete it yourself, here") is in the message.
362
+ *
363
+ * The enabled flag goes with it: leaving `skills[id] = true` in config for a
364
+ * directory that no longer exists means the next turn's briefing silently
365
+ * loses a block the config still claims is on.
366
+ */
367
+ removeSkill(id: string): {
368
+ removed: true;
369
+ id: string;
370
+ path: string;
371
+ };
372
+ /**
373
+ * Switch one agent off (or back on) without taking it out of the roster.
374
+ *
375
+ * Refused while it holds the baton or is mid-turn, for the same reason
376
+ * `removeAgent` is: stopping it there would strand the lock on something that
377
+ * no longer exists, and the thread would show a turn nothing is running. The
378
+ * refusal names the fix rather than just saying no.
379
+ *
380
+ * Off really means off — the agent is stopped and dropped from the live map,
381
+ * not merely hidden. A roster entry that still answers is the kind of "off"
382
+ * that costs money.
383
+ */
384
+ setAgentEnabled(agentId: string, enabled: boolean): {
385
+ id: string;
386
+ enabled: boolean;
387
+ };
388
+ /** Enable/disable one skill for this project; returns the new enabled map. */
389
+ setSkillEnabled(id: string, on: boolean): Record<string, boolean>;
390
+ /** The ACTIVE SKILLS block to prepend to a briefing, or "" when none are on. */
391
+ activeSkillsBlock(): string;
392
+ private static DEFAULT_MCPS;
393
+ /** Configured MCP servers, merged over the built-in suggestions (deduped by name). */
394
+ getMcps(): McpServerConfig[];
395
+ /**
396
+ * The same list, with `connected` MEASURED rather than assumed.
397
+ *
398
+ * The old reading of that field was "a url is typed into this row", which the
399
+ * UI rendered as a green "connected" badge — a claim about a live connection
400
+ * made without ever opening one. Here every configured URL gets a bounded
401
+ * probe (see core/mcp.ts) and the answer is whatever came back. Rows with no
402
+ * URL aren't probed and report false, because "not configured" is not
403
+ * "connected".
404
+ */
405
+ /**
406
+ * Live health per configured MCP server, from the background poll.
407
+ *
408
+ * A server that died used to stay listed as connected, and its tools failed
409
+ * silently mid-turn — the agent just found them gone. The poll notices the
410
+ * transition, says so in the Console, and while a server is down it is left
411
+ * out of turn injection entirely: an absent tool the agent never saw beats a
412
+ * present tool that throws. When the server answers again it is included
413
+ * again automatically — that is the whole reconnect story for per-turn
414
+ * config files; there is no persistent connection to rebuild.
415
+ */
416
+ private mcpHealth;
417
+ private mcpTimer;
418
+ /** Poll every configured server once; log the transitions. */
419
+ pollMcpHealth(timeoutMs?: number): Promise<void>;
420
+ mcpHealthReport(): Record<string, {
421
+ up: boolean;
422
+ failures: number;
423
+ probedAt: number;
424
+ }>;
425
+ /**
426
+ * The servers a turn should carry: everything not known-down.
427
+ *
428
+ * Unknown (never probed — a fresh daemon, a just-added server) passes
429
+ * through; refusing a server nobody has measured would block first use on a
430
+ * poll that hasn't run yet. Only a measured, repeated failure withholds.
431
+ */
432
+ healthyMcps(): McpServerConfig[];
433
+ startMcpHealthLoop(intervalMs?: number): void;
434
+ getMcpsProbed(timeoutMs?: number): Promise<McpServerConfig[]>;
435
+ /** Add or update one MCP (by name); persists only the real (non-default) fields. */
436
+ upsertMcp(mcp: McpServerConfig): McpServerConfig[];
437
+ /**
438
+ * Remove a configured MCP server by name.
439
+ *
440
+ * `removed` is false when nothing was configured under that name, which the
441
+ * route answers with a 404 rather than a cheerful 200 — "deleted a thing that
442
+ * wasn't there" is the kind of success that hides a typo in a server name.
443
+ *
444
+ * Note what this does to a name that is also one of the built-in suggestion
445
+ * rows (GitHub, Slack, …): the *configuration* goes, and the suggestion comes
446
+ * back with an empty url, because those rows aren't installed servers, they're
447
+ * placeholders getMcps() merges in. That is the honest outcome — the server is
448
+ * gone, and what's left is an offer to add one — but a caller diffing the list
449
+ * for the name will still find it, so it should compare `url`/`command`.
450
+ */
451
+ removeMcp(name: string): {
452
+ removed: boolean;
453
+ mcps: McpServerConfig[];
454
+ };
142
455
  /**
143
456
  * Every conversation in this project, main first. Main is implicit: it's
144
457
  * always there and it owns every event written before chats existed, so it
@@ -146,68 +459,159 @@ export declare class ProjectRuntime {
146
459
  * haven't spoken in yet has no events to derive it from.
147
460
  */
148
461
  chats(): ChatInfo[];
149
- createChat(title: string): ChatInfo;
150
- renameChat(id: string, title: string): ChatInfo | null;
462
+ /** Which run, race, crew or import made each thread (ChatInfo.group). */
463
+ private chatGroups;
464
+ /** Pin, archive or file a thread. Main is always first and always there. */
465
+ setChatFlags(id: string, flags: {
466
+ pinned?: boolean;
467
+ archived?: boolean;
468
+ folder?: string | null;
469
+ }): ChatInfo | null;
470
+ /** Rate a reply up or down (0 clears). Main included. */
471
+ rateMessage(chatId: string, eventId: number, agent: string, v: number): Record<string, {
472
+ v: 1 | -1;
473
+ agent: string;
474
+ }> | null;
475
+ /** Every rating in every thread, per agent: how many up, how many down. */
476
+ ratingsByAgent(): Record<string, {
477
+ up: number;
478
+ down: number;
479
+ }>;
480
+ /** Star or unstar a message in a thread (main included). */
481
+ starMessage(chatId: string, eventId: number, on: boolean): number[] | null;
482
+ createChat(title: string, opts?: {
483
+ agentId?: string;
484
+ model?: string;
485
+ }): ChatInfo;
151
486
  /**
152
- * Forget a conversation. Its events stay in the log — it's append-only, and
153
- * the brain is built from all of them; deleting the thread you had with an
154
- * agent shouldn't quietly rewrite what the project decided. The chat just
155
- * stops being listed.
487
+ * May this thread be bound to this agent (and model)?
488
+ *
489
+ * A model bound to an agent that bakes its model into a spawned process
490
+ * would be a setting that silently did nothing, so it is refused here —
491
+ * where the person can act on it — rather than dropped at send time.
156
492
  */
493
+ private bindable;
494
+ /** Can this agent be handed a different model for one turn? */
495
+ private switchesModelPerTurn;
496
+ /** Bind (or unbind) who answers in a thread. */
497
+ setChatAgent(id: string, agentId: string | null, model?: string): ChatInfo | null;
498
+ /**
499
+ * Ask several models the same thing at once, each in its own thread.
500
+ *
501
+ * With free quota, asking five models costs what asking one costs, and
502
+ * "which of these is right" is a judgement a person makes in ten seconds.
503
+ * So: one prompt, one thread per model, all running at the same time.
504
+ *
505
+ * The agents are TRANSIENT — built for the ask, not added to the roster.
506
+ * Adding five agents to .loom/config.json to ask five questions would leave
507
+ * the project's roster as a record of everything anyone ever compared. What
508
+ * stays behind is the threads, which are the part worth keeping.
509
+ */
510
+ askModels(text: string, picks: Array<{
511
+ model: string;
512
+ provider?: string;
513
+ }>, opts?: {
514
+ title?: string;
515
+ briefing?: boolean;
516
+ }): Promise<Array<{
517
+ chat: string;
518
+ model: string;
519
+ provider: string;
520
+ agentId: string;
521
+ }>>;
522
+ /** What a thread has pinned, if anything. */
523
+ chatBinding(chat?: string): {
524
+ agentId?: string;
525
+ model?: string;
526
+ };
527
+ renameChat(id: string, title: string): ChatInfo | null;
157
528
  deleteChat(id: string): boolean;
158
529
  boardTasks(): BoardTask[];
159
530
  createTask(input: {
160
531
  title: string;
161
532
  column?: string;
162
533
  agent?: string;
534
+ blockedBy?: string[];
535
+ priority?: string | null;
536
+ due?: string | null;
163
537
  }): BoardTask;
538
+ /** Only blockers that exist. A link to a deleted card blocks nothing forever. */
539
+ private validBlockers;
540
+ /**
541
+ * A card is blocked while any of its blockers is not yet `ready`.
542
+ *
543
+ * `ready` is the board's own definition of done — the last column. Deleted
544
+ * blockers don't count (validBlockers keeps them out, and a stale link that
545
+ * survived a race reads as done rather than blocking forever).
546
+ */
547
+ taskBlockers(id: string): Array<{
548
+ id: string;
549
+ title: string;
550
+ column: string;
551
+ }>;
552
+ /** task/<id>-<slug>: stable id first so a retitle doesn't orphan the branch. */
553
+ /**
554
+ * What opening a PR for this card would push, and what it would run.
555
+ *
556
+ * Asked before anything happens, because pushing publishes: the person sees
557
+ * the branch, the commits and the exact command, and only then decides.
558
+ */
559
+ taskPrPlan(id: string): Promise<{
560
+ branch: string;
561
+ base: string;
562
+ commits: string[];
563
+ files: string[];
564
+ command: string;
565
+ ready: boolean;
566
+ why?: string;
567
+ }>;
568
+ /** Push the branch and open the PR — only ever from an explicit click. */
569
+ openTaskPr(id: string): Promise<{
570
+ url: string;
571
+ branch: string;
572
+ }>;
573
+ private taskBranchName;
164
574
  /** Move or retitle a card. Yours, so this is the real state — not a hint. */
165
575
  updateTask(id: string, patch: {
166
576
  title?: string;
167
577
  column?: string;
168
578
  agent?: string;
579
+ blockedBy?: string[];
580
+ priority?: string | null;
581
+ due?: string | null;
582
+ crew?: string;
583
+ goal?: string;
584
+ stage?: string;
585
+ claimedBy?: string;
169
586
  }): BoardTask | null;
587
+ /** Would `id` depending on `blockers` create a loop back to `id`? */
588
+ private wouldCycle;
170
589
  deleteTask(id: string): boolean;
171
590
  /** Any adapter mid-turn? (Hot reloads are deferred while work is in flight.) */
172
591
  anyBusy(): boolean;
173
592
  agent(id: string): AnyAgent;
174
593
  private ensureStarted;
175
- /** Pre-turn porcelain snapshots, for per-prompt diff attribution. */
176
- private preTurnTree;
177
- /** After a turn: log which files that prompt changed (turn_diff), then learn. */
594
+ checkpoints(): Promise<checkpoints.Checkpoint[]>;
595
+ rewind(id: string): Promise<checkpoints.RestoreResult>;
596
+ /** Put one file back as a checkpoint had it (see checkpoints.restoreFile). */
597
+ rewindFile(id: string, file: string): Promise<Awaited<ReturnType<typeof checkpoints.restoreFile>>>;
598
+ turnFacts(agentId: string): Promise<TurnFacts>;
178
599
  private captureTurnDiff;
179
- /**
180
- * Phase 2: read a finished turn for durable memory.
181
- *
182
- * Fire-and-forget on purpose. A slow or missing extractor must never delay
183
- * anything — extractFromTurn already swallows engine failures, and this is
184
- * void-ed so even an unexpected throw can't escape into the event pipeline.
185
- * Off entirely when config says so; a no-op when Claude isn't available.
186
- */
600
+ private commitTurn;
187
601
  private extractMemory;
188
- /**
189
- * The transcript of the most recent turn in a chat: from the last human
190
- * message to now — the user's ask and what the agent did in reply.
191
- */
192
- private gatherTurnText;
193
602
  workingTree(): Promise<WorkingTree>;
194
- /** Freshly read every connected ADE's native memory from disk. */
195
- private importedMemory;
196
- /** The merged brain: decisions + imported ADE memories + shared context. */
197
603
  unifiedMemory(): UnifiedMemory;
198
- /**
199
- * Phase 3: the brain brief for a handoff — the memories relevant to the work
200
- * in flight, compiled. Query is the recent conversation plus the files recent
201
- * turns touched; scoped to the incoming agent; low-confidence memories are
202
- * held back from injection (they stay visible in the Brain tab). Empty string
203
- * when there's nothing relevant, so callers append it unconditionally.
204
- */
205
- private retrieveBrief;
206
- /**
207
- * Pull each ADE's native memory into the shared log. Idempotent — a source
208
- * whose content hasn't changed since its last import is skipped, so this is
209
- * safe to call on connect, on demand, or on a timer.
210
- */
604
+ private brainBrief;
605
+ private memoryUse;
606
+ private memoryUseTimer;
607
+ private memoryUseFile;
608
+ memoryUsage(): Record<string, {
609
+ n: number;
610
+ at: number;
611
+ }>;
612
+ private noteMemoriesUsed;
613
+ private brainBriefFor;
614
+ searchBrain(opts: RetrieveOpts): Promise<Hit[]>;
211
615
  importMemories(): {
212
616
  imported: number;
213
617
  sources: string[];
@@ -219,6 +623,22 @@ export declare class ProjectRuntime {
219
623
  * memory automatically — it survives every future handoff projection.
220
624
  */
221
625
  private captureDecisions;
626
+ private decisionsFile;
627
+ /** An agent's declared role from config (planner/builder/reviewer/…), else its kind. */
628
+ agentRole(agentId: string): string;
629
+ /** How many turns this agent has completed (for the decision's turnIndex). */
630
+ private turnCountFor;
631
+ /**
632
+ * All captured decisions for this project, newest first, in today's shape —
633
+ * see normalizeStoredDecision for what that does to records written before
634
+ * a decision had to say where its confidence came from.
635
+ */
636
+ getDecisions(): AgentDecision[];
637
+ decisionStats(): DecisionStats;
638
+ /** Append decisions to the persisted store (kept oldest→newest on disk). */
639
+ storeDecisions(decisions: AgentDecision[]): void;
640
+ /** Mine decisions from a completed turn, persist them, surface on the Timeline. */
641
+ private captureAgentDecisions;
222
642
  /**
223
643
  * The persisted holder, unless it refers to an agent that has since been
224
644
  * removed from the config — ghost holders are cleared, not fatal.
@@ -254,28 +674,210 @@ export declare class ProjectRuntime {
254
674
  agentId: string;
255
675
  reply: string;
256
676
  }>;
257
- sendMessage(text: string, agentId?: string, opts?: {
258
- source?: "user" | "route";
677
+ /**
678
+ * A proxy in front of one server, so its page can talk to the app.
679
+ *
680
+ * One per server, reused while it points at the same place — restarting a
681
+ * dev server on the same port keeps the preview URL stable, which matters
682
+ * because the iframe is pointed at it.
683
+ */
684
+ previewProxy(name: string, target: string): Promise<PreviewProxy>;
685
+ /** Live server state and output, for the socket. Returns unsubscribe. */
686
+ /** Replies as they're written, for the socket. Returns unsubscribe. */
687
+ onStream(cb: (f: LiveText) => void): () => void;
688
+ /** The replies being typed right now in one thread (or all of them). */
689
+ liveNow(chat?: string): {
690
+ agentId: string;
691
+ chat: string;
692
+ text: string;
693
+ think: string;
694
+ }[];
695
+ private liveSoFar;
696
+ private liveText;
697
+ /** Streamed text and tool progress as a turn produces them; what finishes lands in the log. */
698
+ onLiveDelta(cb: (d: LiveFrame) => void): () => void;
699
+ /**
700
+ * Answer a structured question an agent is waiting on (a needs_input event
701
+ * with a requestId). The turn carries on with the answer.
702
+ */
703
+ answerQuestion(agentId: string, chat: string, requestId: string, answers: Record<string, unknown>): Promise<void>;
704
+ /** Structured questions agents are blocked on, by agent. */
705
+ private openQuestions;
706
+ /** Compact an agent's native context for a chat now, instead of waiting for the harness to. */
707
+ compactAgent(agentId: string, chat?: string): Promise<void>;
708
+ /**
709
+ * A plan turn on a provider agent runs in the agent's own plan mode, which
710
+ * changes nothing; Loom keeps the plan it proposes under plans/, as its plan
711
+ * mode always has.
712
+ */
713
+ private saveProposedPlan;
714
+ onServerEvent(cb: (f: ServerFrame) => void): () => void;
715
+ onQueueChange(cb: (q: QueueState) => void): () => void;
716
+ enqueue(input: QueueInput): QueueItem;
717
+ editQueued(itemId: string, patch: {
718
+ text?: string;
719
+ target?: QueueTarget;
720
+ plan?: boolean;
721
+ when?: QueueCondition | null;
722
+ }): QueueItem;
723
+ queueBlocker(item: QueueItem): string | null;
724
+ private watchClockConditions;
725
+ private holdQueueFor;
726
+ private releaseQuestionHold;
727
+ private kickQueue;
728
+ drainPromptQueue(): Promise<void>;
729
+ sendMessage(text: string, agentId?: string, opts?: TurnOptions): Promise<TurnResult>;
730
+ /**
731
+ * An agent is re-running the same failing command (or the same call over and
732
+ * over). Say so in its chat — a card with Stop / Nudge / Hand off — and push;
733
+ * with watchdog.auto "nudge", also stop the turn and tell it to step back.
734
+ */
735
+ private onLoop;
736
+ /**
737
+ * Blast-Radius Shield (core/shield.ts): a command an agent ran that can't be
738
+ * taken back — a force-push, a reset --hard, a recursive delete outside the
739
+ * project, a dropped table. Said at once, in its chat and as a push; with
740
+ * shield.auto "stop" (the default on a night shift) the turn is stopped too.
741
+ */
742
+ private shield;
743
+ /** The loop card's buttons: stop the turn, nudge the agent, or hand the task to another agent. */
744
+ actOnLoop(chat: string, agentId: string, action: "stop" | "nudge" | "handoff", to?: string, loop?: Loop): Promise<{
745
+ done: string;
746
+ to?: string;
747
+ }>;
748
+ private lastLoop;
749
+ /**
750
+ * Define or replace a named route.
751
+ *
752
+ * Routes were config you hand-edited: `ship` was built at init and everything
753
+ * else meant opening .loom/config.json. Validated against the CURRENT roster
754
+ * before saving — a route that names an agent this project doesn't have would
755
+ * sit in the file looking runnable and fail at its first step. Saving through
756
+ * here puts the team's pipeline in a version-controllable file instead of one
757
+ * person's shell history.
758
+ */
759
+ saveRoute(name: string, steps: RouteStepSpec[]): Record<string, RouteStepSpec[]>;
760
+ deleteRoute(name: string): Record<string, RouteStepSpec[]>;
761
+ /**
762
+ * Checkpoint the project's Loom-owned state: brain, board, config.
763
+ *
764
+ * For the moment before letting a fleet loose on something — a restorable
765
+ * "before". Deliberately NOT the working tree (git owns files and does it
766
+ * better) and NOT the event log (history is what happened; a restore that
767
+ * rewrote history would be a lie with a timestamp). Restoring brings back
768
+ * what the project knew, what was on the board, and how it was configured.
769
+ */
770
+ snapshot(): {
771
+ format: "loom-snapshot";
772
+ version: 1;
773
+ project: string;
774
+ takenAt: number;
775
+ brain: ReturnType<Brain["export"]>;
776
+ tasks: BoardTask[];
777
+ config: ProjectConfig;
778
+ };
779
+ /**
780
+ * Restore a snapshot. Config and board are replaced (that is what "restore"
781
+ * means for state you own); the brain is MERGED through the same dedupe as
782
+ * import, because memory is an append-only fold — a restore that silently
783
+ * forgot what was learned since the snapshot would be data loss wearing a
784
+ * seatbelt. What it knew then comes back; what it learned since stays.
785
+ */
786
+ restore(snap: ReturnType<ProjectRuntime["snapshot"]>): {
787
+ brain: {
788
+ added: number;
789
+ known: number;
790
+ };
791
+ tasks: number;
792
+ };
793
+ /** Turns older than this are presumed hung. Generous: real turns run long. */
794
+ static readonly STALE_TURN_MS: number;
795
+ staleSessions(now?: number): Array<{
796
+ agentId: string;
797
+ busyMs: number;
798
+ }>;
799
+ /**
800
+ * Put a hung session out of its misery and bring up a fresh one.
801
+ *
802
+ * Interrupt first — a process that responds to that wasn't hung, and gets to
803
+ * finish dying cleanly — then stop, drop, and respawn from config, exactly as
804
+ * a cold start would. The baton is released if the corpse held it, because a
805
+ * lock owned by a session that no longer exists refuses everyone forever.
806
+ */
807
+ reapSession(agentId: string): Promise<{
808
+ respawned: boolean;
809
+ }>;
810
+ /**
811
+ * How many subtasks may run at once in this project.
812
+ *
813
+ * A fan-out is the point of the feature and also the way to melt the machine:
814
+ * each child is a real CLI process with its own model calls. The cap is per
815
+ * project rather than global so one busy project can't starve the others.
816
+ */
817
+ private static readonly MAX_CONCURRENT_SUBTASKS;
818
+ /** In-flight subtasks, by the id minted when they started. */
819
+ private subtasks;
820
+ /** Subtasks currently running, for the status payload and the cap. */
821
+ liveSubtasks(): Array<{
822
+ id: string;
823
+ parent: string;
824
+ agentId: string;
825
+ task: string;
826
+ }>;
827
+ /**
828
+ * Run a subtask on a child agent, alongside the parent's turn.
829
+ *
830
+ * A turn used to be all-or-nothing: one agent, one prompt, one result. "Audit
831
+ * these twelve files" wanted twelve cheap readers, and the only way to get
832
+ * them was twelve sequential turns, each one taking the baton off the last.
833
+ *
834
+ * What makes a child a child rather than another turn:
835
+ *
836
+ * - **It never touches the baton.** The parent still holds it, so a fan-out
837
+ * cannot steal the conversation from the agent that started it, and the
838
+ * human's next message still lands where they expect.
839
+ * - **Its briefing is narrowed.** It gets the task and the project's shape,
840
+ * not the parent's whole thread. Handing a child the full history is how
841
+ * you pay twice for context the parent already read.
842
+ * - **Its result is attributed and parented**, so the thread can indent it
843
+ * under the turn that asked rather than interleaving it as a peer.
844
+ *
845
+ * Everything it learns still lands in the one project brain — a child that
846
+ * discovered something and took it to the grave would be worse than no child.
847
+ */
848
+ spawnSubAgent(parentAgentId: string, opts: {
849
+ agentId: string;
850
+ task: string;
259
851
  chat?: string;
260
852
  }): Promise<{
853
+ id: string;
261
854
  agentId: string;
262
855
  }>;
856
+ private subtaskBriefing;
263
857
  private defaultAdapterId;
264
- /** Briefings are injected with the first turn after a handoff. */
265
- private pendingBriefings;
266
858
  private consumePendingBriefing;
859
+ retryTurn(toAgentId: string): Promise<{
860
+ agentId: string;
861
+ retried: string;
862
+ }>;
267
863
  /**
268
- * Explicit baton pass: interrupt the current holder if mid-turn, project
269
- * the log into the target's namespaced memory, arm the one-shot briefing.
270
- * A *manual* handoff cancels any active route — the human outranks it.
864
+ * Carry the outgoing agent's branch into the incoming agent's worktree.
865
+ *
866
+ * Only with both `worktreePerAgent` and `mergeOnHandoff` on, only when the
867
+ * two really are separate checkouts, and never when it would have to guess:
868
+ * see core/worktree-merge.ts for what it refuses. The outcome is a value so
869
+ * the handoff event and the briefing can both say what happened.
271
870
  */
871
+ private mergeForHandoff;
272
872
  handoff(to: string, opts?: {
273
873
  source?: "user" | "route";
274
874
  }): Promise<{
275
875
  from: string | null;
876
+ merge?: MergeOutcome;
276
877
  }>;
277
878
  interrupt(opts?: {
278
879
  source?: "user" | "route";
880
+ chat?: string;
279
881
  }): Promise<{
280
882
  interrupted: string | null;
281
883
  }>;
@@ -285,6 +887,17 @@ export declare class ProjectRuntime {
285
887
  * list of agent ids/roles. Undefined → the "ship" route if defined, else
286
888
  * every adapter in config order.
287
889
  */
890
+ /**
891
+ * Opt-in: checkpoint before a route starts.
892
+ *
893
+ * A route is exactly the moment you let a fleet loose — several agents,
894
+ * several turns, no human between hops. With safety.snapshotBeforeRoutes on,
895
+ * the brain+board+config land in .loom/snapshots/pre-route-<ts>.json first,
896
+ * so `loom restore` has a "before" without anyone having remembered to take
897
+ * one. Bounded: the newest five are kept, older ones pruned — a safety net,
898
+ * not an archive.
899
+ */
900
+ private snapshotBeforeRoute;
288
901
  startRoute(opts: {
289
902
  task: string;
290
903
  spec?: string | RouteStepSpec[];
@@ -294,6 +907,62 @@ export declare class ProjectRuntime {
294
907
  abortRoute(): Promise<RouteState>;
295
908
  routeState(): RouteState | null;
296
909
  status(): Promise<ProjectStatus>;
910
+ /**
911
+ * What every agent in this project is doing right now — for the fleet view.
912
+ *
913
+ * One row per roster agent (its thread, whether it's mid-turn, its last
914
+ * step) and one per orchestra task (worker sessions don't live in the
915
+ * roster). "Last step" is the newest event from that agent in that thread,
916
+ * summarised to a line: the tool it ran, the file it touched, what it said.
917
+ */
918
+ activity(): Record<string, unknown>;
919
+ /** The team member running this daemon (set by Team Link), for commit trailers. */
920
+ memberLogin: string | null;
921
+ /** Loom Teams, Phase 2: this project's team coordinator (set by Team Link). */
922
+ coordinator: OrchestraCoordinator | null;
923
+ /** Loom Teams, Phase 3: this project's share of the team brain (set by Team Link). */
924
+ teamBrain: TeamBrainHook | null;
925
+ /** The effective loom.team.json while shared with a team (D37); null when solo. */
926
+ teamPolicy: TeamPolicy | null;
927
+ private crewSpendLedger;
928
+ private crewSpendToday;
929
+ /**
930
+ * An agent's options under the team policy (D38): its permission mode capped
931
+ * at the ceiling. Plan mode can't be known when an agent is built, so
932
+ * `bypassRequiresPlan` treats it as off — the stricter reading.
933
+ */
934
+ private policyOptions;
935
+ /** Phase 5: this project is a runner's workspace for one goal (D70). */
936
+ runnerMode: boolean;
937
+ /** Adapter kinds usable on this machine: the roster's plus installed CLIs. */
938
+ usableKinds(): string[];
939
+ /**
940
+ * One question to one agent, outside any thread: the Phase 4 review (D60).
941
+ * Runs in `dir` (a throwaway directory, so a reviewer that forgets it's
942
+ * read-only can't touch the project), returns everything it said, and
943
+ * counts its cost like any turn.
944
+ */
945
+ askAgent(kind: string, dir: string, text: string, opts?: {
946
+ timeoutMs?: number;
947
+ }): Promise<string>;
948
+ /** Share this project with a team, or record an explicit opt-out (null). */
949
+ setTeam(share: {
950
+ teamId: string;
951
+ repo: string;
952
+ } | null): void;
953
+ chatOf(agentId: string): string | undefined;
954
+ /** The live (or latest) orchestra run, compact — for status payloads. */
955
+ orchestraSummary(): Record<string, unknown> | null;
297
956
  close(): Promise<void>;
957
+ private closed;
958
+ /**
959
+ * Append unless the runtime has been closed.
960
+ *
961
+ * The async tails need this: a subtask completion or a turn error can resolve
962
+ * after close() — stopping an agent does not cancel a promise already in
963
+ * flight — and appending then throws into an unhandled rejection against a
964
+ * sqlite handle that no longer exists. The record is not lost so much as
965
+ * meaningless: the project this event belonged to is gone from memory.
966
+ */
967
+ private appendIfOpen;
298
968
  }
299
- export declare function relativeToProject(projectDir: string, p: string): string;