@intentic/sandbox-contract 1.248.0 → 1.249.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 (877) hide show
  1. package/README.md +18 -15
  2. package/dist/chores/chores.d.ts.map +1 -1
  3. package/dist/chores/chores.js.map +1 -1
  4. package/dist/chores/digest.d.ts.map +1 -1
  5. package/dist/chores/digest.js.map +1 -1
  6. package/dist/chores/extension-update.d.ts.map +1 -1
  7. package/dist/chores/extension-update.js.map +1 -1
  8. package/dist/chores/fix-deps.d.ts.map +1 -1
  9. package/dist/chores/fix-deps.js.map +1 -1
  10. package/dist/chores/index.d.ts +2 -2
  11. package/dist/chores/index.d.ts.map +1 -1
  12. package/dist/chores/index.js +1 -1
  13. package/dist/chores/index.js.map +1 -1
  14. package/dist/chores/probes.d.ts.map +1 -1
  15. package/dist/chores/probes.js.map +1 -1
  16. package/dist/chores/prompt.d.ts.map +1 -1
  17. package/dist/chores/prompt.js.map +1 -1
  18. package/dist/chores/stack.d.ts.map +1 -1
  19. package/dist/chores/stack.js.map +1 -1
  20. package/dist/chores/verdict.d.ts +7 -1
  21. package/dist/chores/verdict.d.ts.map +1 -1
  22. package/dist/chores/verdict.js +8 -0
  23. package/dist/chores/verdict.js.map +1 -1
  24. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  25. package/dist/contracts/accounts.contract.js.map +1 -1
  26. package/dist/contracts/activity.contract.d.ts +1 -0
  27. package/dist/contracts/activity.contract.d.ts.map +1 -1
  28. package/dist/contracts/agent.contract.d.ts +12 -205
  29. package/dist/contracts/agent.contract.d.ts.map +1 -1
  30. package/dist/contracts/agent.contract.js +2 -1
  31. package/dist/contracts/agent.contract.js.map +1 -1
  32. package/dist/contracts/agents.contract.d.ts +228 -54
  33. package/dist/contracts/agents.contract.d.ts.map +1 -1
  34. package/dist/contracts/agents.contract.js +11 -2
  35. package/dist/contracts/agents.contract.js.map +1 -1
  36. package/dist/contracts/automations.contract.d.ts +35 -17
  37. package/dist/contracts/automations.contract.d.ts.map +1 -1
  38. package/dist/contracts/automations.contract.js +10 -1
  39. package/dist/contracts/automations.contract.js.map +1 -1
  40. package/dist/contracts/capabilities.contract.d.ts +0 -12
  41. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  42. package/dist/contracts/capabilities.contract.js +1 -1
  43. package/dist/contracts/capabilities.contract.js.map +1 -1
  44. package/dist/contracts/chores.contract.d.ts.map +1 -1
  45. package/dist/contracts/chores.contract.js.map +1 -1
  46. package/dist/contracts/ci.contract.d.ts +9 -0
  47. package/dist/contracts/ci.contract.d.ts.map +1 -1
  48. package/dist/contracts/endpoints.contract.d.ts.map +1 -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 +1 -1
  52. package/dist/contracts/exit.contract.js.map +1 -1
  53. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  54. package/dist/contracts/extensions.contract.js.map +1 -1
  55. package/dist/contracts/git.contract.d.ts +45 -6
  56. package/dist/contracts/git.contract.d.ts.map +1 -1
  57. package/dist/contracts/git.contract.js +9 -9
  58. package/dist/contracts/git.contract.js.map +1 -1
  59. package/dist/contracts/host.contract.d.ts +2 -0
  60. package/dist/contracts/host.contract.d.ts.map +1 -1
  61. package/dist/contracts/host.contract.js.map +1 -1
  62. package/dist/contracts/intentic.contract.js +1 -1
  63. package/dist/contracts/intentic.contract.js.map +1 -1
  64. package/dist/contracts/logs.contract.d.ts.map +1 -1
  65. package/dist/contracts/logs.contract.js.map +1 -1
  66. package/dist/contracts/loops.contract.d.ts.map +1 -1
  67. package/dist/contracts/loops.contract.js.map +1 -1
  68. package/dist/contracts/personas.contract.d.ts +1 -0
  69. package/dist/contracts/personas.contract.d.ts.map +1 -1
  70. package/dist/contracts/personas.contract.js +1 -1
  71. package/dist/contracts/personas.contract.js.map +1 -1
  72. package/dist/contracts/providers.contract.d.ts.map +1 -1
  73. package/dist/contracts/providers.contract.js.map +1 -1
  74. package/dist/contracts/runner.contract.d.ts +97 -171
  75. package/dist/contracts/runner.contract.d.ts.map +1 -1
  76. package/dist/contracts/runner.contract.js +2 -2
  77. package/dist/contracts/runner.contract.js.map +1 -1
  78. package/dist/contracts/safety.contract.d.ts.map +1 -1
  79. package/dist/contracts/safety.contract.js +1 -1
  80. package/dist/contracts/safety.contract.js.map +1 -1
  81. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  82. package/dist/contracts/secrets.contract.js.map +1 -1
  83. package/dist/contracts/sessions.contract.d.ts +2 -41
  84. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  85. package/dist/contracts/sessions.contract.js +1 -1
  86. package/dist/contracts/sessions.contract.js.map +1 -1
  87. package/dist/contracts/settings.contract.d.ts +8 -18
  88. package/dist/contracts/settings.contract.d.ts.map +1 -1
  89. package/dist/contracts/settings.contract.js.map +1 -1
  90. package/dist/contracts/share.contract.d.ts.map +1 -1
  91. package/dist/contracts/share.contract.js.map +1 -1
  92. package/dist/contracts/skills.contract.d.ts.map +1 -1
  93. package/dist/contracts/skills.contract.js.map +1 -1
  94. package/dist/contracts/system.contract.d.ts +49 -73
  95. package/dist/contracts/system.contract.d.ts.map +1 -1
  96. package/dist/contracts/system.contract.js +12 -2
  97. package/dist/contracts/system.contract.js.map +1 -1
  98. package/dist/contracts/usage.contract.d.ts.map +1 -1
  99. package/dist/contracts/usage.contract.js.map +1 -1
  100. package/dist/contracts/vpn.contract.d.ts.map +1 -1
  101. package/dist/contracts/vpn.contract.js +1 -1
  102. package/dist/contracts/vpn.contract.js.map +1 -1
  103. package/dist/contracts/webext.contract.d.ts.map +1 -1
  104. package/dist/contracts/webext.contract.js.map +1 -1
  105. package/dist/contracts/workflows.contract.d.ts +7 -6
  106. package/dist/contracts/workflows.contract.d.ts.map +1 -1
  107. package/dist/contracts/workflows.contract.js +12 -3
  108. package/dist/contracts/workflows.contract.js.map +1 -1
  109. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  110. package/dist/contracts/workspace.contract.js.map +1 -1
  111. package/dist/events/agent-events.d.ts +1237 -0
  112. package/dist/events/agent-events.d.ts.map +1 -0
  113. package/dist/events/agent-events.js +226 -0
  114. package/dist/events/agent-events.js.map +1 -0
  115. package/dist/events/cards.d.ts +404 -0
  116. package/dist/events/cards.d.ts.map +1 -0
  117. package/dist/events/cards.js +179 -0
  118. package/dist/events/cards.js.map +1 -0
  119. package/dist/events/resume.d.ts +23 -0
  120. package/dist/events/resume.d.ts.map +1 -0
  121. package/dist/events/resume.js +31 -0
  122. package/dist/events/resume.js.map +1 -0
  123. package/dist/events/system-events.d.ts +615 -0
  124. package/dist/events/system-events.d.ts.map +1 -0
  125. package/dist/events/system-events.js +64 -0
  126. package/dist/events/system-events.js.map +1 -0
  127. package/dist/events/transcript.d.ts +1755 -0
  128. package/dist/events/transcript.d.ts.map +1 -0
  129. package/dist/events/transcript.js +205 -0
  130. package/dist/events/transcript.js.map +1 -0
  131. package/dist/ids/conversation-ids.d.ts +8 -0
  132. package/dist/ids/conversation-ids.d.ts.map +1 -0
  133. package/dist/{conversation-ids.js → ids/conversation-ids.js} +13 -0
  134. package/dist/ids/conversation-ids.js.map +1 -0
  135. package/dist/ids/hostnames.d.ts.map +1 -0
  136. package/dist/ids/hostnames.js.map +1 -0
  137. package/dist/ids/session-names.d.ts.map +1 -0
  138. package/dist/ids/session-names.js.map +1 -0
  139. package/dist/ids/share-paths.d.ts.map +1 -0
  140. package/dist/ids/share-paths.js.map +1 -0
  141. package/dist/{tunnel-ids.d.ts → ids/tunnel-ids.d.ts} +1 -0
  142. package/dist/ids/tunnel-ids.d.ts.map +1 -0
  143. package/dist/{tunnel-ids.js → ids/tunnel-ids.js} +1 -0
  144. package/dist/ids/tunnel-ids.js.map +1 -0
  145. package/dist/index.d.ts +423 -450
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +54 -46
  148. package/dist/index.js.map +1 -1
  149. package/dist/{agent-catalog.d.ts → models/agent-catalog.d.ts} +2 -2
  150. package/dist/models/agent-catalog.d.ts.map +1 -0
  151. package/dist/models/agent-catalog.js.map +1 -0
  152. package/dist/models/agent-runtimes.d.ts.map +1 -0
  153. package/dist/models/agent-runtimes.js.map +1 -0
  154. package/dist/{fast-tier.d.ts → models/fast-tier.d.ts} +1 -1
  155. package/dist/models/fast-tier.d.ts.map +1 -0
  156. package/dist/models/fast-tier.js.map +1 -0
  157. package/dist/models/model-order.d.ts.map +1 -0
  158. package/dist/models/model-order.js.map +1 -0
  159. package/dist/{model-pins.d.ts → models/model-pins.d.ts} +1 -1
  160. package/dist/models/model-pins.d.ts.map +1 -0
  161. package/dist/models/model-pins.js.map +1 -0
  162. package/dist/{model-roles.d.ts → models/model-roles.d.ts} +0 -33
  163. package/dist/models/model-roles.d.ts.map +1 -0
  164. package/dist/{model-roles.js → models/model-roles.js} +0 -35
  165. package/dist/models/model-roles.js.map +1 -0
  166. package/dist/{plan-pools.d.ts → models/plan-pools.d.ts} +1 -1
  167. package/dist/models/plan-pools.d.ts.map +1 -0
  168. package/dist/models/plan-pools.js.map +1 -0
  169. package/dist/models/prompt-complexity.d.ts.map +1 -0
  170. package/dist/models/prompt-complexity.js.map +1 -0
  171. package/dist/models/provider-specs.d.ts.map +1 -0
  172. package/dist/models/provider-specs.js.map +1 -0
  173. package/dist/policy/approvals-execution.d.ts.map +1 -0
  174. package/dist/policy/approvals-execution.js.map +1 -0
  175. package/dist/{batch-runs.d.ts → policy/batch-runs.d.ts} +5 -1
  176. package/dist/policy/batch-runs.d.ts.map +1 -0
  177. package/dist/{batch-runs.js → policy/batch-runs.js} +10 -7
  178. package/dist/policy/batch-runs.js.map +1 -0
  179. package/dist/policy/capability-env.d.ts.map +1 -0
  180. package/dist/policy/capability-env.js.map +1 -0
  181. package/dist/policy/capability-secrets.d.ts.map +1 -0
  182. package/dist/policy/capability-secrets.js.map +1 -0
  183. package/dist/{card-status.d.ts → policy/card-status.d.ts} +2 -2
  184. package/dist/policy/card-status.d.ts.map +1 -0
  185. package/dist/{card-status.js → policy/card-status.js} +1 -5
  186. package/dist/policy/card-status.js.map +1 -0
  187. package/dist/{command-classes.d.ts → policy/command-classes.d.ts} +6 -2
  188. package/dist/policy/command-classes.d.ts.map +1 -0
  189. package/dist/{command-classes.js → policy/command-classes.js} +48 -11
  190. package/dist/policy/command-classes.js.map +1 -0
  191. package/dist/{command-run.d.ts → policy/command-run.d.ts} +1 -1
  192. package/dist/policy/command-run.d.ts.map +1 -0
  193. package/dist/policy/command-run.js.map +1 -0
  194. package/dist/policy/control-scopes.d.ts +16 -0
  195. package/dist/policy/control-scopes.d.ts.map +1 -0
  196. package/dist/policy/control-scopes.js +26 -0
  197. package/dist/policy/control-scopes.js.map +1 -0
  198. package/dist/policy/credential-material.d.ts.map +1 -0
  199. package/dist/policy/credential-material.js.map +1 -0
  200. package/dist/policy/needs-action.d.ts.map +1 -0
  201. package/dist/policy/needs-action.js.map +1 -0
  202. package/dist/policy/output-fields.d.ts.map +1 -0
  203. package/dist/policy/output-fields.js.map +1 -0
  204. package/dist/policy/overlay-lint.d.ts.map +1 -0
  205. package/dist/policy/overlay-lint.js.map +1 -0
  206. package/dist/policy/owner-ticket.d.ts.map +1 -0
  207. package/dist/{owner-ticket.js → policy/owner-ticket.js} +1 -1
  208. package/dist/policy/owner-ticket.js.map +1 -0
  209. package/dist/{safety-policy.d.ts → policy/safety-policy.d.ts} +6 -5
  210. package/dist/policy/safety-policy.d.ts.map +1 -0
  211. package/dist/{safety-policy.js → policy/safety-policy.js} +12 -12
  212. package/dist/policy/safety-policy.js.map +1 -0
  213. package/dist/policy/search-globs.d.ts.map +1 -0
  214. package/dist/policy/search-globs.js.map +1 -0
  215. package/dist/protocol/container-requirements.d.ts +20 -0
  216. package/dist/protocol/container-requirements.d.ts.map +1 -0
  217. package/dist/protocol/container-requirements.js +23 -0
  218. package/dist/protocol/container-requirements.js.map +1 -0
  219. package/dist/{host-protocol.d.ts → protocol/host-protocol.d.ts} +1 -0
  220. package/dist/protocol/host-protocol.d.ts.map +1 -0
  221. package/dist/{host-protocol.js → protocol/host-protocol.js} +1 -0
  222. package/dist/protocol/host-protocol.js.map +1 -0
  223. package/dist/protocol/ingress-contract.d.ts.map +1 -0
  224. package/dist/{ingress-contract.js → protocol/ingress-contract.js} +1 -1
  225. package/dist/protocol/ingress-contract.js.map +1 -0
  226. package/dist/protocol/ingress-protocol.d.ts.map +1 -0
  227. package/dist/protocol/ingress-protocol.js.map +1 -0
  228. package/dist/protocol/listener-protocol.d.ts.map +1 -0
  229. package/dist/{listener-protocol.js → protocol/listener-protocol.js} +1 -1
  230. package/dist/protocol/listener-protocol.js.map +1 -0
  231. package/dist/{peer-dial.d.ts → protocol/peer-dial.d.ts} +4 -1
  232. package/dist/protocol/peer-dial.d.ts.map +1 -0
  233. package/dist/{peer-dial.js → protocol/peer-dial.js} +51 -10
  234. package/dist/protocol/peer-dial.js.map +1 -0
  235. package/dist/protocol/peer-mcp-server.d.ts.map +1 -0
  236. package/dist/protocol/peer-mcp-server.js.map +1 -0
  237. package/dist/protocol/request-id.d.ts.map +1 -0
  238. package/dist/protocol/request-id.js.map +1 -0
  239. package/dist/protocol/routes.d.ts.map +1 -0
  240. package/dist/protocol/routes.js.map +1 -0
  241. package/dist/{runner-protocol.d.ts → protocol/runner-protocol.d.ts} +1 -0
  242. package/dist/protocol/runner-protocol.d.ts.map +1 -0
  243. package/dist/{runner-protocol.js → protocol/runner-protocol.js} +2 -1
  244. package/dist/protocol/runner-protocol.js.map +1 -0
  245. package/dist/protocol/sse.d.ts.map +1 -0
  246. package/dist/protocol/sse.js.map +1 -0
  247. package/dist/{terminal-protocol.d.ts → protocol/terminal-protocol.d.ts} +1 -3
  248. package/dist/protocol/terminal-protocol.d.ts.map +1 -0
  249. package/dist/protocol/terminal-protocol.js.map +1 -0
  250. package/dist/protocol/webext-links.d.ts.map +1 -0
  251. package/dist/protocol/webext-links.js.map +1 -0
  252. package/dist/{webext-protocol.d.ts → protocol/webext-protocol.d.ts} +1 -0
  253. package/dist/protocol/webext-protocol.d.ts.map +1 -0
  254. package/dist/{webext-protocol.js → protocol/webext-protocol.js} +1 -0
  255. package/dist/protocol/webext-protocol.js.map +1 -0
  256. package/dist/schemas/activity.d.ts +2 -0
  257. package/dist/schemas/activity.d.ts.map +1 -1
  258. package/dist/schemas/activity.js +4 -0
  259. package/dist/schemas/activity.js.map +1 -1
  260. package/dist/schemas/agent.d.ts +16 -4
  261. package/dist/schemas/agent.d.ts.map +1 -1
  262. package/dist/schemas/agent.js +21 -4
  263. package/dist/schemas/agent.js.map +1 -1
  264. package/dist/schemas/agents.d.ts +17 -4
  265. package/dist/schemas/agents.d.ts.map +1 -1
  266. package/dist/schemas/agents.js +15 -4
  267. package/dist/schemas/agents.js.map +1 -1
  268. package/dist/schemas/approvals.d.ts.map +1 -1
  269. package/dist/schemas/approvals.js.map +1 -1
  270. package/dist/schemas/automations.d.ts +54 -28
  271. package/dist/schemas/automations.d.ts.map +1 -1
  272. package/dist/schemas/automations.js +26 -8
  273. package/dist/schemas/automations.js.map +1 -1
  274. package/dist/schemas/capabilities.d.ts +0 -8
  275. package/dist/schemas/capabilities.d.ts.map +1 -1
  276. package/dist/schemas/capabilities.js +0 -4
  277. package/dist/schemas/capabilities.js.map +1 -1
  278. package/dist/schemas/ci.d.ts +10 -0
  279. package/dist/schemas/ci.d.ts.map +1 -1
  280. package/dist/schemas/ci.js +9 -1
  281. package/dist/schemas/ci.js.map +1 -1
  282. package/dist/schemas/codebase-health.d.ts.map +1 -1
  283. package/dist/schemas/codebase-health.js.map +1 -1
  284. package/dist/schemas/devices.d.ts +90 -0
  285. package/dist/schemas/devices.d.ts.map +1 -1
  286. package/dist/schemas/devices.js +10 -1
  287. package/dist/schemas/devices.js.map +1 -1
  288. package/dist/schemas/engines.d.ts.map +1 -1
  289. package/dist/schemas/engines.js.map +1 -1
  290. package/dist/schemas/environment.d.ts.map +1 -1
  291. package/dist/schemas/environment.js.map +1 -1
  292. package/dist/schemas/exit.d.ts.map +1 -1
  293. package/dist/schemas/exit.js.map +1 -1
  294. package/dist/schemas/extension-updates.d.ts.map +1 -1
  295. package/dist/schemas/extension-updates.js.map +1 -1
  296. package/dist/schemas/git-history.d.ts.map +1 -1
  297. package/dist/schemas/git-history.js.map +1 -1
  298. package/dist/schemas/git.d.ts +80 -16
  299. package/dist/schemas/git.d.ts.map +1 -1
  300. package/dist/schemas/git.js +37 -25
  301. package/dist/schemas/git.js.map +1 -1
  302. package/dist/schemas/history.d.ts.map +1 -1
  303. package/dist/schemas/history.js.map +1 -1
  304. package/dist/schemas/hosts.d.ts.map +1 -1
  305. package/dist/schemas/hosts.js.map +1 -1
  306. package/dist/schemas/inventory.d.ts.map +1 -1
  307. package/dist/schemas/inventory.js.map +1 -1
  308. package/dist/schemas/issues.d.ts +0 -1
  309. package/dist/schemas/issues.d.ts.map +1 -1
  310. package/dist/schemas/issues.js +0 -1
  311. package/dist/schemas/issues.js.map +1 -1
  312. package/dist/schemas/logs.d.ts.map +1 -1
  313. package/dist/schemas/logs.js.map +1 -1
  314. package/dist/schemas/loops.d.ts.map +1 -1
  315. package/dist/schemas/loops.js +1 -1
  316. package/dist/schemas/loops.js.map +1 -1
  317. package/dist/schemas/maintenance.d.ts.map +1 -1
  318. package/dist/schemas/maintenance.js.map +1 -1
  319. package/dist/schemas/marketplace.d.ts +0 -4
  320. package/dist/schemas/marketplace.d.ts.map +1 -1
  321. package/dist/schemas/panels.d.ts.map +1 -1
  322. package/dist/schemas/panels.js.map +1 -1
  323. package/dist/schemas/personas.d.ts +2 -1
  324. package/dist/schemas/personas.d.ts.map +1 -1
  325. package/dist/schemas/personas.js +6 -2
  326. package/dist/schemas/personas.js.map +1 -1
  327. package/dist/schemas/plan-limits.d.ts +2 -4
  328. package/dist/schemas/plan-limits.d.ts.map +1 -1
  329. package/dist/schemas/plan-limits.js +5 -8
  330. package/dist/schemas/plan-limits.js.map +1 -1
  331. package/dist/schemas/ports.d.ts.map +1 -1
  332. package/dist/schemas/ports.js.map +1 -1
  333. package/dist/schemas/provider-oauth.d.ts.map +1 -1
  334. package/dist/schemas/provider-oauth.js.map +1 -1
  335. package/dist/schemas/provider-subscriptions.d.ts +1 -1
  336. package/dist/schemas/provider-subscriptions.d.ts.map +1 -1
  337. package/dist/schemas/provider-subscriptions.js +1 -1
  338. package/dist/schemas/provider-subscriptions.js.map +1 -1
  339. package/dist/schemas/public.d.ts.map +1 -1
  340. package/dist/schemas/public.js.map +1 -1
  341. package/dist/schemas/push.d.ts.map +1 -1
  342. package/dist/schemas/push.js.map +1 -1
  343. package/dist/schemas/secrets.d.ts.map +1 -1
  344. package/dist/schemas/secrets.js.map +1 -1
  345. package/dist/schemas/settings.d.ts +6 -9
  346. package/dist/schemas/settings.d.ts.map +1 -1
  347. package/dist/schemas/settings.js +16 -5
  348. package/dist/schemas/settings.js.map +1 -1
  349. package/dist/schemas/share.d.ts.map +1 -1
  350. package/dist/schemas/share.js.map +1 -1
  351. package/dist/schemas/shared.d.ts +4 -0
  352. package/dist/schemas/shared.d.ts.map +1 -1
  353. package/dist/schemas/shared.js +3 -0
  354. package/dist/schemas/shared.js.map +1 -1
  355. package/dist/schemas/system.d.ts +6 -0
  356. package/dist/schemas/system.d.ts.map +1 -1
  357. package/dist/schemas/system.js +10 -0
  358. package/dist/schemas/system.js.map +1 -1
  359. package/dist/schemas/terminal.d.ts.map +1 -1
  360. package/dist/schemas/terminal.js.map +1 -1
  361. package/dist/schemas/usage.d.ts.map +1 -1
  362. package/dist/schemas/usage.js.map +1 -1
  363. package/dist/schemas/vpn.d.ts.map +1 -1
  364. package/dist/schemas/vpn.js.map +1 -1
  365. package/dist/schemas/webext.d.ts.map +1 -1
  366. package/dist/schemas/webext.js.map +1 -1
  367. package/dist/schemas/workflows.d.ts +66 -9
  368. package/dist/schemas/workflows.d.ts.map +1 -1
  369. package/dist/schemas/workflows.js +6 -5
  370. package/dist/schemas/workflows.js.map +1 -1
  371. package/dist/schemas/workspace-repos.d.ts.map +1 -1
  372. package/dist/schemas/workspace-repos.js.map +1 -1
  373. package/dist/schemas/workspace-search.d.ts.map +1 -1
  374. package/dist/schemas/workspace-search.js.map +1 -1
  375. package/dist/schemas/workspace-setup.d.ts.map +1 -1
  376. package/dist/schemas/workspace-setup.js.map +1 -1
  377. package/dist/schemas/workspace-tree.d.ts.map +1 -1
  378. package/dist/schemas/workspace-tree.js.map +1 -1
  379. package/dist/state/arrival.d.ts.map +1 -0
  380. package/dist/{arrival.js → state/arrival.js} +1 -1
  381. package/dist/state/arrival.js.map +1 -0
  382. package/dist/state/contract-lock.d.ts.map +1 -0
  383. package/dist/{contract-lock.js → state/contract-lock.js} +1 -1
  384. package/dist/state/contract-lock.js.map +1 -0
  385. package/dist/{definition.d.ts → state/definition.d.ts} +21 -17
  386. package/dist/state/definition.d.ts.map +1 -0
  387. package/dist/{definition.js → state/definition.js} +4 -4
  388. package/dist/state/definition.js.map +1 -0
  389. package/dist/state/history-state.d.ts.map +1 -0
  390. package/dist/{history-state.js → state/history-state.js} +1 -0
  391. package/dist/state/history-state.js.map +1 -0
  392. package/dist/state/runtime-state.d.ts.map +1 -0
  393. package/dist/state/runtime-state.js.map +1 -0
  394. package/dist/state/starter.d.ts.map +1 -0
  395. package/dist/state/starter.js.map +1 -0
  396. package/dist/state/state-portability.d.ts.map +1 -0
  397. package/dist/state/state-portability.js.map +1 -0
  398. package/dist/state/versions.d.ts.map +1 -0
  399. package/dist/state/versions.js.map +1 -0
  400. package/dist/{workspace-state.d.ts → state/workspace-state.d.ts} +8 -0
  401. package/dist/state/workspace-state.d.ts.map +1 -0
  402. package/dist/{workspace-state.js → state/workspace-state.js} +25 -0
  403. package/dist/state/workspace-state.js.map +1 -0
  404. package/dist/{documents.d.ts → text/documents.d.ts} +1 -1
  405. package/dist/text/documents.d.ts.map +1 -0
  406. package/dist/{documents.js → text/documents.js} +1 -1
  407. package/dist/text/documents.js.map +1 -0
  408. package/dist/text/embed.d.ts.map +1 -0
  409. package/dist/text/embed.js.map +1 -0
  410. package/dist/text/mentions.d.ts.map +1 -0
  411. package/dist/text/mentions.js.map +1 -0
  412. package/dist/text/model-answer.d.ts +3 -0
  413. package/dist/text/model-answer.d.ts.map +1 -0
  414. package/dist/text/model-answer.js +3 -0
  415. package/dist/text/model-answer.js.map +1 -0
  416. package/dist/text/path-refs.d.ts.map +1 -0
  417. package/dist/text/path-refs.js.map +1 -0
  418. package/dist/{shell-regions.d.ts → text/shell-regions.d.ts} +1 -1
  419. package/dist/text/shell-regions.d.ts.map +1 -0
  420. package/dist/text/shell-regions.js.map +1 -0
  421. package/dist/text/title.d.ts.map +1 -0
  422. package/dist/text/title.js.map +1 -0
  423. package/dist/{transcript-fold.d.ts → text/transcript-fold.d.ts} +2 -1
  424. package/dist/text/transcript-fold.d.ts.map +1 -0
  425. package/dist/{transcript-fold.js → text/transcript-fold.js} +2 -16
  426. package/dist/text/transcript-fold.js.map +1 -0
  427. package/dist/text/whisper.d.ts +3 -0
  428. package/dist/text/whisper.d.ts.map +1 -0
  429. package/dist/text/whisper.js +11 -0
  430. package/dist/text/whisper.js.map +1 -0
  431. package/dist/{workflow-faults.d.ts → text/workflow-faults.d.ts} +1 -1
  432. package/dist/text/workflow-faults.d.ts.map +1 -0
  433. package/dist/{workflow-faults.js → text/workflow-faults.js} +1 -1
  434. package/dist/text/workflow-faults.js.map +1 -0
  435. package/package.json +70 -70
  436. package/src/chores/chores.test.ts +4 -10
  437. package/src/chores/chores.ts +148 -392
  438. package/src/chores/digest.ts +8 -28
  439. package/src/chores/extension-update.ts +3 -8
  440. package/src/chores/fix-deps.ts +4 -18
  441. package/src/chores/index.ts +2 -2
  442. package/src/chores/probes.test.ts +7 -43
  443. package/src/chores/probes.ts +62 -167
  444. package/src/chores/prompt.ts +10 -34
  445. package/src/chores/stack.test.ts +6 -45
  446. package/src/chores/stack.ts +27 -118
  447. package/src/chores/verdict.test.ts +101 -80
  448. package/src/chores/verdict.ts +54 -99
  449. package/src/contracts/accounts.contract.ts +4 -19
  450. package/src/contracts/agent.contract.ts +7 -22
  451. package/src/contracts/agents.contract.ts +25 -71
  452. package/src/contracts/automations.contract.ts +14 -30
  453. package/src/contracts/capabilities.contract.ts +8 -35
  454. package/src/contracts/chores.contract.ts +4 -15
  455. package/src/contracts/endpoints.contract.ts +5 -22
  456. package/src/contracts/exit.contract.ts +7 -30
  457. package/src/contracts/extensions.contract.ts +8 -30
  458. package/src/contracts/git.contract.ts +25 -49
  459. package/src/contracts/host.contract.ts +9 -44
  460. package/src/contracts/intentic.contract.ts +1 -1
  461. package/src/contracts/logs.contract.ts +3 -13
  462. package/src/contracts/loops.contract.ts +9 -40
  463. package/src/contracts/personas.contract.ts +10 -35
  464. package/src/contracts/providers.contract.ts +4 -17
  465. package/src/contracts/runner.contract.ts +12 -39
  466. package/src/contracts/safety.contract.ts +5 -14
  467. package/src/contracts/secrets.contract.ts +4 -22
  468. package/src/contracts/sessions.contract.ts +1 -1
  469. package/src/contracts/settings.contract.ts +4 -10
  470. package/src/contracts/share.contract.ts +3 -9
  471. package/src/contracts/skills.contract.ts +4 -15
  472. package/src/contracts/system.contract.ts +26 -52
  473. package/src/contracts/usage.contract.ts +7 -21
  474. package/src/contracts/vpn.contract.ts +9 -16
  475. package/src/contracts/webext.contract.ts +9 -25
  476. package/src/contracts/workflows.contract.ts +34 -58
  477. package/src/contracts/workspace.contract.ts +19 -50
  478. package/src/events/agent-events.ts +345 -0
  479. package/src/events/cards.ts +286 -0
  480. package/src/{events.test.ts → events/resume.test.ts} +4 -19
  481. package/src/events/resume.ts +60 -0
  482. package/src/events/system-events.ts +139 -0
  483. package/src/events/transcript.ts +320 -0
  484. package/src/{conversation-ids.test.ts → ids/conversation-ids.test.ts} +25 -13
  485. package/src/ids/conversation-ids.ts +178 -0
  486. package/src/ids/hostnames.ts +129 -0
  487. package/src/ids/session-names.ts +29 -0
  488. package/src/ids/share-paths.ts +43 -0
  489. package/src/{tunnel-ids.test.ts → ids/tunnel-ids.test.ts} +1 -14
  490. package/src/ids/tunnel-ids.ts +29 -0
  491. package/src/index.ts +71 -87
  492. package/src/{agent-catalog.test.ts → models/agent-catalog.test.ts} +19 -93
  493. package/src/models/agent-catalog.ts +174 -0
  494. package/src/models/agent-runtimes.ts +201 -0
  495. package/src/models/capability-ledger.test.ts +84 -0
  496. package/src/{fast-tier.test.ts → models/fast-tier.test.ts} +7 -18
  497. package/src/models/fast-tier.ts +36 -0
  498. package/src/{model-order.test.ts → models/model-order.test.ts} +19 -40
  499. package/src/models/model-order.ts +163 -0
  500. package/src/{model-pins.test.ts → models/model-pins.test.ts} +12 -46
  501. package/src/models/model-pins.ts +57 -0
  502. package/src/models/model-roles.test.ts +38 -0
  503. package/src/models/model-roles.ts +180 -0
  504. package/src/{plan-pools.test.ts → models/plan-pools.test.ts} +6 -11
  505. package/src/models/plan-pools.ts +65 -0
  506. package/src/{prompt-complexity.test.ts → models/prompt-complexity.test.ts} +8 -60
  507. package/src/models/prompt-complexity.ts +215 -0
  508. package/src/{provider-specs.test.ts → models/provider-specs.test.ts} +18 -47
  509. package/src/models/provider-specs.ts +272 -0
  510. package/src/policy/approvals-execution.ts +58 -0
  511. package/src/{batch-runs.test.ts → policy/batch-runs.test.ts} +4 -20
  512. package/src/policy/batch-runs.ts +137 -0
  513. package/src/policy/capability-secrets.ts +5 -0
  514. package/src/{card-status.ts → policy/card-status.ts} +11 -26
  515. package/src/{command-classes.test.ts → policy/command-classes.test.ts} +11 -118
  516. package/src/policy/command-classes.ts +395 -0
  517. package/src/policy/command-run.ts +65 -0
  518. package/src/policy/control-scopes.ts +38 -0
  519. package/src/{credential-material.test.ts → policy/credential-material.test.ts} +4 -26
  520. package/src/policy/credential-material.ts +91 -0
  521. package/src/policy/needs-action.ts +5 -0
  522. package/src/policy/output-fields.ts +86 -0
  523. package/src/policy/overlay-lint.ts +100 -0
  524. package/src/{owner-ticket.test.ts → policy/owner-ticket.test.ts} +1 -1
  525. package/src/{owner-ticket.ts → policy/owner-ticket.ts} +9 -31
  526. package/src/policy/safety-policy.test.ts +84 -0
  527. package/src/policy/safety-policy.ts +142 -0
  528. package/src/policy/search-globs.ts +60 -0
  529. package/src/protocol/container-requirements.test.ts +72 -0
  530. package/src/protocol/container-requirements.ts +58 -0
  531. package/src/protocol/host-protocol.ts +29 -0
  532. package/src/protocol/ingress-contract.ts +103 -0
  533. package/src/{ingress-protocol.test.ts → protocol/ingress-protocol.test.ts} +25 -90
  534. package/src/protocol/ingress-protocol.ts +441 -0
  535. package/src/protocol/listener-protocol.ts +75 -0
  536. package/src/{peer-dial.test.ts → protocol/peer-dial.test.ts} +52 -1
  537. package/src/protocol/peer-dial.ts +207 -0
  538. package/src/{peer-mcp-server.ts → protocol/peer-mcp-server.ts} +16 -41
  539. package/src/protocol/request-id.ts +5 -0
  540. package/src/{routes.test.ts → protocol/routes.test.ts} +14 -22
  541. package/src/protocol/routes.ts +159 -0
  542. package/src/protocol/runner-protocol.ts +197 -0
  543. package/src/protocol/terminal-protocol.ts +13 -0
  544. package/src/protocol/webext-links.ts +50 -0
  545. package/src/protocol/webext-protocol.ts +24 -0
  546. package/src/schemas/activity.ts +22 -30
  547. package/src/schemas/agent.ts +130 -238
  548. package/src/schemas/agents.ts +165 -483
  549. package/src/schemas/approvals.ts +23 -71
  550. package/src/schemas/automations.ts +142 -250
  551. package/src/schemas/capabilities.ts +127 -414
  552. package/src/schemas/ci.ts +56 -108
  553. package/src/schemas/codebase-health.ts +7 -11
  554. package/src/schemas/devices.ts +98 -321
  555. package/src/schemas/engines.ts +16 -44
  556. package/src/schemas/environment.ts +41 -91
  557. package/src/schemas/exit.ts +24 -81
  558. package/src/schemas/extension-updates.ts +42 -87
  559. package/src/schemas/git-history.ts +30 -84
  560. package/src/schemas/git.ts +141 -256
  561. package/src/schemas/history.ts +14 -40
  562. package/src/schemas/hosts.ts +9 -15
  563. package/src/schemas/inventory.ts +8 -10
  564. package/src/schemas/issues.ts +66 -134
  565. package/src/schemas/logs.ts +15 -34
  566. package/src/schemas/loops.ts +46 -163
  567. package/src/schemas/maintenance.ts +47 -172
  568. package/src/schemas/panels.ts +20 -45
  569. package/src/schemas/personas.ts +50 -200
  570. package/src/schemas/plan-limits.ts +58 -197
  571. package/src/schemas/ports.ts +14 -32
  572. package/src/schemas/provider-oauth.ts +23 -76
  573. package/src/schemas/provider-subscriptions.ts +4 -13
  574. package/src/schemas/public.ts +4 -15
  575. package/src/schemas/push.ts +8 -36
  576. package/src/schemas/secrets.ts +20 -64
  577. package/src/schemas/settings.ts +175 -600
  578. package/src/schemas/share.ts +14 -32
  579. package/src/schemas/shared.ts +14 -13
  580. package/src/schemas/system.ts +46 -78
  581. package/src/schemas/terminal.ts +41 -120
  582. package/src/schemas/usage.ts +44 -233
  583. package/src/schemas/version-seam.test.ts +9 -26
  584. package/src/schemas/vpn.ts +27 -64
  585. package/src/schemas/webext.ts +22 -53
  586. package/src/schemas/workflows.ts +57 -183
  587. package/src/schemas/workspace-repos.ts +12 -24
  588. package/src/schemas/workspace-search.ts +17 -35
  589. package/src/schemas/workspace-setup.ts +4 -11
  590. package/src/schemas/workspace-tree.ts +32 -91
  591. package/src/state/arrival.ts +109 -0
  592. package/src/state/contract-lock.test.ts +17 -0
  593. package/src/state/contract-lock.ts +49 -0
  594. package/src/state/definition.ts +143 -0
  595. package/src/state/history-state.ts +103 -0
  596. package/src/{runtime-state.test.ts → state/runtime-state.test.ts} +3 -10
  597. package/src/state/runtime-state.ts +62 -0
  598. package/src/state/starter.ts +5 -0
  599. package/src/state/state-portability.ts +27 -0
  600. package/src/state/versions.ts +26 -0
  601. package/src/{workspace-state.test.ts → state/workspace-state.test.ts} +65 -172
  602. package/src/state/workspace-state.ts +669 -0
  603. package/src/{documents.test.ts → text/documents.test.ts} +1 -1
  604. package/src/text/documents.ts +42 -0
  605. package/src/text/embed.ts +132 -0
  606. package/src/text/mentions.ts +21 -0
  607. package/src/text/model-answer.ts +9 -0
  608. package/src/text/path-refs.ts +39 -0
  609. package/src/text/shell-regions.ts +224 -0
  610. package/src/{title.test.ts → text/title.test.ts} +13 -32
  611. package/src/text/title.ts +202 -0
  612. package/src/{transcript-fold.test.ts → text/transcript-fold.test.ts} +5 -83
  613. package/src/{transcript-fold.ts → text/transcript-fold.ts} +65 -170
  614. package/src/text/whisper.test.ts +19 -0
  615. package/src/text/whisper.ts +17 -0
  616. package/src/{workflow-faults.test.ts → text/workflow-faults.test.ts} +6 -24
  617. package/src/{workflow-faults.ts → text/workflow-faults.ts} +20 -60
  618. package/dist/agent-catalog.d.ts.map +0 -1
  619. package/dist/agent-catalog.js.map +0 -1
  620. package/dist/agent-runtimes.d.ts.map +0 -1
  621. package/dist/agent-runtimes.js.map +0 -1
  622. package/dist/approvals-execution.d.ts.map +0 -1
  623. package/dist/approvals-execution.js.map +0 -1
  624. package/dist/arrival.d.ts.map +0 -1
  625. package/dist/arrival.js.map +0 -1
  626. package/dist/batch-runs.d.ts.map +0 -1
  627. package/dist/batch-runs.js.map +0 -1
  628. package/dist/capability-env.d.ts.map +0 -1
  629. package/dist/capability-env.js.map +0 -1
  630. package/dist/capability-secrets.d.ts.map +0 -1
  631. package/dist/capability-secrets.js.map +0 -1
  632. package/dist/card-status.d.ts.map +0 -1
  633. package/dist/card-status.js.map +0 -1
  634. package/dist/command-classes.d.ts.map +0 -1
  635. package/dist/command-classes.js.map +0 -1
  636. package/dist/command-run.d.ts.map +0 -1
  637. package/dist/command-run.js.map +0 -1
  638. package/dist/contract-lock.d.ts.map +0 -1
  639. package/dist/contract-lock.js.map +0 -1
  640. package/dist/conversation-ids.d.ts +0 -4
  641. package/dist/conversation-ids.d.ts.map +0 -1
  642. package/dist/conversation-ids.js.map +0 -1
  643. package/dist/credential-material.d.ts.map +0 -1
  644. package/dist/credential-material.js.map +0 -1
  645. package/dist/definition.d.ts.map +0 -1
  646. package/dist/definition.js.map +0 -1
  647. package/dist/documents.d.ts.map +0 -1
  648. package/dist/documents.js.map +0 -1
  649. package/dist/embed.d.ts.map +0 -1
  650. package/dist/embed.js.map +0 -1
  651. package/dist/events.d.ts +0 -4336
  652. package/dist/events.d.ts.map +0 -1
  653. package/dist/events.js +0 -725
  654. package/dist/events.js.map +0 -1
  655. package/dist/fast-tier.d.ts.map +0 -1
  656. package/dist/fast-tier.js.map +0 -1
  657. package/dist/history-state.d.ts.map +0 -1
  658. package/dist/history-state.js.map +0 -1
  659. package/dist/host-protocol.d.ts.map +0 -1
  660. package/dist/host-protocol.js.map +0 -1
  661. package/dist/hostnames.d.ts.map +0 -1
  662. package/dist/hostnames.js.map +0 -1
  663. package/dist/ingress-contract.d.ts.map +0 -1
  664. package/dist/ingress-contract.js.map +0 -1
  665. package/dist/ingress-protocol.d.ts.map +0 -1
  666. package/dist/ingress-protocol.js.map +0 -1
  667. package/dist/listener-protocol.d.ts.map +0 -1
  668. package/dist/listener-protocol.js.map +0 -1
  669. package/dist/mentions.d.ts.map +0 -1
  670. package/dist/mentions.js.map +0 -1
  671. package/dist/model-order.d.ts.map +0 -1
  672. package/dist/model-order.js.map +0 -1
  673. package/dist/model-pins.d.ts.map +0 -1
  674. package/dist/model-pins.js.map +0 -1
  675. package/dist/model-roles.d.ts.map +0 -1
  676. package/dist/model-roles.js.map +0 -1
  677. package/dist/needs-action.d.ts.map +0 -1
  678. package/dist/needs-action.js.map +0 -1
  679. package/dist/output-fields.d.ts.map +0 -1
  680. package/dist/output-fields.js.map +0 -1
  681. package/dist/overlay-lint.d.ts.map +0 -1
  682. package/dist/overlay-lint.js.map +0 -1
  683. package/dist/owner-ticket.d.ts.map +0 -1
  684. package/dist/owner-ticket.js.map +0 -1
  685. package/dist/path-refs.d.ts.map +0 -1
  686. package/dist/path-refs.js.map +0 -1
  687. package/dist/peer-dial.d.ts.map +0 -1
  688. package/dist/peer-dial.js.map +0 -1
  689. package/dist/peer-mcp-server.d.ts.map +0 -1
  690. package/dist/peer-mcp-server.js.map +0 -1
  691. package/dist/plan-pools.d.ts.map +0 -1
  692. package/dist/plan-pools.js.map +0 -1
  693. package/dist/prompt-complexity.d.ts.map +0 -1
  694. package/dist/prompt-complexity.js.map +0 -1
  695. package/dist/provider-specs.d.ts.map +0 -1
  696. package/dist/provider-specs.js.map +0 -1
  697. package/dist/request-id.d.ts.map +0 -1
  698. package/dist/request-id.js.map +0 -1
  699. package/dist/routes.d.ts.map +0 -1
  700. package/dist/routes.js.map +0 -1
  701. package/dist/runner-protocol.d.ts.map +0 -1
  702. package/dist/runner-protocol.js.map +0 -1
  703. package/dist/runtime-state.d.ts.map +0 -1
  704. package/dist/runtime-state.js.map +0 -1
  705. package/dist/safety-policy.d.ts.map +0 -1
  706. package/dist/safety-policy.js.map +0 -1
  707. package/dist/search-globs.d.ts.map +0 -1
  708. package/dist/search-globs.js.map +0 -1
  709. package/dist/session-names.d.ts.map +0 -1
  710. package/dist/session-names.js.map +0 -1
  711. package/dist/share-paths.d.ts.map +0 -1
  712. package/dist/share-paths.js.map +0 -1
  713. package/dist/shell-regions.d.ts.map +0 -1
  714. package/dist/shell-regions.js.map +0 -1
  715. package/dist/sse.d.ts.map +0 -1
  716. package/dist/sse.js.map +0 -1
  717. package/dist/starter.d.ts.map +0 -1
  718. package/dist/starter.js.map +0 -1
  719. package/dist/state-portability.d.ts.map +0 -1
  720. package/dist/state-portability.js.map +0 -1
  721. package/dist/terminal-protocol.d.ts.map +0 -1
  722. package/dist/terminal-protocol.js.map +0 -1
  723. package/dist/title.d.ts.map +0 -1
  724. package/dist/title.js.map +0 -1
  725. package/dist/transcript-fold.d.ts.map +0 -1
  726. package/dist/transcript-fold.js.map +0 -1
  727. package/dist/tunnel-ids.d.ts.map +0 -1
  728. package/dist/tunnel-ids.js.map +0 -1
  729. package/dist/versions.d.ts.map +0 -1
  730. package/dist/versions.js.map +0 -1
  731. package/dist/webext-links.d.ts.map +0 -1
  732. package/dist/webext-links.js.map +0 -1
  733. package/dist/webext-protocol.d.ts.map +0 -1
  734. package/dist/webext-protocol.js.map +0 -1
  735. package/dist/workflow-faults.d.ts.map +0 -1
  736. package/dist/workflow-faults.js.map +0 -1
  737. package/dist/workspace-state.d.ts.map +0 -1
  738. package/dist/workspace-state.js.map +0 -1
  739. package/src/agent-catalog.ts +0 -316
  740. package/src/agent-runtimes.ts +0 -419
  741. package/src/approvals-execution.ts +0 -96
  742. package/src/arrival.ts +0 -160
  743. package/src/batch-runs.ts +0 -188
  744. package/src/capability-ledger.test.ts +0 -140
  745. package/src/capability-secrets.ts +0 -20
  746. package/src/command-classes.ts +0 -617
  747. package/src/command-run.ts +0 -78
  748. package/src/contract-lock.test.ts +0 -23
  749. package/src/contract-lock.ts +0 -66
  750. package/src/conversation-ids.ts +0 -207
  751. package/src/credential-material.ts +0 -181
  752. package/src/definition.ts +0 -207
  753. package/src/documents.ts +0 -67
  754. package/src/embed.ts +0 -164
  755. package/src/events.ts +0 -1870
  756. package/src/fast-tier.ts +0 -72
  757. package/src/history-state.ts +0 -174
  758. package/src/host-protocol.ts +0 -36
  759. package/src/hostnames.ts +0 -180
  760. package/src/ingress-contract.ts +0 -157
  761. package/src/ingress-protocol.ts +0 -625
  762. package/src/listener-protocol.ts +0 -96
  763. package/src/mentions.ts +0 -25
  764. package/src/model-order.ts +0 -262
  765. package/src/model-pins.ts +0 -132
  766. package/src/model-roles.test.ts +0 -52
  767. package/src/model-roles.ts +0 -320
  768. package/src/needs-action.ts +0 -14
  769. package/src/output-fields.ts +0 -111
  770. package/src/overlay-lint.ts +0 -116
  771. package/src/path-refs.ts +0 -59
  772. package/src/peer-dial.ts +0 -163
  773. package/src/plan-pools.ts +0 -92
  774. package/src/prompt-complexity.ts +0 -334
  775. package/src/provider-specs.ts +0 -432
  776. package/src/request-id.ts +0 -41
  777. package/src/routes.ts +0 -219
  778. package/src/runner-protocol.ts +0 -239
  779. package/src/runtime-state.ts +0 -140
  780. package/src/safety-policy.test.ts +0 -88
  781. package/src/safety-policy.ts +0 -258
  782. package/src/search-globs.ts +0 -76
  783. package/src/session-names.ts +0 -44
  784. package/src/share-paths.ts +0 -68
  785. package/src/shell-regions.ts +0 -289
  786. package/src/starter.ts +0 -13
  787. package/src/state-portability.ts +0 -56
  788. package/src/terminal-protocol.ts +0 -16
  789. package/src/title.ts +0 -267
  790. package/src/tunnel-ids.ts +0 -57
  791. package/src/versions.ts +0 -48
  792. package/src/webext-links.ts +0 -90
  793. package/src/webext-protocol.ts +0 -27
  794. package/src/workspace-state.ts +0 -1090
  795. /package/dist/{hostnames.d.ts → ids/hostnames.d.ts} +0 -0
  796. /package/dist/{hostnames.js → ids/hostnames.js} +0 -0
  797. /package/dist/{session-names.d.ts → ids/session-names.d.ts} +0 -0
  798. /package/dist/{session-names.js → ids/session-names.js} +0 -0
  799. /package/dist/{share-paths.d.ts → ids/share-paths.d.ts} +0 -0
  800. /package/dist/{share-paths.js → ids/share-paths.js} +0 -0
  801. /package/dist/{agent-catalog.js → models/agent-catalog.js} +0 -0
  802. /package/dist/{agent-runtimes.d.ts → models/agent-runtimes.d.ts} +0 -0
  803. /package/dist/{agent-runtimes.js → models/agent-runtimes.js} +0 -0
  804. /package/dist/{fast-tier.js → models/fast-tier.js} +0 -0
  805. /package/dist/{model-order.d.ts → models/model-order.d.ts} +0 -0
  806. /package/dist/{model-order.js → models/model-order.js} +0 -0
  807. /package/dist/{model-pins.js → models/model-pins.js} +0 -0
  808. /package/dist/{plan-pools.js → models/plan-pools.js} +0 -0
  809. /package/dist/{prompt-complexity.d.ts → models/prompt-complexity.d.ts} +0 -0
  810. /package/dist/{prompt-complexity.js → models/prompt-complexity.js} +0 -0
  811. /package/dist/{provider-specs.d.ts → models/provider-specs.d.ts} +0 -0
  812. /package/dist/{provider-specs.js → models/provider-specs.js} +0 -0
  813. /package/dist/{approvals-execution.d.ts → policy/approvals-execution.d.ts} +0 -0
  814. /package/dist/{approvals-execution.js → policy/approvals-execution.js} +0 -0
  815. /package/dist/{capability-env.d.ts → policy/capability-env.d.ts} +0 -0
  816. /package/dist/{capability-env.js → policy/capability-env.js} +0 -0
  817. /package/dist/{capability-secrets.d.ts → policy/capability-secrets.d.ts} +0 -0
  818. /package/dist/{capability-secrets.js → policy/capability-secrets.js} +0 -0
  819. /package/dist/{command-run.js → policy/command-run.js} +0 -0
  820. /package/dist/{credential-material.d.ts → policy/credential-material.d.ts} +0 -0
  821. /package/dist/{credential-material.js → policy/credential-material.js} +0 -0
  822. /package/dist/{needs-action.d.ts → policy/needs-action.d.ts} +0 -0
  823. /package/dist/{needs-action.js → policy/needs-action.js} +0 -0
  824. /package/dist/{output-fields.d.ts → policy/output-fields.d.ts} +0 -0
  825. /package/dist/{output-fields.js → policy/output-fields.js} +0 -0
  826. /package/dist/{overlay-lint.d.ts → policy/overlay-lint.d.ts} +0 -0
  827. /package/dist/{overlay-lint.js → policy/overlay-lint.js} +0 -0
  828. /package/dist/{owner-ticket.d.ts → policy/owner-ticket.d.ts} +0 -0
  829. /package/dist/{search-globs.d.ts → policy/search-globs.d.ts} +0 -0
  830. /package/dist/{search-globs.js → policy/search-globs.js} +0 -0
  831. /package/dist/{ingress-contract.d.ts → protocol/ingress-contract.d.ts} +0 -0
  832. /package/dist/{ingress-protocol.d.ts → protocol/ingress-protocol.d.ts} +0 -0
  833. /package/dist/{ingress-protocol.js → protocol/ingress-protocol.js} +0 -0
  834. /package/dist/{listener-protocol.d.ts → protocol/listener-protocol.d.ts} +0 -0
  835. /package/dist/{peer-mcp-server.d.ts → protocol/peer-mcp-server.d.ts} +0 -0
  836. /package/dist/{peer-mcp-server.js → protocol/peer-mcp-server.js} +0 -0
  837. /package/dist/{request-id.d.ts → protocol/request-id.d.ts} +0 -0
  838. /package/dist/{request-id.js → protocol/request-id.js} +0 -0
  839. /package/dist/{routes.d.ts → protocol/routes.d.ts} +0 -0
  840. /package/dist/{routes.js → protocol/routes.js} +0 -0
  841. /package/dist/{sse.d.ts → protocol/sse.d.ts} +0 -0
  842. /package/dist/{sse.js → protocol/sse.js} +0 -0
  843. /package/dist/{terminal-protocol.js → protocol/terminal-protocol.js} +0 -0
  844. /package/dist/{webext-links.d.ts → protocol/webext-links.d.ts} +0 -0
  845. /package/dist/{webext-links.js → protocol/webext-links.js} +0 -0
  846. /package/dist/{arrival.d.ts → state/arrival.d.ts} +0 -0
  847. /package/dist/{contract-lock.d.ts → state/contract-lock.d.ts} +0 -0
  848. /package/dist/{history-state.d.ts → state/history-state.d.ts} +0 -0
  849. /package/dist/{runtime-state.d.ts → state/runtime-state.d.ts} +0 -0
  850. /package/dist/{runtime-state.js → state/runtime-state.js} +0 -0
  851. /package/dist/{starter.d.ts → state/starter.d.ts} +0 -0
  852. /package/dist/{starter.js → state/starter.js} +0 -0
  853. /package/dist/{state-portability.d.ts → state/state-portability.d.ts} +0 -0
  854. /package/dist/{state-portability.js → state/state-portability.js} +0 -0
  855. /package/dist/{versions.d.ts → state/versions.d.ts} +0 -0
  856. /package/dist/{versions.js → state/versions.js} +0 -0
  857. /package/dist/{embed.d.ts → text/embed.d.ts} +0 -0
  858. /package/dist/{embed.js → text/embed.js} +0 -0
  859. /package/dist/{mentions.d.ts → text/mentions.d.ts} +0 -0
  860. /package/dist/{mentions.js → text/mentions.js} +0 -0
  861. /package/dist/{path-refs.d.ts → text/path-refs.d.ts} +0 -0
  862. /package/dist/{path-refs.js → text/path-refs.js} +0 -0
  863. /package/dist/{shell-regions.js → text/shell-regions.js} +0 -0
  864. /package/dist/{title.d.ts → text/title.d.ts} +0 -0
  865. /package/dist/{title.js → text/title.js} +0 -0
  866. /package/src/{hostnames.test.ts → ids/hostnames.test.ts} +0 -0
  867. /package/src/{share-paths.test.ts → ids/share-paths.test.ts} +0 -0
  868. /package/src/{capability-env.ts → policy/capability-env.ts} +0 -0
  869. /package/src/{overlay-lint.test.ts → policy/overlay-lint.test.ts} +0 -0
  870. /package/src/{search-globs.test.ts → policy/search-globs.test.ts} +0 -0
  871. /package/src/{ingress-contract.test.ts → protocol/ingress-contract.test.ts} +0 -0
  872. /package/src/{peer-mcp-server.test.ts → protocol/peer-mcp-server.test.ts} +0 -0
  873. /package/src/{sse.ts → protocol/sse.ts} +0 -0
  874. /package/src/{versions.test.ts → state/versions.test.ts} +0 -0
  875. /package/src/{embed.test.ts → text/embed.test.ts} +0 -0
  876. /package/src/{mentions.test.ts → text/mentions.test.ts} +0 -0
  877. /package/src/{path-refs.test.ts → text/path-refs.test.ts} +0 -0
