@intentic/sandbox-contract 1.232.0 → 1.234.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 (538) hide show
  1. package/README.md +11 -5
  2. package/dist/agent-catalog.d.ts +4 -2
  3. package/dist/agent-catalog.d.ts.map +1 -1
  4. package/dist/agent-catalog.js +20 -14
  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/chores.js +36 -1
  9. package/dist/chores/chores.js.map +1 -1
  10. package/dist/chores/probes.d.ts +1 -1
  11. package/dist/chores/probes.d.ts.map +1 -1
  12. package/dist/chores/probes.js +70 -0
  13. package/dist/chores/probes.js.map +1 -1
  14. package/dist/chores/stack.d.ts.map +1 -1
  15. package/dist/chores/stack.js +2 -1
  16. package/dist/chores/stack.js.map +1 -1
  17. package/dist/chores/verdict.d.ts +1 -1
  18. package/dist/chores/verdict.d.ts.map +1 -1
  19. package/dist/command-classes.d.ts +17 -0
  20. package/dist/command-classes.d.ts.map +1 -0
  21. package/dist/command-classes.js +189 -0
  22. package/dist/command-classes.js.map +1 -0
  23. package/dist/contracts/activity.contract.js +1 -1
  24. package/dist/contracts/activity.contract.js.map +1 -1
  25. package/dist/contracts/agent.contract.d.ts +40 -2
  26. package/dist/contracts/agent.contract.d.ts.map +1 -1
  27. package/dist/contracts/agent.contract.js +4 -1
  28. package/dist/contracts/agent.contract.js.map +1 -1
  29. package/dist/contracts/agents.contract.d.ts +24 -0
  30. package/dist/contracts/agents.contract.d.ts.map +1 -1
  31. package/dist/contracts/agents.contract.js +5 -1
  32. package/dist/contracts/agents.contract.js.map +1 -1
  33. package/dist/contracts/automations.contract.d.ts +30 -0
  34. package/dist/contracts/automations.contract.d.ts.map +1 -1
  35. package/dist/contracts/automations.contract.js +2 -1
  36. package/dist/contracts/automations.contract.js.map +1 -1
  37. package/dist/contracts/capabilities.contract.d.ts +63 -0
  38. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  39. package/dist/contracts/capabilities.contract.js +3 -1
  40. package/dist/contracts/capabilities.contract.js.map +1 -1
  41. package/dist/contracts/chores.contract.d.ts +17 -0
  42. package/dist/contracts/chores.contract.d.ts.map +1 -1
  43. package/dist/contracts/chores.contract.js +2 -1
  44. package/dist/contracts/chores.contract.js.map +1 -1
  45. package/dist/contracts/ci.contract.js +2 -1
  46. package/dist/contracts/ci.contract.js.map +1 -1
  47. package/dist/contracts/claude.contract.js +2 -1
  48. package/dist/contracts/claude.contract.js.map +1 -1
  49. package/dist/contracts/cursor.contract.js +2 -1
  50. package/dist/contracts/cursor.contract.js.map +1 -1
  51. package/dist/contracts/drafts.contract.d.ts.map +1 -1
  52. package/dist/contracts/drafts.contract.js +2 -1
  53. package/dist/contracts/drafts.contract.js.map +1 -1
  54. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  55. package/dist/contracts/endpoints.contract.js +2 -1
  56. package/dist/contracts/endpoints.contract.js.map +1 -1
  57. package/dist/contracts/exit.contract.d.ts.map +1 -1
  58. package/dist/contracts/exit.contract.js +2 -1
  59. package/dist/contracts/exit.contract.js.map +1 -1
  60. package/dist/contracts/extensions.contract.d.ts +44 -0
  61. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  62. package/dist/contracts/extensions.contract.js +4 -1
  63. package/dist/contracts/extensions.contract.js.map +1 -1
  64. package/dist/contracts/git.contract.d.ts.map +1 -1
  65. package/dist/contracts/git.contract.js +4 -1
  66. package/dist/contracts/git.contract.js.map +1 -1
  67. package/dist/contracts/grok.contract.d.ts.map +1 -1
  68. package/dist/contracts/grok.contract.js +2 -1
  69. package/dist/contracts/grok.contract.js.map +1 -1
  70. package/dist/contracts/history.contract.d.ts.map +1 -1
  71. package/dist/contracts/history.contract.js +2 -1
  72. package/dist/contracts/history.contract.js.map +1 -1
  73. package/dist/contracts/host.contract.d.ts +7 -0
  74. package/dist/contracts/host.contract.d.ts.map +1 -1
  75. package/dist/contracts/host.contract.js +4 -1
  76. package/dist/contracts/host.contract.js.map +1 -1
  77. package/dist/contracts/intentic.contract.d.ts.map +1 -1
  78. package/dist/contracts/intentic.contract.js +2 -1
  79. package/dist/contracts/intentic.contract.js.map +1 -1
  80. package/dist/contracts/inventory.contract.js +1 -1
  81. package/dist/contracts/inventory.contract.js.map +1 -1
  82. package/dist/contracts/issues.contract.d.ts +89 -0
  83. package/dist/contracts/issues.contract.d.ts.map +1 -0
  84. package/dist/contracts/issues.contract.js +50 -0
  85. package/dist/contracts/issues.contract.js.map +1 -0
  86. package/dist/contracts/logs.contract.d.ts.map +1 -1
  87. package/dist/contracts/logs.contract.js +1 -1
  88. package/dist/contracts/logs.contract.js.map +1 -1
  89. package/dist/contracts/loops.contract.js +2 -1
  90. package/dist/contracts/loops.contract.js.map +1 -1
  91. package/dist/contracts/panels.contract.d.ts.map +1 -1
  92. package/dist/contracts/panels.contract.js +2 -1
  93. package/dist/contracts/panels.contract.js.map +1 -1
  94. package/dist/contracts/personas.contract.js +2 -1
  95. package/dist/contracts/personas.contract.js.map +1 -1
  96. package/dist/contracts/ports.contract.d.ts.map +1 -1
  97. package/dist/contracts/ports.contract.js +2 -1
  98. package/dist/contracts/ports.contract.js.map +1 -1
  99. package/dist/contracts/prepush.contract.d.ts.map +1 -1
  100. package/dist/contracts/prepush.contract.js +2 -1
  101. package/dist/contracts/prepush.contract.js.map +1 -1
  102. package/dist/contracts/providers.contract.d.ts.map +1 -1
  103. package/dist/contracts/providers.contract.js +2 -1
  104. package/dist/contracts/providers.contract.js.map +1 -1
  105. package/dist/contracts/public.contract.d.ts.map +1 -1
  106. package/dist/contracts/public.contract.js +2 -1
  107. package/dist/contracts/public.contract.js.map +1 -1
  108. package/dist/contracts/push.contract.d.ts.map +1 -1
  109. package/dist/contracts/push.contract.js +2 -1
  110. package/dist/contracts/push.contract.js.map +1 -1
  111. package/dist/contracts/runner.contract.d.ts +127 -84
  112. package/dist/contracts/runner.contract.d.ts.map +1 -1
  113. package/dist/contracts/runner.contract.js +10 -2
  114. package/dist/contracts/runner.contract.js.map +1 -1
  115. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  116. package/dist/contracts/secrets.contract.js +2 -1
  117. package/dist/contracts/secrets.contract.js.map +1 -1
  118. package/dist/contracts/sessions.contract.js +1 -1
  119. package/dist/contracts/sessions.contract.js.map +1 -1
  120. package/dist/contracts/settings.contract.d.ts +32 -0
  121. package/dist/contracts/settings.contract.d.ts.map +1 -1
  122. package/dist/contracts/settings.contract.js +3 -1
  123. package/dist/contracts/settings.contract.js.map +1 -1
  124. package/dist/contracts/share.contract.d.ts.map +1 -1
  125. package/dist/contracts/share.contract.js +2 -1
  126. package/dist/contracts/share.contract.js.map +1 -1
  127. package/dist/contracts/skills.contract.d.ts.map +1 -1
  128. package/dist/contracts/skills.contract.js +2 -1
  129. package/dist/contracts/skills.contract.js.map +1 -1
  130. package/dist/contracts/system.contract.d.ts +31 -16
  131. package/dist/contracts/system.contract.d.ts.map +1 -1
  132. package/dist/contracts/system.contract.js +6 -1
  133. package/dist/contracts/system.contract.js.map +1 -1
  134. package/dist/contracts/translator.contract.d.ts.map +1 -1
  135. package/dist/contracts/translator.contract.js +4 -1
  136. package/dist/contracts/translator.contract.js.map +1 -1
  137. package/dist/contracts/usage.contract.js +1 -1
  138. package/dist/contracts/usage.contract.js.map +1 -1
  139. package/dist/contracts/vpn.contract.d.ts.map +1 -1
  140. package/dist/contracts/vpn.contract.js +2 -1
  141. package/dist/contracts/vpn.contract.js.map +1 -1
  142. package/dist/contracts/webext.contract.d.ts +45 -0
  143. package/dist/contracts/webext.contract.d.ts.map +1 -0
  144. package/dist/contracts/webext.contract.js +12 -0
  145. package/dist/contracts/webext.contract.js.map +1 -0
  146. package/dist/contracts/workflows.contract.js +2 -1
  147. package/dist/contracts/workflows.contract.js.map +1 -1
  148. package/dist/contracts/workspace.contract.d.ts +2 -2
  149. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  150. package/dist/contracts/workspace.contract.js +7 -1
  151. package/dist/contracts/workspace.contract.js.map +1 -1
  152. package/dist/credential-material.d.ts +2 -0
  153. package/dist/credential-material.d.ts.map +1 -0
  154. package/dist/credential-material.js +36 -0
  155. package/dist/credential-material.js.map +1 -0
  156. package/dist/definition-action.d.ts +7 -0
  157. package/dist/definition-action.d.ts.map +1 -0
  158. package/dist/definition-action.js +3 -0
  159. package/dist/definition-action.js.map +1 -0
  160. package/dist/definition.d.ts +132 -21
  161. package/dist/definition.d.ts.map +1 -1
  162. package/dist/definition.js +29 -7
  163. package/dist/definition.js.map +1 -1
  164. package/dist/events.d.ts +101 -0
  165. package/dist/events.d.ts.map +1 -1
  166. package/dist/events.js +25 -1
  167. package/dist/events.js.map +1 -1
  168. package/dist/fast-tier.d.ts +1 -1
  169. package/dist/fast-tier.d.ts.map +1 -1
  170. package/dist/history-state.d.ts.map +1 -1
  171. package/dist/history-state.js +2 -0
  172. package/dist/history-state.js.map +1 -1
  173. package/dist/hostnames.d.ts +2 -0
  174. package/dist/hostnames.d.ts.map +1 -1
  175. package/dist/hostnames.js +3 -1
  176. package/dist/hostnames.js.map +1 -1
  177. package/dist/index.d.ts +411 -7
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +56 -1
  180. package/dist/index.js.map +1 -1
  181. package/dist/listener-protocol.js +1 -1
  182. package/dist/listener-protocol.js.map +1 -1
  183. package/dist/quick-model.d.ts +1 -1
  184. package/dist/quick-model.d.ts.map +1 -1
  185. package/dist/runner-protocol.d.ts +18 -0
  186. package/dist/runner-protocol.d.ts.map +1 -1
  187. package/dist/runner-protocol.js +8 -4
  188. package/dist/runner-protocol.js.map +1 -1
  189. package/dist/runtime-state.d.ts +9 -0
  190. package/dist/runtime-state.d.ts.map +1 -1
  191. package/dist/runtime-state.js +3 -0
  192. package/dist/runtime-state.js.map +1 -1
  193. package/dist/schemas/activity.d.ts +112 -0
  194. package/dist/schemas/activity.d.ts.map +1 -0
  195. package/dist/schemas/activity.js +70 -0
  196. package/dist/schemas/activity.js.map +1 -0
  197. package/dist/schemas/agent.d.ts +195 -0
  198. package/dist/schemas/agent.d.ts.map +1 -0
  199. package/dist/schemas/agent.js +171 -0
  200. package/dist/schemas/agent.js.map +1 -0
  201. package/dist/schemas/agents.d.ts +690 -0
  202. package/dist/schemas/agents.d.ts.map +1 -0
  203. package/dist/schemas/agents.js +314 -0
  204. package/dist/schemas/agents.js.map +1 -0
  205. package/dist/schemas/automations.d.ts +781 -0
  206. package/dist/schemas/automations.d.ts.map +1 -0
  207. package/dist/schemas/automations.js +223 -0
  208. package/dist/schemas/automations.js.map +1 -0
  209. package/dist/schemas/capabilities.d.ts +753 -0
  210. package/dist/schemas/capabilities.d.ts.map +1 -0
  211. package/dist/schemas/capabilities.js +269 -0
  212. package/dist/schemas/capabilities.js.map +1 -0
  213. package/dist/schemas/ci.d.ts +179 -0
  214. package/dist/schemas/ci.d.ts.map +1 -0
  215. package/dist/schemas/ci.js +99 -0
  216. package/dist/schemas/ci.js.map +1 -0
  217. package/dist/schemas/claude-gate.d.ts +13 -0
  218. package/dist/schemas/claude-gate.d.ts.map +1 -0
  219. package/dist/schemas/claude-gate.js +8 -0
  220. package/dist/schemas/claude-gate.js.map +1 -0
  221. package/dist/schemas/codebase-health.d.ts +56 -0
  222. package/dist/schemas/codebase-health.d.ts.map +1 -0
  223. package/dist/schemas/codebase-health.js +43 -0
  224. package/dist/schemas/codebase-health.js.map +1 -0
  225. package/dist/schemas/computers.d.ts +386 -0
  226. package/dist/schemas/computers.d.ts.map +1 -0
  227. package/dist/schemas/computers.js +107 -0
  228. package/dist/schemas/computers.js.map +1 -0
  229. package/dist/schemas/drafts.d.ts +84 -0
  230. package/dist/schemas/drafts.d.ts.map +1 -0
  231. package/dist/schemas/drafts.js +44 -0
  232. package/dist/schemas/drafts.js.map +1 -0
  233. package/dist/schemas/environment.d.ts +349 -0
  234. package/dist/schemas/environment.d.ts.map +1 -0
  235. package/dist/schemas/environment.js +111 -0
  236. package/dist/schemas/environment.js.map +1 -0
  237. package/dist/schemas/exit.d.ts +151 -0
  238. package/dist/schemas/exit.d.ts.map +1 -0
  239. package/dist/schemas/exit.js +115 -0
  240. package/dist/schemas/exit.js.map +1 -0
  241. package/dist/schemas/extension-updates.d.ts +1016 -0
  242. package/dist/schemas/extension-updates.d.ts.map +1 -0
  243. package/dist/schemas/extension-updates.js +199 -0
  244. package/dist/schemas/extension-updates.js.map +1 -0
  245. package/dist/schemas/fast-mode.d.ts +8 -0
  246. package/dist/schemas/fast-mode.d.ts.map +1 -0
  247. package/dist/schemas/fast-mode.js +3 -0
  248. package/dist/schemas/fast-mode.js.map +1 -0
  249. package/dist/schemas/git-history.d.ts +238 -0
  250. package/dist/schemas/git-history.d.ts.map +1 -0
  251. package/dist/schemas/git-history.js +152 -0
  252. package/dist/schemas/git-history.js.map +1 -0
  253. package/dist/schemas/git.d.ts +471 -0
  254. package/dist/schemas/git.d.ts.map +1 -0
  255. package/dist/schemas/git.js +204 -0
  256. package/dist/schemas/git.js.map +1 -0
  257. package/dist/schemas/history.d.ts +100 -0
  258. package/dist/schemas/history.d.ts.map +1 -0
  259. package/dist/schemas/history.js +54 -0
  260. package/dist/schemas/history.js.map +1 -0
  261. package/dist/schemas/hosts.d.ts +41 -0
  262. package/dist/schemas/hosts.d.ts.map +1 -0
  263. package/dist/schemas/hosts.js +18 -0
  264. package/dist/schemas/hosts.js.map +1 -0
  265. package/dist/schemas/intentic.d.ts +5 -0
  266. package/dist/schemas/intentic.d.ts.map +1 -0
  267. package/dist/schemas/intentic.js +3 -0
  268. package/dist/schemas/intentic.js.map +1 -0
  269. package/dist/schemas/internal.d.ts +8 -0
  270. package/dist/schemas/internal.d.ts.map +1 -0
  271. package/dist/schemas/internal.js +12 -0
  272. package/dist/schemas/internal.js.map +1 -0
  273. package/dist/schemas/inventory.d.ts +171 -0
  274. package/dist/schemas/inventory.d.ts.map +1 -0
  275. package/dist/schemas/inventory.js +51 -0
  276. package/dist/schemas/inventory.js.map +1 -0
  277. package/dist/schemas/issues.d.ts +324 -0
  278. package/dist/schemas/issues.d.ts.map +1 -0
  279. package/dist/schemas/issues.js +107 -0
  280. package/dist/schemas/issues.js.map +1 -0
  281. package/dist/schemas/logs.d.ts +67 -0
  282. package/dist/schemas/logs.d.ts.map +1 -0
  283. package/dist/schemas/logs.js +54 -0
  284. package/dist/schemas/logs.js.map +1 -0
  285. package/dist/schemas/loops.d.ts +415 -0
  286. package/dist/schemas/loops.d.ts.map +1 -0
  287. package/dist/schemas/loops.js +188 -0
  288. package/dist/schemas/loops.js.map +1 -0
  289. package/dist/schemas/maintenance.d.ts +618 -0
  290. package/dist/schemas/maintenance.d.ts.map +1 -0
  291. package/dist/schemas/maintenance.js +222 -0
  292. package/dist/schemas/maintenance.js.map +1 -0
  293. package/dist/schemas/marketplace.d.ts +64 -0
  294. package/dist/schemas/marketplace.d.ts.map +1 -0
  295. package/dist/schemas/marketplace.js +17 -0
  296. package/dist/schemas/marketplace.js.map +1 -0
  297. package/dist/schemas/panels.d.ts +61 -0
  298. package/dist/schemas/panels.d.ts.map +1 -0
  299. package/dist/schemas/panels.js +51 -0
  300. package/dist/schemas/panels.js.map +1 -0
  301. package/dist/schemas/personas.d.ts +122 -0
  302. package/dist/schemas/personas.d.ts.map +1 -0
  303. package/dist/schemas/personas.js +102 -0
  304. package/dist/schemas/personas.js.map +1 -0
  305. package/dist/schemas/plan-limits.d.ts +172 -0
  306. package/dist/schemas/plan-limits.d.ts.map +1 -0
  307. package/dist/schemas/plan-limits.js +126 -0
  308. package/dist/schemas/plan-limits.js.map +1 -0
  309. package/dist/schemas/ports.d.ts +71 -0
  310. package/dist/schemas/ports.d.ts.map +1 -0
  311. package/dist/schemas/ports.js +42 -0
  312. package/dist/schemas/ports.js.map +1 -0
  313. package/dist/schemas/provider-oauth.d.ts +128 -0
  314. package/dist/schemas/provider-oauth.d.ts.map +1 -0
  315. package/dist/schemas/provider-oauth.js +91 -0
  316. package/dist/schemas/provider-oauth.js.map +1 -0
  317. package/dist/schemas/provider-subscriptions.d.ts +9 -0
  318. package/dist/schemas/provider-subscriptions.d.ts.map +1 -0
  319. package/dist/schemas/provider-subscriptions.js +3 -0
  320. package/dist/schemas/provider-subscriptions.js.map +1 -0
  321. package/dist/schemas/public.d.ts +32 -0
  322. package/dist/schemas/public.d.ts.map +1 -0
  323. package/dist/schemas/public.js +29 -0
  324. package/dist/schemas/public.js.map +1 -0
  325. package/dist/schemas/push.d.ts +55 -0
  326. package/dist/schemas/push.d.ts.map +1 -0
  327. package/dist/schemas/push.js +60 -0
  328. package/dist/schemas/push.js.map +1 -0
  329. package/dist/schemas/secrets.d.ts +86 -0
  330. package/dist/schemas/secrets.d.ts.map +1 -0
  331. package/dist/schemas/secrets.js +51 -0
  332. package/dist/schemas/secrets.js.map +1 -0
  333. package/dist/schemas/sessions.d.ts +32 -0
  334. package/dist/schemas/sessions.d.ts.map +1 -0
  335. package/dist/schemas/sessions.js +11 -0
  336. package/dist/schemas/sessions.js.map +1 -0
  337. package/dist/schemas/settings.d.ts +554 -0
  338. package/dist/schemas/settings.d.ts.map +1 -0
  339. package/dist/schemas/settings.js +263 -0
  340. package/dist/schemas/settings.js.map +1 -0
  341. package/dist/schemas/share.d.ts +49 -0
  342. package/dist/schemas/share.d.ts.map +1 -0
  343. package/dist/schemas/share.js +26 -0
  344. package/dist/schemas/share.js.map +1 -0
  345. package/dist/schemas/shared.d.ts +22 -0
  346. package/dist/schemas/shared.d.ts.map +1 -0
  347. package/dist/schemas/shared.js +16 -0
  348. package/dist/schemas/shared.js.map +1 -0
  349. package/dist/schemas/system.d.ts +86 -0
  350. package/dist/schemas/system.d.ts.map +1 -0
  351. package/dist/schemas/system.js +64 -0
  352. package/dist/schemas/system.js.map +1 -0
  353. package/dist/schemas/terminal.d.ts +230 -0
  354. package/dist/schemas/terminal.d.ts.map +1 -0
  355. package/dist/schemas/terminal.js +133 -0
  356. package/dist/schemas/terminal.js.map +1 -0
  357. package/dist/schemas/usage.d.ts +113 -0
  358. package/dist/schemas/usage.d.ts.map +1 -0
  359. package/dist/schemas/usage.js +91 -0
  360. package/dist/schemas/usage.js.map +1 -0
  361. package/dist/schemas/vpn.d.ts +229 -0
  362. package/dist/schemas/vpn.d.ts.map +1 -0
  363. package/dist/schemas/vpn.js +115 -0
  364. package/dist/schemas/vpn.js.map +1 -0
  365. package/dist/schemas/webext.d.ts +122 -0
  366. package/dist/schemas/webext.d.ts.map +1 -0
  367. package/dist/schemas/webext.js +45 -0
  368. package/dist/schemas/webext.js.map +1 -0
  369. package/dist/schemas/workflows.d.ts +881 -0
  370. package/dist/schemas/workflows.d.ts.map +1 -0
  371. package/dist/schemas/workflows.js +164 -0
  372. package/dist/schemas/workflows.js.map +1 -0
  373. package/dist/schemas/workspace-repos.d.ts +143 -0
  374. package/dist/schemas/workspace-repos.d.ts.map +1 -0
  375. package/dist/schemas/workspace-repos.js +87 -0
  376. package/dist/schemas/workspace-repos.js.map +1 -0
  377. package/dist/schemas/workspace-search.d.ts +170 -0
  378. package/dist/schemas/workspace-search.d.ts.map +1 -0
  379. package/dist/schemas/workspace-search.js +85 -0
  380. package/dist/schemas/workspace-search.js.map +1 -0
  381. package/dist/schemas/workspace-setup.d.ts +48 -0
  382. package/dist/schemas/workspace-setup.d.ts.map +1 -0
  383. package/dist/schemas/workspace-setup.js +26 -0
  384. package/dist/schemas/workspace-setup.js.map +1 -0
  385. package/dist/schemas/workspace-tree.d.ts +120 -0
  386. package/dist/schemas/workspace-tree.d.ts.map +1 -0
  387. package/dist/schemas/workspace-tree.js +111 -0
  388. package/dist/schemas/workspace-tree.js.map +1 -0
  389. package/dist/webext-links.d.ts +14 -0
  390. package/dist/webext-links.d.ts.map +1 -0
  391. package/dist/webext-links.js +25 -0
  392. package/dist/webext-links.js.map +1 -0
  393. package/dist/webext-protocol.d.ts +8 -0
  394. package/dist/webext-protocol.d.ts.map +1 -0
  395. package/dist/webext-protocol.js +7 -0
  396. package/dist/webext-protocol.js.map +1 -0
  397. package/dist/workflow-faults.d.ts +1 -1
  398. package/dist/workflow-faults.d.ts.map +1 -1
  399. package/dist/workspace-state.d.ts +12 -8
  400. package/dist/workspace-state.d.ts.map +1 -1
  401. package/dist/workspace-state.js +15 -10
  402. package/dist/workspace-state.js.map +1 -1
  403. package/package.json +19 -8
  404. package/src/agent-catalog.test.ts +56 -55
  405. package/src/agent-catalog.ts +33 -33
  406. package/src/capability-ledger.test.ts +11 -2
  407. package/src/chores/chores.test.ts +1 -1
  408. package/src/chores/chores.ts +67 -2
  409. package/src/chores/probes.test.ts +65 -0
  410. package/src/chores/probes.ts +133 -1
  411. package/src/chores/stack.test.ts +19 -0
  412. package/src/chores/stack.ts +19 -3
  413. package/src/chores/verdict.test.ts +40 -20
  414. package/src/chores/verdict.ts +1 -1
  415. package/src/command-classes.test.ts +445 -0
  416. package/src/command-classes.ts +468 -0
  417. package/src/contracts/activity.contract.ts +1 -1
  418. package/src/contracts/agent.contract.ts +4 -13
  419. package/src/contracts/agents.contract.ts +6 -6
  420. package/src/contracts/automations.contract.ts +2 -2
  421. package/src/contracts/capabilities.contract.ts +3 -4
  422. package/src/contracts/chores.contract.ts +2 -1
  423. package/src/contracts/ci.contract.ts +2 -2
  424. package/src/contracts/claude.contract.ts +2 -2
  425. package/src/contracts/cursor.contract.ts +2 -2
  426. package/src/contracts/drafts.contract.ts +2 -1
  427. package/src/contracts/endpoints.contract.ts +2 -1
  428. package/src/contracts/exit.contract.ts +2 -1
  429. package/src/contracts/extensions.contract.ts +8 -7
  430. package/src/contracts/git.contract.ts +19 -18
  431. package/src/contracts/grok.contract.ts +2 -1
  432. package/src/contracts/history.contract.ts +2 -1
  433. package/src/contracts/host.contract.ts +4 -1
  434. package/src/contracts/intentic.contract.ts +2 -1
  435. package/src/contracts/inventory.contract.ts +1 -1
  436. package/src/contracts/issues.contract.ts +60 -0
  437. package/src/contracts/logs.contract.ts +7 -1
  438. package/src/contracts/loops.contract.ts +2 -2
  439. package/src/contracts/panels.contract.ts +2 -1
  440. package/src/contracts/personas.contract.ts +3 -3
  441. package/src/contracts/ports.contract.ts +3 -2
  442. package/src/contracts/prepush.contract.ts +2 -1
  443. package/src/contracts/providers.contract.ts +2 -1
  444. package/src/contracts/public.contract.ts +3 -2
  445. package/src/contracts/push.contract.ts +2 -1
  446. package/src/contracts/runner.contract.ts +18 -2
  447. package/src/contracts/secrets.contract.ts +2 -1
  448. package/src/contracts/sessions.contract.ts +1 -1
  449. package/src/contracts/settings.contract.ts +3 -9
  450. package/src/contracts/share.contract.ts +3 -2
  451. package/src/contracts/skills.contract.ts +2 -1
  452. package/src/contracts/system.contract.ts +6 -9
  453. package/src/contracts/translator.contract.ts +4 -1
  454. package/src/contracts/usage.contract.ts +1 -1
  455. package/src/contracts/vpn.contract.ts +2 -8
  456. package/src/contracts/webext.contract.ts +37 -0
  457. package/src/contracts/workflows.contract.ts +2 -2
  458. package/src/contracts/workspace.contract.ts +10 -12
  459. package/src/conversation-ids.test.ts +1 -1
  460. package/src/credential-material.test.ts +120 -0
  461. package/src/credential-material.ts +100 -0
  462. package/src/definition-action.ts +8 -0
  463. package/src/definition.ts +74 -10
  464. package/src/events.ts +84 -22
  465. package/src/fast-tier.ts +1 -1
  466. package/src/history-state.ts +17 -0
  467. package/src/host-protocol.ts +1 -1
  468. package/src/hostnames.test.ts +2 -2
  469. package/src/hostnames.ts +18 -2
  470. package/src/index.ts +65 -1
  471. package/src/listener-protocol.ts +1 -1
  472. package/src/quick-model.ts +1 -1
  473. package/src/routes.test.ts +4 -2
  474. package/src/runner-protocol.ts +35 -5
  475. package/src/runtime-state.ts +16 -0
  476. package/src/schemas/activity.ts +123 -0
  477. package/src/schemas/agent.ts +422 -0
  478. package/src/schemas/agents.ts +802 -0
  479. package/src/schemas/automations.ts +522 -0
  480. package/src/schemas/capabilities.ts +729 -0
  481. package/src/schemas/ci.ts +235 -0
  482. package/src/schemas/claude-gate.ts +13 -0
  483. package/src/schemas/codebase-health.ts +64 -0
  484. package/src/schemas/computers.ts +287 -0
  485. package/src/schemas/drafts.ts +108 -0
  486. package/src/schemas/environment.ts +276 -0
  487. package/src/schemas/exit.ts +222 -0
  488. package/src/schemas/extension-updates.ts +324 -0
  489. package/src/schemas/fast-mode.ts +8 -0
  490. package/src/schemas/git-history.ts +265 -0
  491. package/src/schemas/git.ts +430 -0
  492. package/src/schemas/history.ts +112 -0
  493. package/src/schemas/hosts.ts +37 -0
  494. package/src/schemas/intentic.ts +2 -0
  495. package/src/schemas/internal.ts +17 -0
  496. package/src/schemas/inventory.ts +68 -0
  497. package/src/schemas/issues.ts +279 -0
  498. package/src/schemas/logs.ts +96 -0
  499. package/src/schemas/loops.ts +401 -0
  500. package/src/schemas/maintenance.ts +471 -0
  501. package/src/schemas/marketplace.ts +23 -0
  502. package/src/schemas/panels.ts +99 -0
  503. package/src/schemas/personas.ts +281 -0
  504. package/src/schemas/plan-limits.ts +255 -0
  505. package/src/schemas/ports.ts +84 -0
  506. package/src/schemas/provider-oauth.ts +191 -0
  507. package/src/schemas/provider-subscriptions.ts +11 -0
  508. package/src/schemas/public.ts +52 -0
  509. package/src/schemas/push.ts +112 -0
  510. package/src/schemas/secrets.ts +68 -0
  511. package/src/schemas/sessions.ts +16 -0
  512. package/src/schemas/settings.ts +964 -0
  513. package/src/schemas/share.ts +71 -0
  514. package/src/schemas/shared.ts +32 -0
  515. package/src/schemas/system.ts +156 -0
  516. package/src/schemas/terminal.ts +288 -0
  517. package/src/schemas/usage.ts +303 -0
  518. package/src/{schemas.test.ts → schemas/version-seam.test.ts} +4 -2
  519. package/src/schemas/vpn.ts +215 -0
  520. package/src/schemas/webext.ts +108 -0
  521. package/src/schemas/workflows.ts +413 -0
  522. package/src/schemas/workspace-repos.ts +123 -0
  523. package/src/schemas/workspace-search.ts +141 -0
  524. package/src/schemas/workspace-setup.ts +43 -0
  525. package/src/schemas/workspace-tree.ts +234 -0
  526. package/src/title.test.ts +1 -1
  527. package/src/tunnel-ids.test.ts +3 -1
  528. package/src/webext-links.ts +90 -0
  529. package/src/webext-protocol.ts +27 -0
  530. package/src/workflow-faults.test.ts +1 -1
  531. package/src/workflow-faults.ts +1 -1
  532. package/src/workspace-state.test.ts +6 -4
  533. package/src/workspace-state.ts +35 -50
  534. package/dist/schemas.d.ts +0 -9909
  535. package/dist/schemas.d.ts.map +0 -1
  536. package/dist/schemas.js +0 -4288
  537. package/dist/schemas.js.map +0 -1
  538. package/src/schemas.ts +0 -10090
