agent-dealer 0.2.0 → 1.0.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 (276) hide show
  1. package/bundle/server/dist/adapters/agent-deck-bind.js +443 -0
  2. package/bundle/server/dist/adapters/agent-deck-bind.test.js +454 -0
  3. package/bundle/server/dist/adapters/agent-deck.js +38 -50
  4. package/bundle/server/dist/adapters/agent-deck.test.js +63 -0
  5. package/bundle/server/dist/adapters/agent-health.js +230 -33
  6. package/bundle/server/dist/adapters/agent-health.test.js +237 -0
  7. package/bundle/server/dist/adapters/authority-lifecycle.js +289 -0
  8. package/bundle/server/dist/adapters/codex-scoped-config.js +103 -0
  9. package/bundle/server/dist/adapters/execution-authority.js +103 -0
  10. package/bundle/server/dist/adapters/execution-authority.test.js +166 -0
  11. package/bundle/server/dist/adapters/external.js +0 -1
  12. package/bundle/server/dist/adapters/git-worktree.js +514 -0
  13. package/bundle/server/dist/adapters/git-worktree.test.js +502 -0
  14. package/bundle/server/dist/adapters/github.js +170 -0
  15. package/bundle/server/dist/adapters/github.test.js +205 -0
  16. package/bundle/server/dist/adapters/linear-inbox.js +199 -30
  17. package/bundle/server/dist/adapters/linear-inbox.test.js +35 -0
  18. package/bundle/server/dist/adapters/linear-sync.js +3 -101
  19. package/bundle/server/dist/adapters/managed-repo.js +168 -0
  20. package/bundle/server/dist/adapters/managed-repo.test.js +63 -0
  21. package/bundle/server/dist/adapters/outbound-delivery.js +83 -0
  22. package/bundle/server/dist/adapters/outbound-delivery.test.js +53 -0
  23. package/bundle/server/dist/adapters/reflect-authority.js +43 -0
  24. package/bundle/server/dist/cli-env.js +26 -0
  25. package/bundle/server/dist/cli-env.test.js +14 -1
  26. package/bundle/server/dist/coordinator/abort.integration.test.js +74 -0
  27. package/bundle/server/dist/coordinator/admission.js +330 -0
  28. package/bundle/server/dist/coordinator/admission.test.js +338 -0
  29. package/bundle/server/dist/coordinator/args.js +128 -0
  30. package/bundle/server/dist/coordinator/args.test.js +132 -0
  31. package/bundle/server/dist/coordinator/authority-recovery.integration.test.js +661 -0
  32. package/bundle/server/dist/coordinator/auto-merge.integration.test.js +363 -0
  33. package/bundle/server/dist/coordinator/auto-merge.js +286 -0
  34. package/bundle/server/dist/coordinator/auto-merge.timeout.test.js +14 -0
  35. package/bundle/server/dist/coordinator/branch-progress.js +81 -0
  36. package/bundle/server/dist/coordinator/clock-jump.js +98 -0
  37. package/bundle/server/dist/coordinator/commands.js +1088 -0
  38. package/bundle/server/dist/coordinator/commands.test.js +554 -0
  39. package/bundle/server/dist/coordinator/deck-outage-config.js +32 -0
  40. package/bundle/server/dist/coordinator/deck-outage.integration.test.js +200 -0
  41. package/bundle/server/dist/coordinator/dependencies.js +242 -0
  42. package/bundle/server/dist/coordinator/dependency-readiness.integration.test.js +535 -0
  43. package/bundle/server/dist/coordinator/developer-effect.js +959 -0
  44. package/bundle/server/dist/coordinator/developer-effect.test.js +1143 -0
  45. package/bundle/server/dist/coordinator/dispatcher.js +58 -0
  46. package/bundle/server/dist/coordinator/dispatcher.test.js +81 -0
  47. package/bundle/server/dist/coordinator/effect-registry.js +17 -0
  48. package/bundle/server/dist/coordinator/execution-env.integration.test.js +122 -0
  49. package/bundle/server/dist/coordinator/failure-reason.js +273 -0
  50. package/bundle/server/dist/coordinator/failure-reason.test.js +234 -0
  51. package/bundle/server/dist/coordinator/guidance.js +33 -0
  52. package/bundle/server/dist/coordinator/guidance.test.js +110 -0
  53. package/bundle/server/dist/coordinator/human-resolution.js +88 -0
  54. package/bundle/server/dist/coordinator/human-resolution.test.js +72 -0
  55. package/bundle/server/dist/coordinator/intent-forecast.js +13 -0
  56. package/bundle/server/dist/coordinator/intent-forecast.test.js +34 -0
  57. package/bundle/server/dist/coordinator/latest-failure.js +100 -0
  58. package/bundle/server/dist/coordinator/latest-failure.test.js +125 -0
  59. package/bundle/server/dist/coordinator/metrics.js +35 -0
  60. package/bundle/server/dist/coordinator/metrics.test.js +52 -0
  61. package/bundle/server/dist/coordinator/permissions.js +127 -0
  62. package/bundle/server/dist/coordinator/permissions.test.js +184 -0
  63. package/bundle/server/dist/coordinator/presumed-dead-budget.integration.test.js +146 -0
  64. package/bundle/server/dist/coordinator/process-liveness.js +191 -0
  65. package/bundle/server/dist/coordinator/profile-snapshot.js +20 -0
  66. package/bundle/server/dist/coordinator/profile-snapshot.test.js +118 -0
  67. package/bundle/server/dist/coordinator/projection.js +147 -0
  68. package/bundle/server/dist/coordinator/projection.test.js +121 -0
  69. package/bundle/server/dist/coordinator/prompts.js +164 -0
  70. package/bundle/server/dist/coordinator/prompts.test.js +177 -0
  71. package/bundle/server/dist/coordinator/queue-by-default.integration.test.js +271 -0
  72. package/bundle/server/dist/coordinator/reclaim-republish.integration.test.js +372 -0
  73. package/bundle/server/dist/coordinator/recovery.js +466 -0
  74. package/bundle/server/dist/coordinator/recovery.test.js +164 -0
  75. package/bundle/server/dist/coordinator/reflect-trigger.js +218 -0
  76. package/bundle/server/dist/coordinator/reflect-trigger.test.js +324 -0
  77. package/bundle/server/dist/coordinator/repair-cycle.integration.test.js +234 -0
  78. package/bundle/server/dist/coordinator/restart-recovery.integration.test.js +363 -0
  79. package/bundle/server/dist/coordinator/reviewer-effect.js +507 -0
  80. package/bundle/server/dist/coordinator/reviewer-effect.test.js +612 -0
  81. package/bundle/server/dist/coordinator/reviewer-result.js +38 -0
  82. package/bundle/server/dist/coordinator/reviewer-result.test.js +45 -0
  83. package/bundle/server/dist/coordinator/routing.js +160 -0
  84. package/bundle/server/dist/coordinator/routing.test.js +336 -0
  85. package/bundle/server/dist/coordinator/session-lifecycle.integration.test.js +127 -0
  86. package/bundle/server/dist/coordinator/session-lifecycle.js +280 -0
  87. package/bundle/server/dist/coordinator/session-lifecycle.test.js +121 -0
  88. package/bundle/server/dist/coordinator/session-progress.js +351 -0
  89. package/bundle/server/dist/coordinator/session-progress.test.js +190 -0
  90. package/bundle/server/dist/coordinator/session-timeouts.js +33 -0
  91. package/bundle/server/dist/coordinator/sleep-recovery.integration.test.js +233 -0
  92. package/bundle/server/dist/coordinator/spawn.js +49 -0
  93. package/bundle/server/dist/coordinator/sync-issue-base-branch.js +18 -0
  94. package/bundle/server/dist/coordinator/usage-cap-config.js +10 -0
  95. package/bundle/server/dist/coordinator/usage-cap-defer.js +189 -0
  96. package/bundle/server/dist/coordinator/usage-cap.integration.test.js +193 -0
  97. package/bundle/server/dist/coordinator/usage.js +40 -0
  98. package/bundle/server/dist/coordinator/usage.test.js +69 -0
  99. package/bundle/server/dist/coordinator/verification-receipt.js +333 -0
  100. package/bundle/server/dist/coordinator/verification-receipt.test.js +382 -0
  101. package/bundle/server/dist/coordinator/worker-loop.js +363 -0
  102. package/bundle/server/dist/coordinator/worker-loop.test.js +327 -0
  103. package/bundle/server/dist/coordinator/workflow-instances.test.js +45 -0
  104. package/bundle/server/dist/coordinator/worktree-owner-liveness.js +82 -0
  105. package/bundle/server/dist/coordinator/worktree-owner-liveness.test.js +199 -0
  106. package/bundle/server/dist/db/artifacts-issue-columns.test.js +18 -0
  107. package/bundle/server/dist/db/authority-attempts-stale-at-migration.test.js +65 -0
  108. package/bundle/server/dist/db/idempotency-index-migration.test.js +57 -0
  109. package/bundle/server/dist/db/index.js +359 -7
  110. package/bundle/server/dist/db/linear-inbox-unlock.test.js +67 -0
  111. package/bundle/server/dist/db/migrate-to-issues.js +824 -0
  112. package/bundle/server/dist/db/migrate-to-issues.test.js +842 -0
  113. package/bundle/server/dist/db/schema.sql +311 -1
  114. package/bundle/server/dist/db/schema.test.js +66 -0
  115. package/bundle/server/dist/db/worker-session-pid-migration.test.js +112 -0
  116. package/bundle/server/dist/dev-review-cli-happy-path.integration.test.js +338 -0
  117. package/bundle/server/dist/direct-start-liveness.integration.test.js +350 -0
  118. package/bundle/server/dist/index.js +58 -5
  119. package/bundle/server/dist/paths.js +40 -4
  120. package/bundle/server/dist/paths.test.js +42 -0
  121. package/bundle/server/dist/pid-marker-claim-child.js +18 -0
  122. package/bundle/server/dist/pid-marker-hold-arbiter-child.js +24 -0
  123. package/bundle/server/dist/pid-marker.js +141 -0
  124. package/bundle/server/dist/pid-marker.test.js +208 -0
  125. package/bundle/server/dist/queue/approve-deliver.js +128 -28
  126. package/bundle/server/dist/queue/reflect-schedule.js +25 -0
  127. package/bundle/server/dist/queue/result-qa.js +1 -1
  128. package/bundle/server/dist/queue/send-gate.test.js +172 -36
  129. package/bundle/server/dist/repository/agents.js +55 -18
  130. package/bundle/server/dist/repository/artifacts-for-issue.js +42 -0
  131. package/bundle/server/dist/repository/artifacts-for-issue.test.js +48 -0
  132. package/bundle/server/dist/repository/artifacts.js +47 -0
  133. package/bundle/server/dist/repository/artifacts.test.js +48 -0
  134. package/bundle/server/dist/repository/authority-attempts.js +189 -0
  135. package/bundle/server/dist/repository/findings.js +70 -0
  136. package/bundle/server/dist/repository/findings.test.js +68 -0
  137. package/bundle/server/dist/repository/human-actions.js +142 -0
  138. package/bundle/server/dist/repository/human-actions.test.js +123 -0
  139. package/bundle/server/dist/repository/intake-settings.js +5 -59
  140. package/bundle/server/dist/repository/issues.js +305 -0
  141. package/bundle/server/dist/repository/issues.test.js +69 -0
  142. package/bundle/server/dist/repository/outbound-drafts.js +28 -0
  143. package/bundle/server/dist/repository/queue-entries.js +162 -0
  144. package/bundle/server/dist/repository/review-publications.js +153 -0
  145. package/bundle/server/dist/repository/review-publications.test.js +78 -0
  146. package/bundle/server/dist/repository/runs-external-id.test.js +5 -3
  147. package/bundle/server/dist/repository/runs.js +4 -211
  148. package/bundle/server/dist/repository/runtime-availability.js +54 -0
  149. package/bundle/server/dist/repository/usage-events.js +60 -0
  150. package/bundle/server/dist/repository/usage-events.test.js +56 -0
  151. package/bundle/server/dist/repository/work-items.js +305 -0
  152. package/bundle/server/dist/repository/work-items.test.js +142 -0
  153. package/bundle/server/dist/repository/worker-sessions.js +219 -0
  154. package/bundle/server/dist/repository/worker-sessions.test.js +60 -0
  155. package/bundle/server/dist/repository/workflow-events.js +193 -0
  156. package/bundle/server/dist/repository/workflow-events.test.js +89 -0
  157. package/bundle/server/dist/resolve-tsx-bin.js +19 -0
  158. package/bundle/server/dist/routes/human-actions.js +68 -0
  159. package/bundle/server/dist/routes/human-actions.test.js +284 -0
  160. package/bundle/server/dist/routes/index.js +29 -496
  161. package/bundle/server/dist/routes/issues.js +240 -0
  162. package/bundle/server/dist/routes/issues.test.js +451 -0
  163. package/bundle/server/dist/routes/queue.js +41 -0
  164. package/bundle/server/dist/routes/queue.test.js +78 -0
  165. package/bundle/server/dist/runners/claude-args.js +18 -30
  166. package/bundle/server/dist/runners/claude.js +19 -163
  167. package/bundle/server/dist/runners/claude.test.js +15 -70
  168. package/bundle/server/dist/runners/codex-args.js +59 -0
  169. package/bundle/server/dist/runners/codex-args.test.js +72 -0
  170. package/bundle/server/dist/runners/codex-jsonl.js +150 -0
  171. package/bundle/server/dist/runners/codex-jsonl.test.js +36 -0
  172. package/bundle/server/dist/runners/codex-resume.test.js +19 -0
  173. package/bundle/server/dist/runners/codex.js +46 -0
  174. package/bundle/server/dist/runners/models-codex.test.js +14 -0
  175. package/bundle/server/dist/runners/models.js +53 -1
  176. package/bundle/server/dist/runners/persist.js +4 -1
  177. package/bundle/server/dist/runners/process-registry.js +11 -0
  178. package/bundle/server/dist/runners/prompts.js +13 -280
  179. package/bundle/server/dist/runners/prompts.test.js +22 -153
  180. package/bundle/server/dist/runners/qa.js +17 -1
  181. package/bundle/server/dist/runners/reflect.js +4 -16
  182. package/bundle/server/dist/runners/spawn-cli.js +197 -0
  183. package/bundle/server/dist/runners/spawn-cli.test.js +130 -0
  184. package/bundle/server/dist/runners/stream-json.js +0 -141
  185. package/bundle/server/dist/runners/usage-cap.js +242 -0
  186. package/bundle/server/dist/runners/usage-cap.test.js +97 -0
  187. package/bundle/server/dist/server-liveness.js +37 -0
  188. package/bundle/server/dist/server-liveness.test.js +82 -0
  189. package/bundle/server/dist/static-ui.test.js +44 -0
  190. package/bundle/server/package.json +4 -2
  191. package/bundle/server/static-ui/assets/index-BTtPGYpY.js +60 -0
  192. package/bundle/server/static-ui/assets/index-BxTx4b1d.css +1 -0
  193. package/bundle/server/static-ui/index.html +2 -2
  194. package/bundle/shared/dist/agents.d.ts +262 -133
  195. package/bundle/shared/dist/agents.js +85 -19
  196. package/bundle/shared/dist/cursor-auth-health.d.ts +12 -0
  197. package/bundle/shared/dist/cursor-auth-health.js +36 -0
  198. package/bundle/shared/dist/cursor-auth-health.test.d.ts +1 -0
  199. package/bundle/shared/dist/cursor-auth-health.test.js +40 -0
  200. package/bundle/shared/dist/findings.d.ts +46 -0
  201. package/bundle/shared/dist/findings.js +17 -0
  202. package/bundle/shared/dist/findings.test.d.ts +1 -0
  203. package/bundle/shared/dist/findings.test.js +20 -0
  204. package/bundle/shared/dist/github-repo.d.ts +28 -0
  205. package/bundle/shared/dist/github-repo.js +98 -0
  206. package/bundle/shared/dist/github-repo.test.d.ts +1 -0
  207. package/bundle/shared/dist/github-repo.test.js +32 -0
  208. package/bundle/shared/dist/human-actions.d.ts +66 -0
  209. package/bundle/shared/dist/human-actions.js +51 -0
  210. package/bundle/shared/dist/human-actions.test.d.ts +1 -0
  211. package/bundle/shared/dist/human-actions.test.js +57 -0
  212. package/bundle/shared/dist/index.d.ts +567 -757
  213. package/bundle/shared/dist/index.js +22 -36
  214. package/bundle/shared/dist/issues.d.ts +385 -0
  215. package/bundle/shared/dist/issues.js +169 -0
  216. package/bundle/shared/dist/issues.test.d.ts +1 -0
  217. package/bundle/shared/dist/issues.test.js +72 -0
  218. package/bundle/shared/dist/outbound-draft.d.ts +6 -0
  219. package/bundle/shared/dist/outbound-draft.js +4 -0
  220. package/bundle/shared/dist/plan-triage.d.ts +6 -6
  221. package/bundle/shared/dist/profile-snapshot.d.ts +154 -0
  222. package/bundle/shared/dist/profile-snapshot.js +145 -0
  223. package/bundle/shared/dist/profile-snapshot.test.d.ts +1 -0
  224. package/bundle/shared/dist/profile-snapshot.test.js +67 -0
  225. package/bundle/shared/dist/queue-entries.d.ts +89 -0
  226. package/bundle/shared/dist/queue-entries.js +19 -0
  227. package/bundle/shared/dist/result-qa.d.ts +2 -2
  228. package/bundle/shared/dist/runtime-auth-health.d.ts +66 -0
  229. package/bundle/shared/dist/runtime-auth-health.js +186 -0
  230. package/bundle/shared/dist/runtime-auth-health.test.d.ts +1 -0
  231. package/bundle/shared/dist/runtime-auth-health.test.js +200 -0
  232. package/bundle/shared/dist/runtime-availability.d.ts +51 -0
  233. package/bundle/shared/dist/runtime-availability.js +13 -0
  234. package/bundle/shared/dist/runtime.d.ts +1 -1
  235. package/bundle/shared/dist/runtime.js +1 -1
  236. package/bundle/shared/dist/usage-events.d.ts +36 -0
  237. package/bundle/shared/dist/usage-events.js +13 -0
  238. package/bundle/shared/dist/worker-sessions.d.ts +140 -0
  239. package/bundle/shared/dist/worker-sessions.js +70 -0
  240. package/bundle/shared/dist/worker-sessions.test.d.ts +1 -0
  241. package/bundle/shared/dist/worker-sessions.test.js +39 -0
  242. package/bundle/shared/dist/workflow.d.ts +78 -0
  243. package/bundle/shared/dist/workflow.js +59 -0
  244. package/bundle/shared/dist/workflow.test.d.ts +1 -0
  245. package/bundle/shared/dist/workflow.test.js +61 -0
  246. package/bundle/shared/package.json +1 -1
  247. package/dist/action.d.ts +1 -0
  248. package/dist/action.js +50 -0
  249. package/dist/action.test.d.ts +1 -0
  250. package/dist/action.test.js +70 -0
  251. package/dist/agent.d.ts +1 -0
  252. package/dist/agent.js +17 -0
  253. package/dist/agent.test.d.ts +1 -0
  254. package/dist/agent.test.js +19 -0
  255. package/dist/cli-check.d.ts +7 -0
  256. package/dist/cli-check.js +40 -0
  257. package/dist/doctor.js +59 -1
  258. package/dist/http.d.ts +5 -0
  259. package/dist/http.js +19 -0
  260. package/dist/index.js +28 -0
  261. package/dist/issue.d.ts +35 -0
  262. package/dist/issue.js +143 -0
  263. package/dist/issue.test.d.ts +1 -0
  264. package/dist/issue.test.js +240 -0
  265. package/dist/lifecycle.contract.test.d.ts +1 -0
  266. package/dist/lifecycle.contract.test.js +135 -0
  267. package/dist/queue.d.ts +11 -0
  268. package/dist/queue.js +60 -0
  269. package/dist/queue.test.d.ts +1 -0
  270. package/dist/queue.test.js +46 -0
  271. package/dist/test-fetch-stub.d.ts +6 -0
  272. package/dist/test-fetch-stub.js +31 -0
  273. package/package.json +2 -1
  274. package/templates/prod.env.example +1 -1
  275. package/bundle/server/static-ui/assets/index-B_7S7xJb.js +0 -79
  276. package/bundle/server/static-ui/assets/index-QYv3zmE6.css +0 -1