@@ -0,0 +1,272 @@
1
+ import type { ProviderBrand } from "@intentic/constants";
2
+ import { type AgentCapabilities, CLAUDE_CODE, CODEX, CURSOR, OPENCODE, OPENCODE_GEMINI } from "./agent-runtimes.js";
3
+
4
+ // Every fact about a provider more than one surface needs, one row each, replacing lists that drifted out of sync.
5
+ // `access` (cost) and `auth` (connection) stay separate: conflating them mis-describes Z.ai, a prepaid plan spent
6
+ // through a minted key. Adding a provider is one row here plus one registry line; everything else derives.
7
+
8
+ // What a provider costs to unlock: `free` is a real tier (Google's channel needs only a sign-in), and there is
9
+ // deliberately no `key` rung, since a raw API key against your own gateway is an `endpoint` capability, not a row here.
10
+ export type AccessKind = "free" | "subscription";
11
+
12
+ export interface ProviderAccess {
13
+ readonly kind: AccessKind;
14
+ // What the user connects, named the way its vendor names it: the noun every connect prompt uses.
15
+ readonly requirement: string;
16
+ // What connecting it lets them run, for the connect gate's one-line pitch.
17
+ readonly runs: string;
18
+ }
19
+
20
+ // Cost order at the margin (free, subscription); not AccessKind's own order, which isn't a runtime fact.
21
+ export const ACCESS_COST: Record<AccessKind, number> = { free: 0, subscription: 1 };
22
+
23
+ // How a credential for this provider is obtained and held; every surface branches on this instead of the provider's
24
+ // name:
25
+ // - oauth: the daemon runs the sign-in and stores the tokens itself
26
+ // - translator: the bundled CLIProxyAPI holds a subscription OAuth and re-serves it behind an Anthropic endpoint
27
+ // - minted: the daemon mints the vendor's own API key from a sign-in and stores that
28
+ export type ProviderAuth =
29
+ | { readonly kind: "oauth" }
30
+ | { readonly kind: "translator"; readonly cliProxy: string }
31
+ | { readonly kind: "minted"; readonly variants: readonly MintedVariant[] };
32
+
33
+ // One identity a minted provider signs into: a vendor (Z.ai) can sell one product through separate estates whose hosts
34
+ // and keys are not interchangeable. Bases live per-variant, so a turn dials the host that minted its key.
35
+ export interface MintedVariant {
36
+ // The stored account's record of where it came from, and what login/start names; never shown.
37
+ readonly id: string;
38
+ // What the connect row's estate control calls it, in the vendor's own words.
39
+ readonly label: string;
40
+ // How this sign-in ends, deciding only the connect panel's shape:
41
+ // - device: the daemon polls the vendor to completion, nothing to paste back
42
+ // - redirect: the vendor sends the browser to a loopback address, and the user brings the URL back
43
+ readonly flow: "device" | "redirect";
44
+ // ANTHROPIC_BASE_URL for a turn minted here; no version segment, the harness appends /v1/messages itself.
45
+ readonly anthropicBase: string;
46
+ // Where this estate's catalog is read from: an OpenAI-compatible root, with its version segment.
47
+ readonly catalogBase: string;
48
+ }
49
+
50
+ export interface ProviderSpec {
51
+ // The wire id, and a reserved capability id: an installed agent capability may not reuse one.
52
+ readonly id: string;
53
+ // What the picker, the rail and the account tabs call it.
54
+ readonly label: string;
55
+ // Whose allowance a turn spends, as a sentence subject; a routed turn can spend a quota neither field names.
56
+ readonly vendor: string;
57
+ // Where account rows are filed under (tab, picker section, connect chip); differs from vendor only for Grok.
58
+ readonly accountLabel: string;
59
+ // Where the sign-in happens, not the provider's product name: what a user leaving the page should recognize.
60
+ readonly destination: string;
61
+ readonly brand: ProviderBrand;
62
+ readonly access: ProviderAccess;
63
+ readonly auth: ProviderAuth;
64
+ // Whether a plan-limit reading is obtainable, so a blank meter is told apart from a plan that publishes none.
65
+ readonly planLimits: boolean;
66
+ // The two runtimes this provider runs on; equal records here mean the harness is not a real choice for it.
67
+ readonly runtimes: { readonly native: AgentCapabilities; readonly claudeCode: AgentCapabilities };
68
+ }
69
+
70
+ // satisfies checks each row's shape; as const keeps ids/auth kinds literal, so NativeProvider stays a union.
71
+ export const PROVIDER_SPECS = [
72
+ {
73
+ id: "claude",
74
+ label: "Claude Code",
75
+ vendor: "Claude",
76
+ accountLabel: "Claude",
77
+ destination: "Anthropic",
78
+ brand: "claude",
79
+ access: { kind: "subscription", requirement: "Claude subscription", runs: "Claude Code" },
80
+ auth: { kind: "oauth" },
81
+ planLimits: true,
82
+ // Claude has no second runtime: the harness axis is not a choice here.
83
+ runtimes: { native: CLAUDE_CODE, claudeCode: CLAUDE_CODE },
84
+ },
85
+ {
86
+ id: "codex",
87
+ label: "Codex",
88
+ vendor: "ChatGPT",
89
+ accountLabel: "ChatGPT",
90
+ destination: "ChatGPT",
91
+ brand: "codex",
92
+ access: { kind: "subscription", requirement: "ChatGPT subscription", runs: "Codex" },
93
+ auth: { kind: "translator", cliProxy: "codex" },
94
+ planLimits: true,
95
+ runtimes: { native: CODEX, claudeCode: CLAUDE_CODE },
96
+ },
97
+ {
98
+ id: "grok",
99
+ label: "Grok",
100
+ vendor: "xAI",
101
+ accountLabel: "Grok",
102
+ destination: "x.ai",
103
+ brand: "grok",
104
+ access: { kind: "subscription", requirement: "SuperGrok subscription", runs: "Grok" },
105
+ // The app says grok, CLIProxyAPI says xai; Grok alone also runs natively, not just through the translator.
106
+ auth: { kind: "translator", cliProxy: "xai" },
107
+ planLimits: false,
108
+ runtimes: { native: OPENCODE, claudeCode: CLAUDE_CODE },
109
+ },
110
+ {
111
+ id: "kimi",
112
+ label: "Kimi Code",
113
+ vendor: "Kimi Code",
114
+ accountLabel: "Kimi Code",
115
+ destination: "Kimi Code",
116
+ brand: "kimi",
117
+ access: { kind: "subscription", requirement: "Kimi Code subscription", runs: "Kimi Code" },
118
+ auth: { kind: "translator", cliProxy: "kimi" },
119
+ planLimits: true,
120
+ // Kimi has no native runtime: it exists only under the Claude Code loop, on both harnesses.
121
+ runtimes: { native: CLAUDE_CODE, claudeCode: CLAUDE_CODE },
122
+ },
123
+ {
124
+ // Labelled for the account (Google), not the model family: this channel vends Claude and GPT-OSS beside Gemini.
125
+ id: "gemini",
126
+ label: "Google",
127
+ vendor: "Google",
128
+ accountLabel: "Google",
129
+ destination: "Google",
130
+ brand: "gemini",
131
+ access: { kind: "free", requirement: "Google sign-in", runs: "Gemini, Claude and GPT-OSS under Claude Code" },
132
+ // antigravity is Google's own agent product, the name CLIProxyAPI files this credential under.
133
+ auth: { kind: "translator", cliProxy: "antigravity" },
134
+ planLimits: true,
135
+ // The only routed provider that ignores harness: Google refuses any request announcing the Claude Code loop.
136
+ runtimes: { native: OPENCODE_GEMINI, claudeCode: OPENCODE_GEMINI },
137
+ },
138
+ {
139
+ // Cursor's own runtime via Anysphere's SDK; labelled for the account since it vends several vendors' models.
140
+ id: "cursor",
141
+ label: "Cursor",
142
+ vendor: "Cursor",
143
+ accountLabel: "Cursor",
144
+ destination: "Cursor",
145
+ brand: "cursor",
146
+ // Requirement names the plan, not the account: a free Cursor sign-in works but cannot run a turn here.
147
+ access: { kind: "subscription", requirement: "Cursor Pro subscription", runs: "Cursor Agent" },
148
+ auth: { kind: "oauth" },
149
+ planLimits: false,
150
+ // Cursor ignores harness too: there is no route to it but its own SDK.
151
+ runtimes: { native: CURSOR, claudeCode: CURSOR },
152
+ },
153
+ // The two minted providers need no new runtime or translator hop: each has its own Anthropic Messages endpoint.
154
+ {
155
+ id: "meta",
156
+ label: "Meta",
157
+ vendor: "Meta",
158
+ accountLabel: "Meta",
159
+ destination: "Meta",
160
+ brand: "meta",
161
+ // A subscription like the rest: the device sign-in mints a plan key, and the plan is what a turn spends.
162
+ access: { kind: "subscription", requirement: "Muse Code subscription", runs: "Muse Spark under Claude Code" },
163
+ auth: {
164
+ kind: "minted",
165
+ // One estate, no choice to offer; the id still exists since a stored account records which variant minted
166
+ // it.
167
+ variants: [
168
+ {
169
+ id: "meta",
170
+ label: "Meta",
171
+ // The textbook device flow (RFC 8628): a code read off the card, and a poll that returns nothing
172
+ // here.
173
+ flow: "device",
174
+ // No version segment here: /v1/messages is appended by the harness, beside the catalog's OpenAI
175
+ // surface.
176
+ anthropicBase: "https://api.meta.ai",
177
+ catalogBase: "https://api.meta.ai/v1",
178
+ },
179
+ ],
180
+ },
181
+ // No quota surface a minted key can read: the row shows no meter and says so, not an empty one reading as zero.
182
+ planLimits: false,
183
+ runtimes: { native: CLAUDE_CODE, claudeCode: CLAUDE_CODE },
184
+ },
185
+ {
186
+ id: "zai",
187
+ label: "Z.ai",
188
+ vendor: "Z.ai",
189
+ accountLabel: "Z.ai",
190
+ destination: "Z.ai",
191
+ brand: "zai",
192
+ // A prepaid GLM Coding Plan with a watched quota; the sign-in mints its own key, so requirement names the plan.
193
+ access: { kind: "subscription", requirement: "Z.ai GLM Coding Plan", runs: "GLM under Claude Code" },
194
+ auth: {
195
+ kind: "minted",
196
+ // Two estates, each its own base (a key from one is refused by the other); root is the coding-plan path.
197
+ variants: [
198
+ {
199
+ id: "zai",
200
+ // Cased as the vendor cases it, matching how the row itself is titled elsewhere on screen.
201
+ label: "Z.ai international",
202
+ // zcode.z.ai mediates the callback itself: the daemon polls it, nothing dead-ends in the user's
203
+ // browser.
204
+ flow: "device",
205
+ anthropicBase: "https://api.z.ai/api/anthropic",
206
+ catalogBase: "https://api.z.ai/api/coding/paas/v4",
207
+ },
208
+ {
209
+ id: "bigmodel",
210
+ label: "BigModel (中国大陆)",
211
+ // BigModel refuses that callback; a loopback redirect dead-ends the page, and the user brings the
212
+ // grant back.
213
+ flow: "redirect",
214
+ anthropicBase: "https://open.bigmodel.cn/api/anthropic",
215
+ catalogBase: "https://open.bigmodel.cn/api/coding/paas/v4",
216
+ },
217
+ ],
218
+ },
219
+ planLimits: false,
220
+ runtimes: { native: CLAUDE_CODE, claudeCode: CLAUDE_CODE },
221
+ },
222
+ ] as const satisfies readonly ProviderSpec[];
223
+
224
+ type Spec = (typeof PROVIDER_SPECS)[number];
225
+
226
+ // The agent runtimes the daemon can serve; a native id is reserved, `endpoint/<id>` or any other value names an
227
+ // installed capability instead. Derived from the table and a union of six names, so the wire vocabulary can't drift.
228
+ export type NativeProvider = Spec["id"];
229
+ export const NATIVE_PROVIDERS: readonly NativeProvider[] = PROVIDER_SPECS.map((spec) => spec.id);
230
+
231
+ const BY_ID = new Map<string, ProviderSpec>(PROVIDER_SPECS.map((spec) => [spec.id, spec] as const));
232
+
233
+ // The row for a provider id, or nothing for an ACP agent, an endpoint, or a typo: the one lookup every table and
234
+ // surface goes through.
235
+ export const providerSpec = (provider: string): ProviderSpec | undefined => BY_ID.get(provider);
236
+
237
+ // Providers whose model runs under Claude Code through the bundled translator (CLIProxyAPI); claude is absent, native
238
+ // Anthropic OAuth serves it directly. Narrowed off the auth kind so tables built on this move with it.
239
+ export type TranslatorProvider = Extract<Spec, { auth: { kind: "translator" } }>["id"];
240
+ export const TRANSLATOR_PROVIDERS: readonly TranslatorProvider[] = PROVIDER_SPECS.filter(
241
+ (spec): spec is Extract<Spec, { auth: { kind: "translator" } }> => spec.auth.kind === "translator",
242
+ ).map((spec) => spec.id);
243
+
244
+ // Providers whose sign-in mints the vendor's own API key, served straight off that vendor's own Anthropic Messages
245
+ // endpoint.
246
+ export type MintedProvider = Extract<Spec, { auth: { kind: "minted" } }>["id"];
247
+ export const MINTED_PROVIDERS: readonly MintedProvider[] = PROVIDER_SPECS.filter(
248
+ (spec): spec is Extract<Spec, { auth: { kind: "minted" } }> => spec.auth.kind === "minted",
249
+ ).map((spec) => spec.id);
250
+
251
+ // This provider's CLIProxyAPI id, where it has one; not always ours (grok/xai, gemini/antigravity).
252
+ export const cliProxyIdOf = (provider: string): string | undefined => {
253
+ const auth = providerSpec(provider)?.auth;
254
+ return auth?.kind === "translator" ? auth.cliProxy : undefined;
255
+ };
256
+
257
+ // Every estate a minted provider can sign into, in connect-row order, or nothing if it is not minted. The head is the
258
+ // default a variant-less login/start gets.
259
+ export const mintedVariants = (provider: string): readonly MintedVariant[] | undefined => {
260
+ const auth = providerSpec(provider)?.auth;
261
+ return auth?.kind === "minted" ? auth.variants : undefined;
262
+ };
263
+
264
+ // The whole estate (bases and flow together), so a base is never read without its sibling. An absent id defaults to the
265
+ // head; a name matching no variant is undefined, not the default, so a lost variant surfaces honestly.
266
+ export const mintedVariant = (provider: string, variant?: string): MintedVariant | undefined => {
267
+ const variants = mintedVariants(provider);
268
+ if (variants === undefined) {
269
+ return undefined;
270
+ }
271
+ return variant === undefined || variant === "" ? variants[0] : variants.find((entry) => entry.id === variant);
272
+ };
@@ -0,0 +1,58 @@
1
+ // A held item is dated this far out (an ordinary scheduledAt), to catch a mis-click before it's public.
2
+ export const APPROVAL_HOLD_MS = 60_000;
3
+
4
+ // Platforms reachable by a stored API credential alone; the rest need a turn to drive the logged-in browser.
5
+ export const DIRECT_PUBLISH_PLATFORMS: ReadonlySet<string> = new Set(["discord"]);
6
+
7
+ // The workspace-relative directory both prompts below name, spelled once.
8
+ const APPROVALS_DIR = ".intentic/config/approvals";
9
+
10
+ // Status bookkeeping every executing turn is told, identical across kinds so the queue reads one shape back.
11
+ const WRITE_BACK = [
12
+ `Before you act on one, set its "status" to "running" and "startedAt" to the epoch ms, so a turn that dies`,
13
+ `here cannot do it twice. When it is done, set "status":"done" plus "finishedAt" (epoch ms) and, where`,
14
+ `there is one, "result": the post's URL, a confirmation number, whatever a person would want to go and`,
15
+ `look at. If it failed, set "status":"failed" plus an "error" saying what went wrong in plain words the`,
16
+ `owner can act on, then move to the next one instead of retrying in a loop.`,
17
+ ];
18
+
19
+ // Names the files directly rather than saying "go look": the daemon already decided what's due, and a re-deriving turn
20
+ // could disagree. Writes the outcome back into the same file, since that's where the queue reads it.
21
+ export const publishTurnPrompt = (posts: readonly { readonly id: string; readonly platform: string }[]): string =>
22
+ [
23
+ `Publish these approved posts, which are due now. They live in ${APPROVALS_DIR}/, one JSON file each:`,
24
+ ``,
25
+ ...posts.map((post) => `- ${post.id}.json (${post.platform})`),
26
+ ``,
27
+ `Take them ONE AT A TIME, and for each:`,
28
+ `1. Read the file. ${WRITE_BACK[0]}`,
29
+ ` ${WRITE_BACK[1]}`,
30
+ `2. Post exactly its "content": with its "title", "target" and "media", using that platform's skill.`,
31
+ ` A "target" that is a URL means this post is a REPLY to whatever is at it: open that exact URL and`,
32
+ ` reply where it lands. On reddit a comment permalink (.../comments/<post>/<slug>/<comment>/) has to`,
33
+ ` nest under that comment rather than becoming a new top-level comment on the thread.`,
34
+ `3. ${WRITE_BACK[2]} ${WRITE_BACK[3]}`,
35
+ ` ${WRITE_BACK[4]}`,
36
+ ``,
37
+ `Never rewrite the content: the owner approved these exact words. Never touch a file not listed above.`,
38
+ ].join(`\n`);
39
+
40
+ // Same discipline as a publish turn, but the work comes from the file, written by the agent that proposed it since this
41
+ // turn has none of that conversation. Approval covers exactly summary/details; anything more is failed, not improvised.
42
+ export const actionTurnPrompt = (actions: readonly { readonly id: string; readonly summary: string }[]): string =>
43
+ [
44
+ `Carry out these approved actions, which are due now. They live in ${APPROVALS_DIR}/, one JSON file each:`,
45
+ ``,
46
+ ...actions.map((action) => `- ${action.id}.json: ${action.summary}`),
47
+ ``,
48
+ `Take them ONE AT A TIME, and for each:`,
49
+ `1. Read the file. ${WRITE_BACK[0]}`,
50
+ ` ${WRITE_BACK[1]}`,
51
+ `2. Do exactly what its "instructions" say. The owner approved what "summary" and "details" describe and`,
52
+ ` nothing more: if carrying it out would need something they do not say, stop and fail it with that`,
53
+ ` reason rather than improvising.`,
54
+ `3. ${WRITE_BACK[2]} ${WRITE_BACK[3]}`,
55
+ ` ${WRITE_BACK[4]}`,
56
+ ``,
57
+ `Never touch a file not listed above.`,
58
+ ].join(`\n`);
@@ -1,8 +1,7 @@
1
1
  import { STATE_DIR } from "@intentic/constants";
