@intentic/sandbox-contract 1.330.0 → 1.332.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 (337) hide show
  1. package/README.md +15 -0
  2. package/dist/chores/probes.d.ts.map +1 -1
  3. package/dist/chores/probes.js.map +1 -1
  4. package/dist/contracts/accounts.contract.d.ts +15 -0
  5. package/dist/contracts/accounts.contract.d.ts.map +1 -1
  6. package/dist/contracts/agent.contract.d.ts +38 -0
  7. package/dist/contracts/agent.contract.d.ts.map +1 -1
  8. package/dist/contracts/agent.contract.js +14 -3
  9. package/dist/contracts/agent.contract.js.map +1 -1
  10. package/dist/contracts/agents.contract.d.ts +29 -0
  11. package/dist/contracts/agents.contract.d.ts.map +1 -1
  12. package/dist/contracts/automations.contract.d.ts +2 -0
  13. package/dist/contracts/automations.contract.d.ts.map +1 -1
  14. package/dist/contracts/device.contract.d.ts +7 -0
  15. package/dist/contracts/device.contract.d.ts.map +1 -1
  16. package/dist/contracts/git.contract.d.ts +2 -0
  17. package/dist/contracts/git.contract.d.ts.map +1 -1
  18. package/dist/contracts/logs.contract.d.ts +10 -0
  19. package/dist/contracts/logs.contract.d.ts.map +1 -1
  20. package/dist/contracts/needs.contract.d.ts +7 -0
  21. package/dist/contracts/needs.contract.d.ts.map +1 -1
  22. package/dist/contracts/offload.contract.d.ts +70 -0
  23. package/dist/contracts/offload.contract.d.ts.map +1 -1
  24. package/dist/contracts/offload.contract.js +10 -1
  25. package/dist/contracts/offload.contract.js.map +1 -1
  26. package/dist/contracts/privacy.contract.d.ts +14 -0
  27. package/dist/contracts/privacy.contract.d.ts.map +1 -1
  28. package/dist/contracts/privacy.contract.js +11 -1
  29. package/dist/contracts/privacy.contract.js.map +1 -1
  30. package/dist/contracts/providers.contract.d.ts +3 -0
  31. package/dist/contracts/providers.contract.d.ts.map +1 -1
  32. package/dist/contracts/runner.contract.d.ts +106 -2
  33. package/dist/contracts/runner.contract.d.ts.map +1 -1
  34. package/dist/contracts/sessions.contract.d.ts +1 -0
  35. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  36. package/dist/contracts/settings.contract.d.ts +74 -94
  37. package/dist/contracts/settings.contract.d.ts.map +1 -1
  38. package/dist/contracts/settings.contract.js +19 -1
  39. package/dist/contracts/settings.contract.js.map +1 -1
  40. package/dist/contracts/system.contract.d.ts +20 -0
  41. package/dist/contracts/system.contract.d.ts.map +1 -1
  42. package/dist/contracts/translator.contract.d.ts +8 -0
  43. package/dist/contracts/translator.contract.d.ts.map +1 -1
  44. package/dist/events/agent-events.d.ts +47 -0
  45. package/dist/events/agent-events.d.ts.map +1 -1
  46. package/dist/events/agent-events.js +6 -0
  47. package/dist/events/agent-events.js.map +1 -1
  48. package/dist/events/agent-words.d.ts.map +1 -1
  49. package/dist/events/agent-words.js +1 -1
  50. package/dist/events/agent-words.js.map +1 -1
  51. package/dist/events/resume.d.ts +3 -0
  52. package/dist/events/resume.d.ts.map +1 -1
  53. package/dist/events/resume.js +17 -2
  54. package/dist/events/resume.js.map +1 -1
  55. package/dist/events/sandbox-notice.d.ts +18 -0
  56. package/dist/events/sandbox-notice.d.ts.map +1 -1
  57. package/dist/events/sandbox-notice.js +27 -1
  58. package/dist/events/sandbox-notice.js.map +1 -1
  59. package/dist/events/system-events.d.ts +4 -0
  60. package/dist/events/system-events.d.ts.map +1 -1
  61. package/dist/events/transcript.d.ts +64 -0
  62. package/dist/events/transcript.d.ts.map +1 -1
  63. package/dist/events/transcript.js +17 -1
  64. package/dist/events/transcript.js.map +1 -1
  65. package/dist/index.d.ts +327 -124
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +5 -0
  68. package/dist/index.js.map +1 -1
  69. package/dist/models/agent-catalog.d.ts.map +1 -1
  70. package/dist/models/agent-catalog.js +8 -7
  71. package/dist/models/agent-catalog.js.map +1 -1
  72. package/dist/models/agent-runtimes.d.ts +3 -1
  73. package/dist/models/agent-runtimes.d.ts.map +1 -1
  74. package/dist/models/agent-runtimes.js +10 -0
  75. package/dist/models/agent-runtimes.js.map +1 -1
  76. package/dist/models/model-order.d.ts +1 -0
  77. package/dist/models/model-order.d.ts.map +1 -1
  78. package/dist/models/model-order.js +9 -0
  79. package/dist/models/model-order.js.map +1 -1
  80. package/dist/models/model-pins.d.ts.map +1 -1
  81. package/dist/models/model-pins.js.map +1 -1
  82. package/dist/models/model-roles.d.ts +32 -17
  83. package/dist/models/model-roles.d.ts.map +1 -1
  84. package/dist/models/model-roles.js +30 -26
  85. package/dist/models/model-roles.js.map +1 -1
  86. package/dist/models/model-setups.d.ts +46 -0
  87. package/dist/models/model-setups.d.ts.map +1 -0
  88. package/dist/models/model-setups.js +86 -0
  89. package/dist/models/model-setups.js.map +1 -0
  90. package/dist/models/plan-pools.d.ts +5 -1
  91. package/dist/models/plan-pools.d.ts.map +1 -1
  92. package/dist/models/plan-pools.js +41 -13
  93. package/dist/models/plan-pools.js.map +1 -1
  94. package/dist/models/provider-specs.d.ts +20 -0
  95. package/dist/models/provider-specs.d.ts.map +1 -1
  96. package/dist/models/provider-specs.js +13 -1
  97. package/dist/models/provider-specs.js.map +1 -1
  98. package/dist/policy/command-classes.d.ts.map +1 -1
  99. package/dist/policy/command-classes.js +26 -3
  100. package/dist/policy/command-classes.js.map +1 -1
  101. package/dist/policy/credential-material.d.ts +6 -0
  102. package/dist/policy/credential-material.d.ts.map +1 -1
  103. package/dist/policy/credential-material.js +37 -15
  104. package/dist/policy/credential-material.js.map +1 -1
  105. package/dist/policy/search-globs.d.ts +3 -0
  106. package/dist/policy/search-globs.d.ts.map +1 -1
  107. package/dist/policy/search-globs.js +118 -0
  108. package/dist/policy/search-globs.js.map +1 -1
  109. package/dist/policy/secret-hosts.d.ts +1 -0
  110. package/dist/policy/secret-hosts.d.ts.map +1 -1
  111. package/dist/policy/secret-hosts.js +1 -0
  112. package/dist/policy/secret-hosts.js.map +1 -1
  113. package/dist/policy/turned-away.d.ts.map +1 -1
  114. package/dist/policy/turned-away.js +1 -0
  115. package/dist/policy/turned-away.js.map +1 -1
  116. package/dist/protocol/doors/runner-protocol.d.ts +9 -0
  117. package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
  118. package/dist/protocol/doors/runner-protocol.js +5 -0
  119. package/dist/protocol/doors/runner-protocol.js.map +1 -1
  120. package/dist/protocol/pairing-redeem.d.ts +23 -0
  121. package/dist/protocol/pairing-redeem.d.ts.map +1 -0
  122. package/dist/protocol/pairing-redeem.js +44 -0
  123. package/dist/protocol/pairing-redeem.js.map +1 -0
  124. package/dist/protocol/peer-mcp-server.d.ts.map +1 -1
  125. package/dist/protocol/peer-mcp-server.js +1 -1
  126. package/dist/protocol/peer-mcp-server.js.map +1 -1
  127. package/dist/protocol/raw/raw-json-routes.d.ts +16 -0
  128. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  129. package/dist/protocol/raw/raw-json-routes.js +2 -0
  130. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  131. package/dist/protocol/raw/raw-routes.d.ts +8 -0
  132. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  133. package/dist/protocol/raw/raw-routes.js +2 -0
  134. package/dist/protocol/raw/raw-routes.js.map +1 -1
  135. package/dist/protocol/sse.d.ts +20 -1
  136. package/dist/protocol/sse.d.ts.map +1 -1
  137. package/dist/protocol/sse.js +112 -17
  138. package/dist/protocol/sse.js.map +1 -1
  139. package/dist/schemas/agent.d.ts +35 -0
  140. package/dist/schemas/agent.d.ts.map +1 -1
  141. package/dist/schemas/agent.js +12 -1
  142. package/dist/schemas/agent.js.map +1 -1
  143. package/dist/schemas/automations.d.ts +6 -0
  144. package/dist/schemas/automations.d.ts.map +1 -1
  145. package/dist/schemas/automations.js +3 -1
  146. package/dist/schemas/automations.js.map +1 -1
  147. package/dist/schemas/devices.d.ts +17 -0
  148. package/dist/schemas/devices.d.ts.map +1 -1
  149. package/dist/schemas/devices.js +2 -1
  150. package/dist/schemas/devices.js.map +1 -1
  151. package/dist/schemas/engines.d.ts +8 -1
  152. package/dist/schemas/engines.d.ts.map +1 -1
  153. package/dist/schemas/engines.js +1 -1
  154. package/dist/schemas/engines.js.map +1 -1
  155. package/dist/schemas/environment.d.ts +30 -0
  156. package/dist/schemas/environment.d.ts.map +1 -1
  157. package/dist/schemas/environment.js +13 -0
  158. package/dist/schemas/environment.js.map +1 -1
  159. package/dist/schemas/git/git-scope.d.ts +20 -0
  160. package/dist/schemas/git/git-scope.d.ts.map +1 -0
  161. package/dist/schemas/git/git-scope.js +37 -0
  162. package/dist/schemas/git/git-scope.js.map +1 -0
  163. package/dist/schemas/git/git.d.ts +1 -0
  164. package/dist/schemas/git/git.d.ts.map +1 -1
  165. package/dist/schemas/git/git.js +9 -1
  166. package/dist/schemas/git/git.js.map +1 -1
  167. package/dist/schemas/hosts.d.ts +42 -0
  168. package/dist/schemas/hosts.d.ts.map +1 -1
  169. package/dist/schemas/hosts.js +3 -0
  170. package/dist/schemas/hosts.js.map +1 -1
  171. package/dist/schemas/keep-warm.d.ts +1 -0
  172. package/dist/schemas/keep-warm.d.ts.map +1 -1
  173. package/dist/schemas/keep-warm.js +1 -1
  174. package/dist/schemas/keep-warm.js.map +1 -1
  175. package/dist/schemas/logs.d.ts +21 -0
  176. package/dist/schemas/logs.d.ts.map +1 -1
  177. package/dist/schemas/logs.js +19 -0
  178. package/dist/schemas/logs.js.map +1 -1
  179. package/dist/schemas/metrics.d.ts +12 -0
  180. package/dist/schemas/metrics.d.ts.map +1 -1
  181. package/dist/schemas/metrics.js +26 -8
  182. package/dist/schemas/metrics.js.map +1 -1
  183. package/dist/schemas/needs.d.ts +19 -0
  184. package/dist/schemas/needs.d.ts.map +1 -1
  185. package/dist/schemas/needs.js +17 -3
  186. package/dist/schemas/needs.js.map +1 -1
  187. package/dist/schemas/offload.d.ts +154 -0
  188. package/dist/schemas/offload.d.ts.map +1 -1
  189. package/dist/schemas/offload.js +34 -0
  190. package/dist/schemas/offload.js.map +1 -1
  191. package/dist/schemas/privacy.d.ts +19 -0
  192. package/dist/schemas/privacy.d.ts.map +1 -1
  193. package/dist/schemas/privacy.js +17 -2
  194. package/dist/schemas/privacy.js.map +1 -1
  195. package/dist/schemas/project-bring-back.d.ts +172 -0
  196. package/dist/schemas/project-bring-back.d.ts.map +1 -0
  197. package/dist/schemas/project-bring-back.js +39 -0
  198. package/dist/schemas/project-bring-back.js.map +1 -0
  199. package/dist/schemas/providers/handoff.d.ts +77 -0
  200. package/dist/schemas/providers/handoff.d.ts.map +1 -0
  201. package/dist/schemas/providers/handoff.js +85 -0
  202. package/dist/schemas/providers/handoff.js.map +1 -0
  203. package/dist/schemas/providers/plan-limits.d.ts +34 -0
  204. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  205. package/dist/schemas/providers/plan-limits.js +13 -2
  206. package/dist/schemas/providers/plan-limits.js.map +1 -1
  207. package/dist/schemas/providers/provider-oauth.d.ts +8 -0
  208. package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
  209. package/dist/schemas/providers/usage.d.ts +3 -1
  210. package/dist/schemas/providers/usage.d.ts.map +1 -1
  211. package/dist/schemas/providers/usage.js +7 -2
  212. package/dist/schemas/providers/usage.js.map +1 -1
  213. package/dist/schemas/run-targets.d.ts.map +1 -1
  214. package/dist/schemas/run-targets.js +5 -2
  215. package/dist/schemas/run-targets.js.map +1 -1
  216. package/dist/schemas/settings-history.d.ts +6 -1
  217. package/dist/schemas/settings-history.d.ts.map +1 -1
  218. package/dist/schemas/settings-history.js +25 -1
  219. package/dist/schemas/settings-history.js.map +1 -1
  220. package/dist/schemas/settings.d.ts +69 -100
  221. package/dist/schemas/settings.d.ts.map +1 -1
  222. package/dist/schemas/settings.js +41 -24
  223. package/dist/schemas/settings.js.map +1 -1
  224. package/dist/schemas/short-codes.d.ts +31 -0
  225. package/dist/schemas/short-codes.d.ts.map +1 -0
  226. package/dist/schemas/short-codes.js +28 -0
  227. package/dist/schemas/short-codes.js.map +1 -0
  228. package/dist/schemas/system.d.ts +130 -0
  229. package/dist/schemas/system.d.ts.map +1 -1
  230. package/dist/schemas/system.js +37 -1
  231. package/dist/schemas/system.js.map +1 -1
  232. package/dist/state/definition.d.ts +64 -40
  233. package/dist/state/definition.d.ts.map +1 -1
  234. package/dist/state/history-state.d.ts.map +1 -1
  235. package/dist/state/history-state.js +1 -0
  236. package/dist/state/history-state.js.map +1 -1
  237. package/dist/state/runtime-state.d.ts +3 -0
  238. package/dist/state/runtime-state.d.ts.map +1 -1
  239. package/dist/state/runtime-state.js +1 -0
  240. package/dist/state/runtime-state.js.map +1 -1
  241. package/dist/state/versions.d.ts +6 -0
  242. package/dist/state/versions.d.ts.map +1 -1
  243. package/dist/state/versions.js +47 -0
  244. package/dist/state/versions.js.map +1 -1
  245. package/dist/text/embed.d.ts +2 -1
  246. package/dist/text/embed.d.ts.map +1 -1
  247. package/dist/text/embed.js +10 -5
  248. package/dist/text/embed.js.map +1 -1
  249. package/dist/text/title.d.ts.map +1 -1
  250. package/dist/text/title.js +4 -7
  251. package/dist/text/title.js.map +1 -1
  252. package/dist/text/transcript-fold.d.ts +2 -1
  253. package/dist/text/transcript-fold.d.ts.map +1 -1
  254. package/dist/text/transcript-fold.js +21 -6
  255. package/dist/text/transcript-fold.js.map +1 -1
  256. package/package.json +28 -6
  257. package/src/chores/probes.ts +3 -1
  258. package/src/contracts/agent.contract.ts +24 -3
  259. package/src/contracts/offload.contract.ts +21 -1
  260. package/src/contracts/privacy.contract.ts +13 -0
  261. package/src/contracts/settings.contract.ts +23 -0
  262. package/src/events/agent-events.ts +13 -0
  263. package/src/events/agent-words.ts +2 -3
  264. package/src/events/resume.test.ts +14 -2
  265. package/src/events/resume.ts +32 -3
  266. package/src/events/sandbox-notice.ts +31 -1
  267. package/src/events/transcript.ts +27 -2
  268. package/src/index.ts +5 -0
  269. package/src/models/agent-catalog.test.ts +4 -3
  270. package/src/models/agent-catalog.ts +10 -7
  271. package/src/models/agent-runtimes.ts +30 -1
  272. package/src/models/capability-ledger.test.ts +4 -0
  273. package/src/models/model-order.ts +13 -0
  274. package/src/models/model-pins.ts +5 -4
  275. package/src/models/model-roles.test.ts +9 -31
  276. package/src/models/model-roles.ts +42 -49
  277. package/src/models/model-setups.test.ts +100 -0
  278. package/src/models/model-setups.ts +151 -0
  279. package/src/models/plan-pools.test.ts +85 -0
  280. package/src/models/plan-pools.ts +76 -17
  281. package/src/models/provider-specs.ts +20 -2
  282. package/src/policy/command-classes.ts +34 -3
  283. package/src/policy/credential-material.ts +58 -16
  284. package/src/policy/search-globs.ts +135 -0
  285. package/src/policy/secret-hosts.ts +7 -0
  286. package/src/policy/tests/command-classes.test.ts +35 -0
  287. package/src/policy/tests/credential-material.test.ts +20 -0
  288. package/src/policy/tests/search-globs.test.ts +46 -1
  289. package/src/policy/tests/secret-hosts.test.ts +17 -1
  290. package/src/policy/turned-away.ts +2 -0
  291. package/src/protocol/doors/runner-protocol.ts +14 -1
  292. package/src/protocol/pairing-redeem.test.ts +86 -0
  293. package/src/protocol/pairing-redeem.ts +79 -0
  294. package/src/protocol/peer-mcp-server.ts +1 -2
  295. package/src/protocol/raw/raw-json-routes.ts +3 -0
  296. package/src/protocol/raw/raw-routes.ts +5 -0
  297. package/src/protocol/sse.test.ts +50 -1
  298. package/src/protocol/sse.ts +172 -26
  299. package/src/schemas/agent.ts +23 -2
  300. package/src/schemas/automations.ts +6 -2
  301. package/src/schemas/daemon-health.test.ts +28 -0
  302. package/src/schemas/devices.ts +11 -2
  303. package/src/schemas/engines.ts +1 -1
  304. package/src/schemas/environment.ts +25 -0
  305. package/src/schemas/git/git-scope.test.ts +91 -0
  306. package/src/schemas/git/git-scope.ts +71 -0
  307. package/src/schemas/git/git.ts +15 -1
  308. package/src/schemas/hosts.ts +7 -0
  309. package/src/schemas/keep-warm.ts +2 -1
  310. package/src/schemas/logs.ts +25 -0
  311. package/src/schemas/metrics.test.ts +80 -0
  312. package/src/schemas/metrics.ts +31 -9
  313. package/src/schemas/needs.ts +29 -3
  314. package/src/schemas/offload.ts +76 -0
  315. package/src/schemas/privacy.ts +27 -3
  316. package/src/schemas/project-bring-back.test.ts +15 -0
  317. package/src/schemas/project-bring-back.ts +78 -0
  318. package/src/schemas/providers/handoff.test.ts +42 -0
  319. package/src/schemas/providers/handoff.ts +128 -0
  320. package/src/schemas/providers/plan-limits.ts +23 -2
  321. package/src/schemas/providers/usage.ts +13 -7
  322. package/src/schemas/run-targets.ts +5 -2
  323. package/src/schemas/settings-history.ts +43 -1
  324. package/src/schemas/settings.test.ts +84 -6
  325. package/src/schemas/settings.ts +74 -44
  326. package/src/schemas/short-codes.ts +48 -0
  327. package/src/schemas/system.ts +63 -1
  328. package/src/state/history-state.ts +4 -0
  329. package/src/state/runtime-state.test.ts +4 -0
  330. package/src/state/runtime-state.ts +4 -0
  331. package/src/state/versions.test.ts +30 -1
  332. package/src/state/versions.ts +68 -0
  333. package/src/text/embed.test.ts +14 -0
  334. package/src/text/embed.ts +19 -10
  335. package/src/text/title.ts +5 -9
  336. package/src/text/transcript-fold.test.ts +61 -0
  337. package/src/text/transcript-fold.ts +31 -6
