@intentic/sandbox-contract 1.430.0 → 1.432.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 (711) hide show
  1. package/README.md +22 -5
  2. package/dist/app-routes/app-pages.d.ts +1 -0
  3. package/dist/app-routes/app-pages.d.ts.map +1 -1
  4. package/dist/app-routes/app-pages.js +1 -0
  5. package/dist/app-routes/app-pages.js.map +1 -1
  6. package/dist/app-routes/index.d.ts +1 -0
  7. package/dist/app-routes/index.d.ts.map +1 -1
  8. package/dist/app-routes/index.js +1 -0
  9. package/dist/app-routes/index.js.map +1 -1
  10. package/dist/app-routes/return-path.d.ts +2 -0
  11. package/dist/app-routes/return-path.d.ts.map +1 -0
  12. package/dist/app-routes/return-path.js +8 -0
  13. package/dist/app-routes/return-path.js.map +1 -0
  14. package/dist/briefs/agent-ask.d.ts +10 -0
  15. package/dist/briefs/agent-ask.d.ts.map +1 -0
  16. package/dist/briefs/agent-ask.js +2 -0
  17. package/dist/briefs/agent-ask.js.map +1 -0
  18. package/dist/{chores/extension-update.d.ts → briefs/extension-update-brief.d.ts} +1 -1
  19. package/dist/briefs/extension-update-brief.d.ts.map +1 -0
  20. package/dist/{chores/extension-update.js → briefs/extension-update-brief.js} +2 -2
  21. package/dist/briefs/extension-update-brief.js.map +1 -0
  22. package/dist/chores/digest.d.ts.map +1 -1
  23. package/dist/chores/digest.js.map +1 -1
  24. package/dist/chores/index.d.ts +2 -2
  25. package/dist/chores/index.d.ts.map +1 -1
  26. package/dist/chores/index.js +1 -1
  27. package/dist/chores/index.js.map +1 -1
  28. package/dist/chores/prompt.d.ts +1 -9
  29. package/dist/chores/prompt.d.ts.map +1 -1
  30. package/dist/chores/prompt.js +1 -1
  31. package/dist/chores/prompt.js.map +1 -1
  32. package/dist/chores/stack.d.ts.map +1 -1
  33. package/dist/chores/stack.js.map +1 -1
  34. package/dist/chores/verdict.d.ts.map +1 -1
  35. package/dist/chores/verdict.js.map +1 -1
  36. package/dist/chores/workspace-scope.d.ts +1 -3
  37. package/dist/chores/workspace-scope.d.ts.map +1 -1
  38. package/dist/chores/workspace-scope.js +1 -3
  39. package/dist/chores/workspace-scope.js.map +1 -1
  40. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  41. package/dist/contracts/accounts.contract.js +2 -0
  42. package/dist/contracts/accounts.contract.js.map +1 -1
  43. package/dist/contracts/agent.contract.d.ts +1226 -12
  44. package/dist/contracts/agent.contract.d.ts.map +1 -1
  45. package/dist/contracts/agents.contract.d.ts +2665 -733
  46. package/dist/contracts/agents.contract.d.ts.map +1 -1
  47. package/dist/contracts/agents.contract.js +35 -5
  48. package/dist/contracts/agents.contract.js.map +1 -1
  49. package/dist/contracts/automations.contract.d.ts +90 -8
  50. package/dist/contracts/automations.contract.d.ts.map +1 -1
  51. package/dist/contracts/automations.contract.js +1 -0
  52. package/dist/contracts/automations.contract.js.map +1 -1
  53. package/dist/contracts/capabilities.contract.d.ts +49 -0
  54. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  55. package/dist/contracts/capabilities.contract.js +24 -1
  56. package/dist/contracts/capabilities.contract.js.map +1 -1
  57. package/dist/contracts/ci.contract.d.ts +222 -95
  58. package/dist/contracts/ci.contract.d.ts.map +1 -1
  59. package/dist/contracts/ci.contract.js +87 -26
  60. package/dist/contracts/ci.contract.js.map +1 -1
  61. package/dist/contracts/device-ci-runners.contract.d.ts +108 -0
  62. package/dist/contracts/device-ci-runners.contract.d.ts.map +1 -0
  63. package/dist/contracts/device-ci-runners.contract.js +56 -0
  64. package/dist/contracts/device-ci-runners.contract.js.map +1 -0
  65. package/dist/contracts/device-stacks.contract.d.ts +129 -0
  66. package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
  67. package/dist/contracts/device-stacks.contract.js +66 -0
  68. package/dist/contracts/device-stacks.contract.js.map +1 -0
  69. package/dist/contracts/device.contract.d.ts +74 -0
  70. package/dist/contracts/device.contract.d.ts.map +1 -1
  71. package/dist/contracts/extensions.contract.d.ts +604 -0
  72. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  73. package/dist/contracts/extensions.contract.js +11 -2
  74. package/dist/contracts/extensions.contract.js.map +1 -1
  75. package/dist/contracts/git.contract.d.ts +7 -0
  76. package/dist/contracts/git.contract.d.ts.map +1 -1
  77. package/dist/contracts/needs.contract.d.ts +1097 -18
  78. package/dist/contracts/needs.contract.d.ts.map +1 -1
  79. package/dist/contracts/offload.contract.d.ts +25 -0
  80. package/dist/contracts/offload.contract.d.ts.map +1 -1
  81. package/dist/contracts/ports.contract.d.ts +8 -0
  82. package/dist/contracts/ports.contract.d.ts.map +1 -1
  83. package/dist/contracts/ports.contract.js +6 -5
  84. package/dist/contracts/ports.contract.js.map +1 -1
  85. package/dist/contracts/remote.contract.d.ts +1 -0
  86. package/dist/contracts/remote.contract.d.ts.map +1 -1
  87. package/dist/contracts/runner.contract.d.ts +1203 -9
  88. package/dist/contracts/runner.contract.d.ts.map +1 -1
  89. package/dist/contracts/runner.contract.js +49 -2
  90. package/dist/contracts/runner.contract.js.map +1 -1
  91. package/dist/contracts/runners.contract.d.ts +16 -0
  92. package/dist/contracts/runners.contract.d.ts.map +1 -0
  93. package/dist/contracts/runners.contract.js +15 -0
  94. package/dist/contracts/runners.contract.js.map +1 -0
  95. package/dist/contracts/safety.contract.d.ts.map +1 -1
  96. package/dist/contracts/safety.contract.js +1 -0
  97. package/dist/contracts/safety.contract.js.map +1 -1
  98. package/dist/contracts/seal.contract.d.ts +100 -0
  99. package/dist/contracts/seal.contract.d.ts.map +1 -1
  100. package/dist/contracts/secrets.contract.d.ts +15 -0
  101. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  102. package/dist/contracts/secrets.contract.js +27 -1
  103. package/dist/contracts/secrets.contract.js.map +1 -1
  104. package/dist/contracts/sessions.contract.d.ts +159 -2
  105. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  106. package/dist/contracts/settings.contract.d.ts +59 -42
  107. package/dist/contracts/settings.contract.d.ts.map +1 -1
  108. package/dist/contracts/settings.contract.js +19 -0
  109. package/dist/contracts/settings.contract.js.map +1 -1
  110. package/dist/contracts/skills.contract.d.ts +6 -0
  111. package/dist/contracts/skills.contract.d.ts.map +1 -1
  112. package/dist/contracts/stack-grants.contract.d.ts +418 -0
  113. package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
  114. package/dist/contracts/stack-grants.contract.js +46 -0
  115. package/dist/contracts/stack-grants.contract.js.map +1 -0
  116. package/dist/contracts/system.contract.d.ts +516 -69
  117. package/dist/contracts/system.contract.d.ts.map +1 -1
  118. package/dist/contracts/system.contract.js +26 -45
  119. package/dist/contracts/system.contract.js.map +1 -1
  120. package/dist/contracts/usage.contract.d.ts +3 -0
  121. package/dist/contracts/usage.contract.d.ts.map +1 -1
  122. package/dist/contracts/workspace.contract.d.ts +0 -55
  123. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  124. package/dist/contracts/workspace.contract.js +0 -19
  125. package/dist/contracts/workspace.contract.js.map +1 -1
  126. package/dist/events/agent-events.d.ts +615 -8
  127. package/dist/events/agent-events.d.ts.map +1 -1
  128. package/dist/events/agent-events.js +2 -2
  129. package/dist/events/agent-events.js.map +1 -1
  130. package/dist/events/agent-transcript.d.ts +159 -2
  131. package/dist/events/agent-transcript.d.ts.map +1 -1
  132. package/dist/events/agent-words.d.ts +5 -0
  133. package/dist/events/agent-words.d.ts.map +1 -1
  134. package/dist/events/agent-words.js +22 -2
  135. package/dist/events/agent-words.js.map +1 -1
  136. package/dist/events/child-news.d.ts +32 -0
  137. package/dist/events/child-news.d.ts.map +1 -0
  138. package/dist/events/child-news.js +171 -0
  139. package/dist/events/child-news.js.map +1 -0
  140. package/dist/events/prompt-origins.d.ts +42 -0
  141. package/dist/events/prompt-origins.d.ts.map +1 -1
  142. package/dist/events/prompt-origins.js +28 -0
  143. package/dist/events/prompt-origins.js.map +1 -1
  144. package/dist/events/refusal-incidents.d.ts +1 -0
  145. package/dist/events/refusal-incidents.d.ts.map +1 -1
  146. package/dist/events/refusal-incidents.js +42 -19
  147. package/dist/events/refusal-incidents.js.map +1 -1
  148. package/dist/events/requests.d.ts +14 -0
  149. package/dist/events/requests.d.ts.map +1 -1
  150. package/dist/events/requests.js +12 -0
  151. package/dist/events/requests.js.map +1 -1
  152. package/dist/events/system-events.d.ts +98 -0
  153. package/dist/events/system-events.d.ts.map +1 -1
  154. package/dist/events/transcript.d.ts +799 -10
  155. package/dist/events/transcript.d.ts.map +1 -1
  156. package/dist/events/transcript.js +2 -1
  157. package/dist/events/transcript.js.map +1 -1
  158. package/dist/ids/conversation-ids.d.ts +1 -0
  159. package/dist/ids/conversation-ids.d.ts.map +1 -1
  160. package/dist/ids/conversation-ids.js +2 -1
  161. package/dist/ids/conversation-ids.js.map +1 -1
  162. package/dist/ids/project-id.d.ts.map +1 -1
  163. package/dist/ids/project-id.js +4 -4
  164. package/dist/ids/project-id.js.map +1 -1
  165. package/dist/ids/run-row-ids.d.ts +8 -0
  166. package/dist/ids/run-row-ids.d.ts.map +1 -0
  167. package/dist/ids/run-row-ids.js +32 -0
  168. package/dist/ids/run-row-ids.js.map +1 -0
  169. package/dist/index.d.ts +4 -4
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +4 -4
  172. package/dist/index.js.map +1 -1
  173. package/dist/models/agent-catalog.d.ts.map +1 -1
  174. package/dist/models/agent-catalog.js +3 -2
  175. package/dist/models/agent-catalog.js.map +1 -1
  176. package/dist/models/agent-lanes.d.ts.map +1 -1
  177. package/dist/models/agent-lanes.js +4 -1
  178. package/dist/models/agent-lanes.js.map +1 -1
  179. package/dist/models/agent-runtimes.d.ts.map +1 -1
  180. package/dist/models/agent-runtimes.js +2 -2
  181. package/dist/models/agent-runtimes.js.map +1 -1
  182. package/dist/models/agent-standing.d.ts +6 -1
  183. package/dist/models/agent-standing.d.ts.map +1 -1
  184. package/dist/models/agent-standing.js +1 -0
  185. package/dist/models/agent-standing.js.map +1 -1
  186. package/dist/models/model-roles.d.ts +91 -37
  187. package/dist/models/model-roles.d.ts.map +1 -1
  188. package/dist/models/model-roles.js +106 -35
  189. package/dist/models/model-roles.js.map +1 -1
  190. package/dist/models/model-setups.d.ts +10 -8
  191. package/dist/models/model-setups.d.ts.map +1 -1
  192. package/dist/models/model-setups.js +15 -15
  193. package/dist/models/model-setups.js.map +1 -1
  194. package/dist/models/providers/provider-traits.d.ts +215 -0
  195. package/dist/models/providers/provider-traits.d.ts.map +1 -0
  196. package/dist/models/providers/provider-traits.js +60 -0
  197. package/dist/models/providers/provider-traits.js.map +1 -0
  198. package/dist/netd/browser-wire.d.ts +8 -0
  199. package/dist/netd/browser-wire.d.ts.map +1 -1
  200. package/dist/netd/browser-wire.js +5 -0
  201. package/dist/netd/browser-wire.js.map +1 -1
  202. package/dist/netd/generated/wire.d.ts +42 -1
  203. package/dist/netd/generated/wire.d.ts.map +1 -1
  204. package/dist/policy/admin/admin-grant.d.ts +21 -0
  205. package/dist/policy/admin/admin-grant.d.ts.map +1 -0
  206. package/dist/policy/admin/admin-grant.js +41 -0
  207. package/dist/policy/admin/admin-grant.js.map +1 -0
  208. package/dist/policy/approvals-execution.d.ts +5 -2
  209. package/dist/policy/approvals-execution.d.ts.map +1 -1
  210. package/dist/policy/approvals-execution.js +3 -4
  211. package/dist/policy/approvals-execution.js.map +1 -1
  212. package/dist/policy/batch-runs.d.ts +1 -1
  213. package/dist/policy/batch-runs.d.ts.map +1 -1
  214. package/dist/policy/batch-runs.js +2 -1
  215. package/dist/policy/batch-runs.js.map +1 -1
  216. package/dist/policy/capabilities/capability-kinds.d.ts +268 -0
  217. package/dist/policy/capabilities/capability-kinds.d.ts.map +1 -0
  218. package/dist/policy/capabilities/capability-kinds.js +47 -0
  219. package/dist/policy/capabilities/capability-kinds.js.map +1 -0
  220. package/dist/policy/command-classes.d.ts.map +1 -1
  221. package/dist/policy/command-classes.js +3 -1
  222. package/dist/policy/command-classes.js.map +1 -1
  223. package/dist/policy/device-programs.d.ts +79 -2
  224. package/dist/policy/device-programs.d.ts.map +1 -1
  225. package/dist/policy/device-programs.js +15 -16
  226. package/dist/policy/device-programs.js.map +1 -1
  227. package/dist/policy/message-limits.d.ts.map +1 -1
  228. package/dist/policy/message-limits.js.map +1 -1
  229. package/dist/policy/org-locks.d.ts +1 -1
  230. package/dist/policy/org-locks.d.ts.map +1 -1
  231. package/dist/policy/org-locks.js +1 -0
  232. package/dist/policy/org-locks.js.map +1 -1
  233. package/dist/policy/reserved-servers.d.ts.map +1 -1
  234. package/dist/policy/reserved-servers.js +5 -1
  235. package/dist/policy/reserved-servers.js.map +1 -1
  236. package/dist/policy/role-capability.d.ts.map +1 -1
  237. package/dist/policy/role-capability.js +2 -1
  238. package/dist/policy/role-capability.js.map +1 -1
  239. package/dist/policy/shell/command-normalise.d.ts +10 -0
  240. package/dist/policy/shell/command-normalise.d.ts.map +1 -0
  241. package/dist/policy/shell/command-normalise.js +153 -0
  242. package/dist/policy/shell/command-normalise.js.map +1 -0
  243. package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
  244. package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
  245. package/dist/policy/shell/workspace-root-exclude.js +4 -0
  246. package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
  247. package/dist/protocol/doors/listener-protocol.d.ts +11 -0
  248. package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
  249. package/dist/protocol/doors/listener-protocol.js +5 -0
  250. package/dist/protocol/doors/listener-protocol.js.map +1 -1
  251. package/dist/protocol/doors/loopback-proof.d.ts +8 -0
  252. package/dist/protocol/doors/loopback-proof.d.ts.map +1 -0
  253. package/dist/protocol/doors/loopback-proof.js +11 -0
  254. package/dist/protocol/doors/loopback-proof.js.map +1 -0
  255. package/dist/protocol/doors/pass-scopes.d.ts +4 -0
  256. package/dist/protocol/doors/pass-scopes.d.ts.map +1 -0
  257. package/dist/protocol/doors/pass-scopes.js +3 -0
  258. package/dist/protocol/doors/pass-scopes.js.map +1 -0
  259. package/dist/protocol/doors/runner-protocol.d.ts +187 -0
  260. package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
  261. package/dist/protocol/doors/runner-protocol.js +48 -1
  262. package/dist/protocol/doors/runner-protocol.js.map +1 -1
  263. package/dist/protocol/doors/sandbox-pass.d.ts +19 -2
  264. package/dist/protocol/doors/sandbox-pass.d.ts.map +1 -1
  265. package/dist/protocol/doors/sandbox-pass.js +42 -10
  266. package/dist/protocol/doors/sandbox-pass.js.map +1 -1
  267. package/dist/protocol/doors/webext-links.d.ts.map +1 -1
  268. package/dist/protocol/doors/webext-links.js.map +1 -1
  269. package/dist/protocol/member-reach.d.ts +6 -0
  270. package/dist/protocol/member-reach.d.ts.map +1 -1
  271. package/dist/protocol/member-reach.js +24 -0
  272. package/dist/protocol/member-reach.js.map +1 -1
  273. package/dist/protocol/peer-mcp-server.d.ts +2 -0
  274. package/dist/protocol/peer-mcp-server.d.ts.map +1 -1
  275. package/dist/protocol/peer-mcp-server.js +1 -0
  276. package/dist/protocol/peer-mcp-server.js.map +1 -1
  277. package/dist/protocol/raw/extension-protocol.d.ts +518 -0
  278. package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
  279. package/dist/protocol/raw/extension-protocol.js +276 -0
  280. package/dist/protocol/raw/extension-protocol.js.map +1 -1
  281. package/dist/protocol/raw/raw-json-routes.d.ts +572 -0
  282. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  283. package/dist/protocol/raw/raw-json-routes.js +25 -2
  284. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  285. package/dist/protocol/raw/raw-routes.d.ts +245 -3
  286. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  287. package/dist/protocol/raw/raw-routes.js +79 -36
  288. package/dist/protocol/raw/raw-routes.js.map +1 -1
  289. package/dist/protocol/route-meta.d.ts.map +1 -1
  290. package/dist/protocol/route-meta.js.map +1 -1
  291. package/dist/schemas/account-routes.d.ts +176 -0
  292. package/dist/schemas/account-routes.d.ts.map +1 -0
  293. package/dist/schemas/account-routes.js +73 -0
  294. package/dist/schemas/account-routes.js.map +1 -0
  295. package/dist/schemas/activity.d.ts.map +1 -1
  296. package/dist/schemas/activity.js.map +1 -1
  297. package/dist/schemas/agent-background.d.ts +48 -0
  298. package/dist/schemas/agent-background.d.ts.map +1 -0
  299. package/dist/schemas/agent-background.js +63 -0
  300. package/dist/schemas/agent-background.js.map +1 -0
  301. package/dist/schemas/agent-land.d.ts +7 -0
  302. package/dist/schemas/agent-land.d.ts.map +1 -1
  303. package/dist/schemas/agent-land.js +11 -0
  304. package/dist/schemas/agent-land.js.map +1 -1
  305. package/dist/schemas/agent.d.ts +4 -0
  306. package/dist/schemas/agent.d.ts.map +1 -1
  307. package/dist/schemas/agent.js +4 -2
  308. package/dist/schemas/agent.js.map +1 -1
  309. package/dist/schemas/agents-list.d.ts +40 -0
  310. package/dist/schemas/agents-list.d.ts.map +1 -1
  311. package/dist/schemas/agents.d.ts +668 -17
  312. package/dist/schemas/agents.d.ts.map +1 -1
  313. package/dist/schemas/agents.js +16 -41
  314. package/dist/schemas/agents.js.map +1 -1
  315. package/dist/schemas/auto-approve.d.ts +12 -0
  316. package/dist/schemas/auto-approve.d.ts.map +1 -0
  317. package/dist/schemas/auto-approve.js +12 -0
  318. package/dist/schemas/auto-approve.js.map +1 -0
  319. package/dist/schemas/automations.d.ts +170 -27
  320. package/dist/schemas/automations.d.ts.map +1 -1
  321. package/dist/schemas/automations.js +26 -34
  322. package/dist/schemas/automations.js.map +1 -1
  323. package/dist/schemas/bridge-heads.d.ts +57 -0
  324. package/dist/schemas/bridge-heads.d.ts.map +1 -0
  325. package/dist/schemas/bridge-heads.js +22 -0
  326. package/dist/schemas/bridge-heads.js.map +1 -0
  327. package/dist/schemas/capabilities.d.ts +21 -0
  328. package/dist/schemas/capabilities.d.ts.map +1 -1
  329. package/dist/schemas/capabilities.js +6 -0
  330. package/dist/schemas/capabilities.js.map +1 -1
  331. package/dist/schemas/checkout-hooks.d.ts +24 -0
  332. package/dist/schemas/checkout-hooks.d.ts.map +1 -0
  333. package/dist/schemas/checkout-hooks.js +23 -0
  334. package/dist/schemas/checkout-hooks.js.map +1 -0
  335. package/dist/schemas/ci-deployments.d.ts +30 -0
  336. package/dist/schemas/ci-deployments.d.ts.map +1 -0
  337. package/dist/schemas/ci-deployments.js +18 -0
  338. package/dist/schemas/ci-deployments.js.map +1 -0
  339. package/dist/schemas/ci-fleet.d.ts +216 -0
  340. package/dist/schemas/ci-fleet.d.ts.map +1 -0
  341. package/dist/schemas/ci-fleet.js +87 -0
  342. package/dist/schemas/ci-fleet.js.map +1 -0
  343. package/dist/schemas/ci.d.ts +348 -21
  344. package/dist/schemas/ci.d.ts.map +1 -1
  345. package/dist/schemas/ci.js +110 -19
  346. package/dist/schemas/ci.js.map +1 -1
  347. package/dist/schemas/command-run.d.ts +29 -0
  348. package/dist/schemas/command-run.d.ts.map +1 -0
  349. package/dist/schemas/command-run.js +20 -0
  350. package/dist/schemas/command-run.js.map +1 -0
  351. package/dist/schemas/connection-hub.d.ts +3 -1
  352. package/dist/schemas/connection-hub.d.ts.map +1 -1
  353. package/dist/schemas/connection-hub.js +2 -1
  354. package/dist/schemas/connection-hub.js.map +1 -1
  355. package/dist/schemas/context-continues.d.ts.map +1 -1
  356. package/dist/schemas/context-continues.js +2 -2
  357. package/dist/schemas/context-continues.js.map +1 -1
  358. package/dist/schemas/data-protection.d.ts +15 -2
  359. package/dist/schemas/data-protection.d.ts.map +1 -1
  360. package/dist/schemas/data-protection.js +15 -23
  361. package/dist/schemas/data-protection.js.map +1 -1
  362. package/dist/schemas/device-stacks.d.ts +131 -0
  363. package/dist/schemas/device-stacks.d.ts.map +1 -1
  364. package/dist/schemas/device-stacks.js +81 -0
  365. package/dist/schemas/device-stacks.js.map +1 -1
  366. package/dist/schemas/devices.d.ts +137 -0
  367. package/dist/schemas/devices.d.ts.map +1 -1
  368. package/dist/schemas/devices.js +11 -2
  369. package/dist/schemas/devices.js.map +1 -1
  370. package/dist/schemas/environment.d.ts +1 -0
  371. package/dist/schemas/environment.d.ts.map +1 -1
  372. package/dist/schemas/environment.js +1 -0
  373. package/dist/schemas/environment.js.map +1 -1
  374. package/dist/schemas/extension-updates.d.ts +1186 -0
  375. package/dist/schemas/extension-updates.d.ts.map +1 -1
  376. package/dist/schemas/extension-updates.js +22 -4
  377. package/dist/schemas/extension-updates.js.map +1 -1
  378. package/dist/schemas/git/git.d.ts +13 -0
  379. package/dist/schemas/git/git.d.ts.map +1 -1
  380. package/dist/schemas/git/git.js +7 -7
  381. package/dist/schemas/git/git.js.map +1 -1
  382. package/dist/schemas/git/index-run.d.ts +1 -0
  383. package/dist/schemas/git/index-run.d.ts.map +1 -1
  384. package/dist/schemas/host-power.d.ts +76 -0
  385. package/dist/schemas/host-power.d.ts.map +1 -0
  386. package/dist/schemas/host-power.js +101 -0
  387. package/dist/schemas/host-power.js.map +1 -0
  388. package/dist/schemas/hosts.d.ts +365 -0
  389. package/dist/schemas/hosts.d.ts.map +1 -1
  390. package/dist/schemas/hosts.js +33 -1
  391. package/dist/schemas/hosts.js.map +1 -1
  392. package/dist/schemas/issues.d.ts +55 -225
  393. package/dist/schemas/issues.d.ts.map +1 -1
  394. package/dist/schemas/issues.js +21 -43
  395. package/dist/schemas/issues.js.map +1 -1
  396. package/dist/schemas/keyring-native.d.ts.map +1 -1
  397. package/dist/schemas/keyring-native.js +3 -1
  398. package/dist/schemas/keyring-native.js.map +1 -1
  399. package/dist/schemas/keyring.d.ts +1 -0
  400. package/dist/schemas/keyring.d.ts.map +1 -1
  401. package/dist/schemas/keyring.js +3 -1
  402. package/dist/schemas/keyring.js.map +1 -1
  403. package/dist/schemas/maintenance.d.ts.map +1 -1
  404. package/dist/schemas/maintenance.js.map +1 -1
  405. package/dist/schemas/members.d.ts.map +1 -1
  406. package/dist/schemas/members.js +2 -14
  407. package/dist/schemas/members.js.map +1 -1
  408. package/dist/schemas/metrics.d.ts +33 -0
  409. package/dist/schemas/metrics.d.ts.map +1 -1
  410. package/dist/schemas/metrics.js +26 -0
  411. package/dist/schemas/metrics.js.map +1 -1
  412. package/dist/schemas/need-kinds.d.ts +19 -0
  413. package/dist/schemas/need-kinds.d.ts.map +1 -0
  414. package/dist/schemas/need-kinds.js +7 -0
  415. package/dist/schemas/need-kinds.js.map +1 -0
  416. package/dist/schemas/needs.d.ts +868 -27
  417. package/dist/schemas/needs.d.ts.map +1 -1
  418. package/dist/schemas/needs.js +79 -9
  419. package/dist/schemas/needs.js.map +1 -1
  420. package/dist/schemas/offload.d.ts +61 -0
  421. package/dist/schemas/offload.d.ts.map +1 -1
  422. package/dist/schemas/offload.js +14 -1
  423. package/dist/schemas/offload.js.map +1 -1
  424. package/dist/schemas/outward-action.d.ts +39 -0
  425. package/dist/schemas/outward-action.d.ts.map +1 -0
  426. package/dist/schemas/outward-action.js +40 -0
  427. package/dist/schemas/outward-action.js.map +1 -0
  428. package/dist/schemas/ports.d.ts +4 -0
  429. package/dist/schemas/ports.d.ts.map +1 -1
  430. package/dist/schemas/ports.js +3 -0
  431. package/dist/schemas/ports.js.map +1 -1
  432. package/dist/schemas/providers/capacity.d.ts +6 -0
  433. package/dist/schemas/providers/capacity.d.ts.map +1 -1
  434. package/dist/schemas/providers/plan-limits.d.ts +1 -0
  435. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  436. package/dist/schemas/providers/plan-limits.js +1 -0
  437. package/dist/schemas/providers/plan-limits.js.map +1 -1
  438. package/dist/schemas/providers/refusals.d.ts +12 -0
  439. package/dist/schemas/providers/refusals.d.ts.map +1 -1
  440. package/dist/schemas/providers/refusals.js +4 -0
  441. package/dist/schemas/providers/refusals.js.map +1 -1
  442. package/dist/schemas/remote-access.d.ts +1 -0
  443. package/dist/schemas/remote-access.d.ts.map +1 -1
  444. package/dist/schemas/remote-access.js +1 -0
  445. package/dist/schemas/remote-access.js.map +1 -1
  446. package/dist/schemas/run-targets.d.ts.map +1 -1
  447. package/dist/schemas/run-targets.js +2 -1
  448. package/dist/schemas/run-targets.js.map +1 -1
  449. package/dist/schemas/runner-views.d.ts +24 -0
  450. package/dist/schemas/runner-views.d.ts.map +1 -0
  451. package/dist/schemas/runner-views.js +16 -0
  452. package/dist/schemas/runner-views.js.map +1 -0
  453. package/dist/schemas/sandbox-reach.d.ts +157 -0
  454. package/dist/schemas/sandbox-reach.d.ts.map +1 -0
  455. package/dist/schemas/sandbox-reach.js +112 -0
  456. package/dist/schemas/sandbox-reach.js.map +1 -0
  457. package/dist/schemas/secrets.d.ts +17 -0
  458. package/dist/schemas/secrets.d.ts.map +1 -1
  459. package/dist/schemas/secrets.js +12 -5
  460. package/dist/schemas/secrets.js.map +1 -1
  461. package/dist/schemas/settings-history.d.ts +1 -1
  462. package/dist/schemas/settings-history.d.ts.map +1 -1
  463. package/dist/schemas/settings-history.js +5 -4
  464. package/dist/schemas/settings-history.js.map +1 -1
  465. package/dist/schemas/settings-savings.d.ts +58 -0
  466. package/dist/schemas/settings-savings.d.ts.map +1 -1
  467. package/dist/schemas/settings-savings.js +22 -0
  468. package/dist/schemas/settings-savings.js.map +1 -1
  469. package/dist/schemas/settings.d.ts +20 -42
  470. package/dist/schemas/settings.d.ts.map +1 -1
  471. package/dist/schemas/settings.js +24 -7
  472. package/dist/schemas/settings.js.map +1 -1
  473. package/dist/schemas/stack-grants.d.ts +60 -0
  474. package/dist/schemas/stack-grants.d.ts.map +1 -0
  475. package/dist/schemas/stack-grants.js +33 -0
  476. package/dist/schemas/stack-grants.js.map +1 -0
  477. package/dist/schemas/system.d.ts +19 -0
  478. package/dist/schemas/system.d.ts.map +1 -1
  479. package/dist/schemas/system.js +9 -0
  480. package/dist/schemas/system.js.map +1 -1
  481. package/dist/schemas/terminal.d.ts +46 -0
  482. package/dist/schemas/terminal.d.ts.map +1 -1
  483. package/dist/schemas/terminal.js +19 -0
  484. package/dist/schemas/terminal.js.map +1 -1
  485. package/dist/schemas/watch-sources.d.ts +72 -0
  486. package/dist/schemas/watch-sources.d.ts.map +1 -0
  487. package/dist/schemas/watch-sources.js +88 -0
  488. package/dist/schemas/watch-sources.js.map +1 -0
  489. package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
  490. package/dist/schemas/workspace/workspace-search.js +1 -1
  491. package/dist/schemas/workspace/workspace-search.js.map +1 -1
  492. package/dist/schemas/wsl-memory.d.ts +76 -0
  493. package/dist/schemas/wsl-memory.d.ts.map +1 -0
  494. package/dist/schemas/wsl-memory.js +36 -0
  495. package/dist/schemas/wsl-memory.js.map +1 -0
  496. package/dist/state/auth-state.d.ts.map +1 -1
  497. package/dist/state/auth-state.js +3 -0
  498. package/dist/state/auth-state.js.map +1 -1
  499. package/dist/state/definition.d.ts +16 -8
  500. package/dist/state/definition.d.ts.map +1 -1
  501. package/dist/state/runtime-state.d.ts +1 -1
  502. package/dist/state/runtime-state.d.ts.map +1 -1
  503. package/dist/state/runtime-state.js +1 -1
  504. package/dist/state/runtime-state.js.map +1 -1
  505. package/dist/state/workspace-state.d.ts +9 -4
  506. package/dist/state/workspace-state.d.ts.map +1 -1
  507. package/dist/state/workspace-state.js +9 -4
  508. package/dist/state/workspace-state.js.map +1 -1
  509. package/dist/sync/workspace-sync-ignores.d.ts +4 -0
  510. package/dist/sync/workspace-sync-ignores.d.ts.map +1 -0
  511. package/dist/sync/workspace-sync-ignores.js +75 -0
  512. package/dist/sync/workspace-sync-ignores.js.map +1 -0
  513. package/dist/text/pages.d.ts.map +1 -1
  514. package/dist/text/pages.js +17 -4
  515. package/dist/text/pages.js.map +1 -1
  516. package/dist/text/transcript-fold.js +2 -2
  517. package/dist/text/transcript-fold.js.map +1 -1
  518. package/package.json +5 -5
  519. package/src/app-routes/app-pages.ts +3 -0
  520. package/src/app-routes/index.ts +1 -0
  521. package/src/app-routes/return-path.ts +16 -0
  522. package/src/briefs/agent-ask.ts +23 -0
  523. package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
  524. package/src/chores/digest.ts +1 -0
  525. package/src/chores/index.ts +13 -2
  526. package/src/chores/prompt.ts +3 -18
  527. package/src/chores/stack.ts +1 -0
  528. package/src/chores/verdict.ts +1 -0
  529. package/src/chores/workspace-scope.ts +3 -8
  530. package/src/contracts/accounts.contract.ts +3 -0
  531. package/src/contracts/agents.contract.ts +41 -5
  532. package/src/contracts/automations.contract.ts +2 -0
  533. package/src/contracts/capabilities.contract.ts +31 -2
  534. package/src/contracts/ci.contract.ts +119 -37
  535. package/src/contracts/device-ci-runners.contract.ts +81 -0
  536. package/src/contracts/device-stacks.contract.ts +97 -0
  537. package/src/contracts/extensions.contract.ts +12 -1
  538. package/src/contracts/ports.contract.ts +6 -6
  539. package/src/contracts/runner.contract.ts +117 -3
  540. package/src/contracts/runners.contract.ts +19 -0
  541. package/src/contracts/safety.contract.ts +2 -0
  542. package/src/contracts/secrets.contract.ts +39 -0
  543. package/src/contracts/settings.contract.ts +26 -0
  544. package/src/contracts/stack-grants.contract.ts +51 -0
  545. package/src/contracts/system.contract.ts +36 -62
  546. package/src/contracts/workspace.contract.ts +0 -22
  547. package/src/events/agent-events.ts +3 -2
  548. package/src/events/agent-words.test.ts +19 -1
  549. package/src/events/agent-words.ts +36 -2
  550. package/src/events/child-news.test.ts +91 -0
  551. package/src/events/child-news.ts +269 -0
  552. package/src/events/prompt-origins.ts +35 -0
  553. package/src/events/refusal-incidents.ts +60 -19
  554. package/src/events/requests.ts +18 -0
  555. package/src/events/transcript.ts +10 -1
  556. package/src/ids/conversation-ids.test.ts +3 -1
  557. package/src/ids/conversation-ids.ts +6 -4
  558. package/src/ids/project-dir.test.ts +1 -1
  559. package/src/ids/project-dir.ts +1 -1
  560. package/src/ids/project-id.test.ts +14 -0
  561. package/src/ids/project-id.ts +6 -4
  562. package/src/ids/run-row-ids.test.ts +38 -0
  563. package/src/ids/run-row-ids.ts +49 -0
  564. package/src/index.ts +6 -6
  565. package/src/models/agent-catalog.test.ts +7 -4
  566. package/src/models/agent-catalog.ts +3 -2
  567. package/src/models/agent-lanes.ts +8 -1
  568. package/src/models/agent-runtimes.ts +7 -6
  569. package/src/models/agent-standing.ts +13 -0
  570. package/src/models/model-roles.test.ts +61 -4
  571. package/src/models/model-roles.ts +153 -49
  572. package/src/models/model-setups.ts +49 -26
  573. package/src/models/provider-specs.test.ts +2 -2
  574. package/src/models/providers/provider-traits.test.ts +71 -0
  575. package/src/models/providers/provider-traits.ts +144 -0
  576. package/src/netd/browser-wire.ts +13 -0
  577. package/src/netd/generated/browser-wire.json +10 -0
  578. package/src/netd/generated/netd-wire.json +224 -1
  579. package/src/netd/generated/wire.ts +18 -6
  580. package/src/netd/wire-manifests.test.ts +16 -0
  581. package/src/policy/admin/admin-grant.ts +69 -0
  582. package/src/policy/approvals-execution.ts +11 -6
  583. package/src/policy/batch-runs.ts +2 -2
  584. package/src/policy/capabilities/capability-kinds.test.ts +112 -0
  585. package/src/policy/capabilities/capability-kinds.ts +110 -0
  586. package/src/policy/command-classes.ts +5 -3
  587. package/src/policy/credential-material.ts +1 -1
  588. package/src/policy/device-programs.ts +29 -20
  589. package/src/policy/message-limits.ts +8 -4
  590. package/src/policy/org-locks.ts +1 -0
  591. package/src/policy/overlay-lint.ts +1 -1
  592. package/src/policy/reserved-servers.ts +5 -1
  593. package/src/policy/role-capability.ts +3 -1
  594. package/src/policy/shell/command-normalise.test.ts +72 -0
  595. package/src/policy/shell/command-normalise.ts +212 -0
  596. package/src/policy/shell/workspace-root-exclude.ts +11 -0
  597. package/src/policy/tests/admin-grant.test.ts +35 -0
  598. package/src/policy/tests/command-classes.test.ts +41 -0
  599. package/src/protocol/doors/listener-protocol.ts +32 -1
  600. package/src/protocol/doors/loopback-proof.ts +34 -0
  601. package/src/protocol/doors/pass-scopes.ts +12 -0
  602. package/src/protocol/doors/runner-protocol.ts +133 -4
  603. package/src/protocol/doors/sandbox-pass.test.ts +33 -1
  604. package/src/protocol/doors/sandbox-pass.ts +92 -16
  605. package/src/protocol/doors/webext-links.ts +3 -1
  606. package/src/protocol/ingress-contract.fixture.json +5 -1
  607. package/src/protocol/member-reach.test.ts +40 -1
  608. package/src/protocol/member-reach.ts +40 -0
  609. package/src/protocol/peer-mcp-server.ts +6 -0
  610. package/src/protocol/raw/extension-protocol.ts +469 -2
  611. package/src/protocol/raw/raw-json-routes.ts +45 -1
  612. package/src/protocol/raw/raw-routes.ts +133 -40
  613. package/src/protocol/route-meta.ts +4 -1
  614. package/src/schemas/account-routes.ts +126 -0
  615. package/src/schemas/activity.ts +6 -4
  616. package/src/schemas/agent-background.ts +104 -0
  617. package/src/schemas/agent-land.ts +21 -2
  618. package/src/schemas/agent.test.ts +3 -0
  619. package/src/schemas/agent.ts +10 -4
  620. package/src/schemas/agents.ts +26 -65
  621. package/src/schemas/auto-approve.ts +31 -0
  622. package/src/schemas/automations.ts +51 -42
  623. package/src/schemas/bridge-heads.ts +33 -0
  624. package/src/schemas/capabilities.ts +23 -0
  625. package/src/schemas/checkout-hooks.ts +44 -0
  626. package/src/schemas/ci-deployments.ts +26 -0
  627. package/src/schemas/ci-fleet.ts +180 -0
  628. package/src/schemas/ci.ts +185 -45
  629. package/src/schemas/command-run.ts +44 -0
  630. package/src/schemas/compose-overlay.test.ts +1 -1
  631. package/src/schemas/compose-overlay.ts +1 -1
  632. package/src/schemas/connection-hub.ts +4 -2
  633. package/src/schemas/context-continues.ts +6 -3
  634. package/src/schemas/data-protection.ts +28 -34
  635. package/src/schemas/device-stacks.ts +162 -3
  636. package/src/schemas/device-swaps.test.ts +1 -1
  637. package/src/schemas/devices.ts +31 -2
  638. package/src/schemas/egress-private.test.ts +1 -1
  639. package/src/schemas/environment.ts +4 -0
  640. package/src/schemas/extension-updates.ts +35 -7
  641. package/src/schemas/git/git.ts +14 -14
  642. package/src/schemas/host-power.test.ts +53 -0
  643. package/src/schemas/host-power.ts +173 -0
  644. package/src/schemas/hosts.test.ts +32 -0
  645. package/src/schemas/hosts.ts +86 -2
  646. package/src/schemas/intentic-os.ts +2 -2
  647. package/src/schemas/issues.ts +43 -86
  648. package/src/schemas/keyring-native.test.ts +11 -3
  649. package/src/schemas/keyring-native.ts +3 -1
  650. package/src/schemas/keyring.ts +6 -1
  651. package/src/schemas/maintenance.ts +4 -3
  652. package/src/schemas/members.ts +4 -16
  653. package/src/schemas/metrics.test.ts +9 -1
  654. package/src/schemas/metrics.ts +43 -0
  655. package/src/schemas/need-kinds.ts +13 -0
  656. package/src/schemas/needs.ts +118 -14
  657. package/src/schemas/offload.ts +37 -3
  658. package/src/schemas/outward-action.ts +47 -0
  659. package/src/schemas/ports.ts +5 -0
  660. package/src/schemas/providers/plan-limits.ts +1 -0
  661. package/src/schemas/providers/refusals.ts +9 -0
  662. package/src/schemas/remote-access.ts +3 -0
  663. package/src/schemas/run-targets.ts +2 -1
  664. package/src/schemas/runner-views.ts +27 -0
  665. package/src/schemas/sandbox-reach.ts +161 -0
  666. package/src/schemas/secrets.ts +23 -5
  667. package/src/schemas/settings-history.ts +10 -5
  668. package/src/schemas/settings-savings.ts +29 -0
  669. package/src/schemas/settings.test.ts +24 -23
  670. package/src/schemas/settings.ts +55 -22
  671. package/src/schemas/stack-grants.ts +59 -0
  672. package/src/schemas/state-plan.test.ts +1 -1
  673. package/src/schemas/state-plan.ts +2 -2
  674. package/src/schemas/system.ts +16 -1
  675. package/src/schemas/terminal.ts +28 -0
  676. package/src/schemas/updates.test.ts +1 -1
  677. package/src/schemas/updates.ts +1 -1
  678. package/src/schemas/version-seam.test.ts +4 -1
  679. package/src/schemas/watch-sources.ts +127 -0
  680. package/src/schemas/workspace/workspace-search.ts +5 -2
  681. package/src/schemas/wsl-memory.ts +59 -0
  682. package/src/state/auth-state.ts +10 -0
  683. package/src/state/runtime-state.test.ts +3 -2
  684. package/src/state/runtime-state.ts +3 -1
  685. package/src/state/update-probation.ts +1 -1
  686. package/src/state/ways-back.test.ts +1 -1
  687. package/src/state/workspace-state.test.ts +2 -0
  688. package/src/state/workspace-state.ts +21 -21
  689. package/src/sync/workspace-sync-ignores.test.ts +48 -0
  690. package/src/sync/workspace-sync-ignores.ts +143 -0
  691. package/src/text/embed.ts +2 -2
  692. package/src/text/pages.ts +34 -7
  693. package/src/text/transcript-fold.test.ts +40 -2
  694. package/src/text/transcript-fold.ts +2 -2
  695. package/dist/chores/extension-update.d.ts.map +0 -1
  696. package/dist/chores/extension-update.js.map +0 -1
  697. package/dist/contracts/chores.contract.d.ts +0 -213
  698. package/dist/contracts/chores.contract.d.ts.map +0 -1
  699. package/dist/contracts/chores.contract.js +0 -32
  700. package/dist/contracts/chores.contract.js.map +0 -1
  701. package/dist/contracts/issues.contract.d.ts +0 -95
  702. package/dist/contracts/issues.contract.d.ts.map +0 -1
  703. package/dist/contracts/issues.contract.js +0 -50
  704. package/dist/contracts/issues.contract.js.map +0 -1
  705. package/src/chores/chores.test.ts +0 -24
  706. package/src/chores/digest.test.ts +0 -27
  707. package/src/chores/probes.integration.test.ts +0 -494
  708. package/src/chores/stack.test.ts +0 -140
  709. package/src/chores/verdict.test.ts +0 -761
  710. package/src/contracts/chores.contract.ts +0 -39
  711. package/src/contracts/issues.contract.ts +0 -53
