@intentic/sandbox-contract 1.248.0 → 1.250.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 (879) 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 +6 -0
  93. package/dist/contracts/skills.contract.d.ts.map +1 -1
  94. package/dist/contracts/skills.contract.js +13 -4
  95. package/dist/contracts/skills.contract.js.map +1 -1
  96. package/dist/contracts/system.contract.d.ts +49 -73
  97. package/dist/contracts/system.contract.d.ts.map +1 -1
  98. package/dist/contracts/system.contract.js +12 -2
  99. package/dist/contracts/system.contract.js.map +1 -1
  100. package/dist/contracts/usage.contract.d.ts.map +1 -1
  101. package/dist/contracts/usage.contract.js.map +1 -1
  102. package/dist/contracts/vpn.contract.d.ts.map +1 -1
  103. package/dist/contracts/vpn.contract.js +1 -1
  104. package/dist/contracts/vpn.contract.js.map +1 -1
  105. package/dist/contracts/webext.contract.d.ts.map +1 -1
  106. package/dist/contracts/webext.contract.js.map +1 -1
  107. package/dist/contracts/workflows.contract.d.ts +7 -6
  108. package/dist/contracts/workflows.contract.d.ts.map +1 -1
  109. package/dist/contracts/workflows.contract.js +12 -3
  110. package/dist/contracts/workflows.contract.js.map +1 -1
  111. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  112. package/dist/contracts/workspace.contract.js.map +1 -1
  113. package/dist/events/agent-events.d.ts +1237 -0
  114. package/dist/events/agent-events.d.ts.map +1 -0
  115. package/dist/events/agent-events.js +226 -0
  116. package/dist/events/agent-events.js.map +1 -0
  117. package/dist/events/cards.d.ts +404 -0
  118. package/dist/events/cards.d.ts.map +1 -0
  119. package/dist/events/cards.js +179 -0
  120. package/dist/events/cards.js.map +1 -0
  121. package/dist/events/resume.d.ts +23 -0
  122. package/dist/events/resume.d.ts.map +1 -0
  123. package/dist/events/resume.js +31 -0
  124. package/dist/events/resume.js.map +1 -0
  125. package/dist/events/system-events.d.ts +615 -0
  126. package/dist/events/system-events.d.ts.map +1 -0
  127. package/dist/events/system-events.js +64 -0
  128. package/dist/events/system-events.js.map +1 -0
  129. package/dist/events/transcript.d.ts +1755 -0
  130. package/dist/events/transcript.d.ts.map +1 -0
  131. package/dist/events/transcript.js +205 -0
  132. package/dist/events/transcript.js.map +1 -0
  133. package/dist/ids/conversation-ids.d.ts +8 -0
  134. package/dist/ids/conversation-ids.d.ts.map +1 -0
  135. package/dist/{conversation-ids.js → ids/conversation-ids.js} +13 -0
  136. package/dist/ids/conversation-ids.js.map +1 -0
  137. package/dist/ids/hostnames.d.ts.map +1 -0
  138. package/dist/ids/hostnames.js.map +1 -0
  139. package/dist/ids/session-names.d.ts.map +1 -0
  140. package/dist/ids/session-names.js.map +1 -0
  141. package/dist/ids/share-paths.d.ts.map +1 -0
  142. package/dist/ids/share-paths.js.map +1 -0
  143. package/dist/{tunnel-ids.d.ts → ids/tunnel-ids.d.ts} +1 -0
  144. package/dist/ids/tunnel-ids.d.ts.map +1 -0
  145. package/dist/{tunnel-ids.js → ids/tunnel-ids.js} +1 -0
  146. package/dist/ids/tunnel-ids.js.map +1 -0
  147. package/dist/index.d.ts +429 -450
  148. package/dist/index.d.ts.map +1 -1
  149. package/dist/index.js +54 -46
  150. package/dist/index.js.map +1 -1
  151. package/dist/{agent-catalog.d.ts → models/agent-catalog.d.ts} +2 -2
  152. package/dist/models/agent-catalog.d.ts.map +1 -0
  153. package/dist/models/agent-catalog.js.map +1 -0
  154. package/dist/models/agent-runtimes.d.ts.map +1 -0
  155. package/dist/models/agent-runtimes.js.map +1 -0
  156. package/dist/{fast-tier.d.ts → models/fast-tier.d.ts} +1 -1
  157. package/dist/models/fast-tier.d.ts.map +1 -0
  158. package/dist/models/fast-tier.js.map +1 -0
  159. package/dist/models/model-order.d.ts.map +1 -0
  160. package/dist/{model-order.js → models/model-order.js} +2 -0
  161. package/dist/models/model-order.js.map +1 -0
  162. package/dist/{model-pins.d.ts → models/model-pins.d.ts} +1 -1
  163. package/dist/models/model-pins.d.ts.map +1 -0
  164. package/dist/models/model-pins.js.map +1 -0
  165. package/dist/{model-roles.d.ts → models/model-roles.d.ts} +0 -33
  166. package/dist/models/model-roles.d.ts.map +1 -0
  167. package/dist/{model-roles.js → models/model-roles.js} +0 -35
  168. package/dist/models/model-roles.js.map +1 -0
  169. package/dist/{plan-pools.d.ts → models/plan-pools.d.ts} +1 -1
  170. package/dist/models/plan-pools.d.ts.map +1 -0
  171. package/dist/models/plan-pools.js.map +1 -0
  172. package/dist/models/prompt-complexity.d.ts.map +1 -0
  173. package/dist/models/prompt-complexity.js.map +1 -0
  174. package/dist/models/provider-specs.d.ts.map +1 -0
  175. package/dist/models/provider-specs.js.map +1 -0
  176. package/dist/policy/approvals-execution.d.ts.map +1 -0
  177. package/dist/policy/approvals-execution.js.map +1 -0
  178. package/dist/{batch-runs.d.ts → policy/batch-runs.d.ts} +5 -1
  179. package/dist/policy/batch-runs.d.ts.map +1 -0
  180. package/dist/{batch-runs.js → policy/batch-runs.js} +10 -7
  181. package/dist/policy/batch-runs.js.map +1 -0
  182. package/dist/policy/capability-env.d.ts.map +1 -0
  183. package/dist/policy/capability-env.js.map +1 -0
  184. package/dist/policy/capability-secrets.d.ts.map +1 -0
  185. package/dist/policy/capability-secrets.js.map +1 -0
  186. package/dist/{card-status.d.ts → policy/card-status.d.ts} +2 -2
  187. package/dist/policy/card-status.d.ts.map +1 -0
  188. package/dist/{card-status.js → policy/card-status.js} +1 -5
  189. package/dist/policy/card-status.js.map +1 -0
  190. package/dist/{command-classes.d.ts → policy/command-classes.d.ts} +6 -2
  191. package/dist/policy/command-classes.d.ts.map +1 -0
  192. package/dist/{command-classes.js → policy/command-classes.js} +48 -11
  193. package/dist/policy/command-classes.js.map +1 -0
  194. package/dist/{command-run.d.ts → policy/command-run.d.ts} +1 -1
  195. package/dist/policy/command-run.d.ts.map +1 -0
  196. package/dist/policy/command-run.js.map +1 -0
  197. package/dist/policy/control-scopes.d.ts +16 -0
  198. package/dist/policy/control-scopes.d.ts.map +1 -0
  199. package/dist/policy/control-scopes.js +26 -0
  200. package/dist/policy/control-scopes.js.map +1 -0
  201. package/dist/policy/credential-material.d.ts.map +1 -0
  202. package/dist/policy/credential-material.js.map +1 -0
  203. package/dist/policy/needs-action.d.ts.map +1 -0
  204. package/dist/policy/needs-action.js.map +1 -0
  205. package/dist/policy/output-fields.d.ts.map +1 -0
  206. package/dist/policy/output-fields.js.map +1 -0
  207. package/dist/policy/overlay-lint.d.ts.map +1 -0
  208. package/dist/policy/overlay-lint.js.map +1 -0
  209. package/dist/policy/owner-ticket.d.ts.map +1 -0
  210. package/dist/{owner-ticket.js → policy/owner-ticket.js} +1 -1
  211. package/dist/policy/owner-ticket.js.map +1 -0
  212. package/dist/{safety-policy.d.ts → policy/safety-policy.d.ts} +6 -5
  213. package/dist/policy/safety-policy.d.ts.map +1 -0
  214. package/dist/{safety-policy.js → policy/safety-policy.js} +12 -12
  215. package/dist/policy/safety-policy.js.map +1 -0
  216. package/dist/policy/search-globs.d.ts.map +1 -0
  217. package/dist/policy/search-globs.js.map +1 -0
  218. package/dist/protocol/container-requirements.d.ts +20 -0
  219. package/dist/protocol/container-requirements.d.ts.map +1 -0
  220. package/dist/protocol/container-requirements.js +23 -0
  221. package/dist/protocol/container-requirements.js.map +1 -0
  222. package/dist/{host-protocol.d.ts → protocol/host-protocol.d.ts} +1 -0
  223. package/dist/protocol/host-protocol.d.ts.map +1 -0
  224. package/dist/{host-protocol.js → protocol/host-protocol.js} +1 -0
  225. package/dist/protocol/host-protocol.js.map +1 -0
  226. package/dist/protocol/ingress-contract.d.ts.map +1 -0
  227. package/dist/{ingress-contract.js → protocol/ingress-contract.js} +1 -1
  228. package/dist/protocol/ingress-contract.js.map +1 -0
  229. package/dist/protocol/ingress-protocol.d.ts.map +1 -0
  230. package/dist/protocol/ingress-protocol.js.map +1 -0
  231. package/dist/protocol/listener-protocol.d.ts.map +1 -0
  232. package/dist/{listener-protocol.js → protocol/listener-protocol.js} +1 -1
  233. package/dist/protocol/listener-protocol.js.map +1 -0
  234. package/dist/{peer-dial.d.ts → protocol/peer-dial.d.ts} +4 -1
  235. package/dist/protocol/peer-dial.d.ts.map +1 -0
  236. package/dist/{peer-dial.js → protocol/peer-dial.js} +51 -10
  237. package/dist/protocol/peer-dial.js.map +1 -0
  238. package/dist/protocol/peer-mcp-server.d.ts.map +1 -0
  239. package/dist/protocol/peer-mcp-server.js.map +1 -0
  240. package/dist/protocol/request-id.d.ts.map +1 -0
  241. package/dist/protocol/request-id.js.map +1 -0
  242. package/dist/protocol/routes.d.ts.map +1 -0
  243. package/dist/protocol/routes.js.map +1 -0
  244. package/dist/{runner-protocol.d.ts → protocol/runner-protocol.d.ts} +1 -0
  245. package/dist/protocol/runner-protocol.d.ts.map +1 -0
  246. package/dist/{runner-protocol.js → protocol/runner-protocol.js} +2 -1
  247. package/dist/protocol/runner-protocol.js.map +1 -0
  248. package/dist/protocol/sse.d.ts.map +1 -0
  249. package/dist/protocol/sse.js.map +1 -0
  250. package/dist/{terminal-protocol.d.ts → protocol/terminal-protocol.d.ts} +1 -3
  251. package/dist/protocol/terminal-protocol.d.ts.map +1 -0
  252. package/dist/protocol/terminal-protocol.js.map +1 -0
  253. package/dist/protocol/webext-links.d.ts.map +1 -0
  254. package/dist/protocol/webext-links.js.map +1 -0
  255. package/dist/{webext-protocol.d.ts → protocol/webext-protocol.d.ts} +1 -0
  256. package/dist/protocol/webext-protocol.d.ts.map +1 -0
  257. package/dist/{webext-protocol.js → protocol/webext-protocol.js} +1 -0
  258. package/dist/protocol/webext-protocol.js.map +1 -0
  259. package/dist/schemas/activity.d.ts +2 -0
  260. package/dist/schemas/activity.d.ts.map +1 -1
  261. package/dist/schemas/activity.js +4 -0
  262. package/dist/schemas/activity.js.map +1 -1
  263. package/dist/schemas/agent.d.ts +16 -4
  264. package/dist/schemas/agent.d.ts.map +1 -1
  265. package/dist/schemas/agent.js +21 -4
  266. package/dist/schemas/agent.js.map +1 -1
  267. package/dist/schemas/agents.d.ts +17 -4
  268. package/dist/schemas/agents.d.ts.map +1 -1
  269. package/dist/schemas/agents.js +15 -4
  270. package/dist/schemas/agents.js.map +1 -1
  271. package/dist/schemas/approvals.d.ts.map +1 -1
  272. package/dist/schemas/approvals.js.map +1 -1
  273. package/dist/schemas/automations.d.ts +54 -28
  274. package/dist/schemas/automations.d.ts.map +1 -1
  275. package/dist/schemas/automations.js +26 -8
  276. package/dist/schemas/automations.js.map +1 -1
  277. package/dist/schemas/capabilities.d.ts +0 -8
  278. package/dist/schemas/capabilities.d.ts.map +1 -1
  279. package/dist/schemas/capabilities.js +0 -4
  280. package/dist/schemas/capabilities.js.map +1 -1
  281. package/dist/schemas/ci.d.ts +10 -0
  282. package/dist/schemas/ci.d.ts.map +1 -1
  283. package/dist/schemas/ci.js +9 -1
  284. package/dist/schemas/ci.js.map +1 -1
  285. package/dist/schemas/codebase-health.d.ts.map +1 -1
  286. package/dist/schemas/codebase-health.js.map +1 -1
  287. package/dist/schemas/devices.d.ts +92 -0
  288. package/dist/schemas/devices.d.ts.map +1 -1
  289. package/dist/schemas/devices.js +12 -1
  290. package/dist/schemas/devices.js.map +1 -1
  291. package/dist/schemas/engines.d.ts.map +1 -1
  292. package/dist/schemas/engines.js.map +1 -1
  293. package/dist/schemas/environment.d.ts.map +1 -1
  294. package/dist/schemas/environment.js.map +1 -1
  295. package/dist/schemas/exit.d.ts.map +1 -1
  296. package/dist/schemas/exit.js.map +1 -1
  297. package/dist/schemas/extension-updates.d.ts.map +1 -1
  298. package/dist/schemas/extension-updates.js.map +1 -1
  299. package/dist/schemas/git-history.d.ts.map +1 -1
  300. package/dist/schemas/git-history.js.map +1 -1
  301. package/dist/schemas/git.d.ts +80 -16
  302. package/dist/schemas/git.d.ts.map +1 -1
  303. package/dist/schemas/git.js +37 -25
  304. package/dist/schemas/git.js.map +1 -1
  305. package/dist/schemas/history.d.ts.map +1 -1
  306. package/dist/schemas/history.js.map +1 -1
  307. package/dist/schemas/hosts.d.ts.map +1 -1
  308. package/dist/schemas/hosts.js.map +1 -1
  309. package/dist/schemas/inventory.d.ts.map +1 -1
  310. package/dist/schemas/inventory.js.map +1 -1
  311. package/dist/schemas/issues.d.ts +0 -1
  312. package/dist/schemas/issues.d.ts.map +1 -1
  313. package/dist/schemas/issues.js +0 -1
  314. package/dist/schemas/issues.js.map +1 -1
  315. package/dist/schemas/logs.d.ts.map +1 -1
  316. package/dist/schemas/logs.js.map +1 -1
  317. package/dist/schemas/loops.d.ts.map +1 -1
  318. package/dist/schemas/loops.js +1 -1
  319. package/dist/schemas/loops.js.map +1 -1
  320. package/dist/schemas/maintenance.d.ts.map +1 -1
  321. package/dist/schemas/maintenance.js.map +1 -1
  322. package/dist/schemas/marketplace.d.ts +0 -4
  323. package/dist/schemas/marketplace.d.ts.map +1 -1
  324. package/dist/schemas/panels.d.ts.map +1 -1
  325. package/dist/schemas/panels.js.map +1 -1
  326. package/dist/schemas/personas.d.ts +2 -1
  327. package/dist/schemas/personas.d.ts.map +1 -1
  328. package/dist/schemas/personas.js +6 -2
  329. package/dist/schemas/personas.js.map +1 -1
  330. package/dist/schemas/plan-limits.d.ts +2 -4
  331. package/dist/schemas/plan-limits.d.ts.map +1 -1
  332. package/dist/schemas/plan-limits.js +5 -8
  333. package/dist/schemas/plan-limits.js.map +1 -1
  334. package/dist/schemas/ports.d.ts.map +1 -1
  335. package/dist/schemas/ports.js.map +1 -1
  336. package/dist/schemas/provider-oauth.d.ts.map +1 -1
  337. package/dist/schemas/provider-oauth.js.map +1 -1
  338. package/dist/schemas/provider-subscriptions.d.ts +1 -1
  339. package/dist/schemas/provider-subscriptions.d.ts.map +1 -1
  340. package/dist/schemas/provider-subscriptions.js +1 -1
  341. package/dist/schemas/provider-subscriptions.js.map +1 -1
  342. package/dist/schemas/public.d.ts.map +1 -1
  343. package/dist/schemas/public.js.map +1 -1
  344. package/dist/schemas/push.d.ts.map +1 -1
  345. package/dist/schemas/push.js.map +1 -1
  346. package/dist/schemas/secrets.d.ts.map +1 -1
  347. package/dist/schemas/secrets.js.map +1 -1
  348. package/dist/schemas/settings.d.ts +11 -9
  349. package/dist/schemas/settings.d.ts.map +1 -1
  350. package/dist/schemas/settings.js +22 -7
  351. package/dist/schemas/settings.js.map +1 -1
  352. package/dist/schemas/share.d.ts.map +1 -1
  353. package/dist/schemas/share.js.map +1 -1
  354. package/dist/schemas/shared.d.ts +4 -0
  355. package/dist/schemas/shared.d.ts.map +1 -1
  356. package/dist/schemas/shared.js +3 -0
  357. package/dist/schemas/shared.js.map +1 -1
  358. package/dist/schemas/system.d.ts +6 -0
  359. package/dist/schemas/system.d.ts.map +1 -1
  360. package/dist/schemas/system.js +10 -0
  361. package/dist/schemas/system.js.map +1 -1
  362. package/dist/schemas/terminal.d.ts.map +1 -1
  363. package/dist/schemas/terminal.js.map +1 -1
  364. package/dist/schemas/usage.d.ts.map +1 -1
  365. package/dist/schemas/usage.js.map +1 -1
  366. package/dist/schemas/vpn.d.ts.map +1 -1
  367. package/dist/schemas/vpn.js.map +1 -1
  368. package/dist/schemas/webext.d.ts.map +1 -1
  369. package/dist/schemas/webext.js.map +1 -1
  370. package/dist/schemas/workflows.d.ts +66 -9
  371. package/dist/schemas/workflows.d.ts.map +1 -1
  372. package/dist/schemas/workflows.js +6 -5
  373. package/dist/schemas/workflows.js.map +1 -1
  374. package/dist/schemas/workspace-repos.d.ts.map +1 -1
  375. package/dist/schemas/workspace-repos.js.map +1 -1
  376. package/dist/schemas/workspace-search.d.ts.map +1 -1
  377. package/dist/schemas/workspace-search.js.map +1 -1
  378. package/dist/schemas/workspace-setup.d.ts.map +1 -1
  379. package/dist/schemas/workspace-setup.js.map +1 -1
  380. package/dist/schemas/workspace-tree.d.ts.map +1 -1
  381. package/dist/schemas/workspace-tree.js.map +1 -1
  382. package/dist/state/arrival.d.ts.map +1 -0
  383. package/dist/{arrival.js → state/arrival.js} +1 -1
  384. package/dist/state/arrival.js.map +1 -0
  385. package/dist/state/contract-lock.d.ts.map +1 -0
  386. package/dist/{contract-lock.js → state/contract-lock.js} +1 -1
  387. package/dist/state/contract-lock.js.map +1 -0
  388. package/dist/{definition.d.ts → state/definition.d.ts} +21 -17
  389. package/dist/state/definition.d.ts.map +1 -0
  390. package/dist/{definition.js → state/definition.js} +4 -4
  391. package/dist/state/definition.js.map +1 -0
  392. package/dist/state/history-state.d.ts.map +1 -0
  393. package/dist/{history-state.js → state/history-state.js} +1 -0
  394. package/dist/state/history-state.js.map +1 -0
  395. package/dist/state/runtime-state.d.ts.map +1 -0
  396. package/dist/state/runtime-state.js.map +1 -0
  397. package/dist/state/starter.d.ts.map +1 -0
  398. package/dist/state/starter.js.map +1 -0
  399. package/dist/state/state-portability.d.ts.map +1 -0
  400. package/dist/state/state-portability.js.map +1 -0
  401. package/dist/state/versions.d.ts.map +1 -0
  402. package/dist/state/versions.js.map +1 -0
  403. package/dist/{workspace-state.d.ts → state/workspace-state.d.ts} +8 -0
  404. package/dist/state/workspace-state.d.ts.map +1 -0
  405. package/dist/{workspace-state.js → state/workspace-state.js} +25 -0
  406. package/dist/state/workspace-state.js.map +1 -0
  407. package/dist/{documents.d.ts → text/documents.d.ts} +1 -1
  408. package/dist/text/documents.d.ts.map +1 -0
  409. package/dist/{documents.js → text/documents.js} +1 -1
  410. package/dist/text/documents.js.map +1 -0
  411. package/dist/text/embed.d.ts.map +1 -0
  412. package/dist/text/embed.js.map +1 -0
  413. package/dist/text/mentions.d.ts.map +1 -0
  414. package/dist/text/mentions.js.map +1 -0
  415. package/dist/text/model-answer.d.ts +3 -0
  416. package/dist/text/model-answer.d.ts.map +1 -0
  417. package/dist/text/model-answer.js +3 -0
  418. package/dist/text/model-answer.js.map +1 -0
  419. package/dist/text/path-refs.d.ts.map +1 -0
  420. package/dist/text/path-refs.js.map +1 -0
  421. package/dist/{shell-regions.d.ts → text/shell-regions.d.ts} +1 -1
  422. package/dist/text/shell-regions.d.ts.map +1 -0
  423. package/dist/text/shell-regions.js.map +1 -0
  424. package/dist/text/title.d.ts.map +1 -0
  425. package/dist/text/title.js.map +1 -0
  426. package/dist/{transcript-fold.d.ts → text/transcript-fold.d.ts} +2 -1
  427. package/dist/text/transcript-fold.d.ts.map +1 -0
  428. package/dist/{transcript-fold.js → text/transcript-fold.js} +2 -16
  429. package/dist/text/transcript-fold.js.map +1 -0
  430. package/dist/text/whisper.d.ts +3 -0
  431. package/dist/text/whisper.d.ts.map +1 -0
  432. package/dist/text/whisper.js +11 -0
  433. package/dist/text/whisper.js.map +1 -0
  434. package/dist/{workflow-faults.d.ts → text/workflow-faults.d.ts} +1 -1
  435. package/dist/text/workflow-faults.d.ts.map +1 -0
  436. package/dist/{workflow-faults.js → text/workflow-faults.js} +1 -1
  437. package/dist/text/workflow-faults.js.map +1 -0
  438. package/package.json +70 -70
  439. package/src/chores/chores.test.ts +4 -10
  440. package/src/chores/chores.ts +148 -392
  441. package/src/chores/digest.ts +8 -28
  442. package/src/chores/extension-update.ts +3 -8
  443. package/src/chores/fix-deps.ts +4 -18
  444. package/src/chores/index.ts +2 -2
  445. package/src/chores/probes.test.ts +7 -43
  446. package/src/chores/probes.ts +62 -167
  447. package/src/chores/prompt.ts +10 -34
  448. package/src/chores/stack.test.ts +6 -45
  449. package/src/chores/stack.ts +27 -118
  450. package/src/chores/verdict.test.ts +101 -80
  451. package/src/chores/verdict.ts +54 -99
  452. package/src/contracts/accounts.contract.ts +4 -19
  453. package/src/contracts/agent.contract.ts +7 -22
  454. package/src/contracts/agents.contract.ts +25 -71
  455. package/src/contracts/automations.contract.ts +14 -30
  456. package/src/contracts/capabilities.contract.ts +8 -35
  457. package/src/contracts/chores.contract.ts +4 -15
  458. package/src/contracts/endpoints.contract.ts +5 -22
  459. package/src/contracts/exit.contract.ts +7 -30
  460. package/src/contracts/extensions.contract.ts +8 -30
  461. package/src/contracts/git.contract.ts +25 -49
  462. package/src/contracts/host.contract.ts +9 -44
  463. package/src/contracts/intentic.contract.ts +1 -1
  464. package/src/contracts/logs.contract.ts +3 -13
  465. package/src/contracts/loops.contract.ts +9 -40
  466. package/src/contracts/personas.contract.ts +10 -35
  467. package/src/contracts/providers.contract.ts +4 -17
  468. package/src/contracts/runner.contract.ts +12 -39
  469. package/src/contracts/safety.contract.ts +5 -14
  470. package/src/contracts/secrets.contract.ts +4 -22
  471. package/src/contracts/sessions.contract.ts +1 -1
  472. package/src/contracts/settings.contract.ts +4 -10
  473. package/src/contracts/share.contract.ts +3 -9
  474. package/src/contracts/skills.contract.ts +21 -19
  475. package/src/contracts/system.contract.ts +26 -52
  476. package/src/contracts/usage.contract.ts +7 -21
  477. package/src/contracts/vpn.contract.ts +9 -16
  478. package/src/contracts/webext.contract.ts +9 -25
  479. package/src/contracts/workflows.contract.ts +34 -58
  480. package/src/contracts/workspace.contract.ts +19 -50
  481. package/src/events/agent-events.ts +345 -0
  482. package/src/events/cards.ts +286 -0
  483. package/src/{events.test.ts → events/resume.test.ts} +4 -19
  484. package/src/events/resume.ts +60 -0
  485. package/src/events/system-events.ts +139 -0
  486. package/src/events/transcript.ts +320 -0
  487. package/src/{conversation-ids.test.ts → ids/conversation-ids.test.ts} +25 -13
  488. package/src/ids/conversation-ids.ts +178 -0
  489. package/src/ids/hostnames.ts +129 -0
  490. package/src/ids/session-names.ts +29 -0
  491. package/src/ids/share-paths.ts +43 -0
  492. package/src/{tunnel-ids.test.ts → ids/tunnel-ids.test.ts} +1 -14
  493. package/src/ids/tunnel-ids.ts +29 -0
  494. package/src/index.ts +71 -87
  495. package/src/{agent-catalog.test.ts → models/agent-catalog.test.ts} +19 -93
  496. package/src/models/agent-catalog.ts +174 -0
  497. package/src/models/agent-runtimes.ts +201 -0
  498. package/src/models/capability-ledger.test.ts +84 -0
  499. package/src/{fast-tier.test.ts → models/fast-tier.test.ts} +7 -18
  500. package/src/models/fast-tier.ts +36 -0
  501. package/src/{model-order.test.ts → models/model-order.test.ts} +54 -40
  502. package/src/models/model-order.ts +171 -0
  503. package/src/{model-pins.test.ts → models/model-pins.test.ts} +12 -46
  504. package/src/models/model-pins.ts +57 -0
  505. package/src/models/model-roles.test.ts +38 -0
  506. package/src/models/model-roles.ts +180 -0
  507. package/src/{plan-pools.test.ts → models/plan-pools.test.ts} +6 -11
  508. package/src/models/plan-pools.ts +65 -0
  509. package/src/{prompt-complexity.test.ts → models/prompt-complexity.test.ts} +8 -60
  510. package/src/models/prompt-complexity.ts +215 -0
  511. package/src/{provider-specs.test.ts → models/provider-specs.test.ts} +18 -47
  512. package/src/models/provider-specs.ts +272 -0
  513. package/src/policy/approvals-execution.ts +58 -0
  514. package/src/{batch-runs.test.ts → policy/batch-runs.test.ts} +4 -20
  515. package/src/policy/batch-runs.ts +137 -0
  516. package/src/policy/capability-secrets.ts +5 -0
  517. package/src/{card-status.ts → policy/card-status.ts} +11 -26
  518. package/src/{command-classes.test.ts → policy/command-classes.test.ts} +11 -118
  519. package/src/policy/command-classes.ts +395 -0
  520. package/src/policy/command-run.ts +65 -0
  521. package/src/policy/control-scopes.ts +38 -0
  522. package/src/{credential-material.test.ts → policy/credential-material.test.ts} +4 -26
  523. package/src/policy/credential-material.ts +91 -0
  524. package/src/policy/needs-action.ts +5 -0
  525. package/src/policy/output-fields.ts +86 -0
  526. package/src/policy/overlay-lint.ts +100 -0
  527. package/src/{owner-ticket.test.ts → policy/owner-ticket.test.ts} +1 -1
  528. package/src/{owner-ticket.ts → policy/owner-ticket.ts} +9 -31
  529. package/src/policy/safety-policy.test.ts +84 -0
  530. package/src/policy/safety-policy.ts +142 -0
  531. package/src/policy/search-globs.ts +60 -0
  532. package/src/protocol/container-requirements.test.ts +72 -0
  533. package/src/protocol/container-requirements.ts +58 -0
  534. package/src/protocol/host-protocol.ts +29 -0
  535. package/src/protocol/ingress-contract.ts +103 -0
  536. package/src/{ingress-protocol.test.ts → protocol/ingress-protocol.test.ts} +25 -90
  537. package/src/protocol/ingress-protocol.ts +441 -0
  538. package/src/protocol/listener-protocol.ts +75 -0
  539. package/src/{peer-dial.test.ts → protocol/peer-dial.test.ts} +52 -1
  540. package/src/protocol/peer-dial.ts +207 -0
  541. package/src/{peer-mcp-server.ts → protocol/peer-mcp-server.ts} +16 -41
  542. package/src/protocol/request-id.ts +5 -0
  543. package/src/{routes.test.ts → protocol/routes.test.ts} +14 -22
  544. package/src/protocol/routes.ts +159 -0
  545. package/src/protocol/runner-protocol.ts +197 -0
  546. package/src/protocol/terminal-protocol.ts +13 -0
  547. package/src/protocol/webext-links.ts +50 -0
  548. package/src/protocol/webext-protocol.ts +24 -0
  549. package/src/schemas/activity.ts +22 -30
  550. package/src/schemas/agent.ts +130 -238
  551. package/src/schemas/agents.ts +165 -483
  552. package/src/schemas/approvals.ts +23 -71
  553. package/src/schemas/automations.ts +142 -250
  554. package/src/schemas/capabilities.ts +127 -414
  555. package/src/schemas/ci.ts +56 -108
  556. package/src/schemas/codebase-health.ts +7 -11
  557. package/src/schemas/devices.ts +103 -321
  558. package/src/schemas/engines.ts +16 -44
  559. package/src/schemas/environment.ts +41 -91
  560. package/src/schemas/exit.ts +24 -81
  561. package/src/schemas/extension-updates.ts +42 -87
  562. package/src/schemas/git-history.ts +30 -84
  563. package/src/schemas/git.ts +141 -256
  564. package/src/schemas/history.ts +14 -40
  565. package/src/schemas/hosts.ts +9 -15
  566. package/src/schemas/inventory.ts +8 -10
  567. package/src/schemas/issues.ts +66 -134
  568. package/src/schemas/logs.ts +15 -34
  569. package/src/schemas/loops.ts +46 -163
  570. package/src/schemas/maintenance.ts +47 -172
  571. package/src/schemas/panels.ts +20 -45
  572. package/src/schemas/personas.ts +50 -200
  573. package/src/schemas/plan-limits.ts +58 -197
  574. package/src/schemas/ports.ts +14 -32
  575. package/src/schemas/provider-oauth.ts +23 -76
  576. package/src/schemas/provider-subscriptions.ts +4 -13
  577. package/src/schemas/public.ts +4 -15
  578. package/src/schemas/push.ts +8 -36
  579. package/src/schemas/secrets.ts +20 -64
  580. package/src/schemas/settings.ts +182 -602
  581. package/src/schemas/share.ts +14 -32
  582. package/src/schemas/shared.ts +14 -13
  583. package/src/schemas/system.ts +46 -78
  584. package/src/schemas/terminal.ts +41 -120
  585. package/src/schemas/usage.ts +44 -233
  586. package/src/schemas/version-seam.test.ts +9 -26
  587. package/src/schemas/vpn.ts +27 -64
  588. package/src/schemas/webext.ts +22 -53
  589. package/src/schemas/workflows.ts +57 -183
  590. package/src/schemas/workspace-repos.ts +12 -24
  591. package/src/schemas/workspace-search.ts +17 -35
  592. package/src/schemas/workspace-setup.ts +4 -11
  593. package/src/schemas/workspace-tree.ts +32 -91
  594. package/src/state/arrival.ts +109 -0
  595. package/src/state/contract-lock.test.ts +17 -0
  596. package/src/state/contract-lock.ts +49 -0
  597. package/src/state/definition.ts +143 -0
  598. package/src/state/history-state.ts +103 -0
  599. package/src/{runtime-state.test.ts → state/runtime-state.test.ts} +3 -10
  600. package/src/state/runtime-state.ts +63 -0
  601. package/src/state/starter.ts +5 -0
  602. package/src/state/state-portability.ts +27 -0
  603. package/src/state/versions.ts +26 -0
  604. package/src/{workspace-state.test.ts → state/workspace-state.test.ts} +65 -172
  605. package/src/state/workspace-state.ts +669 -0
  606. package/src/{documents.test.ts → text/documents.test.ts} +1 -1
  607. package/src/text/documents.ts +42 -0
  608. package/src/text/embed.ts +132 -0
  609. package/src/text/mentions.ts +21 -0
  610. package/src/text/model-answer.ts +9 -0
  611. package/src/text/path-refs.ts +39 -0
  612. package/src/text/shell-regions.ts +224 -0
  613. package/src/{title.test.ts → text/title.test.ts} +13 -32
  614. package/src/text/title.ts +202 -0
  615. package/src/{transcript-fold.test.ts → text/transcript-fold.test.ts} +5 -83
  616. package/src/{transcript-fold.ts → text/transcript-fold.ts} +65 -170
  617. package/src/text/whisper.test.ts +19 -0
  618. package/src/text/whisper.ts +17 -0
  619. package/src/{workflow-faults.test.ts → text/workflow-faults.test.ts} +6 -24
  620. package/src/{workflow-faults.ts → text/workflow-faults.ts} +20 -60
  621. package/dist/agent-catalog.d.ts.map +0 -1
  622. package/dist/agent-catalog.js.map +0 -1
  623. package/dist/agent-runtimes.d.ts.map +0 -1
  624. package/dist/agent-runtimes.js.map +0 -1
  625. package/dist/approvals-execution.d.ts.map +0 -1
  626. package/dist/approvals-execution.js.map +0 -1
  627. package/dist/arrival.d.ts.map +0 -1
  628. package/dist/arrival.js.map +0 -1
  629. package/dist/batch-runs.d.ts.map +0 -1
  630. package/dist/batch-runs.js.map +0 -1
  631. package/dist/capability-env.d.ts.map +0 -1
  632. package/dist/capability-env.js.map +0 -1
  633. package/dist/capability-secrets.d.ts.map +0 -1
  634. package/dist/capability-secrets.js.map +0 -1
  635. package/dist/card-status.d.ts.map +0 -1
  636. package/dist/card-status.js.map +0 -1
  637. package/dist/command-classes.d.ts.map +0 -1
  638. package/dist/command-classes.js.map +0 -1
  639. package/dist/command-run.d.ts.map +0 -1
  640. package/dist/command-run.js.map +0 -1
  641. package/dist/contract-lock.d.ts.map +0 -1
  642. package/dist/contract-lock.js.map +0 -1
  643. package/dist/conversation-ids.d.ts +0 -4
  644. package/dist/conversation-ids.d.ts.map +0 -1
  645. package/dist/conversation-ids.js.map +0 -1
  646. package/dist/credential-material.d.ts.map +0 -1
  647. package/dist/credential-material.js.map +0 -1
  648. package/dist/definition.d.ts.map +0 -1
  649. package/dist/definition.js.map +0 -1
  650. package/dist/documents.d.ts.map +0 -1
  651. package/dist/documents.js.map +0 -1
  652. package/dist/embed.d.ts.map +0 -1
  653. package/dist/embed.js.map +0 -1
  654. package/dist/events.d.ts +0 -4336
  655. package/dist/events.d.ts.map +0 -1
  656. package/dist/events.js +0 -725
  657. package/dist/events.js.map +0 -1
  658. package/dist/fast-tier.d.ts.map +0 -1
  659. package/dist/fast-tier.js.map +0 -1
  660. package/dist/history-state.d.ts.map +0 -1
  661. package/dist/history-state.js.map +0 -1
  662. package/dist/host-protocol.d.ts.map +0 -1
  663. package/dist/host-protocol.js.map +0 -1
  664. package/dist/hostnames.d.ts.map +0 -1
  665. package/dist/hostnames.js.map +0 -1
  666. package/dist/ingress-contract.d.ts.map +0 -1
  667. package/dist/ingress-contract.js.map +0 -1
  668. package/dist/ingress-protocol.d.ts.map +0 -1
  669. package/dist/ingress-protocol.js.map +0 -1
  670. package/dist/listener-protocol.d.ts.map +0 -1
  671. package/dist/listener-protocol.js.map +0 -1
  672. package/dist/mentions.d.ts.map +0 -1
  673. package/dist/mentions.js.map +0 -1
  674. package/dist/model-order.d.ts.map +0 -1
  675. package/dist/model-order.js.map +0 -1
  676. package/dist/model-pins.d.ts.map +0 -1
  677. package/dist/model-pins.js.map +0 -1
  678. package/dist/model-roles.d.ts.map +0 -1
  679. package/dist/model-roles.js.map +0 -1
  680. package/dist/needs-action.d.ts.map +0 -1
  681. package/dist/needs-action.js.map +0 -1
  682. package/dist/output-fields.d.ts.map +0 -1
  683. package/dist/output-fields.js.map +0 -1
  684. package/dist/overlay-lint.d.ts.map +0 -1
  685. package/dist/overlay-lint.js.map +0 -1
  686. package/dist/owner-ticket.d.ts.map +0 -1
  687. package/dist/owner-ticket.js.map +0 -1
  688. package/dist/path-refs.d.ts.map +0 -1
  689. package/dist/path-refs.js.map +0 -1
  690. package/dist/peer-dial.d.ts.map +0 -1
  691. package/dist/peer-dial.js.map +0 -1
  692. package/dist/peer-mcp-server.d.ts.map +0 -1
  693. package/dist/peer-mcp-server.js.map +0 -1
  694. package/dist/plan-pools.d.ts.map +0 -1
  695. package/dist/plan-pools.js.map +0 -1
  696. package/dist/prompt-complexity.d.ts.map +0 -1
  697. package/dist/prompt-complexity.js.map +0 -1
  698. package/dist/provider-specs.d.ts.map +0 -1
  699. package/dist/provider-specs.js.map +0 -1
  700. package/dist/request-id.d.ts.map +0 -1
  701. package/dist/request-id.js.map +0 -1
  702. package/dist/routes.d.ts.map +0 -1
  703. package/dist/routes.js.map +0 -1
  704. package/dist/runner-protocol.d.ts.map +0 -1
  705. package/dist/runner-protocol.js.map +0 -1
  706. package/dist/runtime-state.d.ts.map +0 -1
  707. package/dist/runtime-state.js.map +0 -1
  708. package/dist/safety-policy.d.ts.map +0 -1
  709. package/dist/safety-policy.js.map +0 -1
  710. package/dist/search-globs.d.ts.map +0 -1
  711. package/dist/search-globs.js.map +0 -1
  712. package/dist/session-names.d.ts.map +0 -1
  713. package/dist/session-names.js.map +0 -1
  714. package/dist/share-paths.d.ts.map +0 -1
  715. package/dist/share-paths.js.map +0 -1
  716. package/dist/shell-regions.d.ts.map +0 -1
  717. package/dist/shell-regions.js.map +0 -1
  718. package/dist/sse.d.ts.map +0 -1
  719. package/dist/sse.js.map +0 -1
  720. package/dist/starter.d.ts.map +0 -1
  721. package/dist/starter.js.map +0 -1
  722. package/dist/state-portability.d.ts.map +0 -1
  723. package/dist/state-portability.js.map +0 -1
  724. package/dist/terminal-protocol.d.ts.map +0 -1
  725. package/dist/terminal-protocol.js.map +0 -1
  726. package/dist/title.d.ts.map +0 -1
  727. package/dist/title.js.map +0 -1
  728. package/dist/transcript-fold.d.ts.map +0 -1
  729. package/dist/transcript-fold.js.map +0 -1
  730. package/dist/tunnel-ids.d.ts.map +0 -1
  731. package/dist/tunnel-ids.js.map +0 -1
  732. package/dist/versions.d.ts.map +0 -1
  733. package/dist/versions.js.map +0 -1
  734. package/dist/webext-links.d.ts.map +0 -1
  735. package/dist/webext-links.js.map +0 -1
  736. package/dist/webext-protocol.d.ts.map +0 -1
  737. package/dist/webext-protocol.js.map +0 -1
  738. package/dist/workflow-faults.d.ts.map +0 -1
  739. package/dist/workflow-faults.js.map +0 -1
  740. package/dist/workspace-state.d.ts.map +0 -1
  741. package/dist/workspace-state.js.map +0 -1
  742. package/src/agent-catalog.ts +0 -316
  743. package/src/agent-runtimes.ts +0 -419
  744. package/src/approvals-execution.ts +0 -96
  745. package/src/arrival.ts +0 -160
  746. package/src/batch-runs.ts +0 -188
  747. package/src/capability-ledger.test.ts +0 -140
  748. package/src/capability-secrets.ts +0 -20
  749. package/src/command-classes.ts +0 -617
  750. package/src/command-run.ts +0 -78
  751. package/src/contract-lock.test.ts +0 -23
  752. package/src/contract-lock.ts +0 -66
  753. package/src/conversation-ids.ts +0 -207
  754. package/src/credential-material.ts +0 -181
  755. package/src/definition.ts +0 -207
  756. package/src/documents.ts +0 -67
  757. package/src/embed.ts +0 -164
  758. package/src/events.ts +0 -1870
  759. package/src/fast-tier.ts +0 -72
  760. package/src/history-state.ts +0 -174
  761. package/src/host-protocol.ts +0 -36
  762. package/src/hostnames.ts +0 -180
  763. package/src/ingress-contract.ts +0 -157
  764. package/src/ingress-protocol.ts +0 -625
  765. package/src/listener-protocol.ts +0 -96
  766. package/src/mentions.ts +0 -25
  767. package/src/model-order.ts +0 -262
  768. package/src/model-pins.ts +0 -132
  769. package/src/model-roles.test.ts +0 -52
  770. package/src/model-roles.ts +0 -320
  771. package/src/needs-action.ts +0 -14
  772. package/src/output-fields.ts +0 -111
  773. package/src/overlay-lint.ts +0 -116
  774. package/src/path-refs.ts +0 -59
  775. package/src/peer-dial.ts +0 -163
  776. package/src/plan-pools.ts +0 -92
  777. package/src/prompt-complexity.ts +0 -334
  778. package/src/provider-specs.ts +0 -432
  779. package/src/request-id.ts +0 -41
  780. package/src/routes.ts +0 -219
  781. package/src/runner-protocol.ts +0 -239
  782. package/src/runtime-state.ts +0 -140
  783. package/src/safety-policy.test.ts +0 -88
  784. package/src/safety-policy.ts +0 -258
  785. package/src/search-globs.ts +0 -76
  786. package/src/session-names.ts +0 -44
  787. package/src/share-paths.ts +0 -68
  788. package/src/shell-regions.ts +0 -289
  789. package/src/starter.ts +0 -13
  790. package/src/state-portability.ts +0 -56
  791. package/src/terminal-protocol.ts +0 -16
  792. package/src/title.ts +0 -267
  793. package/src/tunnel-ids.ts +0 -57
  794. package/src/versions.ts +0 -48
  795. package/src/webext-links.ts +0 -90
  796. package/src/webext-protocol.ts +0 -27
  797. package/src/workspace-state.ts +0 -1090
  798. /package/dist/{hostnames.d.ts → ids/hostnames.d.ts} +0 -0
  799. /package/dist/{hostnames.js → ids/hostnames.js} +0 -0
  800. /package/dist/{session-names.d.ts → ids/session-names.d.ts} +0 -0
  801. /package/dist/{session-names.js → ids/session-names.js} +0 -0
  802. /package/dist/{share-paths.d.ts → ids/share-paths.d.ts} +0 -0
  803. /package/dist/{share-paths.js → ids/share-paths.js} +0 -0
  804. /package/dist/{agent-catalog.js → models/agent-catalog.js} +0 -0
  805. /package/dist/{agent-runtimes.d.ts → models/agent-runtimes.d.ts} +0 -0
  806. /package/dist/{agent-runtimes.js → models/agent-runtimes.js} +0 -0
  807. /package/dist/{fast-tier.js → models/fast-tier.js} +0 -0
  808. /package/dist/{model-order.d.ts → models/model-order.d.ts} +0 -0
  809. /package/dist/{model-pins.js → models/model-pins.js} +0 -0
  810. /package/dist/{plan-pools.js → models/plan-pools.js} +0 -0
  811. /package/dist/{prompt-complexity.d.ts → models/prompt-complexity.d.ts} +0 -0
  812. /package/dist/{prompt-complexity.js → models/prompt-complexity.js} +0 -0
  813. /package/dist/{provider-specs.d.ts → models/provider-specs.d.ts} +0 -0
  814. /package/dist/{provider-specs.js → models/provider-specs.js} +0 -0
  815. /package/dist/{approvals-execution.d.ts → policy/approvals-execution.d.ts} +0 -0
  816. /package/dist/{approvals-execution.js → policy/approvals-execution.js} +0 -0
  817. /package/dist/{capability-env.d.ts → policy/capability-env.d.ts} +0 -0
  818. /package/dist/{capability-env.js → policy/capability-env.js} +0 -0
  819. /package/dist/{capability-secrets.d.ts → policy/capability-secrets.d.ts} +0 -0
  820. /package/dist/{capability-secrets.js → policy/capability-secrets.js} +0 -0
  821. /package/dist/{command-run.js → policy/command-run.js} +0 -0
  822. /package/dist/{credential-material.d.ts → policy/credential-material.d.ts} +0 -0
  823. /package/dist/{credential-material.js → policy/credential-material.js} +0 -0
  824. /package/dist/{needs-action.d.ts → policy/needs-action.d.ts} +0 -0
  825. /package/dist/{needs-action.js → policy/needs-action.js} +0 -0
  826. /package/dist/{output-fields.d.ts → policy/output-fields.d.ts} +0 -0
  827. /package/dist/{output-fields.js → policy/output-fields.js} +0 -0
  828. /package/dist/{overlay-lint.d.ts → policy/overlay-lint.d.ts} +0 -0
  829. /package/dist/{overlay-lint.js → policy/overlay-lint.js} +0 -0
  830. /package/dist/{owner-ticket.d.ts → policy/owner-ticket.d.ts} +0 -0
  831. /package/dist/{search-globs.d.ts → policy/search-globs.d.ts} +0 -0
  832. /package/dist/{search-globs.js → policy/search-globs.js} +0 -0
  833. /package/dist/{ingress-contract.d.ts → protocol/ingress-contract.d.ts} +0 -0
  834. /package/dist/{ingress-protocol.d.ts → protocol/ingress-protocol.d.ts} +0 -0
  835. /package/dist/{ingress-protocol.js → protocol/ingress-protocol.js} +0 -0
  836. /package/dist/{listener-protocol.d.ts → protocol/listener-protocol.d.ts} +0 -0
  837. /package/dist/{peer-mcp-server.d.ts → protocol/peer-mcp-server.d.ts} +0 -0
  838. /package/dist/{peer-mcp-server.js → protocol/peer-mcp-server.js} +0 -0
  839. /package/dist/{request-id.d.ts → protocol/request-id.d.ts} +0 -0
  840. /package/dist/{request-id.js → protocol/request-id.js} +0 -0
  841. /package/dist/{routes.d.ts → protocol/routes.d.ts} +0 -0
  842. /package/dist/{routes.js → protocol/routes.js} +0 -0
  843. /package/dist/{sse.d.ts → protocol/sse.d.ts} +0 -0
  844. /package/dist/{sse.js → protocol/sse.js} +0 -0
  845. /package/dist/{terminal-protocol.js → protocol/terminal-protocol.js} +0 -0
  846. /package/dist/{webext-links.d.ts → protocol/webext-links.d.ts} +0 -0
  847. /package/dist/{webext-links.js → protocol/webext-links.js} +0 -0
  848. /package/dist/{arrival.d.ts → state/arrival.d.ts} +0 -0
  849. /package/dist/{contract-lock.d.ts → state/contract-lock.d.ts} +0 -0
  850. /package/dist/{history-state.d.ts → state/history-state.d.ts} +0 -0
  851. /package/dist/{runtime-state.d.ts → state/runtime-state.d.ts} +0 -0
  852. /package/dist/{runtime-state.js → state/runtime-state.js} +0 -0
  853. /package/dist/{starter.d.ts → state/starter.d.ts} +0 -0
  854. /package/dist/{starter.js → state/starter.js} +0 -0
  855. /package/dist/{state-portability.d.ts → state/state-portability.d.ts} +0 -0
  856. /package/dist/{state-portability.js → state/state-portability.js} +0 -0
  857. /package/dist/{versions.d.ts → state/versions.d.ts} +0 -0
  858. /package/dist/{versions.js → state/versions.js} +0 -0
  859. /package/dist/{embed.d.ts → text/embed.d.ts} +0 -0
  860. /package/dist/{embed.js → text/embed.js} +0 -0
  861. /package/dist/{mentions.d.ts → text/mentions.d.ts} +0 -0
  862. /package/dist/{mentions.js → text/mentions.js} +0 -0
  863. /package/dist/{path-refs.d.ts → text/path-refs.d.ts} +0 -0
  864. /package/dist/{path-refs.js → text/path-refs.js} +0 -0
  865. /package/dist/{shell-regions.js → text/shell-regions.js} +0 -0
  866. /package/dist/{title.d.ts → text/title.d.ts} +0 -0
  867. /package/dist/{title.js → text/title.js} +0 -0
  868. /package/src/{hostnames.test.ts → ids/hostnames.test.ts} +0 -0
  869. /package/src/{share-paths.test.ts → ids/share-paths.test.ts} +0 -0
  870. /package/src/{capability-env.ts → policy/capability-env.ts} +0 -0
  871. /package/src/{overlay-lint.test.ts → policy/overlay-lint.test.ts} +0 -0
  872. /package/src/{search-globs.test.ts → policy/search-globs.test.ts} +0 -0
  873. /package/src/{ingress-contract.test.ts → protocol/ingress-contract.test.ts} +0 -0
  874. /package/src/{peer-mcp-server.test.ts → protocol/peer-mcp-server.test.ts} +0 -0
  875. /package/src/{sse.ts → protocol/sse.ts} +0 -0
  876. /package/src/{versions.test.ts → state/versions.test.ts} +0 -0
  877. /package/src/{embed.test.ts → text/embed.test.ts} +0 -0
  878. /package/src/{mentions.test.ts → text/mentions.test.ts} +0 -0
  879. /package/src/{path-refs.test.ts → text/path-refs.test.ts} +0 -0
