@intentic/sandbox-contract 1.231.0 → 1.233.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 (500) hide show
  1. package/README.md +13 -2
  2. package/dist/agent-catalog.d.ts +2 -1
  3. package/dist/agent-catalog.d.ts.map +1 -1
  4. package/dist/agent-catalog.js +1 -1
  5. package/dist/agent-catalog.js.map +1 -1
  6. package/dist/chores/chores.d.ts +1 -1
  7. package/dist/chores/chores.d.ts.map +1 -1
  8. package/dist/chores/probes.d.ts +1 -1
  9. package/dist/chores/probes.d.ts.map +1 -1
  10. package/dist/chores/stack.d.ts.map +1 -1
  11. package/dist/chores/stack.js +2 -1
  12. package/dist/chores/stack.js.map +1 -1
  13. package/dist/chores/verdict.d.ts +1 -1
  14. package/dist/chores/verdict.d.ts.map +1 -1
  15. package/dist/command-classes.d.ts +14 -0
  16. package/dist/command-classes.d.ts.map +1 -0
  17. package/dist/command-classes.js +168 -0
  18. package/dist/command-classes.js.map +1 -0
  19. package/dist/contracts/activity.contract.js +1 -1
  20. package/dist/contracts/activity.contract.js.map +1 -1
  21. package/dist/contracts/agent.contract.d.ts +51 -2
  22. package/dist/contracts/agent.contract.d.ts.map +1 -1
  23. package/dist/contracts/agent.contract.js +13 -1
  24. package/dist/contracts/agent.contract.js.map +1 -1
  25. package/dist/contracts/agents.contract.d.ts +24 -0
  26. package/dist/contracts/agents.contract.d.ts.map +1 -1
  27. package/dist/contracts/agents.contract.js +5 -1
  28. package/dist/contracts/agents.contract.js.map +1 -1
  29. package/dist/contracts/automations.contract.js +2 -1
  30. package/dist/contracts/automations.contract.js.map +1 -1
  31. package/dist/contracts/capabilities.contract.d.ts +63 -0
  32. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  33. package/dist/contracts/capabilities.contract.js +3 -1
  34. package/dist/contracts/capabilities.contract.js.map +1 -1
  35. package/dist/contracts/chores.contract.d.ts.map +1 -1
  36. package/dist/contracts/chores.contract.js +2 -1
  37. package/dist/contracts/chores.contract.js.map +1 -1
  38. package/dist/contracts/ci.contract.js +2 -1
  39. package/dist/contracts/ci.contract.js.map +1 -1
  40. package/dist/contracts/claude.contract.js +2 -1
  41. package/dist/contracts/claude.contract.js.map +1 -1
  42. package/dist/contracts/cursor.contract.js +2 -1
  43. package/dist/contracts/cursor.contract.js.map +1 -1
  44. package/dist/contracts/drafts.contract.d.ts.map +1 -1
  45. package/dist/contracts/drafts.contract.js +2 -1
  46. package/dist/contracts/drafts.contract.js.map +1 -1
  47. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  48. package/dist/contracts/endpoints.contract.js +2 -1
  49. package/dist/contracts/endpoints.contract.js.map +1 -1
  50. package/dist/contracts/exit.contract.d.ts.map +1 -1
  51. package/dist/contracts/exit.contract.js +2 -1
  52. package/dist/contracts/exit.contract.js.map +1 -1
  53. package/dist/contracts/extensions.contract.d.ts +42 -0
  54. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  55. package/dist/contracts/extensions.contract.js +4 -1
  56. package/dist/contracts/extensions.contract.js.map +1 -1
  57. package/dist/contracts/git.contract.d.ts.map +1 -1
  58. package/dist/contracts/git.contract.js +4 -1
  59. package/dist/contracts/git.contract.js.map +1 -1
  60. package/dist/contracts/grok.contract.d.ts.map +1 -1
  61. package/dist/contracts/grok.contract.js +2 -1
  62. package/dist/contracts/grok.contract.js.map +1 -1
  63. package/dist/contracts/history.contract.d.ts.map +1 -1
  64. package/dist/contracts/history.contract.js +2 -1
  65. package/dist/contracts/history.contract.js.map +1 -1
  66. package/dist/contracts/host.contract.d.ts +11 -0
  67. package/dist/contracts/host.contract.d.ts.map +1 -1
  68. package/dist/contracts/host.contract.js +4 -1
  69. package/dist/contracts/host.contract.js.map +1 -1
  70. package/dist/contracts/intentic.contract.d.ts.map +1 -1
  71. package/dist/contracts/intentic.contract.js +2 -1
  72. package/dist/contracts/intentic.contract.js.map +1 -1
  73. package/dist/contracts/inventory.contract.js +1 -1
  74. package/dist/contracts/inventory.contract.js.map +1 -1
  75. package/dist/contracts/logs.contract.d.ts.map +1 -1
  76. package/dist/contracts/logs.contract.js +1 -1
  77. package/dist/contracts/logs.contract.js.map +1 -1
  78. package/dist/contracts/loops.contract.js +2 -1
  79. package/dist/contracts/loops.contract.js.map +1 -1
  80. package/dist/contracts/panels.contract.d.ts.map +1 -1
  81. package/dist/contracts/panels.contract.js +2 -1
  82. package/dist/contracts/panels.contract.js.map +1 -1
  83. package/dist/contracts/personas.contract.js +2 -1
  84. package/dist/contracts/personas.contract.js.map +1 -1
  85. package/dist/contracts/ports.contract.d.ts.map +1 -1
  86. package/dist/contracts/ports.contract.js +2 -1
  87. package/dist/contracts/ports.contract.js.map +1 -1
  88. package/dist/contracts/prepush.contract.d.ts.map +1 -1
  89. package/dist/contracts/prepush.contract.js +2 -1
  90. package/dist/contracts/prepush.contract.js.map +1 -1
  91. package/dist/contracts/providers.contract.d.ts.map +1 -1
  92. package/dist/contracts/providers.contract.js +2 -1
  93. package/dist/contracts/providers.contract.js.map +1 -1
  94. package/dist/contracts/public.contract.d.ts.map +1 -1
  95. package/dist/contracts/public.contract.js +2 -1
  96. package/dist/contracts/public.contract.js.map +1 -1
  97. package/dist/contracts/push.contract.d.ts.map +1 -1
  98. package/dist/contracts/push.contract.js +2 -1
  99. package/dist/contracts/push.contract.js.map +1 -1
  100. package/dist/contracts/runner.contract.d.ts +151 -43
  101. package/dist/contracts/runner.contract.d.ts.map +1 -1
  102. package/dist/contracts/runner.contract.js +14 -1
  103. package/dist/contracts/runner.contract.js.map +1 -1
  104. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  105. package/dist/contracts/secrets.contract.js +2 -1
  106. package/dist/contracts/secrets.contract.js.map +1 -1
  107. package/dist/contracts/sessions.contract.js +1 -1
  108. package/dist/contracts/sessions.contract.js.map +1 -1
  109. package/dist/contracts/settings.contract.d.ts +20 -0
  110. package/dist/contracts/settings.contract.d.ts.map +1 -1
  111. package/dist/contracts/settings.contract.js +3 -1
  112. package/dist/contracts/settings.contract.js.map +1 -1
  113. package/dist/contracts/share.contract.d.ts.map +1 -1
  114. package/dist/contracts/share.contract.js +2 -1
  115. package/dist/contracts/share.contract.js.map +1 -1
  116. package/dist/contracts/skills.contract.d.ts.map +1 -1
  117. package/dist/contracts/skills.contract.js +2 -1
  118. package/dist/contracts/skills.contract.js.map +1 -1
  119. package/dist/contracts/system.contract.d.ts +35 -16
  120. package/dist/contracts/system.contract.d.ts.map +1 -1
  121. package/dist/contracts/system.contract.js +6 -1
  122. package/dist/contracts/system.contract.js.map +1 -1
  123. package/dist/contracts/translator.contract.d.ts.map +1 -1
  124. package/dist/contracts/translator.contract.js +4 -1
  125. package/dist/contracts/translator.contract.js.map +1 -1
  126. package/dist/contracts/usage.contract.js +1 -1
  127. package/dist/contracts/usage.contract.js.map +1 -1
  128. package/dist/contracts/vpn.contract.d.ts.map +1 -1
  129. package/dist/contracts/vpn.contract.js +2 -1
  130. package/dist/contracts/vpn.contract.js.map +1 -1
  131. package/dist/contracts/webext.contract.d.ts +45 -0
  132. package/dist/contracts/webext.contract.d.ts.map +1 -0
  133. package/dist/contracts/webext.contract.js +12 -0
  134. package/dist/contracts/webext.contract.js.map +1 -0
  135. package/dist/contracts/workflows.contract.js +2 -1
  136. package/dist/contracts/workflows.contract.js.map +1 -1
  137. package/dist/contracts/workspace.contract.d.ts +2 -2
  138. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  139. package/dist/contracts/workspace.contract.js +7 -1
  140. package/dist/contracts/workspace.contract.js.map +1 -1
  141. package/dist/definition-action.d.ts +7 -0
  142. package/dist/definition-action.d.ts.map +1 -0
  143. package/dist/definition-action.js +3 -0
  144. package/dist/definition-action.js.map +1 -0
  145. package/dist/definition.d.ts +1064 -0
  146. package/dist/definition.d.ts.map +1 -0
  147. package/dist/definition.js +93 -0
  148. package/dist/definition.js.map +1 -0
  149. package/dist/events.d.ts +109 -0
  150. package/dist/events.d.ts.map +1 -1
  151. package/dist/events.js +30 -1
  152. package/dist/events.js.map +1 -1
  153. package/dist/fast-tier.d.ts +1 -1
  154. package/dist/fast-tier.d.ts.map +1 -1
  155. package/dist/history-state.d.ts.map +1 -1
  156. package/dist/history-state.js +1 -0
  157. package/dist/history-state.js.map +1 -1
  158. package/dist/index.d.ts +371 -103
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +52 -1
  161. package/dist/index.js.map +1 -1
  162. package/dist/listener-protocol.js +1 -1
  163. package/dist/listener-protocol.js.map +1 -1
  164. package/dist/quick-model.d.ts +1 -1
  165. package/dist/quick-model.d.ts.map +1 -1
  166. package/dist/runner-protocol.d.ts +18 -0
  167. package/dist/runner-protocol.d.ts.map +1 -1
  168. package/dist/runner-protocol.js +8 -4
  169. package/dist/runner-protocol.js.map +1 -1
  170. package/dist/schemas/activity.d.ts +112 -0
  171. package/dist/schemas/activity.d.ts.map +1 -0
  172. package/dist/schemas/activity.js +70 -0
  173. package/dist/schemas/activity.js.map +1 -0
  174. package/dist/schemas/agent.d.ts +189 -0
  175. package/dist/schemas/agent.d.ts.map +1 -0
  176. package/dist/schemas/agent.js +170 -0
  177. package/dist/schemas/agent.js.map +1 -0
  178. package/dist/schemas/agents.d.ts +690 -0
  179. package/dist/schemas/agents.d.ts.map +1 -0
  180. package/dist/schemas/agents.js +314 -0
  181. package/dist/schemas/agents.js.map +1 -0
  182. package/dist/schemas/automations.d.ts +736 -0
  183. package/dist/schemas/automations.d.ts.map +1 -0
  184. package/dist/schemas/automations.js +218 -0
  185. package/dist/schemas/automations.js.map +1 -0
  186. package/dist/schemas/capabilities.d.ts +753 -0
  187. package/dist/schemas/capabilities.d.ts.map +1 -0
  188. package/dist/schemas/capabilities.js +269 -0
  189. package/dist/schemas/capabilities.js.map +1 -0
  190. package/dist/schemas/ci.d.ts +179 -0
  191. package/dist/schemas/ci.d.ts.map +1 -0
  192. package/dist/schemas/ci.js +99 -0
  193. package/dist/schemas/ci.js.map +1 -0
  194. package/dist/schemas/claude-gate.d.ts +13 -0
  195. package/dist/schemas/claude-gate.d.ts.map +1 -0
  196. package/dist/schemas/claude-gate.js +8 -0
  197. package/dist/schemas/claude-gate.js.map +1 -0
  198. package/dist/schemas/codebase-health.d.ts +56 -0
  199. package/dist/schemas/codebase-health.d.ts.map +1 -0
  200. package/dist/schemas/codebase-health.js +43 -0
  201. package/dist/schemas/codebase-health.js.map +1 -0
  202. package/dist/schemas/computers.d.ts +386 -0
  203. package/dist/schemas/computers.d.ts.map +1 -0
  204. package/dist/schemas/computers.js +107 -0
  205. package/dist/schemas/computers.js.map +1 -0
  206. package/dist/schemas/drafts.d.ts +84 -0
  207. package/dist/schemas/drafts.d.ts.map +1 -0
  208. package/dist/schemas/drafts.js +44 -0
  209. package/dist/schemas/drafts.js.map +1 -0
  210. package/dist/schemas/environment.d.ts +349 -0
  211. package/dist/schemas/environment.d.ts.map +1 -0
  212. package/dist/schemas/environment.js +111 -0
  213. package/dist/schemas/environment.js.map +1 -0
  214. package/dist/schemas/exit.d.ts +151 -0
  215. package/dist/schemas/exit.d.ts.map +1 -0
  216. package/dist/schemas/exit.js +115 -0
  217. package/dist/schemas/exit.js.map +1 -0
  218. package/dist/schemas/extension-updates.d.ts +1014 -0
  219. package/dist/schemas/extension-updates.d.ts.map +1 -0
  220. package/dist/schemas/extension-updates.js +197 -0
  221. package/dist/schemas/extension-updates.js.map +1 -0
  222. package/dist/schemas/fast-mode.d.ts +8 -0
  223. package/dist/schemas/fast-mode.d.ts.map +1 -0
  224. package/dist/schemas/fast-mode.js +3 -0
  225. package/dist/schemas/fast-mode.js.map +1 -0
  226. package/dist/schemas/git-history.d.ts +238 -0
  227. package/dist/schemas/git-history.d.ts.map +1 -0
  228. package/dist/schemas/git-history.js +152 -0
  229. package/dist/schemas/git-history.js.map +1 -0
  230. package/dist/schemas/git.d.ts +471 -0
  231. package/dist/schemas/git.d.ts.map +1 -0
  232. package/dist/schemas/git.js +204 -0
  233. package/dist/schemas/git.js.map +1 -0
  234. package/dist/schemas/history.d.ts +100 -0
  235. package/dist/schemas/history.d.ts.map +1 -0
  236. package/dist/schemas/history.js +54 -0
  237. package/dist/schemas/history.js.map +1 -0
  238. package/dist/schemas/hosts.d.ts +41 -0
  239. package/dist/schemas/hosts.d.ts.map +1 -0
  240. package/dist/schemas/hosts.js +18 -0
  241. package/dist/schemas/hosts.js.map +1 -0
  242. package/dist/schemas/intentic.d.ts +5 -0
  243. package/dist/schemas/intentic.d.ts.map +1 -0
  244. package/dist/schemas/intentic.js +3 -0
  245. package/dist/schemas/intentic.js.map +1 -0
  246. package/dist/schemas/internal.d.ts +8 -0
  247. package/dist/schemas/internal.d.ts.map +1 -0
  248. package/dist/schemas/internal.js +12 -0
  249. package/dist/schemas/internal.js.map +1 -0
  250. package/dist/schemas/inventory.d.ts +171 -0
  251. package/dist/schemas/inventory.d.ts.map +1 -0
  252. package/dist/schemas/inventory.js +51 -0
  253. package/dist/schemas/inventory.js.map +1 -0
  254. package/dist/schemas/logs.d.ts +67 -0
  255. package/dist/schemas/logs.d.ts.map +1 -0
  256. package/dist/schemas/logs.js +54 -0
  257. package/dist/schemas/logs.js.map +1 -0
  258. package/dist/schemas/loops.d.ts +415 -0
  259. package/dist/schemas/loops.d.ts.map +1 -0
  260. package/dist/schemas/loops.js +188 -0
  261. package/dist/schemas/loops.js.map +1 -0
  262. package/dist/schemas/maintenance.d.ts +557 -0
  263. package/dist/schemas/maintenance.d.ts.map +1 -0
  264. package/dist/schemas/maintenance.js +201 -0
  265. package/dist/schemas/maintenance.js.map +1 -0
  266. package/dist/schemas/marketplace.d.ts +64 -0
  267. package/dist/schemas/marketplace.d.ts.map +1 -0
  268. package/dist/schemas/marketplace.js +17 -0
  269. package/dist/schemas/marketplace.js.map +1 -0
  270. package/dist/schemas/panels.d.ts +61 -0
  271. package/dist/schemas/panels.d.ts.map +1 -0
  272. package/dist/schemas/panels.js +51 -0
  273. package/dist/schemas/panels.js.map +1 -0
  274. package/dist/schemas/personas.d.ts +122 -0
  275. package/dist/schemas/personas.d.ts.map +1 -0
  276. package/dist/schemas/personas.js +102 -0
  277. package/dist/schemas/personas.js.map +1 -0
  278. package/dist/schemas/plan-limits.d.ts +172 -0
  279. package/dist/schemas/plan-limits.d.ts.map +1 -0
  280. package/dist/schemas/plan-limits.js +126 -0
  281. package/dist/schemas/plan-limits.js.map +1 -0
  282. package/dist/schemas/ports.d.ts +71 -0
  283. package/dist/schemas/ports.d.ts.map +1 -0
  284. package/dist/schemas/ports.js +42 -0
  285. package/dist/schemas/ports.js.map +1 -0
  286. package/dist/schemas/provider-oauth.d.ts +128 -0
  287. package/dist/schemas/provider-oauth.d.ts.map +1 -0
  288. package/dist/schemas/provider-oauth.js +91 -0
  289. package/dist/schemas/provider-oauth.js.map +1 -0
  290. package/dist/schemas/provider-subscriptions.d.ts +9 -0
  291. package/dist/schemas/provider-subscriptions.d.ts.map +1 -0
  292. package/dist/schemas/provider-subscriptions.js +3 -0
  293. package/dist/schemas/provider-subscriptions.js.map +1 -0
  294. package/dist/schemas/public.d.ts +32 -0
  295. package/dist/schemas/public.d.ts.map +1 -0
  296. package/dist/schemas/public.js +29 -0
  297. package/dist/schemas/public.js.map +1 -0
  298. package/dist/schemas/push.d.ts +55 -0
  299. package/dist/schemas/push.d.ts.map +1 -0
  300. package/dist/schemas/push.js +60 -0
  301. package/dist/schemas/push.js.map +1 -0
  302. package/dist/schemas/secrets.d.ts +86 -0
  303. package/dist/schemas/secrets.d.ts.map +1 -0
  304. package/dist/schemas/secrets.js +51 -0
  305. package/dist/schemas/secrets.js.map +1 -0
  306. package/dist/schemas/sessions.d.ts +32 -0
  307. package/dist/schemas/sessions.d.ts.map +1 -0
  308. package/dist/schemas/sessions.js +11 -0
  309. package/dist/schemas/sessions.js.map +1 -0
  310. package/dist/schemas/settings.d.ts +548 -0
  311. package/dist/schemas/settings.d.ts.map +1 -0
  312. package/dist/schemas/settings.js +259 -0
  313. package/dist/schemas/settings.js.map +1 -0
  314. package/dist/schemas/share.d.ts +49 -0
  315. package/dist/schemas/share.d.ts.map +1 -0
  316. package/dist/schemas/share.js +26 -0
  317. package/dist/schemas/share.js.map +1 -0
  318. package/dist/schemas/shared.d.ts +22 -0
  319. package/dist/schemas/shared.d.ts.map +1 -0
  320. package/dist/schemas/shared.js +16 -0
  321. package/dist/schemas/shared.js.map +1 -0
  322. package/dist/schemas/system.d.ts +86 -0
  323. package/dist/schemas/system.d.ts.map +1 -0
  324. package/dist/schemas/system.js +64 -0
  325. package/dist/schemas/system.js.map +1 -0
  326. package/dist/schemas/terminal.d.ts +230 -0
  327. package/dist/schemas/terminal.d.ts.map +1 -0
  328. package/dist/schemas/terminal.js +133 -0
  329. package/dist/schemas/terminal.js.map +1 -0
  330. package/dist/schemas/usage.d.ts +113 -0
  331. package/dist/schemas/usage.d.ts.map +1 -0
  332. package/dist/schemas/usage.js +91 -0
  333. package/dist/schemas/usage.js.map +1 -0
  334. package/dist/schemas/vpn.d.ts +229 -0
  335. package/dist/schemas/vpn.d.ts.map +1 -0
  336. package/dist/schemas/vpn.js +115 -0
  337. package/dist/schemas/vpn.js.map +1 -0
  338. package/dist/schemas/webext.d.ts +98 -0
  339. package/dist/schemas/webext.d.ts.map +1 -0
  340. package/dist/schemas/webext.js +36 -0
  341. package/dist/schemas/webext.js.map +1 -0
  342. package/dist/schemas/workflows.d.ts +881 -0
  343. package/dist/schemas/workflows.d.ts.map +1 -0
  344. package/dist/schemas/workflows.js +164 -0
  345. package/dist/schemas/workflows.js.map +1 -0
  346. package/dist/schemas/workspace-repos.d.ts +143 -0
  347. package/dist/schemas/workspace-repos.d.ts.map +1 -0
  348. package/dist/schemas/workspace-repos.js +87 -0
  349. package/dist/schemas/workspace-repos.js.map +1 -0
  350. package/dist/schemas/workspace-search.d.ts +170 -0
  351. package/dist/schemas/workspace-search.d.ts.map +1 -0
  352. package/dist/schemas/workspace-search.js +85 -0
  353. package/dist/schemas/workspace-search.js.map +1 -0
  354. package/dist/schemas/workspace-setup.d.ts +48 -0
  355. package/dist/schemas/workspace-setup.d.ts.map +1 -0
  356. package/dist/schemas/workspace-setup.js +26 -0
  357. package/dist/schemas/workspace-setup.js.map +1 -0
  358. package/dist/schemas/workspace-tree.d.ts +120 -0
  359. package/dist/schemas/workspace-tree.d.ts.map +1 -0
  360. package/dist/schemas/workspace-tree.js +111 -0
  361. package/dist/schemas/workspace-tree.js.map +1 -0
  362. package/dist/webext-links.d.ts +13 -0
  363. package/dist/webext-links.d.ts.map +1 -0
  364. package/dist/webext-links.js +24 -0
  365. package/dist/webext-links.js.map +1 -0
  366. package/dist/webext-protocol.d.ts +8 -0
  367. package/dist/webext-protocol.d.ts.map +1 -0
  368. package/dist/webext-protocol.js +7 -0
  369. package/dist/webext-protocol.js.map +1 -0
  370. package/dist/workflow-faults.d.ts +1 -1
  371. package/dist/workflow-faults.d.ts.map +1 -1
  372. package/dist/workspace-state.d.ts +11 -2
  373. package/dist/workspace-state.d.ts.map +1 -1
  374. package/dist/workspace-state.js +4 -2
  375. package/dist/workspace-state.js.map +1 -1
  376. package/package.json +17 -6
  377. package/src/agent-catalog.test.ts +1 -1
  378. package/src/agent-catalog.ts +4 -11
  379. package/src/chores/chores.ts +1 -1
  380. package/src/chores/probes.ts +1 -1
  381. package/src/chores/stack.test.ts +19 -0
  382. package/src/chores/stack.ts +19 -3
  383. package/src/chores/verdict.test.ts +11 -1
  384. package/src/chores/verdict.ts +1 -1
  385. package/src/command-classes.test.ts +378 -0
  386. package/src/command-classes.ts +378 -0
  387. package/src/contracts/activity.contract.ts +1 -1
  388. package/src/contracts/agent.contract.ts +22 -12
  389. package/src/contracts/agents.contract.ts +6 -6
  390. package/src/contracts/automations.contract.ts +2 -2
  391. package/src/contracts/capabilities.contract.ts +3 -4
  392. package/src/contracts/chores.contract.ts +2 -1
  393. package/src/contracts/ci.contract.ts +2 -2
  394. package/src/contracts/claude.contract.ts +2 -2
  395. package/src/contracts/cursor.contract.ts +2 -2
  396. package/src/contracts/drafts.contract.ts +2 -1
  397. package/src/contracts/endpoints.contract.ts +2 -1
  398. package/src/contracts/exit.contract.ts +2 -1
  399. package/src/contracts/extensions.contract.ts +5 -5
  400. package/src/contracts/git.contract.ts +19 -18
  401. package/src/contracts/grok.contract.ts +2 -1
  402. package/src/contracts/history.contract.ts +2 -1
  403. package/src/contracts/host.contract.ts +4 -1
  404. package/src/contracts/intentic.contract.ts +2 -1
  405. package/src/contracts/inventory.contract.ts +1 -1
  406. package/src/contracts/logs.contract.ts +7 -1
  407. package/src/contracts/loops.contract.ts +2 -2
  408. package/src/contracts/panels.contract.ts +2 -1
  409. package/src/contracts/personas.contract.ts +3 -3
  410. package/src/contracts/ports.contract.ts +3 -2
  411. package/src/contracts/prepush.contract.ts +2 -1
  412. package/src/contracts/providers.contract.ts +2 -1
  413. package/src/contracts/public.contract.ts +3 -2
  414. package/src/contracts/push.contract.ts +2 -1
  415. package/src/contracts/runner.contract.ts +33 -1
  416. package/src/contracts/secrets.contract.ts +2 -1
  417. package/src/contracts/sessions.contract.ts +1 -1
  418. package/src/contracts/settings.contract.ts +3 -9
  419. package/src/contracts/share.contract.ts +3 -2
  420. package/src/contracts/skills.contract.ts +2 -1
  421. package/src/contracts/system.contract.ts +6 -9
  422. package/src/contracts/translator.contract.ts +4 -1
  423. package/src/contracts/usage.contract.ts +1 -1
  424. package/src/contracts/vpn.contract.ts +2 -8
  425. package/src/contracts/webext.contract.ts +37 -0
  426. package/src/contracts/workflows.contract.ts +2 -2
  427. package/src/contracts/workspace.contract.ts +10 -12
  428. package/src/conversation-ids.test.ts +1 -1
  429. package/src/definition-action.ts +8 -0
  430. package/src/definition.ts +235 -0
  431. package/src/events.ts +128 -22
  432. package/src/fast-tier.ts +1 -1
  433. package/src/history-state.ts +5 -0
  434. package/src/host-protocol.ts +1 -1
  435. package/src/hostnames.test.ts +2 -2
  436. package/src/index.ts +61 -1
  437. package/src/listener-protocol.ts +1 -1
  438. package/src/quick-model.ts +1 -1
  439. package/src/runner-protocol.ts +35 -5
  440. package/src/schemas/activity.ts +123 -0
  441. package/src/schemas/agent.ts +409 -0
  442. package/src/schemas/agents.ts +802 -0
  443. package/src/schemas/automations.ts +510 -0
  444. package/src/schemas/capabilities.ts +729 -0
  445. package/src/schemas/ci.ts +235 -0
  446. package/src/schemas/claude-gate.ts +13 -0
  447. package/src/schemas/codebase-health.ts +64 -0
  448. package/src/schemas/computers.ts +287 -0
  449. package/src/schemas/drafts.ts +108 -0
  450. package/src/schemas/environment.ts +276 -0
  451. package/src/schemas/exit.ts +222 -0
  452. package/src/schemas/extension-updates.ts +322 -0
  453. package/src/schemas/fast-mode.ts +8 -0
  454. package/src/schemas/git-history.ts +265 -0
  455. package/src/schemas/git.ts +430 -0
  456. package/src/schemas/history.ts +112 -0
  457. package/src/schemas/hosts.ts +37 -0
  458. package/src/schemas/intentic.ts +2 -0
  459. package/src/schemas/internal.ts +17 -0
  460. package/src/schemas/inventory.ts +68 -0
  461. package/src/schemas/logs.ts +96 -0
  462. package/src/schemas/loops.ts +401 -0
  463. package/src/schemas/maintenance.ts +421 -0
  464. package/src/schemas/marketplace.ts +23 -0
  465. package/src/schemas/panels.ts +99 -0
  466. package/src/schemas/personas.ts +281 -0
  467. package/src/schemas/plan-limits.ts +255 -0
  468. package/src/schemas/ports.ts +84 -0
  469. package/src/schemas/provider-oauth.ts +191 -0
  470. package/src/schemas/provider-subscriptions.ts +11 -0
  471. package/src/schemas/public.ts +52 -0
  472. package/src/schemas/push.ts +112 -0
  473. package/src/schemas/secrets.ts +68 -0
  474. package/src/schemas/sessions.ts +16 -0
  475. package/src/schemas/settings.ts +932 -0
  476. package/src/schemas/share.ts +71 -0
  477. package/src/schemas/shared.ts +32 -0
  478. package/src/schemas/system.ts +156 -0
  479. package/src/schemas/terminal.ts +286 -0
  480. package/src/schemas/usage.ts +303 -0
  481. package/src/{schemas.test.ts → schemas/version-seam.test.ts} +4 -2
  482. package/src/schemas/vpn.ts +215 -0
  483. package/src/schemas/webext.ts +79 -0
  484. package/src/schemas/workflows.ts +413 -0
  485. package/src/schemas/workspace-repos.ts +123 -0
  486. package/src/schemas/workspace-search.ts +141 -0
  487. package/src/schemas/workspace-setup.ts +43 -0
  488. package/src/schemas/workspace-tree.ts +234 -0
  489. package/src/title.test.ts +1 -1
  490. package/src/webext-links.ts +80 -0
  491. package/src/webext-protocol.ts +27 -0
  492. package/src/workflow-faults.test.ts +1 -1
  493. package/src/workflow-faults.ts +1 -1
  494. package/src/workspace-state.test.ts +7 -3
  495. package/src/workspace-state.ts +27 -13
  496. package/dist/schemas.d.ts +0 -9800
  497. package/dist/schemas.d.ts.map +0 -1
  498. package/dist/schemas.js +0 -4252
  499. package/dist/schemas.js.map +0 -1
  500. package/src/schemas.ts +0 -9999
