@intentic/sandbox-contract 1.429.0 → 1.431.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 (594) hide show
  1. package/README.md +12 -2
  2. package/dist/app-routes/app-pages.d.ts +1 -0
  3. package/dist/app-routes/app-pages.d.ts.map +1 -1
  4. package/dist/app-routes/app-pages.js +1 -0
  5. package/dist/app-routes/app-pages.js.map +1 -1
  6. package/dist/app-routes/index.d.ts +1 -0
  7. package/dist/app-routes/index.d.ts.map +1 -1
  8. package/dist/app-routes/index.js +1 -0
  9. package/dist/app-routes/index.js.map +1 -1
  10. package/dist/app-routes/return-path.d.ts +2 -0
  11. package/dist/app-routes/return-path.d.ts.map +1 -0
  12. package/dist/app-routes/return-path.js +8 -0
  13. package/dist/app-routes/return-path.js.map +1 -0
  14. package/dist/contracts/accounts.contract.d.ts +7 -0
  15. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  16. package/dist/contracts/accounts.contract.js +2 -0
  17. package/dist/contracts/accounts.contract.js.map +1 -1
  18. package/dist/contracts/agent.contract.d.ts +381 -0
  19. package/dist/contracts/agent.contract.d.ts.map +1 -1
  20. package/dist/contracts/agents.contract.d.ts +3297 -1568
  21. package/dist/contracts/agents.contract.d.ts.map +1 -1
  22. package/dist/contracts/agents.contract.js +35 -5
  23. package/dist/contracts/agents.contract.js.map +1 -1
  24. package/dist/contracts/automations.contract.d.ts +31 -0
  25. package/dist/contracts/automations.contract.d.ts.map +1 -1
  26. package/dist/contracts/automations.contract.js +1 -0
  27. package/dist/contracts/automations.contract.js.map +1 -1
  28. package/dist/contracts/bookmarks.contract.d.ts +101 -0
  29. package/dist/contracts/bookmarks.contract.d.ts.map +1 -0
  30. package/dist/contracts/bookmarks.contract.js +51 -0
  31. package/dist/contracts/bookmarks.contract.js.map +1 -0
  32. package/dist/contracts/browser.contract.d.ts +176 -0
  33. package/dist/contracts/browser.contract.d.ts.map +1 -0
  34. package/dist/contracts/browser.contract.js +150 -0
  35. package/dist/contracts/browser.contract.js.map +1 -0
  36. package/dist/contracts/capabilities.contract.d.ts +48 -0
  37. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  38. package/dist/contracts/capabilities.contract.js +3 -1
  39. package/dist/contracts/capabilities.contract.js.map +1 -1
  40. package/dist/contracts/device-ci-runners.contract.d.ts +108 -0
  41. package/dist/contracts/device-ci-runners.contract.d.ts.map +1 -0
  42. package/dist/contracts/device-ci-runners.contract.js +56 -0
  43. package/dist/contracts/device-ci-runners.contract.js.map +1 -0
  44. package/dist/contracts/device.contract.d.ts +87 -0
  45. package/dist/contracts/device.contract.d.ts.map +1 -1
  46. package/dist/contracts/device.contract.js +4 -0
  47. package/dist/contracts/device.contract.js.map +1 -1
  48. package/dist/contracts/extensions.contract.d.ts +1 -0
  49. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  50. package/dist/contracts/extensions.contract.js +1 -1
  51. package/dist/contracts/extensions.contract.js.map +1 -1
  52. package/dist/contracts/git.contract.d.ts +7 -0
  53. package/dist/contracts/git.contract.d.ts.map +1 -1
  54. package/dist/contracts/issues.contract.d.ts +11 -0
  55. package/dist/contracts/issues.contract.d.ts.map +1 -1
  56. package/dist/contracts/needs.contract.d.ts +408 -0
  57. package/dist/contracts/needs.contract.d.ts.map +1 -1
  58. package/dist/contracts/offload.contract.d.ts +4 -0
  59. package/dist/contracts/offload.contract.d.ts.map +1 -1
  60. package/dist/contracts/ports.contract.d.ts +8 -0
  61. package/dist/contracts/ports.contract.d.ts.map +1 -1
  62. package/dist/contracts/ports.contract.js +6 -5
  63. package/dist/contracts/ports.contract.js.map +1 -1
  64. package/dist/contracts/remote.contract.d.ts +121 -0
  65. package/dist/contracts/remote.contract.d.ts.map +1 -0
  66. package/dist/contracts/remote.contract.js +80 -0
  67. package/dist/contracts/remote.contract.js.map +1 -0
  68. package/dist/contracts/runner.contract.d.ts +716 -15
  69. package/dist/contracts/runner.contract.d.ts.map +1 -1
  70. package/dist/contracts/runner.contract.js +49 -2
  71. package/dist/contracts/runner.contract.js.map +1 -1
  72. package/dist/contracts/runners.contract.d.ts +16 -0
  73. package/dist/contracts/runners.contract.d.ts.map +1 -0
  74. package/dist/contracts/runners.contract.js +15 -0
  75. package/dist/contracts/runners.contract.js.map +1 -0
  76. package/dist/contracts/safety.contract.d.ts.map +1 -1
  77. package/dist/contracts/safety.contract.js +1 -0
  78. package/dist/contracts/safety.contract.js.map +1 -1
  79. package/dist/contracts/seal.contract.d.ts +105 -0
  80. package/dist/contracts/seal.contract.d.ts.map +1 -1
  81. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  82. package/dist/contracts/secrets.contract.js +6 -0
  83. package/dist/contracts/secrets.contract.js.map +1 -1
  84. package/dist/contracts/sessions.contract.d.ts +48 -0
  85. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  86. package/dist/contracts/settings.contract.d.ts +28 -0
  87. package/dist/contracts/settings.contract.d.ts.map +1 -1
  88. package/dist/contracts/settings.contract.js +1 -0
  89. package/dist/contracts/settings.contract.js.map +1 -1
  90. package/dist/contracts/skills.contract.d.ts +6 -0
  91. package/dist/contracts/skills.contract.d.ts.map +1 -1
  92. package/dist/contracts/system.contract.d.ts +482 -4
  93. package/dist/contracts/system.contract.d.ts.map +1 -1
  94. package/dist/contracts/system.contract.js +70 -3
  95. package/dist/contracts/system.contract.js.map +1 -1
  96. package/dist/contracts/translator.contract.d.ts +7 -0
  97. package/dist/contracts/translator.contract.d.ts.map +1 -1
  98. package/dist/contracts/usage.contract.d.ts +3 -0
  99. package/dist/contracts/usage.contract.d.ts.map +1 -1
  100. package/dist/events/agent-events.d.ts +194 -0
  101. package/dist/events/agent-events.d.ts.map +1 -1
  102. package/dist/events/agent-events.js +2 -2
  103. package/dist/events/agent-events.js.map +1 -1
  104. package/dist/events/agent-transcript.d.ts +48 -0
  105. package/dist/events/agent-transcript.d.ts.map +1 -1
  106. package/dist/events/agent-words.d.ts +5 -0
  107. package/dist/events/agent-words.d.ts.map +1 -1
  108. package/dist/events/agent-words.js +20 -1
  109. package/dist/events/agent-words.js.map +1 -1
  110. package/dist/events/failure-rows.d.ts +2 -2
  111. package/dist/events/failure-rows.d.ts.map +1 -1
  112. package/dist/events/failure-rows.js +13 -13
  113. package/dist/events/failure-rows.js.map +1 -1
  114. package/dist/events/refusal-incidents.d.ts +1 -0
  115. package/dist/events/refusal-incidents.d.ts.map +1 -1
  116. package/dist/events/refusal-incidents.js +42 -19
  117. package/dist/events/refusal-incidents.js.map +1 -1
  118. package/dist/events/resume.d.ts.map +1 -1
  119. package/dist/events/resume.js +12 -12
  120. package/dist/events/resume.js.map +1 -1
  121. package/dist/events/sandbox-notice.d.ts.map +1 -1
  122. package/dist/events/sandbox-notice.js.map +1 -1
  123. package/dist/events/system-events.d.ts +102 -0
  124. package/dist/events/system-events.d.ts.map +1 -1
  125. package/dist/events/transcript.d.ts +240 -0
  126. package/dist/events/transcript.d.ts.map +1 -1
  127. package/dist/ids/conversation-ids.d.ts +1 -0
  128. package/dist/ids/conversation-ids.d.ts.map +1 -1
  129. package/dist/ids/conversation-ids.js +2 -1
  130. package/dist/ids/conversation-ids.js.map +1 -1
  131. package/dist/ids/project-id.d.ts.map +1 -1
  132. package/dist/ids/project-id.js +4 -4
  133. package/dist/ids/project-id.js.map +1 -1
  134. package/dist/ids/run-row-ids.d.ts +8 -0
  135. package/dist/ids/run-row-ids.d.ts.map +1 -0
  136. package/dist/ids/run-row-ids.js +32 -0
  137. package/dist/ids/run-row-ids.js.map +1 -0
  138. package/dist/index.d.ts +12 -4
  139. package/dist/index.d.ts.map +1 -1
  140. package/dist/index.js +12 -4
  141. package/dist/index.js.map +1 -1
  142. package/dist/models/agent-catalog.d.ts.map +1 -1
  143. package/dist/models/agent-catalog.js +3 -2
  144. package/dist/models/agent-catalog.js.map +1 -1
  145. package/dist/models/agent-lanes.d.ts.map +1 -1
  146. package/dist/models/agent-lanes.js +4 -1
  147. package/dist/models/agent-lanes.js.map +1 -1
  148. package/dist/models/agent-runtimes.d.ts.map +1 -1
  149. package/dist/models/agent-runtimes.js +2 -2
  150. package/dist/models/agent-runtimes.js.map +1 -1
  151. package/dist/models/agent-standing.d.ts +6 -1
  152. package/dist/models/agent-standing.d.ts.map +1 -1
  153. package/dist/models/agent-standing.js +1 -0
  154. package/dist/models/agent-standing.js.map +1 -1
  155. package/dist/models/providers/provider-traits.d.ts +215 -0
  156. package/dist/models/providers/provider-traits.d.ts.map +1 -0
  157. package/dist/models/providers/provider-traits.js +60 -0
  158. package/dist/models/providers/provider-traits.js.map +1 -0
  159. package/dist/netd/browser-wire.d.ts +58 -1
  160. package/dist/netd/browser-wire.d.ts.map +1 -1
  161. package/dist/netd/browser-wire.js +27 -0
  162. package/dist/netd/browser-wire.js.map +1 -1
  163. package/dist/netd/generated/browser-wire.d.ts +135 -0
  164. package/dist/netd/generated/browser-wire.d.ts.map +1 -1
  165. package/dist/netd/generated/wire.d.ts +56 -1
  166. package/dist/netd/generated/wire.d.ts.map +1 -1
  167. package/dist/policy/admin/admin-grant.d.ts +21 -0
  168. package/dist/policy/admin/admin-grant.d.ts.map +1 -0
  169. package/dist/policy/admin/admin-grant.js +41 -0
  170. package/dist/policy/admin/admin-grant.js.map +1 -0
  171. package/dist/policy/capabilities/capability-kinds.d.ts +268 -0
  172. package/dist/policy/capabilities/capability-kinds.d.ts.map +1 -0
  173. package/dist/policy/capabilities/capability-kinds.js +47 -0
  174. package/dist/policy/capabilities/capability-kinds.js.map +1 -0
  175. package/dist/policy/command-classes.d.ts.map +1 -1
  176. package/dist/policy/command-classes.js +3 -1
  177. package/dist/policy/command-classes.js.map +1 -1
  178. package/dist/policy/device-programs.d.ts +79 -2
  179. package/dist/policy/device-programs.d.ts.map +1 -1
  180. package/dist/policy/device-programs.js +15 -16
  181. package/dist/policy/device-programs.js.map +1 -1
  182. package/dist/policy/reserved-servers.d.ts.map +1 -1
  183. package/dist/policy/reserved-servers.js +5 -1
  184. package/dist/policy/reserved-servers.js.map +1 -1
  185. package/dist/policy/role-capability.d.ts.map +1 -1
  186. package/dist/policy/role-capability.js +2 -1
  187. package/dist/policy/role-capability.js.map +1 -1
  188. package/dist/policy/shell/command-normalise.d.ts +10 -0
  189. package/dist/policy/shell/command-normalise.d.ts.map +1 -0
  190. package/dist/policy/shell/command-normalise.js +153 -0
  191. package/dist/policy/shell/command-normalise.js.map +1 -0
  192. package/dist/protocol/doors/listener-protocol.d.ts +4 -0
  193. package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
  194. package/dist/protocol/doors/listener-protocol.js +4 -0
  195. package/dist/protocol/doors/listener-protocol.js.map +1 -1
  196. package/dist/protocol/doors/loopback-proof.d.ts +8 -0
  197. package/dist/protocol/doors/loopback-proof.d.ts.map +1 -0
  198. package/dist/protocol/doors/loopback-proof.js +11 -0
  199. package/dist/protocol/doors/loopback-proof.js.map +1 -0
  200. package/dist/protocol/doors/pass-scopes.d.ts +4 -0
  201. package/dist/protocol/doors/pass-scopes.d.ts.map +1 -0
  202. package/dist/protocol/doors/pass-scopes.js +3 -0
  203. package/dist/protocol/doors/pass-scopes.js.map +1 -0
  204. package/dist/protocol/doors/runner-protocol.d.ts +187 -0
  205. package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
  206. package/dist/protocol/doors/runner-protocol.js +48 -1
  207. package/dist/protocol/doors/runner-protocol.js.map +1 -1
  208. package/dist/protocol/doors/sandbox-pass.d.ts +19 -2
  209. package/dist/protocol/doors/sandbox-pass.d.ts.map +1 -1
  210. package/dist/protocol/doors/sandbox-pass.js +42 -10
  211. package/dist/protocol/doors/sandbox-pass.js.map +1 -1
  212. package/dist/protocol/member-reach.d.ts +6 -0
  213. package/dist/protocol/member-reach.d.ts.map +1 -1
  214. package/dist/protocol/member-reach.js +24 -0
  215. package/dist/protocol/member-reach.js.map +1 -1
  216. package/dist/protocol/peer-mcp-server.d.ts +2 -0
  217. package/dist/protocol/peer-mcp-server.d.ts.map +1 -1
  218. package/dist/protocol/peer-mcp-server.js +1 -0
  219. package/dist/protocol/peer-mcp-server.js.map +1 -1
  220. package/dist/protocol/raw/raw-json-routes.d.ts +518 -0
  221. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  222. package/dist/protocol/raw/raw-json-routes.js +26 -2
  223. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  224. package/dist/protocol/raw/raw-routes.d.ts +182 -2
  225. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  226. package/dist/protocol/raw/raw-routes.js +67 -35
  227. package/dist/protocol/raw/raw-routes.js.map +1 -1
  228. package/dist/protocol/route-meta.d.ts.map +1 -1
  229. package/dist/protocol/route-meta.js.map +1 -1
  230. package/dist/schemas/account-routes.d.ts +176 -0
  231. package/dist/schemas/account-routes.d.ts.map +1 -0
  232. package/dist/schemas/account-routes.js +73 -0
  233. package/dist/schemas/account-routes.js.map +1 -0
  234. package/dist/schemas/activity.d.ts.map +1 -1
  235. package/dist/schemas/activity.js.map +1 -1
  236. package/dist/schemas/agent-background.d.ts +48 -0
  237. package/dist/schemas/agent-background.d.ts.map +1 -0
  238. package/dist/schemas/agent-background.js +63 -0
  239. package/dist/schemas/agent-background.js.map +1 -0
  240. package/dist/schemas/agent-land.d.ts +7 -0
  241. package/dist/schemas/agent-land.d.ts.map +1 -1
  242. package/dist/schemas/agent-land.js +11 -0
  243. package/dist/schemas/agent-land.js.map +1 -1
  244. package/dist/schemas/agent.d.ts +16 -0
  245. package/dist/schemas/agent.d.ts.map +1 -1
  246. package/dist/schemas/agent.js +3 -4
  247. package/dist/schemas/agent.js.map +1 -1
  248. package/dist/schemas/agents-list.d.ts +42 -0
  249. package/dist/schemas/agents-list.d.ts.map +1 -1
  250. package/dist/schemas/agents.d.ts +668 -17
  251. package/dist/schemas/agents.d.ts.map +1 -1
  252. package/dist/schemas/agents.js +16 -41
  253. package/dist/schemas/agents.js.map +1 -1
  254. package/dist/schemas/auto-approve.d.ts +12 -0
  255. package/dist/schemas/auto-approve.d.ts.map +1 -0
  256. package/dist/schemas/auto-approve.js +12 -0
  257. package/dist/schemas/auto-approve.js.map +1 -0
  258. package/dist/schemas/automations.d.ts +83 -0
  259. package/dist/schemas/automations.d.ts.map +1 -1
  260. package/dist/schemas/automations.js +11 -1
  261. package/dist/schemas/automations.js.map +1 -1
  262. package/dist/schemas/bookmarks.d.ts +85 -0
  263. package/dist/schemas/bookmarks.d.ts.map +1 -0
  264. package/dist/schemas/bookmarks.js +56 -0
  265. package/dist/schemas/bookmarks.js.map +1 -0
  266. package/dist/schemas/bridge-heads.d.ts +57 -0
  267. package/dist/schemas/bridge-heads.d.ts.map +1 -0
  268. package/dist/schemas/bridge-heads.js +22 -0
  269. package/dist/schemas/bridge-heads.js.map +1 -0
  270. package/dist/schemas/browser-tools.d.ts +167 -0
  271. package/dist/schemas/browser-tools.d.ts.map +1 -0
  272. package/dist/schemas/browser-tools.js +121 -0
  273. package/dist/schemas/browser-tools.js.map +1 -0
  274. package/dist/schemas/browsing.d.ts +139 -0
  275. package/dist/schemas/browsing.d.ts.map +1 -0
  276. package/dist/schemas/browsing.js +83 -0
  277. package/dist/schemas/browsing.js.map +1 -0
  278. package/dist/schemas/capabilities.d.ts +57 -0
  279. package/dist/schemas/capabilities.d.ts.map +1 -1
  280. package/dist/schemas/capabilities.js +9 -0
  281. package/dist/schemas/capabilities.js.map +1 -1
  282. package/dist/schemas/checkout-hooks.d.ts +24 -0
  283. package/dist/schemas/checkout-hooks.d.ts.map +1 -0
  284. package/dist/schemas/checkout-hooks.js +23 -0
  285. package/dist/schemas/checkout-hooks.js.map +1 -0
  286. package/dist/schemas/ci-fleet.d.ts +216 -0
  287. package/dist/schemas/ci-fleet.d.ts.map +1 -0
  288. package/dist/schemas/ci-fleet.js +87 -0
  289. package/dist/schemas/ci-fleet.js.map +1 -0
  290. package/dist/schemas/connection-hub.d.ts +3 -1
  291. package/dist/schemas/connection-hub.d.ts.map +1 -1
  292. package/dist/schemas/connection-hub.js +2 -1
  293. package/dist/schemas/connection-hub.js.map +1 -1
  294. package/dist/schemas/context-continues.d.ts.map +1 -1
  295. package/dist/schemas/context-continues.js +2 -2
  296. package/dist/schemas/context-continues.js.map +1 -1
  297. package/dist/schemas/context-trim.js +3 -3
  298. package/dist/schemas/context-trim.js.map +1 -1
  299. package/dist/schemas/device-remote.d.ts +84 -0
  300. package/dist/schemas/device-remote.d.ts.map +1 -0
  301. package/dist/schemas/device-remote.js +54 -0
  302. package/dist/schemas/device-remote.js.map +1 -0
  303. package/dist/schemas/devices.d.ts +64 -0
  304. package/dist/schemas/devices.d.ts.map +1 -1
  305. package/dist/schemas/devices.js +6 -1
  306. package/dist/schemas/devices.js.map +1 -1
  307. package/dist/schemas/environment.d.ts +1 -0
  308. package/dist/schemas/environment.d.ts.map +1 -1
  309. package/dist/schemas/environment.js +1 -0
  310. package/dist/schemas/environment.js.map +1 -1
  311. package/dist/schemas/extension-updates.d.ts +2 -0
  312. package/dist/schemas/extension-updates.d.ts.map +1 -1
  313. package/dist/schemas/extension-updates.js +4 -0
  314. package/dist/schemas/extension-updates.js.map +1 -1
  315. package/dist/schemas/git/git.d.ts +13 -0
  316. package/dist/schemas/git/git.d.ts.map +1 -1
  317. package/dist/schemas/git/git.js +7 -7
  318. package/dist/schemas/git/git.js.map +1 -1
  319. package/dist/schemas/git/index-run.d.ts +1 -0
  320. package/dist/schemas/git/index-run.d.ts.map +1 -1
  321. package/dist/schemas/host-power.d.ts +54 -0
  322. package/dist/schemas/host-power.d.ts.map +1 -0
  323. package/dist/schemas/host-power.js +46 -0
  324. package/dist/schemas/host-power.js.map +1 -0
  325. package/dist/schemas/hosts.d.ts +145 -0
  326. package/dist/schemas/hosts.d.ts.map +1 -1
  327. package/dist/schemas/hosts.js +15 -1
  328. package/dist/schemas/hosts.js.map +1 -1
  329. package/dist/schemas/issues.d.ts +44 -0
  330. package/dist/schemas/issues.d.ts.map +1 -1
  331. package/dist/schemas/issues.js +12 -0
  332. package/dist/schemas/issues.js.map +1 -1
  333. package/dist/schemas/keep-warm.d.ts.map +1 -1
  334. package/dist/schemas/keep-warm.js +2 -3
  335. package/dist/schemas/keep-warm.js.map +1 -1
  336. package/dist/schemas/keyring-native.d.ts.map +1 -1
  337. package/dist/schemas/keyring-native.js +3 -1
  338. package/dist/schemas/keyring-native.js.map +1 -1
  339. package/dist/schemas/keyring.d.ts +1 -0
  340. package/dist/schemas/keyring.d.ts.map +1 -1
  341. package/dist/schemas/keyring.js +3 -1
  342. package/dist/schemas/keyring.js.map +1 -1
  343. package/dist/schemas/members.d.ts.map +1 -1
  344. package/dist/schemas/members.js +2 -14
  345. package/dist/schemas/members.js.map +1 -1
  346. package/dist/schemas/metrics.d.ts +8 -0
  347. package/dist/schemas/metrics.d.ts.map +1 -1
  348. package/dist/schemas/metrics.js +8 -0
  349. package/dist/schemas/metrics.js.map +1 -1
  350. package/dist/schemas/needs.d.ts +349 -1
  351. package/dist/schemas/needs.d.ts.map +1 -1
  352. package/dist/schemas/needs.js +45 -5
  353. package/dist/schemas/needs.js.map +1 -1
  354. package/dist/schemas/offload.d.ts +9 -0
  355. package/dist/schemas/offload.d.ts.map +1 -1
  356. package/dist/schemas/offload.js +2 -1
  357. package/dist/schemas/offload.js.map +1 -1
  358. package/dist/schemas/ports.d.ts +4 -0
  359. package/dist/schemas/ports.d.ts.map +1 -1
  360. package/dist/schemas/ports.js +3 -0
  361. package/dist/schemas/ports.js.map +1 -1
  362. package/dist/schemas/providers/capacity.d.ts +6 -0
  363. package/dist/schemas/providers/capacity.d.ts.map +1 -1
  364. package/dist/schemas/providers/handoff.d.ts.map +1 -1
  365. package/dist/schemas/providers/handoff.js +11 -11
  366. package/dist/schemas/providers/handoff.js.map +1 -1
  367. package/dist/schemas/providers/provider-oauth.d.ts +14 -0
  368. package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
  369. package/dist/schemas/providers/provider-oauth.js +6 -2
  370. package/dist/schemas/providers/provider-oauth.js.map +1 -1
  371. package/dist/schemas/providers/refusals.d.ts +12 -0
  372. package/dist/schemas/providers/refusals.d.ts.map +1 -1
  373. package/dist/schemas/providers/refusals.js +4 -0
  374. package/dist/schemas/providers/refusals.js.map +1 -1
  375. package/dist/schemas/providers/switched.js +1 -1
  376. package/dist/schemas/providers/switched.js.map +1 -1
  377. package/dist/schemas/queued-trial-retry.d.ts +7 -0
  378. package/dist/schemas/queued-trial-retry.d.ts.map +1 -0
  379. package/dist/schemas/queued-trial-retry.js +8 -0
  380. package/dist/schemas/queued-trial-retry.js.map +1 -0
  381. package/dist/schemas/remote-access.d.ts +138 -0
  382. package/dist/schemas/remote-access.d.ts.map +1 -0
  383. package/dist/schemas/remote-access.js +72 -0
  384. package/dist/schemas/remote-access.js.map +1 -0
  385. package/dist/schemas/run-targets.d.ts.map +1 -1
  386. package/dist/schemas/run-targets.js +2 -1
  387. package/dist/schemas/run-targets.js.map +1 -1
  388. package/dist/schemas/runner-views.d.ts +24 -0
  389. package/dist/schemas/runner-views.d.ts.map +1 -0
  390. package/dist/schemas/runner-views.js +16 -0
  391. package/dist/schemas/runner-views.js.map +1 -0
  392. package/dist/schemas/sandbox-reach.d.ts +157 -0
  393. package/dist/schemas/sandbox-reach.d.ts.map +1 -0
  394. package/dist/schemas/sandbox-reach.js +112 -0
  395. package/dist/schemas/sandbox-reach.js.map +1 -0
  396. package/dist/schemas/seal.d.ts +1 -1
  397. package/dist/schemas/seal.d.ts.map +1 -1
  398. package/dist/schemas/seal.js +1 -1
  399. package/dist/schemas/seal.js.map +1 -1
  400. package/dist/schemas/settings.d.ts +44 -0
  401. package/dist/schemas/settings.d.ts.map +1 -1
  402. package/dist/schemas/settings.js +24 -1
  403. package/dist/schemas/settings.js.map +1 -1
  404. package/dist/schemas/system.d.ts +19 -0
  405. package/dist/schemas/system.d.ts.map +1 -1
  406. package/dist/schemas/system.js +9 -0
  407. package/dist/schemas/system.js.map +1 -1
  408. package/dist/schemas/terminal.d.ts +182 -0
  409. package/dist/schemas/terminal.d.ts.map +1 -1
  410. package/dist/schemas/terminal.js +60 -1
  411. package/dist/schemas/terminal.js.map +1 -1
  412. package/dist/state/auth-state.d.ts.map +1 -1
  413. package/dist/state/auth-state.js +2 -0
  414. package/dist/state/auth-state.js.map +1 -1
  415. package/dist/state/definition.d.ts +64 -0
  416. package/dist/state/definition.d.ts.map +1 -1
  417. package/dist/state/runtime-state.d.ts +4 -1
  418. package/dist/state/runtime-state.d.ts.map +1 -1
  419. package/dist/state/runtime-state.js +2 -1
  420. package/dist/state/runtime-state.js.map +1 -1
  421. package/dist/state/workspace-state.d.ts +1 -1
  422. package/dist/state/workspace-state.d.ts.map +1 -1
  423. package/dist/state/workspace-state.js +1 -1
  424. package/dist/state/workspace-state.js.map +1 -1
  425. package/dist/sync/workspace-sync-ignores.d.ts +4 -0
  426. package/dist/sync/workspace-sync-ignores.d.ts.map +1 -0
  427. package/dist/sync/workspace-sync-ignores.js +75 -0
  428. package/dist/sync/workspace-sync-ignores.js.map +1 -0
  429. package/dist/text/land-rows.d.ts.map +1 -1
  430. package/dist/text/land-rows.js +13 -17
  431. package/dist/text/land-rows.js.map +1 -1
  432. package/dist/text/notice-rows.js +6 -6
  433. package/dist/text/notice-rows.js.map +1 -1
  434. package/dist/text/pages.d.ts.map +1 -1
  435. package/dist/text/pages.js +17 -4
  436. package/dist/text/pages.js.map +1 -1
  437. package/dist/text/transcript-fold.js +2 -2
  438. package/dist/text/transcript-fold.js.map +1 -1
  439. package/package.json +5 -5
  440. package/src/app-routes/app-pages.ts +3 -0
  441. package/src/app-routes/index.ts +1 -0
  442. package/src/app-routes/return-path.ts +16 -0
  443. package/src/contracts/accounts.contract.ts +3 -0
  444. package/src/contracts/agents.contract.ts +41 -5
  445. package/src/contracts/automations.contract.ts +2 -0
  446. package/src/contracts/bookmarks.contract.ts +66 -0
  447. package/src/contracts/browser.contract.ts +181 -0
  448. package/src/contracts/capabilities.contract.ts +7 -2
  449. package/src/contracts/device-ci-runners.contract.ts +81 -0
  450. package/src/contracts/device.contract.ts +15 -0
  451. package/src/contracts/extensions.contract.ts +1 -1
  452. package/src/contracts/ports.contract.ts +6 -6
  453. package/src/contracts/remote.contract.ts +104 -0
  454. package/src/contracts/runner.contract.ts +117 -3
  455. package/src/contracts/runners.contract.ts +19 -0
  456. package/src/contracts/safety.contract.ts +2 -0
  457. package/src/contracts/secrets.contract.ts +12 -0
  458. package/src/contracts/settings.contract.ts +2 -0
  459. package/src/contracts/system.contract.ts +98 -3
  460. package/src/events/agent-events.ts +3 -2
  461. package/src/events/agent-words.test.ts +19 -1
  462. package/src/events/agent-words.ts +33 -1
  463. package/src/events/failure-rows.ts +13 -14
  464. package/src/events/refusal-incidents.ts +60 -19
  465. package/src/events/resume.test.ts +3 -3
  466. package/src/events/resume.ts +12 -18
  467. package/src/events/sandbox-notice.ts +2 -0
  468. package/src/ids/conversation-ids.test.ts +3 -1
  469. package/src/ids/conversation-ids.ts +6 -4
  470. package/src/ids/project-dir.test.ts +1 -1
  471. package/src/ids/project-dir.ts +1 -1
  472. package/src/ids/project-id.test.ts +14 -0
  473. package/src/ids/project-id.ts +6 -4
  474. package/src/ids/run-row-ids.test.ts +38 -0
  475. package/src/ids/run-row-ids.ts +49 -0
  476. package/src/index.ts +18 -6
  477. package/src/models/agent-catalog.test.ts +7 -4
  478. package/src/models/agent-catalog.ts +3 -2
  479. package/src/models/agent-lanes.ts +8 -1
  480. package/src/models/agent-runtimes.ts +7 -6
  481. package/src/models/agent-standing.ts +13 -0
  482. package/src/models/provider-specs.test.ts +2 -2
  483. package/src/models/providers/provider-traits.test.ts +71 -0
  484. package/src/models/providers/provider-traits.ts +144 -0
  485. package/src/netd/browser-wire.ts +97 -0
  486. package/src/netd/generated/browser-wire.json +904 -0
  487. package/src/netd/generated/browser-wire.ts +62 -3
  488. package/src/netd/generated/netd-wire.json +299 -1
  489. package/src/netd/generated/wire.ts +27 -6
  490. package/src/netd/wire-manifests.test.ts +92 -1
  491. package/src/policy/admin/admin-grant.ts +69 -0
  492. package/src/policy/capabilities/capability-kinds.test.ts +112 -0
  493. package/src/policy/capabilities/capability-kinds.ts +110 -0
  494. package/src/policy/command-classes.ts +5 -3
  495. package/src/policy/credential-material.ts +1 -1
  496. package/src/policy/device-programs.ts +29 -20
  497. package/src/policy/overlay-lint.ts +1 -1
  498. package/src/policy/reserved-servers.ts +5 -1
  499. package/src/policy/role-capability.ts +3 -1
  500. package/src/policy/shell/command-normalise.test.ts +72 -0
  501. package/src/policy/shell/command-normalise.ts +212 -0
  502. package/src/policy/tests/admin-grant.test.ts +35 -0
  503. package/src/policy/tests/command-classes.test.ts +41 -0
  504. package/src/protocol/doors/listener-protocol.ts +18 -1
  505. package/src/protocol/doors/loopback-proof.ts +34 -0
  506. package/src/protocol/doors/pass-scopes.ts +12 -0
  507. package/src/protocol/doors/runner-protocol.ts +133 -4
  508. package/src/protocol/doors/sandbox-pass.test.ts +33 -1
  509. package/src/protocol/doors/sandbox-pass.ts +92 -16
  510. package/src/protocol/ingress-contract.fixture.json +9 -1
  511. package/src/protocol/member-reach.test.ts +40 -1
  512. package/src/protocol/member-reach.ts +40 -0
  513. package/src/protocol/peer-mcp-server.ts +6 -0
  514. package/src/protocol/raw/raw-json-routes.ts +48 -1
  515. package/src/protocol/raw/raw-routes.ts +99 -36
  516. package/src/protocol/route-meta.ts +4 -1
  517. package/src/schemas/account-routes.ts +126 -0
  518. package/src/schemas/activity.ts +4 -3
  519. package/src/schemas/agent-background.ts +104 -0
  520. package/src/schemas/agent-land.ts +21 -2
  521. package/src/schemas/agent.ts +3 -4
  522. package/src/schemas/agents.ts +26 -65
  523. package/src/schemas/auto-approve.ts +31 -0
  524. package/src/schemas/automations.ts +26 -1
  525. package/src/schemas/bookmarks.ts +79 -0
  526. package/src/schemas/bridge-heads.ts +33 -0
  527. package/src/schemas/browser-tools.ts +164 -0
  528. package/src/schemas/browsing.ts +129 -0
  529. package/src/schemas/capabilities.ts +32 -0
  530. package/src/schemas/checkout-hooks.ts +44 -0
  531. package/src/schemas/ci-fleet.ts +180 -0
  532. package/src/schemas/compose-overlay.test.ts +1 -1
  533. package/src/schemas/compose-overlay.ts +1 -1
  534. package/src/schemas/connection-hub.ts +4 -2
  535. package/src/schemas/context-continues.ts +6 -3
  536. package/src/schemas/context-trim.test.ts +6 -6
  537. package/src/schemas/context-trim.ts +3 -3
  538. package/src/schemas/data-protection.ts +1 -1
  539. package/src/schemas/device-remote.ts +106 -0
  540. package/src/schemas/device-swaps.test.ts +1 -1
  541. package/src/schemas/devices.ts +19 -1
  542. package/src/schemas/egress-private.test.ts +1 -1
  543. package/src/schemas/environment.ts +4 -0
  544. package/src/schemas/extension-updates.ts +8 -0
  545. package/src/schemas/git/git.ts +14 -14
  546. package/src/schemas/host-power.ts +79 -0
  547. package/src/schemas/hosts.ts +37 -2
  548. package/src/schemas/intentic-os.ts +2 -2
  549. package/src/schemas/issues.ts +14 -0
  550. package/src/schemas/keep-warm.test.ts +1 -1
  551. package/src/schemas/keep-warm.ts +2 -3
  552. package/src/schemas/keyring-native.test.ts +11 -3
  553. package/src/schemas/keyring-native.ts +3 -1
  554. package/src/schemas/keyring.ts +6 -1
  555. package/src/schemas/members.ts +4 -16
  556. package/src/schemas/metrics.test.ts +9 -1
  557. package/src/schemas/metrics.ts +8 -0
  558. package/src/schemas/needs.ts +68 -5
  559. package/src/schemas/offload.ts +6 -3
  560. package/src/schemas/ports.ts +5 -0
  561. package/src/schemas/providers/handoff.test.ts +8 -10
  562. package/src/schemas/providers/handoff.ts +11 -12
  563. package/src/schemas/providers/provider-oauth.ts +10 -2
  564. package/src/schemas/providers/refusals.ts +9 -0
  565. package/src/schemas/providers/switched.test.ts +6 -6
  566. package/src/schemas/providers/switched.ts +1 -1
  567. package/src/schemas/queued-trial-retry.ts +14 -0
  568. package/src/schemas/remote-access.ts +143 -0
  569. package/src/schemas/run-targets.ts +2 -1
  570. package/src/schemas/runner-views.ts +27 -0
  571. package/src/schemas/sandbox-reach.ts +161 -0
  572. package/src/schemas/seal.ts +2 -1
  573. package/src/schemas/settings.test.ts +5 -4
  574. package/src/schemas/settings.ts +54 -10
  575. package/src/schemas/state-plan.test.ts +1 -1
  576. package/src/schemas/state-plan.ts +2 -2
  577. package/src/schemas/system.ts +16 -1
  578. package/src/schemas/terminal.ts +87 -1
  579. package/src/schemas/updates.test.ts +1 -1
  580. package/src/schemas/updates.ts +1 -1
  581. package/src/state/auth-state.ts +6 -0
  582. package/src/state/runtime-state.test.ts +3 -2
  583. package/src/state/runtime-state.ts +7 -1
  584. package/src/state/update-probation.ts +1 -1
  585. package/src/state/ways-back.test.ts +1 -1
  586. package/src/state/workspace-state.test.ts +2 -0
  587. package/src/state/workspace-state.ts +4 -4
  588. package/src/sync/workspace-sync-ignores.test.ts +48 -0
  589. package/src/sync/workspace-sync-ignores.ts +143 -0
  590. package/src/text/land-rows.ts +13 -18
  591. package/src/text/notice-rows.ts +6 -6
  592. package/src/text/pages.ts +34 -7
  593. package/src/text/transcript-fold.test.ts +77 -39
  594. package/src/text/transcript-fold.ts +2 -2
