@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
@@ -120,6 +120,18 @@ export const BrowserSessionSchema = z.object({
120
120
  pages: z
121
121
  .array(BrowserPageSchema)
122
122
  .describe("Every page it has open. A browser holds several at once, which is the reason it is listed apart from the terminals."),
123
+ // Opened from the browser view by the person, not by an agent's tool; absent on an agent's and from an older daemon.
124
+ own: z
125
+ .boolean()
126
+ .optional()
127
+ .describe("Your own window, opened from the browser view rather than by an agent. Yours to use whenever it is open; no agent drives it."),
128
+ // The conversation whose agent opened it; the client reads that agent's turn to know whether it is driving now.
129
+ owner: z
130
+ .string()
131
+ .optional()
132
+ .describe(
133
+ "The conversation whose agent opened it. While that conversation has a turn running the agent may act in this window at any moment; once it has not, the window is yours to use.",
134
+ ),
123
135
  });
124
136
  export type BrowserPage = z.infer<typeof BrowserPageSchema>;
125
137
  export type BrowserSession = z.infer<typeof BrowserSessionSchema>;
@@ -128,6 +140,44 @@ export const BrowsersListSchema = z.object({
128
140
  });
129
141
  export type BrowsersList = z.infer<typeof BrowsersListSchema>;
130
142
  export const BrowserNameParamSchema = z.object({ name: z.string().describe("Which browser.") });
143
+ export const OpenBrowserInputSchema = z.object({
144
+ url: z.string().optional().describe("Where the new tab goes. Absent opens a blank tab, the way a browser's own new tab does."),
145
+ });
146
+ export type OpenBrowserInput = z.infer<typeof OpenBrowserInputSchema>;
147
+ export const OpenBrowserResultSchema = z.object({
148
+ name: z.string().describe("The window it opened in: what the browser view, the live picture and the close route take."),
149
+ pageId: z.string().optional().describe("The tab it opened, once the window has it. Absent when the tab had not appeared in time."),
150
+ });
151
+ export type OpenBrowserResult = z.infer<typeof OpenBrowserResultSchema>;
152
+ // One window on the sandbox's desktop, as its window manager lists it. The id is what /system/desktop-view takes as
153
+ // `window` to stream that window alone, and what the agent's own desktop tools name it by.
154
+ export const DesktopWindowSchema = z.object({
155
+ id: z.string().describe("The window, as the desktop's window manager names it. Open a picture of it alone by passing this to the desktop view."),
156
+ app: z.string().describe("The program it belongs to, as the system names it (`xterm`, `Code`), not what a person calls it."),
157
+ title: z.string().describe("What its title bar says. Empty for a window that has none."),
158
+ focused: z.boolean().describe("Whether it has the keyboard: typing on the desktop goes to this window."),
159
+ });
160
+ export type DesktopWindow = z.infer<typeof DesktopWindowSchema>;
161
+ // The sandbox's own desktop (desktop/agent-desktop.ts): one screen, so a state rather than a roster. `windows` is what
162
+ // tells an empty desktop from a broken picture of one, and what puts its tile on the rail; `list` is what each of them
163
+ // is, for a tab that shows one window alone.
164
+ export const DesktopStateSchema = z.object({
165
+ running: z
166
+ .boolean()
167
+ .describe("Whether the desktop is up. It starts the first time anyone looks at it, you or an agent, and stays up until the sandbox restarts."),
168
+ display: z.string().optional().describe("The X display it is, present while it runs: a program started with DISPLAY set to this opens its window there."),
169
+ windows: z
170
+ .number()
171
+ .int()
172
+ .nonnegative()
173
+ .optional()
174
+ .describe("How many windows are open on it. None is an empty desktop. Absent while it is not running, or when it has no window manager to ask."),
175
+ list: z
176
+ .array(DesktopWindowSchema)
177
+ .optional()
178
+ .describe("Each window open on it, absent when it is not running or has no window manager to ask."),
179
+ });
180
+ export type DesktopState = z.infer<typeof DesktopStateSchema>;
131
181
  // A subagent is any agent another agent started, and every surface shows one the same way whichever mechanism started
