@intentic/sandbox-contract 1.431.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 (362) hide show
  1. package/README.md +10 -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 +869 -12
  29. package/dist/contracts/agent.contract.d.ts.map +1 -1
  30. package/dist/contracts/agents.contract.d.ts +291 -4
  31. package/dist/contracts/agents.contract.d.ts.map +1 -1
  32. package/dist/contracts/automations.contract.d.ts +59 -8
  33. package/dist/contracts/automations.contract.d.ts.map +1 -1
  34. package/dist/contracts/capabilities.contract.d.ts +37 -0
  35. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  36. package/dist/contracts/capabilities.contract.js +21 -0
  37. package/dist/contracts/capabilities.contract.js.map +1 -1
  38. package/dist/contracts/ci.contract.d.ts +222 -95
  39. package/dist/contracts/ci.contract.d.ts.map +1 -1
  40. package/dist/contracts/ci.contract.js +87 -26
  41. package/dist/contracts/ci.contract.js.map +1 -1
  42. package/dist/contracts/device-stacks.contract.d.ts +129 -0
  43. package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
  44. package/dist/contracts/device-stacks.contract.js +66 -0
  45. package/dist/contracts/device-stacks.contract.js.map +1 -0
  46. package/dist/contracts/device.contract.d.ts +47 -0
  47. package/dist/contracts/device.contract.d.ts.map +1 -1
  48. package/dist/contracts/extensions.contract.d.ts +603 -0
  49. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  50. package/dist/contracts/extensions.contract.js +10 -1
  51. package/dist/contracts/extensions.contract.js.map +1 -1
  52. package/dist/contracts/needs.contract.d.ts +689 -18
  53. package/dist/contracts/needs.contract.d.ts.map +1 -1
  54. package/dist/contracts/offload.contract.d.ts +21 -0
  55. package/dist/contracts/offload.contract.d.ts.map +1 -1
  56. package/dist/contracts/runner.contract.d.ts +501 -8
  57. package/dist/contracts/runner.contract.d.ts.map +1 -1
  58. package/dist/contracts/seal.contract.d.ts +15 -0
  59. package/dist/contracts/seal.contract.d.ts.map +1 -1
  60. package/dist/contracts/secrets.contract.d.ts +15 -0
  61. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  62. package/dist/contracts/secrets.contract.js +21 -1
  63. package/dist/contracts/secrets.contract.js.map +1 -1
  64. package/dist/contracts/sessions.contract.d.ts +111 -2
  65. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  66. package/dist/contracts/settings.contract.d.ts +57 -42
  67. package/dist/contracts/settings.contract.d.ts.map +1 -1
  68. package/dist/contracts/settings.contract.js +18 -0
  69. package/dist/contracts/settings.contract.js.map +1 -1
  70. package/dist/contracts/stack-grants.contract.d.ts +418 -0
  71. package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
  72. package/dist/contracts/stack-grants.contract.js +46 -0
  73. package/dist/contracts/stack-grants.contract.js.map +1 -0
  74. package/dist/contracts/system.contract.d.ts +188 -69
  75. package/dist/contracts/system.contract.d.ts.map +1 -1
  76. package/dist/contracts/system.contract.js +12 -42
  77. package/dist/contracts/system.contract.js.map +1 -1
  78. package/dist/contracts/workspace.contract.d.ts +0 -55
  79. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  80. package/dist/contracts/workspace.contract.js +0 -19
  81. package/dist/contracts/workspace.contract.js.map +1 -1
  82. package/dist/events/agent-events.d.ts +421 -8
  83. package/dist/events/agent-events.d.ts.map +1 -1
  84. package/dist/events/agent-transcript.d.ts +111 -2
  85. package/dist/events/agent-transcript.d.ts.map +1 -1
  86. package/dist/events/agent-words.d.ts.map +1 -1
  87. package/dist/events/agent-words.js +2 -1
  88. package/dist/events/agent-words.js.map +1 -1
  89. package/dist/events/child-news.d.ts +32 -0
  90. package/dist/events/child-news.d.ts.map +1 -0
  91. package/dist/events/child-news.js +171 -0
  92. package/dist/events/child-news.js.map +1 -0
  93. package/dist/events/prompt-origins.d.ts +42 -0
  94. package/dist/events/prompt-origins.d.ts.map +1 -1
  95. package/dist/events/prompt-origins.js +28 -0
  96. package/dist/events/prompt-origins.js.map +1 -1
  97. package/dist/events/requests.d.ts +14 -0
  98. package/dist/events/requests.d.ts.map +1 -1
  99. package/dist/events/requests.js +12 -0
  100. package/dist/events/requests.js.map +1 -1
  101. package/dist/events/system-events.d.ts +12 -0
  102. package/dist/events/system-events.d.ts.map +1 -1
  103. package/dist/events/transcript.d.ts +559 -10
  104. package/dist/events/transcript.d.ts.map +1 -1
  105. package/dist/events/transcript.js +2 -1
  106. package/dist/events/transcript.js.map +1 -1
  107. package/dist/index.d.ts +2 -4
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +2 -4
  110. package/dist/index.js.map +1 -1
  111. package/dist/models/model-roles.d.ts +91 -37
  112. package/dist/models/model-roles.d.ts.map +1 -1
  113. package/dist/models/model-roles.js +106 -35
  114. package/dist/models/model-roles.js.map +1 -1
  115. package/dist/models/model-setups.d.ts +10 -8
  116. package/dist/models/model-setups.d.ts.map +1 -1
  117. package/dist/models/model-setups.js +15 -15
  118. package/dist/models/model-setups.js.map +1 -1
  119. package/dist/policy/approvals-execution.d.ts +5 -2
  120. package/dist/policy/approvals-execution.d.ts.map +1 -1
  121. package/dist/policy/approvals-execution.js +3 -4
  122. package/dist/policy/approvals-execution.js.map +1 -1
  123. package/dist/policy/batch-runs.d.ts +1 -1
  124. package/dist/policy/batch-runs.d.ts.map +1 -1
  125. package/dist/policy/batch-runs.js +2 -1
  126. package/dist/policy/batch-runs.js.map +1 -1
  127. package/dist/policy/message-limits.d.ts.map +1 -1
  128. package/dist/policy/message-limits.js.map +1 -1
  129. package/dist/policy/org-locks.d.ts +1 -1
  130. package/dist/policy/org-locks.d.ts.map +1 -1
  131. package/dist/policy/org-locks.js +1 -0
  132. package/dist/policy/org-locks.js.map +1 -1
  133. package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
  134. package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
  135. package/dist/policy/shell/workspace-root-exclude.js +4 -0
  136. package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
  137. package/dist/protocol/doors/listener-protocol.d.ts +7 -0
  138. package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
  139. package/dist/protocol/doors/listener-protocol.js +1 -0
  140. package/dist/protocol/doors/listener-protocol.js.map +1 -1
  141. package/dist/protocol/doors/webext-links.d.ts.map +1 -1
  142. package/dist/protocol/doors/webext-links.js.map +1 -1
  143. package/dist/protocol/raw/extension-protocol.d.ts +518 -0
  144. package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
  145. package/dist/protocol/raw/extension-protocol.js +276 -0
  146. package/dist/protocol/raw/extension-protocol.js.map +1 -1
  147. package/dist/protocol/raw/raw-json-routes.d.ts +60 -0
  148. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  149. package/dist/protocol/raw/raw-routes.d.ts +81 -1
  150. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  151. package/dist/protocol/raw/raw-routes.js +16 -1
  152. package/dist/protocol/raw/raw-routes.js.map +1 -1
  153. package/dist/schemas/activity.d.ts.map +1 -1
  154. package/dist/schemas/activity.js.map +1 -1
  155. package/dist/schemas/agent.d.ts +4 -0
  156. package/dist/schemas/agent.d.ts.map +1 -1
  157. package/dist/schemas/agent.js +4 -2
  158. package/dist/schemas/agent.js.map +1 -1
  159. package/dist/schemas/agents-list.d.ts +6 -0
  160. package/dist/schemas/agents-list.d.ts.map +1 -1
  161. package/dist/schemas/agents.d.ts +12 -0
  162. package/dist/schemas/agents.d.ts.map +1 -1
  163. package/dist/schemas/automations.d.ts +87 -27
  164. package/dist/schemas/automations.d.ts.map +1 -1
  165. package/dist/schemas/automations.js +15 -33
  166. package/dist/schemas/automations.js.map +1 -1
  167. package/dist/schemas/ci-deployments.d.ts +30 -0
  168. package/dist/schemas/ci-deployments.d.ts.map +1 -0
  169. package/dist/schemas/ci-deployments.js +18 -0
  170. package/dist/schemas/ci-deployments.js.map +1 -0
  171. package/dist/schemas/ci.d.ts +348 -21
  172. package/dist/schemas/ci.d.ts.map +1 -1
  173. package/dist/schemas/ci.js +110 -19
  174. package/dist/schemas/ci.js.map +1 -1
  175. package/dist/schemas/command-run.d.ts +29 -0
  176. package/dist/schemas/command-run.d.ts.map +1 -0
  177. package/dist/schemas/command-run.js +20 -0
  178. package/dist/schemas/command-run.js.map +1 -0
  179. package/dist/schemas/data-protection.d.ts +15 -2
  180. package/dist/schemas/data-protection.d.ts.map +1 -1
  181. package/dist/schemas/data-protection.js +15 -23
  182. package/dist/schemas/data-protection.js.map +1 -1
  183. package/dist/schemas/device-stacks.d.ts +131 -0
  184. package/dist/schemas/device-stacks.d.ts.map +1 -1
  185. package/dist/schemas/device-stacks.js +81 -0
  186. package/dist/schemas/device-stacks.js.map +1 -1
  187. package/dist/schemas/devices.d.ts +73 -0
  188. package/dist/schemas/devices.d.ts.map +1 -1
  189. package/dist/schemas/devices.js +6 -2
  190. package/dist/schemas/devices.js.map +1 -1
  191. package/dist/schemas/extension-updates.d.ts +1184 -0
  192. package/dist/schemas/extension-updates.d.ts.map +1 -1
  193. package/dist/schemas/extension-updates.js +18 -4
  194. package/dist/schemas/extension-updates.js.map +1 -1
  195. package/dist/schemas/host-power.d.ts +22 -0
  196. package/dist/schemas/host-power.d.ts.map +1 -1
  197. package/dist/schemas/host-power.js +55 -0
  198. package/dist/schemas/host-power.js.map +1 -1
  199. package/dist/schemas/hosts.d.ts +226 -0
  200. package/dist/schemas/hosts.d.ts.map +1 -1
  201. package/dist/schemas/hosts.js +24 -0
  202. package/dist/schemas/hosts.js.map +1 -1
  203. package/dist/schemas/issues.d.ts +35 -249
  204. package/dist/schemas/issues.d.ts.map +1 -1
  205. package/dist/schemas/issues.js +9 -43
  206. package/dist/schemas/issues.js.map +1 -1
  207. package/dist/schemas/maintenance.d.ts.map +1 -1
  208. package/dist/schemas/maintenance.js.map +1 -1
  209. package/dist/schemas/metrics.d.ts +25 -0
  210. package/dist/schemas/metrics.d.ts.map +1 -1
  211. package/dist/schemas/metrics.js +18 -0
  212. package/dist/schemas/metrics.js.map +1 -1
  213. package/dist/schemas/need-kinds.d.ts +19 -0
  214. package/dist/schemas/need-kinds.d.ts.map +1 -0
  215. package/dist/schemas/need-kinds.js +7 -0
  216. package/dist/schemas/need-kinds.js.map +1 -0
  217. package/dist/schemas/needs.d.ts +523 -30
  218. package/dist/schemas/needs.d.ts.map +1 -1
  219. package/dist/schemas/needs.js +36 -6
  220. package/dist/schemas/needs.js.map +1 -1
  221. package/dist/schemas/offload.d.ts +52 -0
  222. package/dist/schemas/offload.d.ts.map +1 -1
  223. package/dist/schemas/offload.js +12 -0
  224. package/dist/schemas/offload.js.map +1 -1
  225. package/dist/schemas/outward-action.d.ts +39 -0
  226. package/dist/schemas/outward-action.d.ts.map +1 -0
  227. package/dist/schemas/outward-action.js +40 -0
  228. package/dist/schemas/outward-action.js.map +1 -0
  229. package/dist/schemas/providers/plan-limits.d.ts +1 -0
  230. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  231. package/dist/schemas/providers/plan-limits.js +1 -0
  232. package/dist/schemas/providers/plan-limits.js.map +1 -1
  233. package/dist/schemas/secrets.d.ts +17 -0
  234. package/dist/schemas/secrets.d.ts.map +1 -1
  235. package/dist/schemas/secrets.js +12 -5
  236. package/dist/schemas/secrets.js.map +1 -1
  237. package/dist/schemas/settings-history.d.ts +1 -1
  238. package/dist/schemas/settings-history.d.ts.map +1 -1
  239. package/dist/schemas/settings-history.js +5 -4
  240. package/dist/schemas/settings-history.js.map +1 -1
  241. package/dist/schemas/settings-savings.d.ts +58 -0
  242. package/dist/schemas/settings-savings.d.ts.map +1 -1
  243. package/dist/schemas/settings-savings.js +22 -0
  244. package/dist/schemas/settings-savings.js.map +1 -1
  245. package/dist/schemas/settings.d.ts +2 -42
  246. package/dist/schemas/settings.d.ts.map +1 -1
  247. package/dist/schemas/settings.js +5 -6
  248. package/dist/schemas/settings.js.map +1 -1
  249. package/dist/schemas/stack-grants.d.ts +60 -0
  250. package/dist/schemas/stack-grants.d.ts.map +1 -0
  251. package/dist/schemas/stack-grants.js +33 -0
  252. package/dist/schemas/stack-grants.js.map +1 -0
  253. package/dist/schemas/watch-sources.d.ts +72 -0
  254. package/dist/schemas/watch-sources.d.ts.map +1 -0
  255. package/dist/schemas/watch-sources.js +88 -0
  256. package/dist/schemas/watch-sources.js.map +1 -0
  257. package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
  258. package/dist/schemas/workspace/workspace-search.js +1 -1
  259. package/dist/schemas/workspace/workspace-search.js.map +1 -1
  260. package/dist/schemas/wsl-memory.d.ts +76 -0
  261. package/dist/schemas/wsl-memory.d.ts.map +1 -0
  262. package/dist/schemas/wsl-memory.js +36 -0
  263. package/dist/schemas/wsl-memory.js.map +1 -0
  264. package/dist/state/auth-state.d.ts.map +1 -1
  265. package/dist/state/auth-state.js +2 -0
  266. package/dist/state/auth-state.js.map +1 -1
  267. package/dist/state/definition.d.ts +4 -8
  268. package/dist/state/definition.d.ts.map +1 -1
  269. package/dist/state/workspace-state.d.ts +8 -3
  270. package/dist/state/workspace-state.d.ts.map +1 -1
  271. package/dist/state/workspace-state.js +8 -3
  272. package/dist/state/workspace-state.js.map +1 -1
  273. package/package.json +5 -5
  274. package/src/briefs/agent-ask.ts +23 -0
  275. package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
  276. package/src/chores/digest.ts +1 -0
  277. package/src/chores/index.ts +13 -2
  278. package/src/chores/prompt.ts +3 -18
  279. package/src/chores/stack.ts +1 -0
  280. package/src/chores/verdict.ts +1 -0
  281. package/src/chores/workspace-scope.ts +3 -8
  282. package/src/contracts/capabilities.contract.ts +24 -0
  283. package/src/contracts/ci.contract.ts +119 -37
  284. package/src/contracts/device-stacks.contract.ts +97 -0
  285. package/src/contracts/extensions.contract.ts +11 -0
  286. package/src/contracts/secrets.contract.ts +27 -0
  287. package/src/contracts/settings.contract.ts +24 -0
  288. package/src/contracts/stack-grants.contract.ts +51 -0
  289. package/src/contracts/system.contract.ts +16 -59
  290. package/src/contracts/workspace.contract.ts +0 -22
  291. package/src/events/agent-words.ts +3 -1
  292. package/src/events/child-news.test.ts +91 -0
  293. package/src/events/child-news.ts +269 -0
  294. package/src/events/prompt-origins.ts +35 -0
  295. package/src/events/requests.ts +18 -0
  296. package/src/events/transcript.ts +10 -1
  297. package/src/index.ts +3 -6
  298. package/src/models/model-roles.test.ts +61 -4
  299. package/src/models/model-roles.ts +153 -49
  300. package/src/models/model-setups.ts +49 -26
  301. package/src/policy/approvals-execution.ts +11 -6
  302. package/src/policy/batch-runs.ts +2 -2
  303. package/src/policy/message-limits.ts +8 -4
  304. package/src/policy/org-locks.ts +1 -0
  305. package/src/policy/shell/workspace-root-exclude.ts +11 -0
  306. package/src/protocol/doors/listener-protocol.ts +14 -0
  307. package/src/protocol/doors/webext-links.ts +3 -1
  308. package/src/protocol/raw/extension-protocol.ts +469 -2
  309. package/src/protocol/raw/raw-routes.ts +45 -4
  310. package/src/schemas/activity.ts +2 -1
  311. package/src/schemas/agent.test.ts +3 -0
  312. package/src/schemas/agent.ts +10 -4
  313. package/src/schemas/automations.ts +25 -41
  314. package/src/schemas/ci-deployments.ts +26 -0
  315. package/src/schemas/ci.ts +185 -45
  316. package/src/schemas/command-run.ts +44 -0
  317. package/src/schemas/data-protection.ts +28 -34
  318. package/src/schemas/device-stacks.ts +162 -3
  319. package/src/schemas/devices.ts +13 -2
  320. package/src/schemas/extension-updates.ts +27 -7
  321. package/src/schemas/host-power.test.ts +53 -0
  322. package/src/schemas/host-power.ts +96 -2
  323. package/src/schemas/hosts.test.ts +32 -0
  324. package/src/schemas/hosts.ts +62 -0
  325. package/src/schemas/issues.ts +29 -86
  326. package/src/schemas/maintenance.ts +4 -3
  327. package/src/schemas/metrics.ts +35 -0
  328. package/src/schemas/need-kinds.ts +13 -0
  329. package/src/schemas/needs.ts +57 -16
  330. package/src/schemas/offload.ts +31 -0
  331. package/src/schemas/outward-action.ts +47 -0
  332. package/src/schemas/providers/plan-limits.ts +1 -0
  333. package/src/schemas/secrets.ts +23 -5
  334. package/src/schemas/settings-history.ts +10 -5
  335. package/src/schemas/settings-savings.ts +29 -0
  336. package/src/schemas/settings.test.ts +23 -23
  337. package/src/schemas/settings.ts +10 -12
  338. package/src/schemas/stack-grants.ts +59 -0
  339. package/src/schemas/version-seam.test.ts +4 -1
  340. package/src/schemas/watch-sources.ts +127 -0
  341. package/src/schemas/workspace/workspace-search.ts +5 -2
  342. package/src/schemas/wsl-memory.ts +59 -0
  343. package/src/state/auth-state.ts +7 -0
  344. package/src/state/workspace-state.ts +18 -18
  345. package/src/text/embed.ts +2 -2
  346. package/dist/chores/extension-update.d.ts.map +0 -1
  347. package/dist/chores/extension-update.js.map +0 -1
  348. package/dist/contracts/chores.contract.d.ts +0 -213
  349. package/dist/contracts/chores.contract.d.ts.map +0 -1
  350. package/dist/contracts/chores.contract.js +0 -32
  351. package/dist/contracts/chores.contract.js.map +0 -1
  352. package/dist/contracts/issues.contract.d.ts +0 -106
  353. package/dist/contracts/issues.contract.d.ts.map +0 -1
  354. package/dist/contracts/issues.contract.js +0 -50
  355. package/dist/contracts/issues.contract.js.map +0 -1
  356. package/src/chores/chores.test.ts +0 -24
  357. package/src/chores/digest.test.ts +0 -27
  358. package/src/chores/probes.integration.test.ts +0 -494
  359. package/src/chores/stack.test.ts +0 -140
  360. package/src/chores/verdict.test.ts +0 -761
  361. package/src/contracts/chores.contract.ts +0 -39
  362. package/src/contracts/issues.contract.ts +0 -53