@@ -1,46 +1,10 @@
1
- import type { ChoreLedgerEntry, ChoresReport, ProbeId, ProbeResult } from "../schemas/maintenance.js";
1
+ import type { ChoreLedgerEntry, ChoreOutcome, ChoresReport, ProbeId, ProbeResult } from "../schemas/maintenance.js";
2
2
  import { type Chore, type ChoreContext, type ChoreFinding, CHORES, chorePrompt } from "./chores.js";
3
3
  import { probeSpec } from "./probes.js";
4
4
 
5
- /* FROM EVIDENCE TO A VERDICT, the one place that decides whether a chore is due, and the only place that is
6
- * allowed to. Both the Maintenance panel and its rail badge run this function over the same report, so the number
7
- * on the tile and the reason in the panel are the same computation and cannot drift apart.
8
- *
9
- * Six states, and the distinctions between them are the whole design:
10
- *
11
- * not-applicable this chore is not a QUESTION worth asking of this repository, there is no Dockerfile to
12
- * slim, no pipeline to tighten, no documentation to re-read. Dropped from the panel entirely
13
- * rather than shown as clear, because "clear" claims we checked, and there was nothing to check.
14
- * The reason survives in the panel's scope note, so "why is there no Docker chore here?" has an answer.
15
- * unavailable we have not measured this. knip is not a devDependency; there is no lockfile to audit. Rendered
16
- * greyed, never badged, and never collapsed into `clear`, a maintenance surface reporting a green
17
- * repository it has never actually measured is worse than one that says nothing.
18
- * clear we measured, and there is nothing to do. This is the common state, and it has to be visibly
19
- * reachable or the panel is just a list of complaints.
20
- * snoozed the owner said "not now". Still listed, still showing its evidence, silent until it lapses.
21
- * stale we measured, then work landed, and we have not measured since. The evidence is still shown; the
22
- * CLAIM comes off it, because it describes a tree that no longer exists.
23
- * due there is something to do.
24
- *
25
- * The first three are all ways of saying "no", and keeping them apart is what makes the surface trustworthy: they
26
- * mean we cannot ask, we did not measure, and we measured and found nothing, three different claims, and only
27
- * the last one is reassurance.
28
- *
29
- * And one flag that is not a state: `settled`. A due chore that has been RE-MEASURED since a turn was spent on
30
- * it, and whose evidence did not move, stays due, because it is, but must never light the rail again. This is
31
- * what stops the surface repeating itself while a fix sits in review, and it is why the ledger stores a digest
32
- * rather than a timestamp: "ran 3 days ago" cannot tell you whether it ran against THIS.
33
- *
34
- * `stale` is the other half of that sentence, and it exists because the digest alone cannot tell the two apart.
35
- * A probe that never re-ran produces an unchanged digest for free, so "the fix did not move the numbers" and "we
36
- * have not looked since the fix" arrived at this function looking identical, and the panel showed the second as
37
- * the first, quoting a week-old count an hour after the work that invalidated it. Comparing the run's time to the
38
- * MEASUREMENT's time is what separates them, and it is a comparison of two numbers the report already carries.
39
- *
40
- * Nothing here can hide a problem. Snoozing and settling change whether the rail SPEAKS; the panel still shows
41
- * the chore, its evidence and its state. The one thing that removes a row entirely is `not-applicable`, and that
42
- * is not hiding, it is the absence of a subject, counted in the panel's scope note and expandable to the reason.
43
- * A maintenance surface you can quietly bury findings in is a maintenance surface nobody trusts. */
5
+ // The one function deciding whether a chore is due, run by both the panel and its badge over the same report so
6
+ // neither can drift from the other. Six states (not-applicable, unavailable and clear are different ways of saying no);
7
+ // `settled` is a due chore re-measured with no change, still due but never re-badged.
44
8
 
