@intentic/sandbox-contract 1.430.0 → 1.432.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (711) hide show
  1. package/README.md +22 -5
  2. package/dist/app-routes/app-pages.d.ts +1 -0
  3. package/dist/app-routes/app-pages.d.ts.map +1 -1
  4. package/dist/app-routes/app-pages.js +1 -0
  5. package/dist/app-routes/app-pages.js.map +1 -1
  6. package/dist/app-routes/index.d.ts +1 -0
  7. package/dist/app-routes/index.d.ts.map +1 -1
  8. package/dist/app-routes/index.js +1 -0
  9. package/dist/app-routes/index.js.map +1 -1
  10. package/dist/app-routes/return-path.d.ts +2 -0
  11. package/dist/app-routes/return-path.d.ts.map +1 -0
  12. package/dist/app-routes/return-path.js +8 -0
  13. package/dist/app-routes/return-path.js.map +1 -0
  14. package/dist/briefs/agent-ask.d.ts +10 -0
  15. package/dist/briefs/agent-ask.d.ts.map +1 -0
  16. package/dist/briefs/agent-ask.js +2 -0
  17. package/dist/briefs/agent-ask.js.map +1 -0
  18. package/dist/{chores/extension-update.d.ts → briefs/extension-update-brief.d.ts} +1 -1
  19. package/dist/briefs/extension-update-brief.d.ts.map +1 -0
  20. package/dist/{chores/extension-update.js → briefs/extension-update-brief.js} +2 -2
  21. package/dist/briefs/extension-update-brief.js.map +1 -0
  22. package/dist/chores/digest.d.ts.map +1 -1
  23. package/dist/chores/digest.js.map +1 -1
  24. package/dist/chores/index.d.ts +2 -2
  25. package/dist/chores/index.d.ts.map +1 -1
  26. package/dist/chores/index.js +1 -1
  27. package/dist/chores/index.js.map +1 -1
  28. package/dist/chores/prompt.d.ts +1 -9
  29. package/dist/chores/prompt.d.ts.map +1 -1
  30. package/dist/chores/prompt.js +1 -1
  31. package/dist/chores/prompt.js.map +1 -1
  32. package/dist/chores/stack.d.ts.map +1 -1
  33. package/dist/chores/stack.js.map +1 -1
  34. package/dist/chores/verdict.d.ts.map +1 -1
  35. package/dist/chores/verdict.js.map +1 -1
  36. package/dist/chores/workspace-scope.d.ts +1 -3
  37. package/dist/chores/workspace-scope.d.ts.map +1 -1
  38. package/dist/chores/workspace-scope.js +1 -3
  39. package/dist/chores/workspace-scope.js.map +1 -1
  40. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  41. package/dist/contracts/accounts.contract.js +2 -0
  42. package/dist/contracts/accounts.contract.js.map +1 -1
  43. package/dist/contracts/agent.contract.d.ts +1226 -12
  44. package/dist/contracts/agent.contract.d.ts.map +1 -1
  45. package/dist/contracts/agents.contract.d.ts +2665 -733
  46. package/dist/contracts/agents.contract.d.ts.map +1 -1
  47. package/dist/contracts/agents.contract.js +35 -5
  48. package/dist/contracts/agents.contract.js.map +1 -1
  49. package/dist/contracts/automations.contract.d.ts +90 -8
  50. package/dist/contracts/automations.contract.d.ts.map +1 -1
  51. package/dist/contracts/automations.contract.js +1 -0
  52. package/dist/contracts/automations.contract.js.map +1 -1
  53. package/dist/contracts/capabilities.contract.d.ts +49 -0
  54. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  55. package/dist/contracts/capabilities.contract.js +24 -1
  56. package/dist/contracts/capabilities.contract.js.map +1 -1
  57. package/dist/contracts/ci.contract.d.ts +222 -95
  58. package/dist/contracts/ci.contract.d.ts.map +1 -1
  59. package/dist/contracts/ci.contract.js +87 -26
  60. package/dist/contracts/ci.contract.js.map +1 -1
  61. package/dist/contracts/device-ci-runners.contract.d.ts +108 -0
  62. package/dist/contracts/device-ci-runners.contract.d.ts.map +1 -0
  63. package/dist/contracts/device-ci-runners.contract.js +56 -0
  64. package/dist/contracts/device-ci-runners.contract.js.map +1 -0
  65. package/dist/contracts/device-stacks.contract.d.ts +129 -0
  66. package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
  67. package/dist/contracts/device-stacks.contract.js +66 -0
  68. package/dist/contracts/device-stacks.contract.js.map +1 -0
  69. package/dist/contracts/device.contract.d.ts +74 -0
  70. package/dist/contracts/device.contract.d.ts.map +1 -1
  71. package/dist/contracts/extensions.contract.d.ts +604 -0
  72. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  73. package/dist/contracts/extensions.contract.js +11 -2
  74. package/dist/contracts/extensions.contract.js.map +1 -1
  75. package/dist/contracts/git.contract.d.ts +7 -0
  76. package/dist/contracts/git.contract.d.ts.map +1 -1
  77. package/dist/contracts/needs.contract.d.ts +1097 -18
  78. package/dist/contracts/needs.contract.d.ts.map +1 -1
  79. package/dist/contracts/offload.contract.d.ts +25 -0
  80. package/dist/contracts/offload.contract.d.ts.map +1 -1
  81. package/dist/contracts/ports.contract.d.ts +8 -0
  82. package/dist/contracts/ports.contract.d.ts.map +1 -1
  83. package/dist/contracts/ports.contract.js +6 -5
  84. package/dist/contracts/ports.contract.js.map +1 -1
  85. package/dist/contracts/remote.contract.d.ts +1 -0
  86. package/dist/contracts/remote.contract.d.ts.map +1 -1
  87. package/dist/contracts/runner.contract.d.ts +1203 -9
  88. package/dist/contracts/runner.contract.d.ts.map +1 -1
  89. package/dist/contracts/runner.contract.js +49 -2
  90. package/dist/contracts/runner.contract.js.map +1 -1
  91. package/dist/contracts/runners.contract.d.ts +16 -0
  92. package/dist/contracts/runners.contract.d.ts.map +1 -0
  93. package/dist/contracts/runners.contract.js +15 -0
  94. package/dist/contracts/runners.contract.js.map +1 -0
  95. package/dist/contracts/safety.contract.d.ts.map +1 -1
  96. package/dist/contracts/safety.contract.js +1 -0
  97. package/dist/contracts/safety.contract.js.map +1 -1
  98. package/dist/contracts/seal.contract.d.ts +100 -0
  99. package/dist/contracts/seal.contract.d.ts.map +1 -1
  100. package/dist/contracts/secrets.contract.d.ts +15 -0
  101. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  102. package/dist/contracts/secrets.contract.js +27 -1
  103. package/dist/contracts/secrets.contract.js.map +1 -1
  104. package/dist/contracts/sessions.contract.d.ts +159 -2
  105. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  106. package/dist/contracts/settings.contract.d.ts +59 -42
  107. package/dist/contracts/settings.contract.d.ts.map +1 -1
  108. package/dist/contracts/settings.contract.js +19 -0
  109. package/dist/contracts/settings.contract.js.map +1 -1
  110. package/dist/contracts/skills.contract.d.ts +6 -0
  111. package/dist/contracts/skills.contract.d.ts.map +1 -1
  112. package/dist/contracts/stack-grants.contract.d.ts +418 -0
  113. package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
  114. package/dist/contracts/stack-grants.contract.js +46 -0
  115. package/dist/contracts/stack-grants.contract.js.map +1 -0
  116. package/dist/contracts/system.contract.d.ts +516 -69
  117. package/dist/contracts/system.contract.d.ts.map +1 -1
  118. package/dist/contracts/system.contract.js +26 -45
  119. package/dist/contracts/system.contract.js.map +1 -1
  120. package/dist/contracts/usage.contract.d.ts +3 -0
  121. package/dist/contracts/usage.contract.d.ts.map +1 -1
  122. package/dist/contracts/workspace.contract.d.ts +0 -55
  123. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  124. package/dist/contracts/workspace.contract.js +0 -19
  125. package/dist/contracts/workspace.contract.js.map +1 -1
  126. package/dist/events/agent-events.d.ts +615 -8
  127. package/dist/events/agent-events.d.ts.map +1 -1
  128. package/dist/events/agent-events.js +2 -2
  129. package/dist/events/agent-events.js.map +1 -1
  130. package/dist/events/agent-transcript.d.ts +159 -2
  131. package/dist/events/agent-transcript.d.ts.map +1 -1
  132. package/dist/events/agent-words.d.ts +5 -0
  133. package/dist/events/agent-words.d.ts.map +1 -1
  134. package/dist/events/agent-words.js +22 -2
  135. package/dist/events/agent-words.js.map +1 -1
  136. package/dist/events/child-news.d.ts +32 -0
  137. package/dist/events/child-news.d.ts.map +1 -0
  138. package/dist/events/child-news.js +171 -0
  139. package/dist/events/child-news.js.map +1 -0
  140. package/dist/events/prompt-origins.d.ts +42 -0
  141. package/dist/events/prompt-origins.d.ts.map +1 -1
  142. package/dist/events/prompt-origins.js +28 -0
  143. package/dist/events/prompt-origins.js.map +1 -1
  144. package/dist/events/refusal-incidents.d.ts +1 -0
  145. package/dist/events/refusal-incidents.d.ts.map +1 -1
  146. package/dist/events/refusal-incidents.js +42 -19
  147. package/dist/events/refusal-incidents.js.map +1 -1
  148. package/dist/events/requests.d.ts +14 -0
  149. package/dist/events/requests.d.ts.map +1 -1
  150. package/dist/events/requests.js +12 -0
  151. package/dist/events/requests.js.map +1 -1
  152. package/dist/events/system-events.d.ts +98 -0
  153. package/dist/events/system-events.d.ts.map +1 -1
  154. package/dist/events/transcript.d.ts +799 -10
  155. package/dist/events/transcript.d.ts.map +1 -1
  156. package/dist/events/transcript.js +2 -1
  157. package/dist/events/transcript.js.map +1 -1
  158. package/dist/ids/conversation-ids.d.ts +1 -0
  159. package/dist/ids/conversation-ids.d.ts.map +1 -1
  160. package/dist/ids/conversation-ids.js +2 -1
  161. package/dist/ids/conversation-ids.js.map +1 -1
  162. package/dist/ids/project-id.d.ts.map +1 -1
  163. package/dist/ids/project-id.js +4 -4
  164. package/dist/ids/project-id.js.map +1 -1
  165. package/dist/ids/run-row-ids.d.ts +8 -0
  166. package/dist/ids/run-row-ids.d.ts.map +1 -0
  167. package/dist/ids/run-row-ids.js +32 -0
  168. package/dist/ids/run-row-ids.js.map +1 -0
  169. package/dist/index.d.ts +4 -4
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +4 -4
  172. package/dist/index.js.map +1 -1
  173. package/dist/models/agent-catalog.d.ts.map +1 -1
  174. package/dist/models/agent-catalog.js +3 -2
  175. package/dist/models/agent-catalog.js.map +1 -1
  176. package/dist/models/agent-lanes.d.ts.map +1 -1
  177. package/dist/models/agent-lanes.js +4 -1
  178. package/dist/models/agent-lanes.js.map +1 -1
  179. package/dist/models/agent-runtimes.d.ts.map +1 -1
  180. package/dist/models/agent-runtimes.js +2 -2
  181. package/dist/models/agent-runtimes.js.map +1 -1
  182. package/dist/models/agent-standing.d.ts +6 -1
  183. package/dist/models/agent-standing.d.ts.map +1 -1
  184. package/dist/models/agent-standing.js +1 -0
  185. package/dist/models/agent-standing.js.map +1 -1
  186. package/dist/models/model-roles.d.ts +91 -37
  187. package/dist/models/model-roles.d.ts.map +1 -1
  188. package/dist/models/model-roles.js +106 -35
  189. package/dist/models/model-roles.js.map +1 -1
  190. package/dist/models/model-setups.d.ts +10 -8
  191. package/dist/models/model-setups.d.ts.map +1 -1
  192. package/dist/models/model-setups.js +15 -15
  193. package/dist/models/model-setups.js.map +1 -1
  194. package/dist/models/providers/provider-traits.d.ts +215 -0
  195. package/dist/models/providers/provider-traits.d.ts.map +1 -0
  196. package/dist/models/providers/provider-traits.js +60 -0
  197. package/dist/models/providers/provider-traits.js.map +1 -0
  198. package/dist/netd/browser-wire.d.ts +8 -0
  199. package/dist/netd/browser-wire.d.ts.map +1 -1
  200. package/dist/netd/browser-wire.js +5 -0
  201. package/dist/netd/browser-wire.js.map +1 -1
  202. package/dist/netd/generated/wire.d.ts +42 -1
  203. package/dist/netd/generated/wire.d.ts.map +1 -1
  204. package/dist/policy/admin/admin-grant.d.ts +21 -0
  205. package/dist/policy/admin/admin-grant.d.ts.map +1 -0
  206. package/dist/policy/admin/admin-grant.js +41 -0
  207. package/dist/policy/admin/admin-grant.js.map +1 -0
  208. package/dist/policy/approvals-execution.d.ts +5 -2
  209. package/dist/policy/approvals-execution.d.ts.map +1 -1
  210. package/dist/policy/approvals-execution.js +3 -4
  211. package/dist/policy/approvals-execution.js.map +1 -1
  212. package/dist/policy/batch-runs.d.ts +1 -1
  213. package/dist/policy/batch-runs.d.ts.map +1 -1
  214. package/dist/policy/batch-runs.js +2 -1
  215. package/dist/policy/batch-runs.js.map +1 -1
  216. package/dist/policy/capabilities/capability-kinds.d.ts +268 -0
  217. package/dist/policy/capabilities/capability-kinds.d.ts.map +1 -0
  218. package/dist/policy/capabilities/capability-kinds.js +47 -0
  219. package/dist/policy/capabilities/capability-kinds.js.map +1 -0
  220. package/dist/policy/command-classes.d.ts.map +1 -1
  221. package/dist/policy/command-classes.js +3 -1
  222. package/dist/policy/command-classes.js.map +1 -1
  223. package/dist/policy/device-programs.d.ts +79 -2
  224. package/dist/policy/device-programs.d.ts.map +1 -1
  225. package/dist/policy/device-programs.js +15 -16
  226. package/dist/policy/device-programs.js.map +1 -1
  227. package/dist/policy/message-limits.d.ts.map +1 -1
  228. package/dist/policy/message-limits.js.map +1 -1
  229. package/dist/policy/org-locks.d.ts +1 -1
  230. package/dist/policy/org-locks.d.ts.map +1 -1
  231. package/dist/policy/org-locks.js +1 -0
  232. package/dist/policy/org-locks.js.map +1 -1
  233. package/dist/policy/reserved-servers.d.ts.map +1 -1
  234. package/dist/policy/reserved-servers.js +5 -1
  235. package/dist/policy/reserved-servers.js.map +1 -1
  236. package/dist/policy/role-capability.d.ts.map +1 -1
  237. package/dist/policy/role-capability.js +2 -1
  238. package/dist/policy/role-capability.js.map +1 -1
  239. package/dist/policy/shell/command-normalise.d.ts +10 -0
  240. package/dist/policy/shell/command-normalise.d.ts.map +1 -0
  241. package/dist/policy/shell/command-normalise.js +153 -0
  242. package/dist/policy/shell/command-normalise.js.map +1 -0
  243. package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
  244. package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
  245. package/dist/policy/shell/workspace-root-exclude.js +4 -0
  246. package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
  247. package/dist/protocol/doors/listener-protocol.d.ts +11 -0
  248. package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
  249. package/dist/protocol/doors/listener-protocol.js +5 -0
  250. package/dist/protocol/doors/listener-protocol.js.map +1 -1
  251. package/dist/protocol/doors/loopback-proof.d.ts +8 -0
  252. package/dist/protocol/doors/loopback-proof.d.ts.map +1 -0
  253. package/dist/protocol/doors/loopback-proof.js +11 -0
  254. package/dist/protocol/doors/loopback-proof.js.map +1 -0
  255. package/dist/protocol/doors/pass-scopes.d.ts +4 -0
  256. package/dist/protocol/doors/pass-scopes.d.ts.map +1 -0
  257. package/dist/protocol/doors/pass-scopes.js +3 -0
  258. package/dist/protocol/doors/pass-scopes.js.map +1 -0
  259. package/dist/protocol/doors/runner-protocol.d.ts +187 -0
  260. package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
  261. package/dist/protocol/doors/runner-protocol.js +48 -1
  262. package/dist/protocol/doors/runner-protocol.js.map +1 -1
  263. package/dist/protocol/doors/sandbox-pass.d.ts +19 -2
  264. package/dist/protocol/doors/sandbox-pass.d.ts.map +1 -1
  265. package/dist/protocol/doors/sandbox-pass.js +42 -10
  266. package/dist/protocol/doors/sandbox-pass.js.map +1 -1
  267. package/dist/protocol/doors/webext-links.d.ts.map +1 -1
  268. package/dist/protocol/doors/webext-links.js.map +1 -1
  269. package/dist/protocol/member-reach.d.ts +6 -0
  270. package/dist/protocol/member-reach.d.ts.map +1 -1
  271. package/dist/protocol/member-reach.js +24 -0
  272. package/dist/protocol/member-reach.js.map +1 -1
  273. package/dist/protocol/peer-mcp-server.d.ts +2 -0
  274. package/dist/protocol/peer-mcp-server.d.ts.map +1 -1
  275. package/dist/protocol/peer-mcp-server.js +1 -0
  276. package/dist/protocol/peer-mcp-server.js.map +1 -1
  277. package/dist/protocol/raw/extension-protocol.d.ts +518 -0
  278. package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
  279. package/dist/protocol/raw/extension-protocol.js +276 -0
  280. package/dist/protocol/raw/extension-protocol.js.map +1 -1
  281. package/dist/protocol/raw/raw-json-routes.d.ts +572 -0
  282. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  283. package/dist/protocol/raw/raw-json-routes.js +25 -2
  284. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  285. package/dist/protocol/raw/raw-routes.d.ts +245 -3
  286. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  287. package/dist/protocol/raw/raw-routes.js +79 -36
  288. package/dist/protocol/raw/raw-routes.js.map +1 -1
  289. package/dist/protocol/route-meta.d.ts.map +1 -1
  290. package/dist/protocol/route-meta.js.map +1 -1
  291. package/dist/schemas/account-routes.d.ts +176 -0
  292. package/dist/schemas/account-routes.d.ts.map +1 -0
  293. package/dist/schemas/account-routes.js +73 -0
  294. package/dist/schemas/account-routes.js.map +1 -0
  295. package/dist/schemas/activity.d.ts.map +1 -1
  296. package/dist/schemas/activity.js.map +1 -1
  297. package/dist/schemas/agent-background.d.ts +48 -0
  298. package/dist/schemas/agent-background.d.ts.map +1 -0
  299. package/dist/schemas/agent-background.js +63 -0
  300. package/dist/schemas/agent-background.js.map +1 -0
  301. package/dist/schemas/agent-land.d.ts +7 -0
  302. package/dist/schemas/agent-land.d.ts.map +1 -1
  303. package/dist/schemas/agent-land.js +11 -0
  304. package/dist/schemas/agent-land.js.map +1 -1
  305. package/dist/schemas/agent.d.ts +4 -0
  306. package/dist/schemas/agent.d.ts.map +1 -1
  307. package/dist/schemas/agent.js +4 -2
  308. package/dist/schemas/agent.js.map +1 -1
  309. package/dist/schemas/agents-list.d.ts +40 -0
  310. package/dist/schemas/agents-list.d.ts.map +1 -1
  311. package/dist/schemas/agents.d.ts +668 -17
  312. package/dist/schemas/agents.d.ts.map +1 -1
  313. package/dist/schemas/agents.js +16 -41
  314. package/dist/schemas/agents.js.map +1 -1
  315. package/dist/schemas/auto-approve.d.ts +12 -0
  316. package/dist/schemas/auto-approve.d.ts.map +1 -0
  317. package/dist/schemas/auto-approve.js +12 -0
  318. package/dist/schemas/auto-approve.js.map +1 -0
  319. package/dist/schemas/automations.d.ts +170 -27
  320. package/dist/schemas/automations.d.ts.map +1 -1
  321. package/dist/schemas/automations.js +26 -34
  322. package/dist/schemas/automations.js.map +1 -1
  323. package/dist/schemas/bridge-heads.d.ts +57 -0
  324. package/dist/schemas/bridge-heads.d.ts.map +1 -0
  325. package/dist/schemas/bridge-heads.js +22 -0
  326. package/dist/schemas/bridge-heads.js.map +1 -0
  327. package/dist/schemas/capabilities.d.ts +21 -0
  328. package/dist/schemas/capabilities.d.ts.map +1 -1
  329. package/dist/schemas/capabilities.js +6 -0
  330. package/dist/schemas/capabilities.js.map +1 -1
  331. package/dist/schemas/checkout-hooks.d.ts +24 -0
  332. package/dist/schemas/checkout-hooks.d.ts.map +1 -0
  333. package/dist/schemas/checkout-hooks.js +23 -0
  334. package/dist/schemas/checkout-hooks.js.map +1 -0
  335. package/dist/schemas/ci-deployments.d.ts +30 -0
  336. package/dist/schemas/ci-deployments.d.ts.map +1 -0
  337. package/dist/schemas/ci-deployments.js +18 -0
  338. package/dist/schemas/ci-deployments.js.map +1 -0
  339. package/dist/schemas/ci-fleet.d.ts +216 -0
  340. package/dist/schemas/ci-fleet.d.ts.map +1 -0
  341. package/dist/schemas/ci-fleet.js +87 -0
  342. package/dist/schemas/ci-fleet.js.map +1 -0
  343. package/dist/schemas/ci.d.ts +348 -21
  344. package/dist/schemas/ci.d.ts.map +1 -1
  345. package/dist/schemas/ci.js +110 -19
  346. package/dist/schemas/ci.js.map +1 -1
  347. package/dist/schemas/command-run.d.ts +29 -0
  348. package/dist/schemas/command-run.d.ts.map +1 -0
  349. package/dist/schemas/command-run.js +20 -0
  350. package/dist/schemas/command-run.js.map +1 -0
  351. package/dist/schemas/connection-hub.d.ts +3 -1
  352. package/dist/schemas/connection-hub.d.ts.map +1 -1
  353. package/dist/schemas/connection-hub.js +2 -1
  354. package/dist/schemas/connection-hub.js.map +1 -1
  355. package/dist/schemas/context-continues.d.ts.map +1 -1
  356. package/dist/schemas/context-continues.js +2 -2
  357. package/dist/schemas/context-continues.js.map +1 -1
  358. package/dist/schemas/data-protection.d.ts +15 -2
  359. package/dist/schemas/data-protection.d.ts.map +1 -1
  360. package/dist/schemas/data-protection.js +15 -23
  361. package/dist/schemas/data-protection.js.map +1 -1
  362. package/dist/schemas/device-stacks.d.ts +131 -0
  363. package/dist/schemas/device-stacks.d.ts.map +1 -1
  364. package/dist/schemas/device-stacks.js +81 -0
  365. package/dist/schemas/device-stacks.js.map +1 -1
  366. package/dist/schemas/devices.d.ts +137 -0
  367. package/dist/schemas/devices.d.ts.map +1 -1
  368. package/dist/schemas/devices.js +11 -2
  369. package/dist/schemas/devices.js.map +1 -1
  370. package/dist/schemas/environment.d.ts +1 -0
  371. package/dist/schemas/environment.d.ts.map +1 -1
  372. package/dist/schemas/environment.js +1 -0
  373. package/dist/schemas/environment.js.map +1 -1
  374. package/dist/schemas/extension-updates.d.ts +1186 -0
  375. package/dist/schemas/extension-updates.d.ts.map +1 -1
  376. package/dist/schemas/extension-updates.js +22 -4
  377. package/dist/schemas/extension-updates.js.map +1 -1
  378. package/dist/schemas/git/git.d.ts +13 -0
  379. package/dist/schemas/git/git.d.ts.map +1 -1
  380. package/dist/schemas/git/git.js +7 -7
  381. package/dist/schemas/git/git.js.map +1 -1
  382. package/dist/schemas/git/index-run.d.ts +1 -0
  383. package/dist/schemas/git/index-run.d.ts.map +1 -1
  384. package/dist/schemas/host-power.d.ts +76 -0
  385. package/dist/schemas/host-power.d.ts.map +1 -0
  386. package/dist/schemas/host-power.js +101 -0
  387. package/dist/schemas/host-power.js.map +1 -0
  388. package/dist/schemas/hosts.d.ts +365 -0
  389. package/dist/schemas/hosts.d.ts.map +1 -1
  390. package/dist/schemas/hosts.js +33 -1
  391. package/dist/schemas/hosts.js.map +1 -1
  392. package/dist/schemas/issues.d.ts +55 -225
  393. package/dist/schemas/issues.d.ts.map +1 -1
  394. package/dist/schemas/issues.js +21 -43
  395. package/dist/schemas/issues.js.map +1 -1
  396. package/dist/schemas/keyring-native.d.ts.map +1 -1
  397. package/dist/schemas/keyring-native.js +3 -1
  398. package/dist/schemas/keyring-native.js.map +1 -1
  399. package/dist/schemas/keyring.d.ts +1 -0
  400. package/dist/schemas/keyring.d.ts.map +1 -1
  401. package/dist/schemas/keyring.js +3 -1
  402. package/dist/schemas/keyring.js.map +1 -1
  403. package/dist/schemas/maintenance.d.ts.map +1 -1
  404. package/dist/schemas/maintenance.js.map +1 -1
  405. package/dist/schemas/members.d.ts.map +1 -1
  406. package/dist/schemas/members.js +2 -14
  407. package/dist/schemas/members.js.map +1 -1
  408. package/dist/schemas/metrics.d.ts +33 -0
  409. package/dist/schemas/metrics.d.ts.map +1 -1
  410. package/dist/schemas/metrics.js +26 -0
  411. package/dist/schemas/metrics.js.map +1 -1
  412. package/dist/schemas/need-kinds.d.ts +19 -0
  413. package/dist/schemas/need-kinds.d.ts.map +1 -0
  414. package/dist/schemas/need-kinds.js +7 -0
  415. package/dist/schemas/need-kinds.js.map +1 -0
  416. package/dist/schemas/needs.d.ts +868 -27
  417. package/dist/schemas/needs.d.ts.map +1 -1
  418. package/dist/schemas/needs.js +79 -9
  419. package/dist/schemas/needs.js.map +1 -1
  420. package/dist/schemas/offload.d.ts +61 -0
  421. package/dist/schemas/offload.d.ts.map +1 -1
  422. package/dist/schemas/offload.js +14 -1
  423. package/dist/schemas/offload.js.map +1 -1
  424. package/dist/schemas/outward-action.d.ts +39 -0
  425. package/dist/schemas/outward-action.d.ts.map +1 -0
  426. package/dist/schemas/outward-action.js +40 -0
  427. package/dist/schemas/outward-action.js.map +1 -0
  428. package/dist/schemas/ports.d.ts +4 -0
  429. package/dist/schemas/ports.d.ts.map +1 -1
  430. package/dist/schemas/ports.js +3 -0
  431. package/dist/schemas/ports.js.map +1 -1
  432. package/dist/schemas/providers/capacity.d.ts +6 -0
  433. package/dist/schemas/providers/capacity.d.ts.map +1 -1
  434. package/dist/schemas/providers/plan-limits.d.ts +1 -0
  435. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  436. package/dist/schemas/providers/plan-limits.js +1 -0
  437. package/dist/schemas/providers/plan-limits.js.map +1 -1
  438. package/dist/schemas/providers/refusals.d.ts +12 -0
  439. package/dist/schemas/providers/refusals.d.ts.map +1 -1
  440. package/dist/schemas/providers/refusals.js +4 -0
  441. package/dist/schemas/providers/refusals.js.map +1 -1
  442. package/dist/schemas/remote-access.d.ts +1 -0
  443. package/dist/schemas/remote-access.d.ts.map +1 -1
  444. package/dist/schemas/remote-access.js +1 -0
  445. package/dist/schemas/remote-access.js.map +1 -1
  446. package/dist/schemas/run-targets.d.ts.map +1 -1
  447. package/dist/schemas/run-targets.js +2 -1
  448. package/dist/schemas/run-targets.js.map +1 -1
  449. package/dist/schemas/runner-views.d.ts +24 -0
  450. package/dist/schemas/runner-views.d.ts.map +1 -0
  451. package/dist/schemas/runner-views.js +16 -0
  452. package/dist/schemas/runner-views.js.map +1 -0
  453. package/dist/schemas/sandbox-reach.d.ts +157 -0
  454. package/dist/schemas/sandbox-reach.d.ts.map +1 -0
  455. package/dist/schemas/sandbox-reach.js +112 -0
  456. package/dist/schemas/sandbox-reach.js.map +1 -0
  457. package/dist/schemas/secrets.d.ts +17 -0
  458. package/dist/schemas/secrets.d.ts.map +1 -1
  459. package/dist/schemas/secrets.js +12 -5
  460. package/dist/schemas/secrets.js.map +1 -1
  461. package/dist/schemas/settings-history.d.ts +1 -1
  462. package/dist/schemas/settings-history.d.ts.map +1 -1
  463. package/dist/schemas/settings-history.js +5 -4
  464. package/dist/schemas/settings-history.js.map +1 -1
  465. package/dist/schemas/settings-savings.d.ts +58 -0
  466. package/dist/schemas/settings-savings.d.ts.map +1 -1
  467. package/dist/schemas/settings-savings.js +22 -0
  468. package/dist/schemas/settings-savings.js.map +1 -1
  469. package/dist/schemas/settings.d.ts +20 -42
  470. package/dist/schemas/settings.d.ts.map +1 -1
  471. package/dist/schemas/settings.js +24 -7
  472. package/dist/schemas/settings.js.map +1 -1
  473. package/dist/schemas/stack-grants.d.ts +60 -0
  474. package/dist/schemas/stack-grants.d.ts.map +1 -0
  475. package/dist/schemas/stack-grants.js +33 -0
  476. package/dist/schemas/stack-grants.js.map +1 -0
  477. package/dist/schemas/system.d.ts +19 -0
  478. package/dist/schemas/system.d.ts.map +1 -1
  479. package/dist/schemas/system.js +9 -0
  480. package/dist/schemas/system.js.map +1 -1
  481. package/dist/schemas/terminal.d.ts +46 -0
  482. package/dist/schemas/terminal.d.ts.map +1 -1
  483. package/dist/schemas/terminal.js +19 -0
  484. package/dist/schemas/terminal.js.map +1 -1
  485. package/dist/schemas/watch-sources.d.ts +72 -0
  486. package/dist/schemas/watch-sources.d.ts.map +1 -0
  487. package/dist/schemas/watch-sources.js +88 -0
  488. package/dist/schemas/watch-sources.js.map +1 -0
  489. package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
  490. package/dist/schemas/workspace/workspace-search.js +1 -1
  491. package/dist/schemas/workspace/workspace-search.js.map +1 -1
  492. package/dist/schemas/wsl-memory.d.ts +76 -0
  493. package/dist/schemas/wsl-memory.d.ts.map +1 -0
  494. package/dist/schemas/wsl-memory.js +36 -0
  495. package/dist/schemas/wsl-memory.js.map +1 -0
  496. package/dist/state/auth-state.d.ts.map +1 -1
  497. package/dist/state/auth-state.js +3 -0
  498. package/dist/state/auth-state.js.map +1 -1
  499. package/dist/state/definition.d.ts +16 -8
  500. package/dist/state/definition.d.ts.map +1 -1
  501. package/dist/state/runtime-state.d.ts +1 -1
  502. package/dist/state/runtime-state.d.ts.map +1 -1
  503. package/dist/state/runtime-state.js +1 -1
  504. package/dist/state/runtime-state.js.map +1 -1
  505. package/dist/state/workspace-state.d.ts +9 -4
  506. package/dist/state/workspace-state.d.ts.map +1 -1
  507. package/dist/state/workspace-state.js +9 -4
  508. package/dist/state/workspace-state.js.map +1 -1
  509. package/dist/sync/workspace-sync-ignores.d.ts +4 -0
  510. package/dist/sync/workspace-sync-ignores.d.ts.map +1 -0
  511. package/dist/sync/workspace-sync-ignores.js +75 -0
  512. package/dist/sync/workspace-sync-ignores.js.map +1 -0
  513. package/dist/text/pages.d.ts.map +1 -1
  514. package/dist/text/pages.js +17 -4
  515. package/dist/text/pages.js.map +1 -1
  516. package/dist/text/transcript-fold.js +2 -2
  517. package/dist/text/transcript-fold.js.map +1 -1
  518. package/package.json +5 -5
  519. package/src/app-routes/app-pages.ts +3 -0
  520. package/src/app-routes/index.ts +1 -0
  521. package/src/app-routes/return-path.ts +16 -0
  522. package/src/briefs/agent-ask.ts +23 -0
  523. package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
  524. package/src/chores/digest.ts +1 -0
  525. package/src/chores/index.ts +13 -2
  526. package/src/chores/prompt.ts +3 -18
  527. package/src/chores/stack.ts +1 -0
  528. package/src/chores/verdict.ts +1 -0
  529. package/src/chores/workspace-scope.ts +3 -8
  530. package/src/contracts/accounts.contract.ts +3 -0
  531. package/src/contracts/agents.contract.ts +41 -5
  532. package/src/contracts/automations.contract.ts +2 -0
  533. package/src/contracts/capabilities.contract.ts +31 -2
  534. package/src/contracts/ci.contract.ts +119 -37
  535. package/src/contracts/device-ci-runners.contract.ts +81 -0
  536. package/src/contracts/device-stacks.contract.ts +97 -0
  537. package/src/contracts/extensions.contract.ts +12 -1
  538. package/src/contracts/ports.contract.ts +6 -6
  539. package/src/contracts/runner.contract.ts +117 -3
  540. package/src/contracts/runners.contract.ts +19 -0
  541. package/src/contracts/safety.contract.ts +2 -0
  542. package/src/contracts/secrets.contract.ts +39 -0
  543. package/src/contracts/settings.contract.ts +26 -0
  544. package/src/contracts/stack-grants.contract.ts +51 -0
  545. package/src/contracts/system.contract.ts +36 -62
  546. package/src/contracts/workspace.contract.ts +0 -22
  547. package/src/events/agent-events.ts +3 -2
  548. package/src/events/agent-words.test.ts +19 -1
  549. package/src/events/agent-words.ts +36 -2
  550. package/src/events/child-news.test.ts +91 -0
  551. package/src/events/child-news.ts +269 -0
  552. package/src/events/prompt-origins.ts +35 -0
  553. package/src/events/refusal-incidents.ts +60 -19
  554. package/src/events/requests.ts +18 -0
  555. package/src/events/transcript.ts +10 -1
  556. package/src/ids/conversation-ids.test.ts +3 -1
  557. package/src/ids/conversation-ids.ts +6 -4
  558. package/src/ids/project-dir.test.ts +1 -1
  559. package/src/ids/project-dir.ts +1 -1
  560. package/src/ids/project-id.test.ts +14 -0
  561. package/src/ids/project-id.ts +6 -4
  562. package/src/ids/run-row-ids.test.ts +38 -0
  563. package/src/ids/run-row-ids.ts +49 -0
  564. package/src/index.ts +6 -6
  565. package/src/models/agent-catalog.test.ts +7 -4
  566. package/src/models/agent-catalog.ts +3 -2
  567. package/src/models/agent-lanes.ts +8 -1
  568. package/src/models/agent-runtimes.ts +7 -6
  569. package/src/models/agent-standing.ts +13 -0
  570. package/src/models/model-roles.test.ts +61 -4
  571. package/src/models/model-roles.ts +153 -49
  572. package/src/models/model-setups.ts +49 -26
  573. package/src/models/provider-specs.test.ts +2 -2
  574. package/src/models/providers/provider-traits.test.ts +71 -0
  575. package/src/models/providers/provider-traits.ts +144 -0
  576. package/src/netd/browser-wire.ts +13 -0
  577. package/src/netd/generated/browser-wire.json +10 -0
  578. package/src/netd/generated/netd-wire.json +224 -1
  579. package/src/netd/generated/wire.ts +18 -6
  580. package/src/netd/wire-manifests.test.ts +16 -0
  581. package/src/policy/admin/admin-grant.ts +69 -0
  582. package/src/policy/approvals-execution.ts +11 -6
  583. package/src/policy/batch-runs.ts +2 -2
  584. package/src/policy/capabilities/capability-kinds.test.ts +112 -0
  585. package/src/policy/capabilities/capability-kinds.ts +110 -0
  586. package/src/policy/command-classes.ts +5 -3
  587. package/src/policy/credential-material.ts +1 -1
  588. package/src/policy/device-programs.ts +29 -20
  589. package/src/policy/message-limits.ts +8 -4
  590. package/src/policy/org-locks.ts +1 -0
  591. package/src/policy/overlay-lint.ts +1 -1
  592. package/src/policy/reserved-servers.ts +5 -1
  593. package/src/policy/role-capability.ts +3 -1
  594. package/src/policy/shell/command-normalise.test.ts +72 -0
  595. package/src/policy/shell/command-normalise.ts +212 -0
  596. package/src/policy/shell/workspace-root-exclude.ts +11 -0
  597. package/src/policy/tests/admin-grant.test.ts +35 -0
  598. package/src/policy/tests/command-classes.test.ts +41 -0
  599. package/src/protocol/doors/listener-protocol.ts +32 -1
  600. package/src/protocol/doors/loopback-proof.ts +34 -0
  601. package/src/protocol/doors/pass-scopes.ts +12 -0
  602. package/src/protocol/doors/runner-protocol.ts +133 -4
  603. package/src/protocol/doors/sandbox-pass.test.ts +33 -1
  604. package/src/protocol/doors/sandbox-pass.ts +92 -16
  605. package/src/protocol/doors/webext-links.ts +3 -1
  606. package/src/protocol/ingress-contract.fixture.json +5 -1
  607. package/src/protocol/member-reach.test.ts +40 -1
  608. package/src/protocol/member-reach.ts +40 -0
  609. package/src/protocol/peer-mcp-server.ts +6 -0
  610. package/src/protocol/raw/extension-protocol.ts +469 -2
  611. package/src/protocol/raw/raw-json-routes.ts +45 -1
  612. package/src/protocol/raw/raw-routes.ts +133 -40
  613. package/src/protocol/route-meta.ts +4 -1
  614. package/src/schemas/account-routes.ts +126 -0
  615. package/src/schemas/activity.ts +6 -4
  616. package/src/schemas/agent-background.ts +104 -0
  617. package/src/schemas/agent-land.ts +21 -2
  618. package/src/schemas/agent.test.ts +3 -0
  619. package/src/schemas/agent.ts +10 -4
  620. package/src/schemas/agents.ts +26 -65
  621. package/src/schemas/auto-approve.ts +31 -0
  622. package/src/schemas/automations.ts +51 -42
  623. package/src/schemas/bridge-heads.ts +33 -0
  624. package/src/schemas/capabilities.ts +23 -0
  625. package/src/schemas/checkout-hooks.ts +44 -0
  626. package/src/schemas/ci-deployments.ts +26 -0
  627. package/src/schemas/ci-fleet.ts +180 -0
  628. package/src/schemas/ci.ts +185 -45
  629. package/src/schemas/command-run.ts +44 -0
  630. package/src/schemas/compose-overlay.test.ts +1 -1
  631. package/src/schemas/compose-overlay.ts +1 -1
  632. package/src/schemas/connection-hub.ts +4 -2
  633. package/src/schemas/context-continues.ts +6 -3
  634. package/src/schemas/data-protection.ts +28 -34
  635. package/src/schemas/device-stacks.ts +162 -3
  636. package/src/schemas/device-swaps.test.ts +1 -1
  637. package/src/schemas/devices.ts +31 -2
  638. package/src/schemas/egress-private.test.ts +1 -1
  639. package/src/schemas/environment.ts +4 -0
  640. package/src/schemas/extension-updates.ts +35 -7
  641. package/src/schemas/git/git.ts +14 -14
  642. package/src/schemas/host-power.test.ts +53 -0
  643. package/src/schemas/host-power.ts +173 -0
  644. package/src/schemas/hosts.test.ts +32 -0
  645. package/src/schemas/hosts.ts +86 -2
  646. package/src/schemas/intentic-os.ts +2 -2
  647. package/src/schemas/issues.ts +43 -86
  648. package/src/schemas/keyring-native.test.ts +11 -3
  649. package/src/schemas/keyring-native.ts +3 -1
  650. package/src/schemas/keyring.ts +6 -1
  651. package/src/schemas/maintenance.ts +4 -3
  652. package/src/schemas/members.ts +4 -16
  653. package/src/schemas/metrics.test.ts +9 -1
  654. package/src/schemas/metrics.ts +43 -0
  655. package/src/schemas/need-kinds.ts +13 -0
  656. package/src/schemas/needs.ts +118 -14
  657. package/src/schemas/offload.ts +37 -3
  658. package/src/schemas/outward-action.ts +47 -0
  659. package/src/schemas/ports.ts +5 -0
  660. package/src/schemas/providers/plan-limits.ts +1 -0
  661. package/src/schemas/providers/refusals.ts +9 -0
  662. package/src/schemas/remote-access.ts +3 -0
  663. package/src/schemas/run-targets.ts +2 -1
  664. package/src/schemas/runner-views.ts +27 -0
  665. package/src/schemas/sandbox-reach.ts +161 -0
  666. package/src/schemas/secrets.ts +23 -5
  667. package/src/schemas/settings-history.ts +10 -5
  668. package/src/schemas/settings-savings.ts +29 -0
  669. package/src/schemas/settings.test.ts +24 -23
  670. package/src/schemas/settings.ts +55 -22
  671. package/src/schemas/stack-grants.ts +59 -0
  672. package/src/schemas/state-plan.test.ts +1 -1
  673. package/src/schemas/state-plan.ts +2 -2
  674. package/src/schemas/system.ts +16 -1
  675. package/src/schemas/terminal.ts +28 -0
  676. package/src/schemas/updates.test.ts +1 -1
  677. package/src/schemas/updates.ts +1 -1
  678. package/src/schemas/version-seam.test.ts +4 -1
  679. package/src/schemas/watch-sources.ts +127 -0
  680. package/src/schemas/workspace/workspace-search.ts +5 -2
  681. package/src/schemas/wsl-memory.ts +59 -0
  682. package/src/state/auth-state.ts +10 -0
  683. package/src/state/runtime-state.test.ts +3 -2
  684. package/src/state/runtime-state.ts +3 -1
  685. package/src/state/update-probation.ts +1 -1
  686. package/src/state/ways-back.test.ts +1 -1
  687. package/src/state/workspace-state.test.ts +2 -0
  688. package/src/state/workspace-state.ts +21 -21
  689. package/src/sync/workspace-sync-ignores.test.ts +48 -0
  690. package/src/sync/workspace-sync-ignores.ts +143 -0
  691. package/src/text/embed.ts +2 -2
  692. package/src/text/pages.ts +34 -7
  693. package/src/text/transcript-fold.test.ts +40 -2
  694. package/src/text/transcript-fold.ts +2 -2
  695. package/dist/chores/extension-update.d.ts.map +0 -1
  696. package/dist/chores/extension-update.js.map +0 -1
  697. package/dist/contracts/chores.contract.d.ts +0 -213
  698. package/dist/contracts/chores.contract.d.ts.map +0 -1
  699. package/dist/contracts/chores.contract.js +0 -32
  700. package/dist/contracts/chores.contract.js.map +0 -1
  701. package/dist/contracts/issues.contract.d.ts +0 -95
  702. package/dist/contracts/issues.contract.d.ts.map +0 -1
  703. package/dist/contracts/issues.contract.js +0 -50
  704. package/dist/contracts/issues.contract.js.map +0 -1
  705. package/src/chores/chores.test.ts +0 -24
  706. package/src/chores/digest.test.ts +0 -27
  707. package/src/chores/probes.integration.test.ts +0 -494
  708. package/src/chores/stack.test.ts +0 -140
  709. package/src/chores/verdict.test.ts +0 -761
  710. package/src/contracts/chores.contract.ts +0 -39
  711. package/src/contracts/issues.contract.ts +0 -53