@@ -0,0 +1,35 @@
1
+ import { ADMIN_GRANT_TTL_MS, adminGrantHolds, commandSha256, signAdminGrant } from "../admin/admin-grant.js";
2
+ import { newSignKeyPair } from "../keyring-seal.js";
3
+
4
+ // The bytes intentic-remoted's service verifies (src/service/admin.rs holds the same vector): a grant from this signer
5
+ // must read there, and one from a fixed key must read here exactly as it reads there.
6
+
7
+ const VECTOR = {
8
+ publicKey: "6kpsY-KcUgq-9VB7Ey7F-ZVHdq6-vnuSQh7qaRRG0iw",
9
+ privateKey: "BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc",
10
+ command: "Get-Service Spooler | Format-List *",
11
+ signed: {
12
+ payload:
13
+ "eyJraW5kIjoiYWRtaW4tcnVuIiwiY29tbWFuZFNoYTI1NiI6ImYxOGFkOWRjYjAyZmNjZjAxNjZiZWVhNTlhYmQ5ZTMyNTQxZTgyY2IyNTY3Y2QwMzk1OWJkYTgwOGIxNGQ3YmUiLCJub25jZSI6IkFBRUNBd1FGQmdjSUNRb0xEQTBPRHciLCJpc3N1ZWRBdCI6MTc5NTQwMDAwMDAwMCwiZXhwaXJlc0F0IjoxNzk1NDAwMzAwMDAwfQ",
14
+ sig: "iAcYj9YGvrU8kmaA5a3oStMqlGb31HSVKboBDqD2aXLnl2SFhucx8K4mI_1N3JTZjmntUy3kmDWSNorKoz82CQ",
15
+ },
16
+ };
17
+
18
+ test("the signer makes, byte for byte, the vector the service is tested against", () => {
19
+ expect(commandSha256(VECTOR.command)).toBe("f18ad9dcb02fccf0166beea59abd9e32541e82cb2567cd03959bda808b14d7be");
20
+ expect(signAdminGrant(VECTOR, VECTOR.command, "AAECAwQFBgcICQoLDA0ODw", 1_795_400_000_000)).toEqual(VECTOR.signed);
21
+ expect(adminGrantHolds(VECTOR.publicKey, VECTOR.signed, VECTOR.command, 1_795_400_100_000)).toBe(true);
22
+ });
23
+
24
+ test("a grant holds for its own command, under its own key, until it expires", () => {
25
+ const pair = newSignKeyPair();
26
+ const signed = signAdminGrant(pair, "diskpart /s compact.txt", "AAECAwQFBgcICQoLDA0ODw", 1000);
27
+ expect(adminGrantHolds(pair.publicKey, signed, "diskpart /s compact.txt", 2000)).toBe(true);
28
+ expect(adminGrantHolds(pair.publicKey, signed, "diskpart /s other.txt", 2000)).toBe(false);
29
+ expect(adminGrantHolds(newSignKeyPair().publicKey, signed, "diskpart /s compact.txt", 2000)).toBe(false);
30
+ expect(adminGrantHolds(pair.publicKey, signed, "diskpart /s compact.txt", 1000 + ADMIN_GRANT_TTL_MS + 1)).toBe(false);
31
+ });
32
+
33
+ test("no grant lives longer than five minutes", () => {
34
+ expect(() => signAdminGrant(newSignKeyPair(), "x", "AAECAwQFBgcICQoLDA0ODw", 0, ADMIN_GRANT_TTL_MS + 1)).toThrow(/at most 300 s/);
35
+ });
@@ -637,6 +637,47 @@ describe("live", () => {
637
637
  });