@@ -0,0 +1,235 @@
1
+ import { z } from "zod";
2
+ import { DefinitionActionSchema } from "./definition-action.js";
3
+ import { CapabilitySchema } from "./schemas/capabilities.js";
4
+ import { SandboxSettingsSchema } from "./schemas/settings.js";
5
+
6
+ /* THE SANDBOX DEFINITION: the declarable SHAPE of a sandbox, split off from its state.
7
+ *
8
+ * A bundle (BundleSchema, schemas/maintenance.ts) moves everything a sandbox holds; this is the half of it that
9
+ * is a REFERENCE to a source of truth rather than bytes only this sandbox has: which repos (as remotes a
10
+ * target can clone), which connections (as shapes a target re-authenticates), which overlay steps (as source
11
+ * a target's owner approves), which secrets (as NAMES a target asks for), which agent settings. Everything
12
+ * here can be reproduced against the world; everything a bundle carries beyond it (transcripts, checkpoint
13
+ * timelines, unpushed branches, ledgers) cannot, which is the line between the two formats.
14
+ *
15
+ * ON THE WIRE AND ON DISK IT IS TOML (`sandbox.toml`), hand-writable and diffable; these schemas are what the
16
+ * parsed document must satisfy. The choice of a definition never relaxes the consent model: applying one
17
+ * writes the overlay as a PROPOSAL for the owner's approval gate, lands capabilities unauthenticated, and
18
+ * never carries a credential value, so a definition is safe to publish in a way a bundle never is.
19
+ */
20
+
21
+ // One repository, by reference: the id it lands under in the workspace, where a target clones it from, and
22
+ // (optionally) the branch to check out. A repo with NO remote cannot appear here, the exporter reports it as
23
+ // omitted instead of inventing a source for bytes only the source sandbox holds.
24
+ export const DefinitionRepositorySchema = z.strictObject({
25
+ // Workspace-relative repo id ("intentic", "clients/foo"), the same id the wire {repo} routes use.
26
+ id: z.string().min(1),
27
+ // The clone URL, verbatim from the source repo's own remote.
28
+ remote: z.string().min(1),
29
+ // The branch to check out; absent means the remote's default.
30
+ ref: z.string().optional(),
31
+ });
32
+ export type DefinitionRepository = z.infer<typeof DefinitionRepositorySchema>;
33
+
34
+ /* THE WORKSPACE ITSELF, by reference. `/work` is a git repo of its own (the daemon's `root` scope, git dir on
35
+ * /history), tracking every workspace file that is not a nested repo, the reference shelf, or daemon-internal
36
+ * state — which by the versioned-state allowlist means the owner's AUTHORED content: notes, skills, personas,
37
+ * automations, workflow and loop designs, drafts, workspace extensions. None of that has a source anywhere else,
38
+ * so before this section a definition could only shrug at it and a bundle was the sole way to move it.
39
+ *
40
+ * With a remote it becomes referenceable like any other repo, which is the whole point: `[workspace]` plus
41
+ * `[[repositories]]` is a sandbox's code AND its way of working, and what remains bundle-only is exactly what
42
+ * cannot be pushed anywhere — secrets, identity, /history, the built image.
43
+ *
44
+ * A workspace with no remote cannot appear here; the exporter says so in `omitted` rather than inventing one. */
45
+ export const DefinitionWorkspaceSchema = z.strictObject({
46
+ // The clone URL, verbatim from the workspace repo's own remote.
47
+ remote: z.string().min(1),
48
+ // The branch to check out; absent means the remote's default.
49
+ ref: z.string().optional(),
50
+ });
51
+ export type DefinitionWorkspace = z.infer<typeof DefinitionWorkspaceSchema>;
52
+
53
+ export const DefinitionEnvironmentSchema = z.strictObject({
54
+ // The image the overlay extends, informational: the target composes against ITS OWN base (see
55
+ // composeEnvironment's baseImageOf), this records what the source was on.
56
+ baseImage: z.string().optional(),
57
+ /* The owner-approved CUSTOM overlay section, as source. Deliberately not the composed file and
58
+ * deliberately without the approval hash: consent does not travel, so an applied definition parks this at
59
+ * the target owner's approval gate rather than executing it. */
60
+ dockerfile: z.string().optional(),
61
+ });
62
+ export type DefinitionEnvironment = z.infer<typeof DefinitionEnvironmentSchema>;
63
+
64
+ /* The settings section: every SandboxSettings field, optional, WITHOUT its default. `.partial()` alone keeps
65
+ * each field's `.default()`, so a document naming two flags would parse into the whole surface at today's
66
+ * defaults — the opposite of "state only decisions", and it would freeze those defaults into every future
67
+ * apply. Unwrapping first is what makes an absent key STAY absent, so applying merges over the target's own
68
+ * settings and a definition round-trips through parse byte-identically. */
69
+ // Both wrapper classes, in a loop: a field can be a default inside a prefault, and either one left on would
70
+ // re-materialize its value for an absent key.
71
+ const bareField = (field: z.ZodType): z.ZodType => {
72
+ let inner = field;
73
+ while (inner instanceof z.ZodDefault || inner instanceof z.ZodPrefault) {
74
+ inner = inner.unwrap() as z.ZodType;
75
+ }
76
+ return inner;
77
+ };
78
+
79
+ const definitionSettings = (): z.ZodType<Partial<z.infer<typeof SandboxSettingsSchema>>> => {
80
+ const shape = Object.fromEntries(Object.entries(SandboxSettingsSchema.shape).map(([key, field]) => [key, bareField(field).optional()]));
81
+ return z.strictObject(shape).prefault({}) as unknown as z.ZodType<Partial<z.infer<typeof SandboxSettingsSchema>>>;
82
+ };
83
+
84
+ export const SandboxDefinitionSchema = z.strictObject({
85
+ // Bumped when the layout changes in a way an older daemon would misread. Refused rather than guessed at,
86
+ // the bundle manifest's own rule.
87
+ schemaVersion: z.literal(1),
88
+ // What the source sandbox was called, for the reader; never used to authorize anything.
89
+ name: z.string().optional(),
90
+ environment: DefinitionEnvironmentSchema.prefault({}),
91
+ // The workspace repo itself, when it has a remote to be named by. Absent is the ordinary state of a
92
+ // workspace nobody has published, not an error.
93
+ workspace: DefinitionWorkspaceSchema.optional(),
94
+ repositories: z.array(DefinitionRepositorySchema).prefault([]),
95
+ /* Each connection IN FULL (id, kind, config), not merely named: the manifest they come from carries the
96
+ * SHAPE of a connection and never its credential (workspace-state.ts argues the split on the
97
+ * capabilities.json entry, and the exporter sweeps before reading), so what lands on a target is the card,
98
+ * visibly unauthenticated, waiting for one credential apiece. */
99
+ capabilities: z.array(CapabilitySchema).prefault([]),
100
+ // Secret NAMES only, what the target should ask its owner for. Values never enter a definition.
101
+ secrets: z.array(z.string()).prefault([]),
102
+ // The agent settings that differ from their defaults. Partial on purpose: a definition states decisions,
103
+ // not the whole flag surface, so a flag it does not mention keeps the target's own default.
104
+ settings: definitionSettings(),
105
+ });
106
+ export type SandboxDefinition = z.infer<typeof SandboxDefinitionSchema>;
107
+
108
+ // One "do this by hand" line, the same honesty unit ImportReportSchema carries: a subject the UI bolds and a
109
+ // detail written as an instruction to the owner. Defined in its own leaf module (definition-action.ts says
110
+ // why) and re-exported here, where every consumer of the definition surface finds it.
111
+ export { DefinitionActionSchema, type DefinitionAction } from "./definition-action.js";
112
+
113
+ // What GET /definition answers: the emitted TOML, plus what the derivation could not express (a repo with no
114
+ // remote), listed rather than silent, the export's own `excluded` discipline.
115
+ export const DefinitionExportSchema = z.object({
116
+ toml: z.string(),
117
+ omitted: z.array(DefinitionActionSchema),
118
+ });
119
+ export type DefinitionExport = z.infer<typeof DefinitionExportSchema>;
120
+
121
+ // One appliable piece of a held definition, the checklist row the owner ticks. Mirrors MigrationItemSchema's
122
+ // role; the ids are deterministic ("repo:intentic", "capability:github") so the re-derived apply names the
123
+ // same items the owner reviewed.
124
+ export const DefinitionItemSchema = z.object({
125
+ id: z.string(),
126
+ kind: z.enum(["workspace", "repo", "capability", "environment", "settings"]),
127
+ label: z.string(),
128
+ detail: z.string().optional(),
129
+ /* False when the target already holds this piece (the repo's directory exists, a capability with that id
130
+ * exists): a definition lands BESIDE what is there, never over it, so an inapplicable item renders greyed
131
+ * with its reason rather than disappearing. */
132
+ applicable: z.boolean(),
133
+ reason: z.string().optional(),
134
+ });
135
+ export type DefinitionItem = z.infer<typeof DefinitionItemSchema>;
136
+
137
+ export const DefinitionPlanSchema = z.object({
138
+ // Names the held definition for the apply call. Minted per plan; a new plan replaces the held one.
139
+ token: z.string(),
140
+ name: z.string().optional(),
141
+ items: z.array(DefinitionItemSchema),
142
+ // What is already known not to move mechanically (credentials to enter, an overlay to approve), surfaced
143
+ // at PREVIEW time so the owner ticks with open eyes, the migration surface's rule.
144
+ needsAction: z.array(DefinitionActionSchema),
145
+ });
146
+ export type DefinitionPlan = z.infer<typeof DefinitionPlanSchema>;
147
+
148
+ export const DefinitionApplySchema = z.object({
149
+ token: z.string(),
150
+ // The ticked item ids. Ids the re-derived plan does not contain are ignored rather than erroring.
151
+ items: z.array(z.string()),
152
+ });
153
+ export type DefinitionApply = z.infer<typeof DefinitionApplySchema>;
154
+
155
+ export const DefinitionReportSchema = z.object({
156
+ applied: z.array(z.object({ id: z.string(), label: z.string() })),
157
+ // Ticked and did not land, each with the reason (a clone that failed, a full disk). Distinct from
158
+ // inapplicable items, which were never attempted.
159
+ failed: z.array(z.object({ id: z.string(), label: z.string(), error: z.string() })),
160
+ needsAction: z.array(DefinitionActionSchema),
161
+ });
162
+ export type DefinitionReport = z.infer<typeof DefinitionReportSchema>;
163
+
164
+ // Where this sandbox stands relative to a definition: one line per difference, empty when they agree. The
165
+ // drift answer, computable because the emitter is deterministic.
166
+ export const DefinitionDiffSchema = z.object({
167
+ differences: z.array(DefinitionActionSchema),
168
+ });
169
+ export type DefinitionDiff = z.infer<typeof DefinitionDiffSchema>;
170
+
171
+ /* ---- publishing the workspace repo, the one step a definition cannot take for itself ----
172
+ *
173
+ * `[workspace]` names a remote; nothing can name one that does not exist. So the owner-facing half of the
174
+ * feature is this: create a PRIVATE repo on a connected git host and push /work to it, or adopt a URL the
175
+ * owner made themselves. Deliberately its own route rather than a side effect of the export, publishing a
176
+ * workspace is an outward act with its own confirmation, and deriving a document must stay read-only.
177
+ */
178
+ export const WorkspacePublishSchema = z.object({
179
+ /* An existing repo's clone URL. Given, nothing is created: the remote is wired up and pushed to, which is
180
+ * the path for an owner who made the repo themselves or is moving hosts. */
181
+ remote: z.string().min(1).optional(),
182
+ // The repo to create when `remote` is absent. Owner-side default is the sandbox's own name.
183
+ name: z.string().min(1).optional(),
184
+ /* The account or organization to create it under; absent means the authenticated user. Ignored when
185
+ * `remote` is given. */
186
+ owner: z.string().min(1).optional(),
187
+ });
188
+ export type WorkspacePublish = z.infer<typeof WorkspacePublishSchema>;
189
+
190
+ // Where the workspace now lives, and what a definition will name. `created` distinguishes "made you a repo"
191
+ // from "wired up the one you gave me", which is the difference the card reports back.
192
+ export const WorkspacePublishResultSchema = z.object({
193
+ remote: z.string(),
194
+ branch: z.string(),
195
+ created: z.boolean(),
196
+ });
197
+ export type WorkspacePublishResult = z.infer<typeof WorkspacePublishResultSchema>;
198
+
199
+ // What the card renders before anything is published: whether /work has a remote, and which connected git
200
+ // hosts could make one. Read-only, so the button can say "Publish to github.com" rather than opening a form
201
+ // into a void.
202
+ export const WorkspaceRemoteSchema = z.object({
203
+ remote: z.string().optional(),
204
+ branch: z.string().optional(),
205
+ // Hostnames of connected github/gitlab accounts, in the order they would be tried. Empty means the owner
206
+ // must connect one (or paste a URL).
207
+ hosts: z.array(z.string()),
208
+ });
209
+ export type WorkspaceRemote = z.infer<typeof WorkspaceRemoteSchema>;
210
+
211
+ /* ---- the bundle manifest, restated on the definition ----
212
+ *
213
+ * A bundle is DEFINITION + STATE: its manifest embeds the same definition `GET /definition` emits, and the
214
+ * tar entries behind it carry what no definition can reference (git dirs, transcripts, ledgers). One schema,
215
+ * two doors, which is what keeps the two formats from drifting into different answers about what an
216
+ * environment IS. Version 2 replaced the ad-hoc `environment` facts block with the definition; a v1 bundle is
217
+ * refused by version rather than guessed at, like any other manifest this daemon cannot read.
218
+ */
219
+ export const BundleManifestSchema = z.object({
220
+ // Bumped when the layout changes in a way an older daemon would misread. Refused rather than guessed at.
221
+ version: z.literal(2),
222
+ // Where it came from, for the report's first line. Never used to authorize anything.
223
+ sandbox: z.object({ name: z.string() }).optional(),
224
+ createdAt: z.number(),
225
+ // The owner's export-time choice; the restorer re-derives every decision from the manifests rather than
226
+ // trusting this, and uses it only to explain what is missing.
227
+ secrets: z.boolean(),
228
+ // The declarable shape, exactly what a definition export emits, so the restore report reasons over the
229
+ // same facts either door delivers.
230
+ definition: SandboxDefinitionSchema,
231
+ // Every path class the bundle deliberately left out, with the manifest's own note where it has one. This is
232
+ // what turns "the export skipped things" from a silence into a list the owner can act on.
233
+ excluded: z.array(z.object({ path: z.string(), portability: z.string(), note: z.string().optional() })),
234
+ });
235
+ export type BundleManifest = z.infer<typeof BundleManifestSchema>;
package/src/events.ts CHANGED
@@ -1,18 +1,12 @@
1
1
  import { z } from "zod";