@@ -0,0 +1,110 @@
1
+ // WHAT EACH CAPABILITY KIND IS, as one row per kind: every reader that asks "which kinds are signed-in accounts", "which
2
+ // mount at a turn's start", "which are peers" reads it off this table, so a new kind is one entry the compiler makes
3
+ // complete (`satisfies Record<CapabilityKind, …>`) instead of a dozen hand-kept lists that silently leave it out.
4
+ // Pure data with no schema, so the contract lock does not see it.
5
+ import type { CapabilityKind } from "../../schemas/capabilities.js";
6
+
7
+ export interface KindTraits {
8
+ // Which outward group the Sandbox ▸ Map files a connection of this kind under.
9
+ readonly group: "services" | "accounts" | "machines" | "sandboxes" | "network" | "models";
10
+ // A person's credential reach can hold it back (schemas/members.ts `REACHABLE_CREDENTIAL_KINDS`).
11
+ readonly reachable: boolean;
12
+ // Someone signed in: a role reaches it only by naming it (policy/role-capability.ts).
13
+ readonly signedInAccount: boolean;
14
+ // A profile in the sandbox's own browser, signed into by hand in its login window.
15
+ readonly sandboxBrowser: boolean;
16
+ // Its credential is a mount (a profile, an exported token, a running server) a gate can only withhold per turn.
17
+ readonly credentialMount: boolean;
18
+ // Mounted at a turn's start, so a later grant or connection reaches only the next turn.
19
+ readonly turnStartMount: boolean;
20
+ // The peer door its card pairs through, for a computer, a browser or a phone.
21
+ readonly peer?: "hosts" | "webext" | "phones";
22
+ // A tunnel the machine either holds or does not (tunnel/tunnel-links.ts).
23
+ readonly tunnel: boolean;
24
+ // What model provider it mints: an `endpoint/<id>`, or an ACP agent.
25
+ readonly provider?: "endpoint" | "agent";
26
+ // Its id becomes an `mcp__<id>__` server name for the turn (policy/reserved-servers.ts).
27
+ readonly mintsServer: boolean;
28
+ // Where its tile comes from: the built-in catalog, or a card an extension contributes.
29
+ readonly tile: "catalog" | "card";
30
+ }
31
+
32
+ const off = {
33
+ reachable: false,
34
+ signedInAccount: false,
35
+ sandboxBrowser: false,
36
+ credentialMount: false,
37
+ turnStartMount: false,
38
+ tunnel: false,
39
+ mintsServer: false,
40
+ } as const;
41
+ const account = { ...off, group: "accounts", reachable: true, signedInAccount: true, turnStartMount: true } as const;
42
+ const tunnel = { ...off, group: "network", tunnel: true, tile: "catalog" } as const;
43
+ const peer = { ...off, group: "machines", reachable: true, turnStartMount: true, tile: "card" } as const;
44
+
45
+ // In CapabilityKindSchema's own order (a test holds it there).
46
+ export const CAPABILITY_KIND_TRAITS = {
47
+ mcp: { ...off, group: "services", reachable: true, credentialMount: true, turnStartMount: true, mintsServer: true, tile: "catalog" },
48
+ cli: { ...off, group: "services", reachable: true, tile: "card" },
49
+ plugin: { ...off, group: "services", reachable: true, turnStartMount: true, tile: "catalog" },
50
+ extension: { ...off, group: "services", reachable: true, tile: "catalog" },
51
+ ssh: { ...off, group: "machines", reachable: true, tile: "catalog" },
52
+ vpn: tunnel,
53
+ exit: tunnel,
54
+ netdisk: tunnel,
55
+ docker: { ...off, group: "machines", tile: "catalog" },
56
+ browser: { ...account, sandboxBrowser: true, credentialMount: true, tile: "card" },
57
+ identity: { ...account, sandboxBrowser: true, credentialMount: true, tile: "catalog" },
58
+ device: { ...peer, peer: "hosts" },
59
+ webext: { ...account, peer: "webext", tile: "card" },
60
+ phone: { ...peer, peer: "phones" },
61
+ agent: { ...off, group: "services", turnStartMount: true, provider: "agent", tile: "card" },
62
+ endpoint: { ...off, group: "models", provider: "endpoint", tile: "catalog" },
63
+ localmodel: { ...off, group: "models", provider: "endpoint", tile: "catalog" },
64
+ wallet: { ...off, group: "services", tile: "catalog" },
65
+ fleet: { ...off, group: "sandboxes", reachable: true, tile: "catalog" },
66
+ link: { ...off, group: "sandboxes", reachable: true, mintsServer: true, tile: "catalog" },
67
+ } as const satisfies Record<CapabilityKind, KindTraits>;
68
+
69
+ type Table = typeof CAPABILITY_KIND_TRAITS;
70
+
71
+ // The kinds whose row matches `P`, as a type: `KindsWhere<{ tunnel: true }>` is "vpn" | "exit" | "netdisk".
72
+ export type KindsWhere<P> = { [K in keyof Table]: Table[K] extends P ? K : never }[keyof Table];
73
+
74
+ // The kinds a computer, a browser or a phone pairs as.
75
+ export type PeerKind = KindsWhere<{ readonly peer: string }>;
76
+
77
+ // The table's own keys, which `satisfies` holds to exactly the kinds.
78
+ // SAFETY: Object.keys of a table that satisfies Record<CapabilityKind, …> lists kinds and nothing else.
79
+ const KINDS = Object.keys(CAPABILITY_KIND_TRAITS) as CapabilityKind[];
80
+
81
+ // The kinds whose row passes `test`, in the enum's order.
82
+ export const kindsWhere = (test: (traits: KindTraits) => boolean): readonly CapabilityKind[] =>
83
+ KINDS.filter((kind) => test(CAPABILITY_KIND_TRAITS[kind]));
84
+
85
+ // The kinds whose row matches `P`, as a list typed by them. `P` and `test` must say the same thing; the contract's test
86
+ // pins every list built with this to its literal.
87
+ const kindsTyped = <P>(test: (traits: KindTraits) => boolean): readonly KindsWhere<P>[] =>
88
+ // SAFETY: the caller's `test` selects the rows `P` describes, pinned per list in tests/capability-kinds.test.ts.
89
+ kindsWhere(test) as readonly KindsWhere<P>[];
90
+
91
+ // One kind's row, or undefined for a string no kind answers to (an older or newer peer's kind, an inherited name).
92
+ export const traitsOf = (kind: string): KindTraits | undefined => {
93
+ const found = KINDS.find((candidate) => candidate === kind);
94
+ return found === undefined ? undefined : CAPABILITY_KIND_TRAITS[found];
95
+ };
96
+
97
+ // The kinds a computer, a browser or a phone pairs as, and whether a kind (or a mount target's kind) is one.
98
+ export const PEER_KINDS = kindsTyped<{ readonly peer: string }>((traits) => traits.peer !== undefined);
99
+ export const isPeerKind = (kind: string): kind is PeerKind => traitsOf(kind)?.peer !== undefined;
100
+
101
+ // The kinds that mint an `endpoint/<id>` model provider, and the kinds that are a profile in the sandbox's own browser,
102
+ // typed so `isKindOf` narrows a capability to their configs.
103
+ export const ENDPOINT_KINDS = kindsTyped<{ readonly provider: "endpoint" }>((traits) => traits.provider === "endpoint");
104
+ export const SANDBOX_BROWSER_KINDS = kindsTyped<{ readonly sandboxBrowser: true }>((traits) => traits.sandboxBrowser);
105
+
106
+ // Whether a capability is of one of these kinds, narrowing the capability itself (a discriminated union over `kind`).
107
+ export const isKindOf = <C extends { readonly kind: string }, K extends string>(
108
+ capability: C,
109
+ kinds: readonly K[],
110
+ ): capability is Extract<C, { readonly kind: K }> => kinds.some((kind) => kind === capability.kind);
@@ -2,6 +2,7 @@ import { HISTORY_ROOT, WORKSPACE_ROOT } from "@intentic/constants";
2
2
  import { type CommandClass, CommandClassSchema, type CommandLocus } from "../schemas/command-admission.js";