@@ -1,11 +1,11 @@
1
- // Inbound bug reports from the owner's own sites and apps, grouped by fingerprint
2
- // (.intentic/records/issues/<fingerprint>.json, one file per group).
1
+ // Bug reports from the owner's own sites and apps, as they travel: what the reporter SDK sends, what an intake's
2
+ // automation is configured with, and what one sandbox of the owner's account reports to another. The inbox they are
3
+ // grouped into (.intentic/records/issues/, one file per fingerprint) is the issues extension's own since 2026-11-26, and
4
+ // so are its shapes.
3
5
  import { z } from "zod";
4
- import { entryId } from "./internal.js";
5
6
 
6
- // Three shapes: `IssueReportSchema` (untrusted, from a stranger's POST), `IssueSchema` (the daemon's per-fingerprint
7
- // group with a count and latest sample), and `IssuesConfigSchema`/`IssuePublicConfigSchema` (owner settings vs. what
8
- // the SDK reads back). Imported as types only, so zod never reaches a browser.
7
+ // `IssueReportSchema` (untrusted, from a stranger's POST), and `IssuesConfigSchema`/`IssuePublicConfigSchema` (owner
8
+ // settings vs. what the SDK reads back). Imported as types only, so zod never reaches a browser.
9
9
 
10
10
  // `crash` and `detection` group under one fingerprint with a rising count; `report` never groups, since two people's