2
- import {
3
- AgentProviderSchema,
4
- AgentReplySchema,
5
- AgentSummarySchema,
6
- FastModeStateSchema,
7
- LandConflictSchema,
8
- MemberRoleSchema,
9
- PermissionModeSchema,
10
- RateLimitInfoSchema,
11
- ShareDetailSchema,
12
- SubagentKindSchema,
13
- SubagentStatusSchema,
14
- UsageWindowSchema,
15
- } from "./schemas.js";
2
+ import { AgentProviderSchema, PermissionModeSchema } from "./schemas/agent.js";
3
+ import { AgentSummarySchema, LandConflictSchema } from "./schemas/agents.js";
4
+ import { RateLimitInfoSchema } from "./schemas/claude-gate.js";
5
+ import { FastModeStateSchema } from "./schemas/fast-mode.js";
6
+ import { AgentReplySchema, UsageWindowSchema } from "./schemas/plan-limits.js";
7
+ import { ShareDetailSchema } from "./schemas/share.js";
8
+ import { MemberRoleSchema } from "./schemas/shared.js";
9
+ import { SubagentKindSchema, SubagentStatusSchema, SubagentVerificationSchema } from "./schemas/terminal.js";
16
10
 
17
11
  // The wire shapes streamed from the daemon's event-iterator procedures. This is their canonical home: the