132
182
  // it. The kind names the mechanism, never a second sort of thing:
133
183
  // subagent: in-process, the runtime's own Agent/Task tool, tracked via SubagentStart/Stop hooks and task_* messages
@@ -0,0 +1,47 @@
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { packageRoot } from "@intentic/constants/node";
4
+ import { PreparingUpdateSchema } from "./system.js";
5
+ import { UpdateOutcomeSchema } from "./updates.js";
6
+
7
+ // The update markers `ic` writes onto /history for the daemon to read, spelled once here: golden/update-outcome.json
8
+ // and golden/update-preparing.json are these examples as JSON, and ic's Rust test (_sandbox/ic/src/sandbox/host_files.rs)
9
+ // holds what it writes to them field for field. Where each file lives is the daemon's to say (its own golden,
10
+ // host-files.json). A change here that the committed file does not carry fails, naming the file;
11
+ // `INTENTIC_WRITE_GOLDEN=1` rewrites them, and the Rust test then says whether ic still writes them.
12
+
13
+ const GOLDEN = join(packageRoot(import.meta.url), "golden");
14
+
15
+ // Every field set, and the result whose spelling is easiest to get wrong.
16
+ const outcome = UpdateOutcomeSchema.parse({
17
+ result: "rolled-back",
18
+ verb: "update",
19
+ at: 1_791_240_330_000,
20
+ from: "1.399.0",
21
+ to: "1.400.0",
22
+ reason: "the new version's daemon kept crashing (3 restarts)",
23
+ log: "/home/owner/.intentic/logs/update-sandbox-0123456789ab.log",
24
+ keepUntil: 1_791_326_730_000,
25
+ });
26
+
27
+ const preparing = PreparingUpdateSchema.parse({
28
+ channel: "stable",
29
+ startedAt: 1_791_240_300_000,
30
+ at: 1_791_240_330_000,
31
+ phase: "download",
32
+ percent: 42,
33
+ });
34
+
35
+ const goldens = [
36
+ { file: "update-outcome.json", value: outcome },
37
+ { file: "update-preparing.json", value: preparing },
38
+ ];
39
+
40
+ test.each(goldens)("golden/$file is the contract's example, as the host writes it", ({ file, value }) => {
41
+ const path = join(GOLDEN, file);
42
+ const expected = `${JSON.stringify(value, undefined, 2)}\n`;
43
+ if (process.env["INTENTIC_WRITE_GOLDEN"] === "1") {
44
+ writeFileSync(path, expected);
45
+ }
46
+ expect(readFileSync(path, "utf8")).toBe(expected);
47
+ });
@@ -52,6 +52,10 @@ export type SkipUpdateInput = z.infer<typeof SkipUpdateInputSchema>;
52
52
  export const RollbackTargetSchema = z.object({
53
53
  image: z.string().describe("The local image a rollback would run, pinned under a tag no other flow writes."),
54
54
  version: z.string().optional().describe("What that image says it is. Absent when it would not say."),
55
+ download: z
56
+ .boolean()
57
+ .optional()
58
+ .describe("The local pin is gone (pruned outside ic); going back downloads the published image of `version`."),
55
59
  });
56
60
  export type RollbackTarget = z.infer<typeof RollbackTargetSchema>;
57
61
 
@@ -33,6 +33,8 @@ export const WorkspaceSearchQuerySchema = z.object({
33
33
  limit: z.coerce.number().int().positive().optional().describe("How many results to return."),
34
34
  after: z.string().optional().describe("Resume from the cursor a previous answer handed back."),
35
35
  });