@@ -0,0 +1,522 @@
1
+ // automations: scheduled agent wake-ups (.intentic/config/automations.json)
2
+ import { z } from "zod";
3
+ import { AgentHarnessSchema, AgentOriginSchema, AgentProviderSchema } from "./agent.js";
4
+ import { AgentSummarySchema } from "./agents.js";
5
+ import { entryId } from "./internal.js";
6
+ import { IssuesConfigSchema } from "./issues.js";
7
+ // An automation wakes the agent autonomously: the daemon's scheduler fires each enabled automation on its
8
+ // trigger, runs the optional guard command (a shell command in the workspace; non-zero exit skips the wake),
9
+ // then runs one agent turn with the prompt. The manifest is user config; run history is daemon-recorded.
10
+
11
+ // `schedule` fires on its cron; `event` fires when an external system POSTs /automations/{id}/fire?token=…
12
+ // (a plain Hono route, webhook bodies are arbitrary). The token is the webhook's own auth (senders can't do
13
+ // Google ID tokens): optional on input, the daemon generates one on upsert, and always present in stored and
14
+ // listed automations, so the owner's UI can render the copyable URL.
15
+ // `listener` fires from a realtime source's connection to the provider (an extension's gateway process holds
16
+ // it, e.g. Discord), no cron, no token, never reachable via /fire. channelId narrows to one channel; absent ⇒
17
+ // every channel the bot can read. eventType narrows to one kind of event (a Discord message, a live voice
18
+ // utterance batch, or a finished voice transcript); absent ⇒ all event kinds the source emits. mentioned
19
+ // narrows message events to those that @mention one of the workspace's bots or reply to a bot's message;
20
+ // absent ⇒ all messages. `provider` and `eventType` are open strings, a realtime source is now extension-
21
+ // declared (contributes.listener), so the daemon validates a listener trigger at upsert against `webchat` ∪ the
22
+ // installed extensions' declared providers/events rather than a hardcoded enum here.
23
+ // `webchat` is the exception: it has no gateway. An embeddable widget POSTs a visitor's message to
24
+ // /webchat/<id>/message and the agent's reply streams back over SSE. Its address is the public automation id, so
25
+ // allowedOrigins (the widget's embed sites) + a per-conversation rate limit are its abuse boundary, no secret
26
+ // token can live in a browser.
27
+ // `ci` is the other gateway-less source: the daemon's own pipeline receiver (ci/events.ts) dispatches it from a
28
+ // provider webhook, or from the REST poller on a sandbox whose hooks could not be registered. Its channelId is
29
+ // the workspace repo, and `branch` is its SECOND narrowing axis, a fleet pushes a branch per agent, so a
30
+ // pipeline trigger that can only say "this repo" says "every agent's every failure".
31
+ // `workspace` fires from the sandbox's OWN codebase instead of the outside world, see WorkspaceEventKindSchema.
32
+
33
+ // What the daemon emits as the fleet works, and what a `workspace` trigger names. These are the events a code
34
+ // CHORE runs on (continuous review, post-land checks): the daemon is both producer and consumer, so unlike
35
+ // `event` there is no token and no route, nothing outside the sandbox can reach them.
36
+ //
37
+ // The two OVERLAP on the common path: a clean turn auto-lands, firing both. A chore should name exactly one.
38
+ // `turn.settled` fires once per isolated turn whatever its outcome, so it also covers the errored and
39
+ // conflicted turns most worth a second pair of eyes, and it fires while the user is still looking at the diff,
40
+ // before they decide to land. `agent.landed` fires only when work actually reached the main tree, including an
41
+ // explicit Land from the review panel long after the turn ended.
42
+ //
43
+ // The `deps.*` pair fires from the dependency verifier (workspace/verify-deps.ts) rather than a turn: after a
44
+ // land drifts dependencies, the daemon installs them and runs the tree's own checks, and these are that chain's
45
+ // EDGES, `deps.broken` when the checks go red after a landed change, `deps.fixed` when a later land turns them
46
+ // green again. Edges, not states, on the ci-events precedent (pipeline_broken): a tree that is red and stays
47
+ // red emits nothing, so a fix chore is woken by the breakage, never by the standing colour.
48
+ export const WorkspaceEventKindSchema = z.enum(["turn.settled", "agent.landed", "deps.broken", "deps.fixed"]);
49
+ export type WorkspaceEventKind = z.infer<typeof WorkspaceEventKindSchema>;
50
+ // The payload a workspace-triggered wake carries: one JSON object, in $AUTOMATION_PAYLOAD for the guard and
51
+ // appended to the prompt for the turn.
52
+ //
53
+ // `repos` names the change to look at as an OPEN span, `git -C <dir> diff <from>`, with no upper bound. Each
54
+ // `from` is where that repo stood before the turn (its last landed tip, or the base it branched from); the
55
+ // other end is deliberately the working tree rather than a sha, because a turn that ERRORED left its work
56
+ // uncommitted in the worktree and a commit-to-commit span would report it as nothing at all. `dir` is that
57
+ // repo's dir inside the agent's own checkout, so a chore reads the agent's work without touching /work.
58
+ //
59
+ // No diffstat rides along on purpose: the registry's counts are refreshed at land, so an errored or conflicted
60
+ // turn would carry stale numbers, and a guard that wants a size threshold gets the true one from
61
+ // `git -C <dir> diff --numstat <from>` for the price of one spawn.
62
+ export const WorkspaceEventSchema = z.object({
63
+ event: WorkspaceEventKindSchema,
64
+ agentId: z.string(),
65
+ title: z.string().optional(),
66
+ branch: z.string(),
67
+ // `ready` is a clean turn whose delta was HELD on the branch (auto-land off), for a chore, the moment
68
+ // before the user's deliberate Land, which is exactly when a pre-land review wants to run.
69
+ outcome: z.enum(["landed", "conflict", "ready", "idle", "error"]),
70
+ repos: z.array(z.object({ repo: z.string(), from: z.string(), dir: z.string() })),
71
+ /* The `deps.*` events' own facts, absent on every turn-borne event. What a fix chore needs to start
72
+ * without rediscovering it: which project broke, the exact command that judged it, how it exited, and the
73
+ * tail of its output, bounded, because the payload rides a prompt and a guard's environment, and the full
74
+ * log is one attach away in the project's `--verify` terminal panel. `attempt` counts consecutive red
75
+ * verifies since the last green, so a guard can cap retries in one visible line of shell. */
76
+ deps: z
77
+ .object({
78
+ project: z.string(),
79
+ command: z.string(),
80
+ exitCode: z.number(),
81
+ attempt: z.number(),
82
+ logTail: z.string(),
83
+ })
84
+ .optional(),
85
+ });
86
+ export type WorkspaceEvent = z.infer<typeof WorkspaceEventSchema>;
87
+ export const TriggerSchema = z.discriminatedUnion("kind", [
88
+ z.object({
89
+ kind: z.literal("schedule").describe("On a clock."),
90
+ cron: z.string().min(1).describe("When, in cron notation."),
91
+ }),
92
+ z.object({
93
+ kind: z.literal("event").describe("When something calls its webhook."),
94
+ token: z
95
+ .string()
96
+ .min(1)
97
+ .optional()
98
+ .describe("The credential a caller presents. It is the only one in the exchange, because an outside sender has no identity here."),
99
+ }),
100
+ z.object({
101
+ kind: z.literal("listener").describe("When a message arrives from somewhere outside."),
102
+ provider: z.string().min(1).describe("Which service to listen to."),
103
+ channelId: z.string().min(1).optional().describe("Narrow it to one channel or thread."),
104
+ eventType: z.string().min(1).optional().describe("Narrow it to one kind of event."),
105
+ mentioned: z.boolean().optional().describe("Only when the agent is actually addressed, rather than on everything said in earshot."),
106
+ // ci only: the git ref the pipeline ran on. Absent ⇒ every branch of the matched repos.
107
+ branch: z
108
+ .string()
109
+ .min(1)
110
+ .optional()
111
+ .describe("Narrow it to one branch, for the sources that have branches. Absent means every branch of the repositories it matches."),
112
+ /* The two gateway-less browser sources, `webchat` and `issues`: the website origins allowed to POST to
113
+ * the public endpoint. Absent/empty ⇒ none admitted, on both. One field rather than one per source,
114
+ * because it is the same question asked of the same header by the same kind of caller, and an intake
115
+ * whose allowlist lived somewhere else would be a second gate to keep in step with the first. */
116
+ allowedOrigins: z
117
+ .array(z.string())
118
+ .optional()
119
+ .describe("Which websites may reach the public endpoint, the chat widget's or the bug reporter's. Absent or empty admits nobody."),
120
+ }),
121
+ // `repo` narrows to events whose span touches one workspace repo ("root" or a repo id); absent ⇒ any.
122
+ z.object({
123
+ kind: z.literal("workspace").describe("When something happens to the files or the repositories."),
124
+ event: WorkspaceEventKindSchema.describe("Which happening."),
125
+ repo: z.string().min(1).optional().describe("Narrow it to one repository. Absent means any of them."),
126
+ }),
127
+ ]);
128
+ export type Trigger = z.infer<typeof TriggerSchema>;
129
+ /* The Front Desk widget's settings, everything about the embeddable chat that isn't the automation's prompt.
130
+ * Present only on `webchat` listener automations; the trigger keeps `allowedOrigins` because that one is the
131
+ * admission gate the message route reads, not a rendering choice.
132
+ *
133
+ * Split deliberately into what the WIDGET may read (title/greeting/accent/position/access/googleClientId/
134
+ * turnstileSiteKey, all public by construction, they ship to a stranger's browser) and what only the daemon
135
+ * may read (turnstileSecret). GET /webchat/<id>/config serves the first group by naming it, never by omitting
136
+ * the second: a field added here is invisible to the widget until it is listed there. */
137
+ export const WebchatConfigSchema = z.object({
138
+ // `public` admits anyone; `google` refuses a message that carries no verifiable Google ID token. Absent ⇒
139
+ // public, a Front Desk with no access setting is the anonymous support box it looks like.
140
+ access: z
141
+ .enum(["public", "google"])
142
+ .optional()
143
+ .describe("Who may write to it. Absent means anyone, which is the anonymous support box it looks like."),
144
+ // Ask an anonymous visitor for a display name before the first message. Cosmetic: the name is typed, so it
145
+ // reaches the model as untrusted `displayName`, never as identity.
146
+ requireName: z
147
+ .boolean()
148
+ .optional()
149
+ .describe(
150
+ "Ask a visitor for a name first. Cosmetic: the name is typed, so it reaches the model as something a stranger said, never as identity.",
151
+ ),
152
+ /* The bot ceiling. `turnstile` is Cloudflare's (invisible, needs the site's own keys); `pow` is a
153
+ * hashcash-style challenge the daemon issues and the widget solves in a worker, so a site with no
154
+ * Cloudflare account still has something. Absent ⇒ off: the origin allowlist and the rate limit are then
155
+ * the whole boundary, which is the right default for an internal or invite-only page. */
156
+ antiBot: z
157
+ .enum(["turnstile", "pow"])
158
+ .optional()
159
+ .describe(
160
+ "How to keep bots out: a third-party check that needs the site's own keys, or a puzzle the sandbox sets and the widget solves, so a site with no such account still has something. Absent leaves the site allowlist and the rate limit as the whole boundary.",
161
+ ),
162
+ turnstileSiteKey: z.string().optional().describe("The public half of those keys, which ships to the visitor's browser."),
163
+ turnstileSecret: z.string().optional().describe("The private half, which the sandbox keeps and the widget never sees."),
164
+ // The site's OWN Google OAuth web client id. It cannot be intentic's: Google Identity Services only issues
165
+ // a token to an authorized JavaScript origin, and intentic's client can't list every customer domain.
166
+ googleClientId: z
167
+ .string()
168
+ .optional()
169
+ .describe(
170
+ "The site's own sign-in client id. It cannot be ours: a sign-in is only issued to an approved origin, and no single client can list every customer's domain.",
171
+ ),
172
+ /* Widget chrome. `position` picks the launcher corner.
173
+ *
174
+ * `accent` is a HEX colour, not any CSS colour, because the widget derives values from its channels rather
175
+ * than just painting it: a glyph step for the scheme, a 14% wash for the send button, a bubble edge, a focus
176
+ * ring, and the label that goes on top (see webchat-widget's styles.ts). A colour we cannot read is a widget
177
+ * with half its accent silently missing, so the unreadable case is rejected here instead. */
178
+ title: z.string().max(80).optional(),
179
+ greeting: z.string().max(500).optional(),
180
+ accent: z
181
+ .string()
182
+ .regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, "accent must be a hex colour, e.g. #e47100")
183
+ .optional(),
184
+ position: z.enum(["top-right", "top-left", "bottom-right", "bottom-left"]).optional(),
185
+ /* Two ceilings on top of the route's fixed per-minute window, because a public endpoint's real exposure is
186
+ * cost, not request rate: `dailyMessageMax` caps the whole automation per UTC day, `conversationMessageMax`
187
+ * caps one visitor thread for its lifetime.
188
+ *
189
+ * `dailyMessageMax` absent ⇒ WEBCHAT_DAILY_MAX_DEFAULT, not uncapped. Every message here is an agent turn
190
+ * billed to the owner, and the per-minute window bounds the RATE without bounding the DAY, twenty a minute,
191
+ * sustained, is tens of thousands of turns before anyone notices. A Front Desk nobody configured should not be
192
+ * able to spend that, so the safe number is the one you get for free and the owner raises it deliberately.
193
+ * `conversationMessageMax` stays optional-means-uncapped: it is per visitor thread, which the daily ceiling
194
+ * already bounds in aggregate. */
195
+ dailyMessageMax: z.number().int().positive().optional(),
196
+ conversationMessageMax: z.number().int().positive().optional(),
197
+ // (WEBCHAT_DAILY_MAX_DEFAULT, below the schema, is the number `dailyMessageMax` falls back to.)
198
+ // How long a visitor thread keeps resuming the same conversation before the next message starts a fresh
199
+ // one. Absent ⇒ WEBCHAT_SESSION_TTL_MS (the daemon's default).
200
+ sessionTtlMinutes: z.number().int().positive().optional(),
201
+ });
202
+ export type WebchatConfig = z.infer<typeof WebchatConfigSchema>;
203
+ /* The daily agent-turn ceiling a Front Desk gets when its owner sets none. Lives here rather than beside the
204
+ * route that enforces it because both ends need the number: the daemon to apply it, and the automation editor
205
+ * to show the owner what they are already protected by (an invisible limit is one people hit and file as a bug).
206
+ *
207
+ * 200 is chosen to be irrelevant to real support traffic and decisive against a script. A Front Desk answering
208
+ * two hundred questions in one UTC day is a busy one; a scripted flood reaches that in ten seconds and then
209
+ * stops costing anything. */
210
+ export const WEBCHAT_DAILY_MAX_DEFAULT = 200;
211
+ /* ---- the widget wire: three shapes GET /webchat/<id>/config, GET …/challenge and POST …/message speak ----
212
+ *
213
+ * They live here, beside the stored config they derive from, because the Front Desk widget is a SECOND client of
214
+ * this daemon, a bundle running on a stranger's page, and the reason this package exists is that both ends of
215
+ * a wire read one definition. The widget imports these as types only (`import type`), so zod never reaches a
216
+ * visitor's browser. */
217
+
218
+ // What the widget is told about itself. Fully RESOLVED, every default is applied daemon-side, so the widget
219
+ // carries no fallback logic and one place decides what an unset field means. Everything here is public by
220
+ // construction: it ships to any browser that can reach the endpoint from an allowed origin.
221
+ export const WebchatPublicConfigSchema = z.object({
222
+ automationId: z.string(),
223
+ title: z.string(),
224
+ greeting: z.string(),
225
+ accent: z.string(),
226
+ position: z.enum(["top-right", "top-left", "bottom-right", "bottom-left"]),
227
+ access: z.enum(["public", "google"]),
228
+ requireName: z.boolean(),
229
+ // "off" is spelled out rather than left absent: the widget branches on this, and a missing field that means
230
+ // "no challenge" is the kind of default that turns one serialization bug into an open door.
231
+ antiBot: z.enum(["turnstile", "pow", "off"]),
232
+ turnstileSiteKey: z.string().optional(),
233
+ googleClientId: z.string().optional(),
234
+ });
235
+ export type WebchatPublicConfig = z.infer<typeof WebchatPublicConfigSchema>;
236
+ // A proof-of-work challenge: find a nonce whose SHA-256 of `${salt}:${nonce}` starts with `difficulty` zero
237
+ // bits. Issued per visitor conversation, spent on its first message.
238
+ export const WebchatChallengeSchema = z.object({ salt: z.string(), difficulty: z.number().int().positive() });
239
+ export type WebchatChallenge = z.infer<typeof WebchatChallengeSchema>;
240
+ // One visitor message. `conversationId` is the widget's own localStorage id, it threads the visitor's messages
241
+ // into ONE sandbox conversation, so it is the thread key, not a secret (anyone can mint one; the origin
242
+ // allowlist, the challenge and the rate limit are the gate).
243
+ export const WebchatMessageSchema = z.object({
244
+ conversationId: z.string().min(1).max(200),
245
+ content: z.string().min(1),
246
+ // What the visitor TYPED as their name. Never identity, it reaches the model tagged as unverified, and a
247
+ // signed-in visitor's verified name comes from the ID token instead.
248
+ displayName: z.string().max(200).optional(),
249
+ // A Google ID token from the site's own client id, verified daemon-side against Google's JWKS.
250
+ idToken: z.string().optional(),
251
+ // The anti-bot answer, whichever kind the config asked for. Checked once per conversation, not per message.
252
+ turnstileToken: z.string().optional(),
253
+ powNonce: z.string().optional(),
254
+ // The widget's own transcript, sent ONLY on the first message of a thread, after that the sandbox
255
+ // conversation resumes and carries its own context.
256
+ history: z
257
+ .array(z.object({ author: z.string().optional(), content: z.string() }))
258
+ .max(50)
259
+ .optional(),
260
+ });
261
+ export type WebchatMessage = z.infer<typeof WebchatMessageSchema>;
262
+ export const AutomationSchema = z.object({
263
+ id: entryId.describe("The automation's id."),
264
+ trigger: TriggerSchema.describe("What sets it off: a schedule, an event in the workspace, a message arriving from outside, or a webhook."),
265
+ // Shell command run in the workspace root before waking; exit 0 ⇒ wake, non-zero ⇒ the run is "skipped".
266
+ guard: z
267
+ .string()
268
+ .min(1)
269
+ .optional()
270
+ .describe(
271
+ "A command run before the wake that decides whether there is anything to do. Skipped by the guard is often the most useful thing an automation can report.",
272
+ ),
273
+ prompt: z.string().min(1).describe("What the woken agent is told."),
274
+ // The Front Desk widget's settings, `webchat` listener automations only, ignored on every other trigger.
275
+ webchat: WebchatConfigSchema.optional().describe("Settings for the public chat widget, for an automation that answers visitors."),
276
+ // The bug intake's settings, `issues` listener automations only, ignored on every other trigger. Its own
277
+ // field rather than a shared "public endpoint" bag: the two sources answer different questions (a chat's
278
+ // greeting and access model, an intake's dedup ceiling and ingest key) and a union of both would be a
279
+ // schema where most fields are wrong for whichever source is reading it.
280
+ issues: IssuesConfigSchema.optional().describe("Settings for the bug reporter, for an automation that takes crash reports from your own sites and apps."),
281
+ /* NARROW THIS ONE JOB FURTHER than the persona it runs as, raw tool names, and the escape hatch under the
282
+ * shelves rather than the way anyone is expected to answer this question.
283
+ *
284
+ * The persona (`actsAs` below) is where a session's toolbox is decided now, because the answer is worth
285
+ * reusing: the same bounds apply to the chat, the workflow and the Front Desk that name the same card. This
286
+ * stays for the job that needs LESS than its persona allows, and only less, which is a rule the composer
287
+ * enforces rather than a convention: an edit here can never hand back a shelf the persona switched off. */
288
+ allowedTools: z
289
+ .array(z.string().min(1))
290
+ .optional()
291
+ .describe(
292
+ "Narrow the woken turn to these tools. For one driven by an outside message this list is the real boundary, because prompt wording is only advice and an empty toolbox is not.",
293
+ ),
294
+ // Which provider adapter serves the wake; absent ⇒ claude. Same dispatch as a chat turn (AgentTurnSchema.agent).
295
+ agent: AgentProviderSchema.optional().describe("Which provider serves the wake."),
296
+ /* Which connected account of that provider serves the wake; absent ⇒ the provider's first account, exactly
297
+ * as for a chat turn (AgentTurnSchema.account).
298
+ *
299
+ * An automation needs this more than a chat does, and for a reason a chat never meets: nobody is watching.
300
+ * A sandbox holds several accounts side by side, and when the first one is out of headroom, or belongs to
301
+ * an organization that has disabled the plan, every fire of every automation errors against it until a
302
+ * human happens to read the row. Pinning the wake to an account that can actually run is the difference
303
+ * between "my nightly sweep is quiet" and a Front Desk that turns visitors away all day. */
304
+ account: z.string().optional().describe("Which account pays for it."),
305
+ /* WHICH FACE THE WAKE SHOWS THE OUTSIDE WORLD (AgentTurnSchema.actsAs, read its note for why this is not
306
+ * spelled `account`, which is the field directly above and means who PAYS).
307
+ *
308
+ * Absent ⇒ the wake reaches NO logged-in account at all. That is the one place this whole layer stops being
309
+ * a convenience and becomes a boundary, and it is deliberately the strictest default in the schema: an
310
+ * automation fires with nobody at the composer, on a prompt that, for a Front Desk, a stranger helped write.
311
+ * `allowedTools` above already carries this exact reasoning for tools; an unrepeatable public post deserves
312
+ * it at least as much. An automation that genuinely means "post as us" says so, once, in a field a reviewer
313
+ * can see. */
314
+ actsAs: entryId.optional().describe("Which persona it speaks as. An unwatched turn naming none reaches no signed-in account at all."),
315
+ // Which harness (agentic loop) runs the wake; absent ⇒ native. Same semantics as AgentTurnSchema.harness.
316
+ harness: AgentHarnessSchema.optional().describe("Which agentic loop runs it."),
317
+ // Which model the wake runs on (see agent-catalog.ts modelsFor); absent ⇒ the provider's default.
318
+ model: z.string().optional().describe("Which model runs it."),
319
+ // When true, a fire doesn't wake the agent, it's held in the approvals queue until the owner approves.
320
+ requireApproval: z.boolean().optional().describe("Hold every fire for a person instead of running it. Only a person can release one of those."),
321
+ /* The middle ground between firing instantly and requiring a click: the fire is held in the same approvals
322
+ * queue, visibly, and the daemon runs it ITSELF once the hold has elapsed AND no agent turn is live, the
323
+ * owner's window to cancel or start it early, with silence as consent. What a fix chore wants: time to see
324
+ * "checks broke, a fix is about to start" without a standing decision to make. `requireApproval` wins when
325
+ * both are set, an explicit "ask me" must never quietly become "unless I'm slow". */
326
+ holdForSeconds: z.number().optional().describe("Hold each fire this long before running it anyway, which is a delay rather than a decision."),
327
+ // A code CHORE: maintenance of THIS codebase rather than a reaction to the outside world. Purely a
328
+ // classification, the daemon fires a chore exactly like any other automation, but it cannot be derived
329
+ // from the trigger, which is why it is stored: a nightly `pnpm audit` sweep and a nightly Stripe poll are
330
+ // both `schedule`, and belong on different shelves. Absent ⇒ an ordinary automation.
331
+ chore: z
332
+ .boolean()
333
+ .optional()
334
+ .describe("This automation is a maintenance job, which is what files it under chores rather than among ordinary automations."),
335
+ enabled: z.boolean().describe("Whether it fires at all."),
336
+ });
337
+ export type Automation = z.infer<typeof AutomationSchema>;
338
+ // A wake held for owner approval (.intentic/records/approvals/<id>.json, one file per held wake). It snapshots the
339
+ // trigger payload so an approved run replays exactly what fired, even across a daemon restart. The id is minted
340
+ // by the daemon (an entryId-safe filename).
341
+ export const AutomationApprovalSchema = z.object({
342
+ id: entryId.describe("This waiting item's own id, which approving and rejecting take."),
343
+ automationId: z.string().describe("Which automation it came from."),
344
+ // The event/listener payload the wake would have carried; absent for schedule triggers.
345
+ payload: z
346
+ .string()
347
+ .optional()
348
+ .describe(
349
+ "What set it off, kept whole so an approved wake carries the same thing it would have had. Absent for one on a schedule, which carries nothing.",
350
+ ),
351
+ // The provenance + title the held wake would have opened its conversation with, snapshotted alongside the
352
+ // payload so an approved external wake surfaces on the fleet exactly as an auto one would have.
353
+ origin: AgentOriginSchema.optional().describe(
354
+ "Where the message came from, kept alongside the payload so an approved wake appears on the board exactly as an automatic one would have.",
355
+ ),
356
+ title: z.string().optional().describe("What the conversation would be called."),
357
+ /* The CONTINUING THREAD this wake belonged to, when it had one, the conversation the dispatcher had
358
+ * already opened for it and the provider session that conversation last ran on.
359
+ *
360
+ * Snapshotted for the same reason the payload is, and it is the half that was missing: without it an
361
+ * approved wake fell through to minting a fresh conversation, so a Front Desk visitor's chat became one card
362
+ * per approved message instead of the single thread the dispatcher had opened for them, a second worktree
363
+ * each time, and an agent that met the visitor again on every turn. Absent for a schedule or a webhook,
364
+ * which own no thread. */
365
+ conversationId: z
366
+ .string()
367
+ .optional()
368
+ .describe(
369
+ "The thread this belongs to, when it has one, so approving continues that conversation rather than opening a new one. Without it, one visitor's chat becomes a card per approved message and an agent that meets them again every turn.",
370
+ ),
371
+ sessionId: z.string().optional().describe("The provider session that thread last ran on."),
372
+ createdAt: z.number().describe("When it started waiting, in milliseconds."),
373
+ /* Epoch ms after which the daemon may run this wake itself (a `holdForSeconds` hold), the countdown the
374
+ * row renders, and the deadline the scheduler's tick checks against. Absent on a `requireApproval` hold,
375
+ * which only the owner may release. */
376
+ autoRunAt: z
377
+ .number()
378
+ .optional()
379
+ .describe(
380
+ "When it goes ahead on its own, in milliseconds, for a hold that is only a delay. Absent for one that genuinely waits on a person.",
381
+ ),
382
+ });
383
+ export type AutomationApproval = z.infer<typeof AutomationApprovalSchema>;
384
+ // `rev` is the registry revision this roster was read at, a counter the daemon bumps on every registry change.
385
+ // It is what makes the browser's optimistic writes safe: the fleet is published as full snapshots (last frame
386
+ // wins), so without an ordering stamp a roster READ before a mutation but delivered after it silently puts the
387
+ // mutated agents back. The browser drops any roster older than the newest it has applied, and holds its own
388
+ // pending change until a roster at or past the revision that applied it arrives. See useAgents.ts.
389
+ // `held` is the approvals queue projected onto the board, the wakes waiting at the door, so "needs you" sits
390
+ // beside "running" instead of in a page nobody opens. Defaulted so an older daemon's roster still parses.
391
+ export const AgentsListSchema = z.object({
392
+ agents: z.array(AgentSummarySchema).describe("The conversations."),
393
+ rev: z
394
+ .number()
395
+ .describe(
396
+ "Which version of the fleet this is. The fleet is published as whole snapshots, so without a version a list read before a change but delivered after it would silently undo that change. Drop any list older than the newest you have already applied.",
397
+ ),
398
+ held: z
399
+ .array(AutomationApprovalSchema)
400
+ .default([])
401
+ .describe(
402
+ "Automations waiting at the door for a yes, put alongside the running conversations so needs-you sits beside working rather than on a page nobody opens.",
403
+ ),
404
+ });
405
+ export type AgentsList = z.infer<typeof AgentsListSchema>;
406
+ export const AutomationApprovalsListSchema = z.object({ approvals: z.array(AutomationApprovalSchema).describe("Everything waiting for a yes.") });
407
+ export const AutomationApprovalIdParamSchema = z.object({ id: z.string().describe("Which waiting item.") });
408
+ export const AutomationRunSchema = z.object({
409
+ at: z.number(),
410
+ // skipped = the guard said no; error = the guard passed but the agent turn surfaced an error; interrupted =
411
+ // the daemon died mid-wake, so the run reached no outcome of its own (see agent/turn-journal.ts). Without
412
+ // that last one an interrupted fire records NOTHING and simply vanishes from the row's history, which reads
413
+ // as "it never fired", the one reading a 3 a.m. automation must not be given.
414
+ outcome: z.enum(["completed", "skipped", "error", "interrupted"]),
415
+ detail: z.string().optional(),
416
+ // The stable conversation opened by the wake, so the row can open the provider-neutral agent transcript.
417
+ // Absent only for a run skipped before a conversation was needed.
418
+ conversationId: z.string().optional(),
419
+ });
420
+ export type AutomationRun = z.infer<typeof AutomationRunSchema>;
421
+ // The list row: the stored automation + its recent runs + the next scheduled fire (absent when disabled).
422
+ export const AutomationSummarySchema = AutomationSchema.extend({
423
+ runs: z.array(AutomationRunSchema),
424
+ nextRun: z.number().optional(),
425
+ });
426
+ export type AutomationSummary = z.infer<typeof AutomationSummarySchema>;
427
+ export const AutomationsListSchema = z.object({ automations: z.array(AutomationSummarySchema) });
428
+ export const AutomationIdParamSchema = z.object({ id: z.string() });
429
+ export const AutomationEnabledInputSchema = z.object({ id: z.string(), enabled: z.boolean() });
430
+ /* ---- the automation catalogue: everything that can wake an agent here, and what to start from ----
431
+ *
432
+ * ONE ANSWER TO ONE QUESTION, and that is the whole reason it exists. The composer used to carry a hand-written
433
+ * list of every source and every template. CI, Komodo, Sentry, Stripe, email, the website widget, the chore
434
+ * book, while the daemon's upsert carried a SECOND hand-written list of the providers it would accept. Two
435
+ * lists, edited in different packages, disagreeing was a matter of time; and every area that gained something
436
+ * worth waking on had to edit the automations surface to say so, which is the dependency pointing backwards.
437
+ *
438
+ * Now the daemon merges what IT emits with what every installed extension declares, and serves the result. The
439
+ * composer draws whatever comes back and knows the name of nothing; `upsert` validates against the same merge.
440
+ * An area gains a trigger by declaring it, and the surface it appears on does not change.
441
+ *
442
+ * WHERE A SOURCE IS DECLARED IS WHERE ITS EVENTS COME FROM, `webchat` and `ci` are the daemon's own (it holds
443
+ * the widget endpoint and the pipeline webhook receiver), every other one belongs to the extension whose
444
+ * gateway or backend dispatches it.
445
+ *
446
+ * A TEMPLATE SITS BESIDE THE SOURCE IT FIRES ON, because the source's starter and the template's prompt
447
+ * describe the same payload, and one payload described in two packages is two descriptions to keep in step. A
448
+ * template on the generic `event` webhook has no source to sit beside, so it goes with the pack carrying the
449
+ * capability card it names, which is the same pack the user connected to make it work at all. */
450
+
451
+ // A source's per-source narrowing field, as the generic editor draws it. Absent ⇒ the editor offers no such
452
+ // filter rather than inventing one the provider has no meaning for.
453
+ const TriggerFieldSchema = z.object({ label: z.string().min(1), placeholder: z.string().min(1), hint: z.string().min(1).optional() });
454
+ export const TriggerSourceSchema = z.object({
455
+ // The slug a listener trigger fires on (Trigger.provider).
456
+ provider: z.string().min(1),
457
+ label: z.string().min(1),
458
+ // Simple-icons slug, or an app glyph, the same logo/icon split a capability card and an extension mark draw.
459
+ logo: z.string().min(1).optional(),
460
+ icon: z.string().min(1).optional(),
461
+ events: z.array(z.object({ value: z.string().min(1), label: z.string().min(1) })),
462
+ channel: TriggerFieldSchema,
463
+ // A SECOND narrowing axis, for sources whose events carry one, `ci` narrows by git ref as well as by repo.
464
+ branchField: TriggerFieldSchema.optional(),
465
+ // Only sources whose `message` events distinguish addressed messages set this; absent ⇒ no mention-only filter.
466
+ mentionLabel: z.string().min(1).optional(),
467
+ // The provider owns the payload vocabulary, so it owns the first prompt that explains that payload.
468
+ starterPrompt: z.string().min(1).optional(),
469
+ /* Capability providers that make this source WORK, any one of them connected is enough (a CI trigger rides
470
+ * github or gitlab). Empty ⇒ nothing to connect, the source is usable as it stands. Availability is computed
471
+ * in the browser rather than served, because the browser's capability facts are pushed live and a served
472
+ * boolean would be stale between polls. */
473
+ requires: z.array(z.string().min(1)).default([]),
474
+ /* Whether the extension declaring this is switched ON. Disabled ones are still listed, and that is the
475
+ * point: a stored automation must stay readable and editable while the pack that supplied its provider is
476
+ * off, showing the real label instead of degrading to a bare slug. */
477
+ enabled: z.boolean(),
478
+ });
479
+ export type TriggerSource = z.infer<typeof TriggerSourceSchema>;
480
+ /* HOW A TEMPLATE IS OFFERED. Absent ⇒ it lives in the create dialog's gallery, where you go once you know what
481
+ * you want. The two named forms are for what a user would never think to go looking for:
482
+ * create , a shelf card on the page that makes the automation in one click, switched off, ready to read.
483
+ * The chores are all of these: upkeep nobody opens an automations page hunting for.
484
+ * configure, a shelf card that opens the dialog PREFILLED, for a template that cannot work unconfigured (a
485
+ * Front Desk with no allowed sites admits nobody, and a row that silently does nothing is worse
486
+ * than a form). */
487
+ export const TemplateOfferSchema = z.enum(["create", "configure"]);
488
+ export const AutomationTemplateSchema = z.object({
489
+ // Prefills the automation name, so it is also what "does one of these already exist" is asked by.
490
+ id: z.string().min(1),
491
+ title: z.string().min(1),
492
+ logo: z.string().min(1).optional(),
493
+ icon: z.string().min(1).optional(),
494
+ // Same rule as a source's: any one connected is enough, empty ⇒ always offered.
495
+ requires: z.array(z.string().min(1)).default([]),
496
+ trigger: TriggerSchema,
497
+ // Prefills the guard command (a shell one-liner; non-zero exit skips the wake).
498
+ guard: z.string().min(1).optional(),
499
+ // Prefills the countdown hold: each fire waits this long, visibly and cancellably, before starting itself.
500
+ holdForSeconds: z.number().int().positive().optional(),
501
+ prompt: z.string().min(1),
502
+ // The card's disclosure under the title, "instant", "checks every 5 min", "skips changes under 20 lines".
503
+ note: z.string().min(1).optional(),
504
+ // Post-save instructions: where to paste the webhook URL this automation just minted.
505
+ setup: z.string().min(1).optional(),
506
+ // What the shelf card says under the title. Only offered templates need one; a gallery entry has its
507
+ // trigger beside it for context.
508
+ description: z.string().min(1).optional(),
509
+ offer: TemplateOfferSchema.optional(),
510
+ /* WHETHER THE AUTOMATION THIS MAKES WATCHES THIS CODEBASE, the flag the created record stores, which is
511
+ * what puts its row on the chores shelf rather than among the integrations.
512
+ *
513
+ * Carried rather than inferred from the trigger, because a nightly dependency sweep and a nightly Stripe
514
+ * poll are both `schedule` and only one of them is about your code. */
515
+ chore: z.boolean().optional(),
516
+ });
517
+ export type AutomationTemplate = z.infer<typeof AutomationTemplateSchema>;
518
+ export const AutomationCatalogSchema = z.object({
519
+ sources: z.array(TriggerSourceSchema),
520
+ templates: z.array(AutomationTemplateSchema),
521
+ });
522
+ export type AutomationCatalog = z.infer<typeof AutomationCatalogSchema>;