18
12
  // daemon yields them and the browser client consumes them from the same schema, so the two can't drift (they
@@ -35,6 +29,29 @@ export const AskQuestionSchema = z.object({
35
29
  });
36
30
  export type AskQuestion = z.infer<typeof AskQuestionSchema>;
37
31
 
32
+ /* THE PROGRAM A COMMAND CARD IS HOLDING, as the thing it is rather than as prose about it.
33
+ *
34
+ * It used to ride in `description`, the field every other permission ask fills with a sentence, which left the
35
+ * card with no way to know it was holding four hundred characters of shell: it rendered them as a paragraph,
36
+ * wrapped mid-flag, and the fragment that caused the hold was somewhere in the middle of it.
37
+ *
38
+ * `spans` is the gate's own evidence, computed by the classifier at the moment the rule fired (contract's
39
+ * command-classes.ts, matchCommand) and carried rather than re-derived: a browser that re-ran the patterns
40
+ * would be a second classifier, and the day the two disagreed the card would be marking a fragment that is not
41
+ * the one anybody was held for. Offsets are into `text` AFTER truncation, so they are always paintable.
42
+ *
43
+ * `language` is a Shiki grammar id, and the two are the two execution backends the gate reads (command-gate's
44
+ * EXECUTION_SOURCES): a shell line and a script. */
45
+ export const ProgramAskSchema = z.object({
46
+ text: z.string().describe("What would run."),
47
+ language: z.enum(["bash", "javascript"]).describe("Which of the two backends it is written for, named as the grammar that colours it."),
48
+ truncated: z.boolean().describe("Whether this is the head of a longer program, so the card can say so instead of ending mid-word."),
49
+ spans: z
50
+ .array(z.object({ start: z.number().int().nonnegative(), end: z.number().int().nonnegative() }))
51
+ .describe("Which fragments of the text put it in the class that held it. Offsets into text, in order, never overlapping."),
52
+ });
53
+ export type ProgramAsk = z.infer<typeof ProgramAskSchema>;
54
+
38
55
  // One per-tool permission prompt (the SDK's canUseTool callback, surfaced as a card). The daemon passes the