36
+ // The query's verb enum.
37
+ export type WorkspaceSearchMode = NonNullable<z.infer<typeof WorkspaceSearchQuerySchema>["mode"]>;
36
38
  export const WorkspaceSearchTagSchema = z.object({
37
39
  kind: z
38
40
  .enum(["def", "text", "sem", "bm25", "rerank", "path", "import", "call", "type", "write", "fuzzy", "heuristic"])
@@ -35,6 +35,9 @@ export interface WorkspaceTreeEntry {
35
35
  readonly path: string;
36
36
  readonly type: "file" | "dir";
37
37
  readonly size?: number | undefined;
38
+ // When a file last changed, in epoch milliseconds, from the stat that already reads its size; a directory has none,
39
+ // since a plain one is listed from its dirent alone. The home's date grouping reads it (homeOrder.ts).
40
+ readonly mtime?: number | undefined;
38
41
  // Ignored by tooling (node_modules, .git, gitignored paths, browser profiles); client greys the row.
39
42
  readonly ignored?: boolean | undefined;
40
43
  // Set when this entry is a symlink; `type` above is then its target's type.
@@ -47,6 +50,10 @@ export const WorkspaceTreeEntrySchema: z.ZodType<WorkspaceTreeEntry> = z.object(
47
50
  path: z.string().describe("Its full path from the workspace root, which feeds straight back into the file routes."),
48
51
  type: z.enum(["file", "dir"]).describe("What it is. For a link, what it points at, so a link to a folder opens like a folder."),
49
52
  size: z.number().optional().describe("Size in bytes, for a file."),
53
+ mtime: z
54
+ .number()
55
+ .optional()
56
+ .describe("When a file last changed, in milliseconds since 1970. A folder has none. Absent too where the listing could not read it."),
50
57
  ignored: z
51
58
  .boolean()
52
59
  .optional()
@@ -84,7 +91,11 @@ export const WorkspaceTreeSchema = z.object({
84
91
  export type WorkspaceTree = z.infer<typeof WorkspaceTreeSchema>;
85
92
  // What moved in the shared tree between two generations: every folder whose own entries changed, parents first.
86
93
  export const WorkspaceTreeDeltaSchema = z.object({
87
- from: z.number().int().nonnegative().describe("The generation this applies on top of. A reader holding any other fetches the tree afresh instead."),
94
+ from: z
95
+ .number()
96
+ .int()
97
+ .nonnegative()
98
+ .describe("The generation this applies on top of. A reader holding any other fetches the tree afresh instead."),
88
99
  generation: z.number().int().nonnegative().describe("The generation it leaves the tree at."),
89
100
  dirs: z
90
101
  .array(
@@ -143,7 +154,9 @@ export const WorkspaceDownloadTicketQuerySchema = WorkspaceScopeSchema.extend({
143
154
  .describe("The files and folders to download together, as workspace paths. A folder brings everything inside it."),
144
155
  });
145
156
  export const WorkspaceDownloadTicketSchema = z.object({
146
- ticket: z.string().describe("Hand this to the download route in the query string. It buys exactly the selection it was minted for, once resolved."),
157
+ ticket: z
158
+ .string()
159
+ .describe("Hand this to the download route in the query string. It buys exactly the selection it was minted for, once resolved."),
147
160
  expiresAt: z.number().describe("When it stops working, in milliseconds. It is meant to be used at once."),
148
161
  filename: z.string().describe("What the archive is saved as, so a caller can say what is on its way."),
149
162
  });
@@ -182,7 +195,8 @@ export const WorkspaceFilePresentSchema = z.object({
182
195
  .describe(
183
196
  "Which tree answered. True when no conversation was named, and also when one was but its own copy has no such file, which is the case a reader has to be told about rather than left to assume.",
184
197
  ),
185
- // Absent means the window decoded cleanly. Set by a server that checks (the desktop app's folder server does).
198
+ // Absent means the window decoded cleanly. Both servers set it the same way (@intentic/base/utf8-text): the daemon
199
+ // for /work and the desktop app's folder server, for a UTF-16 file and for any window that is not UTF-8.
186
200
  lossy: z
187
201
  .literal(true)
188
202
  .optional()
@@ -190,6 +204,8 @@ export const WorkspaceFilePresentSchema = z.object({
190
204
  "The bytes are not valid UTF-8, so `content` holds replacement characters where they failed to decode. Saving that text back would change the file, so treat it as read-only.",
191
205
  ),
192
206
  });
207
+ // One window of a file's text; `size` is the whole file, `offset`/`bytes` the byte range `content` decodes from.
208
+ export type WorkspaceFileWindow = z.infer<typeof WorkspaceFilePresentSchema>;
193
209
  // Nothing there is an answer, not a failure: most reads here are read-it-if-there, and a 404 would spam the browser's
194
210
  // network log per miss. A refused read (an escape, a denylisted path) is still an error.
195
211
  export const WorkspaceFileAbsentSchema = z.object({
@@ -201,6 +217,7 @@ export const WorkspaceFileAbsentSchema = z.object({
201
217
  path: z.string().describe("The path, as asked for."),
202
218
  });
203
219
  export const WorkspaceFileSchema = z.discriminatedUnion("present", [WorkspaceFilePresentSchema, WorkspaceFileAbsentSchema]);
220
+ export type WorkspaceFile = z.infer<typeof WorkspaceFileSchema>;
204
221
  // A file's derived text: the markdown shadow fileq keeps beside every document, picture, recording and archive, which
205
222
  // is what an agent reads instead of the bytes. About the shared tree only, since a conversation's own checkout is never
206
223
  // shadowed; no scope field, for that reason.
@@ -208,7 +225,9 @@ export const WorkspaceDerivedQuerySchema = z.object({
208
225
  path: z
209
226
  .string()
210
227
  .min(1)
211
- .describe("The file you want the text of, as a workspace path. The real file, not its shadow: where the text is kept is this route's business."),
228
+ .describe(
229
+ "The file you want the text of, as a workspace path. The real file, not its shadow: where the text is kept is this route's business.",
230
+ ),
212
231
  });
213
232
  // Where one file stands, which is the question a reader looking at a missing or stale rendering is actually asking.
214
233
  // Nothing renders in the background: a file has text once someone asks for it, and fileq keeps it until the file changes.
@@ -225,7 +244,10 @@ export const WorkspaceDerivedPresentSchema = z.object({
225
244
  path: z.string().describe("The file it was derived from, as asked for."),
226
245
  content: z.string().describe("The text itself, as markdown."),
227
246
  deriver: z.string().describe("Which reader wrote it, and at which version, such as `pdf+ocr v1`. A file re-derives when this changes."),
228
- derivedAt: z.string().optional().describe("When it was written, as an ISO timestamp. Absent only for a shadow whose front matter was edited by hand."),
247
+ derivedAt: z
248
+ .string()
249
+ .optional()
250
+ .describe("When it was written, as an ISO timestamp. Absent only for a shadow whose front matter was edited by hand."),
229
251
  title: z.string().optional().describe("The title the format carried, where it carried one."),
230
252
  notes: z
231
253
  .array(z.string())
@@ -233,7 +255,9 @@ export const WorkspaceDerivedPresentSchema = z.object({
233
255
  "Every cap and degradation the derivation hit: a sheet cut to 200 rows, a book cut at 2 MB, a scan recognised rather than read. Show these with the text, since text that was cut reading as complete is the one failure this whole feature cannot afford.",
234
256
  ),
235
257
  tokens: z.number().describe("Roughly what an agent spends reading it, by the same four-chars-a-token estimate every budget here uses."),
236
- truncated: z.boolean().describe("Whether this is only the start of the shadow, cut to keep the response sendable. The file on disk holds the rest."),
258
+ truncated: z
259
+ .boolean()
260
+ .describe("Whether this is only the start of the shadow, cut to keep the response sendable. The file on disk holds the rest."),
237
261
  stale: z
238
262
  .boolean()
239
263
  .describe(
@@ -242,15 +266,21 @@ export const WorkspaceDerivedPresentSchema = z.object({
242
266
  });
243
267
  export const WorkspaceDerivedAbsentSchema = z.object({
244
268
  ...DerivedStandingShape,
245
- present: z.literal(false).describe("There is no derived text for that file. Read `state` before saying so to anyone: absent and being read are different answers."),
269
+ present: z
270
+ .literal(false)
271
+ .describe("There is no derived text for that file. Read `state` before saying so to anyone: absent and being read are different answers."),
246
272
  path: z.string().describe("The file, as asked for."),
247
273
  derivable: z
248
274
  .boolean()
249
- .describe("Whether this format can be turned into text at all. True means asking for it to be derived is worth offering; false means nothing here reads this format."),
275
+ .describe(
276
+ "Whether this format can be turned into text at all. True means asking for it to be derived is worth offering; false means nothing here reads this format.",
277
+ ),
250
278
  reason: z
251
279
  .string()
252
280
  .optional()
253
- .describe("Why there is none, when deriving was just attempted and produced nothing: the file is too large, corrupt, or of a format no reader claims."),
281
+ .describe(
282
+ "Why there is none, when deriving was just attempted and produced nothing: the file is too large, corrupt, or of a format no reader claims.",
283
+ ),
254
284
  });
255
285
  export const WorkspaceDerivedSchema = z.discriminatedUnion("present", [WorkspaceDerivedPresentSchema, WorkspaceDerivedAbsentSchema]);
256
286
  export type WorkspaceDerived = z.infer<typeof WorkspaceDerivedSchema>;
@@ -291,9 +321,7 @@ export const WorkspaceDeletedSchema = z.object({
291
321
  trashed: z
292
322
  .string()
293
323
  .optional()
294
- .describe(
295
- "The trash id that brings it back through the restore call, for a day. Absent when there was nothing at that path to delete.",
296
- ),
324
+ .describe("The trash id that brings it back through the restore call, for a day. Absent when there was nothing at that path to delete."),
297
325
  });
298
326
  export type WorkspaceDeleted = z.infer<typeof WorkspaceDeletedSchema>;
299
327
  export const WorkspaceRestoreSchema = z.object({
@@ -111,3 +111,43 @@ export const ArrivalHostsSchema = z.object({ hosts: z.array(ArrivalHostSchema) }
111
111
  // Reads a setup off a connected device instead of an upload; answers with a plan exactly like the upload door does.
112
112
  export const ArrivalScanSchema = z.object({ host: z.string().min(1) });
113
113
  export type ArrivalScan = z.infer<typeof ArrivalScanSchema>;
114
+
115
+ // A model provider's API key found on one of the owner's devices, offered as a model endpoint. Only plain API keys are
116
+ // read: an OAuth login is bound to the install that holds it, and copying one signs either side out. The key itself
117
+ // never crosses this wire, only its last four characters.
118
+ export const ProviderKeySourceSchema = z.enum(["hermes", "openclaw", "opencode", "gemini", "codex"]);
119
+ export type ProviderKeySource = z.infer<typeof ProviderKeySourceSchema>;
120
+ export const ProviderKeySchema = z.object({
121
+ // A digest of the key, never the key: the same key reads as the same row from any device, and on every read.
122
+ id: z.string(),
123
+ // The provider as this sandbox names it (`openrouter`, `anthropic`), or the source's own name for one it does not
124
+ // know.
125
+ provider: z.string(),
126
+ // What to call it ("OpenRouter").
127
+ label: z.string(),
128
+ // The tool whose files held it; a key held by several is attributed to the first in this enum's order.
129
+ source: ProviderKeySourceSchema,
130
+ // The device it was read from.
131
+ host: z.string(),
132
+ // The key's last four characters.
133
+ hint: z.string(),
134
+ // This sandbox knows where the provider serves models; false is a key reported and not offered.
135
+ applicable: z.boolean(),
136
+ // A model endpoint here already holds this key.
137
+ added: z.boolean(),
138
+ });
139
+ export type ProviderKey = z.infer<typeof ProviderKeySchema>;
140
+ // No connected device is an empty list, not an error.
141
+ export const ProviderKeysSchema = z.object({ keys: z.array(ProviderKeySchema) });
142
+ export type ProviderKeys = z.infer<typeof ProviderKeysSchema>;
143
+
144
+ // The rows to add, by id. The daemon reads the devices again rather than trusting a value the browser never held.
145
+ export const ProviderKeysApplySchema = z.object({ ids: z.array(z.string().min(1)).min(1) });
146
+ export type ProviderKeysApply = z.infer<typeof ProviderKeysApplySchema>;
147
+ export const ProviderKeysAppliedSchema = z.object({
148
+ // Each row that now has an endpoint, with that endpoint's capability id; one already added is listed, not added twice.
149
+ added: z.array(z.object({ id: z.string(), capability: z.string() })),
150
+ // Each row that did not land, in its own words: gone from the device since it was listed, or refused by the apply.
151
+ failed: z.array(z.object({ id: z.string(), error: z.string() })),
152
+ });
153
+ export type ProviderKeysApplied = z.infer<typeof ProviderKeysAppliedSchema>;
@@ -2,7 +2,7 @@ import { readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { shrunkSurfaces } from "@intentic/constants/contract-shrink";
4
4
  import { packageRoot } from "@intentic/constants/node";
5
- import { RAW_ROUTE_LIST } from "../protocol/raw-routes.js";
5
+ import { RAW_ROUTE_LIST } from "../protocol/raw/raw-routes.js";
6
6
  import type { RouteMeta } from "../protocol/route-meta.js";
7
7
  import { accessChanges, currentLock, serializeLock } from "./contract-lock.js";
8
8
 
@@ -1,8 +1,8 @@
1
1
  // contract.lock.json is every exported schema serialized to canonical JSON Schema, so git can flag a wire-contract
2
2
  // change. contract-shrink demands a `!` commit with a Breaking-Note when a schema, field or type shrinks; additions
3
3
  // pass freely. Derived from the package's exports, not a hand-kept list, plus the wire no oRPC route carries: the
4
- // manifests the Rust crates that define it write beside their TypeScript (the tunnel, what a browser sees of the front
5
- // and the edge, and the front's control socket with Node), under `wire:` names no export can take.
4
+ // manifests the Rust crates that define it write beside their TypeScript (the tunnel, what a browser sees of netd
5
+ // and the edge, and netd's control socket with Node), under `wire:` names no export can take.
6
6
  //
7
7
  // And who reaches each route: every raw route's and every procedure's RouteMeta, each reach field with its default
8
8
  // resolved (route-meta.ts `routeAccess`), under `access:METHOD /path`. Resolved, so every field is a value on every
@@ -81,8 +81,8 @@ export const accessChanges = (baseText: string, headText: string): string[] => {
81
81
  });
82
82
  };
83
83
 
84
- // Each written by its crate's own test: `tunnel`, `browser-wire` and `front-wire` under _sandbox/front/crates.
85
- const WIRE_MANIFESTS = ["browser-wire", "front-wire", "tunnel"] as const;
84
+ // Each written by its crate's own test: `tunnel`, `browser-wire` and `netd-wire` under _sandbox/netd/crates.
85
+ const WIRE_MANIFESTS = ["browser-wire", "netd-wire", "tunnel"] as const;
86
86
 
87
87
  export const currentLock = (): Record<string, unknown> => {
88
88
  const lock: Record<string, unknown> = {};
@@ -103,7 +103,7 @@ export const currentLock = (): Record<string, unknown> => {
103
103
  }
104
104
  for (const manifest of WIRE_MANIFESTS) {
105
105
  // Read from src/ whether this runs from src/ or dist/: the manifests are data `cargo test` writes, never compiled.
106
- const text = readFileSync(join(packageRoot(import.meta.url), "src", "front", "generated", `${manifest}.json`), "utf8");
106
+ const text = readFileSync(join(packageRoot(import.meta.url), "src", "netd", "generated", `${manifest}.json`), "utf8");
107
107
  lock[`wire:${manifest}`] = sorted(JSON.parse(text));
108
108
  }
109
109
  return { ...lock, ...accessEntries() };
@@ -95,10 +95,43 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
95
95
  // A rebuild's ask that the next boot resume the turns it cuts (restart-resume.ts): about this machine's next boot only,
96
96
  // read once by it, so a moved sandbox starts without one.
97
97
  { path: "restart-resume.json", portability: "derived" },
98
+ // Spawned children paused on a re-run the sandbox booked for them (agent/subagents/paused-children.ts): the booking
99
+ // is this process's memory, so the next boot tells each parent that its child stays stopped, then forgets the entry.
100
+ // About this machine's restarts, so a moved sandbox starts without it.
101
+ { path: "paused-children.json", portability: "derived" },
102
+ // When this machine's daemon booted (system/boot/boot-history.ts), for telling a restart storm from a restart: about
103
+ // this machine's restarts, so a moved sandbox starts without it.
104
+ { path: "boot-history.json", portability: "derived" },
105
+ // When each housekeeping chore last ran (system/chore-clock.ts), so a restart does not run a daily one again; a moved
106
+ // sandbox runs each once at its first boot.
107
+ { path: "chore-clock.json", portability: "derived" },
108
+ // The last disk measurement (system/resources/storage/disk-storage.ts), kept so a restart still shows one, dated. About
109
+ // this machine's volumes, so a moved sandbox measures its own.
110
+ { path: "storage-scan.json", portability: "derived" },
111
+
112
+ /* ---- the unprivileged agent's execution domain (the daemon's workload/domain/agent-domain-view.ts) ---- */
113
+
114
+ // The agent's own HOME and the per-runtime homes beside it: what the agent keeps outlives a recreate, which includes
115
+ // any login a command-line tool it ran saved there. `secret` for that, since the daemon cannot tell one from the rest.
116
+ {
117
+ path: "agent-home/",
118
+ portability: "secret",
119
+ note: "Sign the agent's own command-line tools in again where it used them.",
120
+ },
121
+ {
122
+ path: "agent-homes/",
123
+ portability: "secret",
124
+ note: "Sign the agent's own command-line tools in again where it used them.",
125
+ },
126
+ // Container storage a domain's runtime filled, pulled again on demand.
127
+ { path: "agent-containers/", portability: "derived" },
128
+ // Each domain view's staging directory (`agent-domain-` and a random suffix), removed when its domain ends.
129
+ { path: "agent-domain-", portability: "derived" },
98
130
 
99
131
  /* ---- credentials ---- */
100
132
 
101
- // The ssh alias dir ~/.ssh/intentic-hosts symlinks to: per-host config, keys and passphrases.
133
+ // The ssh alias dir ~/.ssh/intentic-hosts symlinks to: per-host config, each key's public half, password files, and a
134
+ // key with a passphrase. Every other private key is in the key store under the auth root (ssh-keys/).
102
135
  {
103
136
  path: "ssh-hosts/",
104
137
  portability: "secret",
@@ -122,6 +155,25 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
122
155
 
123
156
  // Signs every browser session cookie; carrying it would let the holder mint sessions against the target.
124
157
  { path: "session-secret", portability: "identity", note: "Sign in again, the target signs its own sessions." },
158
+ // Who owns this sandbox, who else may reach it and at what tier, and the hashed control tokens programs present:
159
+ // the daemon's to decide, so kept off the workspace every turn writes (auth/members/identity-off-workspace.ts moved
160
+ // them from `.intentic/identity/` on 2026-10-06). An access list that traveled would let a source sandbox hand
161
+ // itself the target's ownership, and a token authenticates against the sandbox that minted it.
162
+ { path: "identity/owner.json", portability: "identity", note: "The target is bound by its own owner's first sign-in." },
163
+ {
164
+ path: "identity/members.json",
165
+ portability: "identity",
166
+ note: "Re-invite collaborators from the Access tab, a grant is the platform's record, and the target enforces its own copy.",
167
+ },
168
+ { path: "identity/control-tokens.json", portability: "identity", note: "Mint fresh control tokens, the old ones authenticate against the source sandbox." },
169
+ // Public keys, the owner's require-a-passkey switch and the hashes of their recovery codes, moved from
170
+ // `.intentic/identity/passkeys.json` the same way (the passkeys-off-workspace step), since a passkey sign-in trusts
171
+ // the row it finds: a copy that traveled would let a source sandbox's passkeys open the target.
172
+ {
173
+ path: "identity/passkeys.json",
174
+ portability: "identity",
175
+ note: "Passkeys are bound to the sandbox they were registered with: add them again on the new one from its Access tab.",
176
+ },
125
177
  {
126
178
  path: "browser-access-disabled",
127
179
  portability: "identity",
@@ -139,8 +191,20 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
139
191
  { path: "webext-enrollments.json", portability: "identity", note: "Pair your browser again from its card: the extension is still installed." },
140
192
  // The browser pairing burn list; a redeemed pairing must not read as fresh wherever this file travels.
141
193
  { path: "webext-pair-consumed.json", portability: "identity" },
194
+ // A phone's enrollment and its wake channel, paired to this sandbox; the app on the phone stays installed.
195
+ { path: "phone-enrollments.json", portability: "identity", note: "Pair your phone again from its card: the app is still installed." },
196
+ { path: "phone-pair-consumed.json", portability: "identity" },
197
+ { path: "phone-wake.json", portability: "identity" },
142
198
  // Setup-device pairing burn list; carrying it would mark another sandbox's fresh pairing as spent.
143
199
  { path: "host-pair-consumed.json", portability: "identity" },
200
+ // Lands waiting for the computer whose folder they go to, and which computer last held each attached folder
201
+ // (conversations/land/project-delivery.ts): about the machine this sandbox runs beside, whose folders a moved
202
+ // sandbox does not have.
203
+ { path: "project-deliveries.json", portability: "identity" },
204
+ // The folders attached to this computer's own sandbox, by name (the daemon's system/projects-registry.ts): which of the
205
+ // computer's folders sync in, so it stays with the sandbox that runs beside them. The folders' copies and repos travel
206
+ // with /work and gits/; a moved sandbox treats them as ordinary repos.
207
+ { path: "projects.json", portability: "identity", note: "Attach the folders again from the desktop app on the computer that holds them." },
144
208
  // A runner's enrollment names this sandbox as parent; elsewhere its digest would dial the old parent.
145
209
  { path: "runner-enrollments.json", portability: "identity" },
146
210
  { path: "runner-pair-consumed.json", portability: "identity" },
@@ -152,6 +216,13 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
152
216
  { path: "hook-requests.json", portability: "derived" },
153
217
  // The owner's yes to each workspace extension's declared powers, decided again by the target's owner.
154
218
  { path: "extension-approvals.json", portability: "identity", note: "Approve the extensions written in this workspace again from Extensions." },
219
+ // The owner's yes to each item in the approvals queue, pinned to what it will do: the queue travels with /work, and
220
+ // an item that arrives approved without its yes is not carried out until the target's owner gives it again.
221
+ {
222
+ path: "approval-decisions.json",
223
+ portability: "identity",
224
+ note: "Approve again from Approvals anything that was approved and had not run yet.",
225
+ },
155
226
  { path: "local-cert/", portability: "identity" },
156
227
 
157
228
  /* ---- the state engine's own bookkeeping (the daemon's store/evolution/state-journal.ts) ---- */
@@ -27,6 +27,9 @@ const RUNTIME_DOMAINS = [
27
27
  // The agent's Chromiums and open pages, daemon-held, minted from its own browser tool-call hooks.
28
28
  { domain: "browsers", invalidates: [["browsers"]] },
29
29
 
30
+ // The sandbox's own desktop: up, and how many windows are open on it, watched off its window manager's client list.
31
+ { domain: "desktop", invalidates: [["desktop"]] },
32
+
30
33
  // A connection's status as its last probe found it: pushed when a probe behind a served answer finds another one, and
31
34
  // when a browser sign-in is saved or cleared, which is what moves an account's card off "log in".
32
35
  { domain: "capabilities", invalidates: [["capabilities"]] },
@@ -39,6 +42,7 @@ const RUNTIME_DOMAINS = [
39
42
  // carries a device reading that landed too late for the reader waiting on it (hosts/device-reports.ts).
40
43
  { domain: "hosts", invalidates: [["capabilities"], ["devices"]] },
41
44
  { domain: "webext", invalidates: [["capabilities"]] },
45
+ { domain: "phones", invalidates: [["capabilities"], ["phones"]] },
42
46
  { domain: "runners", invalidates: [["runners"]] },
43
47
 
44
48
  // Watched because rows act on their own while nobody's watching (coming due, a turn writing back).