45
9
  export type ChoreState = "due" | "clear" | "snoozed" | "stale" | "unavailable" | "not-applicable";
46
10
 
@@ -49,27 +13,23 @@ export interface ChoreVerdict {
49
13
  readonly repo: string;
50
14
  readonly state: ChoreState;
51
15
  readonly severity: ChoreFinding["severity"];
52
- // Always present, in every state, "nothing to do" and "not measured" are answers a reader deserves in words.
16
+ // Always present in every state; "nothing to do" and "not measured" are answers a reader deserves in words.
53
17
  readonly headline: string;
54
18
  readonly detail: readonly string[];
55
19
  // The evidence identity. Empty for `unavailable`, where there is no evidence to identify.
56
20
  readonly digest: string;
57
- /* WHEN THE EVIDENCE WAS TAKEN, the fact every row shows beside its numbers, and the one whose absence let a
58
- * measurement from last Tuesday read as this morning's. Undefined when the verdict rests on no measurement at
59
- * all: a survey is decided by the calendar, and an unavailable chore has nothing to be out of date. */
21
+ // When the evidence was taken; undefined when the verdict rests on no measurement (a survey, or unavailable).
60
22
  readonly measuredAt: number | undefined;
61
- // The turn. Present only when there is something to do, a "start an agent" button on a clear chore is an
62
- // invitation to spend money proving that nothing is wrong.
23
+ // Present only when there is something to do; offering it on a clear chore would invite proving nothing's wrong.
63
24
  readonly prompt: string | undefined;
64
25
  readonly lastRun: ChoreLedgerEntry | undefined;
65
- // A turn has been spent on this chore, the evidence has been re-measured since and did not move, and the
66
- // chore's cadence has not lapsed. Still due, still shown, never badged.
26
+ // A turn was spent, the evidence was re-measured since and didn't move, and the cadence hasn't lapsed: still due,
27
+ // still shown, never badged.
67
28
  readonly settled: boolean;
68
29
  }