39
56
  // bridge's own rendered strings through rather than re-deriving them, so the prompt reads exactly as Claude
40
57
  // Code words it. `alwaysLabel` is present only when the SDK offered rules to persist, without it the card
@@ -56,6 +73,15 @@ export const PermissionAskSchema = z.object({
56
73
  .describe(
57
74
  "The wording for an always-allow answer. Present only when there is something an always could actually remember; without it the only answers are once and no.",
58
75
  ),
76
+ program: ProgramAskSchema.optional().describe(
77
+ "The program this card is holding, when the card is about one. Present on a command gate's card and absent on every other permission ask.",
78
+ ),
79
+ explain: z
80
+ .string()
81
+ .optional()
82
+ .describe(
83
+ "One plain sentence saying what the program does and why the agent wants it. Written by the quick model, never by the agent being gated, and only when the owner switched the setting on.",
84
+ ),
59
85
  });
60
86
  export type PermissionAsk = z.infer<typeof PermissionAskSchema>;
61
87
 
@@ -360,8 +386,9 @@ export const RestoredMessageSchema = z.object({
360
386
  thinking: z.string().optional().describe("What the agent was reasoning about."),
361
387
  tools: z.array(RestoredToolCallSchema).optional().describe("The tool calls this part of the turn made."),
362
388
  /* What the daemon added to this turn's message (user rows only), the same notes the live `preamble` frame
363
- * carries, recovered from the stored prompt when the transcript is read back. The reader that strips them out
364
- * of the user's words is the one that hands them over here instead of dropping them on the floor.
389
+ * carries. A daemon-recorded turn takes them straight off that frame in its own log, typed end to end
390
+ * (sessions/turn-transcript.ts); only a conversation adopted from a provider's session store recovers them
391
+ * by parsing the composed prompt kept there, the one store the daemon never wrote typed.
365
392
  *
366
393
  * On the message rather than as a row of its own, and that matters twice: they ARE part of what was
367
394
  * sent, and a record row per turn preamble would break the one-row-per-bubble correspondence a branch counts
@@ -489,8 +516,9 @@ export type ParkedCard = z.infer<typeof ParkedCardSchema>;
489
516
  // ~40 SDKMessage types down to this union: high-value block types get a dedicated frame
490
517
  // (delta/thinking/tool_call/tool_call_update/todos/usage/rate_limit_info/account_usage/context_usage/init/compact); any SDK message
491
518
  // without a UI mapping is dropped. `plan`/`question`/`permission` pause the turn until the user answers on the
492
- // `POST /agent/reply` side channel, and `resolved` releases the one it names; `mode` reports the live
493
- // permission posture as the agent changes it.
519
+ // `POST /agent/reply` side channel, and `resolved` releases the one it names; `permission_note` adds a sentence
520
+ // to a permission card already on screen without settling it; `mode` reports the live permission posture as the
521
+ // agent changes it.
494
522
  // `parentToolUseId` tags frames produced inside a subagent (Task tool); `subagent`/`subagent_update` report the
495
523
  // subagent itself, keyed by the same tool_use id those tagged frames carry.
496
524
  export const AgentEventSchema = z.discriminatedUnion("kind", [
@@ -554,12 +582,14 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
554
582
  * way to find out what those instructions said. This frame is the fix: the note text verbatim, one entry per
555
583
  * note, rendered collapsed so it costs a click rather than a scroll.
556
584
  *
557
- * `title` is the note's own opening header, which is what the stripper already anchors on, so the two
558
- * cannot drift, and a note nobody thought to title cannot reach the wire unlabelled.
585
+ * Emitted from the TYPED notes the wire prompt is serialized from at the same point (turn-preamble.ts,
586
+ * composeWirePrompt), so the disclosure and what the model receives cannot drift: a note is in both or in
587
+ * neither, and a note nobody thought to title cannot reach the wire unlabelled.
559
588
  *
560
589
  * ONE MOMENT, always: the notes went in front of the user's own message before the turn started, so they hang
561
- * off that message and are stored on it, which is how a reopened tab still has them. Nothing is injected into
562
- * a RUNNING turn, the rebase taken while a card sat waiting was the only thing that ever was, and it no
590
+ * off that message and are stored on it, the transcript fold reads this very frame out of the turn's own
591
+ * frame log (sessions/turn-transcript.ts), which is how a reopened tab still has them. Nothing is injected
592
+ * into a RUNNING turn, the rebase taken while a card sat waiting was the only thing that ever was, and it no
563
593
  * longer says anything to the model at all (agent/turn-preamble.ts). */
564
594
  z.object({ kind: z.literal("preamble"), notes: z.array(TurnNoteSchema) }),
565
595
  // The SDK's init handshake; carries the model it actually resolved for the turn.
@@ -666,6 +696,9 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
666
696
  lastTool: z.string().optional(),
667
697
  summary: z.string().optional(),
668
698
  error: z.string().optional(),
699
+ // Whether anything checked the work the report describes (SubagentVerificationSchema). Rides the frame
700
+ // that ENDS the child, beside the report itself, so the card carries both at once.
701
+ verification: SubagentVerificationSchema.optional(),
669
702
  }),