@@ -2,154 +2,230 @@ import { z } from "zod";
2
2
  /** Built-in agent IDs — stable across installs. */
3
3
  export declare const BUILTIN_AGENT_CLAUDE_ID = "00000000-0000-4000-a000-000000000001";
4
4
  export declare const BUILTIN_AGENT_CURSOR_ID = "00000000-0000-4000-a000-000000000002";
5
+ export declare const BUILTIN_AGENT_CODEX_ID = "00000000-0000-4000-a000-000000000003";
5
6
  /** Cursor CLI model id for Auto + Composer subscription pool (not IDE default). */
6
7
  export declare const CURSOR_DEFAULT_MODEL = "auto";
7
8
  /** Cursor models that draw from the Auto + Composer pool on individual Pro plans. */
8
9
  export declare const CURSOR_SUBSCRIPTION_MODEL_IDS: readonly ["auto", "composer-2.5", "composer-2.5-fast"];
9
10
  export declare const AgentHealthIssue: z.ZodObject<{
10
- code: z.ZodEnum<["cli_missing", "runtime_auth", "deck_offline", "workspace_missing", "mcp_not_registered"]>;
11
+ code: z.ZodEnum<["cli_missing", "runtime_auth", "cursor_keychain", "usage_capped", "deck_offline", "deck_unauthorized", "workspace_missing", "deck_missing", "mcp_not_registered", "github_cli_missing", "github_auth"]>;
11
12
  message: z.ZodString;
12
13
  }, "strip", z.ZodTypeAny, {
13
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
14
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
14
15
  message: string;
15
16
  }, {
16
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
17
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
17
18
  message: string;
18
19
  }>;
