@intentic/sandbox-contract 1.248.0 → 1.249.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 (877) hide show
  1. package/README.md +18 -15
  2. package/dist/chores/chores.d.ts.map +1 -1
  3. package/dist/chores/chores.js.map +1 -1
  4. package/dist/chores/digest.d.ts.map +1 -1
  5. package/dist/chores/digest.js.map +1 -1
  6. package/dist/chores/extension-update.d.ts.map +1 -1
  7. package/dist/chores/extension-update.js.map +1 -1
  8. package/dist/chores/fix-deps.d.ts.map +1 -1
  9. package/dist/chores/fix-deps.js.map +1 -1
  10. package/dist/chores/index.d.ts +2 -2
  11. package/dist/chores/index.d.ts.map +1 -1
  12. package/dist/chores/index.js +1 -1
  13. package/dist/chores/index.js.map +1 -1
  14. package/dist/chores/probes.d.ts.map +1 -1
  15. package/dist/chores/probes.js.map +1 -1
  16. package/dist/chores/prompt.d.ts.map +1 -1
  17. package/dist/chores/prompt.js.map +1 -1
  18. package/dist/chores/stack.d.ts.map +1 -1
  19. package/dist/chores/stack.js.map +1 -1
  20. package/dist/chores/verdict.d.ts +7 -1
  21. package/dist/chores/verdict.d.ts.map +1 -1
  22. package/dist/chores/verdict.js +8 -0
  23. package/dist/chores/verdict.js.map +1 -1
  24. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  25. package/dist/contracts/accounts.contract.js.map +1 -1
  26. package/dist/contracts/activity.contract.d.ts +1 -0
  27. package/dist/contracts/activity.contract.d.ts.map +1 -1
  28. package/dist/contracts/agent.contract.d.ts +12 -205
  29. package/dist/contracts/agent.contract.d.ts.map +1 -1
  30. package/dist/contracts/agent.contract.js +2 -1
  31. package/dist/contracts/agent.contract.js.map +1 -1
  32. package/dist/contracts/agents.contract.d.ts +228 -54
  33. package/dist/contracts/agents.contract.d.ts.map +1 -1
  34. package/dist/contracts/agents.contract.js +11 -2
  35. package/dist/contracts/agents.contract.js.map +1 -1
  36. package/dist/contracts/automations.contract.d.ts +35 -17
  37. package/dist/contracts/automations.contract.d.ts.map +1 -1
  38. package/dist/contracts/automations.contract.js +10 -1
  39. package/dist/contracts/automations.contract.js.map +1 -1
  40. package/dist/contracts/capabilities.contract.d.ts +0 -12
  41. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  42. package/dist/contracts/capabilities.contract.js +1 -1
  43. package/dist/contracts/capabilities.contract.js.map +1 -1
  44. package/dist/contracts/chores.contract.d.ts.map +1 -1
  45. package/dist/contracts/chores.contract.js.map +1 -1
  46. package/dist/contracts/ci.contract.d.ts +9 -0
  47. package/dist/contracts/ci.contract.d.ts.map +1 -1
  48. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  49. package/dist/contracts/endpoints.contract.js.map +1 -1
  50. package/dist/contracts/exit.contract.d.ts.map +1 -1
  51. package/dist/contracts/exit.contract.js +1 -1
  52. package/dist/contracts/exit.contract.js.map +1 -1
  53. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  54. package/dist/contracts/extensions.contract.js.map +1 -1
  55. package/dist/contracts/git.contract.d.ts +45 -6
  56. package/dist/contracts/git.contract.d.ts.map +1 -1
  57. package/dist/contracts/git.contract.js +9 -9
  58. package/dist/contracts/git.contract.js.map +1 -1
  59. package/dist/contracts/host.contract.d.ts +2 -0
  60. package/dist/contracts/host.contract.d.ts.map +1 -1
  61. package/dist/contracts/host.contract.js.map +1 -1
  62. package/dist/contracts/intentic.contract.js +1 -1
  63. package/dist/contracts/intentic.contract.js.map +1 -1
  64. package/dist/contracts/logs.contract.d.ts.map +1 -1
  65. package/dist/contracts/logs.contract.js.map +1 -1
  66. package/dist/contracts/loops.contract.d.ts.map +1 -1
  67. package/dist/contracts/loops.contract.js.map +1 -1
  68. package/dist/contracts/personas.contract.d.ts +1 -0
  69. package/dist/contracts/personas.contract.d.ts.map +1 -1
  70. package/dist/contracts/personas.contract.js +1 -1
  71. package/dist/contracts/personas.contract.js.map +1 -1
  72. package/dist/contracts/providers.contract.d.ts.map +1 -1
  73. package/dist/contracts/providers.contract.js.map +1 -1
  74. package/dist/contracts/runner.contract.d.ts +97 -171
  75. package/dist/contracts/runner.contract.d.ts.map +1 -1
  76. package/dist/contracts/runner.contract.js +2 -2
  77. package/dist/contracts/runner.contract.js.map +1 -1
  78. package/dist/contracts/safety.contract.d.ts.map +1 -1
  79. package/dist/contracts/safety.contract.js +1 -1
  80. package/dist/contracts/safety.contract.js.map +1 -1
  81. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  82. package/dist/contracts/secrets.contract.js.map +1 -1
  83. package/dist/contracts/sessions.contract.d.ts +2 -41
  84. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  85. package/dist/contracts/sessions.contract.js +1 -1
  86. package/dist/contracts/sessions.contract.js.map +1 -1
  87. package/dist/contracts/settings.contract.d.ts +8 -18
  88. package/dist/contracts/settings.contract.d.ts.map +1 -1
  89. package/dist/contracts/settings.contract.js.map +1 -1
  90. package/dist/contracts/share.contract.d.ts.map +1 -1
  91. package/dist/contracts/share.contract.js.map +1 -1
  92. package/dist/contracts/skills.contract.d.ts.map +1 -1
  93. package/dist/contracts/skills.contract.js.map +1 -1
  94. package/dist/contracts/system.contract.d.ts +49 -73
  95. package/dist/contracts/system.contract.d.ts.map +1 -1
  96. package/dist/contracts/system.contract.js +12 -2
  97. package/dist/contracts/system.contract.js.map +1 -1
  98. package/dist/contracts/usage.contract.d.ts.map +1 -1
  99. package/dist/contracts/usage.contract.js.map +1 -1
  100. package/dist/contracts/vpn.contract.d.ts.map +1 -1
  101. package/dist/contracts/vpn.contract.js +1 -1
  102. package/dist/contracts/vpn.contract.js.map +1 -1
  103. package/dist/contracts/webext.contract.d.ts.map +1 -1
  104. package/dist/contracts/webext.contract.js.map +1 -1
  105. package/dist/contracts/workflows.contract.d.ts +7 -6
  106. package/dist/contracts/workflows.contract.d.ts.map +1 -1
  107. package/dist/contracts/workflows.contract.js +12 -3
  108. package/dist/contracts/workflows.contract.js.map +1 -1
  109. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  110. package/dist/contracts/workspace.contract.js.map +1 -1
  111. package/dist/events/agent-events.d.ts +1237 -0
  112. package/dist/events/agent-events.d.ts.map +1 -0
  113. package/dist/events/agent-events.js +226 -0
  114. package/dist/events/agent-events.js.map +1 -0
  115. package/dist/events/cards.d.ts +404 -0
  116. package/dist/events/cards.d.ts.map +1 -0
  117. package/dist/events/cards.js +179 -0
  118. package/dist/events/cards.js.map +1 -0
  119. package/dist/events/resume.d.ts +23 -0
  120. package/dist/events/resume.d.ts.map +1 -0
  121. package/dist/events/resume.js +31 -0
  122. package/dist/events/resume.js.map +1 -0
  123. package/dist/events/system-events.d.ts +615 -0
  124. package/dist/events/system-events.d.ts.map +1 -0
  125. package/dist/events/system-events.js +64 -0
  126. package/dist/events/system-events.js.map +1 -0
  127. package/dist/events/transcript.d.ts +1755 -0
  128. package/dist/events/transcript.d.ts.map +1 -0
  129. package/dist/events/transcript.js +205 -0
  130. package/dist/events/transcript.js.map +1 -0
  131. package/dist/ids/conversation-ids.d.ts +8 -0
  132. package/dist/ids/conversation-ids.d.ts.map +1 -0
  133. package/dist/{conversation-ids.js → ids/conversation-ids.js} +13 -0
  134. package/dist/ids/conversation-ids.js.map +1 -0
  135. package/dist/ids/hostnames.d.ts.map +1 -0
  136. package/dist/ids/hostnames.js.map +1 -0
  137. package/dist/ids/session-names.d.ts.map +1 -0
  138. package/dist/ids/session-names.js.map +1 -0
  139. package/dist/ids/share-paths.d.ts.map +1 -0
  140. package/dist/ids/share-paths.js.map +1 -0
  141. package/dist/{tunnel-ids.d.ts → ids/tunnel-ids.d.ts} +1 -0
  142. package/dist/ids/tunnel-ids.d.ts.map +1 -0
  143. package/dist/{tunnel-ids.js → ids/tunnel-ids.js} +1 -0
  144. package/dist/ids/tunnel-ids.js.map +1 -0
  145. package/dist/index.d.ts +423 -450
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +54 -46
  148. package/dist/index.js.map +1 -1
  149. package/dist/{agent-catalog.d.ts → models/agent-catalog.d.ts} +2 -2
  150. package/dist/models/agent-catalog.d.ts.map +1 -0
  151. package/dist/models/agent-catalog.js.map +1 -0
  152. package/dist/models/agent-runtimes.d.ts.map +1 -0
  153. package/dist/models/agent-runtimes.js.map +1 -0
  154. package/dist/{fast-tier.d.ts → models/fast-tier.d.ts} +1 -1
  155. package/dist/models/fast-tier.d.ts.map +1 -0
  156. package/dist/models/fast-tier.js.map +1 -0
  157. package/dist/models/model-order.d.ts.map +1 -0
  158. package/dist/models/model-order.js.map +1 -0
  159. package/dist/{model-pins.d.ts → models/model-pins.d.ts} +1 -1
  160. package/dist/models/model-pins.d.ts.map +1 -0
  161. package/dist/models/model-pins.js.map +1 -0
  162. package/dist/{model-roles.d.ts → models/model-roles.d.ts} +0 -33
  163. package/dist/models/model-roles.d.ts.map +1 -0
  164. package/dist/{model-roles.js → models/model-roles.js} +0 -35
  165. package/dist/models/model-roles.js.map +1 -0
  166. package/dist/{plan-pools.d.ts → models/plan-pools.d.ts} +1 -1
  167. package/dist/models/plan-pools.d.ts.map +1 -0
  168. package/dist/models/plan-pools.js.map +1 -0
  169. package/dist/models/prompt-complexity.d.ts.map +1 -0
  170. package/dist/models/prompt-complexity.js.map +1 -0
  171. package/dist/models/provider-specs.d.ts.map +1 -0
  172. package/dist/models/provider-specs.js.map +1 -0
  173. package/dist/policy/approvals-execution.d.ts.map +1 -0
  174. package/dist/policy/approvals-execution.js.map +1 -0
  175. package/dist/{batch-runs.d.ts → policy/batch-runs.d.ts} +5 -1
  176. package/dist/policy/batch-runs.d.ts.map +1 -0
  177. package/dist/{batch-runs.js → policy/batch-runs.js} +10 -7
  178. package/dist/policy/batch-runs.js.map +1 -0
  179. package/dist/policy/capability-env.d.ts.map +1 -0
  180. package/dist/policy/capability-env.js.map +1 -0
  181. package/dist/policy/capability-secrets.d.ts.map +1 -0
  182. package/dist/policy/capability-secrets.js.map +1 -0
  183. package/dist/{card-status.d.ts → policy/card-status.d.ts} +2 -2
  184. package/dist/policy/card-status.d.ts.map +1 -0
  185. package/dist/{card-status.js → policy/card-status.js} +1 -5
  186. package/dist/policy/card-status.js.map +1 -0
  187. package/dist/{command-classes.d.ts → policy/command-classes.d.ts} +6 -2
  188. package/dist/policy/command-classes.d.ts.map +1 -0
  189. package/dist/{command-classes.js → policy/command-classes.js} +48 -11
  190. package/dist/policy/command-classes.js.map +1 -0
  191. package/dist/{command-run.d.ts → policy/command-run.d.ts} +1 -1
  192. package/dist/policy/command-run.d.ts.map +1 -0
  193. package/dist/policy/command-run.js.map +1 -0
  194. package/dist/policy/control-scopes.d.ts +16 -0
  195. package/dist/policy/control-scopes.d.ts.map +1 -0
  196. package/dist/policy/control-scopes.js +26 -0
  197. package/dist/policy/control-scopes.js.map +1 -0
  198. package/dist/policy/credential-material.d.ts.map +1 -0
  199. package/dist/policy/credential-material.js.map +1 -0
  200. package/dist/policy/needs-action.d.ts.map +1 -0
  201. package/dist/policy/needs-action.js.map +1 -0
  202. package/dist/policy/output-fields.d.ts.map +1 -0
  203. package/dist/policy/output-fields.js.map +1 -0
  204. package/dist/policy/overlay-lint.d.ts.map +1 -0
  205. package/dist/policy/overlay-lint.js.map +1 -0
  206. package/dist/policy/owner-ticket.d.ts.map +1 -0
  207. package/dist/{owner-ticket.js → policy/owner-ticket.js} +1 -1
  208. package/dist/policy/owner-ticket.js.map +1 -0
  209. package/dist/{safety-policy.d.ts → policy/safety-policy.d.ts} +6 -5
  210. package/dist/policy/safety-policy.d.ts.map +1 -0
  211. package/dist/{safety-policy.js → policy/safety-policy.js} +12 -12
  212. package/dist/policy/safety-policy.js.map +1 -0
  213. package/dist/policy/search-globs.d.ts.map +1 -0
  214. package/dist/policy/search-globs.js.map +1 -0
  215. package/dist/protocol/container-requirements.d.ts +20 -0
  216. package/dist/protocol/container-requirements.d.ts.map +1 -0
  217. package/dist/protocol/container-requirements.js +23 -0
  218. package/dist/protocol/container-requirements.js.map +1 -0
  219. package/dist/{host-protocol.d.ts → protocol/host-protocol.d.ts} +1 -0
  220. package/dist/protocol/host-protocol.d.ts.map +1 -0
  221. package/dist/{host-protocol.js → protocol/host-protocol.js} +1 -0
  222. package/dist/protocol/host-protocol.js.map +1 -0
  223. package/dist/protocol/ingress-contract.d.ts.map +1 -0
  224. package/dist/{ingress-contract.js → protocol/ingress-contract.js} +1 -1
  225. package/dist/protocol/ingress-contract.js.map +1 -0
  226. package/dist/protocol/ingress-protocol.d.ts.map +1 -0
  227. package/dist/protocol/ingress-protocol.js.map +1 -0
  228. package/dist/protocol/listener-protocol.d.ts.map +1 -0
  229. package/dist/{listener-protocol.js → protocol/listener-protocol.js} +1 -1
  230. package/dist/protocol/listener-protocol.js.map +1 -0
  231. package/dist/{peer-dial.d.ts → protocol/peer-dial.d.ts} +4 -1
  232. package/dist/protocol/peer-dial.d.ts.map +1 -0
  233. package/dist/{peer-dial.js → protocol/peer-dial.js} +51 -10
  234. package/dist/protocol/peer-dial.js.map +1 -0
  235. package/dist/protocol/peer-mcp-server.d.ts.map +1 -0
  236. package/dist/protocol/peer-mcp-server.js.map +1 -0
  237. package/dist/protocol/request-id.d.ts.map +1 -0
  238. package/dist/protocol/request-id.js.map +1 -0
  239. package/dist/protocol/routes.d.ts.map +1 -0
  240. package/dist/protocol/routes.js.map +1 -0
  241. package/dist/{runner-protocol.d.ts → protocol/runner-protocol.d.ts} +1 -0
  242. package/dist/protocol/runner-protocol.d.ts.map +1 -0
  243. package/dist/{runner-protocol.js → protocol/runner-protocol.js} +2 -1
  244. package/dist/protocol/runner-protocol.js.map +1 -0
  245. package/dist/protocol/sse.d.ts.map +1 -0
  246. package/dist/protocol/sse.js.map +1 -0
  247. package/dist/{terminal-protocol.d.ts → protocol/terminal-protocol.d.ts} +1 -3
  248. package/dist/protocol/terminal-protocol.d.ts.map +1 -0
  249. package/dist/protocol/terminal-protocol.js.map +1 -0
  250. package/dist/protocol/webext-links.d.ts.map +1 -0
  251. package/dist/protocol/webext-links.js.map +1 -0
  252. package/dist/{webext-protocol.d.ts → protocol/webext-protocol.d.ts} +1 -0
  253. package/dist/protocol/webext-protocol.d.ts.map +1 -0
  254. package/dist/{webext-protocol.js → protocol/webext-protocol.js} +1 -0
  255. package/dist/protocol/webext-protocol.js.map +1 -0
  256. package/dist/schemas/activity.d.ts +2 -0
  257. package/dist/schemas/activity.d.ts.map +1 -1
  258. package/dist/schemas/activity.js +4 -0
  259. package/dist/schemas/activity.js.map +1 -1
  260. package/dist/schemas/agent.d.ts +16 -4
  261. package/dist/schemas/agent.d.ts.map +1 -1
  262. package/dist/schemas/agent.js +21 -4
  263. package/dist/schemas/agent.js.map +1 -1
  264. package/dist/schemas/agents.d.ts +17 -4
  265. package/dist/schemas/agents.d.ts.map +1 -1
  266. package/dist/schemas/agents.js +15 -4
  267. package/dist/schemas/agents.js.map +1 -1
  268. package/dist/schemas/approvals.d.ts.map +1 -1
  269. package/dist/schemas/approvals.js.map +1 -1
  270. package/dist/schemas/automations.d.ts +54 -28
  271. package/dist/schemas/automations.d.ts.map +1 -1
  272. package/dist/schemas/automations.js +26 -8
  273. package/dist/schemas/automations.js.map +1 -1
  274. package/dist/schemas/capabilities.d.ts +0 -8
  275. package/dist/schemas/capabilities.d.ts.map +1 -1
  276. package/dist/schemas/capabilities.js +0 -4
  277. package/dist/schemas/capabilities.js.map +1 -1
  278. package/dist/schemas/ci.d.ts +10 -0
  279. package/dist/schemas/ci.d.ts.map +1 -1
  280. package/dist/schemas/ci.js +9 -1
  281. package/dist/schemas/ci.js.map +1 -1
  282. package/dist/schemas/codebase-health.d.ts.map +1 -1
  283. package/dist/schemas/codebase-health.js.map +1 -1
  284. package/dist/schemas/devices.d.ts +90 -0
  285. package/dist/schemas/devices.d.ts.map +1 -1
  286. package/dist/schemas/devices.js +10 -1
  287. package/dist/schemas/devices.js.map +1 -1
  288. package/dist/schemas/engines.d.ts.map +1 -1
  289. package/dist/schemas/engines.js.map +1 -1
  290. package/dist/schemas/environment.d.ts.map +1 -1
  291. package/dist/schemas/environment.js.map +1 -1
  292. package/dist/schemas/exit.d.ts.map +1 -1
  293. package/dist/schemas/exit.js.map +1 -1
  294. package/dist/schemas/extension-updates.d.ts.map +1 -1
  295. package/dist/schemas/extension-updates.js.map +1 -1
  296. package/dist/schemas/git-history.d.ts.map +1 -1
  297. package/dist/schemas/git-history.js.map +1 -1
  298. package/dist/schemas/git.d.ts +80 -16
  299. package/dist/schemas/git.d.ts.map +1 -1
  300. package/dist/schemas/git.js +37 -25
  301. package/dist/schemas/git.js.map +1 -1
  302. package/dist/schemas/history.d.ts.map +1 -1
  303. package/dist/schemas/history.js.map +1 -1
  304. package/dist/schemas/hosts.d.ts.map +1 -1
  305. package/dist/schemas/hosts.js.map +1 -1
  306. package/dist/schemas/inventory.d.ts.map +1 -1
  307. package/dist/schemas/inventory.js.map +1 -1
  308. package/dist/schemas/issues.d.ts +0 -1
  309. package/dist/schemas/issues.d.ts.map +1 -1
  310. package/dist/schemas/issues.js +0 -1
  311. package/dist/schemas/issues.js.map +1 -1
  312. package/dist/schemas/logs.d.ts.map +1 -1
  313. package/dist/schemas/logs.js.map +1 -1
  314. package/dist/schemas/loops.d.ts.map +1 -1
  315. package/dist/schemas/loops.js +1 -1
  316. package/dist/schemas/loops.js.map +1 -1
  317. package/dist/schemas/maintenance.d.ts.map +1 -1
  318. package/dist/schemas/maintenance.js.map +1 -1
  319. package/dist/schemas/marketplace.d.ts +0 -4
  320. package/dist/schemas/marketplace.d.ts.map +1 -1
  321. package/dist/schemas/panels.d.ts.map +1 -1
  322. package/dist/schemas/panels.js.map +1 -1
  323. package/dist/schemas/personas.d.ts +2 -1
  324. package/dist/schemas/personas.d.ts.map +1 -1
  325. package/dist/schemas/personas.js +6 -2
  326. package/dist/schemas/personas.js.map +1 -1
  327. package/dist/schemas/plan-limits.d.ts +2 -4
  328. package/dist/schemas/plan-limits.d.ts.map +1 -1
  329. package/dist/schemas/plan-limits.js +5 -8
  330. package/dist/schemas/plan-limits.js.map +1 -1
  331. package/dist/schemas/ports.d.ts.map +1 -1
  332. package/dist/schemas/ports.js.map +1 -1
  333. package/dist/schemas/provider-oauth.d.ts.map +1 -1
  334. package/dist/schemas/provider-oauth.js.map +1 -1
  335. package/dist/schemas/provider-subscriptions.d.ts +1 -1
  336. package/dist/schemas/provider-subscriptions.d.ts.map +1 -1
  337. package/dist/schemas/provider-subscriptions.js +1 -1
  338. package/dist/schemas/provider-subscriptions.js.map +1 -1
  339. package/dist/schemas/public.d.ts.map +1 -1
  340. package/dist/schemas/public.js.map +1 -1
  341. package/dist/schemas/push.d.ts.map +1 -1
  342. package/dist/schemas/push.js.map +1 -1
  343. package/dist/schemas/secrets.d.ts.map +1 -1
  344. package/dist/schemas/secrets.js.map +1 -1
  345. package/dist/schemas/settings.d.ts +6 -9
  346. package/dist/schemas/settings.d.ts.map +1 -1
  347. package/dist/schemas/settings.js +16 -5
  348. package/dist/schemas/settings.js.map +1 -1
  349. package/dist/schemas/share.d.ts.map +1 -1
  350. package/dist/schemas/share.js.map +1 -1
  351. package/dist/schemas/shared.d.ts +4 -0
  352. package/dist/schemas/shared.d.ts.map +1 -1
  353. package/dist/schemas/shared.js +3 -0
  354. package/dist/schemas/shared.js.map +1 -1
  355. package/dist/schemas/system.d.ts +6 -0
  356. package/dist/schemas/system.d.ts.map +1 -1
  357. package/dist/schemas/system.js +10 -0
  358. package/dist/schemas/system.js.map +1 -1
  359. package/dist/schemas/terminal.d.ts.map +1 -1
  360. package/dist/schemas/terminal.js.map +1 -1
  361. package/dist/schemas/usage.d.ts.map +1 -1
  362. package/dist/schemas/usage.js.map +1 -1
  363. package/dist/schemas/vpn.d.ts.map +1 -1
  364. package/dist/schemas/vpn.js.map +1 -1
  365. package/dist/schemas/webext.d.ts.map +1 -1
  366. package/dist/schemas/webext.js.map +1 -1
  367. package/dist/schemas/workflows.d.ts +66 -9
  368. package/dist/schemas/workflows.d.ts.map +1 -1
  369. package/dist/schemas/workflows.js +6 -5
  370. package/dist/schemas/workflows.js.map +1 -1
  371. package/dist/schemas/workspace-repos.d.ts.map +1 -1
  372. package/dist/schemas/workspace-repos.js.map +1 -1
  373. package/dist/schemas/workspace-search.d.ts.map +1 -1
  374. package/dist/schemas/workspace-search.js.map +1 -1
  375. package/dist/schemas/workspace-setup.d.ts.map +1 -1
  376. package/dist/schemas/workspace-setup.js.map +1 -1
  377. package/dist/schemas/workspace-tree.d.ts.map +1 -1
  378. package/dist/schemas/workspace-tree.js.map +1 -1
  379. package/dist/state/arrival.d.ts.map +1 -0
  380. package/dist/{arrival.js → state/arrival.js} +1 -1
  381. package/dist/state/arrival.js.map +1 -0
  382. package/dist/state/contract-lock.d.ts.map +1 -0
  383. package/dist/{contract-lock.js → state/contract-lock.js} +1 -1
  384. package/dist/state/contract-lock.js.map +1 -0
  385. package/dist/{definition.d.ts → state/definition.d.ts} +21 -17
  386. package/dist/state/definition.d.ts.map +1 -0
  387. package/dist/{definition.js → state/definition.js} +4 -4
  388. package/dist/state/definition.js.map +1 -0
  389. package/dist/state/history-state.d.ts.map +1 -0
  390. package/dist/{history-state.js → state/history-state.js} +1 -0
  391. package/dist/state/history-state.js.map +1 -0
  392. package/dist/state/runtime-state.d.ts.map +1 -0
  393. package/dist/state/runtime-state.js.map +1 -0
  394. package/dist/state/starter.d.ts.map +1 -0
  395. package/dist/state/starter.js.map +1 -0
  396. package/dist/state/state-portability.d.ts.map +1 -0
  397. package/dist/state/state-portability.js.map +1 -0
  398. package/dist/state/versions.d.ts.map +1 -0
  399. package/dist/state/versions.js.map +1 -0
  400. package/dist/{workspace-state.d.ts → state/workspace-state.d.ts} +8 -0
  401. package/dist/state/workspace-state.d.ts.map +1 -0
  402. package/dist/{workspace-state.js → state/workspace-state.js} +25 -0
  403. package/dist/state/workspace-state.js.map +1 -0
  404. package/dist/{documents.d.ts → text/documents.d.ts} +1 -1
  405. package/dist/text/documents.d.ts.map +1 -0
  406. package/dist/{documents.js → text/documents.js} +1 -1
  407. package/dist/text/documents.js.map +1 -0
  408. package/dist/text/embed.d.ts.map +1 -0
  409. package/dist/text/embed.js.map +1 -0
  410. package/dist/text/mentions.d.ts.map +1 -0
  411. package/dist/text/mentions.js.map +1 -0
  412. package/dist/text/model-answer.d.ts +3 -0
  413. package/dist/text/model-answer.d.ts.map +1 -0
  414. package/dist/text/model-answer.js +3 -0
  415. package/dist/text/model-answer.js.map +1 -0
  416. package/dist/text/path-refs.d.ts.map +1 -0
  417. package/dist/text/path-refs.js.map +1 -0
  418. package/dist/{shell-regions.d.ts → text/shell-regions.d.ts} +1 -1
  419. package/dist/text/shell-regions.d.ts.map +1 -0
  420. package/dist/text/shell-regions.js.map +1 -0
  421. package/dist/text/title.d.ts.map +1 -0
  422. package/dist/text/title.js.map +1 -0
  423. package/dist/{transcript-fold.d.ts → text/transcript-fold.d.ts} +2 -1
  424. package/dist/text/transcript-fold.d.ts.map +1 -0
  425. package/dist/{transcript-fold.js → text/transcript-fold.js} +2 -16
  426. package/dist/text/transcript-fold.js.map +1 -0
  427. package/dist/text/whisper.d.ts +3 -0
  428. package/dist/text/whisper.d.ts.map +1 -0
  429. package/dist/text/whisper.js +11 -0
  430. package/dist/text/whisper.js.map +1 -0
  431. package/dist/{workflow-faults.d.ts → text/workflow-faults.d.ts} +1 -1
  432. package/dist/text/workflow-faults.d.ts.map +1 -0
  433. package/dist/{workflow-faults.js → text/workflow-faults.js} +1 -1
  434. package/dist/text/workflow-faults.js.map +1 -0
  435. package/package.json +70 -70
  436. package/src/chores/chores.test.ts +4 -10
  437. package/src/chores/chores.ts +148 -392
  438. package/src/chores/digest.ts +8 -28
  439. package/src/chores/extension-update.ts +3 -8
  440. package/src/chores/fix-deps.ts +4 -18
  441. package/src/chores/index.ts +2 -2
  442. package/src/chores/probes.test.ts +7 -43
  443. package/src/chores/probes.ts +62 -167
  444. package/src/chores/prompt.ts +10 -34
  445. package/src/chores/stack.test.ts +6 -45
  446. package/src/chores/stack.ts +27 -118
  447. package/src/chores/verdict.test.ts +101 -80
  448. package/src/chores/verdict.ts +54 -99
  449. package/src/contracts/accounts.contract.ts +4 -19
  450. package/src/contracts/agent.contract.ts +7 -22
  451. package/src/contracts/agents.contract.ts +25 -71
  452. package/src/contracts/automations.contract.ts +14 -30
  453. package/src/contracts/capabilities.contract.ts +8 -35
  454. package/src/contracts/chores.contract.ts +4 -15
  455. package/src/contracts/endpoints.contract.ts +5 -22
  456. package/src/contracts/exit.contract.ts +7 -30
  457. package/src/contracts/extensions.contract.ts +8 -30
  458. package/src/contracts/git.contract.ts +25 -49
  459. package/src/contracts/host.contract.ts +9 -44
  460. package/src/contracts/intentic.contract.ts +1 -1
  461. package/src/contracts/logs.contract.ts +3 -13
  462. package/src/contracts/loops.contract.ts +9 -40
  463. package/src/contracts/personas.contract.ts +10 -35
  464. package/src/contracts/providers.contract.ts +4 -17
  465. package/src/contracts/runner.contract.ts +12 -39
  466. package/src/contracts/safety.contract.ts +5 -14
  467. package/src/contracts/secrets.contract.ts +4 -22
  468. package/src/contracts/sessions.contract.ts +1 -1
  469. package/src/contracts/settings.contract.ts +4 -10
  470. package/src/contracts/share.contract.ts +3 -9
  471. package/src/contracts/skills.contract.ts +4 -15
  472. package/src/contracts/system.contract.ts +26 -52
  473. package/src/contracts/usage.contract.ts +7 -21
  474. package/src/contracts/vpn.contract.ts +9 -16
  475. package/src/contracts/webext.contract.ts +9 -25
  476. package/src/contracts/workflows.contract.ts +34 -58
  477. package/src/contracts/workspace.contract.ts +19 -50
  478. package/src/events/agent-events.ts +345 -0
  479. package/src/events/cards.ts +286 -0
  480. package/src/{events.test.ts → events/resume.test.ts} +4 -19
  481. package/src/events/resume.ts +60 -0
  482. package/src/events/system-events.ts +139 -0
  483. package/src/events/transcript.ts +320 -0
  484. package/src/{conversation-ids.test.ts → ids/conversation-ids.test.ts} +25 -13
  485. package/src/ids/conversation-ids.ts +178 -0
  486. package/src/ids/hostnames.ts +129 -0
  487. package/src/ids/session-names.ts +29 -0
  488. package/src/ids/share-paths.ts +43 -0
  489. package/src/{tunnel-ids.test.ts → ids/tunnel-ids.test.ts} +1 -14
  490. package/src/ids/tunnel-ids.ts +29 -0
  491. package/src/index.ts +71 -87
  492. package/src/{agent-catalog.test.ts → models/agent-catalog.test.ts} +19 -93
  493. package/src/models/agent-catalog.ts +174 -0
  494. package/src/models/agent-runtimes.ts +201 -0
  495. package/src/models/capability-ledger.test.ts +84 -0
  496. package/src/{fast-tier.test.ts → models/fast-tier.test.ts} +7 -18
  497. package/src/models/fast-tier.ts +36 -0
  498. package/src/{model-order.test.ts → models/model-order.test.ts} +19 -40
  499. package/src/models/model-order.ts +163 -0
  500. package/src/{model-pins.test.ts → models/model-pins.test.ts} +12 -46
  501. package/src/models/model-pins.ts +57 -0
  502. package/src/models/model-roles.test.ts +38 -0
  503. package/src/models/model-roles.ts +180 -0
  504. package/src/{plan-pools.test.ts → models/plan-pools.test.ts} +6 -11
  505. package/src/models/plan-pools.ts +65 -0
  506. package/src/{prompt-complexity.test.ts → models/prompt-complexity.test.ts} +8 -60
  507. package/src/models/prompt-complexity.ts +215 -0
  508. package/src/{provider-specs.test.ts → models/provider-specs.test.ts} +18 -47
  509. package/src/models/provider-specs.ts +272 -0
  510. package/src/policy/approvals-execution.ts +58 -0
  511. package/src/{batch-runs.test.ts → policy/batch-runs.test.ts} +4 -20
  512. package/src/policy/batch-runs.ts +137 -0
  513. package/src/policy/capability-secrets.ts +5 -0
  514. package/src/{card-status.ts → policy/card-status.ts} +11 -26
  515. package/src/{command-classes.test.ts → policy/command-classes.test.ts} +11 -118
  516. package/src/policy/command-classes.ts +395 -0
  517. package/src/policy/command-run.ts +65 -0
  518. package/src/policy/control-scopes.ts +38 -0
  519. package/src/{credential-material.test.ts → policy/credential-material.test.ts} +4 -26
  520. package/src/policy/credential-material.ts +91 -0
  521. package/src/policy/needs-action.ts +5 -0
  522. package/src/policy/output-fields.ts +86 -0
  523. package/src/policy/overlay-lint.ts +100 -0
  524. package/src/{owner-ticket.test.ts → policy/owner-ticket.test.ts} +1 -1
  525. package/src/{owner-ticket.ts → policy/owner-ticket.ts} +9 -31
  526. package/src/policy/safety-policy.test.ts +84 -0
  527. package/src/policy/safety-policy.ts +142 -0
  528. package/src/policy/search-globs.ts +60 -0
  529. package/src/protocol/container-requirements.test.ts +72 -0
  530. package/src/protocol/container-requirements.ts +58 -0
  531. package/src/protocol/host-protocol.ts +29 -0
  532. package/src/protocol/ingress-contract.ts +103 -0
  533. package/src/{ingress-protocol.test.ts → protocol/ingress-protocol.test.ts} +25 -90
  534. package/src/protocol/ingress-protocol.ts +441 -0
  535. package/src/protocol/listener-protocol.ts +75 -0
  536. package/src/{peer-dial.test.ts → protocol/peer-dial.test.ts} +52 -1
  537. package/src/protocol/peer-dial.ts +207 -0
  538. package/src/{peer-mcp-server.ts → protocol/peer-mcp-server.ts} +16 -41
  539. package/src/protocol/request-id.ts +5 -0
  540. package/src/{routes.test.ts → protocol/routes.test.ts} +14 -22
  541. package/src/protocol/routes.ts +159 -0
  542. package/src/protocol/runner-protocol.ts +197 -0
  543. package/src/protocol/terminal-protocol.ts +13 -0
  544. package/src/protocol/webext-links.ts +50 -0
  545. package/src/protocol/webext-protocol.ts +24 -0
  546. package/src/schemas/activity.ts +22 -30
  547. package/src/schemas/agent.ts +130 -238
  548. package/src/schemas/agents.ts +165 -483
  549. package/src/schemas/approvals.ts +23 -71
  550. package/src/schemas/automations.ts +142 -250
  551. package/src/schemas/capabilities.ts +127 -414
  552. package/src/schemas/ci.ts +56 -108
  553. package/src/schemas/codebase-health.ts +7 -11
  554. package/src/schemas/devices.ts +98 -321
  555. package/src/schemas/engines.ts +16 -44
  556. package/src/schemas/environment.ts +41 -91
  557. package/src/schemas/exit.ts +24 -81
  558. package/src/schemas/extension-updates.ts +42 -87
  559. package/src/schemas/git-history.ts +30 -84
  560. package/src/schemas/git.ts +141 -256
  561. package/src/schemas/history.ts +14 -40
  562. package/src/schemas/hosts.ts +9 -15
  563. package/src/schemas/inventory.ts +8 -10
  564. package/src/schemas/issues.ts +66 -134
  565. package/src/schemas/logs.ts +15 -34
  566. package/src/schemas/loops.ts +46 -163
  567. package/src/schemas/maintenance.ts +47 -172
  568. package/src/schemas/panels.ts +20 -45
  569. package/src/schemas/personas.ts +50 -200
  570. package/src/schemas/plan-limits.ts +58 -197
  571. package/src/schemas/ports.ts +14 -32
  572. package/src/schemas/provider-oauth.ts +23 -76
  573. package/src/schemas/provider-subscriptions.ts +4 -13
  574. package/src/schemas/public.ts +4 -15
  575. package/src/schemas/push.ts +8 -36
  576. package/src/schemas/secrets.ts +20 -64
  577. package/src/schemas/settings.ts +175 -600
  578. package/src/schemas/share.ts +14 -32
  579. package/src/schemas/shared.ts +14 -13
  580. package/src/schemas/system.ts +46 -78
  581. package/src/schemas/terminal.ts +41 -120
  582. package/src/schemas/usage.ts +44 -233
  583. package/src/schemas/version-seam.test.ts +9 -26
  584. package/src/schemas/vpn.ts +27 -64
  585. package/src/schemas/webext.ts +22 -53
  586. package/src/schemas/workflows.ts +57 -183
  587. package/src/schemas/workspace-repos.ts +12 -24
  588. package/src/schemas/workspace-search.ts +17 -35
  589. package/src/schemas/workspace-setup.ts +4 -11
  590. package/src/schemas/workspace-tree.ts +32 -91
  591. package/src/state/arrival.ts +109 -0
  592. package/src/state/contract-lock.test.ts +17 -0
  593. package/src/state/contract-lock.ts +49 -0
  594. package/src/state/definition.ts +143 -0
  595. package/src/state/history-state.ts +103 -0
  596. package/src/{runtime-state.test.ts → state/runtime-state.test.ts} +3 -10
  597. package/src/state/runtime-state.ts +62 -0
  598. package/src/state/starter.ts +5 -0
  599. package/src/state/state-portability.ts +27 -0
  600. package/src/state/versions.ts +26 -0
  601. package/src/{workspace-state.test.ts → state/workspace-state.test.ts} +65 -172
  602. package/src/state/workspace-state.ts +669 -0
  603. package/src/{documents.test.ts → text/documents.test.ts} +1 -1
  604. package/src/text/documents.ts +42 -0
  605. package/src/text/embed.ts +132 -0
  606. package/src/text/mentions.ts +21 -0
  607. package/src/text/model-answer.ts +9 -0
  608. package/src/text/path-refs.ts +39 -0
  609. package/src/text/shell-regions.ts +224 -0
  610. package/src/{title.test.ts → text/title.test.ts} +13 -32
  611. package/src/text/title.ts +202 -0
  612. package/src/{transcript-fold.test.ts → text/transcript-fold.test.ts} +5 -83
  613. package/src/{transcript-fold.ts → text/transcript-fold.ts} +65 -170
  614. package/src/text/whisper.test.ts +19 -0
  615. package/src/text/whisper.ts +17 -0
  616. package/src/{workflow-faults.test.ts → text/workflow-faults.test.ts} +6 -24
  617. package/src/{workflow-faults.ts → text/workflow-faults.ts} +20 -60
  618. package/dist/agent-catalog.d.ts.map +0 -1
  619. package/dist/agent-catalog.js.map +0 -1
  620. package/dist/agent-runtimes.d.ts.map +0 -1
  621. package/dist/agent-runtimes.js.map +0 -1
  622. package/dist/approvals-execution.d.ts.map +0 -1
  623. package/dist/approvals-execution.js.map +0 -1
  624. package/dist/arrival.d.ts.map +0 -1
  625. package/dist/arrival.js.map +0 -1
  626. package/dist/batch-runs.d.ts.map +0 -1
  627. package/dist/batch-runs.js.map +0 -1
  628. package/dist/capability-env.d.ts.map +0 -1
  629. package/dist/capability-env.js.map +0 -1
  630. package/dist/capability-secrets.d.ts.map +0 -1
  631. package/dist/capability-secrets.js.map +0 -1
  632. package/dist/card-status.d.ts.map +0 -1
  633. package/dist/card-status.js.map +0 -1
  634. package/dist/command-classes.d.ts.map +0 -1
  635. package/dist/command-classes.js.map +0 -1
  636. package/dist/command-run.d.ts.map +0 -1
  637. package/dist/command-run.js.map +0 -1
  638. package/dist/contract-lock.d.ts.map +0 -1
  639. package/dist/contract-lock.js.map +0 -1
  640. package/dist/conversation-ids.d.ts +0 -4
  641. package/dist/conversation-ids.d.ts.map +0 -1
  642. package/dist/conversation-ids.js.map +0 -1
  643. package/dist/credential-material.d.ts.map +0 -1
  644. package/dist/credential-material.js.map +0 -1
  645. package/dist/definition.d.ts.map +0 -1
  646. package/dist/definition.js.map +0 -1
  647. package/dist/documents.d.ts.map +0 -1
  648. package/dist/documents.js.map +0 -1
  649. package/dist/embed.d.ts.map +0 -1
  650. package/dist/embed.js.map +0 -1
  651. package/dist/events.d.ts +0 -4336
  652. package/dist/events.d.ts.map +0 -1
  653. package/dist/events.js +0 -725
  654. package/dist/events.js.map +0 -1
  655. package/dist/fast-tier.d.ts.map +0 -1
  656. package/dist/fast-tier.js.map +0 -1
  657. package/dist/history-state.d.ts.map +0 -1
  658. package/dist/history-state.js.map +0 -1
  659. package/dist/host-protocol.d.ts.map +0 -1
  660. package/dist/host-protocol.js.map +0 -1
  661. package/dist/hostnames.d.ts.map +0 -1
  662. package/dist/hostnames.js.map +0 -1
  663. package/dist/ingress-contract.d.ts.map +0 -1
  664. package/dist/ingress-contract.js.map +0 -1
  665. package/dist/ingress-protocol.d.ts.map +0 -1
  666. package/dist/ingress-protocol.js.map +0 -1
  667. package/dist/listener-protocol.d.ts.map +0 -1
  668. package/dist/listener-protocol.js.map +0 -1
  669. package/dist/mentions.d.ts.map +0 -1
  670. package/dist/mentions.js.map +0 -1
  671. package/dist/model-order.d.ts.map +0 -1
  672. package/dist/model-order.js.map +0 -1
  673. package/dist/model-pins.d.ts.map +0 -1
  674. package/dist/model-pins.js.map +0 -1
  675. package/dist/model-roles.d.ts.map +0 -1
  676. package/dist/model-roles.js.map +0 -1
  677. package/dist/needs-action.d.ts.map +0 -1
  678. package/dist/needs-action.js.map +0 -1
  679. package/dist/output-fields.d.ts.map +0 -1
  680. package/dist/output-fields.js.map +0 -1
  681. package/dist/overlay-lint.d.ts.map +0 -1
  682. package/dist/overlay-lint.js.map +0 -1
  683. package/dist/owner-ticket.d.ts.map +0 -1
  684. package/dist/owner-ticket.js.map +0 -1
  685. package/dist/path-refs.d.ts.map +0 -1
  686. package/dist/path-refs.js.map +0 -1
  687. package/dist/peer-dial.d.ts.map +0 -1
  688. package/dist/peer-dial.js.map +0 -1
  689. package/dist/peer-mcp-server.d.ts.map +0 -1
  690. package/dist/peer-mcp-server.js.map +0 -1
  691. package/dist/plan-pools.d.ts.map +0 -1
  692. package/dist/plan-pools.js.map +0 -1
  693. package/dist/prompt-complexity.d.ts.map +0 -1
  694. package/dist/prompt-complexity.js.map +0 -1
  695. package/dist/provider-specs.d.ts.map +0 -1
  696. package/dist/provider-specs.js.map +0 -1
  697. package/dist/request-id.d.ts.map +0 -1
  698. package/dist/request-id.js.map +0 -1
  699. package/dist/routes.d.ts.map +0 -1
  700. package/dist/routes.js.map +0 -1
  701. package/dist/runner-protocol.d.ts.map +0 -1
  702. package/dist/runner-protocol.js.map +0 -1
  703. package/dist/runtime-state.d.ts.map +0 -1
  704. package/dist/runtime-state.js.map +0 -1
  705. package/dist/safety-policy.d.ts.map +0 -1
  706. package/dist/safety-policy.js.map +0 -1
  707. package/dist/search-globs.d.ts.map +0 -1
  708. package/dist/search-globs.js.map +0 -1
  709. package/dist/session-names.d.ts.map +0 -1
  710. package/dist/session-names.js.map +0 -1
  711. package/dist/share-paths.d.ts.map +0 -1
  712. package/dist/share-paths.js.map +0 -1
  713. package/dist/shell-regions.d.ts.map +0 -1
  714. package/dist/shell-regions.js.map +0 -1
  715. package/dist/sse.d.ts.map +0 -1
  716. package/dist/sse.js.map +0 -1
  717. package/dist/starter.d.ts.map +0 -1
  718. package/dist/starter.js.map +0 -1
  719. package/dist/state-portability.d.ts.map +0 -1
  720. package/dist/state-portability.js.map +0 -1
  721. package/dist/terminal-protocol.d.ts.map +0 -1
  722. package/dist/terminal-protocol.js.map +0 -1
  723. package/dist/title.d.ts.map +0 -1
  724. package/dist/title.js.map +0 -1
  725. package/dist/transcript-fold.d.ts.map +0 -1
  726. package/dist/transcript-fold.js.map +0 -1
  727. package/dist/tunnel-ids.d.ts.map +0 -1
  728. package/dist/tunnel-ids.js.map +0 -1
  729. package/dist/versions.d.ts.map +0 -1
  730. package/dist/versions.js.map +0 -1
  731. package/dist/webext-links.d.ts.map +0 -1
  732. package/dist/webext-links.js.map +0 -1
  733. package/dist/webext-protocol.d.ts.map +0 -1
  734. package/dist/webext-protocol.js.map +0 -1
  735. package/dist/workflow-faults.d.ts.map +0 -1
  736. package/dist/workflow-faults.js.map +0 -1
  737. package/dist/workspace-state.d.ts.map +0 -1
  738. package/dist/workspace-state.js.map +0 -1
  739. package/src/agent-catalog.ts +0 -316
  740. package/src/agent-runtimes.ts +0 -419
  741. package/src/approvals-execution.ts +0 -96
  742. package/src/arrival.ts +0 -160
  743. package/src/batch-runs.ts +0 -188
  744. package/src/capability-ledger.test.ts +0 -140
  745. package/src/capability-secrets.ts +0 -20
  746. package/src/command-classes.ts +0 -617
  747. package/src/command-run.ts +0 -78
  748. package/src/contract-lock.test.ts +0 -23
  749. package/src/contract-lock.ts +0 -66
  750. package/src/conversation-ids.ts +0 -207
  751. package/src/credential-material.ts +0 -181
  752. package/src/definition.ts +0 -207
  753. package/src/documents.ts +0 -67
  754. package/src/embed.ts +0 -164
  755. package/src/events.ts +0 -1870
  756. package/src/fast-tier.ts +0 -72
  757. package/src/history-state.ts +0 -174
  758. package/src/host-protocol.ts +0 -36
  759. package/src/hostnames.ts +0 -180
  760. package/src/ingress-contract.ts +0 -157
  761. package/src/ingress-protocol.ts +0 -625
  762. package/src/listener-protocol.ts +0 -96
  763. package/src/mentions.ts +0 -25
  764. package/src/model-order.ts +0 -262
  765. package/src/model-pins.ts +0 -132
  766. package/src/model-roles.test.ts +0 -52
  767. package/src/model-roles.ts +0 -320
  768. package/src/needs-action.ts +0 -14
  769. package/src/output-fields.ts +0 -111
  770. package/src/overlay-lint.ts +0 -116
  771. package/src/path-refs.ts +0 -59
  772. package/src/peer-dial.ts +0 -163
  773. package/src/plan-pools.ts +0 -92
  774. package/src/prompt-complexity.ts +0 -334
  775. package/src/provider-specs.ts +0 -432
  776. package/src/request-id.ts +0 -41
  777. package/src/routes.ts +0 -219
  778. package/src/runner-protocol.ts +0 -239
  779. package/src/runtime-state.ts +0 -140
  780. package/src/safety-policy.test.ts +0 -88
  781. package/src/safety-policy.ts +0 -258
  782. package/src/search-globs.ts +0 -76
  783. package/src/session-names.ts +0 -44
  784. package/src/share-paths.ts +0 -68
  785. package/src/shell-regions.ts +0 -289
  786. package/src/starter.ts +0 -13
  787. package/src/state-portability.ts +0 -56
  788. package/src/terminal-protocol.ts +0 -16
  789. package/src/title.ts +0 -267
  790. package/src/tunnel-ids.ts +0 -57
  791. package/src/versions.ts +0 -48
  792. package/src/webext-links.ts +0 -90
  793. package/src/webext-protocol.ts +0 -27
  794. package/src/workspace-state.ts +0 -1090
  795. /package/dist/{hostnames.d.ts → ids/hostnames.d.ts} +0 -0
  796. /package/dist/{hostnames.js → ids/hostnames.js} +0 -0
  797. /package/dist/{session-names.d.ts → ids/session-names.d.ts} +0 -0
  798. /package/dist/{session-names.js → ids/session-names.js} +0 -0
  799. /package/dist/{share-paths.d.ts → ids/share-paths.d.ts} +0 -0
  800. /package/dist/{share-paths.js → ids/share-paths.js} +0 -0
  801. /package/dist/{agent-catalog.js → models/agent-catalog.js} +0 -0
  802. /package/dist/{agent-runtimes.d.ts → models/agent-runtimes.d.ts} +0 -0
  803. /package/dist/{agent-runtimes.js → models/agent-runtimes.js} +0 -0
  804. /package/dist/{fast-tier.js → models/fast-tier.js} +0 -0
  805. /package/dist/{model-order.d.ts → models/model-order.d.ts} +0 -0
  806. /package/dist/{model-order.js → models/model-order.js} +0 -0
  807. /package/dist/{model-pins.js → models/model-pins.js} +0 -0
  808. /package/dist/{plan-pools.js → models/plan-pools.js} +0 -0
  809. /package/dist/{prompt-complexity.d.ts → models/prompt-complexity.d.ts} +0 -0
  810. /package/dist/{prompt-complexity.js → models/prompt-complexity.js} +0 -0
  811. /package/dist/{provider-specs.d.ts → models/provider-specs.d.ts} +0 -0
  812. /package/dist/{provider-specs.js → models/provider-specs.js} +0 -0
  813. /package/dist/{approvals-execution.d.ts → policy/approvals-execution.d.ts} +0 -0
  814. /package/dist/{approvals-execution.js → policy/approvals-execution.js} +0 -0
  815. /package/dist/{capability-env.d.ts → policy/capability-env.d.ts} +0 -0
  816. /package/dist/{capability-env.js → policy/capability-env.js} +0 -0
  817. /package/dist/{capability-secrets.d.ts → policy/capability-secrets.d.ts} +0 -0
  818. /package/dist/{capability-secrets.js → policy/capability-secrets.js} +0 -0
  819. /package/dist/{command-run.js → policy/command-run.js} +0 -0
  820. /package/dist/{credential-material.d.ts → policy/credential-material.d.ts} +0 -0
  821. /package/dist/{credential-material.js → policy/credential-material.js} +0 -0
  822. /package/dist/{needs-action.d.ts → policy/needs-action.d.ts} +0 -0
  823. /package/dist/{needs-action.js → policy/needs-action.js} +0 -0
  824. /package/dist/{output-fields.d.ts → policy/output-fields.d.ts} +0 -0
  825. /package/dist/{output-fields.js → policy/output-fields.js} +0 -0
  826. /package/dist/{overlay-lint.d.ts → policy/overlay-lint.d.ts} +0 -0
  827. /package/dist/{overlay-lint.js → policy/overlay-lint.js} +0 -0
  828. /package/dist/{owner-ticket.d.ts → policy/owner-ticket.d.ts} +0 -0
  829. /package/dist/{search-globs.d.ts → policy/search-globs.d.ts} +0 -0
  830. /package/dist/{search-globs.js → policy/search-globs.js} +0 -0
  831. /package/dist/{ingress-contract.d.ts → protocol/ingress-contract.d.ts} +0 -0
  832. /package/dist/{ingress-protocol.d.ts → protocol/ingress-protocol.d.ts} +0 -0
  833. /package/dist/{ingress-protocol.js → protocol/ingress-protocol.js} +0 -0
  834. /package/dist/{listener-protocol.d.ts → protocol/listener-protocol.d.ts} +0 -0
  835. /package/dist/{peer-mcp-server.d.ts → protocol/peer-mcp-server.d.ts} +0 -0
  836. /package/dist/{peer-mcp-server.js → protocol/peer-mcp-server.js} +0 -0
  837. /package/dist/{request-id.d.ts → protocol/request-id.d.ts} +0 -0
  838. /package/dist/{request-id.js → protocol/request-id.js} +0 -0
  839. /package/dist/{routes.d.ts → protocol/routes.d.ts} +0 -0
  840. /package/dist/{routes.js → protocol/routes.js} +0 -0
  841. /package/dist/{sse.d.ts → protocol/sse.d.ts} +0 -0
  842. /package/dist/{sse.js → protocol/sse.js} +0 -0
  843. /package/dist/{terminal-protocol.js → protocol/terminal-protocol.js} +0 -0
  844. /package/dist/{webext-links.d.ts → protocol/webext-links.d.ts} +0 -0
  845. /package/dist/{webext-links.js → protocol/webext-links.js} +0 -0
  846. /package/dist/{arrival.d.ts → state/arrival.d.ts} +0 -0
  847. /package/dist/{contract-lock.d.ts → state/contract-lock.d.ts} +0 -0
  848. /package/dist/{history-state.d.ts → state/history-state.d.ts} +0 -0
  849. /package/dist/{runtime-state.d.ts → state/runtime-state.d.ts} +0 -0
  850. /package/dist/{runtime-state.js → state/runtime-state.js} +0 -0
  851. /package/dist/{starter.d.ts → state/starter.d.ts} +0 -0
  852. /package/dist/{starter.js → state/starter.js} +0 -0
  853. /package/dist/{state-portability.d.ts → state/state-portability.d.ts} +0 -0
  854. /package/dist/{state-portability.js → state/state-portability.js} +0 -0
  855. /package/dist/{versions.d.ts → state/versions.d.ts} +0 -0
  856. /package/dist/{versions.js → state/versions.js} +0 -0
  857. /package/dist/{embed.d.ts → text/embed.d.ts} +0 -0
  858. /package/dist/{embed.js → text/embed.js} +0 -0
  859. /package/dist/{mentions.d.ts → text/mentions.d.ts} +0 -0
  860. /package/dist/{mentions.js → text/mentions.js} +0 -0
  861. /package/dist/{path-refs.d.ts → text/path-refs.d.ts} +0 -0
  862. /package/dist/{path-refs.js → text/path-refs.js} +0 -0
  863. /package/dist/{shell-regions.js → text/shell-regions.js} +0 -0
  864. /package/dist/{title.d.ts → text/title.d.ts} +0 -0
  865. /package/dist/{title.js → text/title.js} +0 -0
  866. /package/src/{hostnames.test.ts → ids/hostnames.test.ts} +0 -0
  867. /package/src/{share-paths.test.ts → ids/share-paths.test.ts} +0 -0
  868. /package/src/{capability-env.ts → policy/capability-env.ts} +0 -0
  869. /package/src/{overlay-lint.test.ts → policy/overlay-lint.test.ts} +0 -0
  870. /package/src/{search-globs.test.ts → policy/search-globs.test.ts} +0 -0
  871. /package/src/{ingress-contract.test.ts → protocol/ingress-contract.test.ts} +0 -0
  872. /package/src/{peer-mcp-server.test.ts → protocol/peer-mcp-server.test.ts} +0 -0
  873. /package/src/{sse.ts → protocol/sse.ts} +0 -0
  874. /package/src/{versions.test.ts → state/versions.test.ts} +0 -0
  875. /package/src/{embed.test.ts → text/embed.test.ts} +0 -0
  876. /package/src/{mentions.test.ts → text/mentions.test.ts} +0 -0
  877. /package/src/{path-refs.test.ts → text/path-refs.test.ts} +0 -0