670
703
  z.object({ kind: z.literal("todos"), items: z.array(TodoItemSchema) }),
671
704
  // The provider's own slash commands (ACP available_commands_update), replaced whole each time, the
@@ -875,6 +908,19 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
875
908
  // already moved on. It rides verbatim, exactly as the client POSTed it; absent, nobody answered (the turn
876
909
  // was stopped, or died under the card), which is not a decision and must not replay as one.
877
910
  z.object({ kind: z.literal("resolved"), requestId: z.string(), reply: AgentReplySchema.optional() }),
911
+ /* A LATE SENTENCE FOR A CARD ALREADY ON SCREEN: the quick model's plain-language reading of a held command,
912
+ * landing on the permission card named by `requestId` (see PermissionAsk.explain).
913
+ *
914
+ * A frame of its own rather than a field on the card, because the card MUST NOT WAIT FOR IT. This is a
915
+ * safety prompt and the turn is parked on it; a quick-model rung can take tens of seconds before the chain
916
+ * steps down (agent/quick-model.ts measured one at 58), and holding the card back for that reads exactly
917
+ * like the agent freezing, which is the failure the explanation was meant to prevent rather than cause. So
918
+ * the card goes out complete and unexplained, and this arrives if and when it does. Same shape and the same
919
+ * reason as `service_event`, which streams a running service's status onto an offer already rendered.
920
+ *
921
+ * Never arrives at all when the setting is off, when nothing is connected to answer, or when the user
922
+ * settles the card first, and none of those change what the card says. */
923
+ z.object({ kind: z.literal("permission_note"), requestId: z.string(), explain: z.string() }),
878
924
  // The turn's permission mode, whenever it changes, the user's pick at turn start, then every move the