2
2
  import { describe, expect, it } from "vitest";
3
3
 
4
- // The job a batch pack starts, which decides whose model list pays for it. Maintenance stands in for all of
5
- // them: what `batchTurnBody` owes is that the role it is handed reaches the turn, not which one it was.
4
+ // Stands in for any role: what's tested is that the role reaches the turn, not which one it is.
6
5
  const ROLE = `maintenance-chore` as const;
7
6
  import {
8
7
  type BatchRunKind,
@@ -17,10 +16,9 @@ import {
17
16
  batchTurnBody,
18
17
  parseBatchFile,
19
18
  } from "./batch-runs.js";
20
- import { ConversationIdSchema } from "./schemas/agent.js";
19
+ import { ConversationIdSchema } from "../schemas/agent.js";
21
20
 
22
- // The two real layouts this substrate had to fit without moving anything already on disk: one that fans out
23
- // over items under `records/artifacts`, and one where a run IS the item, under `records/chores`.
21
+ // The two real layouts this fits: one fans out over items, one where a run is the item.
24
22
  const FANNED: BatchRunKind = { runsDir: `records/artifacts/acceptance`, prefix: `xt`, scanRuns: 10 };
25
23
  const SINGLE: BatchRunKind = { runsDir: `records/chores/runs`, prefix: `mt`, scanRuns: 30 };
26
24
 
@@ -31,15 +29,12 @@ describe(`batch run ids`, () => {
31
29
  expect([earlier < later, earlier.startsWith(`r`)]).toEqual([true, true]);
32
30
  });
33
31
 
34
- /* Sorting has to survive a base-36 digit boundary, which is what an unpadded `toString(36)` gets wrong:
35
- * the smaller number is the shorter string, and the shorter string sorts first only by luck. */
32
+ // Must survive a digit boundary: unpadded toString(36) sorts the shorter string first, not the smaller number.
36
33
  it(`still sorts when two moments straddle a digit boundary`, () => {
37
34
  const boundary = 36 ** 7;
38
35
  expect(batchRunIdAt(boundary - 1) < batchRunIdAt(boundary)).toBe(true);
39
36
  });
40
37
 
41
- /* The drift that made this shared. A surface where one run IS one item mints several inside a millisecond
42
- * ("run this chore in every repository"), and the copy without a counter handed them all the same id. */
43
38
  it(`does not repeat inside one millisecond`, () => {
44
39
  const minted = new Set(Array.from({ length: 50 }, () => batchRunIdAt(1_700_000_000_000)));
45
40
  expect(minted.size).toBe(50);
@@ -56,15 +51,12 @@ describe(`batch conversation ids`, () => {
56
51
  expect(batchConversationId(SINGLE, `r5k2a`)).toBe(`mt-r5k2a`);
57
52
  });
58
53
 
59
- /* The run id is how a finished card is attributed back to its run, so the ITEM is what gets cut. Measured
60
- * against the real schema rather than a copy of its regex: the cap exists because that schema enforces it. */
61
54
  it(`cuts the item, never the run id, and still satisfies ConversationIdSchema`, () => {
62
55
  const runId = batchRunIdAt(1_700_000_000_000);
63
56
  const id = batchConversationId(FANNED, runId, `x`.repeat(200));
64
57
  expect([id.startsWith(`xt-${runId}-`), ConversationIdSchema.safeParse(id).success]).toEqual([true, true]);
65
58
  });
66
59
 
67
- // A cut that lands on the separator would leave `xt-r5k2-`, which ConversationIdSchema refuses.
68
60
  it(`leaves no trailing separator when the cut lands on one`, () => {
69
61
  const runId = `r${`z`.repeat(58)}`;
70
62
  const id = batchConversationId(FANNED, runId, `story`);
@@ -81,8 +73,6 @@ describe(`where a run keeps its files`, () => {
81
73
  expect(batchResultPath(FANNED, `r5k2`, `checkout-flow`)).toBe(`${STATE_DIR}/records/artifacts/acceptance/r5k2/checkout-flow/result.json`);
82
74
  });
83
75
 
84
- // A run whose item is the run writes beside its manifest rather than one pointless level down: the layout
85
- // maintenance already has on disk.
86
76
  it(`writes a single-item run's result beside its manifest`, () => {
87
77
  expect([batchResultPath(SINGLE, `r5k2a`), batchItemDir(SINGLE, `r5k2a`)]).toEqual([
88
78
  `${STATE_DIR}/records/chores/runs/r5k2a/result.json`,
@@ -99,8 +89,6 @@ describe(`reading a file an agent may still be writing`, () => {
99
89
  expect(parseBatchFile(`{"outcome":"acted"}`, shape)).toEqual({ outcome: `acted` });
100
90
  });
101
91
 
102
- /* All three failures are the same answer — undefined — because one bad directory must not blank a whole
103
- * history, and a half-written file is ordinary here rather than exceptional. */
104
92
  it(`skips a file that is truncated, is not an object, or does not fit the shape`, () => {
105
93
  expect([parseBatchFile(`{"outcome":`, shape), parseBatchFile(`"acted"`, shape), parseBatchFile(`{"summary":"x"}`, shape)]).toEqual([
106
94
  undefined,
@@ -125,8 +113,6 @@ describe(`what the agent is told`, () => {
125
113
  expect(clause).toContain(batchResultPath(SINGLE, `r5k2a`));
126
114
  });
127
115
 
128
- /* A turn that concludes there was nothing to do and writes no file is indistinguishable from a turn that
129
- * died, and the surface has to show the second as an unknown. */
130
116
  it(`asks for the file even when there was nothing to do`, () => {
131
117
  expect(clause).toContain(`even if you conclude there was nothing to do`);
132
118
  });
@@ -157,8 +143,6 @@ describe(`the turn a run starts`, () => {
157
143
  expect([body[`agent`], body[`model`], body[`effort`]]).toEqual([`claude`, `opus`, `high`]);
158
144
  });
159
145
 
160
- /* ABSENT rather than undefined: the body is serialized to JSON and the daemon's fill step reads a missing
161
- * key as "the owner's list for this job decides", which is not what an explicit null would say. */
162
146
  it(`omits the keys a pick did not pin, rather than sending them empty`, () => {
163
147
  const body = batchTurnBody({ prompt: `p`, title: `t`, conversationId: `c`, role: ROLE, pick: { provider: `claude` } });
164
148
  expect(Object.keys(body)).not.toContain(`model`);
@@ -0,0 +1,137 @@
1
+ import { STATE_DIR } from "@intentic/constants";
2
+ import type { ModelRole } from "../models/model-roles.js";
3
+
4
+ // One batch run engine for every surface that fans an isolated agent turn out over items and reads results off disk.
5
+ // Backed by files, not a pack's own store, with derived conversation ids that join the fleet via a GET /agents filter,
6
+ // under .intentic. Manifest and result shapes stay with the packs; this owns only what all three need alike.
7
+
8
+ // Where one kind of run keeps its directories: the tail, not composed from a pack id, since the existing on-disk
9
+ // layouts (acceptance vs maintenance) are not uniform and rewriting them would orphan runs.
10
+ export interface BatchRunKind {
11
+ /* The directory holding this kind's run directories, workspace-relative, under the state dir. */
12
+ readonly runsDir: string;
13
+ // The conversation-id prefix (2-3 chars); every conversation this kind starts carries it as the join key.
14
+ readonly prefix: string;
15
+ // How many runs deep a results reader goes; one shared number so a badge and a list never disagree on "recent".
16
+ readonly scanRuns: number;
17
+ }
18
+
19
+ // Hard ceiling from the conversation id's own regex (it lands in branch names and paths), not a style choice.
20
+ const CONVERSATION_ID_MAX = 64;
21
+
22
+ // `r` + a zero-padded base-36 millisecond + a per-process counter: padding keeps it sortable across a digit boundary,
23
+ // and the counter is needed since a single-item-per-run surface can mint several within one millisecond.
24
+ const TIME_DIGITS = 8;
25
+ let sequence = 0;
26
+ export const batchRunIdAt = (epochMs: number): string => `r${epochMs.toString(36).padStart(TIME_DIGITS, `0`)}${(sequence++).toString(36)}`;
27
+
28
+ // The fleet conversation id for one item of a run (or a single-item run, omitting item). The run id survives
29
+ // truncation, since that's what attributes a card back to its run; a trailing separator left by the cut is trimmed.
30
+ export const batchConversationId = (kind: BatchRunKind, runId: string, item?: string): string =>
31
+ `${kind.prefix}-${runId}${item === undefined ? `` : `-${item}`}`.slice(0, CONVERSATION_ID_MAX).replace(/[-_]+$/u, ``);
32
+
33
+ // Every conversation one kind starts, for the prefix filter over GET /agents that joins a run to the fleet.
34
+ export const batchRunPrefix = (kind: BatchRunKind): string => `${kind.prefix}-`;
35
+
36
+ // The directory holding one kind's run directories, workspace-relative. What a listing is asked for.
37
+ export const batchRunsDir = (kind: BatchRunKind): string => `${STATE_DIR}/${kind.runsDir}`;
38
+ export const batchRunDir = (kind: BatchRunKind, runId: string): string => `${batchRunsDir(kind)}/${runId}`;
39
+ export const batchRunManifestPath = (kind: BatchRunKind, runId: string): string => `${batchRunDir(kind, runId)}/run.json`;
40
+
41
+ // Where one item of a run leaves its files; an item-less run (item omitted) writes straight into the run directory,
42
+ // keeping result.json beside run.json rather than one level down.
43
+ export const batchItemDir = (kind: BatchRunKind, runId: string, item?: string): string =>
44
+ item === undefined ? batchRunDir(kind, runId) : `${batchRunDir(kind, runId)}/${item}`;
45
+ export const batchResultPath = (kind: BatchRunKind, runId: string, item?: string): string => `${batchItemDir(kind, runId, item)}/result.json`;
46
+
47
+ // A half-written file, or one from before the shape changed, is skipped rather than thrown on: reading a run mid-write
48
+ // is ordinary here. The caller supplies the shape check; this owns only invalid or non-object JSON.
49
+ export const parseBatchFile = <T>(text: string, shape: (value: Record<string, unknown>) => T | undefined): T | undefined => {
50
+ try {
51
+ const parsed: unknown = JSON.parse(text);
52
+ return typeof parsed !== `object` || parsed === null ? undefined : shape(parsed as Record<string, unknown>);
53
+ } catch {
54
+ return undefined;
55
+ }
56
+ };
57
+
58
+ /* WHAT THE AGENT IS TOLD ABOUT WHERE TO LEAVE ITS ANSWER, appended to whatever prompt the pack composed.
59
+ *
60
+ * WHY THE AGENT WRITES A FILE AND NOT A ROUTE. A ledger is a daemon route, and reaching it from a turn would
61
+ * mean handing the agent a token and a client it needs for nothing else. Writing one small JSON file is
62
+ * something every agent can already do, and the surface promotes finished runs when it next sees them. The
63
+ * promotion is idempotent and re-runs on every poll, so nothing is lost by not being watched.
64
+ *
65
+ * `outcomes` is the pack's vocabulary and is spelled out in full, because a closed set is what lets a surface
66
+ * debounce without hiding anything: an agent that verified some findings and concluded they were false
67
+ * positives has to be able to SAY so, or the next poll starts the same turn again forever. Pass the
68
+ * explanations with the words — a model that reads an outcome as an admission of having done nothing useful
69
+ * will avoid it and report something else, and the surface never goes quiet.
70
+ *
71
+ * The closing line is not decoration. A turn that concludes there was nothing to do and writes no file is
72
+ * indistinguishable from a turn that died, and the surface has to show the second as an unknown. */
73
+ export const batchReportingClause = (params: { readonly path: string; readonly fields: string; readonly outcomes?: string | undefined }): string =>
74
+ [
75
+ `When you are finished, write your conclusion to ${params.path} as JSON:`,
76
+ params.fields,
77
+ ...(params.outcomes === undefined ? [] : [params.outcomes]),
78
+ `Write that file even if you conclude there was nothing to do.`,
79
+ ].join(`\n\n`);
80
+
81
+ /* THE BODY OF THE `POST /agent` THAT STARTS ONE ITEM, so the flag combination that makes a run a run is decided
82
+ * once. `isolated: true` with a conversationId is the shape (and the only shape) that registers a fleet entry,
83
+ * which is why none of these packs owns session machinery; `unattended: true` is what the turn IS — started by
84
+ * a row rather than by a person at a composer — and `runRole` is which of those rows, so the daemon answers
85
+ * with the owner's list FOR THAT JOB (model-roles.ts) unless the caller pinned a model on the row's caret, in
86
+ * which case the pick rides along and the daemon's fill step leaves it alone.
87
+ *
88
+ * PERMISSIONS AND ISOLATION ARE THE CALLER'S, deliberately. They are the two decisions that differ by kind and
89
+ * both are about safety rather than plumbing: an acceptance test that parks on a permission card is a test that
90
+ * never finishes, so that surface trades the prompt away; a maintenance chore is different in kind — nobody is
91
+ * waiting on it, it may take until tomorrow, and a sweep that can answer its own permission prompts is exactly
92
+ * the thing an owner would want to have been asked about. A default here would decide that for both. */
93
+ /* WHAT THE CARET ON THE RUN BUTTON CHOSE, in the shell's own vocabulary (`provider`; the turn calls it `agent`).
94
+ * Every field but the provider is optional and absent means absent: the turn goes out without it and the model's
95
+ * own default answers. All of them travel, because all of them are things the picker can now set and each is a
96
+ * different price — a run re-pointed at a frontier model but not at the tier, the loop or the account it was
97
+ * pinned under is not the run the reader configured. */
98
+ export interface BatchTurnPick {
99
+ readonly provider: string;
100
+ readonly model?: string | undefined;
101
+ readonly account?: string | undefined;
102
+ readonly harness?: string | undefined;
103
+ readonly effort?: string | undefined;
104
+ readonly thinking?: boolean | undefined;
105
+ readonly fast?: boolean | undefined;
106
+ }
107
+
108
+ // The same fields under the names a turn uses. Its own function so the body builder below stays one readable
109
+ // object literal rather than seven nested conditionals.
110
+ const runPickFields = (pick: BatchTurnPick): Record<string, unknown> => ({
111
+ agent: pick.provider,
112
+ ...(pick.model === undefined ? {} : { model: pick.model }),
113
+ ...(pick.account === undefined ? {} : { account: pick.account }),
114
+ ...(pick.harness === undefined ? {} : { harness: pick.harness }),
115
+ ...(pick.effort === undefined ? {} : { effort: pick.effort }),
116
+ ...(pick.thinking === undefined ? {} : { thinking: pick.thinking }),
117
+ ...(pick.fast === undefined ? {} : { fast: pick.fast }),
118
+ });
119
+
120
+ export const batchTurnBody = (params: {
121
+ readonly prompt: string;
122
+ readonly title: string;
123
+ readonly conversationId: string;
124
+ // Which job this is, and so which model list pays; required, so a pack can't silently inherit another's budget.
125
+ readonly role: ModelRole;
126
+ readonly pick?: BatchTurnPick | undefined;
127
+ readonly extra?: Readonly<Record<string, unknown>> | undefined;
128
+ }): Record<string, unknown> => ({
129
+ prompt: params.prompt,
130
+ title: params.title.slice(0, 80),
131
+ conversationId: params.conversationId,
132
+ isolated: true,
133
+ unattended: true,
134
+ runRole: params.role,
135
+ ...(params.pick === undefined ? {} : runPickFields(params.pick)),
136
+ ...params.extra,
137
+ });
@@ -0,0 +1,5 @@
1
+ // Marker for "leave the stored value alone"; distinct from empty or missing so a bypassed read fails loudly.
2
+ export const VAULTED = "__intentic_vaulted__";
3
+
4
+ /** Whether a value is the marker rather than a real credential. */
5
+ export const isVaulted = (value: unknown): boolean => value === VAULTED;
@@ -1,19 +1,14 @@
1
- import type { CardField, TranscriptCards, TranscriptRow } from "./events.js";
2
- import type { AgentReply } from "./schemas/plan-limits.js";
1
+ import type { CardField, TranscriptCards, TranscriptRow } from "../events/transcript.js";
2
+ import type { AgentReply } from "../schemas/plan-limits.js";
3
3
 
4
- /* HOW A REPLY SETTLES THE CARD IT ANSWERS, the one derivation, used by the fold when the `resolved` frame lands
5
- * (transcript-fold.ts) and by a chat freezing its own card the instant its answer is accepted, before that
6
- * frame comes back. Two callers, one rule, which is what keeps "answered" looking the same on the window that
7
- * clicked and on every window that only watched.
8
- *
9
- * No reply is nobody answering: the turn was stopped, or died under the card, which is not a decision, so every
10
- * card reads `cancelled`. A reply of the wrong kind cannot reach a card of another, the requestId is what
11
- * matched it, and reads as unanswered rather than inventing a decision. */
4
+ // How a reply settles the card it answers: one rule used both by the fold and by a chat freezing its own card
5
+ // optimistically before the frame returns. No reply (turn stopped or died) reads as cancelled for every card; a reply
6
+ // of the wrong kind cannot settle a card of another, since requestId is what matches them.
12
7
  type Cards = { -readonly [K in CardField]?: TranscriptRow[K] };
13
8
 
14
9
  export const settledCards = (cards: TranscriptCards, reply: AgentReply | undefined): TranscriptCards => {
15
10
  const out: Cards = {};
16
- const { plan, question, permission, browserHelp, terminalHelp, serviceOffer, capabilityOffer, paymentOffer, credentialOffer } = cards;
11
+ const { plan, question, permission, browserHelp, terminalHelp, capabilityOffer, paymentOffer, credentialOffer } = cards;
17
12
  if (plan !== undefined) {
18
13
  out.plan = { ...plan, status: reply?.kind !== "plan" ? "cancelled" : reply.approve ? "approved" : "rejected" };
19
14
  }
@@ -44,26 +39,18 @@ export const settledCards = (cards: TranscriptCards, reply: AgentReply | undefin
44
39
  if (terminalHelp !== undefined) {
45
40
  out.terminalHelp = { ...terminalHelp, status: reply?.kind !== "terminal_help" ? "cancelled" : reply.helped ? "helped" : "declined" };
46
41
  }
47
- if (serviceOffer !== undefined) {
48
- out.serviceOffer = { ...serviceOffer, status: reply?.kind !== "service_offer" ? "cancelled" : reply.approve ? "approved" : "skipped" };
49
- }
50
- // A yes settles the DECISION, not the ask: the owner is now setting the capability up, so the card moves to
51
- // `connecting` and stays there until the capability_outcome frame says how the setup ended.
42
+ // A yes settles the decision, not the ask: the card moves to connecting until capability_outcome resolves it.
52
43
  if (capabilityOffer !== undefined) {
53
44
  out.capabilityOffer = {
54
45
  ...capabilityOffer,
55
46
  status: reply?.kind !== "capability_offer" ? "cancelled" : reply.connect ? "connecting" : "skipped",
56
47
  };
57
48
  }
58
- // A yes settles the decision; whether the money actually moved is the payment_receipt frame's to say.
49
+ // A yes settles the decision; whether the money moved is the payment_receipt frame's to say.
59
50
  if (paymentOffer !== undefined) {
60
51
  out.paymentOffer = { ...paymentOffer, status: reply?.kind !== "payment_offer" ? "cancelled" : reply.approve ? "approved" : "skipped" };
61
52
  }
62
- /* A yes settles the decision; WHO decided is the credential_receipt frame's to say, because only the
63
- * daemon knows it — the reply carries no name, the identity was verified off the request that delivered
64
- * it. A reply that reaches this derivation at all is one the daemon already accepted from an approver: a
65
- * click from anybody else is refused before the card is settled, so it never gets here and the card stays
66
- * pending. */
53
+ // A yes settles the decision; who decided is the credential_receipt frame's, since only the daemon knows.
67
54
  if (credentialOffer !== undefined) {
68
55
  out.credentialOffer = {
69
56
  ...credentialOffer,
@@ -73,9 +60,8 @@ export const settledCards = (cards: TranscriptCards, reply: AgentReply | undefin
73
60
  return out;
74
61
  };
75
62
 
76
- /* The same cards with every one still `pending` frozen as `cancelled`: the turn ended out from under the ask
77
- * (a Stop, a death, a failure) and nobody decided anything. Returns the SAME object when nothing was pending,
78
- * so a caller can tell a row that changed from one that did not. */
63
+ // Freezes every still-pending card as cancelled: the turn ended (stopped, died, failed) before anyone decided. Returns
64
+ // the same object when nothing was pending, so a caller can tell a changed row from an unchanged one.
79
65
  export const cancelledCards = (cards: TranscriptCards): TranscriptCards => {
80
66
  const out: Cards = {};
81
67
  let changed = false;
@@ -85,7 +71,6 @@ export const cancelledCards = (cards: TranscriptCards): TranscriptCards => {
85
71
  "permission",
86
72
  "browserHelp",
87
73
  "terminalHelp",
88
- "serviceOffer",
89
74
  "capabilityOffer",
90
75
  "paymentOffer",
91
76
  "credentialOffer",