3
3
  import { SECRET_REFERENCE } from "../schemas/needs.js";
4
4
  import { inertRegions, isLive } from "../text/shell-regions.js";
5
+ import { readingsOf } from "./shell/command-normalise.js";
5
6
  import { GIT_BRANCH_SWITCH } from "../text/git-branch-switch.js";
6
7
 
7
8
  // Classifies a shell command, shared by the sandbox gate and the machine agent's shell tool so they can't drift on what
@@ -532,12 +533,13 @@ const MATCHES: Readonly<Record<CommandClass, (command: string, context: CommandC
532
533
  "network.outbound": networkOutbound,
533
534
  };
534
535
 
535
- // Every class the command falls in, with its fragments, in the catalog's own order. `context` is now required: its
536
- // locus decides what half the catalog means, and the inert scan runs once, shared by every class.
536
+ // Every class the command falls in, with its fragments, in the catalog's own order, as written or unquoted. `context` is
537
+ // now required: its locus decides what half the catalog means, and the inert scan runs once, shared by every class.
537
538
  export const matchCommand = (command: string, context: CommandContext): CommandMatch[] => {
538
539
  const regions = inertRegions(command);
540
+ const read = readingsOf(command, context);
539
541
  return CommandClassSchema.options.flatMap((commandClass) => {
540
- const spans = mergeSpans(MATCHES[commandClass](command, context));
542
+ const spans = mergeSpans(read(MATCHES[commandClass]));
541
543
  return spans.length === 0 ? [] : [{ commandClass, spans, live: spans.some((span) => isLive(span, regions)) }];
542
544
  });
543
545
  };