11
11
  // own words are two different things.
@@ -55,8 +55,11 @@ export const IssueReportSchema = z.object({
55
55
  });
56
56
  export type IssueReport = z.infer<typeof IssueReportSchema>;
57
57
 
58
- // POSTed to /intake/<id>/report: the report plus what the gate needs (client id, anti-bot answer) but never stores —
59
- // keeps the stored sample pure evidence, not doorman's paperwork.
58
+ // POSTed to an intake's report door: the report plus what the gate needs (client id, anti-bot answer) but never stores,
59
+ // which keeps the stored sample pure evidence, not doorman's paperwork. Since 2026-11-26 the door is the issues
60
+ // extension's (/door/intentic.issues/<id>/report), where the key travels as `?key=` and a proof of work in the door's
61
+ // headers; `powNonce` and `key` are what an SDK from before then puts in the body at /intake/<id>/report, which the
62
+ // daemon still forwards there.
60
63
  export const IssueIngestSchema = z.object({
61
64
  report: IssueReportSchema,
62
65
  // Per-minute limit key; distinct from the daily budget below.
@@ -69,20 +72,6 @@ export const IssueIngestSchema = z.object({
69
72
  });
70
73
  export type IssueIngest = z.infer<typeof IssueIngestSchema>;
71
74
 
72
- // `investigating` is set only by the daemon when a turn actually starts (a wake, or the Investigate button); never
73
- // guessed, never settable by a click.
74
- export const IssueStatusSchema = z.enum(["open", "investigating", "resolved", "ignored"]);
75
- export type IssueStatus = z.infer<typeof IssueStatusSchema>;
76
-
77
- // Store only the conversation id for an issue run.
78
- export const IssueRunSchema = z.object({
79
- conversationId: z.string().describe("The conversation this run became."),
80
- at: z.number().describe("When it started, in milliseconds."),
81
- // Lets a post-fix recurrence read as "it came back", not "already looked at".
82
- atCount: z.number().describe("How many times it had happened when this run started."),
83
- });
84
- export type IssueRun = z.infer<typeof IssueRunSchema>;
85
-
86
75
  // Who reported it, when the reporter was another sandbox on the owner's account (account-level report routing). Read
87
76
  // from the platform-signed pass, except `conversationId`, which the sending daemon names for its own conversation.
88
77
  export const IssueSenderSchema = z.object({
@@ -120,6 +109,16 @@ export const AccountReportSchema = z.object({
120
109
  });
121
110
  export type AccountReport = z.infer<typeof AccountReportSchema>;
122
111
 
112
+ // (2026-11-26) An admitted account report as the receiving door hands it to the extension that keeps the issues inbox
113
+ // (its `account-report` fire handler, the fire's payload as JSON): the problem, how many arrivals it stands for, and the
114
+ // sender as the platform's pass named it, which the inbox keeps outside everything the reporter wrote.
115
+ export const AccountReportFiledSchema = z.object({
116
+ report: AccountProblemSchema,
117
+ times: z.number().int().min(1).max(10_000),
118
+ sender: IssueSenderSchema,
119
+ });
120
+ export type AccountReportFiled = z.infer<typeof AccountReportFiledSchema>;
121
+
123
122
  // The sending side, over loopback from the `projects report` command: a problem for whichever sandbox on the owner's
124
123
  // account claims `project`, and what came of it (delivered now, waiting in the outbox, or refused for good).
125
124
  export const AccountSendSchema = z.object({
@@ -149,62 +148,18 @@ export const AccountOutboxSchema = z.object({
149
148
  export type AccountOutbox = z.infer<typeof AccountOutboxSchema>;
150
149
  export const AccountProjectsSchema = z.object({ projects: z.array(z.string()) });
151
150
 
152
- // One group; the id is the fingerprint and the filename, never in the body, so a body cannot disagree with its own
153
- // grouping.
154
- export const IssueSchema = z.object({
155
- kind: IssueKindSchema,
156
- // Derived from the report, never typed, so two recurrences of one crash can't end up under two titles.
157
- title: z.string().min(1).max(300).describe("The one line this is listed under."),
158
- culprit: z.string().max(300).optional().describe("The frame it came from, when the stack named one."),
159
- // A workspace can run several intakes (one per site); the inbox is one list across all of them.
160
- automationId: entryId.describe("Which intake received it."),
161
- // Absent for a keyed client (mobile app, server) with no Origin header to send.
162
- origin: z.string().max(400).optional().describe("Which site it came from."),
163
- firstSeen: z.number().describe("When it first happened, in milliseconds."),
164
- lastSeen: z.number().describe("When it last happened, in milliseconds."),
165
- count: z.number().describe("How many times this exact thing has arrived."),
166
- status: IssueStatusSchema.default("open").describe("Where it stands with you."),
167
- statusAt: z.number().optional().describe("When the status last changed, in milliseconds."),
168
- release: z.string().max(200).optional().describe("The build the latest one came from."),
169
- // Latest, not first: a fix must match what it looks like now, not a build that may no longer exist.
170
- sample: IssueReportSchema.describe("The most recent one, in full."),
171
- // Escalation rule lives in this number: fires once when new, again only once count has moved this far past it.
172
- // Stored, since a restart can't derive it from a count and timestamp.
173
- firedAt: z.number().optional().describe("What the count stood at the last time this woke an agent."),
174
- runs: z.array(IssueRunSchema).max(20).optional().describe("The turns started for it."),
175
- // Set only by the daemon, from a pass the platform signed: never a field a reporter can type.
176
- sender: IssueSenderSchema.optional().describe("The sandbox on your account that reported the latest one, when another sandbox did."),
177
- });
178
- export type Issue = z.infer<typeof IssueSchema>;
179
-
180
- // The list row: the stored group plus its filename id (the fingerprint).
181
- export const IssueSummarySchema = IssueSchema.extend({ id: entryId.describe("The issue's id, which is its fingerprint.") });
182
- export type IssueSummary = z.infer<typeof IssueSummarySchema>;
183
-
184
- // `invalid`: nothing but the daemon writes these files, so one that fails to parse is a bug in this daemon or a
185
- // half-written volume, worth surfacing not skipping.
186
- export const IssuesListSchema = z.object({
187
- issues: z.array(IssueSummarySchema).describe("The inbox, most recently seen first."),
188
- invalid: z.array(z.string()).describe("Files in the issues directory that could not be read at all."),
189
- });
190
- export type IssuesList = z.infer<typeof IssuesListSchema>;
191
-
192
- export const IssueIdParamSchema = z.object({ id: entryId.describe("Which issue.") });
193
- // `investigating` is not offered here: the daemon sets it when a turn actually starts, so a click can't fake the one
194
- // status that means something.
195
- export const IssueStatusInputSchema = z.object({
196
- id: entryId.describe("Which issue."),
197
- status: z.enum(["open", "resolved", "ignored"]).describe("Where it now stands with you."),
198
- });
199
- export type IssueStatusInput = z.infer<typeof IssueStatusInputSchema>;
200
-
201
151
  // Present only on `issues` listener automations. `allowedOrigins` is not here: it lives on the trigger, since the
202
152
  // ingest route reads it as the admission gate, not a rendering choice.
203
153
  export const IssuesConfigSchema = z.object({
204
154
  // Ingest key lives in the secrets store (`AutomationSummary.ingestKey`), not here — an abuse label the origin
205
- // allowlist and ceilings actually bound, not a secret.
206
- // Off by default: a leaked key in a public bundle is the commonest abuse, and the allowlist is what limits it.
207
- keyFromBrowsers: z.boolean().optional().describe("Let a browser report with the key alone, rather than only from a site you listed. Off unless you need it."),
155
+ // allowlist and ceilings actually bound, not a secret. `keyFromBrowsers` left for the listener trigger (2026-11-26),
156
+ // where any extension's public door reads it; the automations file's conversion moves a stored one there. It stays
157
+ // accepted here, read by nothing, because a runner of an older release still speaks it inside an automation need's
158
+ // event (the runner door lags in the field: _tools/checks/lib/release-doors.mjs).
159
+ keyFromBrowsers: z
160
+ .boolean()
161
+ .optional()
162
+ .describe("Deprecated: moved to the listener trigger. Let a browser report with the key alone, rather than only from a site you listed."),
208
163
  // Per UTC day, counted in reports that reach the store; absent means ISSUES_DAILY_MAX_DEFAULT, never uncapped.
209
164
  dailyReportMax: z.number().int().positive().optional().describe("How many reports a day this intake accepts at all."),
210
165
  // Wakes an agent on new, then again once count has grown this much since the last wake; absent means
@@ -247,18 +202,6 @@ export type IssuePublicConfig = z.infer<typeof IssuePublicConfigSchema>;
247
202
  export const IssueAcceptedSchema = z.object({ ok: z.literal(true), id: z.string() });
248
203
  export type IssueAccepted = z.infer<typeof IssueAcceptedSchema>;
249
204
 
250
- // Which origins loaded this intake's SDK, and which were turned away: a snippet never pasted and one pasted on a
251
- // disallowed origin both look like "no reports".
252
- export const IssueInstallSchema = z.object({
253
- origin: z.string(),
254
- allowed: z.boolean(),
255
- lastSeenAt: z.number(),
256
- loads: z.number(),
257
- });
258
- export const IssueInstallsSchema = z.object({ origins: z.array(IssueInstallSchema) });
259
- export type IssueInstalls = z.infer<typeof IssueInstallsSchema>;
260
- export const IssueIntakeIdParamSchema = z.object({ automationId: entryId.describe("Which intake.") });
261
-
262
205
  // Constants both the editor and the route need, so a limit is visible to the owner before it is hit.
263
206
 
264
207
  // Default daily ceiling; higher than the Visitor chat's 200 since a report is only sometimes a turn (dedup decides),
@@ -1,8 +1,9 @@
1
1
  // maintenance: the standing evidence a chore is decided from
2
2
  import { z } from "zod";
3
- // The daemon serves facts, never a verdict: which chore is due is computed by shared code
4
- // (`@intentic/sandbox-contract/chores`) so the tile and panel can't disagree. Split by cost: probes (subprocesses,
5
- // cached with a TTL) vs signals (cheap, recomputed per request).
3
+ // FROZEN (2026-11-26), with the `chores` subpath whose types it gives: the maintenance extension's backend measures and
4
+ // serves this evidence now (its src/chores/schema.ts), and the daemon's GET /chores, POST /chores/probe and
5
+ // POST /chores/ledger are gone. Kept for that subpath until extension API 3.0.0, and for the extension-readiness schemas
6
+ // at the bottom, which the extensions contract reads and which stay.
6
7
 
7
8
  export const PROBE_IDS = ["outdated", "audit", "knip", "jscpd", "ui", "bundle", "mutation"] as const;
8
9
  export const ProbeIdSchema = z.enum(PROBE_IDS);
@@ -438,3 +438,38 @@ export const StorageCleanResultSchema = z.object({
438
438
  failed: z.number().describe("How many removals the filesystem refused."),
439
439
  });
440
440
  export type StorageCleanResult = z.infer<typeof StorageCleanResultSchema>;
441
+
442
+ /* GIVING MEMORY BACK TO THE COMPUTER THIS SANDBOX RUNS ON, ON A PERSON'S PRESS (2026-11-26). The composer says when that
443
+ computer is what is short of memory (offload.ts MachineHostSchema), and offers to free some: this sandbox reclaims
444
+ from its own cgroup now, as it does by itself while the computer is under its low line (hosts/reclaim/host-reclaim.ts
445
+ in the daemon), and Windows' Available memory is read just before and a settle after, so the answer says what Windows
446
+ actually got rather than what the sandbox let go. Inside the WSL VM most of a reclaim lands in blocks too small to
447
+ hand back, so "Windows got none of it" is an answer it can give. */
448
+ export const MemoryReclaimRefusalSchema = z.enum([
449
+ // The computer this sandbox runs on says nothing of its memory (not a Windows PC, or an agent older than the reading).
450
+ "no-host",
451
+ // The kernel here takes no reclaim (no memory.reclaim, or a read-only cgroup).
452
+ "unsupported",
453
+ // This sandbox is short of memory itself right now: reclaiming would stall its own work.
454
+ "stalling",
455
+ // This sandbox holds too little to give any back.
456
+ "small",
457
+ ]);
458
+ export type MemoryReclaimRefusal = z.infer<typeof MemoryReclaimRefusalSchema>;
459
+
460
+ export const MemoryReclaimResultSchema = z.discriminatedUnion("outcome", [
461
+ z.object({
462
+ outcome: z.literal("reclaimed"),
463
+ // What this sandbox let go inside the VM, in bytes.
464
+ givenBytes: z.number().int().nonnegative(),
465
+ // The computer, and Windows' Available memory just before and a few seconds after; `afterBytes` is absent when
466
+ // the computer stopped answering in between.
467
+ host: z.object({
468
+ name: z.string().min(1),
469
+ beforeBytes: z.number().int().nonnegative(),
470
+ afterBytes: z.number().int().nonnegative().optional(),
471
+ }),
472
+ }),
473
+ z.object({ outcome: z.literal("refused"), why: MemoryReclaimRefusalSchema }),
474
+ ]);
475
+ export type MemoryReclaimResult = z.infer<typeof MemoryReclaimResultSchema>;
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+
3
+ // What a need asks for (needs.ts), one word per kind; each kind's subject and ask live in needs.ts, and the deploy
4
+ // need's in stack-grants.ts. Its own module so the list can grow without pushing needs.ts past its size.
5
+
6
+ const FIRST_KINDS = ["capability", "secret", "grant", "release", "environment", "automation", "instruction", "host-power"] as const;
7
+ export const NEED_KINDS = [...FIRST_KINDS, "claim", "route", "redirect", "deploy", "wsl-memory"] as const;
8
+ export const NeedKindSchema = z
9
+ .enum(NEED_KINDS)
10
+ .describe(
11
+ "What is being asked for: a connection, a secret's value, wider reach, a gated credential, a tool in the image, an automation to run unattended, a standing rule written into an AGENTS.md, power settings changed on the computer this sandbox runs on, a project claimed for this sandbox so the owner's other sandboxes report its problems here, a person's leave for this sandbox to act as them in another, a person's message sent on to the sandbox it was meant for, a managed stack let receive the secrets its manifest reads, or a smaller WSL VM for the PC this sandbox runs on.",
12
+ );
13
+ export type NeedKind = z.infer<typeof NeedKindSchema>;
@@ -1,22 +1,21 @@
1
1
  import { z } from "zod";
2
2
  import { KeyringShareModeSchema } from "./keyring.js";
3
- import { AutomationSchema } from "./automations.js";
3
+ import { NeedKindSchema } from "./need-kinds.js";
4
+ import { AutomationSchema, WatchKindSchema } from "./automations.js";
5
+ import { DeployNeedAskSchema, DeployNeedSchema } from "./stack-grants.js";
4
6
  import { HostPowerFindingSchema } from "./host-power.js";
7
+ import { WslMemoryNeedSchema } from "./wsl-memory.js";
5
8
  import { entryId } from "./internal.js";
6
9
  import { PASS_SCOPES } from "../protocol/doors/pass-scopes.js";
10
+ import { SECRET_HOSTS_MAX } from "../policy/secret-hosts.js";
11
+ import { SecretHostSchema } from "./secrets.js";
7
12
 
8
13
  // A need: something an agent cannot finish its task without that only a person can provide (a connection, a secret's
9
14
  // value, wider reach, a tool in the image). Unlike a parked card it outlives the turn that raised it: the sandbox keeps
10
15
  // it until someone answers, draws it wherever it is waiting, and wakes the conversation when it is met
11
16
  // (docs/architecture/needs.md). Every word on a need is the daemon's except `why`, the agent's own case.
12
17
 
13
- export const NEED_KINDS = ["capability", "secret", "grant", "release", "environment", "automation", "instruction", "host-power", "claim", "route"] as const;
14
- export const NeedKindSchema = z
15
- .enum(NEED_KINDS)
16
- .describe(
17
- "What is being asked for: a connection, a secret's value, wider reach, a gated credential, a tool in the image, an automation to run unattended, a standing rule written into an AGENTS.md, power settings changed on the computer this sandbox runs on, a project claimed for this sandbox so the owner's other sandboxes report its problems here, or a person's leave for this sandbox to act as them in another.",
18
- );
19
- export type NeedKind = z.infer<typeof NeedKindSchema>;
18
+ export { NEED_KINDS, type NeedKind, NeedKindSchema } from "./need-kinds.js";
20
19
 
21
20
  // `working` is a yes still being carried out: a connection whose form is open, an overlay approved but not yet built.
22
21
  export const NeedStatusSchema = z
@@ -73,6 +72,8 @@ export const SECRET_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
73
72
  // Group 1 is the name in both forms, so every reader that only needs the name reads both alike.
74
73
  export const SECRET_REFERENCE = /\{\{secret:([A-Za-z0-9_./-]+)(?:\|(file))?\}\}/;
75
74
 
75
+ // A secret's host guard list as a card starts it (needs/kinds/secret-need.ts in the sandbox).
76
+ const SecretHostsSchema = z.array(SecretHostSchema).max(SECRET_HOSTS_MAX);
76
77
  export const SecretNeedSchema = z.object({
77
78
  kind: z.literal("secret"),
78
79
  name: z.string().regex(SECRET_NAME).describe("The name it is stored under, and what `{{secret:NAME}}` will resolve."),
@@ -89,6 +90,12 @@ export const SecretNeedSchema = z.object({
89
90
  .boolean()
90
91
  .optional()
91
92
  .describe("A value with lines (a key file, a whole .env): the card takes it in a box with lines and keeps it exactly as pasted."),
93
+ // The agent's proposal: what a person keeps on the card starts the secret guarded, rather than off until someone acts.
94
+ hosts: SecretHostsSchema.min(1)
95
+ .optional()
96
+ .describe(
97
+ "Where it will be sent, as the agent proposes it. The card shows each host for the person to keep or drop, and the secret's host guard starts on with the ones they keep: it goes unasked only there, and anywhere else asks first.",
98
+ ),
92
99
  });
93
100
  export type SecretNeed = z.infer<typeof SecretNeedSchema>;
94
101
 
@@ -175,6 +182,9 @@ export const AutomationNeedSchema = z.object({
175
182
  automation: AutomationSchema.describe("The automation as it would be saved, switched on, the moment a person approves it."),
176
183
  replaces: z.boolean().optional().describe("An automation of this id already exists, and approving replaces it."),
177
184
  firstCheck: AutomationFirstCheckSchema.optional(),
185
+ // (2026-11-26) The declaration of the kind its source names, when an extension declares it, so the card says what the
186
+ // watch looks at in that kind's own words. Absent for a page, a guard, and from a daemon before contributed kinds.
187
+ watchKind: WatchKindSchema.optional(),
178
188
  });
179
189
  export type AutomationNeed = z.infer<typeof AutomationNeedSchema>;
180
190
 
@@ -194,16 +204,15 @@ export const InstructionNeedSchema = z.object({
194
204
  });
195
205
  export type InstructionNeed = z.infer<typeof InstructionNeedSchema>;
196
206
 
197
- // The computer this sandbox runs on would sleep through work just booked on it (2026-11-22, host-power.ts): its power plan
198
- // sleeps it after hours without input, its lid does, Windows Update may restart it in the night. Raised by the daemon
199
- // itself, never by an agent's ask, in the conversation whose booking it would stop; a person's approval runs the
200
- // computer's `power-stay-on` op, which changes what `fixable` findings say on mains power. Its outcome is the person's
201
- // alone: the conversation is never woken to hear it, since a woken turn would run the booked work early.
207
+ // The computer this sandbox runs on would sleep through work just booked on it (2026-11-22, host-power.ts). Raised by the
208
+ // daemon itself in the booking conversation; a yes runs `power-stay-on` and the chosen answer to a Windows Update restart
209
+ // (`remedy`). Told to nobody: a woken turn would run the booked work early.
202
210
  export const HostPowerNeedSchema = z.object({
203
211
  kind: z.literal("host-power"),
204
212
  device: z.string().min(1).describe("The connected computer this sandbox runs on, by its device id."),
205
213
  findings: z.array(HostPowerFindingSchema).describe("What its OS would do to the work, as read when the card was raised."),
206
214
  dueAt: z.number().optional().describe("When the booked work that raised it is due, in milliseconds."),
215
+ utcOffsetMinutes: z.number().int().optional().describe("The computer's local time minus UTC when read: what places its findings' local hours on another clock."),
207
216
  });
208
217
  export type HostPowerNeed = z.infer<typeof HostPowerNeedSchema>;
209
218
 
@@ -233,6 +242,24 @@ export const RouteNeedSchema = z.object({
233
242
  });
234
243
  export type RouteNeed = z.infer<typeof RouteNeedSchema>;
235
244
 
245
+ // A person's message that reached the wrong sandbox, offered to the one it was meant for (account-routing.md, 2026-11-25).
246
+ // The words are the daemon's copy of what the person opened a turn with, never the agent's retelling, and only that
247
+ // person can press it: their editor, signed in to both, opens a chat in the target and sends the words there as they
248
+ // would by hand. No pass and no pairing travel. The platform only found the target among the sandboxes they are in.
249
+ export const REDIRECT_WORDS_MAX = 20_000;
250
+ export const RedirectNeedSchema = z.object({
251
+ kind: z.literal("redirect"),
252
+ target: z.string().min(1).max(40).describe("The target sandbox's tunnel id."),
253
+ targetName: z.string().max(120).describe("Its name, as the platform gave it."),
254
+ address: z.string().max(400).optional().describe("The target's address, as the platform gave it, which the card finds it by."),
255
+ person: z.string().min(1).max(254).describe("Whose words they are, and the only one who can send them on."),
256
+ words: z.string().max(REDIRECT_WORDS_MAX).describe("The message, exactly as the person sent it here."),
257
+ clipped: z.boolean().optional().describe("The message was longer than the card carries, so only its head goes."),
258
+ attachments: z.number().int().min(0).optional().describe("How many files went with it, which stay here."),
259
+ project: z.string().max(400).optional().describe("The project the target was found by, when it was found by its claim."),
260
+ });
261
+ export type RedirectNeed = z.infer<typeof RedirectNeedSchema>;
262
+
236
263
  export const NeedSubjectSchema = z
237
264
  .discriminatedUnion("kind", [
238
265
  CapabilityNeedSchema,
@@ -243,14 +270,16 @@ export const NeedSubjectSchema = z
243
270
  AutomationNeedSchema,
244
271
  InstructionNeedSchema,
245
272
  HostPowerNeedSchema,
273
+ WslMemoryNeedSchema,
246
274
  ClaimNeedSchema,
247
275
  RouteNeedSchema,
276
+ RedirectNeedSchema,
277
+ DeployNeedSchema,
248
278
  ])
249
279
  .describe("What exactly is asked for.");
250
280
  export type NeedSubject = z.infer<typeof NeedSubjectSchema>;
251
281
 
252
- // How the agent learned the outcome: the call it raised the need with, words into its live turn, a turn of its own, or
253
- // queued behind what the conversation was doing.
282
+ // How the agent learned the outcome: the call it raised the need with, words into its live turn, its own turn, or queued.
254
283
  export const NeedToldSchema = z.enum(["call", "turn", "queued"]);
255
284
  export type NeedTold = z.infer<typeof NeedToldSchema>;
256
285
 
@@ -320,6 +349,14 @@ export const NeedAskSchema = z.discriminatedUnion("kind", [
320
349
  .optional()
321
350
  .describe("What it is for: drop, read or task (all three when left out)."),
322
351
  }),
352
+ // Where the person's message belongs, as the agent has it: a sandbox by name or id, or a project whose claim finds it.
353
+ // The words and the person are the daemon's, never named here.
354
+ z.object({
355
+ kind: z.literal("redirect"),
356
+ target: z.string().trim().min(1).max(120).optional().describe("The sandbox the message belongs in, by its name or id."),
357
+ project: z.string().trim().min(1).max(400).optional().describe("Or the project it is about: the sandbox claiming it is the target."),
358
+ }),
359
+ DeployNeedAskSchema,
323
360
  ]);
324
361
  export type NeedAsk = z.infer<typeof NeedAskSchema>;
325
362
 
@@ -360,7 +397,8 @@ export const NeedAnswerSchema = z.discriminatedUnion("kind", [
360
397
  // 2026-11-18: was `{ scope }`, a yes that lifted what the role withheld; now the role the conversation switches to.
361
398
  z.object({ kind: z.literal("grant"), role: entryId.describe("Which of the need's roles the conversation switches to.") }),
362
399
  z.object({ kind: z.literal("release") }),
363
- z.object({ kind: z.literal("approve") }),
400
+ // (2026-11-27) `remedy`: a host-power card's answer to a Windows Update restart (POWER_REMEDY); absent is the pause.
401
+ z.object({ kind: z.literal("approve"), remedy: z.enum(["update-pause", "before-sign-in"]).optional() }),
364
402
  ]);
365
403
  export type NeedAnswer = z.infer<typeof NeedAnswerSchema>;
366
404
 
@@ -385,6 +423,9 @@ export const NeedSecretInputSchema = NeedIdParamSchema.extend({
385
423
  })
386
424
  .optional()
387
425
  .describe("Keep it in the keyring on one of your computers instead of in the sandbox."),
426
+ hosts: SecretHostsSchema.optional().describe(
427
+ "The hosts you let it go to unasked, of those the agent proposed: its host guard starts on with them. Absent or empty leaves its host guard as it is, and a guard already on is never widened from here. Ignored with keepOn, whose keyring keeps its own list.",
428
+ ),
388
429
  });
389
430
  export const NeedsQuerySchema = z.object({
390
431
  conversationId: z.string().optional().describe("One conversation's needs. Absent is every conversation's."),
@@ -108,6 +108,31 @@ export type MachineStanding = z.infer<typeof MachineStandingSchema>;
108
108
  export const MachineStrainSchema = z.enum(["memory", "memory-stall", "cpu", "agents", "disk"]);
109
109
  export type MachineStrain = z.infer<typeof MachineStrainSchema>;
110
110
 
111
+ /* THE COMPUTER UNDER A MACHINE, IN FIGURES ITS OWNER CAN CHECK (2026-11-26). A machine's free memory is the tighter of its
112
+ own budget and its host's room above the line under which the host counts as short (machine-facts.ts), so "1.9 GB
113
+ free" on rog was Windows' Available less a 3.1 GB line nobody could see, while the sandbox itself had 10.5 GB and the
114
+ WSL VM held 16.6 GB of Windows' memory. Said beside the verdict so the composer can name what is short: Windows' own
115
+ figures as Task Manager shows them, and the VM's share and its unused part where that computer's agent reads them.
116
+ Absent where the host says nothing of its memory (a Linux host, an agent older than the reading). */
117
+ export const MachineHostSchema = z.object({
118
+ // The computer, by the word the owner knows it by (its device card).
119
+ name: z.string().min(1),
120
+ // What Windows could hand out now (its Available memory, standby cache included), and how much it has.
121
+ availableMb: z.number().int().nonnegative(),
122
+ totalMb: z.number().int().positive(),
123
+ // The line under which it counts as short (hosts.ts hostMemoryLowBytes): never counted as room for new work.
124
+ reserveMb: z.number().int().nonnegative(),
125
+ // The WSL VM's footprint in Windows' memory, and the part of it free inside the VM but too fragmented to hand back
126
+ // (hosts.ts GuestFreeMemorySchema `strandedBytes`); each absent where that computer's agent did not read it.
127
+ vmMb: z.number().int().nonnegative().optional(),
128
+ vmUnusedMb: z.number().int().nonnegative().optional(),
129
+ // What the machine's own budget has free, before its host's room is folded in; absent where nothing measures it.
130
+ ownFreeMb: z.number().int().nonnegative().optional(),
131
+ // Whether the host's room, not the machine's own budget, is what its free memory came to: the host is what is short.
132
+ binding: z.boolean(),
133
+ });
134
+ export type MachineHost = z.infer<typeof MachineHostSchema>;
135
+
111
136
  export const MachineLoadSchema = z.object({
112
137
  standing: MachineStandingSchema,
113
138
  // Why it is not calm, strongest first; empty when it is.
@@ -126,6 +151,9 @@ export const MachineLoadSchema = z.object({
126
151
  // The share of the machine still free by its tightest measure (slots, memory, CPU), so two machines of different
127
152
  // sizes compare: 0 is none, 1 is idle.
128
153
  headroom: z.number().min(0).max(1),
154
+ // (2026-11-26) The computer it runs on, as that computer's agent last said (MachineHostSchema); absent where it says
155
+ // nothing of its memory.
156
+ host: MachineHostSchema.optional(),
129
157
  });
130
158
  export type MachineLoad = z.infer<typeof MachineLoadSchema>;
131
159
 
@@ -163,6 +191,9 @@ export const FleetAdviceSchema = z.object({
163
191
  machines: z.array(FleetMachineSchema),
164
192
  // Where a new session should start instead of here: absent while here is calm, or when no machine is better off.
165
193
  suggestion: z.object({ runner: z.string().min(1), name: z.string().min(1) }).optional(),
194
+ // (2026-11-26) Whether this sandbox could give memory back to the computer it runs on now (POST /system/memory/reclaim):
195
+ // that computer says what memory it has, and the kernel here takes a reclaim. Absent from a daemon older than it.
196
+ reclaim: z.boolean().optional(),
166
197
  });
167
198
  export type FleetAdvice = z.infer<typeof FleetAdviceSchema>;
168
199
 
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+
3
+ // POST /capabilities/{id}/outward-action: an extension's backend, about to carry out an outward action with one of its
4
+ // cards' credentials, asks the owner's action rules for the verdict. The daemon decides, records and, on a hold, drafts
5
+ // the approvals-queue item the extension carries out once a person says yes; the extension decides nothing of the rule.
6
+
7
+ // The parts every call about one action carries, for its verdict and for its outcome alike.
8
+ const OutwardActionCallSchema = z.object({
9
+ id: z.string().describe("The card whose credential it would use. Only a card the calling extension contributes."),
10
+ action: z
11
+ .string()
12
+ .min(1)
13
+ .max(100)
14
+ .describe("The action below the card's kind, as the card's manifest declares it (`message.send`): the rules' key is `<kind>.<action>`."),
15
+ conversationId: z.string().max(200).optional().describe("The conversation the action is for, as the call that asked for it named it. Absent for an approved one."),
16
+ endpoint: z.string().max(500).optional().describe("Where it goes below the service (`/me/sendMail`), for its Activity row. Never a credential."),
17
+ channel: z.string().max(500).optional().describe("Who or where it goes to, for its Activity row."),
18
+ content: z.string().max(256 * 1024).optional().describe("What it says, for its Activity row."),
19
+ });
20
+ export const OutwardActionAskSchema = OutwardActionCallSchema.extend({
21
+ hold: z
22
+ .object({
23
+ summary: z.string().min(1).max(200).describe("The approval's headline."),
24
+ details: z.string().max(64 * 1024).describe("Everything the person should read before saying yes."),
25
+ digest: z
26
+ .string()
27
+ .regex(/^[0-9a-f]{64}$/)
28
+ .describe("The SHA-256 of exactly what the extension will carry out, which it recomputes before acting."),
29
+ })
30
+ .optional()
31
+ .describe("What to put before the owner when the rules hold it. Absent, a hold is only answered, never drafted (an approved action asking again)."),
32
+ });
33
+ export const OutwardActionVerdictSchema = z.discriminatedUnion("verdict", [
34
+ z.object({ verdict: z.literal("allow").describe("Go ahead, then report how it went.") }),
35
+ z.object({ verdict: z.literal("deny"), reason: z.string().describe("The rule's reason, to say to whoever asked.") }),
36
+ z.object({
37
+ verdict: z.literal("hold"),
38
+ reason: z.string().describe("Why it waits."),
39
+ approvalId: z.string().optional().describe("The approvals-queue item drafted for it, when the ask carried one."),
40
+ }),
41
+ ]);
42
+ export type OutwardActionVerdict = z.infer<typeof OutwardActionVerdictSchema>;
43
+ // POST /capabilities/{id}/outward-action/outcome: how an allowed or approved action went, for its Activity row.
44
+ export const OutwardActionOutcomeSchema = OutwardActionCallSchema.extend({
45
+ outcome: z.enum(["ok", "error"]).describe("Whether it happened."),
46
+ error: z.string().max(2000).optional().describe("What went wrong, in the service's own words."),
47
+ });
@@ -264,6 +264,7 @@ export const AgentReplySchema = z.discriminatedUnion("kind", [
264
264
  "Once allows this call alone; always allows what the request's always-label names (a tool, a rule, a secret) for the rest of the conversation; everything allows this call and every later request in this conversation that an allow-once could settle, until it is taken back on Grants; no blocks it. A request that always asks (alwaysAsks) reads everything as once.",
265
265
  ),
266
266
  feedback: z.string().optional().describe("Why not, which goes back to the model as the reason."),
267
+ keep: z.literal(true).optional().describe("With always: the request's keepLabel answer rather than its alwaysLabel one."),
267
268
  // Whole, not a patch: effort or an account named for one model means nothing on another.
268
269
  child: ChildRunSchema.optional().describe(
269
270
  "For a request to start a subagent: what to start it on instead of what the agent asked for. It replaces the whole run (model, account, effort and the rest), not only the fields it names. Ignored with a no, and on any other request.",
@@ -22,6 +22,16 @@ export const SecretKeysSchema = z.object({
22
22
  export const SecretKeyParamSchema = z.object({ key: secretKey.describe("Which secret, by name.") });
23
23
  export const SecretRevealSchema = z.object({ value: z.string().describe("The value itself. The only place in this API one is ever returned.") });
24
24
 
25
+ // (2026-11-25) A value the agent already holds the way to, moved into the store without passing through the chat or its
26
+ // own context: `secrets import NAME --stdin`, a value piped from where it lives now (another orchestrator's variables,
27
+ // a file on a server). A new name only, never one anything here holds: the agent token can add a credential and never
28
+ // replace one, so a value the owner stored cannot be swapped under the references that read it.
29
+ export const SECRET_IMPORT_MAX = 64_000;
30
+ export const SecretImportSchema = z.object({
31
+ key: secretKey.describe("The name to store it under: one nothing here holds yet."),
32
+ value: z.string().min(1).max(SECRET_IMPORT_MAX).describe("The value, as read from the command's input. Stored, never echoed or logged."),
33
+ });
34
+
25
35
  // A secret nobody has to find or paste: a session key, a webhook signing secret, a database password the task sets up
26
36
  // itself. The sandbox makes it and keeps it; the caller gets its reference and length, never the value.
27
37
  // The shortest stored value the sandbox masks wherever it appears; a shorter one masks only in a secret-like context. The
@@ -72,9 +82,9 @@ export const CredentialGateKindSchema = z
72
82
  export type CredentialGateKind = z.infer<typeof CredentialGateKindSchema>;
73
83
 
74
84
  export const CredentialLaneSchema = z
75
- .enum(["shell", "code", "browser", "session", "otp", "gateway", "ssh", "device", "desktop"])
85
+ .enum(["shell", "code", "browser", "session", "otp", "gateway", "ssh", "device", "desktop", "mcp"])
76
86
  .describe(
77
- "What the credential was about to be used for: a shell command, a script, typing into a page, mounting a connected account, one one-time code, a request the credential gateway attaches it to, a signature the sandbox's ssh agent makes with a held key, typing into a window or phone app on one of the owner's computers, or typing into a window on the sandbox's own desktop.",
87
+ "What the credential was about to be used for: a shell command, a script, typing into a page, mounting a connected account, one one-time code, a request the credential gateway attaches it to, a signature the sandbox's ssh agent makes with a held key, typing into a window or phone app on one of the owner's computers, typing into a window on the sandbox's own desktop, or an argument of a tool call to an MCP server the owner connected.",
78
88
  );
79
89
  export type CredentialLane = z.infer<typeof CredentialLaneSchema>;
80
90
 
@@ -319,14 +329,14 @@ export const SecretInventoryEntrySchema = z.object({
319
329
  .object({
320
330
  at: z.number().describe("When, in milliseconds."),
321
331
  lane: z
322
- .enum(["shell", "code", "browser", "gateway", "ssh", "device", "desktop"])
332
+ .enum(["shell", "code", "browser", "gateway", "ssh", "device", "desktop", "mcp", "deploy"])
323
333
  .describe(
324
- "How it was used: a command, a script, typed into a page, attached by the credential gateway to a request the agent sent, a key the sandbox's ssh agent signed with for the agent, typed into a window or app on one of the owner's computers, or typed into a window on the sandbox's desktop.",
334
+ "How it was used: a command, a script, typed into a page, attached by the credential gateway to a request the agent sent, a key the sandbox's ssh agent signed with for the agent, typed into a window or app on one of the owner's computers, typed into a window on the sandbox's desktop, sent in a tool call to an MCP server the owner connected, or rendered by the sandbox into a managed stack's .env or registry login as it deployed it.",
325
335
  ),
326
336
  detail: z
327
337
  .string()
328
338
  .optional()
329
- .describe("Where it went: the start of the command or script, or the site. Names and destinations only, never values."),
339
+ .describe("Where it went: the start of the command or script, the site, the MCP tool and its server's host, or the stack and the computer it was deployed to. Names and destinations only, never values."),
330
340
  approvedBy: z.string().optional().describe("Who released it for that use, when it is gated. Absent when nothing had to be approved."),
331
341
  })
332
342
  .optional()
@@ -376,3 +386,11 @@ export const SecretInventorySchema = z.object({
376
386
  .array(SecretInventoryEntrySchema)
377
387
  .describe("One entry per secret this sandbox knows about, from every place they live. No values, ever."),
378
388
  });
389
+
390
+ // (2026-11-25) A keyed mark of each named value: an HMAC under a key this sandbox keeps in its auth root, never a plain
391
+ // hash, so a mark says nothing about the value to anyone without that key. A managed deploy answers the marks of the
392
+ // values it filled (device-stacks.ts); comparing them later with these tells the Deployments extension that a stack's
393
+ // secret changed in the store, without it ever holding one. A name nothing holds answers no mark.
394
+ export const SecretMarksRequestSchema = z.object({ names: z.array(secretKey).min(1).max(200) });
395
+ export const SecretMarksResponseSchema = z.object({ marks: z.record(z.string(), z.string()) });
396
+ export type SecretMarksResponse = z.infer<typeof SecretMarksResponseSchema>;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { at, drop, dropAll, fold, isJsonObject, type JsonObject, mapValue, rename, retype, transform } from "../documents/conversions.js";
3
- import { type ModelRole, ModelRoleSchema } from "../models/model-roles.js";
3
+ import { type ModelRole, ROLES_BEFORE_CONTRIBUTIONS } from "../models/model-roles.js";
4
4
  import { setupsFromRoleLists } from "../models/model-setups.js";
5
5
  import { ModelPinSchema, type ModelPin } from "./agent.js";
6
6
  import { RESTORE_POINT_KEEP_DAYS_DEFAULT } from "./data-protection.js";
@@ -84,18 +84,20 @@ const refactorsFromChores = transform(
84
84
  // (`modelDefault`); it runs on a named setup it shares with other jobs. Jobs that held the same list share one setup, a
85
85
  // list most of whose jobs are suggested a preset becomes that preset, and a job that held none, or an empty one, is on
86
86
  // none, which runs it exactly as before: not at all. A list that does not read (a role this version does not know, a malformed pin) is left out rather than refusing
87
- // the whole file, the same reading the schema gave it.
87
+ // the whole file, the same reading the schema gave it. The jobs it reads are the table's of 2026-11-26, frozen
88
+ // (ROLES_BEFORE_CONTRIBUTIONS): six of them moved to their extensions' manifests that day, and a file this converts still
89
+ // names them.
88
90
  const PinList = z.array(ModelPinSchema);
89
91
  const holdsRoleLists = (settings: JsonObject): settings is JsonObject => Object.hasOwn(settings, "modelRoles") || Object.hasOwn(settings, "modelDefault");
90
92
  const roleListsIntoSetups = transform("folds modelRoles and modelDefault into setups (modelSetups, roleSetups)", holdsRoleLists, (settings): JsonObject => {
91
93
  const { modelRoles, modelDefault, ...rest } = settings;
92
94
  const fallback = PinList.safeParse(modelDefault);
93
95
  const lists: Partial<Record<ModelRole, ModelPin[]>> = {};
94
- for (const role of ModelRoleSchema.options) {
95
- const own = isJsonObject(modelRoles) ? PinList.safeParse(modelRoles[role]) : undefined;
96
+ for (const { id } of ROLES_BEFORE_CONTRIBUTIONS) {
97
+ const own = isJsonObject(modelRoles) ? PinList.safeParse(modelRoles[id]) : undefined;
96
98
  const list = own?.success === true ? own.data : fallback.success && fallback.data.length > 0 ? fallback.data : undefined;
97
99
  if (list !== undefined) {
98
- lists[role] = list;
100
+ lists[id] = list;
99
101
  }
100
102
  }
101
103
  const { modelSetups, roleSetups } = setupsFromRoleLists(lists);
@@ -182,4 +184,7 @@ export const SETTINGS_HISTORY = [
182
184
  ...dropAll(["iqSearch", "iqSearchHoldout"]),
183
185
  // Personas were renamed roles (2026-11-18): the switch that matches a new chat to one moves with them.
184
186
  rename("personaRouting", "roleRouting"),
187
+ // Planning fan-outs by allowance became the only way (2026-11-25): off, a second child started on an account that could
188
+ // not carry it, ran its allowance out and waited for the reset anyway. `subagentReservePercent` at 0 is the loosest plan.
189
+ ...dropAll(["subagentBudget"]),
185
190
  ] as const;