@intentic/sandbox-contract 1.431.0 → 1.433.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 (510) hide show
  1. package/README.md +25 -3
  2. package/dist/briefs/agent-ask.d.ts +10 -0
  3. package/dist/briefs/agent-ask.d.ts.map +1 -0
  4. package/dist/briefs/agent-ask.js +2 -0
  5. package/dist/briefs/agent-ask.js.map +1 -0
  6. package/dist/{chores/extension-update.d.ts → briefs/extension-update-brief.d.ts} +1 -1
  7. package/dist/briefs/extension-update-brief.d.ts.map +1 -0
  8. package/dist/{chores/extension-update.js → briefs/extension-update-brief.js} +2 -2
  9. package/dist/briefs/extension-update-brief.js.map +1 -0
  10. package/dist/chores/digest.d.ts.map +1 -1
  11. package/dist/chores/digest.js.map +1 -1
  12. package/dist/chores/index.d.ts +2 -2
  13. package/dist/chores/index.d.ts.map +1 -1
  14. package/dist/chores/index.js +1 -1
  15. package/dist/chores/index.js.map +1 -1
  16. package/dist/chores/prompt.d.ts +1 -9
  17. package/dist/chores/prompt.d.ts.map +1 -1
  18. package/dist/chores/prompt.js +1 -1
  19. package/dist/chores/prompt.js.map +1 -1
  20. package/dist/chores/stack.d.ts.map +1 -1
  21. package/dist/chores/stack.js.map +1 -1
  22. package/dist/chores/verdict.d.ts.map +1 -1
  23. package/dist/chores/verdict.js.map +1 -1
  24. package/dist/chores/workspace-scope.d.ts +1 -3
  25. package/dist/chores/workspace-scope.d.ts.map +1 -1
  26. package/dist/chores/workspace-scope.js +1 -3
  27. package/dist/chores/workspace-scope.js.map +1 -1
  28. package/dist/contracts/agent.contract.d.ts +1049 -12
  29. package/dist/contracts/agent.contract.d.ts.map +1 -1
  30. package/dist/contracts/agents.contract.d.ts +358 -4
  31. package/dist/contracts/agents.contract.d.ts.map +1 -1
  32. package/dist/contracts/approvals.contract.d.ts +35 -0
  33. package/dist/contracts/approvals.contract.d.ts.map +1 -1
  34. package/dist/contracts/approvals.contract.js +13 -3
  35. package/dist/contracts/approvals.contract.js.map +1 -1
  36. package/dist/contracts/automations.contract.d.ts +60 -8
  37. package/dist/contracts/automations.contract.d.ts.map +1 -1
  38. package/dist/contracts/capabilities.contract.d.ts +40 -0
  39. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  40. package/dist/contracts/capabilities.contract.js +21 -0
  41. package/dist/contracts/capabilities.contract.js.map +1 -1
  42. package/dist/contracts/ci.contract.d.ts +222 -95
  43. package/dist/contracts/ci.contract.d.ts.map +1 -1
  44. package/dist/contracts/ci.contract.js +87 -26
  45. package/dist/contracts/ci.contract.js.map +1 -1
  46. package/dist/contracts/device-stacks.contract.d.ts +129 -0
  47. package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
  48. package/dist/contracts/device-stacks.contract.js +66 -0
  49. package/dist/contracts/device-stacks.contract.js.map +1 -0
  50. package/dist/contracts/device.contract.d.ts +47 -0
  51. package/dist/contracts/device.contract.d.ts.map +1 -1
  52. package/dist/contracts/extensions.contract.d.ts +607 -0
  53. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  54. package/dist/contracts/extensions.contract.js +10 -1
  55. package/dist/contracts/extensions.contract.js.map +1 -1
  56. package/dist/contracts/needs.contract.d.ts +887 -18
  57. package/dist/contracts/needs.contract.d.ts.map +1 -1
  58. package/dist/contracts/offload.contract.d.ts +21 -0
  59. package/dist/contracts/offload.contract.d.ts.map +1 -1
  60. package/dist/contracts/runner.contract.d.ts +653 -40
  61. package/dist/contracts/runner.contract.d.ts.map +1 -1
  62. package/dist/contracts/seal.contract.d.ts +20 -0
  63. package/dist/contracts/seal.contract.d.ts.map +1 -1
  64. package/dist/contracts/secrets.contract.d.ts +15 -0
  65. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  66. package/dist/contracts/secrets.contract.js +21 -1
  67. package/dist/contracts/secrets.contract.js.map +1 -1
  68. package/dist/contracts/sessions.contract.d.ts +133 -2
  69. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  70. package/dist/contracts/settings.contract.d.ts +73 -42
  71. package/dist/contracts/settings.contract.d.ts.map +1 -1
  72. package/dist/contracts/settings.contract.js +18 -0
  73. package/dist/contracts/settings.contract.js.map +1 -1
  74. package/dist/contracts/stack-grants.contract.d.ts +440 -0
  75. package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
  76. package/dist/contracts/stack-grants.contract.js +46 -0
  77. package/dist/contracts/stack-grants.contract.js.map +1 -0
  78. package/dist/contracts/system.contract.d.ts +191 -69
  79. package/dist/contracts/system.contract.d.ts.map +1 -1
  80. package/dist/contracts/system.contract.js +12 -42
  81. package/dist/contracts/system.contract.js.map +1 -1
  82. package/dist/contracts/workspace.contract.d.ts +0 -55
  83. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  84. package/dist/contracts/workspace.contract.js +0 -19
  85. package/dist/contracts/workspace.contract.js.map +1 -1
  86. package/dist/events/agent-events.d.ts +509 -8
  87. package/dist/events/agent-events.d.ts.map +1 -1
  88. package/dist/events/agent-transcript.d.ts +133 -2
  89. package/dist/events/agent-transcript.d.ts.map +1 -1
  90. package/dist/events/agent-words.d.ts.map +1 -1
  91. package/dist/events/agent-words.js +2 -1
  92. package/dist/events/agent-words.js.map +1 -1
  93. package/dist/events/child-news.d.ts +32 -0
  94. package/dist/events/child-news.d.ts.map +1 -0
  95. package/dist/events/child-news.js +171 -0
  96. package/dist/events/child-news.js.map +1 -0
  97. package/dist/events/prompt-origins.d.ts +42 -0
  98. package/dist/events/prompt-origins.d.ts.map +1 -1
  99. package/dist/events/prompt-origins.js +28 -0
  100. package/dist/events/prompt-origins.js.map +1 -1
  101. package/dist/events/requests.d.ts +14 -0
  102. package/dist/events/requests.d.ts.map +1 -1
  103. package/dist/events/requests.js +12 -0
  104. package/dist/events/requests.js.map +1 -1
  105. package/dist/events/system-events.d.ts +16 -0
  106. package/dist/events/system-events.d.ts.map +1 -1
  107. package/dist/events/transcript.d.ts +669 -10
  108. package/dist/events/transcript.d.ts.map +1 -1
  109. package/dist/events/transcript.js +2 -1
  110. package/dist/events/transcript.js.map +1 -1
  111. package/dist/ids/conversation-ids.d.ts.map +1 -1
  112. package/dist/ids/conversation-ids.js.map +1 -1
  113. package/dist/index.d.ts +2 -4
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +2 -4
  116. package/dist/index.js.map +1 -1
  117. package/dist/models/model-roles.d.ts +91 -37
  118. package/dist/models/model-roles.d.ts.map +1 -1
  119. package/dist/models/model-roles.js +106 -35
  120. package/dist/models/model-roles.js.map +1 -1
  121. package/dist/models/model-setups.d.ts +10 -8
  122. package/dist/models/model-setups.d.ts.map +1 -1
  123. package/dist/models/model-setups.js +15 -15
  124. package/dist/models/model-setups.js.map +1 -1
  125. package/dist/policy/approvals-execution.d.ts +5 -2
  126. package/dist/policy/approvals-execution.d.ts.map +1 -1
  127. package/dist/policy/approvals-execution.js +3 -4
  128. package/dist/policy/approvals-execution.js.map +1 -1
  129. package/dist/policy/batch-runs.d.ts +1 -1
  130. package/dist/policy/batch-runs.d.ts.map +1 -1
  131. package/dist/policy/batch-runs.js +2 -1
  132. package/dist/policy/batch-runs.js.map +1 -1
  133. package/dist/policy/message-limits.d.ts.map +1 -1
  134. package/dist/policy/message-limits.js.map +1 -1
  135. package/dist/policy/org-locks.d.ts +1 -1
  136. package/dist/policy/org-locks.d.ts.map +1 -1
  137. package/dist/policy/org-locks.js +1 -0
  138. package/dist/policy/org-locks.js.map +1 -1
  139. package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
  140. package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
  141. package/dist/policy/shell/workspace-root-exclude.js +4 -0
  142. package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
  143. package/dist/protocol/doors/listener-protocol.d.ts +7 -0
  144. package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
  145. package/dist/protocol/doors/listener-protocol.js +1 -0
  146. package/dist/protocol/doors/listener-protocol.js.map +1 -1
  147. package/dist/protocol/doors/webext-links.d.ts.map +1 -1
  148. package/dist/protocol/doors/webext-links.js.map +1 -1
  149. package/dist/protocol/raw/extension-protocol.d.ts +634 -0
  150. package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
  151. package/dist/protocol/raw/extension-protocol.js +292 -0
  152. package/dist/protocol/raw/extension-protocol.js.map +1 -1
  153. package/dist/protocol/raw/raw-json-routes.d.ts +3034 -0
  154. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  155. package/dist/protocol/raw/raw-json-routes.js +39 -0
  156. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  157. package/dist/protocol/raw/raw-routes.d.ts +260 -1
  158. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  159. package/dist/protocol/raw/raw-routes.js +57 -1
  160. package/dist/protocol/raw/raw-routes.js.map +1 -1
  161. package/dist/protocol/s2s/address.d.ts +53 -0
  162. package/dist/protocol/s2s/address.d.ts.map +1 -0
  163. package/dist/protocol/s2s/address.js +111 -0
  164. package/dist/protocol/s2s/address.js.map +1 -0
  165. package/dist/protocol/s2s/attestation.d.ts +41 -0
  166. package/dist/protocol/s2s/attestation.d.ts.map +1 -0
  167. package/dist/protocol/s2s/attestation.js +96 -0
  168. package/dist/protocol/s2s/attestation.js.map +1 -0
  169. package/dist/protocol/s2s/canonical.d.ts +10 -0
  170. package/dist/protocol/s2s/canonical.d.ts.map +1 -0
  171. package/dist/protocol/s2s/canonical.js +94 -0
  172. package/dist/protocol/s2s/canonical.js.map +1 -0
  173. package/dist/protocol/s2s/envelope.d.ts +40 -0
  174. package/dist/protocol/s2s/envelope.d.ts.map +1 -0
  175. package/dist/protocol/s2s/envelope.js +116 -0
  176. package/dist/protocol/s2s/envelope.js.map +1 -0
  177. package/dist/protocol/s2s/extension-sign.d.ts +21 -0
  178. package/dist/protocol/s2s/extension-sign.d.ts.map +1 -0
  179. package/dist/protocol/s2s/extension-sign.js +41 -0
  180. package/dist/protocol/s2s/extension-sign.js.map +1 -0
  181. package/dist/protocol/s2s/identity-doc.d.ts +50 -0
  182. package/dist/protocol/s2s/identity-doc.d.ts.map +1 -0
  183. package/dist/protocol/s2s/identity-doc.js +89 -0
  184. package/dist/protocol/s2s/identity-doc.js.map +1 -0
  185. package/dist/protocol/s2s/index.d.ts +12 -0
  186. package/dist/protocol/s2s/index.d.ts.map +1 -0
  187. package/dist/protocol/s2s/index.js +12 -0
  188. package/dist/protocol/s2s/index.js.map +1 -0
  189. package/dist/protocol/s2s/kem.d.ts +15 -0
  190. package/dist/protocol/s2s/kem.d.ts.map +1 -0
  191. package/dist/protocol/s2s/kem.js +34 -0
  192. package/dist/protocol/s2s/kem.js.map +1 -0
  193. package/dist/protocol/s2s/keys.d.ts +34 -0
  194. package/dist/protocol/s2s/keys.d.ts.map +1 -0
  195. package/dist/protocol/s2s/keys.js +81 -0
  196. package/dist/protocol/s2s/keys.js.map +1 -0
  197. package/dist/protocol/s2s/passkey-cosign.d.ts +44 -0
  198. package/dist/protocol/s2s/passkey-cosign.d.ts.map +1 -0
  199. package/dist/protocol/s2s/passkey-cosign.js +139 -0
  200. package/dist/protocol/s2s/passkey-cosign.js.map +1 -0
  201. package/dist/protocol/s2s/session.d.ts +61 -0
  202. package/dist/protocol/s2s/session.d.ts.map +1 -0
  203. package/dist/protocol/s2s/session.js +98 -0
  204. package/dist/protocol/s2s/session.js.map +1 -0
  205. package/dist/protocol/s2s/sign.d.ts +12 -0
  206. package/dist/protocol/s2s/sign.d.ts.map +1 -0
  207. package/dist/protocol/s2s/sign.js +33 -0
  208. package/dist/protocol/s2s/sign.js.map +1 -0
  209. package/dist/schemas/activity.d.ts.map +1 -1
  210. package/dist/schemas/activity.js.map +1 -1
  211. package/dist/schemas/agent.d.ts +4 -0
  212. package/dist/schemas/agent.d.ts.map +1 -1
  213. package/dist/schemas/agent.js +4 -2
  214. package/dist/schemas/agent.js.map +1 -1
  215. package/dist/schemas/agents-list.d.ts +8 -0
  216. package/dist/schemas/agents-list.d.ts.map +1 -1
  217. package/dist/schemas/agents.d.ts +16 -0
  218. package/dist/schemas/agents.d.ts.map +1 -1
  219. package/dist/schemas/approvals.d.ts +100 -0
  220. package/dist/schemas/approvals.d.ts.map +1 -1
  221. package/dist/schemas/approvals.js +21 -0
  222. package/dist/schemas/approvals.js.map +1 -1
  223. package/dist/schemas/automations.d.ts +89 -27
  224. package/dist/schemas/automations.d.ts.map +1 -1
  225. package/dist/schemas/automations.js +15 -33
  226. package/dist/schemas/automations.js.map +1 -1
  227. package/dist/schemas/capabilities.d.ts +1 -0
  228. package/dist/schemas/capabilities.d.ts.map +1 -1
  229. package/dist/schemas/ci-deployments.d.ts +30 -0
  230. package/dist/schemas/ci-deployments.d.ts.map +1 -0
  231. package/dist/schemas/ci-deployments.js +18 -0
  232. package/dist/schemas/ci-deployments.js.map +1 -0
  233. package/dist/schemas/ci.d.ts +348 -21
  234. package/dist/schemas/ci.d.ts.map +1 -1
  235. package/dist/schemas/ci.js +110 -19
  236. package/dist/schemas/ci.js.map +1 -1
  237. package/dist/schemas/command-admission.d.ts +6 -0
  238. package/dist/schemas/command-admission.d.ts.map +1 -1
  239. package/dist/schemas/command-admission.js +2 -1
  240. package/dist/schemas/command-admission.js.map +1 -1
  241. package/dist/schemas/command-run.d.ts +29 -0
  242. package/dist/schemas/command-run.d.ts.map +1 -0
  243. package/dist/schemas/command-run.js +20 -0
  244. package/dist/schemas/command-run.js.map +1 -0
  245. package/dist/schemas/contact-need.d.ts +50 -0
  246. package/dist/schemas/contact-need.d.ts.map +1 -0
  247. package/dist/schemas/contact-need.js +19 -0
  248. package/dist/schemas/contact-need.js.map +1 -0
  249. package/dist/schemas/contacts-settings.d.ts +5 -0
  250. package/dist/schemas/contacts-settings.d.ts.map +1 -0
  251. package/dist/schemas/contacts-settings.js +11 -0
  252. package/dist/schemas/contacts-settings.js.map +1 -0
  253. package/dist/schemas/data-protection.d.ts +15 -2
  254. package/dist/schemas/data-protection.d.ts.map +1 -1
  255. package/dist/schemas/data-protection.js +15 -23
  256. package/dist/schemas/data-protection.js.map +1 -1
  257. package/dist/schemas/device-stacks.d.ts +131 -0
  258. package/dist/schemas/device-stacks.d.ts.map +1 -1
  259. package/dist/schemas/device-stacks.js +81 -0
  260. package/dist/schemas/device-stacks.js.map +1 -1
  261. package/dist/schemas/devices.d.ts +73 -0
  262. package/dist/schemas/devices.d.ts.map +1 -1
  263. package/dist/schemas/devices.js +6 -2
  264. package/dist/schemas/devices.js.map +1 -1
  265. package/dist/schemas/extension-updates.d.ts +1192 -0
  266. package/dist/schemas/extension-updates.d.ts.map +1 -1
  267. package/dist/schemas/extension-updates.js +18 -4
  268. package/dist/schemas/extension-updates.js.map +1 -1
  269. package/dist/schemas/host-power.d.ts +22 -0
  270. package/dist/schemas/host-power.d.ts.map +1 -1
  271. package/dist/schemas/host-power.js +55 -0
  272. package/dist/schemas/host-power.js.map +1 -1
  273. package/dist/schemas/hosts.d.ts +226 -0
  274. package/dist/schemas/hosts.d.ts.map +1 -1
  275. package/dist/schemas/hosts.js +24 -0
  276. package/dist/schemas/hosts.js.map +1 -1
  277. package/dist/schemas/issues.d.ts +37 -249
  278. package/dist/schemas/issues.d.ts.map +1 -1
  279. package/dist/schemas/issues.js +10 -43
  280. package/dist/schemas/issues.js.map +1 -1
  281. package/dist/schemas/links.d.ts +8 -0
  282. package/dist/schemas/links.d.ts.map +1 -1
  283. package/dist/schemas/links.js +4 -0
  284. package/dist/schemas/links.js.map +1 -1
  285. package/dist/schemas/maintenance.d.ts.map +1 -1
  286. package/dist/schemas/maintenance.js.map +1 -1
  287. package/dist/schemas/metrics.d.ts +25 -0
  288. package/dist/schemas/metrics.d.ts.map +1 -1
  289. package/dist/schemas/metrics.js +18 -0
  290. package/dist/schemas/metrics.js.map +1 -1
  291. package/dist/schemas/need-kinds.d.ts +20 -0
  292. package/dist/schemas/need-kinds.d.ts.map +1 -0
  293. package/dist/schemas/need-kinds.js +7 -0
  294. package/dist/schemas/need-kinds.js.map +1 -0
  295. package/dist/schemas/needs.d.ts +666 -30
  296. package/dist/schemas/needs.d.ts.map +1 -1
  297. package/dist/schemas/needs.js +29 -6
  298. package/dist/schemas/needs.js.map +1 -1
  299. package/dist/schemas/offload.d.ts +52 -0
  300. package/dist/schemas/offload.d.ts.map +1 -1
  301. package/dist/schemas/offload.js +12 -0
  302. package/dist/schemas/offload.js.map +1 -1
  303. package/dist/schemas/outward-action.d.ts +39 -0
  304. package/dist/schemas/outward-action.d.ts.map +1 -0
  305. package/dist/schemas/outward-action.js +40 -0
  306. package/dist/schemas/outward-action.js.map +1 -0
  307. package/dist/schemas/providers/plan-limits.d.ts +1 -0
  308. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  309. package/dist/schemas/providers/plan-limits.js +1 -0
  310. package/dist/schemas/providers/plan-limits.js.map +1 -1
  311. package/dist/schemas/redirect-need.d.ts +15 -0
  312. package/dist/schemas/redirect-need.d.ts.map +1 -0
  313. package/dist/schemas/redirect-need.js +14 -0
  314. package/dist/schemas/redirect-need.js.map +1 -0
  315. package/dist/schemas/s2s-identity.d.ts +521 -0
  316. package/dist/schemas/s2s-identity.d.ts.map +1 -0
  317. package/dist/schemas/s2s-identity.js +208 -0
  318. package/dist/schemas/s2s-identity.js.map +1 -0
  319. package/dist/schemas/s2s-views.d.ts +2127 -0
  320. package/dist/schemas/s2s-views.d.ts.map +1 -0
  321. package/dist/schemas/s2s-views.js +217 -0
  322. package/dist/schemas/s2s-views.js.map +1 -0
  323. package/dist/schemas/s2s-wire.d.ts +1616 -0
  324. package/dist/schemas/s2s-wire.d.ts.map +1 -0
  325. package/dist/schemas/s2s-wire.js +276 -0
  326. package/dist/schemas/s2s-wire.js.map +1 -0
  327. package/dist/schemas/s2s.d.ts +5 -0
  328. package/dist/schemas/s2s.d.ts.map +1 -0
  329. package/dist/schemas/s2s.js +5 -0
  330. package/dist/schemas/s2s.js.map +1 -0
  331. package/dist/schemas/secrets.d.ts +17 -0
  332. package/dist/schemas/secrets.d.ts.map +1 -1
  333. package/dist/schemas/secrets.js +12 -5
  334. package/dist/schemas/secrets.js.map +1 -1
  335. package/dist/schemas/settings-history.d.ts +1 -1
  336. package/dist/schemas/settings-history.d.ts.map +1 -1
  337. package/dist/schemas/settings-history.js +5 -4
  338. package/dist/schemas/settings-history.js.map +1 -1
  339. package/dist/schemas/settings-savings.d.ts +58 -0
  340. package/dist/schemas/settings-savings.d.ts.map +1 -1
  341. package/dist/schemas/settings-savings.js +22 -0
  342. package/dist/schemas/settings-savings.js.map +1 -1
  343. package/dist/schemas/settings.d.ts +18 -42
  344. package/dist/schemas/settings.d.ts.map +1 -1
  345. package/dist/schemas/settings.js +7 -6
  346. package/dist/schemas/settings.js.map +1 -1
  347. package/dist/schemas/stack-grants.d.ts +60 -0
  348. package/dist/schemas/stack-grants.d.ts.map +1 -0
  349. package/dist/schemas/stack-grants.js +33 -0
  350. package/dist/schemas/stack-grants.js.map +1 -0
  351. package/dist/schemas/terminal.d.ts +2 -0
  352. package/dist/schemas/terminal.d.ts.map +1 -1
  353. package/dist/schemas/terminal.js +4 -0
  354. package/dist/schemas/terminal.js.map +1 -1
  355. package/dist/schemas/vpn.d.ts +4 -0
  356. package/dist/schemas/vpn.d.ts.map +1 -1
  357. package/dist/schemas/vpn.js +9 -0
  358. package/dist/schemas/vpn.js.map +1 -1
  359. package/dist/schemas/watch-sources.d.ts +72 -0
  360. package/dist/schemas/watch-sources.d.ts.map +1 -0
  361. package/dist/schemas/watch-sources.js +88 -0
  362. package/dist/schemas/watch-sources.js.map +1 -0
  363. package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
  364. package/dist/schemas/workspace/workspace-search.js +1 -1
  365. package/dist/schemas/workspace/workspace-search.js.map +1 -1
  366. package/dist/schemas/wsl-memory.d.ts +76 -0
  367. package/dist/schemas/wsl-memory.d.ts.map +1 -0
  368. package/dist/schemas/wsl-memory.js +36 -0
  369. package/dist/schemas/wsl-memory.js.map +1 -0
  370. package/dist/state/auth-state.d.ts.map +1 -1
  371. package/dist/state/auth-state.js +8 -0
  372. package/dist/state/auth-state.js.map +1 -1
  373. package/dist/state/definition.d.ts +22 -8
  374. package/dist/state/definition.d.ts.map +1 -1
  375. package/dist/state/workspace-state.d.ts +8 -3
  376. package/dist/state/workspace-state.d.ts.map +1 -1
  377. package/dist/state/workspace-state.js +8 -3
  378. package/dist/state/workspace-state.js.map +1 -1
  379. package/package.json +20 -5
  380. package/src/briefs/agent-ask.ts +23 -0
  381. package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
  382. package/src/chores/digest.ts +1 -0
  383. package/src/chores/index.ts +13 -2
  384. package/src/chores/prompt.ts +3 -18
  385. package/src/chores/stack.ts +1 -0
  386. package/src/chores/verdict.ts +1 -0
  387. package/src/chores/workspace-scope.ts +3 -8
  388. package/src/contracts/approvals.contract.ts +24 -3
  389. package/src/contracts/capabilities.contract.ts +24 -0
  390. package/src/contracts/ci.contract.ts +119 -37
  391. package/src/contracts/device-stacks.contract.ts +97 -0
  392. package/src/contracts/extensions.contract.ts +11 -0
  393. package/src/contracts/secrets.contract.ts +27 -0
  394. package/src/contracts/settings.contract.ts +24 -0
  395. package/src/contracts/stack-grants.contract.ts +51 -0
  396. package/src/contracts/system.contract.ts +16 -59
  397. package/src/contracts/workspace.contract.ts +0 -22
  398. package/src/events/agent-words.ts +3 -1
  399. package/src/events/child-news.test.ts +91 -0
  400. package/src/events/child-news.ts +269 -0
  401. package/src/events/prompt-origins.ts +35 -0
  402. package/src/events/requests.ts +18 -0
  403. package/src/events/transcript.ts +10 -1
  404. package/src/ids/conversation-ids.test.ts +22 -3
  405. package/src/ids/conversation-ids.ts +5 -7
  406. package/src/index.ts +3 -6
  407. package/src/models/model-roles.test.ts +61 -4
  408. package/src/models/model-roles.ts +153 -49
  409. package/src/models/model-setups.ts +49 -26
  410. package/src/policy/approvals-execution.ts +11 -6
  411. package/src/policy/batch-runs.ts +2 -2
  412. package/src/policy/message-limits.ts +8 -4
  413. package/src/policy/org-locks.ts +1 -0
  414. package/src/policy/shell/workspace-root-exclude.ts +11 -0
  415. package/src/protocol/doors/listener-protocol.ts +14 -0
  416. package/src/protocol/doors/webext-links.ts +3 -1
  417. package/src/protocol/ingress-contract.fixture.json +6 -1
  418. package/src/protocol/raw/extension-protocol.ts +513 -2
  419. package/src/protocol/raw/raw-json-routes.ts +85 -0
  420. package/src/protocol/raw/raw-routes.ts +111 -7
  421. package/src/protocol/s2s/address.test.ts +157 -0
  422. package/src/protocol/s2s/address.ts +193 -0
  423. package/src/protocol/s2s/attestation.test.ts +262 -0
  424. package/src/protocol/s2s/attestation.ts +173 -0
  425. package/src/protocol/s2s/canonical.test.ts +70 -0
  426. package/src/protocol/s2s/canonical.ts +119 -0
  427. package/src/protocol/s2s/envelope.test.ts +162 -0
  428. package/src/protocol/s2s/envelope.ts +194 -0
  429. package/src/protocol/s2s/extension-sign.test.ts +117 -0
  430. package/src/protocol/s2s/extension-sign.ts +76 -0
  431. package/src/protocol/s2s/identity-doc.test.ts +187 -0
  432. package/src/protocol/s2s/identity-doc.ts +169 -0
  433. package/src/protocol/s2s/index.ts +15 -0
  434. package/src/protocol/s2s/kem.ts +62 -0
  435. package/src/protocol/s2s/keys.test.ts +76 -0
  436. package/src/protocol/s2s/keys.ts +155 -0
  437. package/src/protocol/s2s/passkey-cosign.test.ts +98 -0
  438. package/src/protocol/s2s/passkey-cosign.testing.ts +86 -0
  439. package/src/protocol/s2s/passkey-cosign.ts +192 -0
  440. package/src/protocol/s2s/s2s.testing.ts +22 -0
  441. package/src/protocol/s2s/session.test.ts +133 -0
  442. package/src/protocol/s2s/session.ts +179 -0
  443. package/src/protocol/s2s/sign.test.ts +66 -0
  444. package/src/protocol/s2s/sign.ts +53 -0
  445. package/src/schemas/activity.ts +2 -1
  446. package/src/schemas/agent.test.ts +3 -0
  447. package/src/schemas/agent.ts +10 -4
  448. package/src/schemas/approvals.ts +41 -0
  449. package/src/schemas/automations.ts +26 -41
  450. package/src/schemas/ci-deployments.ts +26 -0
  451. package/src/schemas/ci.ts +185 -45
  452. package/src/schemas/command-admission.ts +4 -1
  453. package/src/schemas/command-run.ts +44 -0
  454. package/src/schemas/contact-need.ts +26 -0
  455. package/src/schemas/contacts-settings.ts +16 -0
  456. package/src/schemas/data-protection.ts +28 -34
  457. package/src/schemas/device-stacks.ts +162 -3
  458. package/src/schemas/devices.ts +13 -2
  459. package/src/schemas/extension-updates.ts +27 -7
  460. package/src/schemas/host-power.test.ts +53 -0
  461. package/src/schemas/host-power.ts +96 -2
  462. package/src/schemas/hosts.test.ts +32 -0
  463. package/src/schemas/hosts.ts +62 -0
  464. package/src/schemas/issues.ts +30 -86
  465. package/src/schemas/links.ts +4 -0
  466. package/src/schemas/maintenance.ts +4 -3
  467. package/src/schemas/metrics.ts +35 -0
  468. package/src/schemas/need-kinds.ts +13 -0
  469. package/src/schemas/needs.ts +44 -16
  470. package/src/schemas/offload.ts +31 -0
  471. package/src/schemas/outward-action.ts +47 -0
  472. package/src/schemas/providers/plan-limits.ts +1 -0
  473. package/src/schemas/redirect-need.ts +19 -0
  474. package/src/schemas/s2s-identity.ts +329 -0
  475. package/src/schemas/s2s-views.ts +326 -0
  476. package/src/schemas/s2s-wire.ts +401 -0
  477. package/src/schemas/s2s.test.ts +175 -0
  478. package/src/schemas/s2s.ts +9 -0
  479. package/src/schemas/secrets.ts +23 -5
  480. package/src/schemas/settings-history.ts +10 -5
  481. package/src/schemas/settings-savings.ts +29 -0
  482. package/src/schemas/settings.test.ts +23 -23
  483. package/src/schemas/settings.ts +12 -12
  484. package/src/schemas/stack-grants.ts +59 -0
  485. package/src/schemas/terminal.ts +6 -0
  486. package/src/schemas/version-seam.test.ts +13 -1
  487. package/src/schemas/vpn.ts +13 -0
  488. package/src/schemas/watch-sources.ts +127 -0
  489. package/src/schemas/workspace/workspace-search.ts +5 -2
  490. package/src/schemas/wsl-memory.ts +59 -0
  491. package/src/state/auth-state.ts +17 -0
  492. package/src/state/workspace-state.ts +18 -18
  493. package/src/text/embed.ts +2 -2
  494. package/dist/chores/extension-update.d.ts.map +0 -1
  495. package/dist/chores/extension-update.js.map +0 -1
  496. package/dist/contracts/chores.contract.d.ts +0 -213
  497. package/dist/contracts/chores.contract.d.ts.map +0 -1
  498. package/dist/contracts/chores.contract.js +0 -32
  499. package/dist/contracts/chores.contract.js.map +0 -1
  500. package/dist/contracts/issues.contract.d.ts +0 -106
  501. package/dist/contracts/issues.contract.d.ts.map +0 -1
  502. package/dist/contracts/issues.contract.js +0 -50
  503. package/dist/contracts/issues.contract.js.map +0 -1
  504. package/src/chores/chores.test.ts +0 -24
  505. package/src/chores/digest.test.ts +0 -27
  506. package/src/chores/probes.integration.test.ts +0 -494
  507. package/src/chores/stack.test.ts +0 -140
  508. package/src/chores/verdict.test.ts +0 -761
  509. package/src/contracts/chores.contract.ts +0 -39
  510. package/src/contracts/issues.contract.ts +0 -53