879
925
  // AGENT makes on its own (EnterPlanMode on a request that needs thinking through, ExitPlanMode once the
880
926
  // user approves). The composer's mode selector follows this, so the UI never lies about the live posture.
@@ -955,6 +1001,22 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
955
1001
  * context-window-too-small does: they never reached a provider, and losing them to a
956
1002
  * capacity fact the user did not cause would be ours to answer for. */
957
1003
  "sandbox-memory-low",
1004
+ /* THE LOOP RAN OUT OF ITERATIONS, not out of work: the runtime hit its own turn ceiling and
1005
+ * stopped. Nothing failed, nothing is disconnected and nothing is spent, which is exactly why
1006
+ * it needs a code of its own rather than a sentence: it is the one ending that LOOKS like a
1007
+ * finished turn from the outside, and a ledger that filed it as an ordinary error told a
1008
+ * reader nothing they could act on.
1009
+ *
1010
+ * The recovery is the user's, not the daemon's: whatever the turn was doing is half done, and
1011
+ * re-running it blind would either redo the finished half or resume work nobody looked at. */
1012
+ "turn-cap",
1013
+ /* THE HARNESS ENDED THE TURN WITHOUT SUCCEEDING and did not say why in terms anything here
1014
+ * models: an internal execution error, or a result subtype a later vendor build invented. The
1015
+ * sentence carries the subtype verbatim, because that word is the only thing separating two of
1016
+ * these, and a code that meant "one of several unrelated things" would be worse than none. It
1017
+ * is a real classification all the same: it says the failure came from the LOOP rather than
1018
+ * from the provider, the credential or the request, which rules out every recovery next door. */
1019
+ "harness-incomplete",
958
1020
  ])
959
1021
  .optional(),
960
1022
  // rate_limit only: when the exhausted window reopens (epoch seconds, from the stream's own
@@ -971,6 +1033,25 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
971
1033
  // Absent means there is nothing automatic to resume: a spent usage limit never has one,
972
1034
  // and a refused credential has none once re-minting it has already been tried and failed.
973
1035
  autoResume: z.enum(["scheduled", "available"]).optional(),
1036
+ /* THE DAEMON IS STILL HOLDING THIS EXACT TURN, so the way on is to RE-RUN it rather than to send
1037
+ * something after it. rate_limit only, and the counterpart to `autoResume` rather than a member of it:
1038
+ * that field answers "is a machine bringing this back", and a spent allowance is the one failure where
1039
+ * the answer is deliberately no (the allowance is the user's own budget to spend, turn-resume.ts). This
1040
+ * answers the question that was never asked, "and if the user says go, what happens", which had exactly
1041
+ * one possible answer for as long as it went unasked: a new user message reading "Continue".
1042
+ *
1043
+ * That answer was wrong in a way the chat could not show. The press is not a new instruction, it is the
1044
+ * same one again, and appending it said otherwise to the only reader that matters: the provider session
1045
+ * grew one "Continue" per press, each with a synthetic "No response requested." above it, so a chat that
1046
+ * bounced four times handed the model four turns in which it appeared to have declined to answer. With
1047
+ * this field the press re-runs the held turn instead, which is idempotent by construction (a second press
1048
+ * finds a live turn and supersedes nothing) and leaves the transcript one row for one press.
1049
+ *
1050
+ * `ran` is whether the held turn got anywhere before it was refused, and it changes both what the model
1051
+ * is told (RESUME_NOTES.limit vs .refused, and telling a model to carry on from work that never happened
1052
+ * is how it comes to invent some) and what the strip can honestly say. A spent allowance refuses the
1053
+ * FIRST request most of the time, so false is the common case, not the corner. */
1054
+ held: z.object({ ran: z.boolean() }).optional(),
974
1055
  /* provider-outage only: the shape of the wait. `retryAt` (epoch seconds) is when the next attempt is
975
1056
  * due, not a fixed cadence, because an outage has no reset instant to aim at and hammering a provider
976
1057
  * that is down only spends tokens on refusals, so each attempt waits longer than the last
@@ -1035,6 +1116,23 @@ export const RESUME_NOTES = {
1035
1116
  auth: `The Claude credential that interrupted this conversation has been renewed, and this turn resumed automatically. ${REPEATED}`,
1036
1117
  outage: `The model provider was briefly unavailable and interrupted this conversation; this turn resumed automatically. ${REPEATED}`,
1037
1118
  restart: `The sandbox restarted while this turn was running, which stopped it, and this turn resumed automatically once it came back. ${REPEATED}`,
1119
+ /* A SPENT ALLOWANCE STRANDS A TURN IN TWO SHAPES, and they must not share a note.
1120
+ *
1121
+ * `limit` is the mid-turn one and reads like its three neighbours above: the session holds real work, and
1122
+ * carrying on from it is exactly right.
1123
+ *
1124
+ * `refused` is the turn the provider turned away at the door, before the model read one word of it, and it
1125
+ * is the COMMONER of the two, because an allowance that is already spent refuses the first request it is
1126
+ * asked. REPEATED is actively wrong for it: "part of it was already completed in this session, continue from
1127
+ * that point instead of starting over" is an instruction to continue from work that does not exist, and a
1128
+ * model handed that instruction answers it by inventing the work. So it says the opposite, plainly.
1129
+ *
1130
+ * Both are unlike their neighbours in one way worth stating: nothing resumed automatically. A spent
1131
+ * allowance is the user's own budget and stays their call to spend (turn-resume.ts), so what re-ran this
1132
+ * turn was a person pressing Continue. */
1133
+ limit: `The model provider's usage allowance ran out while this turn was running, which stopped it, and it has been sent again. ${REPEATED}`,
1134
+ refused:
1135
+ "The model provider refused the previous attempt at this request outright, because its usage allowance was spent: no part of the request below was read or acted on, and nothing has been done towards it. It has been sent again, and starts from the beginning.",
1038
1136
  // A turn that was PARKED on the user when the daemon died: nothing re-runs at boot, the card is restored
1039
1137
  // instead, and this is the turn their answer starts (turn-resume.ts). What rides below the note is the
1040
1138
  // answer itself, so the model picks the session back up at exactly the decision it had handed over.
@@ -1080,6 +1178,14 @@ const RESUME_DISCLOSURES: Record<ResumeReason, ResumeDisclosure> = {
1080
1178
  auth: { kind: "notice", text: "Claude sign-in renewed, this turn picked up where it left off." },
1081
1179
  outage: { kind: "notice", text: "The model provider came back, this turn picked up where it left off." },
1082
1180
  restart: { kind: "notice", text: "The sandbox came back, this turn picked up where it left off." },
1181
+ /* THE ONE PAIR NOBODY AUTOMATED, said in the passive voice the other three earn honestly and these two do
1182
+ * not: a person pressed Continue. Which is the whole reason these rows exist at all. A press used to append
1183
+ * the word "Continue" as a message of its own, so a chat that bounced off a spent allowance four times read
1184
+ * back as the user saying "Continue" four times to an agent that had answered none of them, and the provider
1185
+ * session the model actually reads accumulated all four (plus a synthetic "No response requested." per
1186
+ * press). One row for one press was never the problem; a row that claims the user said something new is. */
1187
+ limit: { kind: "notice", text: "Sent again after the allowance ran out mid-turn, picking up where it left off." },
1188
+ refused: { kind: "notice", text: "Sent again after the allowance refused it: nothing had run." },
1083
1189
  answered: { kind: "note", note: { title: "Picked back up after a sandbox restart", text: RESUME_NOTES.answered } },
1084
1190
  };
1085
1191
 
package/src/fast-tier.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { compareCheapestFirst, isCheaperRung } from "./model-order.js";
2
2
  import { parsePinned } from "./quick-model.js";