638
638
  });
639
639
 
640
+ // A shell strips quoting before it runs anything, so a command spelled through it is the same command: the same
641
+ // class, just as live, and marked over what was typed.
642
+ describe("quoting a shell strips", () => {
643
+ test.each([
644
+ [String.raw`r\m -rf ~`, "files.destructive", String.raw`r\m -rf ~`],
645
+ ["r''m -rf ~", "files.destructive", "r''m -rf ~"],
646
+ ['"rm" -rf ~', "files.destructive", '"rm" -rf ~'],
647
+ [String.raw`$'\x72m' -rf ~`, "files.destructive", String.raw`$'\x72m' -rf ~`],
648
+ ["rm${IFS}-rf${IFS}~", "files.destructive", "rm${IFS}-rf${IFS}~"],
649
+ ['cd /tmp && "rm" -rf build', "files.destructive", '"rm" -rf build'],
650
+ ['g""it push --force', "git.destructive", 'g""it push --force'],
651
+ ['git push -"-force"', "git.destructive", 'git push -"-force"'],
652
+ [`sh -c 'g""it push --force'`, "git.destructive", 'g""it push --force'],
653
+ [`bash -c "r''m -rf /"`, "system.destructive", `r''m -rf /"`],
654
+ ['cat ~/.e""nv', "secrets.access", '.e""nv'],
655
+ ])("%j is %s, live, marked as %j", (command, commandClass, fragment) => {
656
+ expect(classify(command)).toContain(commandClass);
657
+ expect(live(command, commandClass)).toBe(true);
658
+ expect(marked(command, commandClass)).toEqual([fragment]);
659
+ });
660
+
661
+ test("what is only quoted text is classified as it was, and stays off the hard rule", () => {
662
+ expect(live(`echo "rm -rf ~ is dangerous"`, "files.destructive")).toBe(false);
663
+ expect(live(`echo "r''m -rf ~"`, "files.destructive")).toBe(false);
664
+ expect(live(`git commit -m "handle r''m -rf ~ too"`, "files.destructive")).toBe(false);
665
+ });
666
+
667
+ test("quotes around ordinary words, and a quoted regex's escapes, invent nothing", () => {
668
+ for (const command of [
669
+ 'git push "origin" "main"',
670
+ 'rm "-r" notes.txt',
671
+ `ls -la "my dir"`,
672
+ String.raw`rg -n '\.env\b' src`,
673
+ String.raw`grep -rn "\.npmrc" .`,
674
+ String.raw`echo "\$HOME"`,
675
+ ]) {
676
+ expect(classify(command), command).toEqual([]);
677
+ }
678
+ });
679
+ });
680
+
640
681
  // The one class whose answer depends on WHOSE checkout would move. A conversation working in a copy of its own may