@@ -34,7 +34,7 @@ export interface CredentialIssuer {
34
34
  }
35
35
 
36
36
  // Credentials that name their own issuer. Kept as data, not regexes, so the terminal filter's copy
37
- // (CREDENTIAL_ISSUERS in _sandbox/output-cleaners/src/cleaners.mjs, builtins only, so it cannot import this) can be
37
+ // (CREDENTIAL_ISSUERS in _sandbox/output-cleaners/src/short-secrets.mjs, builtins only, so it cannot import this) can be
38
38
  // compared entry by entry: the daemon's src/secrets/terminal-masking-parity.test.ts fails the moment the two part. Only
39
39
  // the whole shape counts here, never the prefix alone: the outbox reads text nobody said holds a credential, where a
40
40
  // bare `sk-` in prose is not one. The terminal side also takes the prefix alone beside a credential-shaped name, where
@@ -6,7 +6,7 @@ import { z } from "zod";
6
6
  // shell, and the input tools put text where a terminal could run it. The daemon's gate used to know two of those by
7
7
  // name, the machine's own checks a different few, and `app_start program=powershell args=[…]` slipped past the judge, the
8
8
  // card and the unattended refusal. This is the one table both ends read: the tool, and how to lift the command line
9
- // out of its arguments. A device tool that carries a program is added here, or the machine's test says it is missing.
9
+ // out of its arguments. A device tool that carries a program is added here and built with the machine's `programTool`, or the machine's test says it is missing.
10
10
 