69
30
 
70
- /* HOW OLD THE EVIDENCE IS: the OLDEST of the measurements a verdict rests on, because a claim is only as current
71
- * as the least current thing it was computed from. Undefined when it rests on none, a survey has no measurement,
72
- * and an unavailable chore's probe did not produce one. */
31
+ // How old the evidence is: the oldest of the measurements a verdict rests on, since a claim is only as current
32
+ // as the least current input. Undefined when it rests on none (a survey, or an unavailable probe).
73
33
  const measurementAge = (needs: readonly ProbeId[], probes: ReadonlyMap<ProbeId, ProbeResult>): number | undefined => {
74
34
  const taken = needs.flatMap((id) => {
75
35
  const probe = probes.get(id);
@@ -78,14 +38,13 @@ const measurementAge = (needs: readonly ProbeId[], probes: ReadonlyMap<ProbeId,
78
38
  return taken.length === 0 ? undefined : Math.min(...taken);
79
39
  };
80
40
 
81
- // A survey that is clear is clear because it was READ recently, and saying so is the only way its row means
82
- // anything, "nothing to do" under a chore that has no measurement would be a claim about the code rather than
83
- // about the calendar.
41
+ // A clear survey says when it was last read, since "nothing to do" under a chore with no measurement would be a
42
+ // claim about the code rather than the calendar.
84
43
  const clearHeadline = (chore: Chore, lastRun: ChoreLedgerEntry | undefined, nowMs: number): string =>
85
44
  chore.survey === true && lastRun !== undefined ? `Surveyed ${Math.round((nowMs - lastRun.ranAt) / 86_400_000)} days ago` : `Nothing to do`;
86
45
 
87
- // Why a chore could not be assessed, in the words of the thing that could not do it. Never invented: an
88
- // `unavailable` probe carries the tool's own reason, and a probe that has simply not run yet says that.
46
+ // Why a chore couldn't be assessed, in the words of the thing that couldn't: never invented, an `unavailable`
47
+ // probe carries the tool's own reason, an unrun one says it hasn't run yet.
89
48
  const unmeasuredDetail = (needs: readonly ProbeId[], probes: ReadonlyMap<ProbeId, ProbeResult>): string[] =>
90
49
  needs.flatMap((id) => {
91
50
  const probe = probes.get(id);
@@ -96,9 +55,7 @@ const unmeasuredDetail = (needs: readonly ProbeId[], probes: ReadonlyMap<ProbeId
96
55
  if (probe.state === `ok`) {
97
56
  return [];
98
57
  }
99
- // An unavailable probe's reason already says what is missing ("no lockfile"), so prefixing it with "not
100
- // available in this repository" only says the same thing twice. A failure has to keep its label: its
101
- // reason is the tool's own output, which on its own reads as a fact rather than as a breakage.
58
+ // An unavailable probe's reason already says what's missing; prefixing it would just say the same thing twice.
102
59
  if (probe.state === `unavailable`) {
103
60
  return [`${spec.title} · ${probe.reason ?? `not available in this repository`}`];
104
61
  }
@@ -108,10 +65,8 @@ const unmeasuredDetail = (needs: readonly ProbeId[], probes: ReadonlyMap<ProbeId
108
65
  export const assessChore = (chore: Chore, context: ChoreContext, ledger: ChoreLedgerEntry | undefined): ChoreVerdict => {
109
66
  const base = { chore, repo: context.repo, lastRun: ledger, settled: false, prompt: undefined } as const;
110
67
 
111
- /* APPLICABILITY FIRST, before anything is measured or any evidence is read. A chore that does not apply is
112
- * not "clear" and not "unmeasured", the question does not arise here, and every subsequent branch of this
113
- * function would be answering it anyway. The cause is carried as the headline, because the scope note, which
114
- * groups these rows BY it, is the only place it will ever be read. */
68
+ // Decided before anything is measured; the cause is carried as the headline since the scope note is the only place
69
+ // it is read.
115
70
  const inapplicable = chore.applies?.(context.signals);
116
71
  if (inapplicable !== undefined) {
117
72
  return { ...base, state: `not-applicable`, severity: `info`, headline: inapplicable, detail: [], digest: ``, measuredAt: undefined };
@@ -138,17 +93,11 @@ export const assessChore = (chore: Chore, context: ChoreContext, ledger: ChoreLe
138
93
  };
139
94
  }
140
95
 
141
- /* Has the last run's settlement lapsed? A cadence of 0 means "this is decided by evidence alone", an advisory
142
- * does not become worth looking at again because ninety days passed, it becomes worth looking at again when
143
- * the advisory set changes. Anything with a cadence expires its own settlement, so "we looked and chose not to
144
- * act" cannot silence a chore for good. */
96
+ // A cadence of 0 is decided by evidence alone; any other cadence expires its own settlement over time.
145
97
  const lapsed = ledger !== undefined && chore.cadenceMs > 0 && context.nowMs - ledger.ranAt >= chore.cadenceMs;
146
98
  const sameEvidence = ledger?.digest === finding.digest && !lapsed;
147
99
 
148
- /* A SURVEY has no measurement, so the calendar is the whole trigger: it is due because it has been that long,
149
- * and a run inside the current period settles it until the next one begins. Checked against the run's TIME
150
- * rather than its digest, because a survey run three days into a quarter and one three days before its end
151
- * are the same period but very different answers to "when was this last read?". */
100
+ // A survey's only trigger is the calendar, checked against the run's time rather than its digest.
152
101
  if (chore.survey === true && ledger !== undefined && context.nowMs - ledger.ranAt < chore.cadenceMs) {
153
102
  return {
154
103
  ...base,
@@ -176,10 +125,8 @@ export const assessChore = (chore: Chore, context: ChoreContext, ledger: ChoreLe
176
125
  };
177
126
  }
178
127
 
179
- /* The agent looked at exactly this evidence and reported that there was nothing in it, knip's findings were
180
- * all public entry points, the clones were all generated files. That verdict has to stick, or the next poll
181
- * starts the same turn again and the surface has taught the owner that its rows are wrong. It stops sticking
182
- * when the evidence changes (a different digest) or the cadence lapses. */
128
+ // The agent looked at exactly this evidence and found nothing there; that verdict sticks until the evidence changes
129
+ // or the cadence lapses.
183
130
  if (sameEvidence && ledger?.outcome === `clean`) {
184
131
  return {
185
132
  ...base,
@@ -192,13 +139,8 @@ export const assessChore = (chore: Chore, context: ChoreContext, ledger: ChoreLe
192
139
  };
193
140
  }
194
141
 
195
- /* THE MEASUREMENT IS OLDER THAN THE WORK. A turn landed after the last time we looked, so the evidence below
196
- * describes a tree that no longer exists, an hour after a run deleted the dead code, the row was still
197
- * quoting the count from six days before it. `sameEvidence` cannot catch this: an unchanged digest is exactly
198
- * what a probe that never re-ran produces, so the flag says "settled" at its most confident when it knows
199
- * least. The chore steps down instead, evidence stays on the row, the CLAIM comes off it, and carries no
200
- * prompt, because the honest next move is to measure again rather than to spend a second turn on a finding
201
- * nobody has re-checked. It cannot badge either, which is what stops the tile lighting for work already done. */
142
+ // The measurement predates the last run: an unchanged digest is what a stale probe produces too, so the claim and
143
+ // prompt come off, not the evidence.
202
144
  if (ledger !== undefined && measuredAt !== undefined && ledger.ranAt > measuredAt) {
203
145
  return { ...base, state: `stale`, severity: `info`, headline: finding.headline, detail: finding.detail, digest: finding.digest, measuredAt };
204
146
  }
@@ -216,13 +158,35 @@ export const assessChore = (chore: Chore, context: ChoreContext, ledger: ChoreLe
216
158
  };
217
159
  };
218
160
 
219
- // The ledger is keyed by repo + chore, which is the grain a verdict is decided at: the same chore in two repos is
220
- // two independent questions with two independent answers.
161
+ // Has anyone already answered this, and does the answer still stand; the digest is what makes this an answer
162
+ // rather than a timestamp, since a run against evidence that has since changed answered a different question.
163
+ export interface ChoreAnswer {
164
+ readonly outcome: ChoreOutcome;
165
+ readonly ranAt: number;
166
+ }
167
+
168
+ // What was concluded about this evidence, whenever that was: history, not standing. A lapsed chore still shows
169
+ // its old answer, since that is a fact worth having before spending a second turn.
170
+ export const choreAnswer = (verdict: ChoreVerdict): ChoreAnswer | undefined => {
171
+ const { lastRun, digest } = verdict;
172
+ // An empty digest identifies no evidence, so nothing can have been concluded about it (unavailable, not-applicable,
173
+ // plain clear).
174
+ if (lastRun === undefined || digest === `` || lastRun.digest !== digest) {
175
+ return undefined;
176
+ }
177
+ return { outcome: lastRun.outcome, ranAt: lastRun.ranAt };
178
+ };
179
+
180
+ // Whether there is anything left to start: `settled` or `stale`, not gated on `choreAnswer`, since a stale row
181
+ // has nothing to press either way. A lapsed chore returns to full weight; expiry asks again.
182
+ export const choreAnswered = (verdict: ChoreVerdict): boolean => verdict.settled || verdict.state === `stale`;
183
+
184
+ // The ledger is keyed by repo + chore, the grain a verdict is decided at: the same chore in two repos is two
185
+ // independent answers.
221
186
  export const ledgerKey = (repo: string, chore: string): string => `${repo}|${chore}`;
222
187
 
223
- /* Every chore in every repo, from one report. This is what both surfaces call, the panel groups the result, the
224
- * badge filters it, so there is exactly one traversal of the book in the codebase and adding a chore to CHORES
225
- * reaches both surfaces without touching either. */
188
+ // Every chore in every repo, from one report; the single traversal both the panel and the badge call, so adding
189
+ // a chore to CHORES reaches both without touching either.
226
190
  export const assessReport = (report: ChoresReport, nowMs: number): ChoreVerdict[] => {
227
191
  const ledger = new Map(report.ledger.map((entry) => [ledgerKey(entry.repo, entry.chore), entry]));
228
192
  return report.repos.flatMap(({ repo, probes, signals }) => {
@@ -231,17 +195,8 @@ export const assessReport = (report: ChoresReport, nowMs: number): ChoreVerdict[
231
195
  });
232
196
  };
233
197
 
234
- /* WHAT THE RAIL IS ALLOWED TO SAY. A badge must mean "something happened here that you don't already know about",
235
- * never "here is a statistic", the extension API states that bar and this is the function that holds this
236
- * surface to it. Three filters, and every one of them removes a case that would otherwise light the tile forever:
237
- *
238
- * state === due the obvious one, and it is also what keeps `stale` silent, since a measurement taken before
239
- * the last turn is not a fact anyone should be interrupted about.
240
- * !settled a turn has been spent on this chore and the re-measured evidence did not move.
241
- * unseen digest the owner has already LOOKED at this evidence in the panel. Acknowledgement is per digest
242
- * rather than per chore, so acknowledging today's finding does not also swallow tomorrow's.
243
- *
244
- * `seen` maps ledgerKey → the digest last acknowledged. It lives in a file beside the ledger, because the badge is
245
- * derived from files and its acknowledgement belongs in the same tree. */
198
+ // What the rail may say: something happened you don't already know about, never a statistic. Filters out:
199
+ // - not due, or settled (a turn already re-measured this with no change)
200
+ // - already acknowledged at this exact digest in the panel
246
201
  export const unseenVerdicts = (verdicts: readonly ChoreVerdict[], seen: Readonly<Record<string, string>>): ChoreVerdict[] =>
247
202
  verdicts.filter((verdict) => verdict.state === `due` && !verdict.settled && seen[ledgerKey(verdict.repo, verdict.chore.id)] !== verdict.digest);
@@ -14,23 +14,9 @@ import {
14
14
  } from "../schemas/provider-oauth.js";
15
15
  import { OkSchema } from "../schemas/shared.js";
16
16
 
17
- /* THE ACCOUNTS THIS SANDBOX HOLDS ITSELF, one route family with the provider as a PARAMETER.
18
- *
19
- * Four families used to serve this (Claude's, Cursor's, Grok's, and one for every provider whose sign-in mints
20
- * its own key), each "the previous one's shape" with a verb renamed: `oauth/start` here, `login/start` there,
21
- * an `exchange` for the flow whose proof travelled and a `complete` for the one whose proof did not. The
22
- * lesson providers.contract.ts learned about model catalogs holds for accounts too: the operations are the
23
- * same six for all of them, so the id is a parameter and a provider's own mechanism is its module's to declare
24
- * (the daemon's ProviderModule.accounts), not a vertical slice through the contract, the router and every test
25
- * double.
26
- *
27
- * WHY NOT THE TRANSLATOR ROUTES. Those address subscriptions CLIProxyAPI holds and re-serves behind an Anthropic
28
- * endpoint; these credentials live in this daemon's own auth tree (or, for Grok, in OpenCode's), and a
29
- * disconnect here removes a file rather than asking a proxy to forget one. A provider served both ways (Grok)
30
- * has a row in each.
31
- *
32
- * Nothing redeemable is on any answer here: `accounts` is an OauthAccount list, whose shape has no field a
33
- * credential could ride in, and a sign-in's proof never leaves the sandbox (provider-oauth.ts, LoginStart). */
17
+ // One route family for the accounts this sandbox holds itself, with the provider as a parameter rather than a vertical
18
+ // slice per provider. Distinct from the translator routes (subscriptions proxied through CLIProxyAPI): these
19
+ // credentials live in this daemon's own auth tree, and no credential ever rides in an answer.
34
20
  export const accountsContract = {
35
21
  start: oc
36
22
  .route({
@@ -61,8 +47,7 @@ export const accountsContract = {
61
47
  })
62
48
  .input(NativeProviderParamSchema.extend(LoginCancelSchema.shape))
63
49
  .output(OkSchema),
64
- // Each account carries its plan-limit reading where the provider publishes one. `force` re-measures before
65
- // answering (AccountListQuerySchema); a provider with nothing to measure accepts it and answers at once.
50
+ // `force` re-measures before answering; a provider with nothing to measure accepts it and answers at once.
66
51
  accounts: oc
67
52
  .route({
68
53
  method: "GET",
@@ -1,15 +1,14 @@
1
1
  import { eventIterator, oc } from "@orpc/contract";
2
- import { AgentCommandsQuerySchema, AgentCommandsSchema, AttachFrameSchema } from "../events.js";
2
+ import { AgentCommandsQuerySchema, AgentCommandsSchema } from "../events/cards.js";
3
+ import { AttachFrameSchema } from "../events/agent-events.js";
3
4
  import { AgentTurnSchema, AttachTurnSchema, StartedTurnSchema } from "../schemas/agent.js";
4
5
  import { RewindResultSchema, RewindTurnSchema } from "../schemas/history.js";
5
6
  import { AgentReplySchema, ProviderRefusalsSchema, ResumeTurnSchema, SteerSchema, StopTurnSchema } from "../schemas/plan-limits.js";
6
7
  import { OkSchema } from "../schemas/shared.js";
7
8
 
8
- // A turn EXECUTES as a detached daemon-side run: `run` starts it and acks with the run id; any number of
9
- // clients render it via `attach` (replay from a seq cursor, then live), the initiating window holds no
10
- // special stream, so a reload, a second window, or another device attaches identically. `reply` un-parks a
11
- // turn waiting on any interactive card (plan approval, clarifying questions, a per-tool permission prompt);
12
- // steer injects a user message into the running turn; stop hard-cancels it daemon-side.
9
+ // A turn executes as a detached daemon-side run. `run` starts it, `attach` streams it to any number of clients
10
+ // (replay then live, no special stream for the initiator), `reply` un-parks it, `steer` injects a message, `stop`
11
+ // hard-cancels it.
13
12
  export const agentContract = {
14
13
  run: oc
15
14
  .route({
@@ -60,14 +59,7 @@ export const agentContract = {
60
59
  })
61
60
  .input(StopTurnSchema)
62
61
  .output(OkSchema),
63
- /* Run the conversation's HELD turn again: the one a spent allowance refused, which the daemon kept whole.
64
- * NOT_FOUND when it holds none (nothing was stranded, another turn has since superseded it, or the daemon
65
- * restarted), which is what tells a client to fall back to saying something itself.
66
- *
67
- * Separate from `run` because it is a different act. `run` says something new; this repeats something already
68
- * said, and the difference has to survive onto the wire or it cannot survive into the transcript: a repeat
69
- * sent as a new turn is a new user message, and four presses against one spent allowance then read back, to
70
- * the model as much as to the reader, as four things the user said and nobody answered. */
62
+ // NOT_FOUND when nothing is held (superseded, or the daemon restarted): the client should fall back to `run`.
71
63
  resume: oc
72
64
  .route({
73
65
  method: "POST",
@@ -78,9 +70,7 @@ export const agentContract = {
78
70
  })
79
71
  .input(ResumeTurnSchema)
80
72
  .output(StartedTurnSchema),
81
- // Go back to a message: restore the workspace to that turn's checkpoint, drop the messages after it, and
82
- // forget the provider session. CONFLICT while a turn is running, a restore cannot overwrite files an
83
- // agent is editing. NOT_FOUND when that message has no checkpoint to go back to.
73
+ // CONFLICT while a turn is running; NOT_FOUND when the message has no checkpoint.
84
74
  rewind: oc
85
75
  .route({
86
76
  method: "POST",
@@ -91,8 +81,6 @@ export const agentContract = {
91
81
  })
92
82
  .input(RewindTurnSchema)
93
83
  .output(RewindResultSchema),
94
- // The provider's slash commands as last published by one of its turns, so a conversation's `/` popover is
95
- // populated before it has run one. The live `commands` frame stays authoritative for a running turn.
96
84
  commands: oc
97
85
  .route({
98
86
  method: "GET",
@@ -103,9 +91,6 @@ export const agentContract = {
103
91
  })
104
92
  .input(AgentCommandsQuerySchema)
105
93
  .output(AgentCommandsSchema),
106
- // The last refusal per provider, as reported by whichever turn was refused (ProviderRefusalSchema). Read
107
- // alongside the account listings by the surfaces that draw plan limits: the snapshot on an account row says
108
- // how full its pools were when last polled, and this says whether one of them has since said no.
109
94
  refusals: oc
110
95
  .route({
111
96
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract";
2
- import { AgentTranscriptSchema } from "../events.js";
2
+ import { AgentTranscriptSchema } from "../events/transcript.js";
3
3
  import {
4
4
  AgentArchiveSchema,
5
5
  AgentAutoLandSchema,
@@ -11,6 +11,7 @@ import {
11
11
  AgentPlaceSchema,
12
12
  AgentRenameSchema,
13
13
  AgentResumeAfterLimitSchema,
14
+ AgentMoveAfterLimitSchema,
14
15
  AgentResumeAfterOutageSchema,
15
16
  AgentsArchivedSchema,
16
17
  AgentSearchQuerySchema,
@@ -25,30 +26,9 @@ import { AgentChangesSchema, AgentHistorySchema } from "../schemas/git.js";
25
26
  import { FileDiffSchema } from "../schemas/history.js";
26
27
  import { OkSchema } from "../schemas/shared.js";
27
28
 
28
- // The fleet: every registered conversation-agent (see AgentSummarySchema). Registry-level actions (read,
29
- // rename, seen, archive) apply uniformly. For branch-backed conversations, `diff` is the worktree's CUMULATIVE
30
- // multi-repo delta vs its recorded per-repo bases, one flat change set per repo
31
- // (AgentChanges), each file flagged `landed` or not, deliberately not the working tree's staged/unstaged
32
- // shape: a worktree the user never checks out has no index they could stage into. `land` merges the worktree
33
- // branches into the main tree (per-repo, conflicts reported, nothing lost on failure); `discard` removes
34
- // worktrees + branches + registry entry. Those branch actions reject workspace conversations explicitly. An
35
- // unknown {id} is NOT_FOUND; land/discard while the turn runs is CONFLICT.
36
- // `rename` sets the user-chosen display title, legal mid-turn (it touches no worktree state).
37
- // `seen`/`seenAll` stamp the read marker behind the cards' unread badge (AgentSummarySchema.seenAt), also
38
- // legal mid-turn, and like `rename` they never bump `updatedAt` (reading is not activity).
39
- //
40
- // ARCHIVE is the non-destructive counterpart to discard, and the one the board leans on: for an isolated
41
- // conversation, `archive` commits whatever the worktree still holds onto agent/<id> and drops the CHECKOUT;
42
- // for a workspace conversation it has no git teardown. Both keep the entry and transcript. `list` stops carrying it and
43
- // `archived` does; `unarchive` puts it back, and either way the next turn re-attaches a worktree from the
44
- // surviving branch. Archiving a running agent is CONFLICT, same as land/discard.
45
- //
46
- // PURGE empties the archive, and it is `discard` applied to every agent already in there: worktree remnants,
47
- // branches and entries all go. Deliberately the whole archive and not a list of ids, the archive is the pile
48
- // of agents the user has already decided are over, so "clean it up" is one act with one confirmation, and a
49
- // per-id purge would be `discard`, which already exists. Never touches a running agent (a turn un-archives its
50
- // own agent, so there should be none) and answers with what it actually deleted: a teardown that fails on one
51
- // agent's repo leaves that one behind rather than taking the batch down with it.
29
+ // Every registered conversation-agent (AgentSummarySchema); an unknown {id} is NOT_FOUND across this whole family.
30
+ // `archive` is the non-destructive counterpart to `discard` (worktree committed, entry kept); `purge` is `discard`
31
+ // applied to every already-archived agent.
52
32
  export const agentsContract = {
53
33
  list: oc
54
34
  .route({
@@ -68,10 +48,7 @@ export const agentsContract = {
68
48
  "The same shape as the live fleet, for the conversations somebody has decided are finished. Their work is kept, and any one of them can be brought back.",
69
49
  })
70
50
  .output(AgentsListSchema),
71
- // The board's filter. Answers over BOTH halves of the fleet, the live roster and the archive, because
72
- // the board hides by design (the Finished lane windows to a handful, archived agents are off the roster
73
- // entirely), and a filter that reports "no matches" while the agent sits one click away is a lie. The
74
- // never-carded conversations that are neither are `sessions.list`'s query, which matches by the same rule.
51
+ // Never-carded conversations (neither live nor archived) are `sessions.list`'s query, matching by the same rule.
75
52
  search: oc
76
53
  .route({
77
54
  method: "GET",
@@ -101,12 +78,8 @@ export const agentsContract = {
101
78
  })
102
79
  .input(AgentTranscriptQuerySchema)
103
80
  .output(AgentTranscriptSchema),
104
- /* SPEAK AS THE AGENT, append the user's words to the conversation's record as an assistant row, with no
105
- * turn behind them and no reply. The row is marked `placed` for human readers (TranscriptRowSchema); the
106
- * provider session is FORGOTTEN in the same breath, rewind-style, so the next real turn opens a fresh
107
- * runtime session seeded from the record, where the placed line reads as the agent's own words, because
108
- * the handoff renders every assistant row identically. A running turn is CONFLICT: the illusion can only be
109
- * established between turns, and a concurrent turn would resume the very session this exists to retire. */
81
+ // Also forgets the provider session, rewind-style, so the next fresh session reads the placed line as the agent's
82
+ // own.
110
83
  place: oc
111
84
  .route({
112
85
  method: "POST",
@@ -127,9 +100,6 @@ export const agentsContract = {
127
100
  })
128
101
  .input(AgentRenameSchema)
129
102
  .output(AgentSummarySchema),
130
- // This agent's own land-at-completion posture, an override of the sandbox-wide `autoLand` setting; null
131
- // clears it back to "inherit". Legal mid-turn on purpose: the setting is read at turn COMPLETION, so
132
- // flipping it while the agent works is exactly "hold THIS turn's work for review", the press that matters.
133
103
  autoLand: oc
134
104
  .route({
135
105
  method: "POST",
@@ -140,13 +110,7 @@ export const agentsContract = {
140
110
  })
141
111
  .input(AgentAutoLandSchema)
142
112
  .output(AgentSummarySchema),
143
- /* THIS conversation's answer to a provider outage, an override of the sandbox-wide `resumeAfterOutage`
144
- * setting; null clears it back to "inherit". The chat's offer at the moment a turn dies writes this and
145
- * never the global: the press happens inside one conversation and means "finish this piece of work", so
146
- * its honest scope is that conversation. Sandbox > Agent owns the default for everything else.
147
- *
148
- * Legal mid-turn, and unlike autoLand it is legal for a WORKSPACE conversation too, an outage kills a
149
- * main-tree chat exactly as readily as an isolated one, and there is no branch involved either way. */
113
+ // Legal for a workspace conversation too (unlike autoLand): an outage kills a main-tree chat just as readily.
150
114
  resumeAfterOutage: oc
151
115
  .route({
152
116
  method: "POST",
@@ -157,13 +121,7 @@ export const agentsContract = {
157
121
  })
158
122
  .input(AgentResumeAfterOutageSchema)
159
123
  .output(AgentSummarySchema),
160
- /* THIS conversation's answer to a spent allowance, the same override in the same shape as the outage one
161
- * above; null clears it back to "inherit". Offered on the CARD as well as in the chat, which is the one
162
- * placement difference worth stating: an outage is over in minutes and is met by whoever is in the room,
163
- * while a limit reopens hours later, so the person deciding is usually looking at a board rather than at a
164
- * transcript.
165
- *
166
- * Legal mid-turn, and for a workspace conversation, for the same two reasons its neighbour is. */
124
+ // Also offered on the card, not just chat: a limit reopens hours later, so the decider is usually at a board.
167
125
  resumeAfterLimit: oc
168
126
  .route({
169
127
  method: "POST",
@@ -174,6 +132,17 @@ export const agentsContract = {
174
132
  })
175
133
  .input(AgentResumeAfterLimitSchema)
176
134
  .output(AgentSummarySchema),
135
+ // Moves the held turn the moment the refusal lands, not on the next attempt.
136
+ moveAfterLimit: oc
137
+ .route({
138
+ method: "POST",
139
+ path: "/agents/{id}/move-after-limit",
140
+ summary: "Whether this conversation moves to another account when its allowance is spent",
141
+ description:
142
+ "Overrides the sandbox-wide setting for one conversation; clear it to follow the default again. A move spends a second account of the same provider on this conversation's behalf, so it is off unless asked for.",
143
+ })
144
+ .input(AgentMoveAfterLimitSchema)
145
+ .output(AgentSummarySchema),
177
146
  seen: oc
178
147
  .route({
179
148
  method: "POST",
@@ -184,17 +153,7 @@ export const agentsContract = {
184
153
  })
185
154
  .input(AgentIdSchema)
186
155
  .output(AgentSummarySchema),
187
- /* DISARM EVERY CONDITION WATCH THIS CONVERSATION IS PARKED ON (AgentSummary.watches), the way off the one
188
- * standing arrangement an agent can enter into on the user's behalf without being asked again.
189
- *
190
- * ALL OF THEM, NOT ONE. The id of an individual watch is on the card, but the press a person makes about a
191
- * card means "stop this conversation waking itself up", and picking watches off a submenu one at a time is a
192
- * chore invented by the data shape rather than wanted by anybody. A conversation that should go on watching
193
- * one thing and not another can be told so in the chat, which is where the watches were armed.
194
- *
195
- * No wake fires for what this disarms, which is the whole point: a watch left armed keeps a hosted machine
196
- * awake and eventually starts a turn nobody is expecting. Nothing else about the conversation moves, so the
197
- * card it hands back differs only by having lost its watches. */
156
+ // A finer-grained ask (watch this, not that) goes through the chat, not a per-watch id here.
198
157
  stopWatching: oc
199
158
  .route({
200
159
  method: "POST",
@@ -223,11 +182,8 @@ export const agentsContract = {
223
182
  })
224
183
  .input(AgentIdSchema)
225
184
  .output(AgentChangesSchema),
226
- // The other side of `diff`: the work that is no longer a difference because it is in your own history, and
227
- // the commits holding it. Asked for only once `diff` reports something absorbed, since it costs a `git log`
228
- // per repo and answers nothing until then. Reading one of these files is the SAME call as reading a
229
- // reviewable one (`fileDiff` below): the question "what did this conversation do to this file" has one
230
- // answer whether or not you have since committed it.
185
+ // Costs a `git log` per repo: ask only once `diff` reports something absorbed. Reading a file here reuses
186
+ // `fileDiff`.
231
187
  history: oc
232
188
  .route({
233
189
  method: "GET",
@@ -257,9 +213,7 @@ export const agentsContract = {
257
213
  })
258
214
  .input(AgentLandSchema)
259
215
  .output(LandResultSchema),
260
- // A collaborator's ask for the land they may not perform themselves (role floors put `land`/`discard` at
261
- // maintainer). Stamps AgentSummarySchema.landRequested with the caller's identity and re-frames the fleet,
262
- // so every maintainer's board carries the request; the land or discard that answers it clears the stamp.
216
+ // Stamps `AgentSummarySchema.landRequested` with the caller's identity.
263
217
  requestLand: oc
264
218
  .route({
265
219
  method: "POST",
@@ -8,14 +8,10 @@ import {
8
8
  AutomationSchema,
9
9
  AutomationsListSchema,
10
10
  } from "../schemas/automations.js";
11
- import { OkSchema } from "../schemas/shared.js";
11
+ import { DoorTokenSchema, OkSchema } from "../schemas/shared.js";
12
12
 
13
- // The sandbox's automations manifest (scheduled agent wake-ups). `list` returns each automation with its recent
14
- // runs + next fire time. `upsert` adds or edits by id (nothing to provision, the scheduler picks it up on its
15
- // next poll); `setEnabled` changes only the switch, so a list-row action never has to reconstruct the record.
16
- // `remove` deletes.
17
- // The `pending*` routes are the owner's approval queue: a `requireApproval` automation holds each fire here
18
- // instead of waking; `approve` runs the held wake, `reject` drops it.
13
+ // Automations manifest (scheduled agent wake-ups); `pending*` is the owner's approval queue for wakes a
14
+ // `requireApproval` automation holds instead of firing directly.
19
15
  export const automationsContract = {
20
16
  list: oc
21
17
  .route({
@@ -25,10 +21,6 @@ export const automationsContract = {
25
21
  description: "Every automation with its recent runs and when it fires next.",
26
22
  })
27
23
  .output(AutomationsListSchema),
28
- /* WHAT CAN WAKE AN AGENT HERE, and what to start from, the daemon's own sources and templates merged with
29
- * every installed extension's. The composer's entire vocabulary, so that adding a trigger to an area is a
30
- * change to that area and to nothing else. `upsert` below validates against the same merge, which is what
31
- * keeps the surface and the daemon from disagreeing about what is allowed. */
32
24
  catalog: oc
33
25
  .route({
34
26
  method: "GET",
@@ -65,25 +57,17 @@ export const automationsContract = {
65
57
  })
66
58
  .input(AutomationIdParamSchema)
67
59
  .output(OkSchema),
68
- /* Fire one automation NOW, by hand, the answer to "I wrote a 3 a.m. cron and I have no way to try it".
69
- * It runs the SAME path the real trigger runs: a schedule stays a headless main-tree wake, because a
70
- * test-fire that proves an isolated worktree works proves nothing about the fire it is standing in for. The
71
- * guard runs too ("skipped by guard" is the most useful thing this can report); only the approval gate is
72
- * skipped, since pressing the button IS the owner's approval.
73
- *
74
- * Owner-explicit, so a DISABLED automation fires as well, trying a prompt before switching it on is the
75
- * main reason to press this, and unlike the /automations/{id}/fire webhook there is no outside sender here to
76
- * fail closed against.
77
- *
78
- * NOT FOR A LISTENER, which is the one trigger whose fire is nothing without the thing that fired it. A
79
- * listener's prompt is a brief about handling the events riding with it, and by hand there are none, so the
80
- * button could only ever produce an agent told to handle events, handed none, asking where they went. Worse,
81
- * that pointless run took the automation's turn: a real mention arriving while it ran had to wait behind it.
82
- * Refused here rather than hidden in the UI alone, because the honest answer to "how do I test this" is to
83
- * send the bot a message, which costs nothing and tests the whole path.
84
- *
85
- * Acks immediately with the turn detached, like /fire and `approve`: the guard alone may take a minute, and
86
- * the run history (with the session that makes it openable) is where the outcome lands. */
60
+ rotateToken: oc
61
+ .route({
62
+ method: "POST",
63
+ path: "/automations/{id}/rotate-token",
64
+ summary: "Rotate an automation's webhook token or intake key",
65
+ description:
66
+ "Mints a new credential for the door this automation opens and retires the old one at once. Every caller has to be handed the new URL; that is the point. Refused for an automation with no door.",
67
+ })
68
+ .input(AutomationIdParamSchema)
69
+ .output(DoorTokenSchema),
70
+ // Skips only the approval gate, since pressing this button is the owner's approval.
87
71
  run: oc
88
72
  .route({
89
73
  method: "POST",