@@ -2,55 +2,22 @@
2
2
  import { z } from "zod";
3
3
  import { AgentHarnessSchema, AgentOriginSchema, AgentProviderSchema, ForkedFromSchema } from "./agent.js";
4
4
  import { LoopStateSchema } from "./loops.js";
5
- // A "fleet agent" is any conversation with a registry entry, keyed by its conversationId. Isolated ones own a
6
- // git worktree (branch agent/<id> in every workspace repo); workspace conversations have no branch. The fleet
7
- // surface shows both through the same status/activity/cost lifecycle.
5
+ // A fleet agent is any conversation with a registry entry, keyed by conversationId. Isolated ones own a git worktree
6
+ // (branch agent/<id>); workspace conversations have none, but both share one status/activity/cost lifecycle.
8
7
 
9
- // idle/running/awaiting are the turn lifecycle (awaiting = paused on a plan approval or question); ready /
10
- // landed / conflict are outcomes of the land flow, `ready` is a clean completion whose delta stayed on the
11
- // agent's branch because auto-land is off (the user lands it deliberately, from the review panel or the card);
12
- // error is a terminal turn failure surfaced on the card.
13
- //
14
- // `interrupted` is the turn that never got to report ANY of those: the daemon died under it (a container
15
- // rebuild, a crash, an OOM kill), taking the provider process and the whole runtime half of the fleet, status,
16
- // attention flags, the park a question raised, with it. It exists because the alternative is worse than
17
- // unlabelled: without it such a turn rehydrates as `idle`, which is the resting status of a turn that finished
18
- // CLEANLY, so the board files a killed agent under Finished and the question it was holding disappears with the
19
- // process that asked it. See agents-store.ts, this is the status a live turn leaves on disk.
20
- //
21
- /* `stopping` and `stopped` are the two halves of a user's Stop, and they exist because a hard-cancel is NOT
22
- * instant: /agent/stop aborts the provider and then waits for the turn's generator to unwind (worktree and
23
- * registry cleanup), which is seconds of real time. For that whole window the runtime half still said
24
- * `running`, so every surface kept its spinner turning on a turn the user had already killed, and then the
25
- * card jumped to a settled state out of nowhere. `stopping` is what the daemon knows the instant the abort
26
- * lands, published immediately so the press has a visible result; `stopped` is where the turn comes to rest.
27
- *
28
- * `dismissing` IS THAT SAME WINDOW FOR THE OTHER ENDING A PERSON CHOOSES, waving away the question the turn was
29
- * parked on, and it is a status of its own for one reason: the two endings come to rest in different places.
30
- * A Stop leaves half-written work somebody has to pick up, so its card settles in Attention; a dismissal is
31
- * "I am done with this", so its card settles in Finished. Published as one value, the unwind could not say
32
- * which, so every surface had to park the card where it already was and move it once the turn had ACTUALLY
33
- * finished, seconds later, and the daemon papered over the dismissal half by suppressing the broadcast that
34
- * would have filed it under Active in the meantime — a bet on nothing else broadcasting inside that window,
35
- * which a second agent's frame lost routinely. Said apart, the destination is known at the press: each card
36
- * moves once, immediately, to the lane it is going to end up in, and no surface has to guess or suppress.
37
- *
38
- * `stopped` is deliberately its own value rather than `interrupted` or `error`. Not `error`, which is what a
39
- * stopped turn used to report (every provider adapter surfaces the abort's unwind as an error frame), a card
40
- * accusing the user's own deliberate press of being a failure. Not `interrupted` either: that one means the
41
- * daemon died under the turn, and a boot pass may re-run it, which is precisely what must never happen to a
42
- * turn a person chose to end. */
43
- /* `resuming` is the same argument as `stopping`, made about the other end of a turn's life: the turn was killed
44
- * by something the daemon is ALREADY undoing (a rotated credential being re-minted, a provider outage being
45
- * waited out, turn-resume.ts), so it has stopped without having ended. The gap is real time, a few seconds for
46
- * a re-mint, minutes for an outage's backoff, and for that whole window the turn reported the resting `idle`,
47
- * which the board reads as finished. So a 401 that nobody caused and nobody has to fix filed the card under
48
- * Finished and then pulled it back into Active a moment later, which is the fleet contradicting itself in front
49
- * of the user about work that never stopped being in progress.
50
- *
51
- * Never persisted (see PersistedAgentStatusSchema): what is coming back is remembered in the daemon's memory
52
- * alone, and a daemon that dies mid-wait takes the resume with it, so the card falls back to the ending its
53
- * killed turn actually wrote and reads as finished, which by then is true. Nothing is left to bring it back. */
8
+ // idle/running/awaiting: turn lifecycle (awaiting = paused on a plan or question)
9
+ // ready/landed/conflict: land-flow outcomes (ready = clean completion held on the branch, auto-land off)
10
+ // error: terminal turn failure
11
+ // interrupted: the daemon died under the turn (crash, OOM, rebuild); without it such a turn rehydrates as idle and its
12
+ // parked question disappears
13
+ // stopping/stopped: the two halves of a user's Stop, since a hard-cancel is not instant (`stopping` the moment the
14
+ // abort lands, `stopped` once the turn's generator has unwound)
15
+ // dismissing: the same window for waving away a parked question; settles in Finished rather than Attention, since
16
+ // nothing is left half-done
17
+ // `stopped` is its own value, never `error` (a deliberate stop is not a failure) or `interrupted` (which allows an
18
+ // automatic re-run)
19
+ // resuming: the turn was killed by something the daemon is already undoing (a credential re-mint, an outage backoff);
20
+ // never persisted, since a daemon restart forgets the resume and the turn's own last-written ending becomes true again
54
21
  export const AgentStatusSchema = z.enum([
55
22
  "idle",
56
23
  "running",
@@ -59,6 +26,7 @@ export const AgentStatusSchema = z.enum([
59
26
  "dismissing",
60
27
  "stopped",
61
28
  "resuming",
29
+ "landing",
62
30
  "ready",
63
31
  "landed",
64
32
  "conflict",
@@ -78,48 +46,25 @@ export const AgentAttentionSchema = z.object({
78
46
  plan: z.boolean().describe("It has proposed a plan and is waiting for a yes."),
79
47
  question: z.boolean().describe("It has asked you something."),
80
48
  permission: z.boolean().describe("It wants to use a tool it needs permission for."),
81
- // A priced service run parked on the owner's click (platform/service-offer.ts), the one card where
82
- // waiting costs the agent its whole call, so the lane says "spend approval" rather than a generic pause.
83
- service: z
84
- .boolean()
85
- .describe("It wants to spend money on a paid service and is waiting for approval. The one pause where waiting costs it the whole call."),
86
- // A missing capability parked on the owner's setup (capabilities/capability-offer.ts), the agent is
87
- // waiting for something to be connected, so the lane can say "setup needed" rather than a generic pause.
49
+ // A missing capability (capabilities/capability-offer.ts); lets the lane say "setup needed" rather than a generic
50
+ // pause.
88
51
  capability: z.boolean().describe("It needs something connected that is not connected yet."),
89
- // A gated credential parked on a NAMED person's click (secrets/credential-gate.ts). Its own lane because
90
- // it is the one pause the person reading the board may not be able to clear: every other card here waits
91
- // for whoever is looking at it, this one waits for the specific people the gate names.
52
+ // A gated credential parked on a named person's click; the one pause the board's reader may not be able to clear
53
+ // themselves.
92
54
  credential: z
93
55
  .boolean()
94
56
  .describe("It is waiting for a named person to release a credential. The one pause that may not be yours to clear, whatever your role."),
95
57
  conflict: z.boolean().describe("Its work cannot be merged without somebody resolving a clash."),
96
58
  });
97
59
  export type AgentAttention = z.infer<typeof AgentAttentionSchema>;
98
- /* WHAT THE LAST TURN LEFT OPEN, as the turn itself measured it at the moment it ended.
99
- *
100
- * Every other "needs you" on this card is a turn PARKED on somebody (AgentAttentionSchema): the agent is still
101
- * there, waiting, and the board can say so because the pause is live. This is the opposite shape and the reason
102
- * it is a field of its own: the turn is over, nobody is waiting, and the work stopped short anyway. That card
103
- * reads `idle` beside a hundred others that finished what they were asked, which is how a session with three of
104
- * seven steps still open goes back onto the board looking exactly like a session that is done.
105
- *
106
- * DERIVED, NEVER DECLARED, and that is the whole design constraint. Nothing here asks a model anything or asks
107
- * an agent to report on itself: both readings are taken from frames the daemon already receives on every
108
- * harness, once, at the finish that flushes the turn's tokens and tool counts. An agent cannot flatter this
109
- * field, and a harness that never learned about it still fills it.
110
- *
111
- * Absent for the ordinary card, which is most of them: a turn that ends with its list clear and its check green
112
- * has nothing to say here, and neither has one that kept no list and stood under no check. */
60
+ // What the last turn left open, measured at the moment it ended, unlike AgentAttentionSchema's live parked waits.
61
+ // Derived from finish frames every harness sends, never self-reported; absent for a turn that closed its list and
62
+ // passed its checks.
113
63
  export const UnfinishedWorkSchema = z.object({
114
- // When the turn that left it this way ended, ms since epoch. What the mark's "…, 2h ago" is measured from,
115
- // and NOT `updatedAt`: a card touched since (a land, a rename) has moved without the work moving.
64
+ // Epoch ms the turn ended; not `updatedAt`, which moves on a land or rename without the work moving.
116
65
  at: z.number().describe("When the turn that left this ended, in milliseconds."),
117
- /* THE AGENT'S OWN CHECKLIST, as of that turn's last word on it (the `todos` frames). `open` counts every
118
- * item not marked completed, `total` the whole list, and `next` names the one it would have done next, the
119
- * in-progress item if there is one, else the first still pending.
120
- *
121
- * It is the agent's own account of the job, so a count here is not an inference about what it meant: it is
122
- * the list it wrote, with items on it nobody crossed off. Absent when the conversation kept no list. */
66
+ // The agent's own checklist as of that turn's last word on it; `open`/`total` count items, `next` is the
67
+ // in-progress or first pending one.
123
68
  steps: z
124
69
  .object({
125
70
  open: z.number().describe("Items on it that were never completed."),
@@ -128,91 +73,56 @@ export const UnfinishedWorkSchema = z.object({
128
73
  })
129
74
  .optional()
130
75
  .describe("The agent's own checklist where that turn left it. Absent for a conversation that kept no list."),
131
- // The name of the `turn.ending` check that ran red on the way out, when one did (rules/turn-ending.ts). A
132
- // turn gets two rounds to repair what a check reports and can then end regardless, so this is the workspace's
133
- // own gate saying the work is not done, in a place nothing but the land used to read.
76
+ // Name of the `turn.ending` check still red when the turn ended, after its two repair rounds ran out.
134
77
  check: z.string().optional().describe("The end-of-turn check that was still failing when the turn ended, by name."),
135
78
  });
136
79
  export type UnfinishedWork = z.infer<typeof UnfinishedWorkSchema>;
137
- /* WHAT A LANDING IS CALLED, the commit message drafted from the landed diff (agents/landed-subject.ts), and
138
- * the whole of it: a subject, and the two trailer sentences a repo that keeps a changelog gets.
139
- *
140
- * ONE SHAPE, TWO CARRIERS, and that is the reason it is a schema of its own rather than three fields written
141
- * out twice. The same sentence reaches the Changes panel down two roads, the fleet roster, which is live and
142
- * drops archived agents, and the review, which is a rescan and outlives the card (OriginAgent), so the panel
143
- * takes whichever answers first and must not care which one did. Two hand-kept copies of these three fields
144
- * would be two things to keep in step, and the one that drifted would be the one nobody was looking at.
145
- *
146
- * THE PARTS STAY APART. A subject is one bounded line everywhere it is stored and shown; the notes are
147
- * sentences for the people who read a release. Flattening them into one string would produce a run-on subject
148
- * in the commit box and a truncated note in the changelog, so they are joined only at the moment of the fill,
149
- * where they become a commit message with its trailers and nowhere before it. */
80
+ // A landing's commit message: subject plus the two trailer sentences a changelog repo gets. One schema, not three
81
+ // duplicated fields, since both the live roster and the review carrier must read the same shape and can't disagree.
150
82
  export const LandedMessageSchema = z.object({
151
- /* WHAT THIS AGENT'S LANDED WORK DID, as a commit subject, written from the landed diff when the work
152
- * arrived, which is why it can say what a title cannot.
153
- *
154
- * A title names the ASK, and it is written once, from the opening prompt, a second into the first turn. A
155
- * conversation that opens "audit the review panel" and then spends four turns fixing what the audit found
156
- * still answers to "Review panel · audit", a good name for the session and a wrong subject for the
157
- * commit. This is read off the code instead, so it describes the change the user is about to record. */
83
+ // Written from the landed diff, not the opening prompt: a session that drifts from its title still needs an
84
+ // accurate subject.
158
85
  subject: z
159
86
  .string()
160
87
  .describe(
161
88
  "One line saying what the merged work did, read off the code rather than off the opening request. A conversation that asks for an audit and then spends four turns fixing what it found needs a subject about the fixes.",
162
89
  ),
163
- /* THE SAME LANDING, SAID TO A USER, the `Release-Note:` sentence the chip files in under the subject, for
164
- * a repo that keeps a changelog (SandboxSettings.changelogRepos).
165
- *
166
- * Usually absent, and that is the design: most landings change nothing a user would notice, and the model
167
- * is told to omit the note for those rather than to invent one. */
90
+ // Usually absent by design: the model omits it rather than inventing a note for an unremarkable change.
168
91
  note: z
169
92
  .string()
170
93
  .optional()
171
94
  .describe(
172
95
  "The same change said to somebody who uses the product, for a repository that keeps a changelog. Usually absent, because most changes are not ones a user would notice.",
173
96
  ),
174
- /* WHAT THE SAME LANDING TAKES AWAY, the `Breaking-Note:` sentence, filed as its own trailer so the
175
- * release harvest can put it under "Breaking changes" and the update card can warn with it before the
176
- * update rather than after. Nearly always absent: the model is told a breaking note is for removals only,
177
- * and to omit it when in doubt, except when the landing shrinks a wire-contract lock, where the sentence
178
- * is REQUIRED and mechanically guaranteed (the daemon's git/contract-shrink.ts) rather than judged. */
97
+ // Nearly always absent (removals only); required and mechanically guaranteed when a landing shrinks a wire-contract
98
+ // lock.
179
99
  breaking: z
180
100
  .string()
181
101
  .optional()
182
102
  .describe("What this change takes away, for anything already relying on it. Nearly always absent: it is for removals, not for additions."),
183
103
  });
184
104
  export type LandedMessage = z.infer<typeof LandedMessageSchema>;
185
- /* ONE MODEL'S TURN IN THE DRAFTING WALK, asked, and what became of the ask. The one-shot helper chain tries the
186
- * connected models in order (agent/role-model.ts), and each rung ends one of four ways:
187
- * asking , in flight right now; `ms` absent because it is still being spent.
188
- * answered, it wrote the sentence, in `ms`.
189
- * refused , it failed or declined, in `ms`, with its own words in `reason`.
190
- * skipped , not asked at all: it refused within the last few minutes and the walk stepped over it, with the
191
- * reason it gave back then. Skipping is the memo working, and it reads as such.
192
- * The steps arrive in the order they were spent, so the list IS the timeline. */
105
+ // One model's turn in the drafting walk (agent/role-model.ts tries connected models in order), in spend order:
106
+ // asking: in flight, `ms` absent
107
+ // answered: wrote the sentence, in `ms`
108
+ // refused: failed or declined, in `ms`, with `reason`
109
+ // skipped: not asked, since it refused recently and the walk stepped over it
193
110
  export const LandedMessageStepSchema = z.object({
194
111
  provider: z.string().min(1).describe("Which provider was asked."),
195
112
  model: z.string().min(1).describe("Which of its models."),
196
113
  status: z
197
114
  .enum(["asking", "answered", "refused", "skipped"])
198
115
  .describe("How this one went. Skipped means it was not asked at all, because it refused a few minutes ago and the walk stepped over it."),
199
- // When this rung started being asked, ms since epoch, what an in-flight step's ticking "12s…" is measured
200
- // from, client-side, without a frame per second. Absent for `skipped`, which cost no time at all.
116
+ // Epoch ms it started; client-measures an in-flight step's ticking display. Absent for `skipped`, which cost no
117
+ // time.
201
118
  at: z.number().optional().describe("When it started being asked, in milliseconds. Absent for one that was skipped, which cost no time."),
202
119
  ms: z.number().optional().describe("How long it took. Absent while it is still being asked."),
203
120
  reason: z.string().optional().describe("Why it refused, in its own words."),
204
121
  });
205
122
  export type LandedMessageStep = z.infer<typeof LandedMessageStepSchema>;
206
- /* THE FULL ACCOUNT OF ONE LANDING'S COMMIT MESSAGE BEING DRAFTED, everything a user waiting at the commit box
207
- * is owed: that the draft started, which models have been asked, how each one went, and how it ended.
208
- *
209
- * `outcome` is absent while the draft is RUNNING, which is what "a sentence is on its way" now means, the
210
- * boolean flag this replaces could say only that, and nothing else this schema carries. Ended, it is:
211
- * written, the sentence is on the card (`landedMessage`) and in the box; the steps say who wrote it.
212
- * failed , nothing usable came back. The steps carry each model's own words; `reason` is the one-line
213
- * account for the surfaces with a single line to spend (an answer that was itself a refusal
214
- * sentence, or the whole chain spent).
215
- * An empty `steps` with no outcome is the moment before the first model is asked, the diff is being read. */
123
+ // Full account of one landing's commit message being drafted: started, which models were asked, how each went, and how
124
+ // it ended. `outcome` absent means still running; `written` puts the sentence on the card, `failed` carries a one-line
125
+ // `reason`.
216
126
  export const LandedMessageDraftSchema = z.object({
217
127
  startedAt: z.number().describe("When the drafting began, in milliseconds."),
218
128
  steps: z
@@ -229,83 +139,43 @@ export const LandedMessageDraftSchema = z.object({
229
139
  });
230
140
  export type LandedMessageDraft = z.infer<typeof LandedMessageDraftSchema>;
231
141
  export const AgentSummarySchema = z.object({
232
- // The conversationId.
233
142
  id: z.string().describe("The conversation id, which is how every other call addresses it."),
234
143
  sessionId: z.string().optional().describe("The provider session behind the last turn. It is retired whenever the model or account changes."),
235
- // First prompt, sanitized to one bounded line.
236
144
  title: z.string().optional().describe("What to call it: the first prompt cut to one line, unless somebody renamed it."),
237
145
  status: AgentStatusSchema.describe(
238
- "What it is doing. Stopping and stopped are the two halves of somebody pressing stop, because a cancel is not instant; dismissing is the same window for a question waved away, which ends the turn too but owes the user nothing; resuming means the sandbox is already putting right whatever killed the turn.",
146
+ "What it is doing. Stopping and stopped are the two halves of somebody pressing stop, because a cancel is not instant; dismissing is the same window for a question waved away, which ends the turn too but owes the user nothing; resuming means the sandbox is already putting right whatever killed the turn; landing means its work is being carried into the workspace right now, and nothing may act on its branch until that settles.",
239
147
  ),
240
- /* WHY THE LAST TURN FAILED, the sentence it died on, carried beside the `error` status because that word
241
- * on its own is not an answer. A session refused on its first request (an organization with Claude Code
242
- * switched off, a spent allowance, a model the endpoint has never heard of) reached every surface as a grey
243
- * "error" and a link into the transcript, so the one place the reason existed was the dead conversation
244
- * itself, which is exactly where an unattended run, started from a fan-out nobody is watching, is least
245
- * likely to be read. Absent unless the last turn ended in failure, and cleared the moment it runs again. */
148
+ // Sentence the last turn died on; carried since `error` status alone isn't an answer, especially for an unwatched
149
+ // run.
246
150
  failure: z
247
151
  .string()
248
152
  .optional()
249
153
  .describe(
250
154
  "Why the last turn failed, in the words it died on. Absent unless it did, and cleared the moment it runs again. Carried here because the word error on its own is not an answer, least of all for a run nobody was watching.",
251
155
  ),
252
- /* WHICH KIND OF FAILURE IT WAS, the error frame's own code (AgentEvent's `error`), beside the sentence it
253
- * came with. The sentence says what happened to a person; this says it to the board, which has to DRAW the
254
- * difference and could not.
255
- *
256
- * The chat has always had it, and the gap between the two surfaces is the whole reason this exists. A chat
257
- * reads `rate_limit` and renders a muted notice with a countdown and a press; the board read `status:
258
- * "error"` and rendered a red crash line with "View error" on it, because the code never reached the
259
- * summary. So one spent allowance looked exactly like a harness that died mid-run, on the surface where
260
- * most people meet it, and the state the product knows most about (it knows when it ends) was the one
261
- * drawn with the least. */
156
+ // The error frame's own code, so the board can distinguish e.g. a rate limit from a crash the way chat already
157
+ // does.
262
158
  failureCode: z
263
159
  .string()
264
160
  .optional()
265
161
  .describe(
266
162
  "Which kind of failure it was, as the turn's own error frame coded it. Absent for a failure nothing could classify, which reads as the plain red line it is.",
267
163
  ),
268
- /* WHEN THE SPENT WINDOW REOPENS (epoch SECONDS), for a card whose last turn a usage limit refused. The one
269
- * fact this failure has and no other failure here does, and the reason it is not a failure at all so much
270
- * as a wait: nothing is broken, nobody has anything to fix, and the thing that changes the outcome is a
271
- * clock. A card that cannot say the hour has to spend its line saying "Error" instead, which is how an
272
- * 18-hour-old refusal went on reporting a wall that had reopened before breakfast.
273
- *
274
- * Absent means the instant is genuinely unknown, which for Grok (no published quota) and Cursor (not routed
275
- * through the translator) is the honest answer and stays one. Never invent one: a countdown to a guess is
276
- * worse than no countdown, because the reader plans around it. */
164
+ // Epoch seconds the spent allowance reopens; absent means genuinely unknown (Grok, Cursor) — never guess one.
277
165
  limitResetsAt: z.number().optional().describe("When the spent allowance reopens, in epoch seconds. Absent when the provider publishes no instant."),
278
- /* THE DAEMON IS STILL HOLDING THAT EXACT TURN, so the way on is one press that RE-RUNS it rather than a new
279
- * message saying "carry on" (turn-resume.ts's pendingLimit has the whole argument, and the transcript full
280
- * of the word "Continue" that made it). On the summary because the board is where somebody with four
281
- * stranded agents is standing, and until now the press existed only inside each chat. */
282
166
  limitHeld: z.boolean().optional().describe("Whether the refused turn is held whole, so sending again re-runs it instead of appending to it."),
283
- /* A FIRE IS ALREADY BOOKED FOR THIS ONE: the conversation is armed (`resumeAfterLimit`), the reset instant
284
- * is known, and the daemon's pass will send the held turn again when the window opens without anybody
285
- * pressing anything.
286
- *
287
- * IT IS THE ONE THING THAT MOVES A STRANDED CARD OUT OF THE ATTENTION LANE, and the only reason it needs to
288
- * be on the wire at all. "Does this session need me?" is the question that lane answers, and for a spent
289
- * allowance the honest answer is yes: the window reopening does not send the turn, a person does. Unless
290
- * this is set, in which case a machine does, and demanding a press for work already booked is the same
291
- * false alarm as demanding one for a turn that is running.
292
- *
293
- * A BOOLEAN THE DAEMON ALREADY DECIDED rather than a posture the client re-folds. The effective posture is
294
- * two levels deep (this conversation's override, else the sandbox setting), and the lane machine is a leaf
295
- * with no store to ask: threading a settings read through every caller of `laneOf` would put the answer in
296
- * five places and let them disagree. The daemon resolves it once, where the failure happened. */
167
+ // Whether the daemon has already booked a retry at the reset; the one thing that keeps a stranded card out of the
168
+ // Attention lane.
297
169
  limitScheduled: z.boolean().optional().describe("Whether the held turn is already booked to go again at the reset, so nobody has to press anything."),
170
+ // Account a booked move is sending the held turn to; set alongside `limitScheduled`, cleared by the move's own
171
+ // turn.
172
+ limitMoving: z.string().optional().describe("The account the held turn is being moved to by the owner's policy, while that move is booked."),
298
173
  provider: AgentProviderSchema.describe("Which model provider it runs on."),
299
174
  harness: AgentHarnessSchema.describe("Which agentic loop it runs on."),
300
- // Which machine its turns execute on: a paired runner's id, absent for this sandbox (runners/). Latched
301
- // with the conversation, so a card can say where the work is happening without asking anything.
175
+ // Latched with the conversation, so the card can say where work runs without asking anything else.
302
176
  runner: z.string().optional().describe("The runner this conversation runs on. Absent means this sandbox."),
303
- // What the agent's last turn ran with, the model, its reasoning effort, whether extended thinking was on,
304
- // and whether fast speed was asked for. Recorded per agent because they are facts about THIS conversation: a
305
- // client opening it seeds its composer from them, rather than from whatever that browser last picked in some
306
- // other tab. Absent for an agent whose turns predate the record (model has always been kept; the rest are
307
- // newer). `fast` is what was REQUESTED, not what was served, the served answer belongs to a turn and rides
308
- // its `fast_mode` frame, while this is the composer's memory of the user's own choice.
177
+ // Per-conversation, so opening it restores its own choices rather than another tab's; `fast` here is what was asked
178
+ // for, not what was served.
309
179
  model: z
310
180
  .string()
311
181
  .optional()
@@ -315,17 +185,13 @@ export const AgentSummarySchema = z.object({
315
185
  effort: z.string().optional().describe("How hard that turn was told to think."),
316
186
  thinking: z.boolean().optional().describe("Whether that turn showed its reasoning."),
317
187
  fast: z.boolean().optional().describe("Whether that turn asked for higher speed. What was asked for, not what was served."),
318
- /* WHAT THE COMPLEXITY JUDGE MADE OF THE LAST TURN HERE, mirrored from the persisted entry (agents-store.ts
319
- * `tier`) so a client opening the conversation tomorrow can seed its composer preview with the one judge
320
- * input a draft cannot contain (prompt-complexity.ts `afterHardTurn`). The JUDGEMENT, never what ran, for
321
- * the reason the store states: what ran is a fact about configuration, the next turn is asking about the
322
- * difficulty of the work. Absent ⇒ nothing judged yet. */
188
+ // The judge's verdict on the last turn, not what actually ran: seeds tomorrow's composer preview, absent means
189
+ // nothing judged yet.
323
190
  tier: z
324
191
  .enum(["fast", "standard"])
325
192
  .optional()
326
193
  .describe("How hard its last turn looked to the complexity judge. What the next turn's preview needs, not what actually ran."),
327
- // The conversation's standing "keep every turn on my pick" choice, the composer's memory of it, the same
328
- // shape as `fast` above: what was asked for, restored into the composer on open, sent back on every turn.
194
+ // Standing per-conversation choice, restored into the composer on open and sent back every turn, like `fast` above.
329
195
  tierHold: z
330
196
  .boolean()
331
197
  .optional()
@@ -333,45 +199,25 @@ export const AgentSummarySchema = z.object({
333
199
  account: z.string().optional().describe("Which connected account paid for it."),
334
200
  // The worktree branch (agent/<id>); absent for a non-isolated (main-tree) conversation.
335
201
  branch: z.string().optional().describe("The branch its private copy works on. Absent for a conversation that works directly in the shared tree."),
336
- // This agent's own answer to "land automatically at turn completion?", an explicit per-agent override of
337
- // the sandbox-wide `autoLand` setting. ABSENT ⇒ inherit, which is the common case and the one that keeps
338
- // the global toggle meaningful: an agent that never expressed an opinion follows the sandbox wherever it
339
- // is pointed next. Written by `agents.autoLand`; the UI shows the EFFECTIVE value (this ?? the setting).
202
+ // Per-agent override of the sandbox-wide `autoLand`; absent means inherit, the common case that keeps the toggle
203
+ // meaningful.
340
204
  autoLand: z
341
205
  .boolean()
342
206
  .optional()
343
207
  .describe(
344
208
  "This conversation's own answer to whether its work merges automatically. Absent means it follows the sandbox-wide setting, which is the common case.",
345
209
  ),
346
- /* This agent's own answer to "re-run my turn when the model provider was what failed?", the same
347
- * two-level shape as `autoLand` above, and here for a sharper reason than symmetry.
348
- *
349
- * The press that writes this is offered INSIDE one conversation, at the moment that conversation's turn
350
- * died, and what a person means by it is "finish THIS piece of work". It used to write the sandbox-wide
351
- * setting, so one impatient click at 2 a.m. quietly armed every agent on the board, a scope
352
- * nothing on screen had asked about. So the chat's offer writes this, the settings toggle writes the
353
- * default, and the two stay honestly different things.
354
- *
355
- * ABSENT ⇒ inherit the sandbox setting, which is what keeps that default meaningful: a conversation that
356
- * never expressed an opinion follows the sandbox wherever it is pointed next. Written by
357
- * `agents.resumeAfterOutage`; every surface shows the EFFECTIVE value (this ?? the setting). */
210
+ // Per-conversation override, written by the in-chat retry press (not the settings toggle) so one late-night click
211
+ // can't arm every agent; absent inherits the sandbox setting.
358
212
  resumeAfterOutage: z.boolean().optional(),
359
- /* The same two-level shape again, for the blocker that is not a failure: "when a usage limit refused my
360
- * turn, send it again the moment the allowance comes back".
361
- *
362
- * IT IS THE ONE RESUME WITH A KNOWN HOUR, which is what makes it worth automating and what makes it
363
- * different from its neighbour. An outage resume guesses (a backoff, a bounded number of attempts, no idea
364
- * when the provider returns); this one waits for an instant the provider published and fires once, at it.
365
- *
366
- * OFF unless somebody says otherwise, and that default is load-bearing rather than cautious. Every other
367
- * blocker here clears at no cost to the user, while this one clears into a window they may have been
368
- * saving: spending it the second it reopens is not a decision to make on anybody's behalf. What arming it
369
- * buys is the case nothing else can reach, a turn that hit the wall at 2am on a board nobody is watching,
370
- * where the alternative is a card that waited eight hours for a press that was always going to come. */
213
+ // Off by default, unlike its neighbors: firing the moment a spent allowance reopens spends a window the user may be
214
+ // saving.
371
215
  resumeAfterLimit: z.boolean().optional(),
372
- // A collaborator asked for this agent's work to be landed (agents.requestLand), collaborators may drive
373
- // agents but not merge into the main tree, so the ask rides the summary where every maintainer's board
374
- // sees it. Cleared by the land or discard that answers it. Absent ⇒ nobody is waiting.
216
+ // Per-conversation override for moving a held turn to another account with room the moment it's refused; absent
217
+ // inherits.
218
+ moveAfterLimit: z.boolean().optional(),
219
+ // A collaborator's ask to land (collaborators can't merge themselves); cleared by whichever merge or discard
220
+ // answers it.
375
221
  landRequested: z
376
222
  .object({
377
223
  email: z.string().describe("Who asked."),
@@ -382,23 +228,22 @@ export const AgentSummarySchema = z.object({
382
228
  .describe(
383
229
  "A collaborator has asked a maintainer to merge this work. Cleared by whichever merge or discard answers it. Absent means nobody is waiting.",
384
230
  ),
385
- // Present when the conversation was opened by an outside message rather than by the user (see
386
- // AgentOriginSchema), the card's provenance line. Absent ⇒ the user started it.
231
+ // The card's provenance line when an outside message opened the conversation; absent means a person started it.
387
232
  origin: AgentOriginSchema.optional().describe(
388
233
  "Where the conversation came from when nobody typed it: a chat mention, a visitor's message, a webhook. Absent means a person started it.",
389
234
  ),
390
- /* Where this conversation was cut from, when it was cut from another. Recorded once, from the fork's very
391
- * first turn, and never cleared, it is the relationship, not a pending state.
392
- *
393
- * It rides the SUMMARY rather than living in the client's tabs because a fork and its source are two chats
394
- * that are obviously related and, without this, had no way to say how: the link has to survive closing
395
- * either tab and reopening it from history, and it has to be readable from the OTHER side, the source's
396
- * own transcript marks its cut points by looking for the conversations that name it. */
235
+ // The other provenance line: who asked for the first turn directly (vs `origin`, which names the automation);
236
+ // latched, never rewritten by a later turn.
237
+ startedBy: z
238
+ .string()
239
+ .optional()
240
+ .describe("Who asked for the first turn, as the sandbox verified it: a member's email, or token:<label> for a program's control token. Absent when nothing was verified (a wake, a loopback caller)."),
241
+ // Recorded once on the fork's first turn and never cleared; rides the summary so the link survives closing and
242
+ // reopening either tab.
397
243
  forkedFrom: ForkedFromSchema.optional().describe(
398
244
  "The conversation this one was cut from. Recorded once and never cleared: it is the relationship, not a pending state.",
399
245
  ),
400
- // The ROOT repo's short base sha, the checkout moment's display identity. Per-repo bases stay
401
- // daemon-internal (agents.diff already reports against them).
246
+ // Root repo's short base sha; per-repo bases stay daemon-internal.
402
247
  base: z.string().optional().describe("The commit its private copy started from, shortened."),
403
248
  costUsd: z.number().optional().describe("What it has cost so far, in dollars. A subagent's spend is its own and is not folded in here."),
404
249
  inputTokens: z.number().optional().describe("Tokens sent."),
@@ -406,46 +251,20 @@ export const AgentSummarySchema = z.object({
406
251
  contextTokens: z.number().optional().describe("How much of the window the conversation currently fills."),
407
252
  contextWindow: z.number().optional().describe("How large that window is."),
408
253
  activity: AgentActivitySchema.optional().describe("What it is doing at this moment."),
409
- /* THE WHOLE STORY OF THIS LANDING'S COMMIT MESSAGE BEING WRITTEN, present from the moment the land starts
410
- * the draft, updated on every transition, and kept after it ends until the next land replaces it.
411
- *
412
- * This used to be one boolean ("a model is writing"), and a boolean is exactly one fact short of every
413
- * question the wait raises: WHICH model, for how long, what refused and in what words, what finally
414
- * answered. All of that was known in the daemon and thrown away at the door, a first-pinned model that
415
- * burned 58 seconds refusing on every landing had to be caught by watching CLI processes by hand, because
416
- * nothing on any screen could have shown it.
417
- *
418
- * Runtime only: nothing about it is persisted, so a daemon restart forgets it. That is correct rather than
419
- * lossy, a restart also killed the draft it would have been describing. */
254
+ // The whole drafting story (which models, how long, what refused), replacing a boolean that hid all of it;
255
+ // runtime-only, forgotten on restart like the draft itself.
420
256
  landedMessageDraft: LandedMessageDraftSchema.optional().describe(
421
257
  "The whole story of this merge's commit message being written: which models were asked, how long each took, what refused and in what words. Forgotten on restart, which is right, because a restart also killed the drafting it describes.",
422
258
  ),
423
- /* AND THE SENTENCE ITSELF, once the flag above clears, what this agent's landed work is called, for the
424
- * Changes panel's "From" chip to file into the commit box.
425
- *
426
- * IT RIDES THE ROSTER because the roster is the channel that is already live for it. The review carries the
427
- * same fact (OriginAgent.subject) and has to, for an archived agent whose lines are still in the tree, but
428
- * the review is a workspace-wide rescan, coalesced daemon-side and refetched only when something asks, and
429
- * this sentence arrives ALONE, seconds after the work it describes, with nothing else moving. Every link in
430
- * that chain has to hold for a message that exists to become a message the user can see, and when one of
431
- * them doesn't, the box stays empty with nothing to say why, while the flag above, which travels on THIS
432
- * frame, has already told them a sentence was coming.
433
- *
434
- * So the fact goes where the promise went. Same push, same instant: the frame that ends `landedMessageDraft`
435
- * is the frame that carries the answer, which is also what makes "your commit message is ready" honest.
436
- *
437
- * Absent for every agent that has not landed, and for a landing nothing could be written about. Replaced
438
- * wholesale by the next land, the claim grows and so does the sentence about it. */
259
+ // The finished sentence, on the same push that ends `landedMessageDraft` above so the promise and the answer arrive
260
+ // together; absent until then, replaced wholesale by the next land.
439
261
  landedMessage: LandedMessageSchema.optional().describe(
440
262
  "What this conversation's merged work is called, once the drafting above has finished. It arrives on the same push that ends the draft, so the promise and the answer travel together.",
441
263
  ),
442
- // Present while a turn runs: its start, ms since epoch.
443
264
  startedAt: z.number().optional().describe("When the running turn started, in milliseconds. Absent when none is running."),
444
265
  updatedAt: z.number().describe("When it last did something, in milliseconds. Reading it does not count."),
445
- // When the agent was last OPENED, ms since epoch, the unread badge's reference point (`updatedAt >
446
- // seenAt` ⇒ the agent has done something you haven't looked at). Absent ⇒ never opened. Daemon-side on
447
- // purpose: read state is a fact about the WORK, not about one browser profile, so clearing site data or
448
- // picking up the phone must not resurrect every badge.
266
+ // Daemon-side, not browser-side: read state is a fact about the work, so clearing site data or switching devices
267
+ // can't resurrect a badge.
449
268
  seenAt: z
450
269
  .number()
451
270
  .optional()
@@ -453,27 +272,16 @@ export const AgentSummarySchema = z.object({
453
272
  "When somebody last opened it, in milliseconds. Newer activity than this is what makes it unread. Kept by the sandbox rather than by a browser, so clearing site data or picking up a phone does not resurrect every badge.",
454
273
  ),
455
274
  attention: AgentAttentionSchema.describe("Which kinds of waiting-for-you it is doing."),
456
- /* What the last turn left open, when it left anything (UnfinishedWorkSchema). Beside `attention` because a
457
- * reader asks both questions in the same glance, and apart from it because the answers have opposite
458
- * shapes: attention is a turn parked and waiting, this is a turn gone with the job half done. */
275
+ // Beside `attention` since a reader asks both at a glance, but opposite in shape: a turn gone, not one still parked
276
+ // and waiting.
459
277
  unfinished: UnfinishedWorkSchema.optional().describe(
460
278
  "What its last turn left open: steps it never completed, a check still failing. Absent for a turn that finished what it started.",
461
279
  ),
462
280
  // Completed turns and lifetime tool calls, the card's msgs/tools counters.
463
281
  turns: z.number().optional().describe("Turns it has finished."),
464
282
  toolUses: z.number().optional().describe("Tools it has used, over its whole life."),
465
- /* The agents THIS agent started (SubagentSessionSchema), live and lifetime. Absent ⇒ it has never delegated,
466
- * which is most agents, so the card's chip appears on content rather than reading "0" down the board.
467
- *
468
- * THE TWO HALVES COME FROM DIFFERENT PLACES, and have to: `running` is read off the live subagent registry,
469
- * which sweeps a child five minutes after it reports and remembers nothing across a restart, while `total`
470
- * is counted onto the agent's own entry as each child is born. Deriving both from the live registry is what
471
- * used to take the count off a card while the agent that earned it was still on the board.
472
- *
473
- * It earns a place on a card because a fleet card is the answer to "what is this agent up to", and an agent
474
- * running five children looked exactly like an agent running none: the work was real, the spend was real, and
475
- * the board said nothing. The tokens are NOT folded into the parent's cost, a child's spend is its own, and
476
- * the Subagents area is where it is attributed. */
283
+ // `running` reads the live subagent registry (swept after five minutes), `total` counts on the agent's own entry; a
284
+ // child's spend is its own, never folded into the parent's cost.
477
285
  subagents: z
478
286
  .object({
479
287
  running: z.number().describe("Subagents working right now."),
@@ -483,8 +291,8 @@ export const AgentSummarySchema = z.object({
483
291
  .describe(
484
292
  "Subagents and child agents this one delegated to. Absent means it never has, which is most conversations. Their spend is their own and is not folded into this conversation's cost.",
485
293
  ),
486
- // The agent's cumulative output (base → branch tip across every repo), refreshed on each land,
487
- // the card's "12 files · +412 −96" readout. Independent of what has landed.
294
+ // Cumulative output across every repo (base → branch tip), refreshed on each land; independent of what has actually
295
+ // landed.
488
296
  diff: z
489
297
  .object({
490
298
  files: z.number().describe("Files touched."),
@@ -493,21 +301,8 @@ export const AgentSummarySchema = z.object({
493
301
  })
494
302
  .optional()
495
303
  .describe("Everything it has written, measured from where it started. Independent of how much has been merged."),
496
- /* HOW MUCH OF WHAT THIS AGENT LANDED IS STILL IN YOUR WORKING TREE, present only when some of it ISN'T.
497
- *
498
- * A land applies its delta to the main tree as uncommitted changes, so the user can discard it there like
499
- * any other change, and every other reading on this card is measured between commits and cannot see that
500
- * happen (landed-presence.ts). Left unsaid, the card goes on wearing a landed chip and the session menu
501
- * goes on saying "Already in your workspace" over a tree that no longer holds it, and the next land
502
- * carries only the NEW delta, dropping turn 2 onto a tree missing turn 1.
503
- *
504
- * `present` counts the landed paths still there: dirty, or committed into history, a commit is the
505
- * strongest form of still-there, which is why this cannot be folded into the Changes panel's own
506
- * attribution, where a commit is what ENDS the agent's claim (origins.ts).
507
- *
508
- * Absent is the steady state and the quiet one: an agent that never landed and an agent whose work is
509
- * exactly where it left it both say nothing. Its PRESENCE is the signal, which is what keeps the board
510
- * from spending a line per card on the ordinary case. */
304
+ // How much of what this agent landed is still in the working tree, since a discard after landing is invisible to
305
+ // commit-based readings; absent is the steady state and carries no line.
511
306
  landedPresence: z
512
307
  .object({
513
308
  landed: z.number().describe("Paths this conversation merged in."),
@@ -517,15 +312,8 @@ export const AgentSummarySchema = z.object({
517
312
  .describe(
518
313
  "Present only when some of what it merged has since been thrown away. Absent is the steady state: its presence is the signal, so an ordinary card spends no line on it.",
519
314
  ),
520
- /* The loop driving this conversation, when one is (or was), "iteration 3/12, until the suite is green".
521
- *
522
- * PROJECTED onto the card rather than fetched beside it, and that is the whole reason a loop needed no
523
- * surface of its own: a looping agent is an agent, so the board's status, spend, unread badge and Stop
524
- * button already describe it, and one extra line is the difference between a card that says `running` for
525
- * forty minutes and one that says what it is running towards. A second query joined client-side would have
526
- * paid for the same line with a poll that can disagree with the roster.
527
- *
528
- * Absent ⇒ an ordinary conversation, which is nearly all of them. */
315
+ // The loop driving this conversation, projected here rather than fetched separately, since a looping agent's status
316
+ // and spend are already the card's own.
529
317
  loop: z
530
318
  .object({
531
319
  state: LoopStateSchema.describe("How the loop is going."),
@@ -535,23 +323,8 @@ export const AgentSummarySchema = z.object({
535
323
  })
536
324
  .optional()
537
325
  .describe("The loop driving this conversation, if one is. Absent for an ordinary conversation, which is nearly all of them."),
538
- /* The workflow run this conversation is a step of, "Ship the feature · step 3 of 4 · Review the change".
539
- *
540
- * Projected for the same reason the loop above is, and it answers a question only the board can be asked. A
541
- * run of four `fresh` steps IS four conversations, so it arrives on the board as four unrelated cards that
542
- * started a few minutes apart, the work reads as four people who happen to be busy rather than as one job
543
- * with a shape. Naming the run on each card is what makes them one block, and `runId` is what lets the board
544
- * order them together and link every one of them at the run's own graph.
545
- *
546
- * POSITION IS A FACT ABOUT THE STEP, not a running total: `index`/`total` are its place in the workflow's own
547
- * step order, so a card is published once when its step starts and never has to be rewritten because a
548
- * sibling advanced. How the run as a whole is going is the run page's job, and how THIS step is going is
549
- * already the card's status and the loop line above.
550
- *
551
- * `step` moves within one conversation when steps are chained with `continue`, they share it, which is the
552
- * point of chaining, so this says which one is on it NOW.
553
- *
554
- * Absent ⇒ an ordinary conversation. */
326
+ // Which workflow run and step this conversation is; projected so a multi-step run reads as one job, not unrelated
327
+ // cards started minutes apart.
555
328
  workflow: z
556
329
  .object({
557
330
  runId: z.string().describe("The run this belongs to, which is how a board groups its steps together."),
@@ -564,29 +337,9 @@ export const AgentSummarySchema = z.object({
564
337
  .describe(
565
338
  "The workflow run this conversation is a step of. Without it, a four-step run reads as four unrelated conversations that happen to have started together.",
566
339
  ),
567
- /* THE OUTSIDE CONDITIONS THIS CONVERSATION IS PARKED ON, the armed condition watches (the daemon's
568
- * agent/watchers.ts), projected onto the card for the same reason the loop and the workflow above are.
569
- *
570
- * IT IS THE ONE PROMISE THE BOARD USED TO KEEP SILENTLY. An agent that arms a watch ends its turn: nothing
571
- * is running, nothing is owed to the user, so every surface filed it under finished and drew the resting
572
- * `idle`. Then, some hours later, the daemon's check exits 0 and that same conversation starts working
573
- * again, on its own, in front of somebody who had been told it was done. The wake is the feature; the card
574
- * saying nothing about it beforehand is what made it read as the sandbox acting unasked.
575
- *
576
- * It also has a bill attached, which no other projection here does. An armed watch keeps a hosted machine
577
- * awake (system/idle-stop.ts counts them, deliberately: stopping the box is how a watch silently never
578
- * fires), so an invisible watch is invisible compute. A user looking at a board of finished agents,
579
- * wondering why the machine will not go quiet, could not have found the answer anywhere.
580
- *
581
- * WHAT IS ON THE WIRE IS WHAT A CARD CAN ACT ON, and nothing else. The note (the agent's own line on what
582
- * it is waiting for), the cadence, and the deadline, which is what turns "waiting" into a countdown with an
583
- * end. Deliberately NOT the check command: it is shell text the reader cannot run, judge or fix from a
584
- * board, and it is the one field that could carry a secret reference into a surface that is read over
585
- * shoulders. Deliberately NOT the check COUNT either, which would move every interval and buy a whole
586
- * roster broadcast to advance a number nobody is reading.
587
- *
588
- * Absent ⇒ nothing armed, which is nearly every conversation. Empty is never sent: the daemon clears the
589
- * projection instead, so the field's PRESENCE is the signal. */
340
+ // Outside conditions a conversation is parked on; a finished-looking card can restart itself when one fires, and an
341
+ // armed watch keeps a hosted machine (and its bill) awake. The check command itself never rides the wire, since it
342
+ // may hold a secret.
590
343
  watches: z
591
344
  .array(
592
345
  z.object({
@@ -600,10 +353,8 @@ export const AgentSummarySchema = z.object({
600
353
  .describe(
601
354
  "Outside conditions this conversation is parked on, each of which will wake it. Absent means none, which is nearly every conversation: an armed watch is why a finished-looking agent starts working by itself, and why a hosted machine will not go idle.",
602
355
  ),
603
- // When the agent was ARCHIVED (ms epoch), off the board, but nothing lost: its checkout was retired
604
- // (worktree removed) while the agent/<id> branch, the transcript, and every counter stayed. Absent ⇒ live
605
- // on the board. Archived agents are excluded from the roster the fleet renders; `agents.archived` lists
606
- // them, `agents.unarchive` brings one back, and the next turn re-attaches its worktree from the branch.
356
+ // Epoch ms it was archived; nothing is lost (branch, transcript, counters stay), and unarchiving re-attaches a
357
+ // fresh worktree from the branch.
607
358
  archivedAt: z
608
359
  .number()
609
360
  .optional()
@@ -612,20 +363,14 @@ export const AgentSummarySchema = z.object({
612
363
  ),
613
364
  });
614
365
  export type AgentSummary = z.infer<typeof AgentSummarySchema>;
615
- // One armed condition watch as a card carries it (AgentSummarySchema.watches). Named off the summary rather
616
- // than declared beside it, so the shape the daemon publishes and the shape the wire promises cannot drift.
366
+ // One armed watch as a card carries it; derived from AgentSummarySchema.watches so the two shapes can't drift apart.
617
367
  export type AgentWatch = NonNullable<AgentSummary["watches"]>[number];
618
- // AgentsListSchema lives further down, after AutomationApprovalSchema, the fleet list carries the held wakes,
619
- // and zod declaration order forces the ride-along to be declared first.
368
+ // AgentsListSchema is declared later, after AutomationApprovalSchema, since the fleet list carries held wakes and zod
369
+ // needs that type declared first.
620
370
  export const AgentIdSchema = z.object({ id: z.string().min(1).describe("Which conversation.") });
621
371
 
622
- /* ASKING FOR ONE PAGE OF A CONVERSATION. A transcript read answers with the most recent turns and says where
623
- * they start (`from`); handing that number back as `before` asks for the page above it, and so on to the
624
- * beginning. Both are optional: a tab opening a chat sends neither and gets the tail.
625
- *
626
- * A cursor is never an error. It can be stale by the time it arrives — a rewind truncated the record under it,
627
- * a fork re-cut it, the tab slept through both — and the daemon clamps rather than refusing, because failing
628
- * to open a conversation is a worse answer than opening it at the end. */
372
+ // Pages a transcript: a read returns its most recent turns and where they start (`from`); handing that back as `before`
373
+ // asks for the page above. A stale cursor (a rewind, a fork) is clamped, never refused.
629
374
  export const AgentTranscriptQuerySchema = AgentIdSchema.extend({
630
375
  before: z.coerce
631
376
  .number()
@@ -634,8 +379,7 @@ export const AgentTranscriptQuerySchema = AgentIdSchema.extend({
634
379
  .describe("Return the messages before this position in the record: the `from` of the page below. Absent asks for the most recent turns."),
635
380
  turns: z.coerce.number().int().min(1).max(200).optional().describe("How many of the user's turns to return, newest first. Absent takes the daemon's default."),
636
381
  });
637
- // archive's input: the agents to take off the board. Absent `ids` ⇒ every finished agent that is archivable
638
- // right now (the lane header's "Clear"); unarchive always names its ids (a restore, or a bulk archive's undo).
382
+ // Absent `ids` archives every archivable finished agent (the lane's "Clear"); unarchive always names its own ids.
639
383
  export const AgentArchiveSchema = z.object({
640
384
  ids: z
641
385
  .array(z.string().min(1))
@@ -644,13 +388,9 @@ export const AgentArchiveSchema = z.object({
644
388
  .describe("Which conversations to put away. Leave it out for every finished one that can be archived right now."),
645
389
  });
646
390
  export const AgentIdsSchema = z.object({ ids: z.array(z.string().min(1)).min(1).max(500).describe("Which conversations.") });
647
- // What actually MOVED, and deliberately NOT the roster afterwards. Two archives in flight at once each finish
648
- // holding a full-roster snapshot from a different instant, so a client that swapped one in wholesale would let
649
- // the slower response resurrect what the faster one just filed away, a delta composes where a snapshot races.
650
- // Whole summaries rather than ids because the receiving side has to SHOW them (the archive list, and the agent
651
- // detail page addressed by id); the ids "Undo" needs come off them for free.
652
- // The agents an archive/unarchive actually moved, plus the registry revision that applied the move, the
653
- // browser holds its optimistic add/remove of exactly these ids until it sees a roster at or past `rev`.
391
+ // What actually moved, not the roster afterward: two archives finishing at once would otherwise let a slower snapshot
392
+ // resurrect what a faster one just filed away. Whole summaries, since the receiving surfaces (archive list, detail
393
+ // page) have to show them, not just their ids.
654
394
  export const AgentsMovedSchema = z.object({
655
395
  moved: z
656
396
  .array(AgentSummarySchema)
@@ -664,11 +404,8 @@ export const AgentsMovedSchema = z.object({
664
404
  ),
665
405
  });
666
406
  export type AgentsMoved = z.infer<typeof AgentsMovedSchema>;
667
- /* AN ARCHIVE ALSO REPORTS WHAT IT COULD NOT DO, which is the half that used to go missing. Releasing a working
668
- * copy is git work, and it can fail for reasons no press can fix: the repository behind a checkout was deleted
669
- * from the workspace, a checkout is locked. Those agents stay on the board, so the answer carries them and the
670
- * sentence each failed with, otherwise the only true thing the caller could say about an archive that moved
671
- * nothing was "there was nothing to archive": to a user looking straight at the card it refused. */
407
+ // Also reports what a release could not do (a deleted repo, a locked checkout); those agents stay on the board with the
408
+ // reason they failed, rather than the caller reading silence as "nothing to archive".
672
409
  export const AgentsArchivedSchema = AgentsMovedSchema.extend({
673
410
  failed: z
674
411
  .array(
@@ -680,10 +417,8 @@ export const AgentsArchivedSchema = AgentsMovedSchema.extend({
680
417
  .describe("The conversations this press could not put away, each with the reason, so the board can say it instead of reporting silence."),
681
418
  });
682
419
  export type AgentsArchived = z.infer<typeof AgentsArchivedSchema>;
683
- // What a purge actually deleted. Ids, not summaries: these agents no longer exist anywhere, there is nothing
684
- // left to show and nothing to put back, so the only thing the caller can do with the answer is drop those rows
685
- // and count them. No revision either: archived agents are already off the broadcast roster (see `list`), so a
686
- // purge changes nothing the board's pending-move machinery has to hold a card against.
420
+ // Ids, not summaries: a purged agent no longer exists anywhere, so there's nothing to show. No revision either, since
421
+ // archived agents are already off the broadcast roster.
687
422
  export const AgentsRemovedSchema = z.object({
688
423
  removed: z
689
424
  .array(z.string())
@@ -692,26 +427,9 @@ export const AgentsRemovedSchema = z.object({
692
427
  ),
693
428
  });
694
429
  export type AgentsRemoved = z.infer<typeof AgentsRemovedSchema>;
695
- /* Search the fleet by what was SAID in it, the board's filter (and the popped-out rail's).
696
- *
697
- * Both sides of the conversation, and nothing else: the user's own prompts and the agent's chat bubbles. What
698
- * an agent ANSWERED is half of what a chat is remembered by, the name it found, the file it named, the number
699
- * it reported, and a filter that could not reach it sent people back to opening chats one at a time.
700
- *
701
- * What stays out is everything that is not speech: extended thinking, tool calls and their output, and the
702
- * daemon's own protocol (preambles, attachment notes). That is the line the old user-only rule was really
703
- * drawing, tool output alone names nearly every identifier in the workspace, so matching it returns most of
704
- * the board and the filter stops filtering. Prose is a fraction of a transcript and reads like a sentence
705
- * someone wrote, which is why it can be searched when a diff dump cannot.
706
- *
707
- * The card TITLE is the first prompt (sanitized), so a title match and a prompt match are one rule, not two.
708
- *
709
- * Two chars minimum: below that every agent matches and the scan is pure cost.
710
- *
711
- * `caseSensitive` is the field's Aa switch, the same name and the same default as the workspace search's, so
712
- * one word means one thing across the daemon's search routes. Off is case-INSENSITIVE rather than smart case:
713
- * a filter that quietly changed rule when a capital was typed would make the switch beside it a lie.
714
- */
430
+ // Searches only speech, both sides of the conversation, never thinking, tool output or protocol text, which would
431
+ // otherwise match nearly the whole board. Two-char minimum; `caseSensitive` off means case-insensitive, matching
432
+ // workspace search's own switch.
715
433
  export const AgentSearchQuerySchema = z.object({
716
434
  query: z
717
435
  .string()
@@ -722,14 +440,8 @@ export const AgentSearchQuerySchema = z.object({
722
440
  ),
723
441
  caseSensitive: z.stringbool().optional().describe("Whether capitals matter."),
724
442
  });
725
- /* WHY a row survived the filter: the matched line, windowed around the hit, and which side of the conversation
726
- * said it. A result that matches for a reason the reader cannot see is worse than no filter at all.
727
- *
728
- * `speaker` rides WITH the text rather than beside it because the two are never separately true, every line is
729
- * someone's, and because the words alone stopped being self-identifying the moment agent prose became
730
- * matchable: "landAgent lives in laneDrop.ts" under a card reads as something the user typed until the row
731
- * says otherwise.
732
- */
443
+ // Why a row survived the filter: the matched line, windowed, and who said it. `speaker` rides with the text since agent
444
+ // prose alone can read as something the user typed.
733
445
  export const SpeakerSchema = z.enum(["user", "agent"]);
734
446
  export type Speaker = z.infer<typeof SpeakerSchema>;
735
447
  export const MatchSnippetSchema = z.object({
@@ -739,8 +451,7 @@ export const MatchSnippetSchema = z.object({
739
451
  ),
740
452
  });
741
453
  export type MatchSnippet = z.infer<typeof MatchSnippetSchema>;
742
- // One matching agent, and the evidence for it. `snippet` is absent when the match is the TITLE, which the card
743
- // already shows, repeating it underneath is noise where evidence was wanted.
454
+ // One matching agent and its evidence; `snippet` is absent for a title match, which the card already shows.
744
455
  export const AgentMatchSchema = z.object({
745
456
  id: z.string().describe("Which conversation matched."),
746
457
  snippet: MatchSnippetSchema.optional().describe(
@@ -748,8 +459,7 @@ export const AgentMatchSchema = z.object({
748
459
  ),
749
460
  });
750
461
  export type AgentMatch = z.infer<typeof AgentMatchSchema>;
751
- // `scanned` is how many agents the daemon actually read prompts for, so the board can say when a query saw
752
- // less than the whole fleet rather than implying it saw all of it.
462
+ // How many agents were actually read, so the board can say a search saw less than the whole fleet.
753
463
  export const AgentSearchResultSchema = z.object({
754
464
  matches: z.array(AgentMatchSchema).describe("What matched, from the live fleet and the archive together."),
755
465
  scanned: z
@@ -764,15 +474,13 @@ export const AgentSearchResultSchema = z.object({
764
474
  ),
765
475
  });
766
476
  export type AgentSearchResult = z.infer<typeof AgentSearchResultSchema>;
767
- // rename's input: the user-chosen display title (bounded like sanitizeTitle's cap).
477
+ // The user-chosen display title, bounded like sanitizeTitle's own cap.
768
478
  export const AgentRenameSchema = z.object({
769
479
  id: z.string().min(1).describe("Which conversation."),
770
480
  title: z.string().trim().min(1).max(80).describe("What to call it from now on."),
771
481
  });
772
- /* place's input: words the user writes INTO the transcript wearing the agent's voice (see agentsContract.place).
773
- * Bounded well above anything a person types by hand and just above the handoff's per-message render cap
774
- * (runtime-history's MESSAGE_CHAR_CAP), a placed line longer than that would reach the agent truncated, which
775
- * silently breaks "it thinks these are its own words". Better to refuse at the door with a reason. */
482
+ // Bounded just above the handoff's per-message render cap, so a line too long to carry whole doesn't reach the agent
483
+ // truncated.
776
484
  export const AgentPlaceSchema = z.object({
777
485
  id: z.string().min(1).describe("Which conversation."),
778
486
  text: z
@@ -784,9 +492,8 @@ export const AgentPlaceSchema = z.object({
784
492
  "The words to put in the agent's mouth. Bounded just above what the next turn can carry whole, because a line too long to be handed over intact would reach the agent truncated and quietly break the very thing this is for.",
785
493
  ),
786
494
  });
787
- // autoLand's input: this agent's own land-at-completion posture. `null` CLEARS the override back to "inherit
788
- // the sandbox setting", the browser sends it whenever the user toggles back to what the global already says,
789
- // so agents don't accumulate frozen overrides that quietly stop following the global toggle.
495
+ // `null` clears the override back to inheriting the sandbox setting, so an agent doesn't hold a frozen copy that stops
496
+ // following it.
790
497
  export const AgentAutoLandSchema = z.object({
791
498
  id: z.string().min(1).describe("Which conversation."),
792
499
  autoLand: z
@@ -796,10 +503,7 @@ export const AgentAutoLandSchema = z.object({
796
503
  "Whether its work merges automatically when a turn finishes. Null clears the override and goes back to following the sandbox-wide setting, so a conversation does not sit holding a frozen copy of a default it has quietly stopped following.",
797
504
  ),
798
505
  });
799
- // resumeAfterOutage's input: this ONE conversation's answer to a provider outage. `null` clears the override
800
- // back to "inherit the sandbox setting", sent whenever the user toggles back to what the global already says,
801
- // on the same reasoning as autoLand's null: an agent holding a frozen copy of a default has quietly stopped
802
- // following it, and nothing on screen would say so.
506
+ // Same `null`-clears-the-override shape as autoLand, for this conversation's own outage-resume posture.
803
507
  export const AgentResumeAfterOutageSchema = z.object({
804
508
  id: z.string().min(1).describe("Which conversation."),
805
509
  resumeAfterOutage: z
@@ -807,9 +511,7 @@ export const AgentResumeAfterOutageSchema = z.object({
807
511
  .nullable()
808
512
  .describe("Whether it retries by itself when the model provider was what failed. Null clears the override back to the sandbox-wide setting."),
809
513
  });
810
- // resumeAfterLimit's input, the same override in the same three states as the outage one above, for the
811
- // blocker that comes back on a clock. Written by the card's own offer at the moment a limit strands a turn,
812
- // which is where somebody looking at a stranded card actually is; the settings toggle writes the default.
514
+ // Same three-state override, for the limit blocker; written by the card's own offer when a limit strands a turn.
813
515
  export const AgentResumeAfterLimitSchema = z.object({
814
516
  id: z.string().min(1).describe("Which conversation."),
815
517
  resumeAfterLimit: z
@@ -819,18 +521,25 @@ export const AgentResumeAfterLimitSchema = z.object({
819
521
  "Whether the turn a spent allowance refused is sent again by itself once the window reopens. Null clears the override back to the sandbox-wide setting.",
820
522
  ),
821
523
  });
524
+ // Same three-state override, for moving a held turn to another account with room.
525
+ export const AgentMoveAfterLimitSchema = z.object({
526
+ id: z.string().min(1).describe("Which conversation."),
527
+ moveAfterLimit: z
528
+ .boolean()
529
+ .nullable()
530
+ .describe(
531
+ "Whether the turn a spent allowance refused is moved to another connected account of the same provider that has room, as soon as the refusal lands. Null clears the override back to the sandbox-wide setting.",
532
+ ),
533
+ });
822
534
  export const AgentFileDiffQuerySchema = z.object({
823
535
  id: z.string().min(1).describe("Which conversation."),
824
536
  repo: z.string().min(1).describe("Which repository."),
825
537
  path: z.string().min(1).describe("Which file, relative to that repository."),
826
538
  });
827
- /* WHY a path would not land. The distinction is the whole difference between an actionable report and a dead
828
- * end, because the three have nothing in common but their symptom:
829
- * `workspace`, you have uncommitted edits on that path. Yours is the copy at risk; commit or stash it.
830
- * `diverged` , the main tree's COMMITTED content moved under the agent since it branched. Nothing of
831
- * yours is at risk; the agent's delta is simply written against an older file.
832
- * `binary` , git cannot three-way merge the file at all, so no automatic resolution exists.
833
- * The old report named only the first, which is the rarest of the three. */
539
+ // Why a path would not land:
540
+ // workspace: your own uncommitted edits are on that path
541
+ // diverged: the main tree's committed content moved under the agent since it branched; nothing of yours is at risk
542
+ // binary: git cannot three-way merge the file at all
834
543
  export const LandConflictReasonSchema = z.enum(["workspace", "diverged", "binary"]);
835
544
  export type LandConflictReason = z.infer<typeof LandConflictReasonSchema>;
836
545
  export const LandConflictPathSchema = z.object({
@@ -839,11 +548,8 @@ export const LandConflictPathSchema = z.object({
839
548
  "Why it would not merge, and the three have nothing in common but the symptom. Your own uncommitted edits on that path, where yours is the copy at risk. The shared tree having moved under the conversation since it started, where nothing of yours is at risk. Or a file git cannot merge at all, where no automatic answer exists.",
840
549
  ),
841
550
  });
842
- /* A composed land's refusal, grouped per repo. `paths` is the set that genuinely failed to apply. NOT the
843
- * whole delta, which is what the first version reported whenever it could not pin the cause down, turning
844
- * four real conflicts into a wall of fourteen. `clean` counts what passed in that repo but stays on the branch
845
- * with the rest of the composition. An empty `paths` with `clean: 0` is the repo-unavailable case: the main
846
- * checkout is gone, and no path-level account exists. */
551
+ // `paths` are files that genuinely failed to apply, not the whole delta; empty `paths` with `clean: 0` means the repo
552
+ // itself was unreachable.
847
553
  export const LandConflictSchema = z.object({
848
554
  repo: z.string().describe("Which repository."),
849
555
  paths: z
@@ -856,10 +562,7 @@ export const LandConflictSchema = z.object({
856
562
  .describe(
857
563
  "How many files in this repository passed but remain held with the refused composition. Zero alongside an empty list means the repository could not be reached at all.",
858
564
  ),
859
- // The branch the user's checkout is on, the thing the agent has to rebase onto. Carried because only the
860
- // daemon can see it: an isolated turn's worktree is mounted over the agent's whole view, so the resolution
861
- // errand could otherwise only tell it to go and read the name off `git worktree list`. Absent on a detached
862
- // HEAD or a vanished checkout, where there is no name to give.
565
+ // The branch to rebase onto; carried since an isolated turn's worktree hides it from the agent's own view.
863
566
  mainBranch: z
864
567
  .string()
865
568
  .optional()
@@ -868,10 +571,9 @@ export const LandConflictSchema = z.object({
868
571
  ),
869
572
  });
870
573
  export type LandConflict = z.infer<typeof LandConflictSchema>;
871
- // Land's outcome for the whole frozen repo composition. The ordinary mode preflights every repo before it
872
- // writes any main tree: landed means all of them applied, and a conflict means none did. Every worktree keeps
873
- // its state, nothing is lost, and "Land now" stays available. `resolving` is populated only by a `merge` land:
874
- // the paths written into the workspace carrying conflict markers, which the user finishes by hand.
574
+ // Land's outcome for the whole composed change: the ordinary mode preflights every repo, all-or-nothing, so a refusal
575
+ // leaves the tree untouched. `resolving` only appears for a `merge` land, whose conflict markers the user finishes by
576
+ // hand.
875
577
  export const LandResultSchema = z.object({
876
578
  landed: z.boolean().describe("Whether the entire composed change was applied."),
877
579
  conflicts: z.array(LandConflictSchema).optional().describe("What stopped the whole composed change, grouped per repository."),
@@ -884,8 +586,8 @@ export const LandResultSchema = z.object({
884
586
  )
885
587
  .optional()
886
588
  .describe("Files left half-merged when you asked to carry the whole composition with its conflicts marked for resolution."),
887
- // A `measure` outcome with an outstanding delta: nothing was applied and nothing failed, the work is
888
- // waiting on the branch for a deliberate Land. `landed: false` alone can't say that (it means refusal).
589
+ // A `measure` outcome with work still on the branch; `landed: false` alone can't say that, since alone it means
590
+ // refusal.
889
591
  held: z
890
592
  .boolean()
891
593
  .optional()
@@ -894,41 +596,21 @@ export const LandResultSchema = z.object({
894
596
  ),
895
597
  });
896
598
  export type LandResult = z.infer<typeof LandResultSchema>;
897
- /* Land's input. `check` is the safe default: every repo is preflighted and the composition is applied only if
898
- * ALL of it applies, so a refusal leaves every main tree byte-identical. `merge` is the escape hatch the
899
- * conflict report offers, a three-way apply that carries the whole composition and leaves conflicted paths
900
- * with markers to resolve in place. It is opt-in because it writes those markers. `measure` is the
901
- * auto-land-off mode: everything a land does EXCEPT touching the main trees, the provenance commit onto
902
- * agent/<id>, the cumulative diffstat, and the bookkeeping for work that reached main by another road, so a
903
- * held agent's card stays current while its composed delta waits for a deliberate Land. */
599
+ // check: safe default, preflights every repo and applies only if all of it does, so a refusal leaves the tree
600
+ // byte-identical
601
+ // merge: opt-in escape hatch; three-way applies the whole composition, leaving conflict markers to resolve in place
602
+ // measure: does everything but touch the main trees, so a held agent's card stays current while its delta waits
904
603
  export const LandModeSchema = z.enum(["check", "merge", "measure"]);
905
604
  export type LandMode = z.infer<typeof LandModeSchema>;
906
- /* WHICH RUNG OF AN AGENT'S HISTORY A READING, or a land. STARTS AT.
907
- *
908
- * outstanding, only what has not landed yet, measured from the last landed tip. The default, and what a
909
- * land carries: a second land applies only what the agent has done since the first.
910
- * cumulative , the agent's WHOLE output, from where its branch left the main line. What the review lists
911
- * (landed work stays inspectable), and what "Land again" applies.
912
- *
913
- * A CUMULATIVE LAND IS NOT A DOUBLE APPLICATION. It is the way back when a land's work was discarded from the
914
- * workspace: the outstanding span is empty then, every sha says the work landed, because it did, so only a
915
- * reading from the base can still see the part that is missing. Paths the tree already holds drop out of it
916
- * per file, by the same reverse probe that keeps work which reached main by another road out of a conflict
917
- * report (land.ts, classifyDelta), so what actually applies is exactly what is gone. */
605
+ // outstanding: only what hasn't landed yet, from the last landed tip (the default; what a second land applies)
606
+ // cumulative: the agent's whole output from where its branch left main; what the review lists and what "Land again"
607
+ // applies. Not a double application: it's the way back when landed work was discarded from the tree, since paths
608
+ // already there drop out per file.
918
609
  export const AgentSpanSchema = z.enum(["cumulative", "outstanding"]);
919
610
  export type AgentSpan = z.infer<typeof AgentSpanSchema>;
920
- /* LAND WHILE THE AGENT IS STILL WRITING, the user's deliberate override of the turn guard, and the only
921
- * input here that is about WHEN a land may run rather than what it carries.
922
- *
923
- * A land snapshots the agent's checkout, so mid-turn it can catch work half-done: one leg of a rename, three
924
- * files of a five-file change. The guard exists for that, and it stays the default. What makes the override
925
- * defensible rather than reckless is that neither half of the damage is permanent, a land arrives as
926
- * UNCOMMITTED changes the user reviews before committing, and the rest of the turn lands on top of it at
927
- * completion like any other incremental land. So a premature land is a mess the user can see and one the next
928
- * land repairs, which is a thing to warn about; it is not a thing to forbid.
929
- *
930
- * It does NOT cover a turn PARKED on a question or a permission card, nothing is being written there, so that
931
- * land needs no override and takes none (agents.routes.ts). This flag means "yes, mid-write, I know". */
611
+ // Overrides the guard against landing mid-turn; safe since a land arrives as uncommitted changes the user reviews, and
612
+ // the rest of the turn lands on top of it later. Doesn't apply to a turn parked on a question, which needs no override
613
+ // at all.
932
614
  export const AgentLandSchema = z.object({
933
615
  id: z.string().min(1).describe("Which conversation's work to merge."),
934
616
  mode: LandModeSchema.optional().describe(