@@ -10,7 +10,9 @@ import { LoopStateSchema } from "./loops.js";
10
10
  import { LimitPolicySchema, MemoryKillPolicySchema, RetryPolicySchema, RoomPolicySchema, TurnBreakPolicySchema, TurnBreakSchema } from "./turn-break.js";
11
11
  import { KeepWarmSchema } from "./keep-warm.js";
12
12
  import { proceedOverride } from "./proceed-without-asking.js";
13
+ import { autoApproveMark } from "./auto-approve.js";
13
14
  import { AgentNeedSchema } from "./needs.js";
15
+ import { AgentJobsSchema, AgentScriptRunsSchema, AgentWatchesSchema } from "./agent-background.js";
14
16
  import { StrandedCloneSchema } from "./stranded-clone.js";
15
17
  import { EMOJI_MAX_LENGTH, isSingleEmoji } from "../text/emoji.js";
16
18
  import { ProgramAskSchema } from "../events/requests.js";
@@ -84,6 +86,9 @@ export type AgentActivity = z.infer<typeof AgentActivitySchema>;
84
86
  export const AgentChecklistSchema = z.object({
85
87
  done: z.number().describe("Items it has completed."),
86
88
  total: z.number().describe("Items on the list. Never zero: a conversation that kept no list carries no clause at all."),
89
+ // Optional because only the live list knows it: the reading kept across a daemon restart (`unfinished.steps`)
90
+ // counts what was left open, not what was in hand.
91
+ doing: z.number().optional().describe("Items it has marked in progress and not yet completed. Absent when nothing is, or when the list was read back after a restart."),
87
92
  });