11
11
  /**
12
12
  * What a call's program is, which decides how it is read:
@@ -39,13 +39,16 @@ export const ProgramArgumentsSchema = z.looseObject({
39
39
  });
40
40
  export type ProgramArguments = z.infer<typeof ProgramArgumentsSchema>;
41
41
 
42
- interface ProgramCarrier {
43
- readonly tool: string;
42
+ interface CarrierReading {
44
43
  /** In words: where the program is in the arguments. */
45
44
  readonly carries: string;
46
45
  readonly read: (args: ProgramArguments) => Omit<ProgramReading, "tool"> | undefined;
47
46
  }
48
47
 
48
+ interface ProgramCarrier extends CarrierReading {
49
+ readonly tool: DeviceProgramTool;
50
+ }
51
+
49
52
  const present = (value: string | undefined): string | undefined => (value === undefined || value.trim() === "" ? undefined : value);
50
53
 
51
54
  // A program by the name it is known by (`rm`, `powershell`), not the path or the `.exe` it was started through.
@@ -68,8 +71,7 @@ const ADB_SERIAL = /^[\w.:-]+$/;
68
71
  // A URL, or `www.`/`mailto:` which the machine opens the same way (desktop-automation's looksLikeUrl).
69
72
  const URL_TARGET = /^(?:[a-z][a-z0-9+.-]*:\/\/|www\.|mailto:)/i;