@@ -26,7 +26,22 @@ const failure = {
26
26
  };
27
27
 
28
28
  // The re-runs a resumed turn's row can name (events/resume.ts); a reason a reader does not know draws the row's text.
29
- const ResumeNoticeReasonSchema = z.enum(["auth", "outage", "restart", "stopped", "limit", "switched", "carried", "refused", "door", "overflow", "flagged", "continued"]);
29
+ const ResumeNoticeReasonSchema = z.enum([
30
+ "auth",
31
+ "outage",
32
+ "restart",
33
+ "stopped",
34
+ "limit",
35
+ "switched",
36
+ "carried",
37
+ "trimmed",
38
+ "summarized",
39
+ "refused",
40
+ "door",
41
+ "overflow",
42
+ "flagged",
43
+ "continued",
44
+ ]);
30
45
  export type ResumeNoticeReason = z.infer<typeof ResumeNoticeReasonSchema>;
31
46
 
32
47
  // Every code this build writes, one per sentence shape, each with the facts that shape needs.
@@ -66,6 +81,21 @@ export const SandboxNoticeSchema = z.discriminatedUnion("code", [
66
81
  // A turn sent thin for a small window ("16k"): what was left out, and whether the base instructions were swapped too.
67
82
  z.object({ code: z.literal("contextTrim"), params: z.object({ window: z.string(), omitted: z.string().optional(), base: z.boolean() }) }),
68
83
  z.object({ code: z.literal("resumed"), params: z.object({ reason: ResumeNoticeReasonSchema }) }),
84
+ // How a turn a spent allowance held continued the conversation (schemas/providers/handoff.ts): `tokens` the context
85
+ // it started from and `from` the one carrying the session whole would have re-read (both worded, "118k"); `cleared`
86
+ // older tool outputs a trimmed copy stubbed; `model` the one that wrote a summary. `fellBack` names the hand-off that
87
+ // was asked for and could not be built, which then went on with the record's short hand-off instead.
88
+ z.object({
89
+ code: z.literal("handedOff"),
90
+ params: z.object({
91
+ mode: z.enum(["carry", "trim", "summary"]),
92
+ tokens: z.string().optional(),
93
+ from: z.string().optional(),
94
+ cleared: count.optional(),
95
+ model: z.string().optional(),
96
+ fellBack: z.boolean().optional(),
97
+ }),
98
+ }),
69
99
  // An agent's own dependency install starting: into its conversation's own copy (`ownCopy`) or the main tree; the
70
100
  // workspace root (`root`) and up to three project folders named (`projects`, each with its slash, already joined),
71
101
  // and how many `more` were not named.
@@ -5,6 +5,7 @@ import { TurnErrandSchema, TurnSpeakerSchema } from "../schemas/speaker.js";
5
5
  import { SubagentKindSchema, SubagentStatusSchema, SubagentVerificationSchema } from "../schemas/terminal.js";
6
6
  import { NeedSchema } from "../schemas/needs.js";
7
7
  import { HeldEndingSchema, RetryLadderSchema } from "../schemas/turn-break.js";
8
+ import { HandoffOfferSchema } from "../schemas/providers/handoff.js";
8
9
  import { NoticeCodeSchema } from "./sandbox-notice.js";
9
10
  import { TranscriptAgentNoticeSchema } from "./agent-ui.js";
10
11
  import type { ToolCallContent, ToolCallLocation, ToolCallStatus, ToolKind } from "./requests.js";
@@ -134,6 +135,18 @@ export const TranscriptToolSchema: z.ZodType<TranscriptTool> = z.lazy(() =>
134
135
  subagent: TranscriptSubagentSchema.optional().describe(
135
136
  "The helper this call started, as the daemon's registry sees it: what it is, how it is going, what it has spent. What a card can say about a backgrounded child whose result is minutes away.",
136
137
  ),
138
+ input: z
139
+ .string()
140
+ .optional()
141
+ .describe(
142
+ "What the call was given, as JSON text cut to a few kilobytes, on a call whose input names no one-line target: an MCP tool's arguments, a delegation's prompt. Read afterwards to learn what was asked when the card alone cannot say.",
143
+ ),
144
+ startedAt: z.number().optional().describe("When the call was seen, in milliseconds. Absent on calls recorded before cards were stamped."),
145
+ endedAt: z
146
+ .number()
147
+ .optional()
148
+ .describe("When its result arrived, in milliseconds; absent while it runs, and on a call whose result never came."),
149
+ exitCode: z.number().int().optional().describe("A command's exit code, where the runtime reports one as a number rather than in its output."),
137
150
  }),
138
151
  );