@@ -0,0 +1,179 @@
1
+ import { gcm } from "@noble/ciphers/aes.js";
2
+ import { hmac } from "@noble/hashes/hmac.js";
3
+ import { sha256 } from "@noble/hashes/sha2.js";
4
+ import { randomBytes } from "@noble/hashes/utils.js";
5
+ import { S2S_INFO, type S2sPublicKeys, type S2sSigningKeys } from "../../schemas/s2s-identity.js";
6
+ import { S2S_CALL_SKEW_MS, type S2sCallMethod, type S2sCallSealed, type S2sSessionOpen } from "../../schemas/s2s-wire.js";
7
+ import { canonicalBytes, equalBytes, fromBase64Url, fromUtf8, toBase64Url, utf8 } from "./canonical.js";
8
+ import { decapsulate, deriveKey, encapsulate } from "./kem.js";
9
+ import { fingerprintOf, type RandomBytes, type S2sKeySet, secretKeysOf } from "./keys.js";
10
+ import { hybridSign, hybridVerify } from "./sign.js";
11
+
12
+ // CALL SESSIONS (docs/architecture/messages.md, "Calls"): records and operating are request and response, so one hybrid
13
+ // key agreement, signed by the caller, opens a session whose key then seals every call and answer for an hour. A call
14
+ // costs a symmetric seal, never a signature, and carries a fresh nonce and a timestamp the callee holds to its replay
15
+ // window, so a call replayed or held back is refused.
16
+
17
+ const SESSION_INFO = `${S2S_INFO} session`;
18
+
19
+ // The session key both sides derive: 32 bytes, held in memory only.
20
+ export type SessionKey = Uint8Array;
21
+
22
+ const unsignedOf = (request: S2sSessionOpen): Omit<S2sSessionOpen, "sig"> => {
23
+ const { sig: _sig, ...rest } = request;
24
+ return rest;
25
+ };
26
+
27
+ const keyFor = (secret: Uint8Array, request: S2sSessionOpen): SessionKey => deriveKey(secret, sha256(canonicalBytes(unsignedOf(request))), SESSION_INFO);
28
+
29
+ export interface SessionOpenInput {
30
+ readonly from: string;
31
+ readonly to: string;
32
+ readonly as?: string | undefined;
33
+ readonly caller: S2sKeySet;
34
+ readonly callee: S2sPublicKeys;
35
+ readonly now: number;
36
+ readonly random?: RandomBytes;
37
+ }
38
+
39
+ // What the caller posts to POST /s2s/session, and the key it holds for the session's calls.
40
+ export interface SessionOpening {
41
+ readonly request: S2sSessionOpen;
42
+ readonly key: SessionKey;
43
+ }
44
+
45
+ // The caller's half: a fresh agreement to the callee's key set, signed.
46
+ export const openSession = ({ from, to, as, caller, callee, now, random = randomBytes }: SessionOpenInput): SessionOpening => {
47
+ const agreement = encapsulate(callee, random);
48
+ const unsigned: Omit<S2sSessionOpen, "sig"> = {
49
+ v: 1,
50
+ from,
51
+ fromFp: caller.fingerprint,
52
+ to,
53
+ toFp: fingerprintOf(callee),
54
+ at: now,
55
+ nonce: toBase64Url(random(16)),
56
+ enc: agreement.enc,
57
+ };
58
+ if (as !== undefined) {
59
+ unsigned.as = as;
60
+ }
61
+ const request: S2sSessionOpen = { ...unsigned, sig: hybridSign("session", canonicalBytes(unsigned), secretKeysOf(caller.secret)) };
62
+ return { request, key: keyFor(agreement.secret, request) };
63
+ };
64
+
65
+ export interface SessionAcceptInput {
66
+ // The pinned caller's public signing keys.
67
+ readonly caller: S2sSigningKeys;
68
+ // Every key set this sandbox can open with.
69
+ readonly keys: readonly S2sKeySet[];
70
+ readonly now: number;
71
+ readonly skewMs?: number;
72
+ }
73
+
74
+ // `signature`: the caller's keys did not sign it. `stale`: its time is outside the skew. `recipient`: sealed to no key
75
+ // set offered. `malformed`: its key agreement cannot be decapsulated.
76
+ export type SessionAccepted =
77
+ | { readonly ok: true; readonly key: SessionKey }
78
+ | { readonly ok: false; readonly reason: "signature" | "stale" | "recipient" | "malformed" };
79
+
80
+ // The callee's half: verify, check the clock, and derive the same key. A replayed request is the caller's replay
81
+ // window's to refuse (createReplayWindow, keyed by the request's nonce).
82
+ export const acceptSession = (request: S2sSessionOpen, { caller, keys, now, skewMs = S2S_CALL_SKEW_MS }: SessionAcceptInput): SessionAccepted => {
83
+ if (!hybridVerify("session", canonicalBytes(unsignedOf(request)), request.sig, caller)) {
84
+ return { ok: false, reason: "signature" };
85
+ }
86
+ if (Math.abs(now - request.at) > skewMs) {
87
+ return { ok: false, reason: "stale" };
88
+ }
89
+ const keySet = keys.find((candidate) => candidate.fingerprint === request.toFp);
90
+ if (keySet === undefined) {
91
+ return { ok: false, reason: "recipient" };
92
+ }
93
+ const secret = decapsulate(request.enc, secretKeysOf(keySet.secret));
94
+ return secret === undefined ? { ok: false, reason: "malformed" } : { ok: true, key: keyFor(secret, request) };
95
+ };
96
+
97
+ // The callee's proof it derived the same key: HMAC-SHA256 under it over the session id (S2sSessionAnswer `confirm`).
98
+ export const sessionConfirm = (key: SessionKey, session: string): string => toBase64Url(hmac(sha256, key, utf8(`${SESSION_INFO} confirm ${session}`)));
99
+
100
+ export const confirmsSession = (key: SessionKey, session: string, confirm: string): boolean => {
101
+ const given = fromBase64Url(confirm);
102
+ return given !== undefined && equalBytes(given, hmac(sha256, key, utf8(`${SESSION_INFO} confirm ${session}`)));
103
+ };
104
+
105
+ // Which way a sealed body travels. An answer is bound to the call it answers by that call's nonce (`re`), so no answer
106
+ // can be handed back for another call.
107
+ export type CallLeg = { readonly direction: "call" } | { readonly direction: "answer"; readonly re: string };
108
+
109
+ export interface CallContext {
110
+ readonly session: string;
111
+ readonly method: S2sCallMethod;
112
+ readonly leg: CallLeg;
113
+ }
114
+
115
+ const aadOf = ({ session, method, leg }: CallContext, at: number, nonce: string): Uint8Array =>
116
+ canonicalBytes(leg.direction === "call" ? { session, method, direction: "call", at, nonce } : { session, method, direction: "answer", re: leg.re, at, nonce });
117
+
118
+ // Seals a call's input or its answer, as JSON, under the session key.
119
+ export const sealCall = <T>(key: SessionKey, context: CallContext, payload: T, now: number, random: RandomBytes = randomBytes): S2sCallSealed => {
120
+ const nonceBytes = random(12);
121
+ const nonce = toBase64Url(nonceBytes);
122
+ const body = gcm(key, nonceBytes, aadOf(context, now, nonce)).encrypt(utf8(JSON.stringify(payload)));
123
+ return { at: now, nonce, body: toBase64Url(body) };
124
+ };
125
+
126
+ // The answer to admitting one nonce: fresh, outside the clock skew, or seen before.
127
+ export type ReplayVerdict = "fresh" | "stale" | "replay";
128
+
129
+ export interface ReplayWindow {
130
+ // Admits a nonce made at `at`, remembering it until it would be stale anyway.
131
+ readonly admit: (nonce: string, at: number, now: number) => ReplayVerdict;
132
+ readonly size: () => number;
133
+ }
134
+
135
+ // One session's (or one caller's session requests') nonces: a time outside `skewMs` of now is stale, a nonce seen within
136
+ // the window is a replay, and nothing older than the window is kept, since it would be refused as stale.
137
+ export const createReplayWindow = (skewMs: number = S2S_CALL_SKEW_MS): ReplayWindow => {
138
+ const seen = new Map<string, number>();
139
+ return {
140
+ admit: (nonce, at, now) => {
141
+ for (const [known, when] of seen) {
142
+ if (when < now - skewMs) {
143
+ seen.delete(known);
144
+ }
145
+ }
146
+ if (Math.abs(now - at) > skewMs) {
147
+ return "stale";
148
+ }
149
+ if (seen.has(nonce)) {
150
+ return "replay";
151
+ }
152
+ seen.set(nonce, at);
153
+ return "fresh";
154
+ },
155
+ size: () => seen.size,
156
+ };
157
+ };
158
+
159
+ export type CallOpened = { readonly ok: true; readonly json: string } | { readonly ok: false; readonly reason: "stale" | "replay" | "decrypt" };
160
+
161
+ // Opens a sealed call or answer: its time within the window, its nonce never seen, its body sealed under this key for
162
+ // this session, method and leg. Answers the JSON text, for the method's own schema to parse (S2S_CALLS).
163
+ export const openCall = (key: SessionKey, context: CallContext, sealed: S2sCallSealed, now: number, replay: ReplayWindow): CallOpened => {
164
+ const nonceBytes = fromBase64Url(sealed.nonce);
165
+ const body = fromBase64Url(sealed.body);
166
+ if (nonceBytes?.length !== 12 || body === undefined) {
167
+ return { ok: false, reason: "decrypt" };
168
+ }
169
+ let json: string;
170
+ try {
171
+ json = fromUtf8(gcm(key, nonceBytes, aadOf(context, sealed.at, sealed.nonce)).decrypt(body));
172
+ } catch {
173
+ // allow(silent-catch): a tag that does not verify is a tampered body, another session's, or another call's.
174
+ return { ok: false, reason: "decrypt" };
175
+ }
176
+ // After the tag, so a forged nonce cannot fill the window.
177
+ const verdict = replay.admit(sealed.nonce, sealed.at, now);
178
+ return verdict === "fresh" ? { ok: true, json } : { ok: false, reason: verdict };
179
+ };
@@ -0,0 +1,66 @@
1
+ import { fromBase64Url, toBase64Url, utf8 } from "./canonical.js";
2
+ import { secretKeysOf } from "./keys.js";
3
+ import { keySetFor } from "./s2s.testing.js";
4
+ import { hybridSign, hybridVerify, signedBytes } from "./sign.js";
5
+
6
+ const set = keySetFor(`ops`);
7
+ const other = keySetFor(`other`);
8
+ const message = utf8(`the bytes that matter`);
9
+ const sig = hybridSign(`envelope`, message, secretKeysOf(set.secret));
10
+
11
+ // The signature with one byte of one half changed.
12
+ const flipped = (half: string, at: number): string => {
13
+ const bytes = fromBase64Url(half) ?? new Uint8Array();
14
+ bytes[at] = (bytes[at] ?? 0) ^ 0x01;
15
+ return toBase64Url(bytes);
16
+ };
17
+
18
+ describe("a hybrid signature", () => {
19
+ it("verifies with the signer's keys over the same domain and bytes", () => {
20
+ expect(fromBase64Url(sig.ed25519)?.length).toBe(64);
21
+ expect(fromBase64Url(sig.mldsa65)?.length).toBe(3309);
22
+ expect(hybridVerify(`envelope`, message, sig, set.public)).toBe(true);
23
+ });
24
+
25
+ it("binds the domain, so a signature over an envelope is none over an identity", () => {
26
+ expect(hybridVerify(`identity`, message, sig, set.public)).toBe(false);
27
+ expect(signedBytes(`session`, utf8(`x`))).toEqual(utf8(`intentic-s2s/1 session\nx`));
28
+ });
29
+
30
+ it("does not verify with another key set", () => {
31
+ expect(hybridVerify(`envelope`, message, sig, other.public)).toBe(false);
32
+ expect(hybridVerify(`envelope`, message, sig, { ed25519: set.public.ed25519, mldsa65: other.public.mldsa65 })).toBe(false);
33
+ expect(hybridVerify(`envelope`, message, sig, { ed25519: other.public.ed25519, mldsa65: set.public.mldsa65 })).toBe(false);
34
+ });
35
+
36
+ it("does not verify on either algorithm's half alone: the other half from another signer fails it", () => {
37
+ const theirs = hybridSign(`envelope`, message, secretKeysOf(other.secret));
38
+ expect(hybridVerify(`envelope`, message, { ed25519: sig.ed25519, mldsa65: theirs.mldsa65 }, set.public)).toBe(false);
39
+ expect(hybridVerify(`envelope`, message, { ed25519: theirs.ed25519, mldsa65: sig.mldsa65 }, set.public)).toBe(false);
40
+ expect(hybridVerify(`envelope`, message, { ed25519: sig.ed25519, mldsa65: `` }, set.public)).toBe(false);
41
+ expect(hybridVerify(`envelope`, message, { ed25519: ``, mldsa65: sig.mldsa65 }, set.public)).toBe(false);
42
+ });
43
+
44
+ it("fails for any changed byte of the message", () => {
45
+ for (let at = 0; at < message.length; at++) {
46
+ const changed = message.slice();
47
+ changed[at] = (changed[at] ?? 0) ^ 0x80;
48
+ expect(hybridVerify(`envelope`, changed, sig, set.public)).toBe(false);
49
+ }
50
+ });
51
+
52
+ it("fails for any changed byte of the Ed25519 half, and for changed bytes across the ML-DSA half", () => {
53
+ for (let at = 0; at < 64; at++) {
54
+ expect(hybridVerify(`envelope`, message, { ...sig, ed25519: flipped(sig.ed25519, at) }, set.public)).toBe(false);
55
+ }
56
+ for (const at of [0, 1, 640, 1500, 2420, 3000, 3307, 3308]) {
57
+ expect(hybridVerify(`envelope`, message, { ...sig, mldsa65: flipped(sig.mldsa65, at) }, set.public)).toBe(false);
58
+ }
59
+ });
60
+
61
+ it("answers false, never throws, for halves and keys that are not base64url or of the wrong length", () => {
62
+ expect(hybridVerify(`envelope`, message, { ...sig, ed25519: `not base64!` }, set.public)).toBe(false);
63
+ expect(hybridVerify(`envelope`, message, { ...sig, mldsa65: sig.mldsa65.slice(0, 100) }, set.public)).toBe(false);
64
+ expect(hybridVerify(`envelope`, message, sig, { ...set.public, ed25519: set.public.ed25519.slice(0, 20) })).toBe(false);
65
+ });
66
+ });
@@ -0,0 +1,53 @@
1
+ import { ed25519 } from "@noble/curves/ed25519.js";
2
+ import { ml_dsa65 } from "@noble/post-quantum/ml-dsa.js";
3
+ import { type HybridSig, S2S_INFO, type S2sSigningKeys } from "../../schemas/s2s-identity.js";
4
+ import { concatBytes, fromBase64Url, toBase64Url, utf8 } from "./canonical.js";
5
+ import type { ExtensionSignDomain } from "./extension-sign.js";
6
+
7
+ // Hybrid signatures: Ed25519 and ML-DSA-65 over the same bytes, and a signature verifies only when both halves do, so it
8
+ // holds while either family does. Every signature names what it is for (its domain), so one made over an identity
9
+ // document can never be passed off as one over an envelope or a session.
10
+
11
+ export const SIGN_DOMAINS = ["identity", "identity-prev", "envelope", "session", "attestation"] as const;
12
+ export type SignDomain = (typeof SIGN_DOMAINS)[number];
13
+
14
+ // The secret signing keys, raw: an Ed25519 seed and an expanded ML-DSA-65 secret key (keys.ts secretKeysOf, or a
15
+ // recovery key).
16
+ export interface SigningSecret {
17
+ readonly ed25519: Uint8Array;
18
+ readonly mldsa65: Uint8Array;
19
+ }
20
+
21
+ // What is actually signed: the protocol, the domain and a newline, then the message.
22
+ export const signedBytes = (domain: SignDomain | ExtensionSignDomain, message: Uint8Array): Uint8Array => concatBytes(utf8(`${S2S_INFO} ${domain}\n`), message);
23
+
24
+ export const hybridSign = (domain: SignDomain | ExtensionSignDomain, message: Uint8Array, secret: SigningSecret): HybridSig => {
25
+ const bytes = signedBytes(domain, message);
26
+ return { ed25519: toBase64Url(ed25519.sign(bytes, secret.ed25519)), mldsa65: toBase64Url(ml_dsa65.sign(bytes, secret.mldsa65)) };
27
+ };
28
+
29
+ const verifiesWith = (verify: () => boolean): boolean => {
30
+ try {
31
+ return verify();
32
+ } catch {
33
+ // allow(silent-catch): a key or signature of the wrong length throws in the library; it verifies nothing.
34
+ return false;
35
+ }
36
+ };
37
+
38
+ // True only when both halves verify over the domain's bytes with these public keys; any malformed part is false.
39
+ export const hybridVerify = (domain: SignDomain | ExtensionSignDomain, message: Uint8Array, sig: HybridSig, keys: S2sSigningKeys): boolean => {
40
+ const parts = {
41
+ edSig: fromBase64Url(sig.ed25519),
42
+ dsaSig: fromBase64Url(sig.mldsa65),
43
+ edKey: fromBase64Url(keys.ed25519),
44
+ dsaKey: fromBase64Url(keys.mldsa65),
45
+ };
46
+ const { edSig, dsaSig, edKey, dsaKey } = parts;
47
+ if (edSig === undefined || dsaSig === undefined || edKey === undefined || dsaKey === undefined) {
48
+ return false;
49
+ }
50
+ const bytes = signedBytes(domain, message);
51
+ // RFC 8032's strict reading, not ZIP 215's: one signature per message and key, no other encodings of it.
52
+ return verifiesWith(() => ed25519.verify(edSig, bytes, edKey, { zip215: false })) && verifiesWith(() => ml_dsa65.verify(dsaSig, bytes, dsaKey));
53
+ };
@@ -18,7 +18,8 @@ export const ActivityEventSchema = z.object({
18
18
  .describe("Which account handled it. Absent for the sandbox's own events and for work run on a provider's default."),
19
19
  direction: z.enum(["in", "out", "system"]).describe("Whether something arrived, something went out, or the sandbox did it to itself."),
20
20
  // in: message.received, voice_utterance.received, voice_transcript.received
21
- // out: message.send, reaction.add, messages.read, api.call (unclassified endpoint)
21
+ // out: an outward action an extension declares (message.send, reaction.add, messages.read…), or api.call for a
22
+ // request through the credential gateway no declaration covers
22
23
  // system: gateway.login_failed, dispatch.failed, voice.session_started, voice.session_ended, automation.run,
23
24
  // turn.started, turn.plan, turn.error, turn.completed, rule.held_work, land.unhidden, extension.landed_on,
24
25
  // deps.verify_green, deps.verify_red, deps.breakage_routed, deps.breakage_fixup, deps.breakage_waiting,
@@ -12,6 +12,7 @@ describe("TurnProfile", () => {
12
12
  "fast",
13
13
  "harness",
14
14
  "isolated",
15
+ "job",
15
16
  "model",
16
17
  "runRole",
17
18
  "thinking",
@@ -35,6 +36,7 @@ describe("TurnProfile", () => {
35
36
  isolated: true,
36
37
  unattended: true,
37
38
  runRole: "loop-iteration",
39
+ job: "pipeline-fix",
38
40
  permissionMode: "plan",
39
41
  autoLand: false,
40
42
  });
@@ -50,6 +52,7 @@ describe("TurnProfile", () => {
50
52
  isolated: true,
51
53
  unattended: true,
52
54
  runRole: "loop-iteration",
55
+ job: "pipeline-fix",
53
56
  });
54
57
  });
55
58
 
@@ -2,7 +2,7 @@ import { TurnErrandSchema } from "./speaker.js";
2
2
  import { z } from "zod";
3
3
  import { CONVERSATION_ID, CONVERSATION_TITLE_MAX } from "../ids/conversation-ids.js";
4
4
  import { canonicalHarness } from "../models/agent-catalog.js";
5
- import { ModelRoleSchema } from "../models/model-roles.js";
5
+ import { ModelRoleSchema, RunRoleSchema } from "../models/model-roles.js";
6
6
  import { NATIVE_PROVIDERS } from "../models/provider-specs.js";
7
7
  import { AgentPlacementSchema } from "../protocol/doors/runner-protocol.js";
8
8
  import { MENTION_LIMIT } from "../text/mentions.js";
@@ -198,8 +198,13 @@ const AgentTurnFieldsSchema = z.object({
198
198
  ),
199
199
  // Which per-job model list answers when nobody named a model or provider (turn-resume.ts); names the job, not a
200
200
  // tier, and never overrides an explicit pick.
201
- runRole: ModelRoleSchema.optional().describe(
202
- "What started this turn, when it was not a person typing: which of the sandbox's per-job model lists answers for it. Only used when the turn names no model of its own.",
201
+ runRole: RunRoleSchema.optional().describe(
202
+ "What started this turn, when it was not a person typing: which of the sandbox's per-job model lists answers for it, one of the jobs every sandbox has known (`pipeline-fix`, `loop-iteration`). A job an extension declares goes in `job`. Only used when the turn names no model of its own.",
203
+ ),
204
+ // (2026-11-26) Any job's id, an extension's (`contributes.modelRoles`) included; `runRole` beside it keeps the closed
205
+ // list every daemon and the far ends of the field read, so it never shrinks (model-roles.ts RunRoleSchema).
206
+ job: ModelRoleSchema.optional().describe(
207
+ "The same as `runRole` for any job, one an enabled extension declares included (`nightly-audit`); wins over `runRole`. A sandbox from before 2026-11-26 ignores it.",
203
208
  ),
204
209
  // Set only by the daemon's own dispatchers, never a client; requires conversationId to record it on.
205
210
  origin: AgentOriginSchema.optional().describe(
@@ -387,7 +392,7 @@ export const withRuntimeDefaults = <T extends { readonly agent?: AgentProvider |
387
392
  return { ...turn, agent, harness: canonicalHarness(agent, turn.harness) };
388
393
  };
389
394
  // Which turn this is, as opposed to what it says: who serves it and how (agent, harness, account, model and its knobs),
390
- // as whom (actsAs), where (isolated), whether anyone watches (unattended) and for which job (runRole). A turn that
395
+ // as whom (actsAs), where (isolated), whether anyone watches (unattended) and for which job (job, runRole). A turn that
391
396
  // continues another (a resume, a wake, a nudge, a child's follow-up) carries this whole, never a hand-picked part.
392
397
  export const TurnProfileSchema = AgentTurnFieldsSchema.pick({
393
398
  agent: true,
@@ -401,6 +406,7 @@ export const TurnProfileSchema = AgentTurnFieldsSchema.pick({
401
406
  isolated: true,
402
407
  unattended: true,
403
408
  runRole: true,
409
+ job: true,
404
410
  });
405
411
  export type TurnProfile = z.infer<typeof TurnProfileSchema>;
406
412
  const PROFILE_KEYS = Object.keys(TurnProfileSchema.shape) as readonly (keyof TurnProfile)[];
@@ -1,6 +1,8 @@
1
1
  // approvals: things the agent prepared and may not do until the owner says yes (.intentic/config/approvals/<id>.json)
2
2
  import { z } from "zod";
3
+ import { PasskeyCosignSchema } from "../protocol/s2s/passkey-cosign.js";
3
4
  import { entryId } from "./internal.js";
5
+ import { AuthenticationResponseSchema } from "./system.js";
4
6
 
5
7
  // One queue for anything that needs a yes-click before a machine carries it out and records the outcome: an envelope
6
8
  // (who, when, status, result) plus a kind-specific payload, a discriminated union. Excludes a facts inbox and a hold a
@@ -108,6 +110,15 @@ export const ActionApprovalSchema = z.object({
108
110
  .describe(
109
111
  "Who carries this out instead of an agent turn: once you approve it, the sandbox hands it to that extension's backend, which acts only if what it holds still matches the digest. Written by the extension's own command when it holds an act; an item written by hand never needs one.",
110
112
  ),
113
+ // (2026-11-28) Written by whoever files the item (the performer extension), never by hand, and part of what the yes
114
+ // pins. The daemon refuses a `required` item approved without a passkey; the performer re-checks what it is handed
115
+ // (`ApprovedAction.cosign`), since a turn can write this file before anyone approves it.
116
+ cosign: z
117
+ .enum(["offered", "required"])
118
+ .optional()
119
+ .describe(
120
+ "Whether approving it with a passkey is offered, or required: the sandbox then keeps the passkey's signature over exactly what is approved and hands it to the extension carrying it out, which anyone can check later. Only an item naming a `performer` takes one.",
121
+ ),
111
122
  ...envelope,
112
123
  });
113
124
  export type ActionApproval = z.infer<typeof ActionApprovalSchema>;
@@ -125,6 +136,36 @@ export type ActionApprovalSummary = z.infer<typeof ActionApprovalSummarySchema>;
125
136
  export const ApprovalSummarySchema = z.discriminatedUnion("kind", [PostApprovalSummarySchema, ActionApprovalSummarySchema]);
126
137
  export type ApprovalSummary = z.infer<typeof ApprovalSummarySchema>;
127
138
 
139
+ // (2026-11-28) What `upsert` takes: an item as the owner wants it, and for an action being approved, optionally the
140
+ // passkey assertion that co-signs the yes (the browser's `PublicKeyCredential.toJSON()` over the challenge
141
+ // `passkeyOptions` answered). Never written into the item: the daemon verifies it, and keeps the co-signature
142
+ // (PasskeyCosignSchema) with the recorded yes, off the workspace.
143
+ export const ApprovalUpsertSchema = z.discriminatedUnion("kind", [
144
+ PostApprovalSummarySchema,
145
+ ActionApprovalSummarySchema.extend({
146
+ passkey: AuthenticationResponseSchema.optional().describe(
147
+ "Your passkey's assertion over this item's challenge (POST /approvals/{id}/passkey), when approving it with a passkey. Required for an item whose `cosign` is `required`.",
148
+ ),
149
+ }),
150
+ ]);
151
+ export type ApprovalUpsert = z.infer<typeof ApprovalUpsertSchema>;
152
+
153
+ // (2026-11-28) The WebAuthn request options for co-signing one action with a passkey, in the JSON form
154
+ // `PublicKeyCredential.parseRequestOptionsFromJSON` takes: the challenge is the approval's own
155
+ // (protocol/s2s/passkey-cosign.ts `cosignChallenge`), and only the signed-in person's own passkeys are allowed.
156
+ export const ApprovalPasskeyOptionsSchema = z.object({
157
+ rpId: z.string(),
158
+ challenge: z.string().describe("base64url of SHA-256 over this sandbox, this item and its performer's digest."),
159
+ timeout: z.number(),
160
+ userVerification: z.literal("required"),
161
+ allowCredentials: z.array(z.object({ type: z.literal("public-key"), id: z.string(), transports: z.array(z.string()).optional() })),
162
+ available: z.boolean().describe("Whether you hold a passkey on this sandbox to answer with; false means add one first, from Access."),
163
+ });
164
+ export type ApprovalPasskeyOptions = z.infer<typeof ApprovalPasskeyOptionsSchema>;
165
+
166
+ // (2026-11-28) The co-signature a yes was given with, as the sandbox keeps it and hands it on.
167
+ export { PasskeyCosignSchema };
168
+
128
169
  // Filenames that failed to parse; agent-written files are a trust boundary, so these are surfaced, not silently
129
170
  // dropped.
130
171
  export const ApprovalsListSchema = z.object({
@@ -5,6 +5,7 @@ import { entryId } from "./internal.js";
5
5
  import { IssuesConfigSchema } from "./issues.js";
6
6
  import { ZoneSchema } from "../time/zone.js";
7
7
  import { WorkspaceEventKindSchema } from "./automation-events.js";
8
+ import { WatchKindSchema, WatchSourceSchema } from "./watch-sources.js";
8
9
  export { WorkspaceEventKindSchema, WorkspaceEventSchema, type WorkspaceEventKind, type WorkspaceEvent } from "./automation-events.js";
9
10
  // An automation wakes the agent: the daemon fires each enabled one on its trigger, runs the optional guard command
10
11
  // (non-zero exit skips the wake), then runs one turn with the prompt. The manifest is user config; run history is
@@ -105,6 +106,12 @@ export const TriggerSchema = z.discriminatedUnion("kind", [
105
106
  .array(z.string())
106
107
  .optional()
107
108
  .describe("Which websites may reach the public endpoint, the chat widget's or the bug reporter's. Absent or empty admits nobody."),
109
+ // (2026-11-26) Read by an extension's public door whose route declares `keyFromBrowsers`; until then the bug
110
+ // intake's own setting (`issues.keyFromBrowsers`), moved here by the automations file's conversion.
111
+ keyFromBrowsers: z
112
+ .boolean()
113
+ .optional()
114
+ .describe("Let a browser on a site you did not list in with this automation's key, rather than only from a site you listed. Off unless you need it."),
108
115
  }),
109
116
  // `repo` narrows to events whose span touches one workspace repo ("root" or a repo id); absent ⇒ any.
110
117
  z.object({
@@ -114,48 +121,14 @@ export const TriggerSchema = z.discriminatedUnion("kind", [
114
121
  }),
115
122
  ]);
116
123
  export type Trigger = z.infer<typeof TriggerSchema>;
117
- // A watch is an automation whose check decides, without a model, whether anything happened: either its `guard` command
118
- // or one of these ready-made sources, which the daemon checks itself (automations/watch/watch-sources.ts). Only once the check
119
- // says so does anything run, and what it saw goes with the wake. No source needs an extension, a token or a shell.
120
- // npm: the registry's view of one package. With `range`, the check passes once a published version satisfies it, and
121
- // what it saw is that version; without, what it saw is the version under `tag` (latest by default), for `fireOn: change`.
122
- // github-release: a public repository's newest release (prereleases only when asked), for `fireOn: change`.
123
- // url: one page, its text or the first `select` match, for `fireOn: change`.
124
- export const WatchSourceSchema = z.discriminatedUnion("kind", [
125
- z.object({
126
- kind: z.literal("npm").describe("A package on the npm registry."),
127
- package: z.string().min(1).max(214).describe("The package name, scoped or not, like bun or @scope/name."),
128
- range: z
129
- .string()
130
- .min(1)
131
- .max(200)
132
- .optional()
133
- .describe("A semver range, like >=1.4.3. Passes once a published version satisfies it. Prereleases count only when the range names one."),
134
- tag: z.string().min(1).max(100).optional().describe("Which dist-tag to read without a range. Absent means latest."),
135
- }),
136
- z.object({
137
- kind: z.literal("github-release").describe("The newest release of a public GitHub repository."),
138
- repo: z
139
- .string()
140
- .regex(/^[\w.-]+\/[\w.-]+$/, "repo must look like owner/name")
141
- .describe("The repository, as owner/name."),
142
- prereleases: z.boolean().optional().describe("Count prereleases too. Absent means only full releases."),
143
- }),
144
- z.object({
145
- kind: z.literal("url").describe("One web page."),
146
- url: z.string().url().describe("The page, http or https."),
147
- select: z
148
- .string()
149
- .min(1)
150
- .max(500)
151
- .optional()
152
- .describe("A regular expression; what it matches (its first group, if it has one) is what is watched rather than the whole page's text."),
153
- }),
154
- ]);
155
- export type WatchSource = z.infer<typeof WatchSourceSchema>;
124
+ export * from "./watch-sources.js";
156
125
  // What a passing check sets off. `agent` (the default) is a new agent with the prompt, as every automation always did;
157
126
  // `conversation` continues one that already exists, the way a watch wakes the conversation that armed it, so a plan
158
127
  // made weeks ago resumes where it stopped; `notify` runs no model at all, and only tells the owner what the check saw.
128
+ // (2026-11-26) `extension` runs no model either: it hands the fire to a handler an extension's backend registered
129
+ // (`api.automations.onFire`) and its manifest declares (`permissions.fires`), through a backend-host door no person's,
130
+ // panel's or agent's token reaches. Only that extension saves one naming itself; a fire made while its backend is down
131
+ // is kept and handed over once it is back. An older daemon skips such an entry and keeps it in the file.
159
132
  export const AutomationTargetSchema = z.discriminatedUnion("kind", [
160
133
  z.object({ kind: z.literal("agent").describe("A new agent, told the prompt and what the check saw.") }),
161
134
  z.object({
@@ -163,6 +136,11 @@ export const AutomationTargetSchema = z.discriminatedUnion("kind", [
163
136
  conversationId: z.string().min(1).describe("Which conversation."),
164
137
  }),
165
138
  z.object({ kind: z.literal("notify").describe("No agent: a notification to the owner with what the check saw.") }),
139
+ z.object({
140
+ kind: z.literal("extension").describe("No agent: an extension's own code, woken through a handler its backend registered."),
141
+ extension: z.string().min(1).describe("The extension, as publisher.name."),
142
+ handler: z.string().min(1).describe("Which of its handlers, as its manifest's `permissions.fires` names them."),
143
+ }),
166
144
  ]);
167
145
  export type AutomationTarget = z.infer<typeof AutomationTargetSchema>;
168
146
  // `pass` (the default): every check that passes fires. `change`: a check fires only when what it saw differs from what
@@ -362,7 +340,7 @@ export const AutomationSchema = z.object({
362
340
  // The guard's alternative: a condition the daemon checks itself. Refused at upsert beside a guard, since two checks
363
341
  // would leave "what the check saw" meaning two things.
364
342
  source: WatchSourceSchema.optional().describe(
365
- "A ready-made check instead of a guard command: an npm package's version, a GitHub repository's newest release, or a web page.",
343
+ "A ready-made check instead of a guard command: a web page, or a kind an enabled extension declares, like an npm package's version or a GitHub repository's newest release.",
366
344
  ),
367
345
  fireOn: FireOnSchema.optional().describe(
368
346
  "Fire on every passing check, or only when what the check saw changed since the last one. Absent means every passing check.",
@@ -465,7 +443,7 @@ export const AutomationSchema = z.object({
465
443
  .string()
466
444
  .optional()
467
445
  .describe(
468
- "Who made it, as the sandbox recorded it: a member's email, or agent:<conversation id> for one an agent proposed and a person approved. Its notices (a watch firing or ending, a one-time wake done) go to them. Set by the sandbox; a value sent with a save is ignored. Absent on one made before it was kept, whose notices go to the sandbox's owner and maintainers.",
446
+ "Who made it, as the sandbox recorded it: a member's email, agent:<conversation id> for one an agent proposed and a person approved, or extension:<publisher.name> for one an extension saved with its own token. Its notices (a watch firing or ending, a one-time wake done) go to them. Set by the sandbox; a value sent with a save is ignored. Absent on one made before it was kept, whose notices go to the sandbox's owner and maintainers.",
469
447
  ),
470
448
  });
471
449
  export type Automation = z.infer<typeof AutomationSchema>;
@@ -607,6 +585,11 @@ export const TriggerSourceSchema = z.object({
607
585
  mentionLabel: z.string().min(1).optional(),
608
586
  // The provider owns the payload vocabulary, so it owns the first prompt that explains that payload.
609
587
  starterPrompt: z.string().min(1).optional(),
588
+ // (2026-11-26) Set on a source anyone on the internet reaches (a listener's `strangers`), naming which of the owner's
589
+ // admission floors its wakes answer to: `visitor` (a website visitor's), `report` (a bug report's), and (2026-11-27)
590
+ // `contact` (a contact request from a sandbox that is not a contact yet). Absent: a source whose senders the owner
591
+ // connected, held to the team chat floor.
592
+ strangers: z.enum(["visitor", "report", "contact"]).optional(),
610
593
  // Any one connected capability is enough; computed client-side, since capability facts are pushed live and a served
611
594
  // boolean would go stale between polls.
612
595
  requires: z.array(z.string().min(1)).default([]),
@@ -655,5 +638,7 @@ export type AutomationTemplate = z.infer<typeof AutomationTemplateSchema>;
655
638
  export const AutomationCatalogSchema = z.object({
656
639
  sources: z.array(TriggerSourceSchema),
657
640
  templates: z.array(AutomationTemplateSchema),
641
+ // (2026-11-26) Each installed extension's watch kinds; absent from an older daemon (BUILT_IN_WATCH_KINDS).
642
+ watchKinds: z.array(WatchKindSchema).optional(),
658
643
  });
659
644
  export type AutomationCatalog = z.infer<typeof AutomationCatalogSchema>;
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+
3
+ // ---- (2026-11-25) a deployment told to the forge: POST /ci/deployments ------------------------------------------------
4
+ // The repository's forge shows that a commit went to an environment, through the token of the github/gitlab
5
+ // connection the CI board already uses: on GitHub a Deployment (`environment`) and its statuses, on GitLab a commit
6
+ // status named `deploy/<environment>`. The first report for a deployment answers its `deploymentId`; the later states
7
+ // pass it back. A token without the scope is refused in the forge's words, never retried.
8
+ export const CiDeploymentStateSchema = z.enum(["in_progress", "success", "failure", "inactive"]);
9
+ export const CiDeploymentReportSchema = z.object({
10
+ repo: z.string().min(1).max(500),
11
+ sha: z.string().regex(/^[0-9a-f]{40,64}$/),
12
+ environment: z.string().min(1).max(100),
13
+ state: CiDeploymentStateSchema,
14
+ production: z.boolean().optional(),
15
+ description: z.string().max(140).optional(),
16
+ environmentUrl: z.string().url().max(2000).optional(),
17
+ logUrl: z.string().url().max(2000).optional(),
18
+ deploymentId: z.number().optional(),
19
+ });
20
+ export type CiDeploymentReport = z.infer<typeof CiDeploymentReportSchema>;
21
+ export const CiDeploymentAnswerSchema = z.object({
22
+ deploymentId: z.number().optional(),
23
+ // The forge's page for it, when it has one.
24
+ url: z.string().optional(),
25
+ });
26
+ export type CiDeploymentAnswer = z.infer<typeof CiDeploymentAnswerSchema>;