@intentic/sandbox-contract 1.325.0 → 1.327.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 (537) hide show
  1. package/README.md +24 -12
  2. package/dist/chores/chores.d.ts.map +1 -1
  3. package/dist/chores/chores.js +29 -20
  4. package/dist/chores/chores.js.map +1 -1
  5. package/dist/chores/probes.d.ts +1 -0
  6. package/dist/chores/probes.d.ts.map +1 -1
  7. package/dist/chores/probes.js +81 -12
  8. package/dist/chores/probes.js.map +1 -1
  9. package/dist/contracts/agent.contract.d.ts +1467 -6
  10. package/dist/contracts/agent.contract.d.ts.map +1 -1
  11. package/dist/contracts/agent.contract.js +2 -2
  12. package/dist/contracts/agent.contract.js.map +1 -1
  13. package/dist/contracts/agents.contract.d.ts +1391 -0
  14. package/dist/contracts/agents.contract.d.ts.map +1 -1
  15. package/dist/contracts/agents.contract.js +1 -1
  16. package/dist/contracts/automations.contract.d.ts +123 -4
  17. package/dist/contracts/automations.contract.d.ts.map +1 -1
  18. package/dist/contracts/automations.contract.js +13 -2
  19. package/dist/contracts/automations.contract.js.map +1 -1
  20. package/dist/contracts/capabilities.contract.d.ts +79 -8
  21. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  22. package/dist/contracts/chores.contract.d.ts +2 -0
  23. package/dist/contracts/chores.contract.d.ts.map +1 -1
  24. package/dist/contracts/ci.contract.d.ts +2 -0
  25. package/dist/contracts/ci.contract.d.ts.map +1 -1
  26. package/dist/contracts/device.contract.d.ts +52 -0
  27. package/dist/contracts/device.contract.d.ts.map +1 -1
  28. package/dist/contracts/device.contract.js +2 -0
  29. package/dist/contracts/device.contract.js.map +1 -1
  30. package/dist/contracts/endpoints.contract.d.ts +42 -33
  31. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  32. package/dist/contracts/endpoints.contract.js +17 -7
  33. package/dist/contracts/endpoints.contract.js.map +1 -1
  34. package/dist/contracts/extensions.contract.d.ts +192 -0
  35. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  36. package/dist/contracts/extensions.contract.js +37 -1
  37. package/dist/contracts/extensions.contract.js.map +1 -1
  38. package/dist/contracts/needs.contract.d.ts +1009 -0
  39. package/dist/contracts/needs.contract.d.ts.map +1 -1
  40. package/dist/contracts/pages.contract.d.ts +34 -0
  41. package/dist/contracts/pages.contract.d.ts.map +1 -0
  42. package/dist/contracts/pages.contract.js +49 -0
  43. package/dist/contracts/pages.contract.js.map +1 -0
  44. package/dist/contracts/phone.contract.d.ts +78 -0
  45. package/dist/contracts/phone.contract.d.ts.map +1 -0
  46. package/dist/contracts/phone.contract.js +11 -0
  47. package/dist/contracts/phone.contract.js.map +1 -0
  48. package/dist/contracts/privacy.contract.d.ts +20 -0
  49. package/dist/contracts/privacy.contract.d.ts.map +1 -1
  50. package/dist/contracts/privacy.contract.js +12 -2
  51. package/dist/contracts/privacy.contract.js.map +1 -1
  52. package/dist/contracts/runner.contract.d.ts +648 -127
  53. package/dist/contracts/runner.contract.d.ts.map +1 -1
  54. package/dist/contracts/runner.contract.js +1 -1
  55. package/dist/contracts/runner.contract.js.map +1 -1
  56. package/dist/contracts/secrets.contract.d.ts +88 -0
  57. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  58. package/dist/contracts/secrets.contract.js +20 -1
  59. package/dist/contracts/secrets.contract.js.map +1 -1
  60. package/dist/contracts/sessions.contract.d.ts +184 -0
  61. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  62. package/dist/contracts/settings.contract.d.ts +16 -58
  63. package/dist/contracts/settings.contract.d.ts.map +1 -1
  64. package/dist/contracts/settings.contract.js +10 -1
  65. package/dist/contracts/settings.contract.js.map +1 -1
  66. package/dist/contracts/system.contract.d.ts +227 -32
  67. package/dist/contracts/system.contract.d.ts.map +1 -1
  68. package/dist/contracts/system.contract.js +18 -1
  69. package/dist/contracts/system.contract.js.map +1 -1
  70. package/dist/documents/conversions.d.ts.map +1 -1
  71. package/dist/documents/conversions.js +2 -1
  72. package/dist/documents/conversions.js.map +1 -1
  73. package/dist/documents/read.d.ts.map +1 -1
  74. package/dist/documents/read.js +4 -4
  75. package/dist/documents/read.js.map +1 -1
  76. package/dist/events/agent-events.d.ts +747 -1
  77. package/dist/events/agent-events.d.ts.map +1 -1
  78. package/dist/events/agent-events.js +14 -1
  79. package/dist/events/agent-events.js.map +1 -1
  80. package/dist/events/requests.d.ts +40 -0
  81. package/dist/events/requests.d.ts.map +1 -1
  82. package/dist/events/requests.js +39 -0
  83. package/dist/events/requests.js.map +1 -1
  84. package/dist/events/system-events.d.ts +120 -0
  85. package/dist/events/system-events.d.ts.map +1 -1
  86. package/dist/events/transcript.d.ts +1131 -1
  87. package/dist/events/transcript.d.ts.map +1 -1
  88. package/dist/events/transcript.js +9 -1
  89. package/dist/events/transcript.js.map +1 -1
  90. package/dist/ids/hostnames.d.ts +2 -0
  91. package/dist/ids/hostnames.d.ts.map +1 -1
  92. package/dist/ids/hostnames.js +18 -15
  93. package/dist/ids/hostnames.js.map +1 -1
  94. package/dist/ids/sandbox-id.d.ts +2 -0
  95. package/dist/ids/sandbox-id.d.ts.map +1 -0
  96. package/dist/ids/sandbox-id.js +2 -0
  97. package/dist/ids/sandbox-id.js.map +1 -0
  98. package/dist/ids/tunnel-ids.d.ts +1 -1
  99. package/dist/ids/tunnel-ids.d.ts.map +1 -1
  100. package/dist/ids/tunnel-ids.js +1 -1
  101. package/dist/ids/tunnel-ids.js.map +1 -1
  102. package/dist/index.d.ts +4902 -177
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +25 -9
  105. package/dist/index.js.map +1 -1
  106. package/dist/models/agent-catalog.d.ts +0 -1
  107. package/dist/models/agent-catalog.d.ts.map +1 -1
  108. package/dist/models/agent-catalog.js +0 -1
  109. package/dist/models/agent-catalog.js.map +1 -1
  110. package/dist/models/agent-runtimes.d.ts +1 -1
  111. package/dist/models/agent-runtimes.d.ts.map +1 -1
  112. package/dist/models/agent-runtimes.js +1 -1
  113. package/dist/models/agent-runtimes.js.map +1 -1
  114. package/dist/models/provider-specs.d.ts +1 -0
  115. package/dist/models/provider-specs.d.ts.map +1 -1
  116. package/dist/models/provider-specs.js +11 -0
  117. package/dist/models/provider-specs.js.map +1 -1
  118. package/dist/netd/browser-wire.d.ts.map +1 -0
  119. package/dist/netd/browser-wire.js.map +1 -0
  120. package/dist/{front → netd}/generated/browser-wire.d.ts +8 -0
  121. package/dist/netd/generated/browser-wire.d.ts.map +1 -0
  122. package/dist/netd/generated/browser-wire.js.map +1 -0
  123. package/dist/{front → netd}/generated/wire.d.ts +20 -11
  124. package/dist/netd/generated/wire.d.ts.map +1 -0
  125. package/dist/{front → netd}/generated/wire.js.map +1 -1
  126. package/dist/netd/netd-wire.d.ts +9 -0
  127. package/dist/netd/netd-wire.d.ts.map +1 -0
  128. package/dist/netd/netd-wire.js +8 -0
  129. package/dist/netd/netd-wire.js.map +1 -0
  130. package/dist/policy/credential-material.d.ts +2 -0
  131. package/dist/policy/credential-material.d.ts.map +1 -1
  132. package/dist/policy/credential-material.js +14 -8
  133. package/dist/policy/credential-material.js.map +1 -1
  134. package/dist/policy/message-limits.d.ts +14 -0
  135. package/dist/policy/message-limits.d.ts.map +1 -0
  136. package/dist/policy/message-limits.js +15 -0
  137. package/dist/policy/message-limits.js.map +1 -0
  138. package/dist/policy/request-status.d.ts.map +1 -1
  139. package/dist/policy/request-status.js +9 -1
  140. package/dist/policy/request-status.js.map +1 -1
  141. package/dist/policy/reserved-servers.d.ts.map +1 -1
  142. package/dist/policy/reserved-servers.js +1 -0
  143. package/dist/policy/reserved-servers.js.map +1 -1
  144. package/dist/policy/turned-away.d.ts.map +1 -1
  145. package/dist/policy/turned-away.js +2 -0
  146. package/dist/policy/turned-away.js.map +1 -1
  147. package/dist/protocol/container-requirements.d.ts.map +1 -1
  148. package/dist/protocol/container-requirements.js +3 -4
  149. package/dist/protocol/container-requirements.js.map +1 -1
  150. package/dist/protocol/doors/host-protocol.d.ts.map +1 -0
  151. package/dist/protocol/doors/host-protocol.js.map +1 -0
  152. package/dist/protocol/{listener-protocol.d.ts → doors/listener-protocol.d.ts} +22 -0
  153. package/dist/protocol/doors/listener-protocol.d.ts.map +1 -0
  154. package/dist/protocol/doors/listener-protocol.js +38 -0
  155. package/dist/protocol/doors/listener-protocol.js.map +1 -0
  156. package/dist/protocol/doors/phone-links.d.ts +16 -0
  157. package/dist/protocol/doors/phone-links.d.ts.map +1 -0
  158. package/dist/protocol/doors/phone-links.js +28 -0
  159. package/dist/protocol/doors/phone-links.js.map +1 -0
  160. package/dist/protocol/doors/phone-protocol.d.ts +47 -0
  161. package/dist/protocol/doors/phone-protocol.d.ts.map +1 -0
  162. package/dist/protocol/doors/phone-protocol.js +33 -0
  163. package/dist/protocol/doors/phone-protocol.js.map +1 -0
  164. package/dist/protocol/doors/runner-protocol.d.ts.map +1 -0
  165. package/dist/protocol/{runner-protocol.js → doors/runner-protocol.js} +1 -1
  166. package/dist/protocol/doors/runner-protocol.js.map +1 -0
  167. package/dist/protocol/{webext-links.d.ts → doors/webext-links.d.ts} +1 -0
  168. package/dist/protocol/doors/webext-links.d.ts.map +1 -0
  169. package/dist/protocol/{webext-links.js → doors/webext-links.js} +1 -0
  170. package/dist/protocol/doors/webext-links.js.map +1 -0
  171. package/dist/protocol/doors/webext-protocol.d.ts.map +1 -0
  172. package/dist/protocol/doors/webext-protocol.js.map +1 -0
  173. package/dist/protocol/edge-verdict.d.ts +1 -1
  174. package/dist/protocol/edge-verdict.d.ts.map +1 -1
  175. package/dist/protocol/headers.d.ts +4 -0
  176. package/dist/protocol/headers.d.ts.map +1 -0
  177. package/dist/protocol/headers.js +4 -0
  178. package/dist/protocol/headers.js.map +1 -0
  179. package/dist/protocol/ingress-contract.d.ts +1 -1
  180. package/dist/protocol/ingress-contract.d.ts.map +1 -1
  181. package/dist/protocol/ingress-contract.js +1 -5
  182. package/dist/protocol/ingress-contract.js.map +1 -1
  183. package/dist/protocol/peer-dial.d.ts.map +1 -1
  184. package/dist/protocol/peer-dial.js +18 -36
  185. package/dist/protocol/peer-dial.js.map +1 -1
  186. package/dist/protocol/raw/extension-protocol.d.ts +47 -0
  187. package/dist/protocol/raw/extension-protocol.d.ts.map +1 -0
  188. package/dist/protocol/raw/extension-protocol.js +32 -0
  189. package/dist/protocol/raw/extension-protocol.js.map +1 -0
  190. package/dist/protocol/raw/raw-json-routes.d.ts +855 -0
  191. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -0
  192. package/dist/protocol/raw/raw-json-routes.js +28 -0
  193. package/dist/protocol/raw/raw-json-routes.js.map +1 -0
  194. package/dist/protocol/{raw-routes.d.ts → raw/raw-routes.d.ts} +50 -3
  195. package/dist/protocol/raw/raw-routes.d.ts.map +1 -0
  196. package/dist/protocol/{raw-routes.js → raw/raw-routes.js} +17 -3
  197. package/dist/protocol/raw/raw-routes.js.map +1 -0
  198. package/dist/protocol/raw/route-path.d.ts +3 -0
  199. package/dist/protocol/raw/route-path.d.ts.map +1 -0
  200. package/dist/protocol/raw/route-path.js +8 -0
  201. package/dist/protocol/raw/route-path.js.map +1 -0
  202. package/dist/protocol/route-meta.d.ts +1 -1
  203. package/dist/protocol/route-meta.d.ts.map +1 -1
  204. package/dist/protocol/routes.d.ts +1 -0
  205. package/dist/protocol/routes.d.ts.map +1 -1
  206. package/dist/protocol/routes.js +8 -0
  207. package/dist/protocol/routes.js.map +1 -1
  208. package/dist/protocol/sse.d.ts +2 -1
  209. package/dist/protocol/sse.d.ts.map +1 -1
  210. package/dist/protocol/sse.js +23 -12
  211. package/dist/protocol/sse.js.map +1 -1
  212. package/dist/protocol/tunnel-bulk.js +1 -1
  213. package/dist/protocol/tunnel-bulk.js.map +1 -1
  214. package/dist/protocol/vitals.d.ts +2 -1
  215. package/dist/protocol/vitals.d.ts.map +1 -1
  216. package/dist/protocol/vitals.js +1 -0
  217. package/dist/protocol/vitals.js.map +1 -1
  218. package/dist/schemas/activity.d.ts +1 -0
  219. package/dist/schemas/activity.d.ts.map +1 -1
  220. package/dist/schemas/activity.js.map +1 -1
  221. package/dist/schemas/agent.d.ts +6 -0
  222. package/dist/schemas/agent.d.ts.map +1 -1
  223. package/dist/schemas/agent.js +9 -4
  224. package/dist/schemas/agent.js.map +1 -1
  225. package/dist/schemas/agents-list.d.ts +404 -0
  226. package/dist/schemas/agents-list.d.ts.map +1 -0
  227. package/dist/schemas/agents-list.js +14 -0
  228. package/dist/schemas/agents-list.js.map +1 -0
  229. package/dist/schemas/agents.d.ts +203 -0
  230. package/dist/schemas/agents.d.ts.map +1 -1
  231. package/dist/schemas/agents.js +44 -0
  232. package/dist/schemas/agents.js.map +1 -1
  233. package/dist/schemas/automations.d.ts +235 -347
  234. package/dist/schemas/automations.d.ts.map +1 -1
  235. package/dist/schemas/automations.js +82 -13
  236. package/dist/schemas/automations.js.map +1 -1
  237. package/dist/schemas/capabilities.d.ts +43 -8
  238. package/dist/schemas/capabilities.d.ts.map +1 -1
  239. package/dist/schemas/capabilities.js +6 -2
  240. package/dist/schemas/capabilities.js.map +1 -1
  241. package/dist/schemas/ci.d.ts +4 -0
  242. package/dist/schemas/ci.d.ts.map +1 -1
  243. package/dist/schemas/ci.js +8 -0
  244. package/dist/schemas/ci.js.map +1 -1
  245. package/dist/schemas/devices.d.ts +67 -0
  246. package/dist/schemas/devices.d.ts.map +1 -1
  247. package/dist/schemas/devices.js +8 -0
  248. package/dist/schemas/devices.js.map +1 -1
  249. package/dist/schemas/engines.d.ts +57 -0
  250. package/dist/schemas/engines.d.ts.map +1 -1
  251. package/dist/schemas/engines.js +4 -0
  252. package/dist/schemas/engines.js.map +1 -1
  253. package/dist/schemas/extension-updates.d.ts +329 -0
  254. package/dist/schemas/extension-updates.d.ts.map +1 -1
  255. package/dist/schemas/extension-updates.js +68 -3
  256. package/dist/schemas/extension-updates.js.map +1 -1
  257. package/dist/schemas/git/git.d.ts +11 -0
  258. package/dist/schemas/git/git.d.ts.map +1 -1
  259. package/dist/schemas/git/git.js +4 -4
  260. package/dist/schemas/git/git.js.map +1 -1
  261. package/dist/schemas/history.d.ts +2 -0
  262. package/dist/schemas/history.d.ts.map +1 -1
  263. package/dist/schemas/history.js.map +1 -1
  264. package/dist/schemas/hosts.d.ts +74 -0
  265. package/dist/schemas/hosts.d.ts.map +1 -1
  266. package/dist/schemas/hosts.js +10 -1
  267. package/dist/schemas/hosts.js.map +1 -1
  268. package/dist/schemas/loopback-catch.d.ts +1 -0
  269. package/dist/schemas/loopback-catch.d.ts.map +1 -1
  270. package/dist/schemas/loopback-catch.js +1 -0
  271. package/dist/schemas/loopback-catch.js.map +1 -1
  272. package/dist/schemas/maintenance.d.ts +8 -0
  273. package/dist/schemas/maintenance.d.ts.map +1 -1
  274. package/dist/schemas/maintenance.js +6 -0
  275. package/dist/schemas/maintenance.js.map +1 -1
  276. package/dist/schemas/members.d.ts +58 -0
  277. package/dist/schemas/members.d.ts.map +1 -0
  278. package/dist/schemas/members.js +16 -0
  279. package/dist/schemas/members.js.map +1 -0
  280. package/dist/schemas/metrics.d.ts +10 -0
  281. package/dist/schemas/metrics.d.ts.map +1 -1
  282. package/dist/schemas/metrics.js +19 -3
  283. package/dist/schemas/metrics.js.map +1 -1
  284. package/dist/schemas/needs.d.ts +1159 -1
  285. package/dist/schemas/needs.d.ts.map +1 -1
  286. package/dist/schemas/needs.js +25 -3
  287. package/dist/schemas/needs.js.map +1 -1
  288. package/dist/schemas/offload.js +1 -1
  289. package/dist/schemas/offload.js.map +1 -1
  290. package/dist/schemas/peer-enrollment.d.ts +7 -0
  291. package/dist/schemas/peer-enrollment.d.ts.map +1 -0
  292. package/dist/schemas/peer-enrollment.js +6 -0
  293. package/dist/schemas/peer-enrollment.js.map +1 -0
  294. package/dist/schemas/phone.d.ts +231 -0
  295. package/dist/schemas/phone.d.ts.map +1 -0
  296. package/dist/schemas/phone.js +57 -0
  297. package/dist/schemas/phone.js.map +1 -0
  298. package/dist/schemas/privacy.d.ts +41 -0
  299. package/dist/schemas/privacy.d.ts.map +1 -1
  300. package/dist/schemas/privacy.js +20 -3
  301. package/dist/schemas/privacy.js.map +1 -1
  302. package/dist/schemas/project-delivery.d.ts +94 -0
  303. package/dist/schemas/project-delivery.d.ts.map +1 -0
  304. package/dist/schemas/project-delivery.js +35 -0
  305. package/dist/schemas/project-delivery.js.map +1 -0
  306. package/dist/schemas/providers/plan-limits.d.ts +7 -0
  307. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  308. package/dist/schemas/providers/plan-limits.js +22 -1
  309. package/dist/schemas/providers/plan-limits.js.map +1 -1
  310. package/dist/schemas/providers/usage.d.ts +1 -2
  311. package/dist/schemas/providers/usage.d.ts.map +1 -1
  312. package/dist/schemas/providers/usage.js +1 -2
  313. package/dist/schemas/providers/usage.js.map +1 -1
  314. package/dist/schemas/push.d.ts +1 -0
  315. package/dist/schemas/push.d.ts.map +1 -1
  316. package/dist/schemas/push.js.map +1 -1
  317. package/dist/schemas/secrets.d.ts +99 -0
  318. package/dist/schemas/secrets.d.ts.map +1 -1
  319. package/dist/schemas/secrets.js +34 -3
  320. package/dist/schemas/secrets.js.map +1 -1
  321. package/dist/schemas/settings-history.d.ts +1 -1
  322. package/dist/schemas/settings-history.d.ts.map +1 -1
  323. package/dist/schemas/settings-history.js +1 -0
  324. package/dist/schemas/settings-history.js.map +1 -1
  325. package/dist/schemas/settings.d.ts +13 -58
  326. package/dist/schemas/settings.d.ts.map +1 -1
  327. package/dist/schemas/settings.js +8 -13
  328. package/dist/schemas/settings.js.map +1 -1
  329. package/dist/schemas/terminal.d.ts +32 -0
  330. package/dist/schemas/terminal.d.ts.map +1 -1
  331. package/dist/schemas/terminal.js +37 -0
  332. package/dist/schemas/terminal.js.map +1 -1
  333. package/dist/schemas/updates.d.ts +1 -0
  334. package/dist/schemas/updates.d.ts.map +1 -1
  335. package/dist/schemas/updates.js +4 -0
  336. package/dist/schemas/updates.js.map +1 -1
  337. package/dist/schemas/workspace/workspace-search.d.ts +1 -0
  338. package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
  339. package/dist/schemas/workspace/workspace-search.js.map +1 -1
  340. package/dist/schemas/workspace/workspace-tree.d.ts +3 -0
  341. package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
  342. package/dist/schemas/workspace/workspace-tree.js +22 -5
  343. package/dist/schemas/workspace/workspace-tree.js.map +1 -1
  344. package/dist/state/arrival.d.ts +59 -0
  345. package/dist/state/arrival.d.ts.map +1 -1
  346. package/dist/state/arrival.js +17 -0
  347. package/dist/state/arrival.js.map +1 -1
  348. package/dist/state/contract-lock.js +2 -2
  349. package/dist/state/contract-lock.js.map +1 -1
  350. package/dist/state/definition.d.ts +82 -16
  351. package/dist/state/definition.d.ts.map +1 -1
  352. package/dist/state/history-state.d.ts.map +1 -1
  353. package/dist/state/history-state.js +38 -0
  354. package/dist/state/history-state.js.map +1 -1
  355. package/dist/state/runtime-state.d.ts +6 -0
  356. package/dist/state/runtime-state.d.ts.map +1 -1
  357. package/dist/state/runtime-state.js +2 -0
  358. package/dist/state/runtime-state.js.map +1 -1
  359. package/dist/state/workspace-state.d.ts +24 -6
  360. package/dist/state/workspace-state.d.ts.map +1 -1
  361. package/dist/state/workspace-state.js +29 -7
  362. package/dist/state/workspace-state.js.map +1 -1
  363. package/dist/text/embed.d.ts +10 -0
  364. package/dist/text/embed.d.ts.map +1 -1
  365. package/dist/text/embed.js +25 -0
  366. package/dist/text/embed.js.map +1 -1
  367. package/dist/text/pages.d.ts +53 -0
  368. package/dist/text/pages.d.ts.map +1 -0
  369. package/dist/text/pages.js +230 -0
  370. package/dist/text/pages.js.map +1 -0
  371. package/dist/text/transcript-fold.d.ts +1 -0
  372. package/dist/text/transcript-fold.d.ts.map +1 -1
  373. package/dist/text/transcript-fold.js +30 -2
  374. package/dist/text/transcript-fold.js.map +1 -1
  375. package/dist/webext/index.d.ts +3 -2
  376. package/dist/webext/index.d.ts.map +1 -1
  377. package/dist/webext/index.js +3 -2
  378. package/dist/webext/index.js.map +1 -1
  379. package/package.json +77 -22
  380. package/src/chores/chores.ts +41 -21
  381. package/src/chores/{probes.test.ts → probes.integration.test.ts} +134 -1
  382. package/src/chores/probes.ts +128 -14
  383. package/src/chores/verdict.test.ts +29 -0
  384. package/src/contracts/agent.contract.ts +2 -2
  385. package/src/contracts/agents.contract.ts +1 -1
  386. package/src/contracts/automations.contract.ts +19 -1
  387. package/src/contracts/device.contract.ts +5 -0
  388. package/src/contracts/endpoints.contract.ts +32 -26
  389. package/src/contracts/extensions.contract.ts +49 -0
  390. package/src/contracts/pages.contract.ts +61 -0
  391. package/src/contracts/phone.contract.ts +21 -0
  392. package/src/contracts/privacy.contract.ts +13 -1
  393. package/src/contracts/runner.contract.ts +1 -1
  394. package/src/contracts/secrets.contract.ts +25 -0
  395. package/src/contracts/settings.contract.ts +10 -0
  396. package/src/contracts/system.contract.ts +26 -0
  397. package/src/documents/conversions.ts +3 -1
  398. package/src/documents/read.ts +4 -5
  399. package/src/events/agent-events.ts +27 -3
  400. package/src/events/requests.ts +47 -0
  401. package/src/events/transcript.ts +14 -0
  402. package/src/ids/hostnames.fixture.json +14 -10
  403. package/src/ids/hostnames.test.ts +21 -2
  404. package/src/ids/hostnames.ts +34 -15
  405. package/src/ids/sandbox-id.ts +3 -0
  406. package/src/ids/tunnel-ids.ts +1 -2
  407. package/src/index.ts +29 -12
  408. package/src/models/agent-catalog.ts +1 -2
  409. package/src/models/agent-runtimes.ts +12 -6
  410. package/src/models/provider-specs.test.ts +12 -0
  411. package/src/models/provider-specs.ts +16 -0
  412. package/src/{front → netd}/browser-wire.ts +1 -1
  413. package/src/{front → netd}/generated/browser-wire.json +80 -7
  414. package/src/{front → netd}/generated/browser-wire.ts +34 -7
  415. package/src/{front/generated/front-wire.json → netd/generated/netd-wire.json} +103 -41
  416. package/src/{front → netd}/generated/tunnel.json +15 -1
  417. package/src/{front → netd}/generated/wire.ts +26 -21
  418. package/src/netd/netd-wire.ts +24 -0
  419. package/src/{front → netd}/wire-manifests.test.ts +31 -11
  420. package/src/policy/credential-material.ts +39 -11
  421. package/src/policy/message-limits.ts +25 -0
  422. package/src/policy/request-status.ts +10 -1
  423. package/src/policy/reserved-servers.ts +3 -2
  424. package/src/policy/tests/credential-material.test.ts +49 -1
  425. package/src/policy/tests/message-limits.test.ts +27 -0
  426. package/src/policy/tests/reserved-servers.test.ts +3 -3
  427. package/src/policy/turned-away.ts +5 -1
  428. package/src/protocol/container-requirements.ts +4 -5
  429. package/src/protocol/{listener-protocol.ts → doors/listener-protocol.ts} +37 -15
  430. package/src/protocol/doors/phone-links.ts +50 -0
  431. package/src/protocol/doors/phone-protocol.test.ts +136 -0
  432. package/src/protocol/doors/phone-protocol.ts +71 -0
  433. package/src/protocol/{runner-protocol.ts → doors/runner-protocol.ts} +1 -1
  434. package/src/protocol/{webext-links.ts → doors/webext-links.ts} +4 -0
  435. package/src/protocol/edge-verdict.ts +1 -1
  436. package/src/protocol/headers.ts +14 -0
  437. package/src/protocol/ingress-contract.ts +6 -10
  438. package/src/protocol/peer-dial.test.ts +83 -4
  439. package/src/protocol/peer-dial.ts +33 -40
  440. package/src/protocol/raw/extension-protocol.ts +59 -0
  441. package/src/protocol/raw/raw-json-routes.ts +61 -0
  442. package/src/protocol/{raw-routes.ts → raw/raw-routes.ts} +40 -7
  443. package/src/protocol/raw/route-path.ts +13 -0
  444. package/src/protocol/route-meta.ts +4 -4
  445. package/src/protocol/routes.ts +12 -0
  446. package/src/protocol/sse.test.ts +49 -0
  447. package/src/protocol/sse.ts +29 -14
  448. package/src/protocol/tunnel-bulk.test.ts +1 -1
  449. package/src/protocol/tunnel-bulk.ts +2 -2
  450. package/src/protocol/vitals.test.ts +7 -7
  451. package/src/protocol/vitals.ts +12 -7
  452. package/src/schemas/activity.ts +1 -0
  453. package/src/schemas/agent.ts +11 -4
  454. package/src/schemas/agents-list.ts +24 -0
  455. package/src/schemas/agents.ts +71 -2
  456. package/src/schemas/automations.ts +126 -24
  457. package/src/schemas/capabilities.ts +13 -3
  458. package/src/schemas/ci.ts +10 -0
  459. package/src/schemas/devices.ts +24 -0
  460. package/src/schemas/engines.ts +7 -0
  461. package/src/schemas/extension-updates.ts +93 -3
  462. package/src/schemas/git/git.ts +15 -4
  463. package/src/schemas/history.ts +2 -0
  464. package/src/schemas/hosts.ts +23 -1
  465. package/src/schemas/loopback-catch.ts +6 -1
  466. package/src/schemas/maintenance.ts +9 -0
  467. package/src/schemas/members.ts +33 -0
  468. package/src/schemas/metrics.ts +21 -3
  469. package/src/schemas/needs.ts +36 -3
  470. package/src/schemas/offload.ts +1 -1
  471. package/src/schemas/peer-enrollment.ts +14 -0
  472. package/src/schemas/phone.ts +121 -0
  473. package/src/schemas/privacy.ts +36 -7
  474. package/src/schemas/project-delivery.ts +78 -0
  475. package/src/schemas/providers/plan-limits.ts +27 -3
  476. package/src/schemas/providers/usage.ts +3 -3
  477. package/src/schemas/push.ts +1 -0
  478. package/src/schemas/secrets.ts +54 -3
  479. package/src/schemas/settings-history.ts +2 -0
  480. package/src/schemas/settings.ts +20 -22
  481. package/src/schemas/terminal.ts +50 -0
  482. package/src/schemas/updates.test.ts +47 -0
  483. package/src/schemas/updates.ts +4 -0
  484. package/src/schemas/workspace/workspace-search.ts +2 -0
  485. package/src/schemas/workspace/workspace-tree.ts +40 -12
  486. package/src/state/arrival.ts +40 -0
  487. package/src/state/contract-lock.test.ts +1 -1
  488. package/src/state/contract-lock.ts +5 -5
  489. package/src/state/history-state.ts +72 -1
  490. package/src/state/runtime-state.ts +4 -0
  491. package/src/state/workspace-state.ts +65 -20
  492. package/src/text/embed.test.ts +21 -1
  493. package/src/text/embed.ts +50 -3
  494. package/src/text/pages.test.ts +161 -0
  495. package/src/text/pages.ts +344 -0
  496. package/src/text/transcript-fold.test.ts +22 -0
  497. package/src/text/transcript-fold.ts +41 -2
  498. package/src/webext/index.ts +3 -2
  499. package/dist/front/browser-wire.d.ts.map +0 -1
  500. package/dist/front/browser-wire.js.map +0 -1
  501. package/dist/front/front-wire.d.ts +0 -6
  502. package/dist/front/front-wire.d.ts.map +0 -1
  503. package/dist/front/front-wire.js +0 -5
  504. package/dist/front/front-wire.js.map +0 -1
  505. package/dist/front/generated/browser-wire.d.ts.map +0 -1
  506. package/dist/front/generated/browser-wire.js.map +0 -1
  507. package/dist/front/generated/wire.d.ts.map +0 -1
  508. package/dist/protocol/host-protocol.d.ts.map +0 -1
  509. package/dist/protocol/host-protocol.js.map +0 -1
  510. package/dist/protocol/listener-protocol.d.ts.map +0 -1
  511. package/dist/protocol/listener-protocol.js +0 -33
  512. package/dist/protocol/listener-protocol.js.map +0 -1
  513. package/dist/protocol/raw-routes.d.ts.map +0 -1
  514. package/dist/protocol/raw-routes.js.map +0 -1
  515. package/dist/protocol/request-id.d.ts +0 -2
  516. package/dist/protocol/request-id.d.ts.map +0 -1
  517. package/dist/protocol/request-id.js +0 -2
  518. package/dist/protocol/request-id.js.map +0 -1
  519. package/dist/protocol/runner-protocol.d.ts.map +0 -1
  520. package/dist/protocol/runner-protocol.js.map +0 -1
  521. package/dist/protocol/webext-links.d.ts.map +0 -1
  522. package/dist/protocol/webext-links.js.map +0 -1
  523. package/dist/protocol/webext-protocol.d.ts.map +0 -1
  524. package/dist/protocol/webext-protocol.js.map +0 -1
  525. package/src/front/front-wire.ts +0 -15
  526. package/src/protocol/request-id.ts +0 -2
  527. /package/dist/{front → netd}/browser-wire.d.ts +0 -0
  528. /package/dist/{front → netd}/browser-wire.js +0 -0
  529. /package/dist/{front → netd}/generated/browser-wire.js +0 -0
  530. /package/dist/{front → netd}/generated/wire.js +0 -0
  531. /package/dist/protocol/{host-protocol.d.ts → doors/host-protocol.d.ts} +0 -0
  532. /package/dist/protocol/{host-protocol.js → doors/host-protocol.js} +0 -0
  533. /package/dist/protocol/{runner-protocol.d.ts → doors/runner-protocol.d.ts} +0 -0
  534. /package/dist/protocol/{webext-protocol.d.ts → doors/webext-protocol.d.ts} +0 -0
  535. /package/dist/protocol/{webext-protocol.js → doors/webext-protocol.js} +0 -0
  536. /package/src/protocol/{host-protocol.ts → doors/host-protocol.ts} +0 -0
  537. /package/src/protocol/{webext-protocol.ts → doors/webext-protocol.ts} +0 -0