88
93
  export type AgentChecklist = z.infer<typeof AgentChecklistSchema>;
89
94
  // Which "needs you" flags are raised, the fleet badge aggregates these across all agents.
@@ -376,6 +381,8 @@ export const AgentSummarySchema = z.object({
376
381
  "This conversation's own answer to a turn the sandbox killed because it ran out of memory: `resume` sends it again by itself once memory has stayed free, `wait` holds it for a press. Absent means it follows the sandbox-wide setting.",
377
382
  ),
378
383
  proceedWithoutAsking: proceedOverride,
384
+ // Not a posture: kept with the conversation's other yeses (schemas/auto-approve.ts), projected so the card can wear it.
385
+ autoApprove: autoApproveMark,
379
386
  // A collaborator's ask to land (collaborators can't merge themselves); cleared by whichever merge or discard
380
387
  // answers it.
381
388
  landRequested: z
@@ -716,22 +723,8 @@ export const AgentSummarySchema = z.object({
716
723
  .describe(
717
724
  "Whether this conversation runs again by itself with nobody pressing anything: a watch is armed on it, or words the sandbox or another agent sent wait for it. A finished-looking card that is awaiting a wake is not finished yet.",
718
725
  ),
719
- // Outside conditions a conversation is parked on; a finished-looking card can restart itself when one fires, and an
720
- // armed watch keeps a hosted machine (and its bill) awake. The check command itself never rides the wire, since it
721
- // may hold a secret.
722
- watches: z
723
- .array(
724
- z.object({
725
- id: z.string().describe("The daemon's handle for this watch, the same one the agent was given when it armed it."),
726
- note: z.string().describe("The agent's own line on what it is waiting for."),
727
- intervalSeconds: z.number().int().min(1).describe("How often the check runs."),
728
- deadlineAt: z.number().describe("When it gives up and wakes the conversation anyway, in milliseconds. Every watch has one."),
729
- }),
730
- )
731
- .optional()
732
- .describe(
733
- "Outside conditions this conversation is parked on, each of which will wake it. Absent means none, which is nearly every conversation: an armed watch is why a finished-looking agent starts working by itself, and why a hosted machine will not go idle.",
734
- ),
726
+ // Outside conditions a conversation is parked on (agent-background.ts).
727
+ watches: AgentWatchesSchema,
735
728
  // Kept in the needs store, so unlike `jobs` this survives a restart and stands while the conversation is idle.
736
729
  needs: z
737
730
  .array(AgentNeedSchema)
@@ -739,54 +732,9 @@ export const AgentSummarySchema = z.object({
739
732
  .describe(
740
733
  "What it is waiting on people for and has not got yet, oldest first. Absent means nothing: an open need is why an idle-looking agent still needs you.",
741
734
  ),
742
- // In memory only: a daemon restart leaves transcript rows naming jobs this list no longer carries.
743
- jobs: z
744
- .array(
745
- z.object({
746
- id: z.string().describe("The daemon's handle for this job, the one its transcript row names."),
747
- label: z.string().describe("What the job is, in the agent's own words when it gave any, else its command on one line."),
748
- session: z.string().describe("The terminal session its pane runs in, which is what opening it focuses."),
749
- startedAt: z.number().describe("When it started, in milliseconds."),
750
- endedAt: z.number().optional().describe("When the command exited, in milliseconds. Absent while it runs."),
751
- exitCode: z.number().int().optional().describe("The code it exited with. Absent while it runs, or when its exit left none."),
752
- // What the turn that left it running decided about it (agent/tools/jobs/job-fates.ts): one of these, or none
753
- // while its turn is still going.
754
- watch: z
755
- .string()
756
- .optional()
757
- .describe(
758
- "The watch its exit wakes this conversation through. Present once the turn that left it running has ended and the conversation is waiting on it.",
759
- ),
760
- handed: z
761
- .boolean()
762
- .optional()
763
- .describe(
764
- "Left running for the person: the agent kept it for them with the `keep` tool (or it holds a port this conversation already left them), so it outlives the turn, wakes nothing and is theirs to stop.",
765
- ),
766
- ports: z.array(z.number().int()).optional().describe("The ports it was listening on when its turn ended."),
767
- stoppedBy: z
768
- .enum(["turn", "person", "agent"])
769
- .optional()
770
- .describe(
771
- "Who stopped it: the sandbox, when the turn that used it ended without handing it over; a person; or the agent itself. Present from the moment the stop is asked. Absent for a job that exited by itself.",
772
- ),
773
- // agent/tools/jobs/input-wait.ts: told from /proc, never from what it printed, since a prompt can go
774
- // straight to the terminal or sit in a pipe.
775
- inputWait: z
776
- .object({
777
- since: z.number().describe("When it went still, in milliseconds."),
778
- program: z.string().describe("The process blocked reading the terminal, as its command line."),
779
- })
780
- .optional()
781
- .describe(
782
- "Present while it sits blocked reading its terminal with nothing moving: a prompt nobody in the sandbox will answer, which only stopping it or a person typing into its terminal ends. Absent while it runs on, and once it ends.",
783
- ),
784
- }),
785
- )
786
- .optional()
787
- .describe(
788
- "Commands this conversation left running in the background, and how the most recent ones ended. Absent means none since the daemon started. A job is running exactly while it has no end.",
789
- ),
735
+ // Background commands and workflow runs (agent-background.ts): what keeps going beside its turn.
736
+ jobs: AgentJobsSchema,
737
+ scriptRuns: AgentScriptRunsSchema,
790
738
  // Epoch ms it was archived; nothing is lost (branch, transcript, counters stay), and unarchiving re-attaches a
791
739
  // fresh worktree from the branch.
792
740
  archivedAt: z
@@ -818,6 +766,18 @@ export const AgentStopWatchingSchema = AgentIdSchema.extend({
818
766
  watchId: z.string().optional().describe("Which watch to disarm. Absent disarms every watch this conversation is parked on."),
819
767
  });
820
768
 
769
+ // What a person's stop on a card answers (2026-11-23): the card as the press left it, and whether anything stopped. A job
770
+ // that had already ended, a watch that had already fired, or a runner out of reach is `stopped: false` with the reason,
771
+ // never an error: the press was heard, and the card shows what is still going.
772
+ export const AgentStopAnswerSchema = AgentSummarySchema.extend({
773
+ stopped: z.boolean().describe("Whether anything was stopped by this press."),
774
+ stopReason: z
775
+ .string()
776
+ .optional()
777
+ .describe("Why nothing (or not everything) was stopped: it had already ended, or the runner it runs on is out of reach."),
778
+ });
779
+ export type AgentStopAnswer = z.infer<typeof AgentStopAnswerSchema>;
780
+
821
781
  export const AgentStopJobSchema = AgentIdSchema.extend({
822
782
  jobId: z.string().min(1).describe("Which of its background jobs, by the id its card and transcript row carry."),
823
783
  });
@@ -954,4 +914,5 @@ export const AgentFileDiffQuerySchema = z.object({
954
914
  repo: z.string().min(1).describe("Which repository."),
955
915
  path: z.string().min(1).describe("Which file, relative to that repository."),
956
916
  });
957
- export { LandConflictReasonSchema, type LandConflictReason, LandConflictPathSchema, LandConflictSchema, type LandConflict, LandResultSchema, type LandResult, LandModeSchema, type LandMode, AgentSpanSchema, type AgentSpan, AgentLandSchema } from "./agent-land.js";
917
+ export { LandConflictReasonSchema, type LandConflictReason, LandConflictPathSchema, LandConflictSchema, type LandConflict, LandResultSchema, type LandResult, LandModeSchema, type LandMode, AgentSpanSchema, type AgentSpan, AgentLandSchema, LandingExtensionsSchema, type LandingExtensions } from "./agent-land.js";
918
+ export { AgentFamilyStoppedSchema, AgentStopFamilySchema, type AgentFamilyStopped, type AgentScriptRun } from "./agent-background.js";
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+
3
+ // AUTO-APPROVE (2026-11-22). A mark a person puts on a conversation from its card, alone or on several selected at once,
4
+ // so it stops asking them anything a permission card would ask: every such card raised there, or in a subagent it
5
+ // starts, settles as allowed the moment it is raised, until somebody takes the mark off. Wider than a permission card's
6
+ // "Allow everything in this conversation" in two ways: it answers the owner's hard rules too (a destructive command on
7
+ // the sandbox or on one of the owner's computers), and the conversations it starts follow it. It still never answers a
8
+ // card whose consequence reaches other conversations (restarting the sandbox stops their turns too) or one addressed to
9
+ // a named person (a gated credential's approvers), and it never turns a refusal into a yes: what the owner's policy or a
10
+ // device's own switch refuses stays refused. Kept with the other yeses in the conversation grants, off anything an agent
11
+ // can write, and listed under Access ▸ Allowed, where it can be taken back too.
12
+
13
+ /** How a card carries the mark: its own, or followed from the conversation that started it. Absent: neither. */
14
+ export const autoApproveMark = z
15
+ .enum(["own", "inherited"])
16
+ .optional()
17
+ .describe(
18
+ "Whether every permission this conversation asks for is approved without asking anybody, the owner's hard rules included: `own` when it was marked itself, `inherited` when a conversation that started it was. Absent means its permission cards wait for a person as usual.",
19
+ );
20
+ export type AutoApproveMark = z.infer<typeof autoApproveMark>;
21
+
22
+ /** POST /agents/auto-approve: puts the mark on, or takes it off, several conversations at once. */
23
+ export const AgentAutoApproveSchema = z.object({
24
+ ids: z.array(z.string().min(1)).min(1).max(500).describe("Which conversations."),
25
+ on: z
26
+ .boolean()
27
+ .describe(
28
+ "True marks each so its permission cards, and those of the subagents it starts, are approved without asking from now on, cards already waiting included. False takes each one's own mark off; a conversation started by one still marked keeps following that one.",
29
+ ),
30
+ });
31
+ export type AgentAutoApprove = z.infer<typeof AgentAutoApproveSchema>;
@@ -16,6 +16,8 @@ export { WorkspaceEventKindSchema, WorkspaceEventSchema, type WorkspaceEventKind
16
16
  // the sandbox was down still lands, late, on the next poll
17
17
  // event: fires when an external system POSTs /automations/{id}/fire; its auth token lives outside the manifest
18
18
  // (.intentic/secrets/doors.json), never in this versioned, widely-readable file
19
+ // `signature` additionally requires the provider's own signature, its secret named, not held, here; a signed
20
+ // webhook also drops a redelivery of a call it already took (src/automations/fire/webhook-signature.ts)
19
21
  // listener: fires from a realtime source's own connection (an extension's gateway), no cron, no token, never reachable
20
22
  // via /fire. `channelId`/`eventType`/`mentioned` narrow it; absent means unfiltered. `provider`/`eventType` are open
21
23
  // strings validated at upsert against installed extensions' declared vocabulary
@@ -25,6 +27,21 @@ export { WorkspaceEventKindSchema, WorkspaceEventSchema, type WorkspaceEventKind
25
27
  // pushes one branch per agent
26
28
  // workspace: fires from the sandbox's own codebase (WorkspaceEventKindSchema)
27
29
 
30
+ // How a webhook's sender signs what it sends, by the provider's own scheme: github (X-Hub-Signature-256), linear
31
+ // (Linear-Signature), sentry (Sentry-Hook-Signature), stripe (Stripe-Signature) and standard-webhooks
32
+ // (webhook-id/webhook-timestamp/webhook-signature, what Svix, Clerk, Resend and others send).
33
+ export const WEBHOOK_SIGNATURE_SCHEMES = ["github", "linear", "sentry", "stripe", "standard-webhooks"] as const;
34
+ export const WebhookSignatureSchemeSchema = z.enum(WEBHOOK_SIGNATURE_SCHEMES);
35
+ export type WebhookSignatureScheme = z.infer<typeof WebhookSignatureSchemeSchema>;
36
+ export const WebhookSignatureSchema = z.object({
37
+ scheme: WebhookSignatureSchemeSchema.describe("Which provider's signing scheme the sender uses."),
38
+ secret: z
39
+ .string()
40
+ .regex(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/)
41
+ .describe("The name of the sandbox secret holding the signing secret the provider showed, like GITHUB_WEBHOOK_SECRET. The value itself is never stored here."),
42
+ });
43
+ export type WebhookSignature = z.infer<typeof WebhookSignatureSchema>;
44
+
28
45
  export const TriggerSchema = z.discriminatedUnion("kind", [
29
46
  z.object({
30
47
  kind: z.literal("schedule").describe("On a clock."),
@@ -64,6 +81,11 @@ export const TriggerSchema = z.discriminatedUnion("kind", [
64
81
  .positive()
65
82
  .optional()
66
83
  .describe("How many webhook calls a day may wake the agent, across every caller. Absent is a modest default rather than unlimited."),
84
+ // Added 2026-11-24, optional: a webhook that also proves its sender. The secret's VALUE stays in the sandbox's
85
+ // secrets store (never this versioned file); only its name is kept here.
86
+ signature: WebhookSignatureSchema.optional().describe(
87
+ "Require the sender's own signature on every call, on top of the webhook's token, and drop redeliveries of a call already taken. Absent accepts any call that carries the token.",
88
+ ),
67
89
  }),
68
90
  z.object({
69
91
  kind: z.literal("listener").describe("When a message arrives from somewhere outside."),
@@ -513,7 +535,10 @@ export const AutomationRunSchema = z.object({
513
535
  // error: the guard passed but the turn errored
514
536
  // interrupted: the daemon died mid-wake; without this value an interrupted fire vanishes from history and reads as
515
537
  // never having fired
516
- outcome: z.enum(["completed", "skipped", "error", "interrupted"]),
538
+ // carried: the turn was refused for a spent allowance and the sandbox carried it on by itself, moved to the next
539
+ // model or booked to go again at the reset (its detail says which). Not a failure: 2026-11-25, these were recorded as
540
+ // `error`, painted red and counted toward switching the automation off, against automationFailureLimit's own word
541
+ outcome: z.enum(["completed", "skipped", "error", "interrupted", "carried"]),
517
542
  detail: z.string().optional(),
518
543
  // Absent only for a run skipped before a conversation was needed.
519
544
  conversationId: z.string().optional(),
@@ -0,0 +1,79 @@
1
+ // bookmarks: the pages a browser profile keeps on purpose, in folders, in the order the person put them. One tree per
2
+ // profile, like the history beside it (schemas/browsing.ts); the person's own window's is `_own`.
3
+ import { z } from "zod";
4
+ import { BrowsingProfileSchema } from "./browsing.js";
5
+
6
+ // The two folders every tree has and nobody removes: the bar under the toolbar, and everything else.
7
+ export const BOOKMARK_ROOTS = ["bar", "other"] as const;
8
+ export type BookmarkRoot = (typeof BOOKMARK_ROOTS)[number];
9
+
10
+ // A site's icon as a tab carried it: a small picture in a data: URL, never an address to fetch.
11
+ const FaviconSchema = z
12
+ .string()
13
+ .max(64 * 1024)
14
+ .regex(/^data:image\//)
15
+ .describe("The site's icon as a data: URL, as the tab carried it when the page was kept.");
16
+
17
+ export const BookmarkNodeSchema = z.object({
18
+ id: z.string().describe("The bookmark's or folder's id, stable for its life: what editing, moving and removing take."),
19
+ kind: z.enum(["url", "folder"]).describe("A page, or a folder of them."),
20
+ title: z.string().describe("What it is called: a page's title as kept or renamed, or the folder's name."),
21
+ url: z.string().optional().describe("Where a page bookmark goes. Absent for a folder."),
22
+ parent: z.string().optional().describe("The folder it is in. Absent only for the two roots, `bar` and `other`."),
23
+ added: z.number().describe("When it was added, in milliseconds."),
24
+ favicon: FaviconSchema.optional(),
25
+ });
26
+ export type BookmarkNode = z.infer<typeof BookmarkNodeSchema>;
27
+
28
+ export const BookmarksQuerySchema = z.object({ profile: BrowsingProfileSchema });
29
+ export type BookmarksQuery = z.infer<typeof BookmarksQuerySchema>;
30
+
31
+ export const BookmarksSchema = z.object({
32
+ profile: z.string().describe("Whose bookmarks these are."),
33
+ nodes: z
34
+ .array(BookmarkNodeSchema)
35
+ .describe("Every folder and bookmark, the two roots first, each folder's contents in their order after it (depth first)."),
36
+ });
37
+ export type Bookmarks = z.infer<typeof BookmarksSchema>;
38
+
39
+ const TitleSchema = z.string().max(500);
40
+ const UrlSchema = z.string().min(1).max(4096);
41
+
42
+ export const BookmarkAddSchema = z.object({
43
+ profile: BrowsingProfileSchema,
44
+ kind: z.enum(["url", "folder"]).describe("A page, or a new folder."),
45
+ title: TitleSchema.describe("Its name: the page's title for a page, or the new folder's."),
46
+ url: UrlSchema.optional().describe("The page's address; required for a page, ignored for a folder."),
47
+ parent: z.string().optional().describe("The folder to put it in. Absent puts it on the bookmarks bar."),
48
+ index: z.number().int().nonnegative().optional().describe("Where in that folder, counting from 0. Absent puts it last."),
49
+ favicon: FaviconSchema.optional(),
50
+ });
51
+ export type BookmarkAdd = z.infer<typeof BookmarkAddSchema>;
52
+
53
+ export const BookmarkEditSchema = z.object({
54
+ profile: BrowsingProfileSchema,
55
+ id: z.string().describe("Which bookmark or folder."),
56
+ title: TitleSchema.optional().describe("Its new name. Absent keeps it."),
57
+ url: UrlSchema.optional().describe("A page's new address. Absent keeps it; ignored for a folder."),
58
+ parent: z.string().optional().describe("A folder to move it into, at the end. Absent keeps it where it is."),
59
+ });
60
+ export type BookmarkEdit = z.infer<typeof BookmarkEditSchema>;
61
+
62
+ export const BookmarkMoveSchema = z.object({
63
+ profile: BrowsingProfileSchema,
64
+ id: z.string().describe("Which bookmark or folder."),
65
+ parent: z.string().describe("The folder it goes into, which may be the one it is in."),
66
+ index: z.number().int().nonnegative().describe("Its place there, counting from 0, among what the folder holds without it."),
67
+ });
68
+ export type BookmarkMove = z.infer<typeof BookmarkMoveSchema>;
69
+
70
+ export const BookmarkRemoveSchema = z.object({
71
+ profile: BrowsingProfileSchema,
72
+ id: z.string().describe("Which bookmark, or which folder: a folder goes with everything in it."),
73
+ });
74
+ export type BookmarkRemove = z.infer<typeof BookmarkRemoveSchema>;
75
+
76
+ export const BookmarkChangedSchema = z.object({
77
+ node: BookmarkNodeSchema.optional().describe("The bookmark or folder as it now stands. Absent after a removal."),
78
+ });
79
+ export type BookmarkChanged = z.infer<typeof BookmarkChangedSchema>;
@@ -0,0 +1,33 @@
1
+ // The desktop git bridge's view of a sandbox's repositories, on the ports list it already polls.
2
+ import { z } from "zod";
3
+ import { PortsListSchema } from "./ports.js";
4
+
5
+ // (2026-11-24) What the desktop git bridge used to ask over a fresh SSH login per repo every five seconds
6
+ // (`git ls-remote --symref sandbox HEAD`, plus an `ls /history/gits` every minute): two logins a second into a
7
+ // ten-repo sandbox. Answered on GET /ports from the git dirs' files instead, on the poll the device already makes.
8
+ // Kept out of schemas/ports, which extensions read under the extension API's version (extension-api/src/wire.ts): an
9
+ // extension has no use for it, and its parse of the list drops the field.
10
+ export const BridgeHeadSchema = z.object({
11
+ repo: z.string().min(1).describe("The repository, as its git dir under /history/gits is named, decoded."),
12
+ branch: z.string().min(1).optional().describe("The branch its HEAD names. Absent for a detached HEAD, which has no branch to follow."),
13
+ tip: z
14
+ .string()
15
+ .regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/)
16
+ .optional()
17
+ .describe("The commit that branch points at. Absent while the branch has no commits yet."),
18
+ probe: z
19
+ .literal(true)
20
+ .optional()
21
+ .describe("Set when the sandbox could not read the head off its files (a ref format it does not parse): ask git over SSH instead."),
22
+ });
23
+ export type BridgeHead = z.infer<typeof BridgeHeadSchema>;
24
+
25
+ // The ports list as GET /ports answers it. `bridgeHeads` goes only to a desktop-sync caller (the `x-intentic-sync`
26
+ // header), and is absent from a sandbox from before 2026-11-24, whose device then keeps asking over SSH.
27
+ export const SyncPortsListSchema = PortsListSchema.extend({
28
+ bridgeHeads: z
29
+ .array(BridgeHeadSchema)
30
+ .optional()
31
+ .describe("Every repository's checked-out branch and its tip, for a paired computer's git bridge. Sent only to a desktop-sync caller."),
32
+ });
33
+ export type SyncPortsList = z.infer<typeof SyncPortsListSchema>;
@@ -0,0 +1,164 @@
1
+ import { z } from "zod";
2
+
3
+ // What a browser window does besides showing pages, which a desktop browser draws in its own chrome and the picture of
4
+ // one never shows: its downloads, the file a page asks for, the permission a site asks for, and the tools around a page
5
+ // (print, its source, DevTools). The daemon holds each (browser/downloads, uploads, permissions, devtools); the window's
6
+ // state carries what is pending, and the routes in contracts/browser.contract.ts answer it.
7
+
8
+ export const BrowserDownloadSchema = z.object({
9
+ id: z.string().describe("Stable for the life of the download: what the routes below take."),
10
+ name: z.string().describe("The file's name, as the site suggested it."),
11
+ url: z.string().describe("Where it came from. A printed page is the page's own address."),
12
+ state: z
13
+ .enum(["progress", "done", "canceled", "failed"])
14
+ .describe("Still arriving, finished, stopped by you, or broken off by the browser or the site."),
15
+ receivedBytes: z.number().describe("How much has arrived so far."),
16
+ totalBytes: z.number().optional().describe("How big it is, when the site said. Absent for a size nobody announced."),
17
+ startedAt: z.number().describe("When it started, in milliseconds."),
18
+ finishedAt: z.number().optional().describe("When it finished, failed or was stopped, in milliseconds."),
19
+ });
20
+ export type BrowserDownload = z.infer<typeof BrowserDownloadSchema>;
21
+
22
+ // A page's <input type=file> asking for files. Chromium's own dialog would open on the sandbox's disk, so the daemon
23
+ // holds the ask instead, and the person's own file picker answers it.
24
+ export const BrowserFileChooserSchema = z.object({
25
+ id: z.string().describe("Which ask this is: what the answer names."),
26
+ pageId: z.string().describe("Which page asked."),
27
+ multiple: z.boolean().describe("The page takes several files at once."),
28
+ accept: z
29
+ .array(z.string())
30
+ .optional()
31
+ .describe("What the page says it takes: extensions (.pdf) and media types (image/*), as its accept attribute lists them."),
32
+ });
33
+ export type BrowserFileChooser = z.infer<typeof BrowserFileChooserSchema>;
34
+
35
+ // The permissions a site can ask a person for, the ones this browser answers.
36
+ export const BrowserPermissionSchema = z.enum(["notifications", "geolocation", "camera", "microphone", "clipboard-read"]);
37
+ export type BrowserPermission = z.infer<typeof BrowserPermissionSchema>;
38
+ export const BROWSER_PERMISSIONS = BrowserPermissionSchema.options;
39
+
40
+ // A site's standing answer for one permission: allowed, blocked, or asked each time (nothing decided).
41
+ export const PermissionSettingSchema = z.enum(["allow", "block", "ask"]);
42
+ export type PermissionSetting = z.infer<typeof PermissionSettingSchema>;
43
+
44
+ export const BrowserPermissionAskSchema = z.object({
45
+ id: z.string().describe("Which ask this is: what the answer names."),
46
+ pageId: z.string().describe("Which page asked."),
47
+ origin: z.string().describe("The site asking, as scheme://host[:port]: what a decision is remembered for."),
48
+ permission: BrowserPermissionSchema.describe("What it asks for."),
49
+ // Camera and microphone: there is no device in the sandbox, so the page was told so at once and this only says it.
50
+ unavailable: z
51
+ .literal(true)
52
+ .optional()
53
+ .describe("The sandbox has nothing to give: no camera or microphone. The page was already told no; this says it happened."),
54
+ });
55
+ export type BrowserPermissionAsk = z.infer<typeof BrowserPermissionAskSchema>;
56
+
57
+ const WindowParams = { name: z.string().describe("Which browser window.") };
58
+
59
+ export const DownloadIdParamSchema = z.object({ id: z.string().describe("Which download.") });
60
+
61
+ export const DownloadTicketSchema = z.object({
62
+ ticket: z.string().describe("Opens the download's file once, for a few minutes, at the browser downloads file route."),
63
+ expiresAt: z.number().describe("When the ticket stops working, in milliseconds."),
64
+ });
65
+
66
+ export const SaveDownloadInputSchema = z.object({
67
+ id: z.string().describe("Which download."),
68
+ folder: z
69
+ .string()
70
+ .optional()
71
+ .describe("The workspace folder to save it in, relative to the workspace root. Absent saves into `downloads/`, made if missing."),
72
+ });
73
+ export const SaveDownloadResultSchema = z.object({
74
+ path: z.string().describe("Where it was saved, relative to the workspace root. A name already taken gets a number added."),
75
+ });
76
+
77
+ export const AnswerFileChooserInputSchema = z.object({
78
+ ...WindowParams,
79
+ chooser: z.string().describe("Which ask: the file chooser's id from the window's state."),
80
+ uploads: z
81
+ .array(z.string())
82
+ .optional()
83
+ .describe("The uploads to hand the page, by the ids they were uploaded under. Absent or empty cancels, as closing the picker does."),
84
+ });
85
+
86
+ export const DropFilesInputSchema = z.object({
87
+ ...WindowParams,
88
+ pageId: z.string().describe("The page they were dropped on."),
89
+ x: z.number().describe("Where, in the page's own CSS pixels from its top-left corner."),
90
+ y: z.number().describe("Where, in the page's own CSS pixels from its top-left corner."),
91
+ uploads: z.array(z.string()).min(1).describe("The uploads dropped, by the ids they were uploaded under."),
92
+ });
93
+
94
+ export const GeolocationSchema = z.object({
95
+ latitude: z.number().min(-90).max(90),
96
+ longitude: z.number().min(-180).max(180),
97
+ accuracy: z.number().min(0).describe("How sure, in metres."),
98
+ });
99
+ export type Geolocation = z.infer<typeof GeolocationSchema>;
100
+
101
+ export const AnswerPermissionInputSchema = z.object({
102
+ ...WindowParams,
103
+ ask: z.string().describe("Which ask: its id from the window's state."),
104
+ setting: z.enum(["allow", "block"]).describe("The answer, remembered for the site."),
105
+ location: GeolocationSchema.optional().describe("Your own location, for a site allowed to know it: what the page is then told it is."),
106
+ });
107
+
108
+ export const SiteQuerySchema = z.object({
109
+ ...WindowParams,
110
+ origin: z.string().describe("The site, as scheme://host[:port]."),
111
+ });
112
+
113
+ export const SitePermissionsSchema = z.object({
114
+ origin: z.string().describe("The site."),
115
+ permissions: z
116
+ .array(z.object({ permission: BrowserPermissionSchema, setting: PermissionSettingSchema }))
117
+ .describe("Every permission this browser answers, with the site's standing answer for each."),
118
+ location: z.boolean().describe("Your location is shared with this window, for the sites allowed it."),
119
+ });
120
+ export type SitePermissions = z.infer<typeof SitePermissionsSchema>;
121
+
122
+ export const SetSitePermissionInputSchema = z.object({
123
+ ...WindowParams,
124
+ origin: z.string().describe("The site, as scheme://host[:port]."),
125
+ permission: BrowserPermissionSchema,
126
+ setting: PermissionSettingSchema.describe("Allow, block, or ask again next time."),
127
+ location: GeolocationSchema.optional().describe("Your own location, when allowing a site to know it."),
128
+ });
129
+
130
+ export const BrowserPageToolInputSchema = z.object({
131
+ ...WindowParams,
132
+ pageId: z.string().describe("Which tab."),
133
+ });
134
+
135
+ export const ViewSourceResultSchema = z.object({
136
+ pageId: z.string().optional().describe("The tab the source opened in, once the window lists it."),
137
+ });
138
+
139
+ export const DevToolsResultSchema = z.object({
140
+ path: z
141
+ .string()
142
+ .describe(
143
+ "Where Chromium's own DevTools for the page are served, relative to the sandbox's address: a frame opens it as is. Carries its own ticket, so it works without a header.",
144
+ ),
145
+ socket: z
146
+ .string()
147
+ .describe("The page's DevTools socket, relative to the sandbox's address: what the frontend is told to connect to (its `ws=` or `wss=`)."),
148
+ expiresAt: z.number().describe("When the ticket stops working, in milliseconds."),
149
+ });
150
+
151
+ // A recording of a window's picture under way (browser/media/recordings.ts in the daemon): castd's own H.264 stream
152
+ // rewrapped as an MP4, nothing encoded again, listed with the window's downloads once it stops.
153
+ export const BrowserRecordingSchema = z.object({
154
+ startedAt: z.number().describe("When it started, in milliseconds."),
155
+ maxSeconds: z.number().describe("The longest it runs: it stops by itself then, and is listed with the downloads all the same."),
156
+ });
157
+ export type BrowserRecording = z.infer<typeof BrowserRecordingSchema>;
158
+
159
+ export const BrowserWindowInputSchema = z.object(WindowParams);
160
+
161
+ export const BrowserUploadQuerySchema = z.object({
162
+ id: z.string().regex(/^[A-Za-z0-9_-]{8,64}$/u).describe("An id the uploader picks, the same for every part of one file."),
163
+ name: z.string().min(1).max(255).describe("The file's own name, which the page sees."),
164
+ });
@@ -0,0 +1,129 @@
1
+ // browsing: what the sandbox's browsers remember of where they went (an index per browser profile), and the search
2
+ // engine's suggestions for what is being typed into the address bar. The address bar itself is drawn and ranked in the
3
+ // editor; these are the two things it cannot know on its own.
4
+ import { z } from "zod";
5
+
6
+ // The search engines the address bar can send a query to. Brave is the default: an index of its own, no account.
7
+ export const SEARCH_ENGINES = ["brave", "google", "duckduckgo", "bing", "kagi"] as const;
8
+ export const SearchEngineSchema = z.enum(SEARCH_ENGINES);
9
+ export type SearchEngine = z.infer<typeof SearchEngineSchema>;
10
+ export const DEFAULT_SEARCH_ENGINE: SearchEngine = "brave";
11
+
12
+ // Where each engine takes a query, and how a results page names it: the editor builds the address from `search`, and the
13
+ // sandbox reads a visited results page back into a search term with `host` and `param`.
14
+ export interface SearchEngineInfo {
15
+ readonly name: string;
16
+ // The query, URL-encoded, goes on the end.
17
+ readonly search: string;
18
+ readonly host: string;
19
+ // The query parameter a results page carries the search in.
20
+ readonly param: string;
21
+ }
22
+
23
+ export const SEARCH_ENGINE_INFO = {
24
+ brave: { name: "Brave", search: "https://search.brave.com/search?q=", host: "search.brave.com", param: "q" },
25
+ google: { name: "Google", search: "https://www.google.com/search?q=", host: "www.google.com", param: "q" },
26
+ duckduckgo: { name: "DuckDuckGo", search: "https://duckduckgo.com/?q=", host: "duckduckgo.com", param: "q" },
27
+ bing: { name: "Bing", search: "https://www.bing.com/search?q=", host: "www.bing.com", param: "q" },
28
+ kagi: { name: "Kagi", search: "https://kagi.com/search?q=", host: "kagi.com", param: "q" },
29
+ } as const satisfies Readonly<Record<SearchEngine, SearchEngineInfo>>;
30
+
31
+ // A browser profile's key: `_own` for the person's own window, `web` for the agents' credential-free browser, or a
32
+ // signed-in account's id. One index per profile; the person's own history is `_own`'s alone.
33
+ export const OWN_BROWSING_PROFILE = "_own";
34
+ export const BrowsingProfileSchema = z
35
+ .string()
36
+ .regex(/^[\w.-]{1,80}$/)
37
+ .describe("Which browser's history: `_own` for your own window, `web` for the agents' browser, or a signed-in account's id.");
38
+
39
+ export const BrowsingEntrySchema = z.object({
40
+ url: z.string().describe("The page's address, as the browser committed it."),
41
+ title: z.string().optional().describe("The page's title when last seen. Absent for a page that never gave one."),
42
+ visits: z.number().int().nonnegative().describe("How many times it was visited."),
43
+ typed: z.number().int().nonnegative().describe("How many of those visits were typed into the address bar rather than reached by a link."),
44
+ last: z.number().describe("When it was last visited, in milliseconds."),
45
+ frecency: z
46
+ .number()
47
+ .nonnegative()
48
+ .describe("How much it is worth suggesting: how often and how recently it was visited, typed visits counting more. Only comparable within one answer."),
49
+ });
50
+ export type BrowsingEntry = z.infer<typeof BrowsingEntrySchema>;
51
+
52
+ export const BrowsingTermSchema = z.object({
53
+ term: z.string().describe("What was searched for."),
54
+ count: z.number().int().positive().describe("How many times."),
55
+ last: z.number().describe("When it was last searched for, in milliseconds."),
56
+ });
57
+ export type BrowsingTerm = z.infer<typeof BrowsingTermSchema>;
58
+
59
+ export const BrowsingHistoryQuerySchema = z.object({
60
+ profile: BrowsingProfileSchema,
61
+ since: z
62
+ .string()
63
+ .max(200)
64
+ .optional()
65
+ .describe("The cursor a previous answer gave, to be told only what changed after it. Absent, or one the sandbox no longer recognises, answers the whole index."),
66
+ });
67
+ export type BrowsingHistoryQuery = z.infer<typeof BrowsingHistoryQuerySchema>;
68
+
69
+ export const BrowsingHistorySchema = z.object({
70
+ profile: z.string().describe("Whose history this is."),
71
+ cursor: z.string().describe("Hand this back as `since` to be told only what changes after this answer."),
72
+ full: z.boolean().describe("True when this is the whole index, which replaces whatever the caller held; false when it is only what changed since the cursor given."),
73
+ entries: z
74
+ .array(BrowsingEntrySchema)
75
+ .describe("The pages: on a full answer the most worth suggesting, best first and at most a few thousand; otherwise each page added or changed since the cursor."),
76
+ removed: z.array(z.string()).describe("Addresses forgotten since the cursor. Always empty on a full answer."),
77
+ terms: z.array(BrowsingTermSchema).describe("Searches made, most recent first: every one on a full answer, otherwise those added or changed since the cursor."),
78
+ profiles: z.array(z.string()).describe("Every profile the sandbox holds a history for, so a history page can offer the others."),
79
+ });
80
+ export type BrowsingHistory = z.infer<typeof BrowsingHistorySchema>;
81
+
82
+ // What to forget: some addresses, everything visited in a stretch of time, or all of it. Spelled out rather than inferred
83
+ // from which fields are present, so a call that forgot its arguments cannot clear everything by accident.
84
+ export const BrowsingForgetSchema = z.discriminatedUnion("kind", [
85
+ z.object({
86
+ kind: z.literal("urls"),
87
+ urls: z.array(z.string()).min(1).max(1000).describe("The addresses to forget, exactly as the history lists them."),
88
+ }),
89
+ z.object({
90
+ kind: z.literal("range"),
91
+ from: z.number().describe("The start of the stretch, in milliseconds, included."),
92
+ to: z.number().describe("Its end, in milliseconds, excluded."),
93
+ }),
94
+ z.object({ kind: z.literal("all") }),
95
+ ]);
96
+ export type BrowsingForget = z.infer<typeof BrowsingForgetSchema>;
97
+
98
+ export const BrowsingForgetInputSchema = z.object({
99
+ profile: BrowsingProfileSchema,
100
+ forget: BrowsingForgetSchema.describe("What to forget."),
101
+ });
102
+ export type BrowsingForgetInput = z.infer<typeof BrowsingForgetInputSchema>;
103
+
104
+ export const BrowsingForgetResultSchema = z.object({
105
+ removed: z.number().int().nonnegative().describe("How many addresses left the history entirely."),
106
+ });
107
+ export type BrowsingForgetResult = z.infer<typeof BrowsingForgetResultSchema>;
108
+
109
+ export const SearchSuggestQuerySchema = z.object({
110
+ q: z.string().min(1).max(200).describe("What has been typed so far."),
111
+ engine: SearchEngineSchema.describe("Whose suggestions: the search engine the address bar sends queries to."),
112
+ });
113
+ export type SearchSuggestQuery = z.infer<typeof SearchSuggestQuerySchema>;
114
+
115
+ export const SearchSuggestionsSchema = z.object({
116
+ q: z.string().describe("The text these suggestions are for, so a late answer can be told from a current one."),
117
+ suggestions: z.array(z.string()).describe("What the engine suggests searching for, best first. Empty when it had nothing, or did not answer in time."),
118
+ });
119
+ export type SearchSuggestions = z.infer<typeof SearchSuggestionsSchema>;
120
+
121
+ // Whether an agent's turn is recorded as it drives a browser window, kept with the conversation's artifacts (the
122
+ // daemon's browser/media/recordings.ts, read at the turn's browser calls). Off by default: every turn's browsing kept as
123
+ // video is disk nobody asked for.
124
+ export const RecordAgentBrowsingSchema = z
125
+ .boolean()
126
+ .default(false)
127
+ .describe(
128
+ "Record the browser window as an agent's turn drives it, and keep the video with that conversation's artifacts. Only windows the sandbox streams the new way are recorded, and without sound.",
129
+ );