@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,9 +1,8 @@
1
1
  // history: daemon-owned workspace snapshots (diff + restore)
2
2
  import { z } from "zod";
3
- // The daemon snapshots /work into bare git dirs on /history (outside the agent's reach). A "snapshot" groups
4
- // one commit per scope (root + each nested repo) under a shared id. Only checkpoint triggers (turn / user /
5
- // pre-restore / restore) are listed; "interval" captures are a hidden safety net that dissolves into the next
6
- // visible checkpoint's diff.
3
+ // Daemon snapshots /work into bare git dirs on /history, outside the agent's reach; a snapshot groups one commit per
4
+ // scope (root + each nested repo) under a shared id. "interval" captures are a hidden safety net that dissolves into
5
+ // the next visible checkpoint's diff.
7
6
 
8
7
  export const SnapshotTriggerSchema = z.enum(["turn", "interval", "pre-restore", "restore", "user"]);
9
8
  export type SnapshotTrigger = z.infer<typeof SnapshotTriggerSchema>;
@@ -14,24 +13,19 @@ export const SnapshotSchema = z.object({
14
13
  trigger: SnapshotTriggerSchema.describe(
15
14
  "What caused it. The automatic between-turn captures are a safety net and are not listed; they dissolve into the next visible point's differences.",
16
15
  ),
17
- // Human-readable checkpoint label, the turn's prompt for "turn" snapshots; absent otherwise.
16
+ // Absent for anything but a "turn" snapshot.
18
17
  label: z.string().optional().describe("What to call it. For one taken before a turn, that turn's prompt."),
19
18
  });
20
19
  export type Snapshot = z.infer<typeof SnapshotSchema>;
21
- /* WHICH CONVERSATION MESSAGE A TURN ANSWERS, carried alongside the turn so its pre-turn checkpoint can be
22
- * filed under it (see the sandbox's agent/turn-anchors.ts). `index` is the transcript position the turn began
23
- * at, which is also how many messages a rewind to it keeps. */
20
+ // Which conversation message a turn answers, so its pre-turn checkpoint can be filed under it. `index` is the
21
+ // transcript position the turn began at, and how many messages a rewind to it keeps.
24
22
  export interface SnapshotTurn {
25
23
  readonly conversationId: string;
26
24
  readonly index: number;
27
25
  }
28
26
  export const SnapshotsListSchema = z.object({ snapshots: z.array(SnapshotSchema).describe("Every point you can go back to, newest first.") });