139
152
  // The subagent a call started, on that call's card whichever mechanism started it (transcript-fold.ts places it).
@@ -176,6 +189,10 @@ export interface TranscriptTool {
176
189
  nested?: number | undefined;
177
190
  thinking?: string | undefined;
178
191
  subagent?: TranscriptSubagent | undefined;
192
+ input?: string | undefined;
193
+ startedAt?: number | undefined;
194
+ endedAt?: number | undefined;
195
+ exitCode?: number | undefined;
179
196
  }
180
197
 
181
198
  // Every ending that wakes a conversation off a condition watch; composing and parsing the wake is watch-wake.ts.
@@ -260,12 +277,17 @@ export const TranscriptRowSchema = z.object({
260
277
  .describe(
261
278
  "The run that produced this row. Present on everything a turn produced, absent on rows written outside one. A client draws a run's rows over whatever it already holds for that run, which is what this identifies; content cannot, because the last row of a live run keeps growing.",
262
279
  ),
263
- // The turn's send time (user rows only), not settlement; the only row-moment the daemon actually knows.
280
+ // The turn's send time (user rows only), not settlement; the agent's rows carry `openedAt` instead.
264
281
  sentAt: z
282
+ .number()
283
+ .optional()
284
+ .describe("When it was sent, in milliseconds. On the user's rows only; the agent's own rows and notices carry `openedAt`."),
285
+ // Stamped by the daemon as it folds the frame that opens the row, since the frames themselves carry no clock.
286
+ openedAt: z
265
287
  .number()
266
288
  .optional()
267
289
  .describe(
268
- "When it was sent, in milliseconds. On the user's rows only, because that is the only moment actually known: a turn's own frames arrive with no clock, so stamping the agent's rows could only ever mean the whole turn's start or end.",
290
+ "When an assistant bubble or a notice opened, in milliseconds, as the daemon folded the frame that started it. Absent on user rows, which carry `sentAt`, and on rows recorded before rows were stamped.",
269
291
  ),
270
292
  // A position moves under a rewind and a message's words can repeat, so this is the one name a message keeps.
271
293
  messageId: z
@@ -476,6 +498,9 @@ export const TurnEndingSchema = z.object({
476
498
  .describe(
477
499
  "The account the owner's policy is already moving this turn to, when it is; the surface then reports the move rather than offering a press.",
478
500
  ),
501
+ handoff: HandoffOfferSchema.optional().describe(
502
+ "How the held turn can continue once its cache is cold: carry the session, trim it, or summarise it, which one the sandbox suggests, and which one a person picked. Absent where there is nothing to carry.",
503
+ ),
479
504
  })
480
505
  .optional()
481
506
  .describe("Present when the daemon still holds the refused turn whole, so a press re-runs it rather than appending a message after it."),
package/src/index.ts CHANGED
@@ -188,6 +188,7 @@ export * from "./models/model-order.js";
188
188
  export * from "./models/model-offer.js";
189
189
  export * from "./models/model-pins.js";
190
190
  export * from "./models/model-roles.js";
191
+ export * from "./models/model-setups.js";
191
192
  export * from "./models/plan-pools.js";
192
193
  export * from "./text/path-refs.js";
193
194
  export * from "./text/archives.js";
@@ -224,6 +225,7 @@ export * from "./schemas/extension-updates.js";
224
225
  export * from "./schemas/providers/fast-mode.js";
225
226
  export * from "./schemas/diff.js";
226
227
  export * from "./schemas/git/git.js";
228
+ export * from "./schemas/git/git-scope.js";
227
229
  export * from "./schemas/git/git-history.js";
228
230
  export * from "./schemas/history.js";
229
231
  export * from "./schemas/hosts.js";
@@ -242,7 +244,9 @@ export * from "./schemas/panels.js";
242
244
  export * from "./schemas/personas.js";
243
245
  export * from "./schemas/privacy.js";
244
246
  export * from "./schemas/providers/plan-limits.js";
247
+ export * from "./schemas/providers/handoff.js";
245
248
  export * from "./schemas/platform-link.js";
249
+ export * from "./schemas/project-bring-back.js";
246
250
  export * from "./schemas/ports.js";
247
251
  export * from "./schemas/providers/provider-oauth.js";
248
252
  export * from "./schemas/providers/provider-subscriptions.js";
@@ -257,6 +261,7 @@ export * from "./schemas/settings.js";
257
261
  export * from "./schemas/settings-history.js";
258
262
  export * from "./schemas/share.js";
259
263
  export * from "./schemas/shared.js";
264
+ export * from "./schemas/short-codes.js";
260
265
  export * from "./schemas/system-prompt.js";
261
266
  export * from "./schemas/system.js";
262
267
  export * from "./schemas/state-plan.js";
@@ -29,7 +29,7 @@ describe("every provider/harness pair declares what it can do", () => {
29
29
  it.each(pairs)("$provider on the $harness harness", ({ provider, harness }) => {
30
30
  const capabilities = capabilitiesOf(provider, harness);
31
31
 
32
- expect(["claude-code", "codex", "cursor", "opencode", "opencode-gemini", "acp", "pi"]).toContain(capabilities.runtime);
32
+ expect(["claude-code", "codex", "cursor", "opencode", "opencode-gemini", "acp", "devin", "pi"]).toContain(capabilities.runtime);
33
33
  expect(["modes", "plan"]).toContain(capabilities.permissions);
34
34
  expect(["full", "tools", "http", "none"]).toContain(capabilities.mcp);
35
35
  expect(capabilities.execution).toContain("shell");
@@ -163,11 +163,12 @@ test("every axis a record can lack has words for it", () => {
163
163
  rulebook: "none",
164
164
  secrets: "none",
165
165
  privacy: "none",
166
+ toolAllowlist: false,
166
167
  };
167
168
 
168
- // Thirteen disclosable axes, thirteen sentences; `fastMode` is disclosed via fastAllowed, and `warm` (keep-warm, off by
169
+ // Fourteen disclosable axes, fourteen sentences; `fastMode` is disclosed via fastAllowed, and `warm` (keep-warm, off by
169
170
  // default) is no limit on the turn itself.
170
- expect(limitationsOf(nothing)).toHaveLength(13);
171
+ expect(limitationsOf(nothing)).toHaveLength(14);
171
172
  expect(limitationsOf(nothing).join(" ")).not.toContain("fast");
172
173
  });
173
174
 
@@ -106,19 +106,21 @@ export const modesFor = (capabilities: AgentCapabilities): readonly PermissionMo
106
106
  export const clampMode = (mode: PermissionMode, capabilities: AgentCapabilities): PermissionMode =>
107
107
  modesFor(capabilities).includes(mode) ? mode : "bypassPermissions";
108
108
 
109
+ // What each reach of `mcp` leaves out, said once per answer.
110
+ const MCP_LIMITS = {
111
+ none: ["no MCP tools or plugins"],
112
+ http: ["MCP servers only, none of the daemon's own tools, no plugins"],
113
+ tools: ["no plugins"],
114
+ full: [],
115
+ } as const satisfies Record<AgentCapabilities["mcp"], readonly string[]>;
116
+
109
117
  // What this pair cannot do, phrased for the sender; empty means the full ceiling. `fastMode` is deliberately not
110
118
  // disclosed here, since it also depends on the route and model; fastAllowed answers that instead.
111
119
  export const limitationsOf = (capabilities: AgentCapabilities): string[] => [
112
120
  ...(capabilities.permissions === "plan" ? ["no per-tool approvals"] : []),
113
121
  ...(capabilities.questions ? [] : ["no clarifying questions"]),
114
122
  ...(capabilities.steering ? [] : ["no mid-turn steering"]),
115
- ...(capabilities.mcp === "none"
116
- ? ["no MCP tools or plugins"]
117
- : capabilities.mcp === "http"
118
- ? ["MCP servers only, none of the daemon's own tools, no plugins"]
119
- : capabilities.mcp === "tools"
120
- ? ["no plugins"]
121
- : []),
123
+ ...MCP_LIMITS[capabilities.mcp],
122
124
  ...(capabilities.execution.includes("js") ? [] : ["no code runs, shell only"]),
123
125
  ...(capabilities.effort ? [] : ["no effort control"]),
124
126
  ...(capabilities.commands ? [] : ["no slash commands"]),
@@ -131,6 +133,7 @@ export const limitationsOf = (capabilities: AgentCapabilities): string[] => [
131
133
  ...(capabilities.rulebook === "refuse-only" ? ["command rules can refuse but not hold"] : []),
132
134
  ...(capabilities.rulebook === "none" ? ["command rules not applied"] : []),
133
135
  ...(capabilities.secrets === "none" ? ["secrets reach the model unmasked"] : []),
136
+ ...(capabilities.toolAllowlist ? [] : ["no tool lists: an automation limited to some tools won't run here"]),
134
137
  ];
135
138
 
136
139
  // Claude's compile-time model floor, shared by daemon and web pre-load; versioned ids only, never a tier alias.
@@ -8,7 +8,7 @@ export type ExecutionBackend = "shell" | "js";
8
8
 
9
9
  export interface AgentCapabilities {
10
10
  // Which loop serves the turn; `opencode-gemini` stays separate since adapter health keys off this field.
11
- readonly runtime: "claude-code" | "codex" | "opencode" | "opencode-gemini" | "acp" | "pi" | "cursor";
11
+ readonly runtime: "claude-code" | "codex" | "opencode" | "opencode-gemini" | "acp" | "devin" | "pi" | "cursor";
12
12
  // Mid-turn injection (the SteeringQueue behind /agent/steer); needs the SDK's streaming-input mode.
13
13
  readonly steering: boolean;
14
14
  // How much of the permission-mode axis the runtime honours: every PermissionMode, or just propose-then-approve.
@@ -59,6 +59,10 @@ export interface AgentCapabilities {
59
59
  // configuration the daemon does not own and reads files it never sees. Only a `none` loop on an untrusted provider is
60
60
  // refused while the shield is on.
61
61
  readonly privacy: "gateway" | "hooks" | "none";
62
+ // Whether a turn's tool list (TurnPolicy.allowedTools, an automation's `allowedTools`) is a real boundary here:
63
+ // every tool call the loop makes passes a check the daemon answers, or the loop is built with only the listed tools.
64
+ // A runtime that runs some tool without asking anyone cannot keep it, so a turn carrying a list never starts on one.
65
+ readonly toolAllowlist: boolean;
62
66
  }
63
67
 
64
68
  // The Claude Code Agent SDK loop, the ceiling every other runtime is measured against: the only one that owns the whole
@@ -85,6 +89,9 @@ export const CLAUDE_CODE: AgentCapabilities = {
85
89
  secrets: "masked",
86
90
  // Every request goes to ANTHROPIC_BASE_URL, which the daemon sets per turn.
87
91
  privacy: "gateway",
92
+ // A PreToolUse hook refuses every call off the list, under bypassPermissions and in subagents too
93
+ // (agent/tools/tool-allowlist.ts).
94
+ toolAllowlist: true,
88
95
  };
89
96
 
90
97
  // Codex app-server: item-level events, the turn's remote MCP servers over http, and four seams (steer, a question
@@ -112,6 +119,9 @@ export const CODEX: AgentCapabilities = {
112
119
  secrets: "none",
113
120
  // Its model provider's base_url is the daemon's, written into the per-thread config.
114
121
  privacy: "gateway",
122
+ // Codex runs the commands it judges read-only without asking (its known-safe list), and every tool it has is the
123
+ // shell, so no answer the daemon gives can keep a call off a list.
124
+ toolAllowlist: false,
115
125
  };
116
126
 
117
127
  // OpenCode (the Grok runtime): its own agentic loop and tools, with the turn's remote MCP servers mounted on the shared
@@ -140,6 +150,10 @@ export const OPENCODE: AgentCapabilities = {
140
150
  secrets: "none",
141
151
  // The shared server's provider baseURLs are written by the daemon at spawn.
142
152
  privacy: "gateway",
153
+ // Its session rules could deny every action off the list, but they apply after the server's and the last match wins,
154
+ // so allowing a listed shell command there would override the owner's rulebook asking about it. Not kept until the
155
+ // permission judge (opencode-permissions.ts) checks the list on every call instead.
156
+ toolAllowlist: false,
143
157
  };
144
158
 
145
159
  // The same OpenCode loop, serving Gemini instead of xAI, identical abilities. The Claude Code loop announces itself in
@@ -173,6 +187,16 @@ export const ACP: AgentCapabilities = {
173
187
  secrets: "none",
174
188
  // The agent picks its own provider and endpoint from its own login and environment.
175
189
  privacy: "none",
190
+ // Which calls the agent asks permission for is its own choice, and most run reads without asking.
191
+ toolAllowlist: false,
192
+ };
193
+
194
+ // Devin's own CLI (`devin acp`), the ACP floor with one seam an installed agent lacks: the daemon picks the model, from
195
+ // the account's own list, through the session's model option. Its own runtime name, as OpenCode's Gemini twin has, since
196
+ // adapter health keys off this field and Devin's readiness is an account and an engine, not an installed card.
197
+ export const DEVIN: AgentCapabilities = {
198
+ ...ACP,
199
+ runtime: "devin",
176
200
  };
177
201
 
178
202
  // Pi driven over its RPC mode: above the ACP floor and below the Claude Code ceiling. Real mid-turn steering, an effort
@@ -199,6 +223,8 @@ export const PI: AgentCapabilities = {
199
223
  secrets: "none",
200
224
  // Pi calls its provider from its own login; the daemon names no endpoint.
201
225
  privacy: "none",
226
+ // No seam before a tool runs.
227
+ toolAllowlist: false,
202
228
  };
203
229
 
204
230
  // Cursor's own runtime, driven through `@cursor/sdk` from this daemon's process; an embedding surface, so most seams
@@ -242,4 +268,7 @@ export const CURSOR: AgentCapabilities = {
242
268
  // to mask the output, the tools that read past both (grep, ls, glob, semantic search, fetch, lints) are withheld,
243
269
  // and MCP goes through the masking proxy (runtimes/cursor/cursor-shield.ts).
244
270
  privacy: "hooks",
271
+ // Its hooks are installed only for a shielded turn, and a hook that cannot tell which turn is asking allows; the
272
+ // built-in tool set is withheld by name, not granted. None of that is a list nothing gets past.
273
+ toolAllowlist: false,
245
274
  };
@@ -37,6 +37,10 @@ const LEDGER: Record<keyof AgentCapabilities, Backing> = {
37
37
  // agent/run/decide/turn-decision.ts refuses a "none" runtime on an untrusted provider while the privacy shield is
38
38
  // on; "gateway" runtimes get the daemon's gateway as their base URL (privacy/gateway).
39
39
  privacy: "enforced",
40
+ // agent/run/decide/turn-decision.ts refuses a turn carrying a tool list on a runtime that cannot keep one, the
41
+ // automation ladder passes such rungs over, and agent/tools/tool-allowlist.ts refuses every off-list call on the
42
+ // Claude Code loop.
43
+ toolAllowlist: "enforced",
40
44
 
41
45
  // Descriptive: true of the runtime but nothing consults these; wiring one up moves it to enforced.
42
46
  questions: "descriptive",
@@ -147,3 +147,16 @@ export const compareUnrankedModelIds = (left: string, right: string): number =>
147
147
  // True only for an id that spells out a level above the quiet end, so an unannotated id is never accused of it.
148
148
  // Exported so a settings row can label a pinned thinking variant.
149
149
  export const namesThinking = (id: string): boolean => thinkingRankOf(familyOf(id)) > UNSTATED_THINKING;
150
+
151
+ // Which of three rungs an id stands on: 0 the frontier, 1 the everyday workhorse, 2 the cheap end. A tier word decides
152
+ // where there is one, a release-local ladder (sol, terra, luna) where there is not, and an id with neither is read as
153
+ // the frontier, as the catalog order already leads with it. What the preset setups are worked out from.
154
+ export const modelRungOf = (id: string): number => {
155
+ const family = familyOf(id);
156
+ const tier = tierRankOf(family);
157
+ if (tier !== UNRANKED) {
158
+ return tier;
159
+ }
160
+ const release = releaseTierRankOf(family);
161
+ return release === UNRANKED ? 0 : release;
162
+ };
@@ -1,8 +1,8 @@
1
1
  import type { AgentProvider, ModelPin } from "../schemas/agent.js";
2
2
 
3
- // The order to try models in for a role or job (settings.modelRoles), shared by daemon and browser so both agree what a
4
- // job will spend before it runs. An empty list resolves to nothing for every role: nothing is derived or auto-selected.
5
- // The caller decides what an empty answer means (a helper is off; a run falls back to the chat's own pick).
3
+ // The order to try models in for a job's setup (model-setups.ts), shared by daemon and browser so both agree what a job
4
+ // will spend before it runs. An empty list resolves to nothing: the caller decides what that means (a helper is off; a
5
+ // run falls back to the chat's own pick).
6
6
 
7
7
  // One provider's standing in the decision: can a turn go, and what its catalog holds. ACP agents have no rung here (an
8
8
  // empty model id), but endpoint/<id> providers must be included, matching the picker's own options.
@@ -11,7 +11,8 @@ export interface ModelSource {
11
11
  readonly provider: AgentProvider;
12
12
  // Same connection predicate every surface gates on; a nonempty catalog does not imply ready to send.
13
13
  readonly ready: boolean;
14
- // Nothing here reads this (a pin is verbatim); kept because it's what a source is, and callers still gather it.
14
+ // The models it can run a turn on, newest-first order not assumed. readyChain never reads it (a pin is verbatim);
15
+ // a preset setup is worked out from it (model-setups.ts `presetPins`), so a helper-only model is left out.
15
16
  readonly models: readonly string[];
16
17
  }
17
18
 
@@ -1,37 +1,15 @@
1
- import { MODEL_ROLE_BLOCKS, MODEL_ROLES, type ModelRoleSpec } from "./model-roles.js";
1
+ import { MODEL_ROLES, PRESET_SETUPS } from "./model-roles.js";
2
2
 
3
- // The catalog draws the settings page directly, so its properties (every role in one block) must hold of the table
4
- // itself, not be remembered by whoever adds a row.
3
+ // The catalog draws the settings page directly, so its properties must hold of the table itself, not be remembered by
4
+ // whoever adds a row.
5
5
 
6
- // Typed at its declared width, not the literal tuple: trigger is absent from a helper's type, under test here.
7
- const roles: readonly ModelRoleSpec[] = MODEL_ROLES;
6
+ test("the page reads one-shots first, then whole sessions, in the table's own order", () => {
7
+ const kinds = MODEL_ROLES.map((role) => role.kind);
8
8
 
9
- test("every whole session says what starts it, and it is the block it is drawn in", () => {
10
- const blockOf = new Map(MODEL_ROLE_BLOCKS.flatMap((block) => block.roles.map((role) => [role.id, block.id] as const)));
11
-
12
- for (const role of roles) {
13
- expect(role.kind === `run` ? role.trigger : role.kind, role.id).toBe(blockOf.get(role.id));
14
- }
15
- });
16
-
17
- test("a one-shot declares no trigger at all: nothing presses a commit subject into being", () => {
18
- for (const helper of roles.filter((role) => role.kind === `helper`)) {
19
- expect(Object.keys(helper), helper.id).not.toContain(`trigger`);
20
- }
21
- });
22
-
23
- test("the blocks hold every role once, in the table's own order", () => {
24
- const blocked = MODEL_ROLE_BLOCKS.flatMap((block) => block.roles.map((role) => role.id));
25
-
26
- expect(blocked.toSorted()).toEqual(MODEL_ROLES.map((role) => role.id).toSorted());
27
- // The block order mirrors reach ordering (unpicked jobs, then click-started sessions, then auto-started ones).
28
- expect(blocked).toEqual(MODEL_ROLES.map((role) => role.id));
9
+ expect(kinds.indexOf(`run`)).toBe(kinds.lastIndexOf(`helper`) + 1);
29
10
  });
30
11
 
31
- test("each block says what it is, so the page keeps no headings of its own", () => {
32
- for (const block of MODEL_ROLE_BLOCKS) {
33
- expect(block.label, block.id).toMatch(/\S/);
34
- // A block with nothing in it would draw a heading over an empty surface.
35
- expect(block.roles.length, block.id).toBeGreaterThan(1);
36
- }
12
+ test("every job is suggested a preset, and the cheap one is never suggested for a whole session", () => {
13
+ expect(MODEL_ROLES.every((role) => PRESET_SETUPS.includes(role.setup))).toBe(true);
14
+ expect(new Set<string>(MODEL_ROLES.filter((role) => role.kind === `run`).map((role) => role.setup)).has(`low`)).toBe(false);
37
15
  });
@@ -1,15 +1,17 @@
1
1
  import { z } from "zod";
2
2
 
3
- // Every job that picks a model, one row per job; the unit is the role, not a difficulty tier. Each list is an ordered
4
- // fallback ladder; empty means the job is off (helper) or falls back to the caller's own chat model (run). Adding a
5
- // role is one row here, settings, resolver and daemon all read this table.
3
+ // Every job that picks a model, one row per job; the unit is the role, not a difficulty tier. A job runs on the setup it
4
+ // was put on (model-setups.ts), an ordered fallback ladder it shares with every other job put there; a job on none, or
5
+ // on an empty one, is off (helper) or falls back to the caller's own chat model (run). Adding a role is one row here, settings, resolver
6
+ // and daemon all read this table.
6
7
 
7
8
  export const ModelRoleKindSchema = z.enum(["helper", "run"]);
8
9
  export type ModelRoleKind = z.infer<typeof ModelRoleKindSchema>;
9
10
 
10
- // Which block a run role sorts into on the settings page: pressed by the owner, or started unprompted; helpers declare
11
- // none.
12
- export type ModelRoleTrigger = "pressed" | "unprompted";
11
+ // The three setups every sandbox has, cheapest first: worked out from what is connected until the owner edits one
12
+ // (model-setups.ts `presetPins`). Ids are stored, so they are wire-stable.
13
+ export const PRESET_SETUPS = ["low", "medium", "high"] as const;
14
+ export type PresetSetup = (typeof PRESET_SETUPS)[number];
13
15
 
14
16
  // `id` is a bare string here; narrowed to the role union on `ModelRoleSpec` below, since that union derives from this
15
17
  // table via `satisfies`.
@@ -20,13 +22,14 @@ interface ModelRoleRow {
20
22
  // Must add information beyond the label, not restate it.
21
23
  readonly blurb: string;
22
24
  readonly kind: ModelRoleKind;
23
- /** Required when `kind` is "run"; unset for helpers. */
24
- readonly trigger?: ModelRoleTrigger;
25
25
  // Icon name from the shared icon set; kept here, not in a separate web-side map keyed by id.
26
26
  readonly icon: string;
27
+ // The preset suggested for this job, offered when it is placed: what the work needs, not what it costs today. Only
28
+ // a suggestion: a job runs on nothing until someone puts it on a setup.
29
+ readonly setup: PresetSetup;
27
30
  }
28
31
 
29
- // Ids are wire-stable (`AgentTurn.runRole`); order matches the settings page's block grouping below.
32
+ // Ids are wire-stable (`AgentTurn.runRole`); order is the settings page's: one-shot helpers first, then whole sessions.
30
33
  export const MODEL_ROLES = [
31
34
  {
32
35
  id: "commit-message",
@@ -34,6 +37,7 @@ export const MODEL_ROLES = [
34
37
  blurb: "The subject written when an agent's work lands, and the release note under it.",
35
38
  kind: "helper",
36
39
  icon: "file-edit",
40
+ setup: "low",
37
41
  },
38
42
  {
39
43
  id: "session-title",
@@ -41,6 +45,7 @@ export const MODEL_ROLES = [
41
45
  blurb: "The name a conversation wears on the board, written a second into its first turn.",
42
46
  kind: "helper",
43
47
  icon: "pencil",
48
+ setup: "low",
44
49
  },
45
50
  {
46
51
  // Prompt includes the command about to run, which may be attacker-controlled; a small model can be swayed.
@@ -49,6 +54,7 @@ export const MODEL_ROLES = [
49
54
  blurb: "Which model reads your safety policy before a flagged command runs.",
50
55
  kind: "helper",
51
56
  icon: "shield",
57
+ setup: "medium",
52
58
  },
53
59
  {
54
60
  id: "loop-verdict",
@@ -56,6 +62,16 @@ export const MODEL_ROLES = [
56
62
  blurb: "Whether a loop's iteration met the goal, or the loop goes round again.",
57
63
  kind: "helper",
58
64
  icon: "check-square",
65
+ setup: "medium",
66
+ },
67
+ {
68
+ // Reads a whole conversation (capped tool output) once, so a small model with a large window suits it best.
69
+ id: "handoff-summary",
70
+ label: "Hand-off summaries",
71
+ blurb: "The summary a fresh session opens with when you choose to summarise a long conversation that hit a usage limit, instead of re-reading it all.",
72
+ kind: "helper",
73
+ icon: "align-left",
74
+ setup: "low",
59
75
  },
60
76
  {
61
77
  // One reading answering both halves of "what does this chat open on": an offered `provider:model` line with an
@@ -67,71 +83,79 @@ export const MODEL_ROLES = [
67
83
  blurb: "Which model reads a new chat's first message and picks what it opens on: the model, effort and account, and the persona.",
68
84
  kind: "helper",
69
85
  icon: "sparkles",
86
+ setup: "low",
70
87
  },
71
88
  {
72
89
  id: "pipeline-fix",
73
90
  label: "Pipeline fixes",
74
91
  blurb: "The agent started by Fix on a failed pipeline.",
75
92
  kind: "run",
76
- trigger: "pressed",
77
93
  icon: "wave-pulse",
94
+ setup: "high",
78
95
  },
79
96
  {
80
97
  id: "deployment-fix",
81
98
  label: "Deployment fixes",
82
99
  blurb: "The agent started by Fix on a deployment that is down.",
83
100
  kind: "run",
84
- trigger: "pressed",
85
101
  icon: "server",
102
+ setup: "high",
86
103
  },
87
104
  {
88
105
  id: "maintenance-chore",
89
106
  label: "Maintenance chores",
90
107
  blurb: "A chore run started from the Maintenance board.",
91
108
  kind: "run",
92
- trigger: "pressed",
93
109
  icon: "wrench",
110
+ setup: "medium",
111
+ },
112
+ {
113
+ id: "refactor-run",
114
+ label: "Refactors",
115
+ blurb: "The agent started from a hotspot or key module on a repository's Health tab.",
116
+ kind: "run",
117
+ icon: "hammer",
118
+ setup: "high",
94
119
  },
95
120
  {
96
121
  id: "documentation-run",
97
122
  label: "Documentation runs",
98
123
  blurb: "A pass over a repo's own documentation.",
99
124
  kind: "run",
100
- trigger: "pressed",
101
125
  icon: "book",
126
+ setup: "medium",
102
127
  },
103
128
  {
104
129
  id: "acceptance-run",
105
130
  label: "Acceptance runs",
106
131
  blurb: "One session per story in an acceptance fan-out.",
107
132
  kind: "run",
108
- trigger: "pressed",
109
133
  icon: "list-check",
134
+ setup: "high",
110
135
  },
111
136
  {
112
- // Pressed trigger: the owner's approval click starts this turn; the queue between is just machinery.
113
137
  id: "approval-queue",
114
138
  label: "Approvals queue",
115
139
  blurb: "The turn that publishes or acts on what you approved.",
116
140
  kind: "run",
117
- trigger: "pressed",
118
141
  icon: "check-circle",
142
+ setup: "medium",
119
143
  },
120
144
  {
121
145
  id: "extension-review",
122
146
  label: "Extension update reviews",
123
147
  blurb: "The agent that reads an extension update before it is applied.",
124
148
  kind: "run",
125
- trigger: "unprompted",
126
149
  icon: "box",
150
+ setup: "medium",
127
151
  },
128
152
  {
129
153
  id: "loop-iteration",
130
154
  label: "Loop iterations",
131
155
  blurb: "Each round of a loop working towards its goal.",
132
156
  kind: "run",
133
- trigger: "unprompted",
134
157
  icon: "repeat",
158
+ setup: "high",
135
159
  },
136
160
  ] as const satisfies readonly ModelRoleRow[];
137
161
 
@@ -142,34 +166,3 @@ export const MODEL_ROLE_IDS = MODEL_ROLES.map((role) => role.id) as readonly Mod
142
166
 
143
167
  // Enum, not a string: an id outside this table names nothing, so it should fail loudly rather than be ignored.
144
168
  export const ModelRoleSchema = z.enum(MODEL_ROLE_IDS as [ModelRole, ...ModelRole[]]);
145
-
146
- // Groups MODEL_ROLES for the settings page by kind and trigger; each role belongs to exactly one block, in table order.
147
- export type ModelRoleBlockId = "helper" | "pressed" | "unprompted";
148
-
149
- export interface ModelRoleBlock {
150
- readonly id: ModelRoleBlockId;
151
- /** Heading shown on the settings page. */
152
- readonly label: string;
153
- /** Its roles, in MODEL_ROLES order. */
154
- readonly roles: readonly ModelRoleSpec[];
155
- }
156
-
157
- const rolesWhere = (match: (role: ModelRoleSpec) => boolean): readonly ModelRoleSpec[] => MODEL_ROLES.filter((role) => match(role));
158
-
159
- export const MODEL_ROLE_BLOCKS: readonly ModelRoleBlock[] = [
160
- {
161
- id: "helper",
162
- label: "Automatic helpers",
163
- roles: rolesWhere((role) => role.kind === "helper"),
164
- },
165
- {
166
- id: "pressed",
167
- label: "Runs you start",
168
- roles: rolesWhere((role) => role.kind === "run" && role.trigger === "pressed"),
169
- },
170
- {
171
- id: "unprompted",
172
- label: "Runs that start themselves",
173
- roles: rolesWhere((role) => role.kind === "run" && role.trigger === "unprompted"),
174
- },
175
- ];