19
20
  export type AgentHealthIssue = z.infer<typeof AgentHealthIssue>;
20
21
  export declare const AgentProfile: z.ZodObject<{
21
22
  id: z.ZodString;
22
23
  name: z.ZodString;
23
- runtime: z.ZodEnum<["claude_code", "cursor_local"]>;
24
+ runtime: z.ZodEnum<["claude_code", "cursor_local", "codex_local"]>;
25
+ /**
26
+ * Dead legacy storage (NOT-149). Retained so existing rows migrate safely; never shown
27
+ * in UI, never required by health/admission, and never copied into new profile snapshots.
28
+ */
24
29
  workspaceRoot: z.ZodNullable<z.ZodString>;
30
+ /** Required for any Agent used for execution — Dealer never starts without a Deck. */
25
31
  deckId: z.ZodNullable<z.ZodString>;
26
32
  deckName: z.ZodNullable<z.ZodString>;
33
+ /** Dead legacy storage (NOT-149) — playbooks are chosen dynamically inside the Deck. */
27
34
  playbookId: z.ZodNullable<z.ZodString>;
28
- /** CLI model id for planning; null = runtime default */
35
+ /**
36
+ * Legacy phase defaults, read-only since NOT-71: nothing writes these any more, but
37
+ * profile-snapshot.ts still falls back to them so profiles saved before `defaultModel` /
38
+ * `defaultBudgetJson` existed keep their configured model and caps.
39
+ */
29
40
  defaultPlanModel: z.ZodNullable<z.ZodString>;
30
- /** CLI model id for execution; null = runtime default */
31
41
  defaultExecuteModel: z.ZodNullable<z.ZodString>;
32
- /** Serialized PhaseBudget; null = runtime default (no CLI caps) */
33
42
  defaultPlanBudgetJson: z.ZodNullable<z.ZodString>;
34
- /** Serialized PhaseBudget; null = runtime default (no CLI caps) */
35
43
  defaultExecuteBudgetJson: z.ZodNullable<z.ZodString>;
44
+ /** Role-neutral CLI model id for issue-centric developer/reviewer sessions; null = runtime default. */
45
+ defaultModel: z.ZodNullable<z.ZodString>;
46
+ /**
47
+ * Default reasoning effort (NOT-81). Null = runtime default. Applied only for runtimes
48
+ * that expose a CLI-level effort control (Codex / Claude Code); Cursor ignores it.
49
+ */
50
+ defaultEffort: z.ZodNullable<z.ZodEnum<["low", "medium", "high"]>>;
51
+ /** Serialized PhaseBudget for issue-centric sessions; null = runtime default. */
52
+ defaultBudgetJson: z.ZodNullable<z.ZodString>;
53
+ /** Free-text description of what this profile is for (shown in the picker, snapshotted). */
54
+ purpose: z.ZodNullable<z.ZodString>;
55
+ /** Dead legacy storage (NOT-149). */
56
+ playbookIdsJson: z.ZodNullable<z.ZodString>;
57
+ /** Dead legacy storage (NOT-149). */
58
+ externalMemoryRefsJson: z.ZodNullable<z.ZodString>;
59
+ /** Serialized PermissionPolicyOverride — may only tighten the role's capabilities. */
60
+ permissionPolicyJson: z.ZodNullable<z.ZodString>;
36
61
  isBuiltin: z.ZodBoolean;
37
62
  createdAt: z.ZodString;
38
63
  updatedAt: z.ZodString;
39
64
  }, "strip", z.ZodTypeAny, {
40
65
  id: string;
66
+ runtime: "claude_code" | "cursor_local" | "codex_local";
67
+ createdAt: string;
68
+ updatedAt: string;
69
+ deckId: string | null;
70
+ purpose: string | null;
41
71
  name: string;
42
- runtime: "claude_code" | "cursor_local";
43
72
  workspaceRoot: string | null;
44
- deckId: string | null;
45
73
  deckName: string | null;
46
74
  playbookId: string | null;
47
75
  defaultPlanModel: string | null;
48
76
  defaultExecuteModel: string | null;
49
77
  defaultPlanBudgetJson: string | null;
50
78
  defaultExecuteBudgetJson: string | null;
79
+ defaultModel: string | null;
80
+ defaultEffort: "low" | "medium" | "high" | null;
81
+ defaultBudgetJson: string | null;
82
+ playbookIdsJson: string | null;
83
+ externalMemoryRefsJson: string | null;
84
+ permissionPolicyJson: string | null;
51
85
  isBuiltin: boolean;
52
- createdAt: string;
53
- updatedAt: string;
54
86
  }, {
55
87
  id: string;
88
+ runtime: "claude_code" | "cursor_local" | "codex_local";
89
+ createdAt: string;
90
+ updatedAt: string;
91
+ deckId: string | null;
92
+ purpose: string | null;
56
93
  name: string;
57
- runtime: "claude_code" | "cursor_local";
58
94
  workspaceRoot: string | null;
59
- deckId: string | null;
60
95
  deckName: string | null;
61
96
  playbookId: string | null;
62
97
  defaultPlanModel: string | null;
63
98
  defaultExecuteModel: string | null;
64
99
  defaultPlanBudgetJson: string | null;
65
100
  defaultExecuteBudgetJson: string | null;
101
+ defaultModel: string | null;
102
+ defaultEffort: "low" | "medium" | "high" | null;
103
+ defaultBudgetJson: string | null;
104
+ playbookIdsJson: string | null;
105
+ externalMemoryRefsJson: string | null;
106
+ permissionPolicyJson: string | null;
66
107
  isBuiltin: boolean;
67
- createdAt: string;
68
- updatedAt: string;
69
108
  }>;