70
73
 
71
- const typedBy = (tool: string, action: string, field: "text" | "value"): ProgramCarrier => ({
72
- tool,
74
+ const typedBy = (action: string, field: "text" | "value"): CarrierReading => ({
73
75
  carries: `${field}, when action is ${action}`,
74
76
  read: (args) => {
75
77
  const typed = args.action === action ? present(args[field]) : undefined;
@@ -77,18 +79,17 @@ const typedBy = (tool: string, action: string, field: "text" | "value"): Program
77
79
  },
78
80
  });
79
81
 
80
- /** Every device tool that carries a program. */
81
- export const DEVICE_PROGRAM_TOOLS: readonly ProgramCarrier[] = [
82
- {
83
- tool: "run_command",
82
+ // Keyed by tool name, so the name is a type: the machine marks each of its tools that carries a program with
83
+ // `programTool`, which takes only a name in this table, and its test holds the marked set equal to the table.
84
+ const CARRIERS = {
85
+ run_command: {
84
86
  carries: "command",
85
87
  read: ({ command }) => {
86
88
  const line = present(command);
87
89
  return line === undefined ? undefined : { kind: "command", commandLine: line };
88
90
  },
89
91
  },
90
- {
91
- tool: "android_shell",
92
+ android_shell: {
92
93
  carries: "command, run as `adb [-s serial] shell <command>`",
93
94
  read: ({ command, serial }) => {
94
95
  const line = present(command);
@@ -98,8 +99,7 @@ export const DEVICE_PROGRAM_TOOLS: readonly ProgramCarrier[] = [
98
99
  return { kind: "phone-command", commandLine: `adb ${serial !== undefined && ADB_SERIAL.test(serial) ? `-s ${serial} ` : ""}shell ${line}` };
99
100
  },
100
101
  },
101
- {
102
- tool: "app_start",
102
+ app_start: {
103
103
  carries: "program and args",
104
104
  read: ({ program, args }) => {
105
105
  const started = present(program);
@@ -111,8 +111,7 @@ export const DEVICE_PROGRAM_TOOLS: readonly ProgramCarrier[] = [
111
111
  return { kind: args === undefined || args.length === 0 ? "app-launch" : "command", commandLine: commandLineOf(started, args ?? []) };
112
112
  },
113
113
  },
114
- {
115
- tool: "open",
114
+ open: {
116
115
  carries: "target",
117
116
  read: ({ target }) => {
118
117
  const opened = present(target);
@@ -124,11 +123,21 @@ export const DEVICE_PROGRAM_TOOLS: readonly ProgramCarrier[] = [
124
123
  return { kind: URL_TARGET.test(opened) || !/\s/.test(opened.trim()) ? "app-launch" : "command", commandLine: opened };
125
124
  },
126
125
  },
127
- typedBy("device", "type", "text"),
128
- typedBy("android_act", "type", "text"),
129
- typedBy("clipboard", "write", "text"),
130
- typedBy("ui_act", "set_value", "value"),
131
- ];
126
+ device: typedBy("type", "text"),
127
+ android_act: typedBy("type", "text"),
128
+ clipboard: typedBy("write", "text"),
129
+ ui_act: typedBy("set_value", "value"),
130
+ } satisfies Record<string, CarrierReading>;
131
+
132
+ /** The name of a device tool that carries a program. */
133
+ export type DeviceProgramTool = keyof typeof CARRIERS;
134
+
135
+ /** Every device tool that carries a program. */
136
+ export const DEVICE_PROGRAM_TOOLS: readonly ProgramCarrier[] = Object.entries(CARRIERS).map(([tool, carrier]) => ({
137
+ // SAFETY: Object.entries of CARRIERS yields exactly its own keys.
138
+ tool: tool as DeviceProgramTool,
139
+ ...carrier,
140
+ }));
132
141
 
133
142
  /** The program a `tools/call` of `tool` carries, or undefined for a tool that carries none or a call with nothing in the place the table looks. */
134
143
  export const programInCall = (tool: string, args: ProgramArguments): ProgramReading | undefined => {
@@ -1,7 +1,11 @@
1
- // The longest one message may be on each platform, declared once: the approvals inbox counts a post against it (over it,
2
- // a post does not post), the daemon refuses a direct publish past it, and each messaging gateway spills a reply into a
3
- // follow-up message there. Measured in JavaScript string length (UTF-16 code units), which never undercounts a
4
- // platform that counts characters. A platform absent here has no known cap.
1
+ // FROZEN (2026-11-26, extension API 2.54.0): a platform's one-message limit is what the card naming it declares
2
+ // (`channel.messageLimit` in its extension's manifest), which the gateways, the approvals inbox and a publishing backend
3
+ // read. Nothing in the repository reads this table except the approvals inbox facing a daemon from before 2.54.0, whose
4
+ // cards declare none. It stays because the extension wire records this subpath (@intentic/extension-api/wire), and
5
+ // leaves at extension API 3.0.0 as a pure delete; never add a platform here.
6
+ //
7
+ // The longest one message may be on each platform, as that daemon knew it. Measured in JavaScript string length (UTF-16
8
+ // code units), which never undercounts a platform that counts characters. A platform absent here has no known cap.
5
9
  export const MESSAGE_LIMITS = {
6
10
  bluesky: 300,
7
11
  discord: 2_000,
@@ -74,6 +74,7 @@ export const ORG_SECTION_ROUTES = {
74
74
  "extensions.applyUpdate",
75
75
  "extensions.revert",
76
76
  "extensions.setUpdatePolicy",
77
+ "extensions.setUpdateDefaults",
77
78
  "extensions.devSet",
78
79
  "extensions.devClear",
79
80
  "extensions.devReload",
@@ -16,7 +16,7 @@ export const isOfficialSandboxImage = (ref: string): boolean => OFFICIAL_SANDBOX
16
16
  // The base the dogfood loop compiles from a working tree (`pnpm build:sandbox`). A sandbox on it is rebuilt from that
17
17
  // checkout and never from the registry, which would replace the image rather than refresh it. Exactly this tag, not
18
18
  // "any unpublished ref": a rollback pin is a local tag too, and updating off one is how a rolled-back sandbox rejoins
19
- // its channel. ic's twin is DEV_TAG in _sandbox/ic/src/sandbox/recreate.rs.
19
+ // its channel. ic's twin is DEV_TAG in _hosts/ic/src/sandbox/recreate.rs.
20
20
  export const DEV_SANDBOX_IMAGE = "intentic-sandbox:dev";
21
21
 
22
22
  interface OverlayLine {
@@ -1,4 +1,5 @@
1
1
  import { contributedServerMintingKinds } from "@intentic/extension-manifest";
2
+ import { kindsWhere } from "./capabilities/capability-kinds.js";
2
3
  // The MCP servers the daemon mounts under its own names, and whether each carries content from outside this container.
3
4
  // One source of truth: the outside-content guard's exemption list is the `control` subset of this, and a capability
4
5
  // whose id would become `mcp__<id>__…` is refused when the id is one of these, so nothing the owner configures can
@@ -48,7 +49,10 @@ export const CONTROL_MCP_SERVERS: ReadonlySet<string> = new Set(
48
49
  // (a device's and a connected browser's peer bridge, a cli card that serves tools), read off the schema's own meaning
49
50
  // (`contributedServerMintingKinds`), so a kind that starts minting is refused here without a second list. Other kinds
50
51
  // mint accounts, providers or infrastructure, never a `mcp__<id>__` server keyed by the id.
51
- export const MCP_SERVER_MINTING_KINDS: ReadonlySet<string> = new Set(["mcp", "link", ...contributedServerMintingKinds()]);
52
+ export const MCP_SERVER_MINTING_KINDS: ReadonlySet<string> = new Set([
53
+ ...kindsWhere((traits) => traits.mintsServer),
54
+ ...contributedServerMintingKinds(),
55
+ ]);
52
56
 
53
57
  // Whether adding or renaming a capability of this kind to this id would shadow a daemon server. The one predicate the
54
58
  // capability routes consult, so the refusal and this list can't drift.
@@ -1,3 +1,5 @@
1
+ import { traitsOf } from "./capabilities/capability-kinds.js";
2
+
1
3
  // WHETHER A ROLE LETS A TURN ACT THROUGH ONE CONNECTED CAPABILITY. Pure and shared, because the daemon mounts a turn's
2
4
  // tools on this answer (roles/roles.ts `turnRole`) and the Sandbox ▸ Map view draws who reaches what from it,
3
5
  // and two implementations would disagree at exactly the boundary that matters.
@@ -17,7 +19,7 @@ export interface CapabilityRef {
17
19
  * 2026-10-25, and it fell through to "passes untouched": an X-only role's unattended run reached the owner's Brave,
18
20
  * and an unpinned wake that lost every sandbox account kept it.
19
21
  */
20
- export const isSignedInAccount = (kind: string): boolean => kind === "browser" || kind === "identity" || kind === "webext";
22
+ export const isSignedInAccount = (kind: string): boolean => traitsOf(kind)?.signedInAccount === true;
21
23
 
22
24
  /**
23
25
  * Whether a role speaking through these accounts (its `capabilities`) may act through a capability. Granting an
@@ -0,0 +1,72 @@
1
+ import type { CommandSpan } from "../command-classes.js";
2
+ import { normaliseCommand, readingsOf } from "./command-normalise.js";
3
+
4
+ // The text the classifier reads besides the command: the command itself when there was no quoting to strip.
5
+ const unquoted = (command: string): string => normaliseCommand(command)?.text ?? command;
6
+
7
+ // The original text behind `fragment` of the copy, as a card would mark it.
8
+ const behind = (command: string, fragment: string): string | undefined => {
9
+ const normalised = normaliseCommand(command);
10
+ const start = normalised?.text.indexOf(fragment) ?? -1;
11
+ const span = start === -1 ? undefined : normalised?.original({ start, end: start + fragment.length });
12
+ return span === undefined ? undefined : command.slice(span.start, span.end);
13
+ };
14
+
15
+ test.each([
16
+ [String.raw`r\m -rf ~`, "rm -rf ~"],
17
+ ["r''m -rf ~", "rm -rf ~"],
18
+ ['"rm" -rf ~', "rm -rf ~"],
19
+ ['$"rm" -rf ~', "rm -rf ~"],
20
+ [String.raw`$'\x72m' -rf ~`, "rm -rf ~"],
21
+ [String.raw`$'\162m' -rf ~`, "rm -rf ~"],
22
+ [String.raw`$'rm' -rf ~`, "rm -rf ~"],
23
+ ['g""it push --force', "git push --force"],
24
+ ['git push -"-force"', "git push --force"],
25
+ ["rm${IFS}-rf${IFS}~", "rm -rf ~"],
26
+ ["rm$IFS-rf$IFS~", "rm -rf ~"],
27
+ ["r\\\nm -rf ~", "rm -rf ~"],
28
+ ])("%j reads as %j", (command, expected) => {
29
+ expect(unquoted(command)).toBe(expected);
30
+ });
31
+
32
+ test("a quoted argument with whitespace stays one argument, its inside read as a nested shell would read it", () => {
33
+ expect(normaliseCommand(`echo "rm -rf ~ is dangerous"`)).toBeUndefined();
34
+ expect(unquoted(`bash -c "r''m -rf ~"`)).toBe(`bash -c "rm -rf ~"`);
35
+ expect(unquoted(`sh -c 'g""it push --force'`)).toBe(`sh -c 'git push --force'`);
36
+ });
37
+
38
+ test("a backslash inside quotes is read as bash reads it there, so a quoted regex keeps its escapes", () => {
39
+ expect(unquoted(String.raw`rg '\.env' src`)).toBe(String.raw`rg \.env src`);
40
+ expect(unquoted(String.raw`grep "\.npmrc" .`)).toBe(String.raw`grep \.npmrc .`);
41
+ expect(unquoted(String.raw`echo "\$HOME"`)).toBe("echo $HOME");
42
+ });
43
+
44
+ test("nothing to strip, an unterminated quote and another variable are left as written", () => {
45
+ for (const command of ["ls -la", `ls -la "my dir"`, `echo "rm -rf`, "echo $IFSX"]) {
46
+ expect(normaliseCommand(command), command).toBeUndefined();
47
+ }
48
+ });
49
+
50
+ test("a span over the copy maps back over the text it was read from, the quotes it lost included", () => {
51
+ expect(behind(`cd /tmp && "rm" -rf ~`, "rm -rf ~")).toBe(`"rm" -rf ~`);
52
+ expect(behind(String.raw`ls; $'\x72m' -rf ~`, "rm")).toBe(String.raw`$'\x72m'`);
53
+ expect(behind(String.raw`r\m -rf ~`, "m")).toBe(String.raw`\m`);
54
+ expect(behind("rm${IFS}-rf ~", " -")).toBe("${IFS}-");
55
+ });
56
+
57
+ describe("readingsOf", () => {
58
+ test("one matcher over both readings, every span over the command's own offsets", () => {
59
+ const read = readingsOf(`"rm" x`, { locus: "device" });
60
+ expect(read((text): CommandSpan[] => (text.startsWith("rm") ? [{ start: 0, end: 2 }] : []))).toEqual([{ start: 0, end: 4 }]);
61
+ });
62
+
63
+ test("the file check is asked once per path, though both readings name it", () => {
64
+ const asked: string[] = [];
65
+ const read = readingsOf(`cat "$HOME/.npmrc"`, { locus: "device", holdsSecret: (path) => void asked.push(path) });
66
+ read((_text, context) => {
67
+ context.holdsSecret?.("$HOME/.npmrc");
68
+ return [];
69
+ });
70
+ expect(asked).toEqual(["$HOME/.npmrc"]);
71
+ });
72
+ });
@@ -0,0 +1,212 @@
1
+ import type { CommandContext, CommandSpan } from "../command-classes.js";
2
+
3
+ // A command with the quoting a shell strips before it runs anything, so `r\m`, `r''m`, `"rm"`, `$'\x72m'` and
4
+ // `rm${IFS}-rf` read as the `rm -rf` they are; the classifier runs its tables over this copy as well as the command.
5
+ // A quoted piece with no whitespace in it only joins word fragments and loses its quotes. One with whitespace is a
6
+ // single argument and keeps them, but its inside is read the same way, as the nested shell of a `bash -c "…"` would.
7
+ // Over-reading costs a judge call, the trade the classifier makes everywhere. Each character keeps the slice of the
8
+ // command it came from, so a fragment found here still marks the text the card shows, and still asks `live` of it.
9
+
10
+ interface Reading {
11
+ text: string;
12
+ // Per UTF-16 unit of `text`, the slice of the command it was read from.
13
+ readonly sources: CommandSpan[];
14
+ }
15
+
16
+ const reading = (): Reading => ({ text: "", sources: [] });
17
+
18
+ const emit = (into: Reading, text: string, start: number, end: number): void => {
19
+ into.text += text;
20
+ for (let unit = 0; unit < text.length; unit += 1) {
21
+ into.sources.push({ start, end });
22
+ }
23
+ };
24
+
25
+ // A quote's inside, its first and last characters stretched over the quotes it lost, so a mark covers them too.
26
+ const append = (into: Reading, piece: Reading, start: number, end: number): void => {
27
+ into.text += piece.text;
28
+ const last = piece.sources.length - 1;
29
+ piece.sources.forEach((source, unit) => into.sources.push({ start: unit === 0 ? start : source.start, end: unit === last ? end : source.end }));
30
+ };
31
+
32
+ type QuoteKind = "single" | "double" | "ansi";
33
+
34
+ // `$"…"` is a translated string, read as a plain double-quoted one.
35
+ const openerAt = (command: string, index: number, end: number): { readonly kind: QuoteKind; readonly width: number } | undefined => {
36
+ const pair = command.slice(index, Math.min(index + 2, end));
37
+ if (pair.startsWith("'") || pair.startsWith('"')) {
38
+ return { kind: pair.startsWith("'") ? "single" : "double", width: 1 };
39
+ }
40
+ return pair === "$'" ? { kind: "ansi", width: 2 } : pair === '$"' ? { kind: "double", width: 2 } : undefined;
41
+ };
42
+
43
+ // Where a quote closes, or -1 when it runs off the end; only a single quote can't escape its closer.
44
+ const closingQuote = (command: string, start: number, end: number, kind: QuoteKind): number => {
45
+ const quote = kind === "double" ? '"' : "'";
46
+ for (let index = start; index < end; index += 1) {
47
+ if (kind !== "single" && command[index] === "\\") {
48
+ index += 1;
49
+ } else if (command[index] === quote) {
50
+ return index;
51
+ }
52
+ }
53
+ return -1;
54
+ };
55
+
56
+ const ANSI_C_ESCAPE = /\\(?:x([0-9a-fA-F]{1,2})|u([0-9a-fA-F]{1,4})|U([0-9a-fA-F]{1,8})|([0-7]{1,3})|([\s\S]))/y;
57
+ const ANSI_C_NAMED = new Map([
58
+ ["a", "\x07"],
59
+ ["b", "\b"],
60
+ ["e", "\x1b"],
61
+ ["E", "\x1b"],
62
+ ["f", "\f"],
63
+ ["n", "\n"],
64
+ ["r", "\r"],
65
+ ["t", "\t"],
66
+ ["v", "\v"],
67
+ ]);
68
+
69
+ // One `$'…'` escape as bash expands it. One with no meaning (`\m`) keeps its backslash in bash and loses it here,
70
+ // which reads a little more, never less.
71
+ const ansiCharacter = (escape: RegExpExecArray): string => {
72
+ const [whole, hex, short, long, octal, named = ""] = escape;
73
+ const code = hex ?? short ?? long;
74
+ if (code !== undefined) {
75
+ const point = Number.parseInt(code, 16);
76
+ return point <= 0x10_ff_ff ? String.fromCodePoint(point) : whole;
77
+ }
78
+ return octal === undefined ? (ANSI_C_NAMED.get(named) ?? named) : String.fromCharCode(Number.parseInt(octal, 8) & 0xff);
79
+ };
80
+
81
+ // Inside double quotes a backslash only escapes these (a newline it removes); before anything else it is a character.
82
+ const DOUBLE_QUOTE_ESCAPES = new Set(["$", "`", '"', "\\", "\n"]);
83
+
84
+ // What a backslash at `index` stands for inside each kind of quote, and how many characters it took; undefined
85
+ // where it is only a backslash.
86
+ type EscapeReader = (command: string, index: number) => { readonly text: string; readonly width: number } | undefined;
87
+
88
+ const ESCAPES = {
89
+ single: () => undefined,
90
+ double: (command, index) => {
91
+ const next = command.charAt(index + 1);
92
+ return DOUBLE_QUOTE_ESCAPES.has(next) ? { text: next === "\n" ? "" : next, width: 2 } : undefined;
93
+ },
94
+ ansi: (command, index) => {
95
+ ANSI_C_ESCAPE.lastIndex = index;
96
+ const escape = ANSI_C_ESCAPE.exec(command);
97
+ return escape === null ? undefined : { text: ansiCharacter(escape), width: escape[0].length };
98
+ },
99
+ } satisfies Record<QuoteKind, EscapeReader>;
100
+
101
+ // A quote's inside as the shell hands it over. A closer is never escaped, so no escape here runs past `end`.
102
+ const quotedPiece = (command: string, start: number, end: number, kind: QuoteKind): Reading => {
103
+ const piece = reading();
104
+ let index = start;
105
+ while (index < end) {
106
+ const escape = command.charAt(index) === "\\" ? ESCAPES[kind](command, index) : undefined;
107
+ const width = escape?.width ?? 1;
108
+ emit(piece, escape?.text ?? command.charAt(index), index, index + width);
109
+ index += width;
110
+ }
111
+ return piece;
112
+ };
113
+
114
+ // `${IFS}` and `$IFS` (not `$IFSX`, another variable): the field separator, which splits words as a space does.
115
+ const ifsWidth = (command: string, index: number): number => {
116
+ if (command.startsWith("${IFS}", index)) {
117
+ return 6;
118
+ }
119
+ return command.startsWith("$IFS", index) && !/\w/.test(command.charAt(index + 4)) ? 4 : 0;
120
+ };
121
+
122
+ // The quote opening at `index`, read into `into`; where reading resumes, or undefined when nothing opens there or
123
+ // nothing closes it (an unterminated quote never runs: the shell waits for more).
124
+ const readQuote = (into: Reading, command: string, index: number, end: number): number | undefined => {
125
+ const opener = openerAt(command, index, end);
126
+ if (opener === undefined) {
127
+ return undefined;
128
+ }
129
+ const inside = index + opener.width;
130
+ const close = closingQuote(command, inside, end, opener.kind);
131
+ if (close === -1) {
132
+ return undefined;
133
+ }
134
+ const piece = quotedPiece(command, inside, close, opener.kind);
135
+ // `$'…'` exists to spell characters, so it is always read spelled out.
136
+ if (opener.kind === "ansi" || !/\s/.test(piece.text)) {
137
+ append(into, piece, index, close + 1);
138
+ return close + 1;
139
+ }
140
+ emit(into, command.slice(index, inside), index, inside);
141
+ readRange(into, command, inside, close);
142
+ emit(into, command.charAt(close), close, close + 1);
143
+ return close + 1;
144
+ };
145
+
146
+ // One escape, `$IFS`, quote or plain character at `index`; where the next one starts.
147
+ const readOne = (into: Reading, command: string, index: number, end: number): number => {
148
+ // A line continuation joins its two lines; any other escaped character is just itself.
149
+ if (command.charAt(index) === "\\" && index + 1 < end) {
150
+ const escaped = command.charAt(index + 1);
151
+ emit(into, escaped === "\n" ? "" : escaped, index, index + 2);
152
+ return index + 2;
153
+ }
154
+ const ifs = ifsWidth(command, index);
155
+ if (ifs > 0) {
156
+ emit(into, " ", index, index + ifs);
157
+ return index + ifs;
158
+ }
159
+ const quoted = readQuote(into, command, index, end);
160
+ if (quoted !== undefined) {
161
+ return quoted;
162
+ }
163
+ emit(into, command.charAt(index), index, index + 1);
164
+ return index + 1;
165
+ };
166
+
167
+ const readRange = (into: Reading, command: string, start: number, end: number): void => {
168
+ let index = start;
169
+ while (index < end) {
170
+ index = readOne(into, command, index, end);
171
+ }
172
+ };
173
+
174
+ // The unquoted copy, and the way back from a span over it to the slice of the command it was read from.
175
+ export interface NormalisedCommand {
176
+ readonly text: string;
177
+ readonly original: (span: CommandSpan) => CommandSpan;
178
+ }
179
+
180
+ // Undefined when there is no quoting to strip, so a caller has nothing more to read.
181
+ export const normaliseCommand = (command: string): NormalisedCommand | undefined => {
182
+ const copy = reading();
183
+ readRange(copy, command, 0, command.length);
184
+ if (copy.text === command) {
185
+ return undefined;
186
+ }
187
+ return {
188
+ text: copy.text,
189
+ original: (span) => {
190
+ const start = copy.sources[span.start]?.start ?? command.length;
191
+ return { start, end: span.end > span.start ? (copy.sources[span.end - 1]?.end ?? start) : start };
192
+ },
193
+ };
194
+ };
195
+
196
+ type Matcher = (text: string, context: CommandContext) => CommandSpan[];
197
+
198
+ // One matcher over both readings of a command, as written and unquoted, every span over the command's own offsets. The
199
+ // unquoting is done once, however many matchers ask, and the context's file check once per path, though both readings
200
+ // may name it.
201
+ export const readingsOf = (command: string, context: CommandContext): ((read: Matcher) => CommandSpan[]) => {
202
+ const unquoted = normaliseCommand(command);
203
+ const asked = new Map<string, boolean | undefined>();
204
+ const holdsSecret = (path: string): boolean | undefined => {
205
+ if (!asked.has(path)) {
206
+ asked.set(path, context.holdsSecret?.(path));
207
+ }
208
+ return asked.get(path);
209
+ };
210
+ const once: CommandContext = { ...context, holdsSecret };
211
+ return (read) => [...read(command, once), ...(unquoted === undefined ? [] : read(unquoted.text, once).map(unquoted.original))];
212
+ };
@@ -0,0 +1,11 @@
1
+ // The name of the folder a command run at the workspace root should step over, handed to it in its environment: every
2
+ // automation guard gets the reference shelf's (automations/watch/watch-condition.ts), and the maintenance extension's
3
+ // probes get it at the workspace root only, since inside one repository a `refs/` directory is ordinary project content.
4
+ // In the `chores` subpath until 2026-11-26, which re-exports it until extension API 3.0.0.
5
+ export const WORKSPACE_ROOT_EXCLUDE_ENV = `INTENTIC_WORKSPACE_ROOT_EXCLUDE`;
6
+
7
+ // Unquoted parameter expansion is intentional: when the variable is absent it contributes zero arguments;
8
+ // when present, each expression expands to one whitespace-free CLI argument. The daemon supplies the value
9
+ // from @intentic/workspace-ignore, never from user input.
10
+ export const WORKSPACE_ROOT_RG_EXCLUDE_ARG = `\${${WORKSPACE_ROOT_EXCLUDE_ENV}:+--glob=!/\${${WORKSPACE_ROOT_EXCLUDE_ENV}}/**}`;
11
+ export const WORKSPACE_ROOT_JSCPD_EXCLUDE_ARG = `\${${WORKSPACE_ROOT_EXCLUDE_ENV}:+--ignore=\${${WORKSPACE_ROOT_EXCLUDE_ENV}}/**}`;