@@ -4,6 +4,8 @@ import {
4
4
  CredentialGuardSubjectParamSchema,
5
5
  CredentialGatesSchema,
6
6
  CredentialGrantSchema,
7
+ CredentialPolicySchema,
8
+ CredentialPolicySetSchema,
7
9
  CredentialRequestSchema,
8
10
  SecretInventorySchema,
9
11
  SecretKeyParamSchema,
@@ -141,6 +143,29 @@ export const secretsContract = {
141
143
  .meta({ agent: true })
142
144
  .input(SecretHostGuardSetSchema)
143
145
  .output(SecretHostGuardSetResultSchema),
146
+ // The credential gateway's say over one connection: how its credential reaches the agent, and what it may do there.
147
+ policy: secretRoute
148
+ .route({
149
+ method: "GET",
150
+ path: "/secrets/policy/{subject}",
151
+ summary: "How a connection's credential reaches the agent, and what it may do",
152
+ description:
153
+ "Whether the credential gateway holds this connection's credential or the agent is handed it, and the method and path rules the gateway enforces on every request it attaches it to. Names and rules only, never values.",
154
+ })
155
+ // The `secrets policy` CLI's read, on the agent token: knowing the rules lets a turn plan around them.
156
+ .meta({ agent: true })
157
+ .input(CredentialGuardSubjectParamSchema)
158
+ .output(CredentialPolicySchema),
159
+ setPolicy: secretRoute
160
+ .route({
161
+ method: "PUT",
162
+ path: "/secrets/policy/{subject}",
163
+ summary: "Set how a connection's credential reaches the agent, and its rules",
164
+ description:
165
+ "The owner's alone, and never the agent's: handing the agent the credential itself, or replacing what the gateway lets it do, is a decision about the credential, not a use of it.",
166
+ })
167
+ .input(CredentialPolicySetSchema)
168
+ .output(CredentialPolicySchema),
144
169
  request: secretRoute
145
170
  .route({
146
171
  method: "POST",
@@ -1,6 +1,7 @@
1
1
  import { FIELD_NOTES_FILE } from "@intentic/constants";
2
2
  import { procedure } from "../protocol/route-meta.js";
3
3
  import {
4
+ AgentDomainPolicySchema,
4
5
  AudienceAnswerSchema,
5
6
  AudienceStateSchema,
6
7
  BuiltinPromptSchema,
@@ -24,6 +25,15 @@ import { DayWindowQuerySchema } from "../schemas/providers/usage.js";
24
25
  // overwrites whole. `savings` measures each token-reduction mechanism's worth over the same UTC day window the spend
25
26
  // ledger takes. `builtinPrompt` returns a built-in prompt's actual text to show or fork.
26
27
  export const settingsContract = {
28
+ agentDomain: procedure
29
+ .route({ method: "GET", path: "/settings/agent-domain", summary: "Read the agent execution domain" })
30
+ .meta({ panel: false, control: "never" })
31
+ .output(AgentDomainPolicySchema),
32
+ setAgentDomain: procedure
33
+ .route({ method: "POST", path: "/settings/agent-domain", summary: "Choose the agent execution domain" })
34
+ .meta({ floor: "owner", panel: false, control: "never" })
35
+ .input(AgentDomainPolicySchema)
36
+ .output(OkSchema),
27
37
  get: procedure
28
38
  .route({
29
39
  method: "GET",
@@ -18,6 +18,9 @@ import { AutoUpdateInputSchema, AutoUpdateSchema, SkipUpdateInputSchema } from "
18
18
  import {
19
19
  BrowserNameParamSchema,
20
20
  BrowsersListSchema,
21
+ OpenBrowserInputSchema,
22
+ OpenBrowserResultSchema,
23
+ DesktopStateSchema,
21
24
  SubagentsListSchema,
22
25
  TerminalNameParamSchema,
23
26
  TerminalScrollbackQuerySchema,
@@ -229,6 +232,17 @@ export const systemContract = {
229
232
  "Every browser a conversation currently has running and the pages inside each one. The picture of what they are showing comes over a separate socket; this is the roster.",
230
233
  })
231
234
  .output(BrowsersListSchema),
235
+ // The person's own window: started on the first call, given a new tab on every later one, never an agent's.
236
+ openBrowser: systemRoute
237
+ .route({
238
+ method: "POST",
239
+ path: "/system/browsers",
240
+ summary: "Open a tab in your own browser",
241
+ description:
242
+ "Opens a tab in your own browser window, starting the window first when it is not running. It is a Chromium of its own, with a profile that keeps your sign-ins between windows, and no agent drives it. Answers once the window can be watched.",
243
+ })
244
+ .input(OpenBrowserInputSchema)
245
+ .output(OpenBrowserResultSchema),
232
246
  closeBrowser: systemRoute
233
247
  .route({
234
248
  method: "DELETE",
@@ -239,6 +253,18 @@ export const systemContract = {
239
253
  })
240
254
  .input(BrowserNameParamSchema)
241
255
  .output(OkSchema),
256
+ // The picture and the hands come over /system/desktop-view; this is whether there is anything on it, and which windows
257
+ // a tab could show alone. Pushed through the `desktop` runtime domain as windows open, close and take the keyboard,
258
+ // and as their titles change while a view is open; never polled by the client.
259
+ desktop: systemRoute
260
+ .route({
261
+ method: "GET",
262
+ path: "/system/desktop",
263
+ summary: "The sandbox's own desktop",
264
+ description:
265
+ "Whether the sandbox's desktop is up, which display it is, and which windows are open on it. The live picture of it, or of one window on it, comes over a separate socket; this says whether there is anything to see.",
266
+ })
267
+ .output(DesktopStateSchema),
242
268
  // In-process and spawned alike: the board draws each under the card of the conversation that started it, and a chat
243
269
  // draws it on the card of the call that started it. Pushed through the `subagents` runtime domain, never polled. A
244
270
  // subagent's work is read where it lives: an in-process one's on its delegation's card in its parent's record, a
@@ -1,3 +1,5 @@
1
+ import { errorMessage } from "@intentic/base/errors";
2
+
1
3
  // A stored document's history as data: each conversion is a guarded, pure rewrite of the raw JSON a store reads, run
2
4
  // before the schema on every read. The guard makes a conversion a no-op on a document already past it, so running the
3
5
  // whole list over a document from any era converges on today's shape without the document carrying a version, and
@@ -355,7 +357,7 @@ export class ConversionError extends Error {
355
357
  readonly conversion: string;
356
358
 
357
359
  constructor(conversion: string, cause: unknown) {
358
- super(`conversion "${conversion}" failed: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
360
+ super(`conversion "${conversion}" failed: ${errorMessage(cause)}`, { cause });
359
361
  this.name = "ConversionError";
360
362
  this.conversion = conversion;
361
363
  }
@@ -1,3 +1,4 @@
1
+ import { errorMessage } from "@intentic/base/errors";
1
2
  import type { ManifestProblem } from "../schemas/system.js";
2
3
  import { type Conversion, convertDocument, type Granularity } from "./conversions.js";
3
4
  import { carryUnknown, type IdKeys, reemitQuarantined } from "./passthrough.js";
@@ -35,8 +36,6 @@ export interface DocumentRead<T> {
35
36
  readonly problems: readonly ManifestProblem[];
36
37
  }
37
38
 
38
- const message = (error: unknown): string => (error instanceof Error ? error.message : String(error));
39
-
40
39
  const unreadable = <T>(reason: NonNullable<ManifestProblem["reason"]>, detail: string): DocumentRead<T> => ({
41
40
  value: undefined,
42
41
  carry: (updated) => updated,
@@ -67,7 +66,7 @@ export const readDocument = <T>(text: string, shape: DocumentShape, how: Documen
67
66
  const converted = convertDocument(shape.history, shape.granularity, raw, checkSettles).value;
68
67
  whole = Array.isArray(converted) ? converted : [];
69
68
  } catch (error) {
70
- return unreadable("conversion-failed", `a conversion to this build's shape failed (${message(error)})`);
69
+ return unreadable("conversion-failed", `a conversion to this build's shape failed (${errorMessage(error)})`);
71
70
  }
72
71
  }
73
72
  whole.forEach((written, index) => {
@@ -80,7 +79,7 @@ export const readDocument = <T>(text: string, shape: DocumentShape, how: Documen
80
79
  report({
81
80
  kind: "invalidEntry",
82
81
  reason: "conversion-failed",
83
- detail: `entry ${index} could not be converted to this build's shape (${message(error)}); it is kept as written`,
82
+ detail: `entry ${index} could not be converted to this build's shape (${errorMessage(error)}); it is kept as written`,
84
83
  });
85
84
  return;
86
85
  }
@@ -104,7 +103,7 @@ export const readDocument = <T>(text: string, shape: DocumentShape, how: Documen
104
103
  try {
105
104
  raw = convertDocument(shape.history, shape.granularity, raw, checkSettles).value;
106
105
  } catch (error) {
107
- return unreadable("conversion-failed", `a conversion to this build's shape failed (${message(error)})`);
106
+ return unreadable("conversion-failed", `a conversion to this build's shape failed (${errorMessage(error)})`);
108
107
  }
109
108
  const value = how.parse(raw, report);
110
109
  if (value === undefined) {
@@ -10,7 +10,7 @@ import { PromptCacheOpeningSchema, PromptFingerprintSchema } from "../schemas/ke
10
10
  import { AgentReplySchema, UsageWindowSchema } from "../schemas/providers/plan-limits.js";
11
11
  import { SubagentKindSchema, SubagentStatusSchema, SubagentVerificationSchema } from "../schemas/terminal.js";
12
12
  import { RetryLadderSchema } from "../schemas/turn-break.js";
13
- import { AgentCommandSchema, browserHelpRequest, capabilityOfferRequest, CapabilityOutcomeSchema, ContextUsageSchema, credentialOfferRequest, CredentialReceiptSchema, paymentOfferRequest, PaymentReceiptSchema, PermissionRequestSchema, PlanRequestSchema, QuestionRequestSchema, terminalHelpRequest, TodoItemSchema, ToolCallContentSchema, ToolCallLocationSchema, ToolCallStatusSchema, ToolKindSchema } from "./requests.js";
13
+ import { AgentCommandSchema, browserHelpRequest, capabilityOfferRequest, CapabilityOutcomeSchema, ContextUsageSchema, credentialOfferRequest, CredentialReceiptSchema, pageAskRequest, PageSchema, paymentOfferRequest, PaymentReceiptSchema, PermissionRequestSchema, PlanRequestSchema, QuestionRequestSchema, terminalHelpRequest, TodoItemSchema, ToolCallContentSchema, ToolCallLocationSchema, ToolCallStatusSchema, ToolKindSchema } from "./requests.js";
14
14
  import { TranscriptPatchSchema, TranscriptRowSchema, TurnNoteSchema } from "./transcript.js";
15
15
  import { agentNoticeEvent, agentStatusEvent } from "./agent-ui.js";
16
16
 
@@ -229,6 +229,23 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
229
229
  // Something the agent asked a person for (docs/architecture/needs.md). Parks nothing: the turn carries on, the need
230
230
  // outlives it in the needs store, and its card draws the store's live state by `need.id`.
231
231
  z.object({ kind: z.literal("need"), need: NeedSchema }),
232
+ // A page the agent showed (its `show_page` tool): drawn inline where the turn stands, in a sealed frame. Parks
233
+ // nothing. A page whose id an earlier one already holds is a redraw, and the earlier row folds to a line.
234
+ z.object({ kind: z.literal("page"), page: PageSchema }),
235
+ // A page the agent showed to be answered (`ask_page`): parks the turn until the page sends its answer back, or the
236
+ // person dismisses it. Not journalled for restore: the tool call waiting on it dies with the daemon.
237
+ z.object({ kind: z.literal("page_ask"), ...pageAskRequest }),
238
+ // A page as the model is still writing it, for the chat to draw as it arrives: `text` is what came at `at` in the
239
+ // page's markup, so a window that missed nothing appends and one joining late replays them in order. Live state, not
240
+ // transcript: `done` ends it (the page itself, or the call's failure, takes over), and every draft goes with the turn.
241
+ z.object({
242
+ kind: z.literal("page_draft"),
243
+ callId: z.string().describe("The tool call writing it."),
244
+ at: z.number().int().nonnegative().describe("Where in the page's markup this text starts."),
245
+ text: z.string().describe("The next stretch of the page's markup."),
246
+ title: z.string().optional().describe("The page's title, once the call has written it."),
247
+ done: z.boolean().optional().describe("The draft is over: the page is published, or the call failed."),
248
+ }),
232
249
  // The named card is released and the turn resumes; emitted the moment its waiter settles, since nothing else on
233
250
  // this stream marks a park's end. `reply` is what a rebuilt transcript freezes the card with.
234
251
  z.object({ kind: z.literal("resolved"), requestId: z.string(), reply: AgentReplySchema.optional() }),
@@ -276,9 +293,15 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
276
293
  // The model can only write one-shot jobs (Model.helperOnly: its server says it cannot call tools, or
277
294
  // it is the quick-jobs local model), refused before sending; the words wait for another model.
278
295
  "model-helper-only",
279
- // The privacy shield is on, the provider is untrusted, and the runtime is one its gateway cannot stand in
280
- // front of (Cursor, an ACP agent, Pi), refused before sending; the words wait for a covered provider.
296
+ // The privacy shield is on, the provider is untrusted, and the runtime is one it cannot read by content at
297
+ // all (an ACP agent, Pi), refused before sending; the words wait for a covered provider.
281
298
  "privacy-unshielded",
299
+ // The protected execution-domain policy is unsupported or unreadable; refused before any model/helper ran.
300
+ "agent-domain-refused",
301
+ // The privacy shield found personal data in instructions the runtime loads itself, past every channel it
302
+ // could mask (Cursor's project rules, AGENTS.md), refused before sending; the words wait for the owner to
303
+ // let the provider read this conversation, trust it, or take the data out of those files.
304
+ "privacy-instructions",
282
305
  // The session outgrew the model's context window mid-turn; resuming that session only overflows again,
283
306
  // so the daemon re-runs the turn once in a fresh session carrying the hand-off.
284
307
  "context-overflow",
@@ -379,6 +402,7 @@ export const TURN_FACT_KINDS = [
379
402
  "context_usage",
380
403
  "mode",
381
404
  "agent_status",
405
+ "page_draft",
382
406
  "error",
383
407
  ] as const;
384
408
  export type TurnFact = Extract<AgentEvent, { kind: (typeof TURN_FACT_KINDS)[number] }>;
@@ -266,6 +266,48 @@ export const RequestDocumentSchema = z.object({
266
266
  });
267
267
  export type RequestDocument = z.infer<typeof RequestDocumentSchema>;
268
268
 
269
+ // A page the agent showed in the chat (its `show_page`/`ask_page` tools): a self-contained HTML document the daemon
270
+ // stored under the workspace's records, drawn inline in a sealed frame. The row carries where it lives, not its bytes,
271
+ // so a long chat full of charts stays a light record; the file is the page as it was shown, never rewritten after.
272
+ export const PAGE_MIN_HEIGHT = 80;
273
+ export const PAGE_MAX_HEIGHT = 2000;
274
+ export const PAGE_TITLE_MAX = 200;
275
+ export const PageSchema = z.object({
276
+ id: z.string().min(1).describe("The page's own id, which a later `replaces` names to redraw it in place."),
277
+ title: z.string().max(PAGE_TITLE_MAX).describe("What it is, in a few words."),
278
+ path: z.string().min(1).describe("Where the page is stored, as a workspace path."),
279
+ height: z
280
+ .number()
281
+ .int()
282
+ .min(PAGE_MIN_HEIGHT)
283
+ .max(PAGE_MAX_HEIGHT)
284
+ .optional()
285
+ .describe("The tallest the agent wants its frame, in pixels; the page scrolls inside it beyond that. Absent, the frame fits the page."),
286
+ measured: z
287
+ .number()
288
+ .int()
289
+ .positive()
290
+ .optional()
291
+ .describe("The page's height at the chat's column width, as the sandbox's own browser laid it out, so its room is held before it loads."),
292
+ source: z.string().optional().describe("The workspace file the page was built from, when the agent showed a file rather than writing the page inline."),
293
+ revision: z.number().int().nonnegative().optional().describe("How many times the agent redrew this page; each redraw is a new file at a new path."),
294
+ superseded: z
295
+ .boolean()
296
+ .optional()
297
+ .describe("A later redraw of this page stands further down the conversation, so this one is drawn folded to a line."),
298
+ app: z
299
+ .object({
300
+ server: z.string().min(1).describe("The connected MCP server whose app it is, by its capability id."),
301
+ tool: z.string().min(1).describe("The tool whose call the app shows."),
302
+ })
303
+ .optional()
304
+ .describe("Present when the page is an MCP server's own app (an MCP Apps `ui://` resource), shown for one of its tool calls."),
305
+ });
306
+ export type Page = z.infer<typeof PageSchema>;
307
+
308
+ // What a page sent back is capped at: an answer, not a document.
309
+ export const PAGE_VALUE_MAX = 64_000;
310
+
269
311
  // One request's fields, spelled once: the raising frame, the parked-card journal entry, and the transcript row all share
270
312
  // this shape rather than declaring it three times.
271
313
  const REQUEST_ID = z.string().describe("What to send back when you answer.");
@@ -296,6 +338,11 @@ export const terminalHelpRequest = {
296
338
  session: z.string(),
297
339
  message: z.string(),
298
340
  };
341
+ // A page the agent showed to be answered (`ask_page`): the turn waits until the page sends its answer back.
342
+ export const pageAskRequest = {
343
+ requestId: REQUEST_ID,
344
+ page: PageSchema.describe("The page to answer on."),
345
+ };
299
346
  export const capabilityOfferRequest = { requestId: z.string(), offer: CapabilityOfferSchema };
300
347
  export const paymentOfferRequest = { requestId: z.string(), offer: PaymentOfferSchema };
301
348
  export const credentialOfferRequest = { requestId: z.string(), offer: CredentialOfferSchema };
@@ -14,6 +14,8 @@ import {
14
14
  CapabilityOutcomeSchema,
15
15
  credentialOfferRequest,
16
16
  CredentialReceiptSchema,
17
+ pageAskRequest,
18
+ PageSchema,
17
19
  paymentOfferRequest,
18
20
  PaymentReceiptSchema,
19
21
  PermissionAskSchema,
@@ -92,6 +94,14 @@ export const TranscriptCredentialOfferSchema = z.object({
92
94
  receipt: CredentialReceiptSchema.optional().describe("Who released it, or that somebody refused (the credential_receipt frame)."),
93
95
  });
94
96
  export type TranscriptCredentialOffer = z.infer<typeof TranscriptCredentialOfferSchema>;
97
+ // A page asked to be answered, and what it sent back: the value as the page gave it, JSON text, which is also exactly
98
+ // what the agent was handed.
99
+ export const TranscriptPageAskSchema = z.object({
100
+ ...pageAskRequest,
101
+ status: QuestionStatusSchema.describe("Where the answer stands."),
102
+ value: z.string().optional().describe("What the page sent back, as JSON text."),
103
+ });
104
+ export type TranscriptPageAsk = z.infer<typeof TranscriptPageAskSchema>;
95
105
 
96
106
  // One row shape across live folding, storage and replay; a reopened chat redraws the transcript, not paraphrases it. A
97
107
  // subagent's own calls nest under the card that spawned them (z.lazy, self-referential).
@@ -353,6 +363,9 @@ export const TranscriptRowSchema = z.object({
353
363
  "Another agent's words that reached this conversation, whose they are, and the prompt they came as.",
354
364
  ),
355
365
  backgroundJob: TranscriptBackgroundJobSchema.optional().describe("The background job this row marks the start of."),
366
+ // Not a card: a page parks nothing, it is part of what the agent said. On the bubble whose tool call showed it.
367
+ page: PageSchema.optional().describe("A page the agent showed here, drawn inline."),
368
+ pageAsk: TranscriptPageAskSchema.optional().describe("A page the agent asked to be answered on, and what it sent back."),
356
369
  credentialOffer: TranscriptCredentialOfferSchema.optional().describe(
357
370
  "The gated credential this row asked to use, who may release it, and who did.",
358
371
  ),
@@ -369,6 +382,7 @@ export const REQUEST_FIELDS = [
369
382
  "capabilityOffer",
370
383
  "paymentOffer",
371
384
  "credentialOffer",
385
+ "pageAsk",
372
386
  ] as const;
373
387
  export type RequestField = (typeof REQUEST_FIELDS)[number];
374
388
  export type TranscriptRequests = Pick<TranscriptRow, RequestField>;
@@ -1,13 +1,13 @@
1
1
  [
2
- { "host": "preview-web-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "panel": "web" },
3
- { "host": "preview-my-app-abcdef012345.sbx.example.test:443", "sandboxId": "abcdef012345", "panel": "my-app" },
4
- { "host": "preview-shop--web-abcdef012345.example.com", "sandboxId": "abcdef012345", "panel": "shop--web" },
5
- { "host": "preview-web-0123456789ab.sbx.example.test", "sandboxId": "abcdef012345" },
6
- { "host": "preview--abcdef012345.sbx.example.test", "sandboxId": "abcdef012345" },
7
- { "host": "preview-x-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "panel": "x" },
8
- { "host": "port-1a2b3c4d5e6f-abcdef012345.sbx.example.test:8443", "sandboxId": "abcdef012345", "port": "1a2b3c4d5e6f" },
9
- { "host": "public-9f8e7d6c5b4a-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "public": "9f8e7d6c5b4a" },
10
- { "host": "sandbox-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345" },
2
+ { "host": "preview-web-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "panel": "web", "owner": "abcdef012345" },
3
+ { "host": "preview-my-app-abcdef012345.sbx.example.test:443", "sandboxId": "abcdef012345", "panel": "my-app", "owner": "abcdef012345" },
4
+ { "host": "preview-shop--web-abcdef012345.example.com", "sandboxId": "abcdef012345", "panel": "shop--web", "owner": "abcdef012345" },
5
+ { "host": "preview-web-0123456789ab.sbx.example.test", "sandboxId": "abcdef012345", "owner": "0123456789ab" },
6
+ { "host": "preview--abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "owner": "abcdef012345" },
7
+ { "host": "preview-x-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "panel": "x", "owner": "abcdef012345" },
8
+ { "host": "port-1a2b3c4d5e6f-abcdef012345.sbx.example.test:8443", "sandboxId": "abcdef012345", "port": "1a2b3c4d5e6f", "owner": "abcdef012345" },
9
+ { "host": "public-9f8e7d6c5b4a-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "public": "9f8e7d6c5b4a", "owner": "abcdef012345" },
10
+ { "host": "sandbox-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "owner": "abcdef012345", "daemon": "abcdef012345" },
11
11
  { "host": "app.example.com", "sandboxId": "abcdef012345" },
12
12
  { "host": "preview-web.localhost:8788", "panel": "web" },
13
13
  { "host": "port-a.localhost", "port": "a" },
@@ -16,5 +16,9 @@
16
16
  { "host": "127.0.0.1:8788" },
17
17
  { "host": "[::1]:8788" },
18
18
  { "host": "" },
19
- { "host": "Preview-web-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345" }
19
+ { "host": "Preview-web-abcdef012345.sbx.example.test", "sandboxId": "abcdef012345", "owner": "abcdef012345" },
20
+ { "host": "SANDBOX-abcdef012345.sbx.example.test:443", "owner": "abcdef012345", "daemon": "abcdef012345" },
21
+ { "host": "sandbox-abcdef012345x.sbx.example.test" },
22
+ { "host": "myapp-0123456789ab.example.com", "owner": "0123456789ab" },
23
+ { "host": "abcdef012345.local.sbx.example.test" }
20
24
  ]
@@ -1,5 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import {
3
+ hostOwnerId,
3
4
  labelHostname,
4
5
  panelFromHost,
5
6
  portHostname,
@@ -12,22 +13,26 @@ import {
12
13
  publicSlotFromHost,
13
14
  sandboxHostname,
14
15
  sandboxIdFromUrl,
16
+ sandboxIdOfDaemonUrl,
15
17
  syncFolder,
16
18
  } from "./hostnames.js";
17
19
 
18
20
  const ID = "abc123def456";
19
21
 
20
- // The cases the front's Rust router is held to as well (_sandbox/front, route.rs), read from the one file both run.
22
+ // The cases netd's Rust router is held to as well (_sandbox/netd, route.rs), read from the one file both run.
21
23
  interface HostCase {
22
24
  readonly host: string;
23
25
  readonly sandboxId?: string;
24
26
  readonly panel?: string;
25
27
  readonly port?: string;
26
28
  readonly public?: string;
29
+ // The sandbox the name routes to (hostOwnerId), and the minted id it carries as a daemon's own address.
30
+ readonly owner?: string;
31
+ readonly daemon?: string;
27
32
  }
28
33
  const HOST_CASES = JSON.parse(readFileSync(new URL("./hostnames.fixture.json", import.meta.url), "utf8")) as HostCase[];
29
34
 
30
- test.each(HOST_CASES)("the shared host cases parse as the front parses them: $host", (hostCase) => {
35
+ test.each(HOST_CASES)("the shared host cases parse as netd parses them: $host", (hostCase) => {
31
36
  expect({
32
37
  panel: panelFromHost(hostCase.host, hostCase.sandboxId),
33
38
  port: portSlotFromHost(hostCase.host, hostCase.sandboxId),
@@ -35,6 +40,20 @@ test.each(HOST_CASES)("the shared host cases parse as the front parses them: $ho
35
40
  }).toEqual({ panel: hostCase.panel, port: hostCase.port, public: hostCase.public });
36
41
  });
37
42
 
43
+ test.each(HOST_CASES)("the shared host cases name their owner, and a daemon address its minted id: $host", (hostCase) => {
44
+ expect({ owner: hostOwnerId(hostCase.host), daemon: sandboxIdOfDaemonUrl(hostCase.host) }).toEqual({
45
+ owner: hostCase.owner,
46
+ daemon: hostCase.daemon,
47
+ });
48
+ });
49
+
50
+ test("a daemon address is read with or without its scheme, and an unparsable one names no sandbox", () => {
51
+ expect(sandboxIdOfDaemonUrl(`https://sandbox-82789f4106b4.radarsu.com`)).toBe(`82789f4106b4`);
52
+ expect(sandboxIdOfDaemonUrl(`sandbox-82789f4106b4.radarsu.com/`)).toBe(`82789f4106b4`);
53
+ expect(sandboxIdOfDaemonUrl(`https://sandbox.example.com`)).toBeUndefined();
54
+ expect(sandboxIdOfDaemonUrl(`http://[not a host`)).toBeUndefined();
55
+ });
56
+
38
57
  test("preview and port hostnames round-trip through their Host-header parsers", () => {
39
58
  expect(panelFromHost(`${previewHostname("shop--web", ID, "example.com")}:443`, ID)).toBe("shop--web");
40
59
  expect(portSlotFromHost(`${portHostname("a", ID, "example.com")}:443`, ID)).toBe("a");
@@ -77,19 +77,45 @@ export const portSlotFromHost = (hostHeader: string | undefined, sandboxId: stri
77
77
  export const publicSlotFromHost = (hostHeader: string | undefined, sandboxId: string | undefined): string | undefined =>
78
78
  keyFromHost("public-", hostHeader, sandboxId);
79
79
 
80
+ // WHICH SANDBOX A NAME BELONGS TO is three questions, and each has its own answer below; they disagree on purpose:
81
+ // - hostOwnerId: the sandbox a hostname routes to, by the 12-hex id the platform mints into every name it makes. The
82
+ // edge routes a Host by it, and the platform's DNS reaper reads a record's owner by it.
83
+ // - sandboxIdOfDaemonUrl: the minted id in a daemon's own address, `sandbox-<id>` exactly, which is what the platform's
84
+ // lookup names. A preview or port name is not a daemon's address, and an own domain carries none, its /health says it.
85
+ // - sandboxIdFromUrl: the identity as the user sees it, whatever the label, for naming a sync folder.
86
+
87
+ const MINTED_ID = "[0-9a-f]{12}";
88
+ // A URL's hostname, scheme optional; undefined for one that does not parse.
89
+ const hostnameOf = (url: string): string | undefined => {
90
+ const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(url) ? url : `https://${url}`;
91
+ try {
92
+ return new URL(withScheme).hostname;
93
+ } catch {
94
+ return undefined;
95
+ }
96
+ };
97
+
98
+ // The sandbox that owns a Host (port optional): its leftmost DNS label is `sandbox-<id>` or ends in `-<id>` (a preview,
99
+ // port or outbox name). Anything else, including the loopback `<id>.local.<zone>` label, is no sandbox's.
100
+ export const hostOwnerId = (host: string): string | undefined => {
101
+ const label = host.split(":")[0]?.split(".")[0] ?? "";
102
+ return new RegExp(`-(${MINTED_ID})$`).exec(label)?.[1];
103
+ };
104
+
105
+ // The platform-minted id a daemon's address carries (`https://sandbox-<id>.<zone>`), or undefined for a sandbox behind a
106
+ // domain of its own, or an address that does not parse.
107
+ export const sandboxIdOfDaemonUrl = (url: string): string | undefined => {
108
+ const label = hostnameOf(url)?.split(".")[0] ?? "";
109
+ return new RegExp(`^${SANDBOX_PREFIX}(${MINTED_ID})$`).exec(label)?.[1];
110
+ };
111
+
80
112
  // The sandbox's identity as the user sees it: the URL's leading DNS label minus the `sandbox-` prefix. On the
81
113
  // own-Cloudflare path the label is whatever subdomain the owner chose, so that is the id there.
82
114
  export const sandboxIdFromUrl = (url: string | undefined): string | undefined => {
83
115
  if (url === undefined || url === "") {
84
116
  return undefined;
85
117
  }
86
- const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(url) ? url : `https://${url}`;
87
- let label: string;
88
- try {
89
- label = new URL(withScheme).hostname.split(".")[0] ?? "";
90
- } catch {
91
- return undefined;
92
- }
118
+ const label = hostnameOf(url)?.split(".")[0] ?? "";
93
119
  if (label === "" || label === SANDBOX_PREFIX) {
94
120
  return undefined;
95
121
  }
@@ -114,14 +140,7 @@ export const zoneFromUrl = (url: string | undefined): string | undefined => {
114
140
  if (url === undefined || url === "") {
115
141
  return undefined;
116
142
  }
117
- const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(url) ? url : `https://${url}`;
118
- let hostname: string;
119
- try {
120
- hostname = new URL(withScheme).hostname;
121
- } catch {
122
- return undefined;
123
- }
124
- const labels = hostname.split(".");
143
+ const labels = hostnameOf(url)?.split(".") ?? [];
125
144
  if (labels.length < 3) {
126
145
  return undefined;
127
146
  }
@@ -0,0 +1,3 @@
1
+ // Twelve lowercase hex characters, a gate applied before trusting an id off the wire (a hostname, a ticket, a path).
2
+ // Its own module so a browser bundle can take it without tunnel-ids.ts's node:crypto.
3
+ export const SANDBOX_ID = /^[0-9a-f]{12}$/;
@@ -4,8 +4,7 @@ import { createHash } from "node:crypto";
4
4
  // hashes, hashline anchors). node:crypto makes this subpath node-only.
5
5
  export const sha256Hex = (value: string): string => createHash("sha256").update(value).digest("hex");
6
6
 
7
- // Twelve lowercase hex characters, a gate applied before trusting an id off the wire (a hostname, a ticket).
8
- export const SANDBOX_ID = /^[0-9a-f]{12}$/;
7
+ export { SANDBOX_ID } from "./sandbox-id.js";
9
8
 
10
9
  // The sandbox's stable 12-hex id, digested from the connect token; every public hostname embeds it, and the platform's
11
10
  // grant mint, tunnelId lookup and the desktop agent's loopback dial all must derive the identical value.