70
109
  export type AgentProfile = z.infer<typeof AgentProfile>;
71
110
  export declare const AgentWithHealth: z.ZodObject<{
72
111
  id: z.ZodString;
73
112
  name: z.ZodString;
74
- runtime: z.ZodEnum<["claude_code", "cursor_local"]>;
113
+ runtime: z.ZodEnum<["claude_code", "cursor_local", "codex_local"]>;
114
+ /**
115
+ * Dead legacy storage (NOT-149). Retained so existing rows migrate safely; never shown
116
+ * in UI, never required by health/admission, and never copied into new profile snapshots.
117
+ */
75
118
  workspaceRoot: z.ZodNullable<z.ZodString>;
119
+ /** Required for any Agent used for execution — Dealer never starts without a Deck. */
76
120
  deckId: z.ZodNullable<z.ZodString>;
77
121
  deckName: z.ZodNullable<z.ZodString>;
122
+ /** Dead legacy storage (NOT-149) — playbooks are chosen dynamically inside the Deck. */
78
123
  playbookId: z.ZodNullable<z.ZodString>;
79
- /** CLI model id for planning; null = runtime default */
124
+ /**
125
+ * Legacy phase defaults, read-only since NOT-71: nothing writes these any more, but
126
+ * profile-snapshot.ts still falls back to them so profiles saved before `defaultModel` /
127
+ * `defaultBudgetJson` existed keep their configured model and caps.
128
+ */
80
129
  defaultPlanModel: z.ZodNullable<z.ZodString>;
81
- /** CLI model id for execution; null = runtime default */
82
130
  defaultExecuteModel: z.ZodNullable<z.ZodString>;
83
- /** Serialized PhaseBudget; null = runtime default (no CLI caps) */
84
131
  defaultPlanBudgetJson: z.ZodNullable<z.ZodString>;
85
- /** Serialized PhaseBudget; null = runtime default (no CLI caps) */
86
132
  defaultExecuteBudgetJson: z.ZodNullable<z.ZodString>;
133
+ /** Role-neutral CLI model id for issue-centric developer/reviewer sessions; null = runtime default. */
134
+ defaultModel: z.ZodNullable<z.ZodString>;
135
+ /**
136
+ * Default reasoning effort (NOT-81). Null = runtime default. Applied only for runtimes
137
+ * that expose a CLI-level effort control (Codex / Claude Code); Cursor ignores it.
138
+ */
139
+ defaultEffort: z.ZodNullable<z.ZodEnum<["low", "medium", "high"]>>;
140
+ /** Serialized PhaseBudget for issue-centric sessions; null = runtime default. */
141
+ defaultBudgetJson: z.ZodNullable<z.ZodString>;
142
+ /** Free-text description of what this profile is for (shown in the picker, snapshotted). */
143
+ purpose: z.ZodNullable<z.ZodString>;
144
+ /** Dead legacy storage (NOT-149). */
145
+ playbookIdsJson: z.ZodNullable<z.ZodString>;
146
+ /** Dead legacy storage (NOT-149). */
147
+ externalMemoryRefsJson: z.ZodNullable<z.ZodString>;
148
+ /** Serialized PermissionPolicyOverride — may only tighten the role's capabilities. */
149
+ permissionPolicyJson: z.ZodNullable<z.ZodString>;
87
150
  isBuiltin: z.ZodBoolean;
88
151
  createdAt: z.ZodString;
89
152
  updatedAt: z.ZodString;
90
153
  } & {
91
154
  healthy: z.ZodBoolean;
92
155
  issues: z.ZodArray<z.ZodObject<{
93
- code: z.ZodEnum<["cli_missing", "runtime_auth", "deck_offline", "workspace_missing", "mcp_not_registered"]>;
156
+ code: z.ZodEnum<["cli_missing", "runtime_auth", "cursor_keychain", "usage_capped", "deck_offline", "deck_unauthorized", "workspace_missing", "deck_missing", "mcp_not_registered", "github_cli_missing", "github_auth"]>;
94
157
  message: z.ZodString;
95
158
  }, "strip", z.ZodTypeAny, {
96
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
159
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
97
160
  message: string;
98
161
  }, {
99
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
162
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
100
163
  message: string;
101
164
  }>, "many">;
102
165
  }, "strip", z.ZodTypeAny, {
103
166
  issues: {
104
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
167
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
105
168
  message: string;
106
169
  }[];
107
170
  id: string;
171
+ runtime: "claude_code" | "cursor_local" | "codex_local";
172
+ createdAt: string;
173
+ updatedAt: string;
174
+ deckId: string | null;
175
+ purpose: string | null;
108
176
  name: string;
109
- runtime: "claude_code" | "cursor_local";
110
177
  workspaceRoot: string | null;
111
- deckId: string | null;
112
178
  deckName: string | null;
113
179
  playbookId: string | null;
114
180
  defaultPlanModel: string | null;
115
181
  defaultExecuteModel: string | null;
116
182
  defaultPlanBudgetJson: string | null;
117
183
  defaultExecuteBudgetJson: string | null;
184
+ defaultModel: string | null;
185
+ defaultEffort: "low" | "medium" | "high" | null;
186
+ defaultBudgetJson: string | null;
187
+ playbookIdsJson: string | null;
188
+ externalMemoryRefsJson: string | null;
189
+ permissionPolicyJson: string | null;
118
190
  isBuiltin: boolean;
119
- createdAt: string;
120
- updatedAt: string;
121
191
  healthy: boolean;
122
192
  }, {
123
193
  issues: {
124
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
194
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
125
195
  message: string;
126
196
  }[];
127
197
  id: string;
198
+ runtime: "claude_code" | "cursor_local" | "codex_local";
199
+ createdAt: string;
200
+ updatedAt: string;
201
+ deckId: string | null;
202
+ purpose: string | null;
128
203
  name: string;
129
- runtime: "claude_code" | "cursor_local";
130
204
  workspaceRoot: string | null;
131
- deckId: string | null;
132
205
  deckName: string | null;
133
206
  playbookId: string | null;
134
207
  defaultPlanModel: string | null;
135
208
  defaultExecuteModel: string | null;
136
209
  defaultPlanBudgetJson: string | null;
137
210
  defaultExecuteBudgetJson: string | null;
211
+ defaultModel: string | null;
212
+ defaultEffort: "low" | "medium" | "high" | null;
213
+ defaultBudgetJson: string | null;
214
+ playbookIdsJson: string | null;
215
+ externalMemoryRefsJson: string | null;
216
+ permissionPolicyJson: string | null;
138
217
  isBuiltin: boolean;
139
- createdAt: string;
140
- updatedAt: string;
141
218
  healthy: boolean;
142
219
  }>;