29
- /* REWIND, go back to a message and carry on from there. Restores the workspace to that turn's checkpoint,
30
- * drops every message after it, and forgets the provider session so the next turn opens a fresh one.
31
- *
32
- * `index` is the transcript position of the user message being rewound TO, which is also how many messages
33
- * survive, rewinding to the first message of a conversation keeps none of it and restores the workspace to
34
- * before it ran. */
27
+ // Restores the workspace to that turn's checkpoint, drops every message after it, and forgets the provider session so
28
+ // the next turn opens fresh.
35
29
  export const RewindTurnSchema = z.object({
36
30
  conversationId: z.string().min(1).describe("Which conversation to rewind."),
37
31
  index: z
@@ -43,23 +37,20 @@ export const RewindTurnSchema = z.object({
43
37
  ),
44
38
  });
45
39
  export const RewindResultSchema = z.object({
46
- /* The checkpoint the workspace was restored to, for the History timeline to select. Absent when the
47
- * conversation works in a checkout of its own: that rewind moved the conversation's own branch, which the
48
- * workspace timeline does not carry, there is no row there to select. */
49
40
  snapshot: z
50
41
  .string()
51
42
  .optional()
52
43
  .describe(
53
44
  "The saved point the files were put back to. Absent for a conversation working in its own copy, whose rewind moved a branch rather than the shared timeline.",
54
45
  ),
55
- // Messages dropped from the transcript, what the client removes from its own bubbles.
46
+ // What the client removes from its own message bubbles.
56
47
  dropped: z.number().int().nonnegative().describe("How many messages were removed."),
57
48
  });
58
49
  export type RewindResult = z.infer<typeof RewindResultSchema>;
59
50
  export const SnapshotIdSchema = z.object({ id: z.string().min(1).describe("Which saved point.") });
60
51
  export const SnapshotChangeSchema = z.object({
61
52
  scope: z.string().describe("Which part of the workspace the path belongs to: the workspace root, or one of the repositories inside it."),
62
- // Scope-relative path with forward slashes.
53
+ // Forward slashes.
63
54
  path: z.string().describe("The path, relative to that scope."),
64
55
  status: z.enum(["added", "modified", "deleted", "type-changed"]).describe("What happened to it."),
65
56
  });
@@ -72,25 +63,8 @@ export const SnapshotFileDiffQuerySchema = z.object({
72
63
  scope: z.string().min(1).describe("Which part of the workspace the path belongs to."),
73
64
  path: z.string().min(1).describe("The file, relative to that scope."),
74
65
  });
75
- /* WHAT A FILE TOO BIG TO SEND WHOLE ANSWERS WITH INSTEAD, and why that is not simply "no".
76
- *
77
- * Both whole sides of a half-megabyte file are a megabyte of JSON per click, so above the cap they are not
78
- * sent, which used to be the end of it: the response said "too large" and every review surface printed one
79
- * sentence over an empty pane. That is the wrong trade, because the thing a reader wants out of a big file is
80
- * almost never the file: it is the handful of lines that MOVED, and those are small however big the file is.
81
- *
82
- * So the daemon diffs it and sends the CHANGED REGIONS as a unified patch, at the same three lines of context
83
- * a collapsed region keeps elsewhere. A 40 KB patch stands in for a 60 MB pair, and the reader gets the actual
84
- * review rather than a refusal. `patch` carries the `@@` sections only, the file headers git prints above them
85
- * name rev-specs no one can apply anyway.
86
- *
87
- * An added or deleted file has no counterpart to diff against, so its patch IS the file, one region of pure
88
- * +/− lines. That is still the right answer: cut to the budget, it is the head of the file, which is the peek
89
- * the reader came for.
90
- *
91
- * `patch` is absent only when there was nothing to make one from: a change too large even to render as a
92
- * patch, or a git that refused. The sizes are still there, so a surface can at least say how big the thing it
93
- * is not showing is. */
66
+ // Unified-diff hunks of the changed regions only, not the whole file. An added/deleted file's patch is the whole file;
67
+ // `patch` is absent only when even that could not be made.
94
68
  export const PartialFileDiffSchema = z.object({
95
69
  beforeBytes: z.number().int().nonnegative().optional().describe("How big the before side is, in bytes. Absent when the file did not exist yet."),
96
70
  afterBytes: z.number().int().nonnegative().optional().describe("How big the after side is, in bytes. Absent when the file was deleted."),
@@ -101,8 +75,8 @@ export const PartialFileDiffSchema = z.object({
101
75
  more: z.boolean().optional().describe("There were more changed regions than fit; the patch stops at a region boundary."),
102
76
  });
103
77
  export type PartialFileDiff = z.infer<typeof PartialFileDiffSchema>;
104
- // Both sides of a file diff, a snapshot vs its parent, or a working tree vs HEAD; an absent side means the
105
- // file was added/deleted. Binary content is flagged instead of shipped; oversized content arrives as `partial`.
78
+ // Both sides of a file diff (snapshot vs parent, or worktree vs HEAD); an absent side means added/deleted. Binary is
79
+ // flagged, not shipped; oversized arrives as `partial`.
106
80
  export const FileDiffSchema = z.object({
107
81
  before: z.string().optional().describe("The whole file as it was. Absent when it did not exist yet, or when `partial` is set."),
108
82
  after: z.string().optional().describe("The whole file as it is now. Absent when it was deleted, or when `partial` is set."),
@@ -1,15 +1,12 @@
1
1
  // hosts: the user's own connected devices (the `host` capability's live half)
2
2
  import { z } from "zod";
3
- // The manifest says which machines the user INTENDS to have connected; this says which are actually holding a
4
- // socket right now. Nothing here is remembered across a daemon restart except the enrollment itself: a machine
5
- // is "online" exactly while its WebSocket is attached, so a laptop that closed its lid reads as offline within
6
- // a heartbeat rather than staying green until someone asks it to do something.
3
+ // Manifest says which machines are intended; this says which actually hold a socket now. Nothing persists across a
4
+ // daemon restart except the enrollment itself, so a closed laptop reads offline within a heartbeat.
7
5
 
8
- // What a machine reports about itself once, at connect (the agent's own `host.describe`, cached until it
9
- // reconnects). It is the difference between an agent guessing what is on the box and knowing: the SKILL pack
10
- // tells it HOW to drive Windows, this tells it WHICH Windows this is.
6
+ // What a machine reports once at connect (`host.describe`), cached until it reconnects: the skill pack says how to
7
+ // drive Windows, this says which Windows it is.
11
8
  export const HostFactsSchema = z.object({
12
- // The OS's own name for itself, "Windows 11 Pro 24H2", "Ubuntu 24.04.1 LTS".
9
+ // The OS's own name for itself, e.g. "Windows 11 Pro 24H2".
13
10
  os: z.string(),
14
11
  arch: z.string(),
15
12
  // The shell run_command actually spawns, so the agent writes for the right one from its first command.
@@ -18,9 +15,8 @@ export const HostFactsSchema = z.object({
18
15
  home: z.string(),
19
16
  // Roots in force right now (the capability's `roots`, or [home]), the agent sees its own boundary.
20
17
  roots: z.array(z.string()),
21
- /* The Docker ENGINE's size — the WSL guest on Windows, the Desktop VM on macOS, the host on Linux — which
22
- * is the ceiling a sandbox's share is bounded by, and the number a Resources dialog draws its limits from.
23
- * Absent when the machine has no docker to ask, which is a machine that runs no sandboxes anyway. */
18
+ // Docker engine's size (WSL guest on Windows, Desktop VM on macOS, host on Linux); the ceiling a sandbox's share is
19
+ // bounded by.
24
20
  engine: z.object({ memoryBytes: z.number(), cpus: z.number() }).optional(),
25
21
  });
26
22
  export type HostFacts = z.infer<typeof HostFactsSchema>;
@@ -29,11 +25,9 @@ export const HostSummarySchema = z.object({
29
25
  id: z.string(),
30
26
  platform: z.string().min(1),
31
27
  online: z.boolean(),
32
- // The agent binary's version, so a machine running an old build is visible rather than mysteriously lacking
33
- // a tool. Absent until the machine has connected once.
28
+ // Agent binary version; absent until the machine has connected once.
34
29
  version: z.string().optional(),
35
- // Epoch ms of the last time this machine held a socket. Absent ⇒ it has not connected since this daemon
36
- // booted, liveness is a fact about a socket, so a restart forgets it rather than claiming stale uptime.
30
+ // Epoch ms of the last held socket; absent means not since this daemon booted (liveness resets on restart).
37
31
  lastSeen: z.number().optional(),
38
32
  facts: HostFactsSchema.optional(),
39
33
  });
@@ -1,14 +1,13 @@
1
1
  // inventory: the i.have.* / i.want.service entries in deploy.config.ts's managed region
2
2
  import { z } from "zod";
3
- // The daemon renders/parses these; the browser edits them through the inventory routes. Moved here from the
4
- // daemon's deploy-config.ts so the daemon and the browser validate against ONE schema (no cross-repo dupes).
3
+ // The daemon renders/parses these; the browser edits them through the inventory routes.
5
4
 
6
5
  export const InventoryProviderSchema = z.enum(["host", "cloudflare", "github", "gitlab", "stripe"]);
7
6
  export type InventoryProvider = z.infer<typeof InventoryProviderSchema>;
8
7
  export const ServiceKindSchema = z.enum(["signoz", "outline", "paperless", "openproject", "invoiceninja", "infisical"]);
9
8
  export type ServiceKind = z.infer<typeof ServiceKindSchema>;
10
- // Non-secret option values the user provides; secret options (sshKey, apiToken, apiKey) are emitted as env()
11
- // references and never travel over the wire.
9
+ // Non-secret option values; secret options (sshKey, apiToken, apiKey) are emitted as env() references, never sent over
10
+ // the wire.
12
11
  export const InventoryValuesSchema = z.record(z.string(), z.union([z.string(), z.number()]));
13
12
  // `const <name>` binding in deploy.config.ts, so it must be a valid identifier.
14
13
  const inventoryName = z
@@ -30,8 +29,8 @@ export const ServiceEntrySchema = z.object({
30
29
  on: z.string().describe("Which of your machines to put it on."),
31
30
  expose: z.string().describe("How it should be reachable."),
32
31
  });
33
- // i.want.app, a deployable app built from source. Single production environment on `main`; `values.domain` is
34
- // where it's exposed. Multi-env/teams/use wiring is hand-authored outside the managed region.
32
+ // i.want.app: single production environment on `main`; `values.domain` is where it's exposed. Multi-env/teams wiring is
33
+ // hand-authored outside the managed region.
35
34
  export const AppEntrySchema = z.object({
36
35
  kind: z.literal("app").describe("An app of your own, built from source and deployed."),
37
36
  name: z.string().describe("What to call it."),
@@ -51,8 +50,8 @@ export const InventoryNameParamSchema = z.object({ name: z.string().describe("Wh
51
50
  export const InventoryListSchema = z.object({
52
51
  entries: z.array(InventoryEntrySchema).describe("Everything declared: what you have, and what you want provisioned."),
53
52
  });
54
- // A deploy-target host self-registering via the connect-host script's POST /enroll (connect-token auth). The SSH
55
- // key (+ optional Cloudflare token) is written to desired-state/.env; the host (+ cf) is upserted into inventory.
53
+ // A deploy-target host self-registering via POST /enroll (connect-token auth); the SSH key (+ optional Cloudflare
54
+ // token) is written to desired-state/.env, and upserted into inventory.
56
55
  export const EnrollHostInputSchema = z.object({
57
56
  name: inventoryName,
58
57
  user: z.string().min(1),
@@ -61,8 +60,7 @@ export const EnrollHostInputSchema = z.object({
61
60
  via: z.enum(["direct", "cloudflared"]).default("cloudflared"),
62
61
  sshKey: z.string().min(1),
63
62
  cfToken: z.string().optional(),
64
- // The zone the connect script resolved alongside cfToken, recorded on the i.have.cloudflare entry so
65
- // resolve validates against it (no re-discovery) and the Add-service dialog offers `<subdomain>.<zone>`.
63
+ // Resolved alongside cfToken; avoids re-discovery and lets Add-service offer `<subdomain>.<zone>`.
66
64
  cfZone: z.string().optional(),
67
65
  });
68
66
  export type EnrollHostInput = z.infer<typeof EnrollHostInputSchema>;
@@ -1,33 +1,19 @@
1
- // issues: inbound bug reports from the owner's own sites and apps, grouped by fingerprint
2
- // (.intentic/records/issues/<fingerprint>.json, one file per group)
1
+ // Inbound bug reports from the owner's own sites and apps, grouped by fingerprint
2
+ // (.intentic/records/issues/<fingerprint>.json, one file per group).
3
3
  import { z } from "zod";
4
4
  import { entryId } from "./internal.js";
5
5
 
6
- /* WHAT A USER'S CRASH LOOKS LIKE BY THE TIME AN AGENT CAN ACT ON IT.
7
- *
8
- * Three shapes live here and the split between them is the whole design:
9
- *
10
- * IssueReportSchema what a stranger's browser POSTs to /intake/<id>/report. UNTRUSTED, every field of it,
11
- * and bounded field by field because the endpoint is public and the body is a stack trace
12
- * somebody else's machine wrote.
13
- * IssueSchema what the daemon KEEPS: one group per fingerprint, with a count, a first/last seen and
14
- * the most recent sample. A crash loop is one of these, not ten thousand.
15
- * IssuesConfigSchema what the owner configures on the automation, and IssuePublicConfigSchema the subset the
16
- * SDK is allowed to read back. Named field by field there, never by omission, the same
17
- * rule WebchatConfig's public half is built on.
18
- *
19
- * The SDK imports these as TYPES ONLY (`import type`), so zod never reaches a visitor's browser, which is why
20
- * the wire shapes live in this package beside the stored ones rather than being re-typed in the bundle. */
6
+ // Three shapes: `IssueReportSchema` (untrusted, from a stranger's POST), `IssueSchema` (the daemon's per-fingerprint
7
+ // group with a count and latest sample), and `IssuesConfigSchema`/`IssuePublicConfigSchema` (owner settings vs. what
8
+ // the SDK reads back). Imported as types only, so zod never reaches a browser.
21
9
 
22
- // What kind of thing arrived. `crash` and `detection` GROUP (one fingerprint, a rising count); `report` never
23
- // does, because two people describing the same annoyance in their own words are two things to read.
10
+ // `crash` and `detection` group under one fingerprint with a rising count; `report` never groups, since two people's
11
+ // own words are two different things.
24
12
  export const IssueKindSchema = z.enum(["crash", "report", "detection"]);
25
13
  export type IssueKind = z.infer<typeof IssueKindSchema>;
26
14
 
27
- /* One thing that happened before the crash. Deliberately a flat {at, kind, message} rather than a per-source
28
- * union: the value of a breadcrumb is being READ in order next to the others, and a shape the SDK can produce
29
- * for a console line, a failed fetch and a route change alike is one the agent can render as a timeline
30
- * without knowing which instrumentations the site switched on. */
15
+ // Flat {at, kind, message} rather than a per-source union, so breadcrumbs from any instrumentation render as one
16
+ // ordered timeline without the agent knowing which ones fired.
31
17
  export const IssueBreadcrumbSchema = z.object({
32
18
  at: z.number().describe("When, in milliseconds."),
33
19
  kind: z.string().max(40).describe("What sort of thing it was: a console line, a request, a click, a route change."),
@@ -35,97 +21,79 @@ export const IssueBreadcrumbSchema = z.object({
35
21
  });
36
22
  export type IssueBreadcrumb = z.infer<typeof IssueBreadcrumbSchema>;
37
23
 
38
- // How much of the reporter we are willing to believe: nothing. Both fields are typed by whoever is reporting,
39
- // so they reach the model beside the content rather than above it, exactly as a Front Desk visitor's
40
- // `unverifiedDisplayName` does. There is no signed identity on this endpoint and there should not be one: a
41
- // crash handler fires on a dying page, where no sign-in ceremony can run.
24
+ // Unverified by construction: both fields are typed by the reporter and ride beside the content, never above it. No
25
+ // sign-in ceremony can run on a dying page.
42
26
  export const IssueReporterSchema = z.object({
43
27
  email: z.string().max(320).optional().describe("An address they typed, to reach them about it. Unverified."),
44
28
  name: z.string().max(200).optional().describe("A name they typed. Unverified, and never identity."),
45
29
  });
46
30
  export type IssueReporter = z.infer<typeof IssueReporterSchema>;
47
31
 
48
- // A small bag of host-supplied strings (route, app version, locale, tenant). Bounded in both dimensions
49
- // because it is the one open-ended field on a public endpoint, and an unbounded map is a storage bug waiting
50
- // for the first person who loops over it.
32
+ // Host-supplied strings (route, version, locale, tenant); bounded in both key count and length, the one open-ended
33
+ // field on a public endpoint.
51
34
  const CONTEXT_KEYS_MAX = 20;
52
35
  const IssueContextSchema = z
53
36
  .record(z.string().max(60), z.string().max(300))
54
37
  .refine((context) => Object.keys(context).length <= CONTEXT_KEYS_MAX, { message: `at most ${CONTEXT_KEYS_MAX} context entries` });
55
38
 
56
- /* ONE REPORT, AS IT ARRIVES. Everything optional except `kind` and `message`, because the three kinds carry
57
- * genuinely different evidence and a schema that demanded the union of them would refuse the commonest case:
58
- * `window.onerror` in an old browser, which has a message and very little else. */
39
+ // One report as it arrives; only `kind`/`message` are required, since demanding every kind's fields would refuse the
40
+ // commonest case (`window.onerror` with little else).
59
41
  export const IssueReportSchema = z.object({
60
42
  kind: IssueKindSchema.describe("A crash the SDK caught, something a person wrote in, or a problem the SDK noticed on its own."),
61
43
  message: z.string().min(1).max(1000).describe("The error's own message, or the headline of what a person reported."),
62
44
  stack: z.string().max(20_000).optional().describe("The stack, verbatim from the browser."),
63
45
  url: z.string().max(2000).optional().describe("Where it happened: the page's address, or a screen name in an app."),
64
- /* THE ONE FIELD THAT REPLACES AN ENTIRE INTEGRATION. The agent has the repository, so a build's sha or tag
65
- * is enough to check that commit out and read the real frames; there is nothing to upload, no artifact
66
- * store, and no sourcemap pipeline to keep in step with a deploy. A site that sets nothing here still gets
67
- * a grouped, readable issue: it just costs the agent a guess about which build it came from. */
46
+ // No artifact store or sourcemap pipeline needed: absent, the agent just guesses which build it came from.
68
47
  release: z.string().max(200).optional().describe("Which build it came from: a commit sha or a tag. With it the agent reads your real source rather than minified frames."),
69
48
  userAgent: z.string().max(400).optional().describe("What the browser said it was."),
70
49
  description: z.string().max(5000).optional().describe("What the person typed, when a person is the one reporting."),
71
50
  reporter: IssueReporterSchema.optional().describe("Who says they are reporting it. Unverified by construction."),
72
51
  breadcrumbs: z.array(IssueBreadcrumbSchema).max(40).optional().describe("What happened just before, oldest first."),
73
52
  context: IssueContextSchema.optional().describe("Whatever else the app attached: a route, a version, a locale."),
74
- /* The host's own grouping override, Sentry's convention and worth keeping: an app that knows two crashes
75
- * are the same thing (or knows one crash is really two) can say so, and the daemon groups on this instead
76
- * of on the stack. It is hashed like everything else, never used as a filename directly. */
53
+ // Hashed like everything else; never used as a filename directly.
77
54
  fingerprint: z.string().max(200).optional().describe("Group by this instead of by the stack, when your app knows better than the stack does."),
78
55
  });
79
56
  export type IssueReport = z.infer<typeof IssueReportSchema>;
80
57
 
81
- /* The body POSTed to /intake/<id>/report: the report plus the two things the GATE needs and the report itself
82
- * has no business carrying, a client id to rate-limit against and the anti-bot answer. Kept out of
83
- * IssueReportSchema so that what gets STORED (the sample) is the evidence and not the doorman's paperwork. */
58
+ // POSTed to /intake/<id>/report: the report plus what the gate needs (client id, anti-bot answer) but never stores —
59
+ // keeps the stored sample pure evidence, not doorman's paperwork.
84
60
  export const IssueIngestSchema = z.object({
85
61
  report: IssueReportSchema,
86
- // The SDK's own per-browser id (localStorage). Not a secret and not identity, anyone can mint one: it is
87
- // the key the per-minute limit counts against, so one runaway tab cannot spend the whole day's budget.
62
+ // Per-minute limit key; distinct from the daily budget below.
88
63
  clientId: z.string().min(1).max(200).describe("The SDK's own id for this browser. Not a secret: it is what the rate limit counts against."),
89
- // Only for `report`, and only when the automation asks for a proof of work: a crash fires on a dying page,
90
- // where there is no second to spend on a puzzle and no user to wait for it.
64
+ // Only for `report`, and only if a proof-of-work is asked for; a crash has no second to spend on a puzzle.
91
65
  powNonce: z.string().max(400).optional(),
92
- // Minted by the owner, pasted into a mobile or server SDK that has no Origin header for the allowlist to
93
- // read. An abuse LABEL rather than a secret (it ships inside a mobile binary and can be pulled out of one):
94
- // the real ceilings are the dedup, the rate limit and the daily budget.
66
+ // For a client with no Origin header; an abuse label, not a secret (ships inside a binary) — dedup, rate limit and
67
+ // daily budget are the real ceilings.
95
68
  key: z.string().max(200).optional(),
96
69
  });
97
70
  export type IssueIngest = z.infer<typeof IssueIngestSchema>;
98
71
 
99
- /* Where a group stands with the owner. `investigating` is set by the daemon when a turn is actually started
100
- * for it (from a wake or from the Investigate button), never guessed: it is the difference between "nobody has
101
- * looked at this" and "something is looking at it right now", which is the question a triage inbox is for. */
72
+ // `investigating` is set only by the daemon when a turn actually starts (a wake, or the Investigate button); never
73
+ // guessed, never settable by a click.
102
74
  export const IssueStatusSchema = z.enum(["open", "investigating", "resolved", "ignored"]);
103
75
  export type IssueStatus = z.infer<typeof IssueStatusSchema>;
104
76
 
105
- // One agent turn started for this issue. The conversation id is the link: the fleet board already knows how to
106
- // open one, so the inbox does not have to store anything about the run beyond which conversation it became.
77
+ // One agent turn for this issue; the conversation id is the link, so nothing about the run itself needs storing beyond
78
+ // it.
107
79
  export const IssueRunSchema = z.object({
108
80
  conversationId: z.string().describe("The conversation this run became."),
109
81
  at: z.number().describe("When it started, in milliseconds."),
110
- // What the count stood at when this run was started, so a recurrence after a fix reads as "it came back",
111
- // not as "someone already looked at this".
82
+ // Lets a post-fix recurrence read as "it came back", not "already looked at".
112
83
  atCount: z.number().describe("How many times it had happened when this run started."),
113
84
  });
114
85
  export type IssueRun = z.infer<typeof IssueRunSchema>;
115
86
 
116
- /* ONE GROUP. The id is the fingerprint and is the FILENAME, never in the body (json-dir.ts owns that rule), so
117
- * a body that disagrees with its own grouping cannot be written. */
87
+ // One group; the id is the fingerprint and the filename, never in the body, so a body cannot disagree with its own
88
+ // grouping.
118
89
  export const IssueSchema = z.object({
119
90
  kind: IssueKindSchema,
120
- // The one-line headline the inbox lists it under, derived from the report rather than typed, so two
121
- // recurrences of one crash cannot be filed under two names.
91
+ // Derived from the report, never typed, so two recurrences of one crash can't end up under two titles.
122
92
  title: z.string().min(1).max(300).describe("The one line this is listed under."),
123
93
  culprit: z.string().max(300).optional().describe("The frame it came from, when the stack named one."),
124
- // Which issues automation received it. A workspace can run several (one per site), and the inbox is one
125
- // list across all of them, so the group has to say which door it came in through.
94
+ // A workspace can run several intakes (one per site); the inbox is one list across all of them.
126
95
  automationId: entryId.describe("Which intake received it."),
127
- // The site or app it came from, as the browser's Origin or the SDK's declared one; absent for a keyed
128
- // client (a mobile app, a server) that has no origin to send.
96
+ // Absent for a keyed client (mobile app, server) with no Origin header to send.
129
97
  origin: z.string().max(400).optional().describe("Which site it came from."),
130
98
  firstSeen: z.number().describe("When it first happened, in milliseconds."),
131
99
  lastSeen: z.number().describe("When it last happened, in milliseconds."),
@@ -133,14 +101,10 @@ export const IssueSchema = z.object({
133
101
  status: IssueStatusSchema.default("open").describe("Where it stands with you."),
134
102
  statusAt: z.number().optional().describe("When the status last changed, in milliseconds."),
135
103
  release: z.string().max(200).optional().describe("The build the latest one came from."),
136
- // The most recent event in full. The LATEST rather than the first, deliberately: when a crash is still
137
- // happening, what it looks like now is what a fix has to reproduce, and the first one is often from a
138
- // build that no longer exists.
104
+ // Latest, not first: a fix must match what it looks like now, not a build that may no longer exist.
139
105
  sample: IssueReportSchema.describe("The most recent one, in full."),
140
- /* How many arrivals had been counted the last time this group WOKE an agent. The whole of the escalation
141
- * rule lives in this one number: a group fires once when it is new, and again only when it has moved this
142
- * far past its last firing. Stored rather than derived, because "how many since the last wake" is not
143
- * recoverable from a count and a timestamp after a restart. */
106
+ // Escalation rule lives in this number: fires once when new, again only once count has moved this far past it.
107
+ // Stored, since a restart can't derive it from a count and timestamp.
144
108
  firedAt: z.number().optional().describe("What the count stood at the last time this woke an agent."),
145
109
  runs: z.array(IssueRunSchema).max(20).optional().describe("The turns started for it."),
146
110
  });
@@ -150,9 +114,8 @@ export type Issue = z.infer<typeof IssueSchema>;
150
114
  export const IssueSummarySchema = IssueSchema.extend({ id: entryId.describe("The issue's id, which is its fingerprint.") });
151
115
  export type IssueSummary = z.infer<typeof IssueSummarySchema>;
152
116
 
153
- // `invalid` is the same trust-boundary confession the approvals list makes, for the opposite reason: nothing but
154
- // the daemon writes these, so a file in here that will not parse is a BUG in this daemon or a half-written
155
- // volume, and either is worth seeing rather than silently skipping.
117
+ // `invalid`: nothing but the daemon writes these files, so one that fails to parse is a bug in this daemon or a
118
+ // half-written volume, worth surfacing not skipping.
156
119
  export const IssuesListSchema = z.object({
157
120
  issues: z.array(IssueSummarySchema).describe("The inbox, most recently seen first."),
158
121
  invalid: z.array(z.string()).describe("Files in the issues directory that could not be read at all."),
@@ -160,66 +123,45 @@ export const IssuesListSchema = z.object({
160
123
  export type IssuesList = z.infer<typeof IssuesListSchema>;
161
124
 
162
125
  export const IssueIdParamSchema = z.object({ id: entryId.describe("Which issue.") });
163
- // Triage: the owner moving one row. `investigating` is not offered here, the daemon sets it when a turn
164
- // actually starts, and letting a click claim it would make the one status that means something a lie.
126
+ // `investigating` is not offered here: the daemon sets it when a turn actually starts, so a click can't fake the one
127
+ // status that means something.
165
128
  export const IssueStatusInputSchema = z.object({
166
129
  id: entryId.describe("Which issue."),
167
130
  status: z.enum(["open", "resolved", "ignored"]).describe("Where it now stands with you."),
168
131
  });
169
132
  export type IssueStatusInput = z.infer<typeof IssueStatusInputSchema>;
170
133
 
171
- /* ---- the automation's own settings ----
172
- *
173
- * Present only on `issues` listener automations, ignored on every other trigger, the shape WebchatConfig
174
- * already established. `allowedOrigins` is NOT here: it lives on the trigger, because it is the admission gate
175
- * the ingest route reads rather than a rendering choice, and one gate in two places is one gate. */
134
+ // Present only on `issues` listener automations. `allowedOrigins` is not here: it lives on the trigger, since the
135
+ // ingest route reads it as the admission gate, not a rendering choice.
176
136
  export const IssuesConfigSchema = z.object({
177
- /* The key a client with no Origin presents (a mobile app, a server, a desktop build). Minted by the daemon
178
- * on upsert like the event webhook's token, and for the same reason: every sender supports "paste this
179
- * string", and nothing else is available to a caller with no identity and no browser.
180
- *
181
- * It is an abuse LABEL, not a secret, and the difference matters: it ships inside a binary anyone can pull
182
- * apart. What it buys is that a leaked key can be rotated in one click while the origin allowlist keeps
183
- * covering the web. The ceilings are what actually bound the damage. */
184
- ingestKey: z.string().min(1).optional().describe("The key an app with no website origin presents. Rotate it freely: the limits, not this, are what bound the damage."),
185
- /* Whether a browser with no allowed origin may still report by presenting the key. Off by default: the
186
- * commonest way an intake gets abused is its key ending up in a public web bundle, and the allowlist is
187
- * the thing that stops that mattering. */
137
+ // Ingest key lives in the secrets store (`AutomationSummary.ingestKey`), not here — an abuse label the origin
138
+ // allowlist and ceilings actually bound, not a secret.
139
+ // Off by default: a leaked key in a public bundle is the commonest abuse, and the allowlist is what limits it.
188
140
  keyFromBrowsers: z.boolean().optional().describe("Let a browser report with the key alone, rather than only from a site you listed. Off unless you need it."),
189
- // The whole intake's ceiling per UTC day, counted in reports that reach the store. Absent ⇒
190
- // ISSUES_DAILY_MAX_DEFAULT, never uncapped, for the reason the Front Desk's own daily cap gives.
141
+ // Per UTC day, counted in reports that reach the store; absent means ISSUES_DAILY_MAX_DEFAULT, never uncapped.
191
142
  dailyReportMax: z.number().int().positive().optional().describe("How many reports a day this intake accepts at all."),
192
- /* HOW FAR A KNOWN CRASH HAS TO GO BEFORE IT INTERRUPTS ANYONE AGAIN. A group wakes an agent when it is
193
- * new, and after that only when its count has grown by this much since the last wake. Absent ⇒
194
- * ISSUES_ESCALATE_AFTER_DEFAULT.
195
- *
196
- * This is the number that makes the whole product safe to leave on. Without it a crash loop on one popular
197
- * page is an agent turn per affected browser, which is a bill rather than a bug report. */
143
+ // Wakes an agent on new, then again once count has grown this much since the last wake; absent means
144
+ // ISSUES_ESCALATE_AFTER_DEFAULT. Without a cap, a crash loop is a turn per browser.
198
145
  escalateAfter: z.number().int().positive().optional().describe("How many more times a known crash must happen before it wakes an agent again."),
199
- // A proof-of-work puzzle on WRITTEN REPORTS only (a crash has no second to spend and no user to wait for
200
- // it). Absent ⇒ off, leaving the origin allowlist and the ceilings as the whole boundary.
146
+ // Written reports only, never a crash; absent means off, leaving the allowlist and ceilings as the boundary.
201
147
  antiBot: z.enum(["pow"]).optional().describe("Make a person's browser solve a small puzzle before it accepts a written report."),
202
- /* ---- the report dialog's chrome, all of it public by construction ---- */
148
+ // The report dialog's chrome; public by construction.
203
149
  title: z.string().max(80).optional().describe("The dialog's heading."),
204
150
  prompt: z.string().max(300).optional().describe("The line above the box they type in."),
205
151
  thanks: z.string().max(300).optional().describe("What it says once they have sent it."),
206
152
  askEmail: z.boolean().optional().describe("Ask for an address to reply to. Optional for them either way."),
207
- // A hex colour, for the reason WebchatConfig's `accent` is one: the SDK derives a hover and a focus ring
208
- // from its channels rather than only painting it.
153
+ // Hex colour; the SDK derives a hover and focus ring from its channels, not just paints it.
209
154
  accent: z
210
155
  .string()
211
156
  .regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, "accent must be a hex colour, e.g. #e47100")
212
157
  .optional(),
213
- // Whether the SDK arms window.onerror / unhandledrejection at all. Absent ⇒ on: a site that embedded a
214
- // crash reporter meant to report crashes.
158
+ // Absent means on: a site that embedded this meant to report crashes.
215
159
  captureCrashes: z.boolean().optional().describe("Catch uncaught errors automatically, as well as what people write in."),
216
160
  });
217
161
  export type IssuesConfig = z.infer<typeof IssuesConfigSchema>;
218
162
 
219
- /* What the SDK is told about itself, fully RESOLVED daemon-side so the bundle carries no fallback logic. Every
220
- * field is named here rather than spread from the config: a secret added to IssuesConfig later is invisible to
221
- * a stranger's browser until somebody deliberately lists it, which is the property this shape exists for.
222
- * `ingestKey` is conspicuously absent, a browser proves itself by its origin. */
163
+ // Fully resolved daemon-side; every field is named here so a secret added to `IssuesConfig` later stays invisible until
164
+ // deliberately listed. `ingestKey` is absent — a browser proves itself by origin.
223
165
  export const IssuePublicConfigSchema = z.object({
224
166
  automationId: z.string(),
225
167
  title: z.string(),
@@ -228,21 +170,18 @@ export const IssuePublicConfigSchema = z.object({
228
170
  askEmail: z.boolean(),
229
171
  accent: z.string(),
230
172
  captureCrashes: z.boolean(),
231
- // "off" spelled out rather than left absent, for the reason the Front Desk's is: the SDK branches on it,
232
- // and a missing field meaning "no challenge" is how one serialization bug becomes an open door.
173
+ // "off" spelled out, not absent: a missing field meaning no challenge is how a serialization bug opens a door.
233
174
  antiBot: z.enum(["pow", "off"]),
234
175
  });
235
176
  export type IssuePublicConfig = z.infer<typeof IssuePublicConfigSchema>;
236
177
 
237
- /* What the intake answers with. A short reference the reporter can be shown ("we filed this as 4f3a…"), and
238
- * nothing else: whether this crash is new, how often it has happened and whether it woke anybody are the
239
- * owner's facts, and the caller is a stranger's browser. */
178
+ // A short reference to show the reporter ("we filed this as 4f3a…"), and nothing else: whether it's new, its count, who
179
+ // it woke are the owner's facts, not a stranger's.
240
180
  export const IssueAcceptedSchema = z.object({ ok: z.literal(true), id: z.string() });
241
181
  export type IssueAccepted = z.infer<typeof IssueAcceptedSchema>;
242
182
 
243
- /* Which origins have loaded this intake's SDK, and which were turned away. The Front Desk's install probe,
244
- * whole, because the setup mistake is identical and so is the silence it produces: a snippet that was never
245
- * pasted, and one pasted on an origin the allowlist does not have, are both "an intake with no reports". */
183
+ // Which origins loaded this intake's SDK, and which were turned away: a snippet never pasted and one pasted on a
184
+ // disallowed origin both look like "no reports".
246
185
  export const IssueInstallSchema = z.object({
247
186
  origin: z.string(),
248
187
  allowed: z.boolean(),
@@ -253,23 +192,16 @@ export const IssueInstallsSchema = z.object({ origins: z.array(IssueInstallSchem
253
192
  export type IssueInstalls = z.infer<typeof IssueInstallsSchema>;
254
193
  export const IssueIntakeIdParamSchema = z.object({ automationId: entryId.describe("Which intake.") });
255
194
 
256
- /* ---- the numbers both ends need ----
257
- *
258
- * Here rather than beside the route that enforces them, for WebchatConfig's reason: the automation editor has
259
- * to be able to show the owner what they are already protected by, and a limit that is invisible until it is
260
- * hit gets filed as a bug. */
195
+ // Constants both the editor and the route need, so a limit is visible to the owner before it is hit.
261
196
 
262
- /* The daily ceiling an intake gets when its owner sets none. Larger than the Front Desk's 200 because the unit
263
- * is different: a report is a file write and only SOMETIMES an agent turn (dedup decides), where a visitor
264
- * message is always a turn. High enough that a real product's bad afternoon fits inside it, low enough that a
265
- * script pointed at the endpoint stops being interesting within seconds. */
197
+ // Default daily ceiling; higher than the Front Desk's 200 since a report is only sometimes a turn (dedup decides),
198
+ // unlike a visitor message.
266
199
  export const ISSUES_DAILY_MAX_DEFAULT = 2000;
267
200
 
268
- /* How much a known crash has to grow before it wakes anybody again. Ten is chosen to be quiet on the tail (one
269
- * more person hitting a known bug is not news) and prompt on a spike: a regression that starts affecting
270
- * everybody crosses it almost at once, which is exactly when the second wake is worth having. */
201
+ // Default escalation threshold; quiet on the long tail, but a spike that starts affecting everybody crosses it almost
202
+ // immediately.
271
203
  export const ISSUES_ESCALATE_AFTER_DEFAULT = 10;
272
204
 
273
- // How much of one ingest body the daemon will read. A stack plus forty breadcrumbs plus a description is a few
274
- // kilobytes; this leaves room for a pathological framework trace without letting the endpoint be a file upload.
205
+ // Max ingest body size; a normal report is a few KB, this leaves room for a pathological trace without becoming a file
206
+ // upload.
275
207
  export const ISSUE_PAYLOAD_MAX = 96_000;