641
682
  // stand wherever it likes — the drift that causes is reported at turn-settled, not refused here — but a turn sharing
642
683
  // the owner's tree would move the owner's checkout under them, which is not its call to make.
@@ -61,6 +61,10 @@ export const ListenerMessageSchema = z.object({
61
61
  // Prior channel messages fetched when tagged; top-level so it reaches the model but skips the activity feed.
62
62
  history: z.array(ListenerHistoryEntrySchema).optional(),
63
63
  timestamp: z.string(),
64
+ // (2026-11-26) Only the automation with this id hears it (still held to its own filters, sender rules and the
65
+ // owner's floor): a source with one automation per door (an intake) names the one the message came through, so
66
+ // another listening to everything is not woken too. Absent, every automation whose filters admit it.
67
+ automationId: z.string().min(1).optional(),
64
68
  // Provider-specific fields, for example:
65
69
  // - discord message: guildId, attachments
66
70
  // - slack message: threadTs, teamId, attachments
@@ -78,6 +82,13 @@ export interface ListenerTurnOpened {
78
82
  readonly link?: string;
79
83
  }
80
84
 
85
+ // A wake held for a person: which one, the conversation it will run in, and where a person opens that in the app.
86
+ export interface ListenerHeldWake {
87
+ readonly id: string;
88
+ readonly conversationId?: string;
89
+ readonly link?: string;
90
+ }
91
+
81
92
  // One piece of the agent's work as a status line shows it: what kind of work, on what, and how it went. Never the
82
93
  // call's output. `delegate` is a subagent the turn started, its target the task it was given.
83
94
  export interface ListenerStep {
@@ -111,6 +122,9 @@ export interface ListenerDispatchFrame {
111
122
  readonly plan?: readonly ListenerPlanItem[];
112
123
  // The wake waits for a person's approval before anything runs; the sentence to say where the message came from.
113
124
  readonly held?: string;
125
+ // (2026-11-26) Beside `held`: the held wake's id, and the conversation it runs in once a person lets it, so the
126
+ // sender can link it now (a later message on its thread continues that conversation too).
127
+ readonly heldWake?: ListenerHeldWake;
114
128
  // The wake waits for other turns of this automation to finish first; the sentence to say why.
115
129
  readonly queued?: string;
116
130
  // The message went into the turn already running in its thread instead of starting one; that turn answers it.
@@ -119,12 +133,27 @@ export interface ListenerDispatchFrame {
119
133
  }
120
134
 
121
135
  // The body the daemon POSTs to a gateway's loopback /deliver: a message to post outside any live turn, into a channel by
122
- // the provider's own id, and into the thread inside it the conversation lives in, when it lives in one.
136
+ // the provider's own id, and into the thread inside it the conversation lives in, when it lives in one. `id` names the
137
+ // reply in the daemon's outbox (listener-outbox.ts), the same on every retry: a gateway declaring DELIVER_ID_FEATURE
138
+ // posts one id once and answers a repeat with what the first post answered. Added 2026-11-24, optional: an older
139
+ // daemon sends none, and an older gateway drops it.
123
140
  export const ListenerDeliverSchema = z.object({
124
141
  channelId: z.string().min(1),
125
142
  text: z.string().min(1),
126
143
  thread: z.string().min(1).optional(),
144
+ id: z.string().min(1).max(200).optional(),
127
145
  });
146
+
147
+ // The header a gateway's POST /listeners/<provider>/dispatch names the message by, the same on every retry of it: the
148
+ // daemon admits one key once, and answers a repeat as it answered the first. A 200 from /dispatch (a stream's status
149
+ // included, since its headers wait for the admission) means the message is in the daemon's durable inbox, or matched
150
+ // nothing. `?answer=channel` on a plain dispatch gives each matched turn the channel-answer sink a held wake's answer
151
+ // takes: a message whose live stream died with the gateway is answered in its thread. An older daemon ignores both.
152
+ export const LISTENER_DISPATCH_KEY_HEADER = "idempotency-key";
153
+
154
+ // What a gateway's status snapshot can declare it does, so a daemon newer than the gateway knows what it may rely on.
155
+ // `deliver-id`: /deliver posts a given `id` once, so a retry after an answer that never came cannot post it twice.
156
+ export const DELIVER_ID_FEATURE = "deliver-id";
128
157
  export type ListenerDeliver = z.infer<typeof ListenerDeliverSchema>;
129
158
 
130
159
  // The body of POST /listeners/<provider>/stop: which conversation's running turn to stop, and who in the channel asked,
@@ -160,6 +189,8 @@ export type ListenerPairing = z.infer<typeof ListenerPairingSchema>;
160
189
  // by id.
161
190
  export const ListenerStatusSchema = ActivityStatusSchema.extend({
162
191
  pairing: z.record(z.string(), ListenerPairingSchema).optional(),
192
+ // What this gateway build does beyond the routes every gateway serves (DELIVER_ID_FEATURE); absent from an older one.
193
+ features: z.array(z.string()).optional(),
163
194
  });
164
195
  export type ListenerStatus = z.infer<typeof ListenerStatusSchema>;
165
196
 
@@ -0,0 +1,34 @@
1
+ import { createHmac, timingSafeEqual } from "node:crypto";
2
+ import { sha256Hex } from "../../ids/tunnel-ids.js";
3
+
4
+ /* A DAEMON ON THE LOOPBACK PORT PROVES IT IS THIS SANDBOX'S BEFORE A CREDENTIAL GOES TO IT (2026-11-24). The machine
5
+ agent dials a sandbox at 127.0.0.1:<port derived from its id> when one answers there, and believed any listener whose
6
+ `/health` echoed the id: another account or container on that port took the link token from the first frame and then
7
+ pushed itself a grant. Now the agent sends a random challenge with `/health`, and only a daemon that keeps the digest
8
+ of the credential the agent is about to present can answer it: an HMAC keyed with that digest (an enrollment keeps
9
+ `sha256(token)`, peers/enrollment.ts and desktop-sync.ts), over this sandbox's id and the challenge. The daemon answers
10
+ only on netd's loopback listener, so a stranger on the port cannot borrow an answer through the public tunnel.
11
+ No answer, a wrong one, or a daemon from before this, and the agent dials the public address. Node-only (node:crypto). */
12
+
13
+ // The query `/health` takes the challenge on, and the answer's field (DaemonHealth `proof`).
14
+ export const PROOF_CHALLENGE_PARAM = "proof";
15
+ export const PROOF_KEY_PARAM = "proofKey";
16
+
17
+ // Both are 32 random bytes or an HMAC, in lowercase hex.
18
+ export const PROOF_HEX = /^[0-9a-f]{64}$/;
19
+
20
+ const hmacHex = (key: string, message: string): string => createHmac("sha256", key).update(message).digest("hex");
21
+
22
+ // The digest a daemon keeps of a credential it issued, and so the one thing both ends hold to key a proof with.
23
+ export const credentialDigest = (token: string): string => sha256Hex(token);
24
+
25
+ // Which credential the challenge is about, said without anything that answers for it: a daemon finds the enrollment by
26
+ // it, and a stranger learns nothing it could prove with.
27
+ export const proofKeyOf = (digest: string): string => hmacHex(digest, "intentic loopback proof key");
28
+
29
+ export const loopbackProof = (digest: string, sandboxId: string, challenge: string): string =>
30
+ hmacHex(digest, `intentic loopback proof\n${sandboxId}\n${challenge}`);
31
+
32
+ // Whether `answer` is the proof this challenge wanted, compared in constant time.
33
+ export const provesLoopback = (answer: string, digest: string, sandboxId: string, challenge: string): boolean =>
34
+ PROOF_HEX.test(answer) && timingSafeEqual(Buffer.from(answer), Buffer.from(loopbackProof(digest, sandboxId, challenge)));
@@ -0,0 +1,12 @@
1
+ // What a pass admits its holder to at the receiving sandbox (docs/architecture/account-routing.md). `report`: a problem
2
+ // filed into the issues inbox about a project the receiver claims, every pass before scopes existed. The rest route AS A
3
+ // PERSON, with that person's own access there, and are admitted only beside the pairing secret that person gave the
4
+ // sending sandbox at the receiver (the platform's word alone opens nothing but an inbox): `drop` a note or files into
5
+ // it, `read` the conversations and records that person may read there, `task` start work there as them.
6
+ export const PASS_SCOPES = ["report", "drop", "read", "task"] as const;
7
+ export type PassScope = (typeof PASS_SCOPES)[number];
8
+
9
+ // The header the pairing secret rides beside a pass on every scope but `report` (docs/architecture/account-routing.md):
10
+ // what the person gave the asking sandbox, from the receiving one, so the platform's signature alone opens no more than
11
+ // an inbox.
12
+ export const ROUTE_SECRET_HEADER = "x-intentic-route-secret";
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { NeedsActionSchema } from "../../policy/needs-action.js";
3
+ import { AgentJobsSchema, AgentWatchesSchema } from "../../schemas/agent-background.js";
3
4
  import type { PeerLink } from "../peer-dial.js";
4
5
 
5
6
  // The runner link's edges: the /system/runners/connect handshake, boot env, and turn placement (procedures live in
@@ -18,8 +19,8 @@ export const RunnerHelloSchema = z.object({
18
19
  token: z.string(),
19
20
  // The daemon build the runner runs, so an old image is visible rather than mysteriously wrong.
20
21
  version: z.string(),
21
- // Compared against what the parent runs to report parity (outdated → rebuild action); an outdated runner still runs
22
- // turns rather than being refused.
22
+ // Compared against what the parent runs to report parity (outdated → rebuild action). Parity alone refuses nothing;
23
+ // what a parent refuses a turn for is a missing guarantee (`capabilities`).
23
24
  image: z.string(),
24
25
  // The image `image` was composed from (SANDBOX_BASE_IMAGE). Parity compares this, not `image`: an overlay build's
25
26
  // tag names its own container (`intentic-sandbox-env-<slug>:<hash>`), so two sides on one base and one overlay
@@ -33,9 +34,30 @@ export const RunnerHelloSchema = z.object({
33
34
  // Runner's declared settings-only sandbox.toml (definition.ts), diffed against the parent's to itemize drift;
34
35
  // absent on an old image.
35
36
  definitionToml: z.string().optional(),
37
+ // What this build guarantees beyond the protocol's shape (RUNNER_CAPABILITIES); absent on a build from before the
38
+ // list, which guarantees none of them.
39
+ capabilities: z.array(z.string()).optional(),
36
40
  });
37
41
  export type RunnerHello = z.infer<typeof RunnerHelloSchema>;
38
42
 
43
+ /* WHAT A RUNNER'S BUILD GUARANTEES (2026-11-24). Parity says a runner differs from its parent; it cannot say whether the
44
+ difference matters, and a dev build never updates its runners by itself (system/updates/runner-updates.ts). So a
45
+ runner names the guarantees a parent places work by, and a parent refuses a turn on a runner that lacks one it needs
46
+ (runner-dispatch.ts) instead of running it there and losing the work.
47
+ - `sync-keeps-work`: a pull never resets away a conversation's work the parent never received (it commits it and
48
+ carries it onto the parent's branch, or keeps the runner's own branch), a push commits what a turn left
49
+ uncommitted, and any snapshot an older build set aside on the runner is sent home (runner-sync.ts). 2026-11-24:
50
+ ginger-v2nz on a runner built 11-21 lost its edits to 176 files twice, each time a resume's pull reset them away,
51
+ and only its 18 new files reached the parent. */
52
+ export const RUNNER_CAPABILITIES = ["sync-keeps-work"] as const;
53
+ export type RunnerCapability = (typeof RUNNER_CAPABILITIES)[number];
54
+ // What a parent needs of a runner before it places a turn there.
55
+ export const RUNNER_REQUIRED_CAPABILITIES: readonly RunnerCapability[] = ["sync-keeps-work"];
56
+
57
+ // The guarantees a runner's hello names that a parent needs and it lacks. Pure.
58
+ export const missingRunnerCapabilities = (announced: readonly string[] | undefined): RunnerCapability[] =>
59
+ RUNNER_REQUIRED_CAPABILITIES.filter((capability) => !(announced ?? []).includes(capability));
60
+
39
61
  // The URL a runner dials, given its parent's public URL. One builder, so `ic`, the Fly provisioner and the
40
62
  // daemon route cannot disagree about where the door is (hostConnectUrl's rule).
41
63
  /* HOW OFTEN THE PARENT PINGS A CONNECTED RUNNER, read by both sides of the socket. */
@@ -102,6 +124,9 @@ export const runnerIncomingRef = (conversationId: string): string => `refs/runne
102
124
  // updates target a container that doesn't exist.
103
125
  export const runnerSlug = (name: string): string => `runner-${name}`;
104
126
 
127
+ // The runner id a container slug names, undefined for a slug that is not a runner's. Pure.
128
+ export const runnerIdOfSlug = (slug: string): string | undefined => (slug.startsWith("runner-") && slug.length > "runner-".length ? slug.slice("runner-".length) : undefined);
129
+
105
130
  // Credential doors: a runner's turns spend the origin sandbox's model providers, never accounts of its own. The parent
106
131
  // answers with the least that travels (a minted token or a route); refresh tokens never leave it.
107
132
  export const runnerCredentialsUrl = (parentUrl: string): string => `${parentUrl.replace(/\/$/, "")}/system/runners/credentials`;
@@ -112,6 +137,38 @@ export const runnerCredentialRefreshUrl = (parentUrl: string): string => `${pare
112
137
  export const runnerTranslatorPath = "/system/runners/translator";
113
138
  export const runnerTranslatorUrl = (parentUrl: string): string => `${parentUrl.replace(/\/$/, "")}${runnerTranslatorPath}`;
114
139
 
140
+ // The fleet door: a runner's turn reading the parent's conversations (`agents ls|find|show|bundle`), since the parent holds
141
+ // every record and the runner only the turns it ran. `rest` is the fleet read's own path after `/fleet` and its query,
142
+ // and the request names the conversation it is for in RUNNER_FLEET_CONVERSATION_HEADER.
143
+ export const runnerFleetPath = "/system/runners/fleet";
144
+ export const runnerFleetUrl = (parentUrl: string, rest: string): string => `${parentUrl.replace(/\/$/, "")}${runnerFleetPath}${rest}`;
145
+ export const RUNNER_FLEET_CONVERSATION_HEADER = "x-intentic-runner-conversation";
146
+ // Set on every answer the door gives a runner it knows, so the runner tells the door's own 404 from a parent too old to
147
+ // have one.
148
+ export const RUNNER_FLEET_DOOR_HEADER = "x-intentic-runner-fleet";
149
+ // The door's refusal of a conversation the parent did not place on that runner: the runner reads its own record instead.
150
+ export const RunnerFleetNotPlacedSchema = z.object({ ok: z.literal(false), placed: z.literal(false), message: z.string() });
151
+ export type RunnerFleetNotPlaced = z.infer<typeof RunnerFleetNotPlacedSchema>;
152
+
153
+ // The subagents door (2026-11-23): a runner's turn calling one of its `subagents` tools (spawn, wait, send, cancel, …)
154
+ // for a conversation the parent placed there has it run by the parent, whose registry owns the child. POST the tool's
155
+ // arguments as JSON to `/system/runners/subagents/<tool>`, naming the conversation in RUNNER_FLEET_CONVERSATION_HEADER.
156
+ // Answered with the tool's own MCP result; refused with RunnerFleetNotPlacedSchema (404) for a conversation the parent did
157
+ // not place on that runner, or RunnerSubagentNoToolSchema (404) for a tool this parent does not run for runners.
158
+ export const runnerSubagentsPath = "/system/runners/subagents";
159
+ export const runnerSubagentsUrl = (parentUrl: string, tool: string): string =>
160
+ `${parentUrl.replace(/\/$/, "")}${runnerSubagentsPath}/${encodeURIComponent(tool)}`;
161
+ // Set on every answer the subagents door gives a runner it knows, as RUNNER_FLEET_DOOR_HEADER is on the fleet door's.
162
+ export const RUNNER_SUBAGENTS_DOOR_HEADER = "x-intentic-runner-subagents";
163
+ export const RunnerSubagentNoToolSchema = z.object({ ok: z.literal(false), tool: z.literal(false), message: z.string() });
164
+ export type RunnerSubagentNoTool = z.infer<typeof RunnerSubagentNoToolSchema>;
165
+ // A tool's answer as the parent ran it: MCP content blocks (text, in practice), relayed to the runner's turn as they came.
166
+ export const RunnerSubagentResultSchema = z.object({
167
+ content: z.array(z.looseObject({ type: z.string() })),
168
+ isError: z.boolean().optional(),
169
+ });
170
+ export type RunnerSubagentResult = z.infer<typeof RunnerSubagentResultSchema>;
171
+
115
172
  export const RunnerCredentialRequestSchema = z.object({
116
173
  // Provider as the turn names it (absent = claude); an open vocabulary, including endpoint/<id>.
117
174
  agent: z.string().optional(),
@@ -162,6 +219,7 @@ export type RunnerCredentialRefresh = z.infer<typeof RunnerCredentialRefreshSche
162
219
  export const RunnerFactsSchema = z.object({
163
220
  cpus: z.number().int().positive(),
164
221
  memoryMb: z.number().int().positive(),
222
+ // Free where its workspace lives, clamped by the host drive under its engine where ic tells it (machine-facts.ts).
165
223
  freeDiskMb: z.number().int().nonnegative(),
166
224
  // 0..1 over the last minute; a coarse busy signal for a picker, not a metrics feed.
167
225
  load: z.number().nonnegative(),
@@ -182,14 +240,34 @@ export type RunnerFacts = z.infer<typeof RunnerFactsSchema>;
182
240
  // Whether a runner matches this sandbox's image, channel and approved overlay: `current`, `outdated` (gets an update
183
241
  // button), or `unknown` (never connected, or a parent that can't name its own image). Reported, never enforced; what
184
242
  // the parent does act on is a runner on an older release than its own, which it updates while idle (sandbox
185
- // system/updates/runner-updates.ts).
243
+ // system/updates/runner-updates.ts), and a runner missing a guarantee it needs (RUNNER_CAPABILITIES), which gets no turn.
186
244
  export const RunnerParitySchema = z.enum(["current", "outdated", "unknown"]);
187
245
  export type RunnerParity = z.infer<typeof RunnerParitySchema>;
188
246
 
247
+ /* A RUNNER'S NAME FOR PEOPLE (2026-11-21). Its `id` is the handle everything else holds (its container `runner-<id>` and
248
+ volumes, the parent's enrollment, a conversation's placement, offload settings, `ic runner remove <id>`), so it never
249
+ changes; a person renames a runner by giving it a `label`, kept by the parent beside its enrollment. */
250
+ export const RUNNER_LABEL_MAX = 64;
251
+
252
+ // What the rename route takes: the new label, trimmed; empty clears it and the runner reads by its id again.
253
+ export const RunnerLabelSchema = z.object({ label: z.string().trim().max(RUNNER_LABEL_MAX) });
254
+ export type RunnerLabel = z.infer<typeof RunnerLabelSchema>;
255
+
256
+ // What the parent tells a runner to call itself on its machine (runnerContract.present): the name a person reads it by,
257
+ // and the parent's own name, so the machine's listing says whose runner it is with nothing else to ask.
258
+ export const RunnerPresentationSchema = z.object({ name: z.string().min(1), parentName: z.string().optional() });
259
+ export type RunnerPresentation = z.infer<typeof RunnerPresentationSchema>;
260
+
261
+ // The name a person reads a runner by: its label, else its id. Pure.
262
+ export const runnerTitle = (runner: { readonly id: string; readonly label?: string | undefined }): string =>
263
+ runner.label === undefined || runner.label.trim() === "" ? runner.id : runner.label;
264
+
189
265
  // One runner as the owner's list shows it: enrolled state plus whatever the hub currently knows — HostSummary's shape,
190
266
  // retold with parity instead of platform/scopes.
191
267
  export const RunnerSummarySchema = z.object({
192
268
  id: z.string(),
269
+ // The name a person gave it (RunnerLabelSchema); absent reads as its id (`runnerTitle`).
270
+ label: z.string().optional(),
193
271
  // The connected device that requested it (Devices view); absent for one started by hand on a machine.
194
272
  host: z.string().optional(),
195
273
  online: z.boolean(),
@@ -232,8 +310,28 @@ export const RunnerSyncSchema = z.object({
232
310
  });
233
311
  export type RunnerSync = z.infer<typeof RunnerSyncSchema>;
234
312
 
313
+ // A conversation's work a sync found the parent never received, and what it did with it, so the parent can say so in the
314
+ // conversation itself rather than only in its log:
315
+ // - `carried`: committed and replayed onto the parent's branch, in the checkout the next turn works in
316
+ // - `kept`: committed, but the parent's branch moved in a way it would not replay onto, so the runner's own branch stays
317
+ // as it was (the parent's `parentTip` is set aside) and the next push brings it home
318
+ // - `rescue`: a snapshot an older build set aside on the runner, sent home under `ref` in the parent's git dir of `repo`;
319
+ // `base` is the commit it was taken over, so `git diff base sha` is the work
320
+ export const RunnerSyncWorkSchema = z.object({
321
+ kind: z.enum(["carried", "kept", "rescue"]),
322
+ repo: z.string(),
323
+ sha: z.string(),
324
+ files: z.number().int().nonnegative(),
325
+ base: z.string().optional(),
326
+ parentTip: z.string().optional(),
327
+ ref: z.string().optional(),
328
+ at: z.number().optional(),
329
+ });
330
+ export type RunnerSyncWork = z.infer<typeof RunnerSyncWorkSchema>;
331
+
235
332
  export const RunnerSyncLineSchema = z.union([
236
- z.object({ kind: z.literal("line"), text: z.string() }),
333
+ // `work` rides a plain line, so a parent that predates it reads the text and drops the rest.
334
+ z.object({ kind: z.literal("line"), text: z.string(), work: RunnerSyncWorkSchema.optional() }),
237
335
  z.object({
238
336
  kind: z.literal("done"),
239
337
  ok: z.boolean(),
@@ -264,6 +362,11 @@ export const RunnerTurnSchema = z.object({
264
362
  // Base64 since frames are JSON and attachment count is capped; `path` is the workspace-relative path the prompt
265
363
  // already names.
266
364
  attachments: z.array(z.object({ path: z.string().min(1), bytesBase64: z.string() })).optional(),
365
+ // What the sandbox tells a spawned child with its brief (the "You are a subagent" note), written by the parent: the
366
+ // runner holds no record of the child, its siblings or where its work lands, so a child placed there went without
367
+ // one (shinobi-society, 2026-11-21). A runner older than this field ignores it. A TurnNote (events/transcript.ts),
368
+ // spelled out here: importing that module from this one closes a load cycle through schemas/agent.ts.
369
+ childNote: z.object({ title: z.string(), text: z.string() }).optional(),
267
370
  });
268
371
  export type RunnerTurn = z.infer<typeof RunnerTurnSchema>;
269
372
 
@@ -381,3 +484,29 @@ export type RunnerCommandFrame = z.infer<typeof RunnerCommandFrameSchema>;
381
484
  // the sender. `runner` implies isolation since a remote conversation is branch-anchored; absent means local.
382
485
  export const AgentPlacementSchema = z.union([z.object({ kind: z.literal("local") }), z.object({ kind: z.literal("runner"), id: z.string().min(1) })]);
383
486
  export type AgentPlacement = z.infer<typeof AgentPlacementSchema>;
487
+
488
+ // LIVE VIEWS OF A RUNNER CONVERSATION (2026-11-23). A runner's conversations keep their background jobs and armed watches
489
+ // in the runner's own actors, and its browsers and desktop are the runner's, so the parent's card would show none of them.
490
+ // The runner's `feed` door is the stream the parent opens each time the runner connects: one `cards` frame for every
491
+ // conversation it holds jobs or watches for at once, then a `card` frame whenever one changes, and a `changed` frame when
492
+ // its browser windows or its desktop do, for the parent to re-read and announce to its editors. The shapes are the
493
+ // card's own (AgentSummary `jobs`, `watches`), so the parent shows them as it shows its own.
494
+ export const RunnerFeedCardSchema = z.object({
495
+ conversationId: z.string().min(1),
496
+ // AgentSummary `jobs` and `watches`, whole: an empty list once the last one ends.
497
+ jobs: AgentJobsSchema.unwrap(),
498
+ watches: AgentWatchesSchema.unwrap(),
499
+ });
500
+ export type RunnerFeedCard = z.infer<typeof RunnerFeedCardSchema>;
501
+ export const RunnerFeedFrameSchema = z.union([
502
+ z.object({ kind: z.literal("cards"), cards: z.array(RunnerFeedCardSchema) }),
503
+ z.object({ kind: z.literal("card"), card: RunnerFeedCardSchema }),
504
+ z.object({ kind: z.literal("changed"), domain: z.enum(["browsers", "desktop"]) }),
505
+ ]);
506
+ export type RunnerFeedFrame = z.infer<typeof RunnerFeedFrameSchema>;
507
+
508
+ // What a stop on a runner conversation's card did there: false when there was nothing left to stop.
509
+ export const RunnerStoppedSchema = z.object({ stopped: z.boolean() });
510
+
511
+ // Which of the parent's people's views a revocation ends on the runner: one member's, or (absent) everyone's.
512
+ export const RunnerRevokeSchema = z.object({ member: z.string().optional() });
@@ -1,4 +1,4 @@
1
- import { generateKeyPairSync } from "node:crypto";
1
+ import { createPrivateKey, generateKeyPairSync, sign } from "node:crypto";
2
2
  import { mintIdentityAssertion, verifyIdentityAssertion } from "../../policy/identity-assertion.js";
3
3
  import { isSandboxPass, mintSandboxPass, SANDBOX_PASS_MAX_TTL_MS, SANDBOX_PASS_TTL_MS, verifySandboxPass } from "./sandbox-pass.js";
4
4
 
@@ -20,6 +20,7 @@ describe("sandbox pass", () => {
20
20
  from: A,
21
21
  fromName: "ops",
22
22
  to: B,
23
+ scope: "report",
23
24
  project: "github.com/acme/app",
24
25
  issuedAt: NOW / 1000,
25
26
  expiresAt: (NOW + SANDBOX_PASS_TTL_MS) / 1000,
@@ -43,6 +44,37 @@ describe("sandbox pass", () => {
43
44
  expect(verifySandboxPass(publicPem, assertion.replace(/^pa1/, "sp1"), NOW)).toBeUndefined();
44
45
  });
45
46
 
47
+ // An organisation's line, said by the platform: present only when the two sides differ, and a pass without it reads
48
+ // as before.
49
+ it("carries the organisations a report crosses, and nothing when it crosses none", () => {
50
+ const crossesOrg = { from: { id: "org_1", name: "Acme" } };
51
+ expect(verifySandboxPass(publicPem, mint({ crossesOrg }), NOW)).toMatchObject({ crossesOrg });
52
+ const both = { from: { id: "org_1", name: "Acme" }, to: { id: "org_2", name: "Globex" } };
53
+ expect(verifySandboxPass(publicPem, mint({ crossesOrg: both }), NOW)?.crossesOrg).toEqual(both);
54
+ expect(verifySandboxPass(publicPem, mint(), NOW)).not.toHaveProperty("crossesOrg");
55
+ expect(verifySandboxPass(publicPem, mint({ crossesOrg: {} }), NOW)).not.toHaveProperty("crossesOrg");
56
+ });
57
+
58
+ // A pass that routes as a person names that one person and no project; a report names its project. A daemon from
59
+ // before scopes reads any pass with a project as a report, which is why no other scope may carry one.
60
+ it("routes as one named person for every scope but a report, and never carries a project there", () => {
61
+ const drop = verifySandboxPass(publicPem, mint({ scope: "drop", project: undefined, person: " Ada@Example.com " }), NOW);
62
+ expect(drop).toMatchObject({ scope: "drop", person: "ada@example.com" });
63
+ expect(drop).not.toHaveProperty("project");
64
+ expect(verifySandboxPass(publicPem, mint({ person: "ada@example.com" }), NOW)).toMatchObject({ scope: "report", person: "ada@example.com" });
65
+ expect(() => mint({ scope: "task", person: "ada@example.com" })).toThrow();
66
+ expect(() => mint({ scope: "read", project: undefined })).toThrow();
67
+ expect(() => mint({ project: undefined })).toThrow();
68
+ });
69
+
70
+ it("refuses a scope this build does not know, rather than reading it as another", () => {
71
+ const [prefix, payload] = mint({ scope: "read", project: undefined, person: "ada@example.com" }).split(".");
72
+ const unknown = Buffer.from(Buffer.from(payload ?? "", "base64url").toString("utf8").replace(`"read"`, `"operate"`), "utf8").toString("base64url");
73
+ // Signed properly, by the right key: only the scope is one no build knows.
74
+ const signature = sign(null, Buffer.concat([Buffer.from(`${prefix}.`), Buffer.from(unknown, "base64url")]), createPrivateKey(privatePem)).toString("base64url");
75
+ expect(verifySandboxPass(publicPem, `${prefix}.${unknown}.${signature}`, NOW)).toBeUndefined();
76
+ });
77
+
46
78
  it("refuses to mint a pass to itself or one that lives too long", () => {
47
79
  expect(() => mint({ to: A })).toThrow();
48
80
  expect(() => mint({ ttlMs: SANDBOX_PASS_MAX_TTL_MS + 1 })).toThrow();