143
220
  export type AgentWithHealth = z.infer<typeof AgentWithHealth>;
144
221
  export declare const CreateAgentInput: z.ZodObject<{
145
222
  name: z.ZodString;
146
- runtime: z.ZodEnum<["claude_code", "cursor_local"]>;
147
- workspaceRoot: z.ZodString;
148
- deckId: z.ZodOptional<z.ZodString>;
149
- playbookId: z.ZodOptional<z.ZodString>;
150
- defaultPlanModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
151
- defaultExecuteModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
152
- defaultPlanBudget: z.ZodOptional<z.ZodNullable<z.ZodObject<{
223
+ runtime: z.ZodEnum<["claude_code", "cursor_local", "codex_local"]>;
224
+ /** Exactly one Agent Deck — required; workers never start in no-Deck/degraded mode. */
225
+ deckId: z.ZodString;
226
+ defaultModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ defaultEffort: z.ZodOptional<z.ZodNullable<z.ZodEnum<["low", "medium", "high"]>>>;
228
+ defaultBudget: z.ZodOptional<z.ZodNullable<z.ZodObject<{
153
229
  maxTurns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
154
230
  maxBudgetUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
155
231
  }, "strip", z.ZodTypeAny, {
@@ -159,45 +235,44 @@ export declare const CreateAgentInput: z.ZodObject<{
159
235
  maxTurns?: number | null | undefined;
160
236
  maxBudgetUsd?: number | null | undefined;
161
237
  }>>>;
162
- defaultExecuteBudget: z.ZodOptional<z.ZodNullable<z.ZodObject<{
163
- maxTurns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
164
- maxBudgetUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
165
- }, "strip", z.ZodTypeAny, {
166
- maxTurns?: number | null | undefined;
167
- maxBudgetUsd?: number | null | undefined;
238
+ purpose: z.ZodOptional<z.ZodNullable<z.ZodString>>;
239
+ permissionPolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
240
+ worktreeWrite: z.ZodOptional<z.ZodBoolean>;
241
+ outboundMutation: z.ZodOptional<z.ZodBoolean>;
242
+ }, "strict", z.ZodTypeAny, {
243
+ worktreeWrite?: boolean | undefined;
244
+ outboundMutation?: boolean | undefined;
168
245
  }, {
169
- maxTurns?: number | null | undefined;
170
- maxBudgetUsd?: number | null | undefined;
246
+ worktreeWrite?: boolean | undefined;
247
+ outboundMutation?: boolean | undefined;
171
248
  }>>>;
172
249
  }, "strip", z.ZodTypeAny, {
250
+ runtime: "claude_code" | "cursor_local" | "codex_local";
251
+ deckId: string;
173
252
  name: string;
174
- runtime: "claude_code" | "cursor_local";
175
- workspaceRoot: string;
176
- deckId?: string | undefined;
177
- playbookId?: string | undefined;
178
- defaultPlanModel?: string | null | undefined;
179
- defaultExecuteModel?: string | null | undefined;
180
- defaultPlanBudget?: {
181
- maxTurns?: number | null | undefined;
182
- maxBudgetUsd?: number | null | undefined;
253
+ permissionPolicy?: {
254
+ worktreeWrite?: boolean | undefined;
255
+ outboundMutation?: boolean | undefined;
183
256
  } | null | undefined;
184
- defaultExecuteBudget?: {
257
+ purpose?: string | null | undefined;
258
+ defaultModel?: string | null | undefined;
259
+ defaultEffort?: "low" | "medium" | "high" | null | undefined;
260
+ defaultBudget?: {
185
261
  maxTurns?: number | null | undefined;
186
262
  maxBudgetUsd?: number | null | undefined;
187
263
  } | null | undefined;
188
264
  }, {
265
+ runtime: "claude_code" | "cursor_local" | "codex_local";
266
+ deckId: string;
189
267
  name: string;
190
- runtime: "claude_code" | "cursor_local";
191
- workspaceRoot: string;
192
- deckId?: string | undefined;
193
- playbookId?: string | undefined;
194
- defaultPlanModel?: string | null | undefined;
195
- defaultExecuteModel?: string | null | undefined;
196
- defaultPlanBudget?: {
197
- maxTurns?: number | null | undefined;
198
- maxBudgetUsd?: number | null | undefined;
268
+ permissionPolicy?: {
269
+ worktreeWrite?: boolean | undefined;
270
+ outboundMutation?: boolean | undefined;
199
271
  } | null | undefined;
200
- defaultExecuteBudget?: {
272
+ purpose?: string | null | undefined;
273
+ defaultModel?: string | null | undefined;
274
+ defaultEffort?: "low" | "medium" | "high" | null | undefined;
275
+ defaultBudget?: {
201
276
  maxTurns?: number | null | undefined;
202
277
  maxBudgetUsd?: number | null | undefined;
203
278
  } | null | undefined;
@@ -205,13 +280,12 @@ export declare const CreateAgentInput: z.ZodObject<{
205
280
  export type CreateAgentInput = z.infer<typeof CreateAgentInput>;
206
281
  export declare const UpdateAgentInput: z.ZodObject<{
207
282
  name: z.ZodOptional<z.ZodString>;
208
- runtime: z.ZodOptional<z.ZodEnum<["claude_code", "cursor_local"]>>;
209
- workspaceRoot: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
+ runtime: z.ZodOptional<z.ZodEnum<["claude_code", "cursor_local", "codex_local"]>>;
284
+ /** Null clears the deck (unhealthy until set again); omit leaves unchanged. */
210
285
  deckId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
211
- playbookId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
212
- defaultPlanModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
- defaultExecuteModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
- defaultPlanBudget: z.ZodOptional<z.ZodNullable<z.ZodObject<{
286
+ defaultModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ defaultEffort: z.ZodOptional<z.ZodNullable<z.ZodEnum<["low", "medium", "high"]>>>;
288
+ defaultBudget: z.ZodOptional<z.ZodNullable<z.ZodObject<{
215
289
  maxTurns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
216
290
  maxBudgetUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
217
291
  }, "strip", z.ZodTypeAny, {
@@ -221,45 +295,44 @@ export declare const UpdateAgentInput: z.ZodObject<{
221
295
  maxTurns?: number | null | undefined;
222
296
  maxBudgetUsd?: number | null | undefined;
223
297
  }>>>;
224
- defaultExecuteBudget: z.ZodOptional<z.ZodNullable<z.ZodObject<{
225
- maxTurns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
226
- maxBudgetUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
227
- }, "strip", z.ZodTypeAny, {
228
- maxTurns?: number | null | undefined;
229
- maxBudgetUsd?: number | null | undefined;
298
+ purpose: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
+ permissionPolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
300
+ worktreeWrite: z.ZodOptional<z.ZodBoolean>;
301
+ outboundMutation: z.ZodOptional<z.ZodBoolean>;
302
+ }, "strict", z.ZodTypeAny, {
303
+ worktreeWrite?: boolean | undefined;
304
+ outboundMutation?: boolean | undefined;
230
305
  }, {
231
- maxTurns?: number | null | undefined;
232
- maxBudgetUsd?: number | null | undefined;
306
+ worktreeWrite?: boolean | undefined;
307
+ outboundMutation?: boolean | undefined;
233
308
  }>>>;
234
309
  }, "strip", z.ZodTypeAny, {
235
- name?: string | undefined;
236
- runtime?: "claude_code" | "cursor_local" | undefined;
237
- workspaceRoot?: string | null | undefined;
238
- deckId?: string | null | undefined;
239
- playbookId?: string | null | undefined;
240
- defaultPlanModel?: string | null | undefined;
241
- defaultExecuteModel?: string | null | undefined;
242
- defaultPlanBudget?: {
243
- maxTurns?: number | null | undefined;
244
- maxBudgetUsd?: number | null | undefined;
310
+ runtime?: "claude_code" | "cursor_local" | "codex_local" | undefined;
311
+ permissionPolicy?: {
312
+ worktreeWrite?: boolean | undefined;
313
+ outboundMutation?: boolean | undefined;
245
314
  } | null | undefined;
246
- defaultExecuteBudget?: {
315
+ deckId?: string | null | undefined;
316
+ purpose?: string | null | undefined;
317
+ name?: string | undefined;
318
+ defaultModel?: string | null | undefined;
319
+ defaultEffort?: "low" | "medium" | "high" | null | undefined;
320
+ defaultBudget?: {
247
321
  maxTurns?: number | null | undefined;
248
322
  maxBudgetUsd?: number | null | undefined;
249
323
  } | null | undefined;
250
324
  }, {
251
- name?: string | undefined;
252
- runtime?: "claude_code" | "cursor_local" | undefined;
253
- workspaceRoot?: string | null | undefined;
254
- deckId?: string | null | undefined;
255
- playbookId?: string | null | undefined;
256
- defaultPlanModel?: string | null | undefined;
257
- defaultExecuteModel?: string | null | undefined;
258
- defaultPlanBudget?: {
259
- maxTurns?: number | null | undefined;
260
- maxBudgetUsd?: number | null | undefined;
325
+ runtime?: "claude_code" | "cursor_local" | "codex_local" | undefined;
326
+ permissionPolicy?: {
327
+ worktreeWrite?: boolean | undefined;
328
+ outboundMutation?: boolean | undefined;
261
329
  } | null | undefined;
262
- defaultExecuteBudget?: {
330
+ deckId?: string | null | undefined;
331
+ purpose?: string | null | undefined;
332
+ name?: string | undefined;
333
+ defaultModel?: string | null | undefined;
334
+ defaultEffort?: "low" | "medium" | "high" | null | undefined;
335
+ defaultBudget?: {
263
336
  maxTurns?: number | null | undefined;
264
337
  maxBudgetUsd?: number | null | undefined;
265
338
  } | null | undefined;
@@ -269,121 +342,177 @@ export declare const AgentsSnapshot: z.ZodObject<{
269
342
  agents: z.ZodArray<z.ZodObject<{
270
343
  id: z.ZodString;
271
344
  name: z.ZodString;
272
- runtime: z.ZodEnum<["claude_code", "cursor_local"]>;
345
+ runtime: z.ZodEnum<["claude_code", "cursor_local", "codex_local"]>;
346
+ /**
347
+ * Dead legacy storage (NOT-149). Retained so existing rows migrate safely; never shown
348
+ * in UI, never required by health/admission, and never copied into new profile snapshots.
349
+ */
273
350
  workspaceRoot: z.ZodNullable<z.ZodString>;
351
+ /** Required for any Agent used for execution — Dealer never starts without a Deck. */
274
352
  deckId: z.ZodNullable<z.ZodString>;
275
353
  deckName: z.ZodNullable<z.ZodString>;
354
+ /** Dead legacy storage (NOT-149) — playbooks are chosen dynamically inside the Deck. */
276
355
  playbookId: z.ZodNullable<z.ZodString>;
277
- /** CLI model id for planning; null = runtime default */
356
+ /**
357
+ * Legacy phase defaults, read-only since NOT-71: nothing writes these any more, but
358
+ * profile-snapshot.ts still falls back to them so profiles saved before `defaultModel` /
359
+ * `defaultBudgetJson` existed keep their configured model and caps.
360
+ */
278
361
  defaultPlanModel: z.ZodNullable<z.ZodString>;
279
- /** CLI model id for execution; null = runtime default */
280
362
  defaultExecuteModel: z.ZodNullable<z.ZodString>;
281
- /** Serialized PhaseBudget; null = runtime default (no CLI caps) */
282
363
  defaultPlanBudgetJson: z.ZodNullable<z.ZodString>;
283
- /** Serialized PhaseBudget; null = runtime default (no CLI caps) */
284
364
  defaultExecuteBudgetJson: z.ZodNullable<z.ZodString>;
365
+ /** Role-neutral CLI model id for issue-centric developer/reviewer sessions; null = runtime default. */
366
+ defaultModel: z.ZodNullable<z.ZodString>;
367
+ /**
368
+ * Default reasoning effort (NOT-81). Null = runtime default. Applied only for runtimes
369
+ * that expose a CLI-level effort control (Codex / Claude Code); Cursor ignores it.
370
+ */
371
+ defaultEffort: z.ZodNullable<z.ZodEnum<["low", "medium", "high"]>>;
372
+ /** Serialized PhaseBudget for issue-centric sessions; null = runtime default. */
373
+ defaultBudgetJson: z.ZodNullable<z.ZodString>;
374
+ /** Free-text description of what this profile is for (shown in the picker, snapshotted). */
375
+ purpose: z.ZodNullable<z.ZodString>;
376
+ /** Dead legacy storage (NOT-149). */
377
+ playbookIdsJson: z.ZodNullable<z.ZodString>;
378
+ /** Dead legacy storage (NOT-149). */
379
+ externalMemoryRefsJson: z.ZodNullable<z.ZodString>;
380
+ /** Serialized PermissionPolicyOverride — may only tighten the role's capabilities. */
381
+ permissionPolicyJson: z.ZodNullable<z.ZodString>;
285
382
  isBuiltin: z.ZodBoolean;
286
383
  createdAt: z.ZodString;
287
384
  updatedAt: z.ZodString;
288
385
  } & {
289
386
  healthy: z.ZodBoolean;
290
387
  issues: z.ZodArray<z.ZodObject<{
291
- code: z.ZodEnum<["cli_missing", "runtime_auth", "deck_offline", "workspace_missing", "mcp_not_registered"]>;
388
+ code: z.ZodEnum<["cli_missing", "runtime_auth", "cursor_keychain", "usage_capped", "deck_offline", "deck_unauthorized", "workspace_missing", "deck_missing", "mcp_not_registered", "github_cli_missing", "github_auth"]>;
292
389
  message: z.ZodString;
293
390
  }, "strip", z.ZodTypeAny, {
294
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
391
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
295
392
  message: string;
296
393
  }, {
297
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
394
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
298
395
  message: string;
299
396
  }>, "many">;
300
397
  }, "strip", z.ZodTypeAny, {
301
398
  issues: {
302
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
399
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
303
400
  message: string;
304
401
  }[];
305
402
  id: string;
403
+ runtime: "claude_code" | "cursor_local" | "codex_local";
404
+ createdAt: string;
405
+ updatedAt: string;
406
+ deckId: string | null;
407
+ purpose: string | null;
306
408
  name: string;
307
- runtime: "claude_code" | "cursor_local";
308
409
  workspaceRoot: string | null;
309
- deckId: string | null;
310
410
  deckName: string | null;
311
411
  playbookId: string | null;
312
412
  defaultPlanModel: string | null;
313
413
  defaultExecuteModel: string | null;
314
414
  defaultPlanBudgetJson: string | null;
315
415
  defaultExecuteBudgetJson: string | null;
416
+ defaultModel: string | null;
417
+ defaultEffort: "low" | "medium" | "high" | null;
418
+ defaultBudgetJson: string | null;
419
+ playbookIdsJson: string | null;
420
+ externalMemoryRefsJson: string | null;
421
+ permissionPolicyJson: string | null;
316
422
  isBuiltin: boolean;
317
- createdAt: string;
318
- updatedAt: string;
319
423
  healthy: boolean;
320
424
  }, {
321
425
  issues: {
322
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
426
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
323
427
  message: string;
324
428
  }[];
325
429
  id: string;
430
+ runtime: "claude_code" | "cursor_local" | "codex_local";
431
+ createdAt: string;
432
+ updatedAt: string;
433
+ deckId: string | null;
434
+ purpose: string | null;
326
435
  name: string;
327
- runtime: "claude_code" | "cursor_local";
328
436
  workspaceRoot: string | null;
329
- deckId: string | null;
330
437
  deckName: string | null;
331
438
  playbookId: string | null;
332
439
  defaultPlanModel: string | null;
333
440
  defaultExecuteModel: string | null;
334
441
  defaultPlanBudgetJson: string | null;
335
442
  defaultExecuteBudgetJson: string | null;
443
+ defaultModel: string | null;
444
+ defaultEffort: "low" | "medium" | "high" | null;
445
+ defaultBudgetJson: string | null;
446
+ playbookIdsJson: string | null;
447
+ externalMemoryRefsJson: string | null;
448
+ permissionPolicyJson: string | null;
336
449
  isBuiltin: boolean;
337
- createdAt: string;
338
- updatedAt: string;
339
450
  healthy: boolean;
340
451
  }>, "many">;
341
452
  issueCount: z.ZodNumber;
342
453
  }, "strip", z.ZodTypeAny, {
343
454
  agents: {
344
455
  issues: {
345
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
456
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
346
457
  message: string;
347
458
  }[];
348
459
  id: string;
460
+ runtime: "claude_code" | "cursor_local" | "codex_local";
461
+ createdAt: string;
462
+ updatedAt: string;
463
+ deckId: string | null;
464
+ purpose: string | null;
349
465
  name: string;
350
- runtime: "claude_code" | "cursor_local";
351
466
  workspaceRoot: string | null;
352
- deckId: string | null;
353
467
  deckName: string | null;
354
468
  playbookId: string | null;
355
469
  defaultPlanModel: string | null;
356
470
  defaultExecuteModel: string | null;
357
471
  defaultPlanBudgetJson: string | null;
358
472
  defaultExecuteBudgetJson: string | null;
473
+ defaultModel: string | null;
474
+ defaultEffort: "low" | "medium" | "high" | null;
475
+ defaultBudgetJson: string | null;
476
+ playbookIdsJson: string | null;
477
+ externalMemoryRefsJson: string | null;
478
+ permissionPolicyJson: string | null;
359
479
  isBuiltin: boolean;
360
- createdAt: string;
361
- updatedAt: string;
362
480
  healthy: boolean;
363
481
  }[];
364
482
  issueCount: number;
365
483
  }, {
366
484
  agents: {
367
485
  issues: {
368
- code: "cli_missing" | "runtime_auth" | "deck_offline" | "workspace_missing" | "mcp_not_registered";
486
+ code: "cli_missing" | "runtime_auth" | "cursor_keychain" | "usage_capped" | "deck_offline" | "deck_unauthorized" | "workspace_missing" | "deck_missing" | "mcp_not_registered" | "github_cli_missing" | "github_auth";
369
487
  message: string;
370
488
  }[];
371
489
  id: string;
490
+ runtime: "claude_code" | "cursor_local" | "codex_local";
491
+ createdAt: string;
492
+ updatedAt: string;
493
+ deckId: string | null;
494
+ purpose: string | null;
372
495
  name: string;
373
- runtime: "claude_code" | "cursor_local";
374
496
  workspaceRoot: string | null;
375
- deckId: string | null;
376
497
  deckName: string | null;
377
498
  playbookId: string | null;
378
499
  defaultPlanModel: string | null;
379
500
  defaultExecuteModel: string | null;
380
501
  defaultPlanBudgetJson: string | null;
381
502
  defaultExecuteBudgetJson: string | null;
503
+ defaultModel: string | null;
504
+ defaultEffort: "low" | "medium" | "high" | null;
505
+ defaultBudgetJson: string | null;
506
+ playbookIdsJson: string | null;
507
+ externalMemoryRefsJson: string | null;
508
+ permissionPolicyJson: string | null;
382
509
  isBuiltin: boolean;
383
- createdAt: string;
384
- updatedAt: string;
385
510
  healthy: boolean;
386
511
  }[];
387
512
  issueCount: number;
388
513
  }>;
389
514
  export type AgentsSnapshot = z.infer<typeof AgentsSnapshot>;
515
+ /** Role-neutral model, falling back through the legacy phase columns (execute → plan). */
516
+ export declare function resolveProfileModel(agent: AgentProfile): string | null;
517
+ /** Role-neutral budget JSON, same fallback order as the model. */
518
+ export declare function resolveProfileBudgetJson(agent: AgentProfile): string | null;