3
- import type { AgentProvider } from "./schemas.js";
3
+ import type { AgentProvider } from "./schemas/agent.js";
4
4
 
5
5
  /* WHICH MODEL A DOWNGRADED TURN ACTUALLY RUNS ON, the second half of automatic tier selection.
6
6
  * prompt-complexity.ts decides a turn COULD be cheaper; this decides whether there is anything cheaper to put
@@ -128,6 +128,11 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
128
128
  { path: "sync-enrollments.json", portability: "identity", note: "Re-pair desktop sync from the Sync tab." },
129
129
  { path: "sync-pair-consumed.json", portability: "identity" },
130
130
  { path: "host-enrollments.json", portability: "identity" },
131
+ /* A connected BROWSER's enrollment (webext/webext-store.ts). Identity for the hosts file's reason and one
132
+ * more of its own: the token admits a socket into somebody's signed-in browser, and that browser was paired
133
+ * with THIS sandbox — carried into another one it would either be dead weight or, worse, a second sandbox
134
+ * holding a live key to a browser its owner never connected it to. Re-pairing is a code and one click. */
135
+ { path: "webext-enrollments.json", portability: "identity", note: "Pair your browser again from its card: the extension is still installed." },
131
136
  // The burn list for setup-time computer pairings. Identity, like sync's beside it, and for a sharper reason:
132
137
  // carrying it into another sandbox would mark that sandbox's own fresh pairing as already spent.
133
138
  { path: "host-pair-consumed.json", portability: "identity" },
@@ -24,7 +24,7 @@ export const HostHelloSchema = z.object({
24
24
  * onto one-shot tickets, auth/ws-tickets.ts). A frame is body, not URL, so it is logged nowhere. Until this
25
25
  * arrives the socket is anonymous and short-lived: the daemon closes it in seconds if it never does. */
26
26
  token: z.string(),
27
- // The @intentic/host build the machine is running, surfaced per machine so an old binary is visible rather
27
+ // The @intentic/machine build the machine is running, surfaced per machine so an old binary is visible rather
28
28
  // than mysteriously missing a tool. What the machine IS (`describe`) is not here: it is pulled over the
29
29
  // typed link a moment later, so there is one definition of those facts rather than two.
30
30
  version: z.string(),
@@ -25,8 +25,8 @@ test("preview and port hostnames round-trip through their Host-header parsers",
25
25
  });
26
26
 
27
27
  test("the two schemes never bleed into each other, and stray/wrong-id hosts parse to nothing", () => {
28
- expect(portSlotFromHost("preview-app-" + ID + ".example.com", ID)).toBeUndefined();
29
- expect(panelFromHost("port-a-" + ID + ".example.com", ID)).toBeUndefined();
28
+ expect(portSlotFromHost(`preview-app-${ID}.example.com`, ID)).toBeUndefined();
29
+ expect(panelFromHost(`port-a-${ID}.example.com`, ID)).toBeUndefined();
30
30
  expect(panelFromHost("app.example.com", ID)).toBeUndefined();
31
31
  expect(panelFromHost(`preview-app-000000000000.example.com`, ID)).toBeUndefined();
32
32
  expect(portSlotFromHost(`port-a-000000000000.example.com`, ID)).toBeUndefined();
package/src/index.ts CHANGED
@@ -59,6 +59,9 @@ export { historyContract } from "./contracts/history.contract.js";
59
59
  /* Deliberately NOT part of `sandboxContract` below: that map is the daemon's own HTTP surface, and this one is
60
60
  * spoken the other way round, over a connected computer's WebSocket, with the MACHINE implementing it. */
61
61
  export { hostContract } from "./contracts/host.contract.js";
62
+ // The same inversion again, one layer in: spoken over the socket a BROWSER EXTENSION opened, with the
63
+ // extension implementing it (contracts/webext.contract.ts).
64
+ export { webextContract } from "./contracts/webext.contract.js";
62
65
  // Same inversion, other direction of trust: spoken over a RUNNER's WebSocket, with the runner implementing it.
63
66
  export { runnerContract } from "./contracts/runner.contract.js";
64
67
  export { intenticContract } from "./contracts/intentic.contract.js";
@@ -104,11 +107,14 @@ export * from "./history-state.js";
104
107
  export * from "./agent-catalog.js";
105
108
  export * from "./agent-run-model.js";
106
109
  export * from "./capability-env.js";
110
+ export * from "./command-classes.js";
107
111
  export * from "./capability-secrets.js";
108
112
  export * from "./conversation-ids.js";
109
113
  export * from "./documents.js";
110
114
  export * from "./fast-tier.js";
111
115
  export * from "./host-protocol.js";
116
+ export * from "./webext-protocol.js";
117
+ export * from "./webext-links.js";
112
118
  export * from "./runner-protocol.js";
113
119
  export * from "./listener-protocol.js";
114
120
  export * from "./hostnames.js";
@@ -118,7 +124,61 @@ export * from "./prompt-complexity.js";
118
124
  export * from "./quick-model.js";
119
125
  export * from "./output-fields.js";
120
126
  export * from "./publish-drafts.js";
121
- export * from "./schemas.js";
127
+ /* The wire shapes, one module per subject area, mirroring `contracts/` above: every request and response the
128
+ * daemon speaks is declared in exactly one of them. Inputs that carry a `{param}` in their route path (repo /
129
+ * id / name) merge the path param into the same flat object, oRPC fills the path placeholder from the matching
130
+ * key and routes the rest to the body (POST/PUT) or query (GET).
131
+ *
132
+ * `schemas/internal.ts` is deliberately absent: it holds the id and ref primitives these modules are written
133
+ * in, which are vocabulary rather than shapes either side of the wire sends. */
134
+ export * from "./schemas/activity.js";
135
+ export * from "./schemas/agent.js";
136
+ export * from "./schemas/agents.js";
137
+ export * from "./schemas/automations.js";
138
+ export * from "./schemas/capabilities.js";
139
+ export * from "./schemas/ci.js";
140
+ export * from "./schemas/claude-gate.js";
141
+ export * from "./schemas/codebase-health.js";
142
+ export * from "./schemas/computers.js";
143
+ export * from "./schemas/drafts.js";
144
+ export * from "./schemas/environment.js";
145
+ export * from "./schemas/exit.js";
146
+ export * from "./schemas/extension-updates.js";
147
+ export * from "./schemas/fast-mode.js";
148
+ export * from "./schemas/git.js";
149
+ export * from "./schemas/git-history.js";
150
+ export * from "./schemas/history.js";
151
+ export * from "./schemas/hosts.js";
152
+ export * from "./schemas/intentic.js";
153
+ export * from "./schemas/inventory.js";
154
+ export * from "./schemas/logs.js";
155
+ export * from "./schemas/loops.js";
156
+ export * from "./schemas/maintenance.js";
157
+ export * from "./schemas/marketplace.js";
158
+ export * from "./schemas/panels.js";
159
+ export * from "./schemas/personas.js";
160
+ export * from "./schemas/plan-limits.js";
161
+ export * from "./schemas/ports.js";
162
+ export * from "./schemas/provider-oauth.js";
163
+ export * from "./schemas/provider-subscriptions.js";
164
+ export * from "./schemas/public.js";
165
+ export * from "./schemas/push.js";
166
+ export * from "./schemas/secrets.js";
167
+ export * from "./schemas/sessions.js";
168
+ export * from "./schemas/settings.js";
169
+ export * from "./schemas/share.js";
170
+ export * from "./schemas/shared.js";
171
+ export * from "./schemas/system.js";
172
+ export * from "./schemas/terminal.js";
173
+ export * from "./schemas/usage.js";
174
+ export * from "./schemas/vpn.js";
175
+ export * from "./schemas/webext.js";
176
+ export * from "./schemas/workflows.js";
177
+ export * from "./schemas/workspace-repos.js";
178
+ export * from "./schemas/workspace-search.js";
179
+ export * from "./schemas/workspace-setup.js";
180
+ export * from "./schemas/workspace-tree.js";
181
+ export * from "./definition.js";
122
182
  export * from "./search-globs.js";
123
183
  export * from "./starter.js";
124
184
  export * from "./terminal-protocol.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ActivityStatusSchema } from "./schemas.js";
2
+ import { ActivityStatusSchema } from "./schemas/activity.js";
3
3
 
4
4
  /* The wire between the daemon and an extension's realtime-listener GATEWAY process (ext-discord, ext-slack,
5
5
  * ext-telegram, ext-whatsapp, ext-imap): the four provider-scoped routes app.ts mounts under
@@ -1,6 +1,6 @@
1
1
  import { ACCESS_COST, accessFor, modelsFor, PROVIDERS } from "./agent-catalog.js";
2
2
  import { compareCheapestFirst, familyOf, tierRankOf } from "./model-order.js";
3
- import type { AgentProvider } from "./schemas.js";
3
+ import type { AgentProvider } from "./schemas/agent.js";
4
4
 
5
5
  /* THE QUICK MODEL, the cheap, fast model a small automatic job spends instead of the frontier model the chat
6
6
  * runs on. Today that is the commit message written when an agent's work lands; anything else of that shape (a