@intentic/sandbox-contract 1.394.0 → 1.396.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 (255) hide show
  1. package/README.md +20 -2
  2. package/dist/app-routes/app-pages.d.ts +97 -0
  3. package/dist/app-routes/app-pages.d.ts.map +1 -0
  4. package/dist/app-routes/app-pages.js +71 -0
  5. package/dist/app-routes/app-pages.js.map +1 -0
  6. package/dist/app-routes/index.d.ts +5 -0
  7. package/dist/app-routes/index.d.ts.map +1 -0
  8. package/dist/app-routes/index.js +5 -0
  9. package/dist/app-routes/index.js.map +1 -0
  10. package/dist/app-routes/legacy.d.ts +10 -0
  11. package/dist/app-routes/legacy.d.ts.map +1 -0
  12. package/dist/app-routes/legacy.js +92 -0
  13. package/dist/app-routes/legacy.js.map +1 -0
  14. package/dist/app-routes/paths.d.ts +38 -0
  15. package/dist/app-routes/paths.d.ts.map +1 -0
  16. package/dist/app-routes/paths.js +89 -0
  17. package/dist/app-routes/paths.js.map +1 -0
  18. package/dist/app-routes/patterns.d.ts +5 -0
  19. package/dist/app-routes/patterns.d.ts.map +1 -0
  20. package/dist/app-routes/patterns.js +94 -0
  21. package/dist/app-routes/patterns.js.map +1 -0
  22. package/dist/chores/stack.d.ts.map +1 -1
  23. package/dist/chores/stack.js +13 -2
  24. package/dist/chores/stack.js.map +1 -1
  25. package/dist/contracts/agent.contract.d.ts +115 -0
  26. package/dist/contracts/agent.contract.d.ts.map +1 -1
  27. package/dist/contracts/agents.contract.d.ts +1300 -11
  28. package/dist/contracts/agents.contract.d.ts.map +1 -1
  29. package/dist/contracts/agents.contract.js +12 -2
  30. package/dist/contracts/agents.contract.js.map +1 -1
  31. package/dist/contracts/capabilities.contract.d.ts +8 -0
  32. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  33. package/dist/contracts/endpoints.contract.d.ts +45 -0
  34. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  35. package/dist/contracts/endpoints.contract.js +9 -0
  36. package/dist/contracts/endpoints.contract.js.map +1 -1
  37. package/dist/contracts/git.contract.d.ts +5 -0
  38. package/dist/contracts/git.contract.d.ts.map +1 -1
  39. package/dist/contracts/org.contract.d.ts +8 -0
  40. package/dist/contracts/org.contract.d.ts.map +1 -1
  41. package/dist/contracts/runner.contract.d.ts +2765 -11
  42. package/dist/contracts/runner.contract.d.ts.map +1 -1
  43. package/dist/contracts/runner.contract.js +4 -1
  44. package/dist/contracts/runner.contract.js.map +1 -1
  45. package/dist/contracts/seal.contract.d.ts +2760 -0
  46. package/dist/contracts/seal.contract.d.ts.map +1 -0
  47. package/dist/contracts/seal.contract.js +95 -0
  48. package/dist/contracts/seal.contract.js.map +1 -0
  49. package/dist/contracts/sessions.contract.d.ts +16 -0
  50. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  51. package/dist/contracts/settings.contract.d.ts +89 -2
  52. package/dist/contracts/settings.contract.d.ts.map +1 -1
  53. package/dist/contracts/settings.contract.js +21 -3
  54. package/dist/contracts/settings.contract.js.map +1 -1
  55. package/dist/contracts/system.contract.d.ts +419 -62
  56. package/dist/contracts/system.contract.d.ts.map +1 -1
  57. package/dist/contracts/webext.contract.d.ts +4 -0
  58. package/dist/contracts/webext.contract.d.ts.map +1 -1
  59. package/dist/contracts/workspace.contract.d.ts +6 -0
  60. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  61. package/dist/contracts/workspace.contract.js +11 -1
  62. package/dist/contracts/workspace.contract.js.map +1 -1
  63. package/dist/events/agent-events.d.ts +80 -1
  64. package/dist/events/agent-events.d.ts.map +1 -1
  65. package/dist/events/agent-events.js +16 -0
  66. package/dist/events/agent-events.js.map +1 -1
  67. package/dist/events/agent-transcript.d.ts +16 -0
  68. package/dist/events/agent-transcript.d.ts.map +1 -1
  69. package/dist/events/requests.d.ts +2 -0
  70. package/dist/events/requests.d.ts.map +1 -1
  71. package/dist/events/requests.js +4 -0
  72. package/dist/events/requests.js.map +1 -1
  73. package/dist/events/system-events.d.ts +292 -62
  74. package/dist/events/system-events.d.ts.map +1 -1
  75. package/dist/events/system-events.js +3 -0
  76. package/dist/events/system-events.js.map +1 -1
  77. package/dist/events/transcript.d.ts +96 -0
  78. package/dist/events/transcript.d.ts.map +1 -1
  79. package/dist/events/transcript.js +7 -1
  80. package/dist/events/transcript.js.map +1 -1
  81. package/dist/ids/row-ids.d.ts.map +1 -1
  82. package/dist/ids/row-ids.js +7 -2
  83. package/dist/ids/row-ids.js.map +1 -1
  84. package/dist/index.d.ts +107 -34346
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +7 -3
  87. package/dist/index.js.map +1 -1
  88. package/dist/models/model-roles.d.ts +8 -0
  89. package/dist/models/model-roles.d.ts.map +1 -1
  90. package/dist/models/model-roles.js +8 -0
  91. package/dist/models/model-roles.js.map +1 -1
  92. package/dist/policy/org-locks.d.ts +1 -1
  93. package/dist/policy/org-locks.d.ts.map +1 -1
  94. package/dist/policy/org-locks.js +9 -1
  95. package/dist/policy/org-locks.js.map +1 -1
  96. package/dist/policy/request-status.d.ts.map +1 -1
  97. package/dist/policy/request-status.js +26 -10
  98. package/dist/policy/request-status.js.map +1 -1
  99. package/dist/protocol/doors/runner-protocol.d.ts +18 -0
  100. package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
  101. package/dist/protocol/doors/runner-protocol.js +15 -1
  102. package/dist/protocol/doors/runner-protocol.js.map +1 -1
  103. package/dist/protocol/raw/raw-json-routes.d.ts +6 -0
  104. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  105. package/dist/protocol/routes.d.ts +6 -0
  106. package/dist/protocol/routes.d.ts.map +1 -1
  107. package/dist/protocol/routes.js +64 -8
  108. package/dist/protocol/routes.js.map +1 -1
  109. package/dist/protocol/sse.d.ts.map +1 -1
  110. package/dist/protocol/sse.js +5 -1
  111. package/dist/protocol/sse.js.map +1 -1
  112. package/dist/schemas/agent-land.d.ts +78 -0
  113. package/dist/schemas/agent-land.d.ts.map +1 -0
  114. package/dist/schemas/agent-land.js +47 -0
  115. package/dist/schemas/agent-land.js.map +1 -0
  116. package/dist/schemas/agent.d.ts +4 -0
  117. package/dist/schemas/agent.d.ts.map +1 -1
  118. package/dist/schemas/agent.js +1 -0
  119. package/dist/schemas/agent.js.map +1 -1
  120. package/dist/schemas/agents-list.d.ts +130 -0
  121. package/dist/schemas/agents-list.d.ts.map +1 -1
  122. package/dist/schemas/agents.d.ts +196 -76
  123. package/dist/schemas/agents.d.ts.map +1 -1
  124. package/dist/schemas/agents.js +5 -46
  125. package/dist/schemas/agents.js.map +1 -1
  126. package/dist/schemas/capabilities.d.ts +4 -0
  127. package/dist/schemas/capabilities.d.ts.map +1 -1
  128. package/dist/schemas/commit-attribution.d.ts +41 -0
  129. package/dist/schemas/commit-attribution.d.ts.map +1 -0
  130. package/dist/schemas/commit-attribution.js +16 -0
  131. package/dist/schemas/commit-attribution.js.map +1 -0
  132. package/dist/schemas/composer-drafts.d.ts +19 -0
  133. package/dist/schemas/composer-drafts.d.ts.map +1 -1
  134. package/dist/schemas/composer-drafts.js +10 -0
  135. package/dist/schemas/composer-drafts.js.map +1 -1
  136. package/dist/schemas/environment.d.ts +12 -0
  137. package/dist/schemas/environment.d.ts.map +1 -1
  138. package/dist/schemas/environment.js +1 -0
  139. package/dist/schemas/environment.js.map +1 -1
  140. package/dist/schemas/git/git-history.d.ts +10 -0
  141. package/dist/schemas/git/git-history.d.ts.map +1 -1
  142. package/dist/schemas/git/git-history.js +8 -0
  143. package/dist/schemas/git/git-history.js.map +1 -1
  144. package/dist/schemas/gpu-settings.d.ts +15 -0
  145. package/dist/schemas/gpu-settings.d.ts.map +1 -0
  146. package/dist/schemas/gpu-settings.js +18 -0
  147. package/dist/schemas/gpu-settings.js.map +1 -0
  148. package/dist/schemas/night-hours.d.ts +31 -0
  149. package/dist/schemas/night-hours.d.ts.map +1 -0
  150. package/dist/schemas/night-hours.js +33 -0
  151. package/dist/schemas/night-hours.js.map +1 -0
  152. package/dist/schemas/organisation.d.ts +33 -0
  153. package/dist/schemas/organisation.d.ts.map +1 -1
  154. package/dist/schemas/organisation.js +9 -0
  155. package/dist/schemas/organisation.js.map +1 -1
  156. package/dist/schemas/privacy.d.ts +1 -0
  157. package/dist/schemas/privacy.d.ts.map +1 -1
  158. package/dist/schemas/privacy.js +1 -0
  159. package/dist/schemas/privacy.js.map +1 -1
  160. package/dist/schemas/providers/plan-limits.d.ts +16 -0
  161. package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
  162. package/dist/schemas/providers/plan-limits.js +3 -0
  163. package/dist/schemas/providers/plan-limits.js.map +1 -1
  164. package/dist/schemas/sandbox-mode.d.ts +20 -0
  165. package/dist/schemas/sandbox-mode.d.ts.map +1 -0
  166. package/dist/schemas/sandbox-mode.js +54 -0
  167. package/dist/schemas/sandbox-mode.js.map +1 -0
  168. package/dist/schemas/seal-proof.d.ts +20 -0
  169. package/dist/schemas/seal-proof.d.ts.map +1 -0
  170. package/dist/schemas/seal-proof.js +8 -0
  171. package/dist/schemas/seal-proof.js.map +1 -0
  172. package/dist/schemas/seal.d.ts +235 -0
  173. package/dist/schemas/seal.d.ts.map +1 -0
  174. package/dist/schemas/seal.js +97 -0
  175. package/dist/schemas/seal.js.map +1 -0
  176. package/dist/schemas/settings-experiments.d.ts.map +1 -1
  177. package/dist/schemas/settings-experiments.js +1 -1
  178. package/dist/schemas/settings-experiments.js.map +1 -1
  179. package/dist/schemas/settings-history.d.ts +2 -2
  180. package/dist/schemas/settings.d.ts +59 -15
  181. package/dist/schemas/settings.d.ts.map +1 -1
  182. package/dist/schemas/settings.js +23 -27
  183. package/dist/schemas/settings.js.map +1 -1
  184. package/dist/schemas/webext.d.ts +9 -0
  185. package/dist/schemas/webext.d.ts.map +1 -1
  186. package/dist/schemas/webext.js +2 -0
  187. package/dist/schemas/webext.js.map +1 -1
  188. package/dist/schemas/workspace/workspace-tree.d.ts +8 -0
  189. package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
  190. package/dist/schemas/workspace/workspace-tree.js +16 -0
  191. package/dist/schemas/workspace/workspace-tree.js.map +1 -1
  192. package/dist/state/definition.d.ts +48 -8
  193. package/dist/state/definition.d.ts.map +1 -1
  194. package/dist/text/mentions.d.ts.map +1 -1
  195. package/dist/text/mentions.js +8 -1
  196. package/dist/text/mentions.js.map +1 -1
  197. package/dist/text/transcript-fold.d.ts.map +1 -1
  198. package/dist/text/transcript-fold.js +1 -0
  199. package/dist/text/transcript-fold.js.map +1 -1
  200. package/package.json +16 -5
  201. package/src/app-routes/app-pages.ts +148 -0
  202. package/src/app-routes/app-routes.test.ts +183 -0
  203. package/src/app-routes/index.ts +6 -0
  204. package/src/app-routes/legacy.ts +144 -0
  205. package/src/app-routes/paths.ts +160 -0
  206. package/src/app-routes/patterns.ts +145 -0
  207. package/src/chores/stack.ts +14 -2
  208. package/src/contracts/agents.contract.ts +16 -2
  209. package/src/contracts/endpoints.contract.ts +12 -0
  210. package/src/contracts/runner.contract.ts +12 -0
  211. package/src/contracts/seal.contract.ts +117 -0
  212. package/src/contracts/settings.contract.ts +30 -6
  213. package/src/contracts/workspace.contract.ts +16 -0
  214. package/src/events/agent-events.ts +20 -0
  215. package/src/events/requests.ts +8 -0
  216. package/src/events/system-events.ts +39 -4
  217. package/src/events/transcript.ts +9 -1
  218. package/src/ids/row-ids.test.ts +31 -0
  219. package/src/ids/row-ids.ts +10 -2
  220. package/src/index.ts +65 -5
  221. package/src/models/model-roles.ts +10 -0
  222. package/src/policy/org-locks.ts +9 -1
  223. package/src/policy/request-status.ts +38 -10
  224. package/src/protocol/doors/runner-protocol.ts +28 -1
  225. package/src/protocol/routes.test.ts +75 -2
  226. package/src/protocol/routes.ts +119 -11
  227. package/src/protocol/sse.ts +6 -1
  228. package/src/schemas/agent-land.ts +98 -0
  229. package/src/schemas/agent.ts +3 -0
  230. package/src/schemas/agents.ts +6 -94
  231. package/src/schemas/capabilities.ts +1 -1
  232. package/src/schemas/commit-attribution.ts +38 -0
  233. package/src/schemas/composer-drafts.ts +17 -0
  234. package/src/schemas/environment.ts +4 -0
  235. package/src/schemas/git/git-history.ts +10 -0
  236. package/src/schemas/gpu-settings.ts +31 -0
  237. package/src/schemas/night-hours.test.ts +54 -0
  238. package/src/schemas/night-hours.ts +70 -0
  239. package/src/schemas/organisation.ts +15 -0
  240. package/src/schemas/privacy.test.ts +8 -1
  241. package/src/schemas/privacy.ts +10 -1
  242. package/src/schemas/providers/plan-limits.ts +5 -0
  243. package/src/schemas/sandbox-mode.test.ts +68 -0
  244. package/src/schemas/sandbox-mode.ts +93 -0
  245. package/src/schemas/seal-proof.ts +12 -0
  246. package/src/schemas/seal.ts +175 -0
  247. package/src/schemas/settings-experiments.ts +3 -1
  248. package/src/schemas/settings.test.ts +7 -0
  249. package/src/schemas/settings.ts +60 -48
  250. package/src/schemas/webext.ts +8 -0
  251. package/src/schemas/workspace/workspace-tree.ts +23 -0
  252. package/src/state/daemon-floor.test.ts +1 -0
  253. package/src/text/mentions.ts +10 -1
  254. package/src/text/pages.test.ts +1 -0
  255. package/src/text/transcript-fold.ts +1 -0
@@ -29,6 +29,7 @@ export declare const runnerContract: {
29
29
  kind: "done";
30
30
  ok: boolean;
31
31
  detail?: string | undefined;
32
+ code?: "busy" | undefined;
32
33
  }, unknown, void>, import("@orpc/contract").AsyncIteratorClass<{
33
34
  kind: "line";
34
35
  text: string;
@@ -36,6 +37,7 @@ export declare const runnerContract: {
36
37
  kind: "done";
37
38
  ok: boolean;
38
39
  detail?: string | undefined;
40
+ code?: "busy" | undefined;
39
41
  }, unknown, void>> & {
40
42
  [x: symbol]: z.ZodUnion<readonly [z.ZodObject<{
41
43
  kind: z.ZodLiteral<"line">;
@@ -44,6 +46,9 @@ export declare const runnerContract: {
44
46
  kind: z.ZodLiteral<"done">;
45
47
  ok: z.ZodBoolean;
46
48
  detail: z.ZodOptional<z.ZodString>;
49
+ code: z.ZodOptional<z.ZodEnum<{
50
+ busy: "busy";
51
+ }>>;
47
52
  }, z.core.$strip>]>;
48
53
  }, Record<never, never>, Record<never, never>>;
49
54
  runTurn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -229,6 +234,7 @@ export declare const runnerContract: {
229
234
  name: string;
230
235
  description: string;
231
236
  hint?: string | undefined;
237
+ builtin?: boolean | undefined;
232
238
  }[];
233
239
  } | {
234
240
  kind: "usage";
@@ -597,6 +603,17 @@ export declare const runnerContract: {
597
603
  text: string;
598
604
  title?: string | undefined;
599
605
  done?: boolean | undefined;
606
+ } | {
607
+ kind: "file_draft";
608
+ callId: string;
609
+ path: string;
610
+ op: "edit" | "write";
611
+ at: number;
612
+ text: string;
613
+ old?: string | undefined;
614
+ replaceAll?: boolean | undefined;
615
+ truncated?: boolean | undefined;
616
+ done?: boolean | undefined;
600
617
  } | {
601
618
  kind: "resolved";
602
619
  requestId: string;
@@ -605,12 +622,20 @@ export declare const runnerContract: {
605
622
  requestId: string;
606
623
  approve: boolean;
607
624
  feedback?: string | undefined;
625
+ night?: {
626
+ outcome: "approved" | "picked" | "saved";
627
+ until: string;
628
+ } | undefined;
608
629
  } | {
609
630
  kind: "question";
610
631
  requestId: string;
611
632
  answers?: Record<string, string[]> | undefined;
612
633
  attachments?: Record<string, string[]> | undefined;
613
634
  cancelled?: boolean | undefined;
635
+ night?: {
636
+ outcome: "approved" | "picked" | "saved";
637
+ until: string;
638
+ } | undefined;
614
639
  } | {
615
640
  kind: "permission";
616
641
  requestId: string;
@@ -990,6 +1015,7 @@ export declare const runnerContract: {
990
1015
  name: string;
991
1016
  description: string;
992
1017
  hint?: string | undefined;
1018
+ builtin?: boolean | undefined;
993
1019
  }[];
994
1020
  } | {
995
1021
  kind: "usage";
@@ -1360,6 +1386,17 @@ export declare const runnerContract: {
1360
1386
  text: string;
1361
1387
  title?: string | undefined;
1362
1388
  done?: boolean | undefined;
1389
+ } | {
1390
+ kind: "file_draft";
1391
+ callId: string;
1392
+ path: string;
1393
+ op: "edit" | "write";
1394
+ at: number;
1395
+ text: string;
1396
+ old?: string | undefined;
1397
+ replaceAll?: boolean | undefined;
1398
+ truncated?: boolean | undefined;
1399
+ done?: boolean | undefined;
1363
1400
  } | {
1364
1401
  kind: "resolved";
1365
1402
  requestId: string;
@@ -1368,12 +1405,20 @@ export declare const runnerContract: {
1368
1405
  requestId: string;
1369
1406
  approve: boolean;
1370
1407
  feedback?: string | undefined;
1408
+ night?: {
1409
+ outcome: "approved" | "picked" | "saved";
1410
+ until: string;
1411
+ } | undefined;
1371
1412
  } | {
1372
1413
  kind: "question";
1373
1414
  requestId: string;
1374
1415
  answers?: Record<string, string[]> | undefined;
1375
1416
  attachments?: Record<string, string[]> | undefined;
1376
1417
  cancelled?: boolean | undefined;
1418
+ night?: {
1419
+ outcome: "approved" | "picked" | "saved";
1420
+ until: string;
1421
+ } | undefined;
1377
1422
  } | {
1378
1423
  kind: "permission";
1379
1424
  requestId: string;
@@ -1857,6 +1902,7 @@ export declare const runnerContract: {
1857
1902
  name: z.ZodString;
1858
1903
  description: z.ZodString;
1859
1904
  hint: z.ZodOptional<z.ZodString>;
1905
+ builtin: z.ZodOptional<z.ZodBoolean>;
1860
1906
  }, z.core.$strip>>;
1861
1907
  }, z.core.$strip>, z.ZodObject<{
1862
1908
  kind: z.ZodLiteral<"usage">;
@@ -2444,6 +2490,20 @@ export declare const runnerContract: {
2444
2490
  text: z.ZodString;
2445
2491
  title: z.ZodOptional<z.ZodString>;
2446
2492
  done: z.ZodOptional<z.ZodBoolean>;
2493
+ }, z.core.$strip>, z.ZodObject<{
2494
+ kind: z.ZodLiteral<"file_draft">;
2495
+ callId: z.ZodString;
2496
+ path: z.ZodString;
2497
+ op: z.ZodEnum<{
2498
+ edit: "edit";
2499
+ write: "write";
2500
+ }>;
2501
+ at: z.ZodNumber;
2502
+ text: z.ZodString;
2503
+ old: z.ZodOptional<z.ZodString>;
2504
+ replaceAll: z.ZodOptional<z.ZodBoolean>;
2505
+ truncated: z.ZodOptional<z.ZodBoolean>;
2506
+ done: z.ZodOptional<z.ZodBoolean>;
2447
2507
  }, z.core.$strip>, z.ZodObject<{
2448
2508
  kind: z.ZodLiteral<"resolved">;
2449
2509
  requestId: z.ZodString;
@@ -2452,12 +2512,28 @@ export declare const runnerContract: {
2452
2512
  requestId: z.ZodString;
2453
2513
  approve: z.ZodBoolean;
2454
2514
  feedback: z.ZodOptional<z.ZodString>;
2515
+ night: z.ZodOptional<z.ZodObject<{
2516
+ outcome: z.ZodEnum<{
2517
+ approved: "approved";
2518
+ picked: "picked";
2519
+ saved: "saved";
2520
+ }>;
2521
+ until: z.ZodString;
2522
+ }, z.core.$strip>>;
2455
2523
  }, z.core.$strip>, z.ZodObject<{
2456
2524
  kind: z.ZodLiteral<"question">;
2457
2525
  requestId: z.ZodString;
2458
2526
  answers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
2459
2527
  attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
2460
2528
  cancelled: z.ZodOptional<z.ZodBoolean>;
2529
+ night: z.ZodOptional<z.ZodObject<{
2530
+ outcome: z.ZodEnum<{
2531
+ approved: "approved";
2532
+ picked: "picked";
2533
+ saved: "saved";
2534
+ }>;
2535
+ until: z.ZodString;
2536
+ }, z.core.$strip>>;
2461
2537
  }, z.core.$strip>, z.ZodObject<{
2462
2538
  kind: z.ZodLiteral<"permission">;
2463
2539
  requestId: z.ZodString;
@@ -2633,17 +2709,2695 @@ export declare const runnerContract: {
2633
2709
  kind: z.ZodLiteral<"done">;
2634
2710
  }, z.core.$strip>], "kind">;
2635
2711
  }, Record<never, never>, Record<never, never>>;
2636
- reply: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodDiscriminatedUnion<[z.ZodObject<{
2637
- kind: z.ZodLiteral<"plan">;
2638
- requestId: z.ZodString;
2639
- approve: z.ZodBoolean;
2640
- feedback: z.ZodOptional<z.ZodString>;
2641
- }, z.core.$strip>, z.ZodObject<{
2642
- kind: z.ZodLiteral<"question">;
2643
- requestId: z.ZodString;
2644
- answers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
2645
- attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
2646
- cancelled: z.ZodOptional<z.ZodBoolean>;
2712
+ attachTurn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
2713
+ conversationId: z.ZodString;
2714
+ after: z.ZodNumber;
2715
+ }, z.core.$strip>, import("@orpc/contract").Schema<AsyncIteratorObject<{
2716
+ kind: "session";
2717
+ sessionId: string;
2718
+ account?: string | undefined;
2719
+ } | {
2720
+ kind: "worktree";
2721
+ branch: string;
2722
+ base: string;
2723
+ unenforced?: boolean | undefined;
2724
+ sync?: {
2725
+ commits: number;
2726
+ blocked: string[];
2727
+ } | undefined;
2728
+ remote?: string | undefined;
2729
+ } | {
2730
+ kind: "landed";
2731
+ landed: boolean;
2732
+ conflicts?: {
2733
+ repo: string;
2734
+ paths: {
2735
+ path: string;
2736
+ reason: "binary" | "diverged" | "workspace";
2737
+ }[];
2738
+ clean: number;
2739
+ mainBranch?: string | undefined;
2740
+ }[] | undefined;
2741
+ held?: boolean | undefined;
2742
+ deps?: {
2743
+ missing: number;
2744
+ started: string[];
2745
+ deferred: boolean;
2746
+ } | undefined;
2747
+ into?: string | undefined;
2748
+ land?: string | undefined;
2749
+ } | {
2750
+ kind: "preamble";
2751
+ notes: {
2752
+ title: string;
2753
+ text: string;
2754
+ }[];
2755
+ } | {
2756
+ kind: "init";
2757
+ model: string;
2758
+ prompt?: {
2759
+ hash: string;
2760
+ parts: Record<string, string>;
2761
+ } | undefined;
2762
+ } | {
2763
+ kind: "checkpoint";
2764
+ id: string;
2765
+ index?: number | undefined;
2766
+ } | {
2767
+ kind: "steer";
2768
+ text: string;
2769
+ sentAt: number;
2770
+ attachments?: string[] | undefined;
2771
+ voice?: "agent" | "sandbox" | undefined;
2772
+ errand?: "ci-fix" | "ci-fix-nudge" | "land-breakage" | "land-conflict" | "land-fix" | "land-fix-nudge" | "land-held" | "push-fix" | "push-fix-nudge" | "verify-nudge" | undefined;
2773
+ messageId?: string | undefined;
2774
+ } | {
2775
+ kind: "delta";
2776
+ text: string;
2777
+ parentToolUseId?: string | undefined;
2778
+ } | {
2779
+ kind: "text_end";
2780
+ parentToolUseId?: string | undefined;
2781
+ } | {
2782
+ kind: "thinking";
2783
+ text: string;
2784
+ parentToolUseId?: string | undefined;
2785
+ } | {
2786
+ kind: "tool_call";
2787
+ id: string;
2788
+ name: string;
2789
+ category: "delete" | "edit" | "execute" | "fetch" | "move" | "other" | "read" | "search" | "think";
2790
+ status: "completed" | "failed" | "in_progress" | "interrupted" | "pending";
2791
+ target?: string | undefined;
2792
+ locations?: {
2793
+ path: string;
2794
+ line?: number | undefined;
2795
+ }[] | undefined;
2796
+ content?: ({
2797
+ type: "text";
2798
+ text: string;
2799
+ } | {
2800
+ type: "diff";
2801
+ path: string;
2802
+ oldText?: string | undefined;
2803
+ newText: string;
2804
+ truncated?: boolean | undefined;
2805
+ } | {
2806
+ type: "image";
2807
+ path: string;
2808
+ })[] | undefined;
2809
+ input?: string | undefined;
2810
+ description?: string | undefined;
2811
+ server?: string | undefined;
2812
+ parentToolUseId?: string | undefined;
2813
+ } | {
2814
+ kind: "tool_call_update";
2815
+ id: string;
2816
+ status?: "completed" | "failed" | "in_progress" | "interrupted" | "pending" | undefined;
2817
+ content?: ({
2818
+ type: "text";
2819
+ text: string;
2820
+ } | {
2821
+ type: "diff";
2822
+ path: string;
2823
+ oldText?: string | undefined;
2824
+ newText: string;
2825
+ truncated?: boolean | undefined;
2826
+ } | {
2827
+ type: "image";
2828
+ path: string;
2829
+ })[] | undefined;
2830
+ locations?: {
2831
+ path: string;
2832
+ line?: number | undefined;
2833
+ }[] | undefined;
2834
+ exitCode?: number | undefined;
2835
+ input?: string | undefined;
2836
+ } | {
2837
+ kind: "terminal";
2838
+ session: string;
2839
+ } | {
2840
+ kind: "browser";
2841
+ session: string;
2842
+ } | {
2843
+ kind: "subagent";
2844
+ id: string;
2845
+ subagentKind: "linked" | "spawned" | "subagent";
2846
+ agentType?: string | undefined;
2847
+ description?: string | undefined;
2848
+ model?: string | undefined;
2849
+ provider?: string | undefined;
2850
+ background?: boolean | undefined;
2851
+ } | {
2852
+ kind: "subagent_update";
2853
+ id: string;
2854
+ status?: "blocked" | "completed" | "failed" | "killed" | "paused" | "pending" | "running" | undefined;
2855
+ tokens?: number | undefined;
2856
+ toolUses?: number | undefined;
2857
+ lastTool?: string | undefined;
2858
+ summary?: string | undefined;
2859
+ error?: string | undefined;
2860
+ verification?: {
2861
+ state: "failing" | "no-code" | "unproven" | "verified";
2862
+ paths?: string[] | undefined;
2863
+ check?: string | undefined;
2864
+ } | undefined;
2865
+ sdk?: {
2866
+ sessionId: string;
2867
+ agentId: string;
2868
+ } | undefined;
2869
+ } | {
2870
+ kind: "todos";
2871
+ items: {
2872
+ content: string;
2873
+ status: "completed" | "in_progress" | "pending";
2874
+ activeForm?: string | undefined;
2875
+ }[];
2876
+ } | {
2877
+ kind: "commands";
2878
+ items: {
2879
+ name: string;
2880
+ description: string;
2881
+ hint?: string | undefined;
2882
+ builtin?: boolean | undefined;
2883
+ }[];
2884
+ } | {
2885
+ kind: "usage";
2886
+ account?: string | undefined;
2887
+ costUsd?: number | undefined;
2888
+ inputTokens?: number | undefined;
2889
+ outputTokens?: number | undefined;
2890
+ cacheReadTokens?: number | undefined;
2891
+ cacheCreationTokens?: number | undefined;
2892
+ durationMs?: number | undefined;
2893
+ numTurns?: number | undefined;
2894
+ openingCacheReadTokens?: number | undefined;
2895
+ openingCacheCreationTokens?: number | undefined;
2896
+ promptFingerprint?: string | undefined;
2897
+ } | {
2898
+ kind: "fast_mode";
2899
+ state: "cooldown" | "off" | "on";
2900
+ reason?: string | undefined;
2901
+ } | {
2902
+ kind: "provider_retry";
2903
+ attempt: number;
2904
+ maxAttempts?: number | undefined;
2905
+ nextAttemptAt?: number | undefined;
2906
+ status?: number | undefined;
2907
+ } | {
2908
+ kind: "account_usage";
2909
+ account?: string | undefined;
2910
+ windows: {
2911
+ kind: string;
2912
+ label?: string | undefined;
2913
+ utilization: number;
2914
+ resetsAt?: number | undefined;
2915
+ gates: "all" | "none" | {
2916
+ models: string[];
2917
+ };
2918
+ rounded?: boolean | undefined;
2919
+ lapsedAt?: number | undefined;
2920
+ missingSince?: number | undefined;
2921
+ }[];
2922
+ } | {
2923
+ kind: "compact";
2924
+ trigger: string;
2925
+ preTokens?: number | undefined;
2926
+ postTokens?: number | undefined;
2927
+ } | {
2928
+ kind: "install";
2929
+ reach: "main-tree" | "own-copy";
2930
+ projects: string[];
2931
+ } | {
2932
+ kind: "agent_status";
2933
+ key: string;
2934
+ text: string | null;
2935
+ source?: string | undefined;
2936
+ } | {
2937
+ level: "error" | "info" | "warning";
2938
+ source?: string | undefined;
2939
+ sent?: string | undefined;
2940
+ kind: "agent_notice";
2941
+ text: string;
2942
+ } | {
2943
+ requestId: string;
2944
+ text: string;
2945
+ document?: {
2946
+ path: string;
2947
+ title: string;
2948
+ markdown: string;
2949
+ truncated?: boolean | undefined;
2950
+ plan?: boolean | undefined;
2951
+ } | undefined;
2952
+ kind: "plan";
2953
+ } | {
2954
+ requestId: string;
2955
+ questions: {
2956
+ question: string;
2957
+ header: string;
2958
+ multiSelect: boolean;
2959
+ options: {
2960
+ label: string;
2961
+ description: string;
2962
+ preview?: string | undefined;
2963
+ }[];
2964
+ }[];
2965
+ document?: {
2966
+ path: string;
2967
+ title: string;
2968
+ markdown: string;
2969
+ truncated?: boolean | undefined;
2970
+ plan?: boolean | undefined;
2971
+ } | undefined;
2972
+ kind: "question";
2973
+ } | {
2974
+ requestId: string;
2975
+ session: string;
2976
+ account: string;
2977
+ message: string;
2978
+ kind: "browser_help";
2979
+ } | {
2980
+ requestId: string;
2981
+ session: string;
2982
+ message: string;
2983
+ kind: "terminal_help";
2984
+ } | {
2985
+ requestId: string;
2986
+ offer: {
2987
+ entry: string;
2988
+ name: string;
2989
+ why?: string | undefined;
2990
+ };
2991
+ kind: "capability_offer";
2992
+ } | {
2993
+ requestId: string;
2994
+ offer: {
2995
+ url: string;
2996
+ description?: string | undefined;
2997
+ payTo: string;
2998
+ network: string;
2999
+ asset: string;
3000
+ assetName: string;
3001
+ amountUsd: string;
3002
+ spentTodayUsd: string;
3003
+ dailyCapUsd: string;
3004
+ why?: string | undefined;
3005
+ };
3006
+ kind: "payment_offer";
3007
+ } | {
3008
+ requestId: string;
3009
+ offer: {
3010
+ subject: string;
3011
+ kind: "capability" | "secret";
3012
+ lane: "browser" | "code" | "desktop" | "device" | "gateway" | "otp" | "session" | "shell" | "ssh";
3013
+ detail?: string | undefined;
3014
+ why?: string | undefined;
3015
+ approvers: string[];
3016
+ scope: "conversation" | "use";
3017
+ };
3018
+ kind: "credential_offer";
3019
+ } | {
3020
+ kind: "need";
3021
+ need: {
3022
+ id: string;
3023
+ conversationId: string;
3024
+ subject: {
3025
+ kind: "capability";
3026
+ entry: string;
3027
+ name: string;
3028
+ mode: "change" | "connect" | "reconnect" | "remove";
3029
+ instance?: string | undefined;
3030
+ target?: string | undefined;
3031
+ prefill?: Record<string, string> | undefined;
3032
+ changes?: Record<string, string> | undefined;
3033
+ reason?: string | undefined;
3034
+ reported?: boolean | undefined;
3035
+ } | {
3036
+ kind: "secret";
3037
+ name: string;
3038
+ where?: string | undefined;
3039
+ link?: string | undefined;
3040
+ hint?: string | undefined;
3041
+ replace?: boolean | undefined;
3042
+ } | {
3043
+ kind: "grant";
3044
+ subject: "capability" | "folder" | "shelf" | "site";
3045
+ what: string;
3046
+ label: string;
3047
+ persona?: string | undefined;
3048
+ scope?: "conversation" | "persona" | undefined;
3049
+ } | {
3050
+ kind: "release";
3051
+ subject: string;
3052
+ approvers: string[];
3053
+ } | {
3054
+ kind: "environment";
3055
+ tool: string;
3056
+ steps: string;
3057
+ approvedHash?: string | undefined;
3058
+ } | {
3059
+ kind: "automation";
3060
+ automation: {
3061
+ id: string;
3062
+ trigger: {
3063
+ kind: "schedule";
3064
+ cron: string;
3065
+ tz?: string | undefined;
3066
+ afterSessions?: number | undefined;
3067
+ } | {
3068
+ kind: "once";
3069
+ at: number;
3070
+ } | {
3071
+ kind: "event";
3072
+ dailyMax?: number | undefined;
3073
+ } | {
3074
+ kind: "listener";
3075
+ provider: string;
3076
+ channelId?: string | undefined;
3077
+ eventType?: string | undefined;
3078
+ mentioned?: boolean | undefined;
3079
+ branch?: string | undefined;
3080
+ allowedOrigins?: string[] | undefined;
3081
+ } | {
3082
+ kind: "workspace";
3083
+ event: "agent.landed" | "deps.broken" | "deps.fixed" | "turn.settled";
3084
+ repo?: string | undefined;
3085
+ };
3086
+ guard?: string | undefined;
3087
+ source?: {
3088
+ kind: "npm";
3089
+ package: string;
3090
+ range?: string | undefined;
3091
+ tag?: string | undefined;
3092
+ } | {
3093
+ kind: "github-release";
3094
+ repo: string;
3095
+ prereleases?: boolean | undefined;
3096
+ } | {
3097
+ kind: "url";
3098
+ url: string;
3099
+ select?: string | undefined;
3100
+ } | undefined;
3101
+ fireOn?: "change" | "pass" | undefined;
3102
+ until?: "first-fire" | undefined;
3103
+ expiresAt?: number | undefined;
3104
+ target?: {
3105
+ kind: "agent";
3106
+ } | {
3107
+ kind: "conversation";
3108
+ conversationId: string;
3109
+ } | {
3110
+ kind: "notify";
3111
+ } | undefined;
3112
+ note?: string | undefined;
3113
+ prompt: string;
3114
+ webchat?: {
3115
+ access?: "google" | "public" | undefined;
3116
+ requireName?: boolean | undefined;
3117
+ antiBot?: "pow" | "turnstile" | undefined;
3118
+ turnstileSiteKey?: string | undefined;
3119
+ turnstileSecret?: string | undefined;
3120
+ googleClientId?: string | undefined;
3121
+ title?: string | undefined;
3122
+ greeting?: string | undefined;
3123
+ accent?: string | undefined;
3124
+ position?: "bottom-left" | "bottom-right" | "top-left" | "top-right" | undefined;
3125
+ dailyMessageMax?: number | undefined;
3126
+ conversationMessageMax?: number | undefined;
3127
+ sessionTtlMinutes?: number | undefined;
3128
+ aiDisclosure?: boolean | undefined;
3129
+ aiDisclosureText?: string | undefined;
3130
+ } | undefined;
3131
+ issues?: {
3132
+ keyFromBrowsers?: boolean | undefined;
3133
+ dailyReportMax?: number | undefined;
3134
+ escalateAfter?: number | undefined;
3135
+ antiBot?: "pow" | undefined;
3136
+ title?: string | undefined;
3137
+ prompt?: string | undefined;
3138
+ thanks?: string | undefined;
3139
+ askEmail?: boolean | undefined;
3140
+ accent?: string | undefined;
3141
+ captureCrashes?: boolean | undefined;
3142
+ } | undefined;
3143
+ allowedTools?: string[] | undefined;
3144
+ models?: {
3145
+ provider: string;
3146
+ model: string;
3147
+ effort?: string | undefined;
3148
+ thinking?: boolean | undefined;
3149
+ fast?: boolean | undefined;
3150
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
3151
+ }[] | undefined;
3152
+ account?: string | undefined;
3153
+ actsAs?: string | undefined;
3154
+ runAs?: string | undefined;
3155
+ senders?: {
3156
+ rules: {
3157
+ label?: string | undefined;
3158
+ ids?: string[] | undefined;
3159
+ groups?: string[] | undefined;
3160
+ actsAs?: string | undefined;
3161
+ runAs?: string | undefined;
3162
+ requireApproval?: boolean | undefined;
3163
+ }[];
3164
+ others: "allow" | "hold" | "ignore";
3165
+ } | undefined;
3166
+ requireApproval?: boolean | undefined;
3167
+ holdForSeconds?: number | undefined;
3168
+ chore?: boolean | undefined;
3169
+ group?: string | undefined;
3170
+ enabled: boolean;
3171
+ };
3172
+ replaces?: boolean | undefined;
3173
+ firstCheck?: {
3174
+ pass: boolean;
3175
+ saw: string;
3176
+ at: number;
3177
+ } | undefined;
3178
+ };
3179
+ title: string;
3180
+ why?: string | undefined;
3181
+ status: "cancelled" | "declined" | "met" | "open" | "working";
3182
+ createdAt: number;
3183
+ updatedAt: number;
3184
+ answeredBy?: string | undefined;
3185
+ byAgent?: boolean | undefined;
3186
+ outcome?: string | undefined;
3187
+ told?: "call" | "queued" | "turn" | undefined;
3188
+ unattended?: boolean | undefined;
3189
+ };
3190
+ } | {
3191
+ kind: "page";
3192
+ page: {
3193
+ id: string;
3194
+ title: string;
3195
+ path: string;
3196
+ height?: number | undefined;
3197
+ measured?: number | undefined;
3198
+ source?: string | undefined;
3199
+ revision?: number | undefined;
3200
+ superseded?: boolean | undefined;
3201
+ app?: {
3202
+ server: string;
3203
+ tool: string;
3204
+ } | undefined;
3205
+ };
3206
+ } | {
3207
+ kind: "review";
3208
+ review: {
3209
+ id: string;
3210
+ source: "claude" | "codex";
3211
+ level?: "high" | "low" | "max" | "medium" | "xhigh" | undefined;
3212
+ findings: {
3213
+ file: string;
3214
+ line?: number | undefined;
3215
+ endLine?: number | undefined;
3216
+ summary: string;
3217
+ title?: string | undefined;
3218
+ scenario?: string | undefined;
3219
+ body?: string | undefined;
3220
+ category?: string | undefined;
3221
+ verdict?: "CONFIRMED" | "PLAUSIBLE" | undefined;
3222
+ priority?: number | undefined;
3223
+ outcome?: "fixed" | "no_change_needed" | "skipped" | undefined;
3224
+ }[];
3225
+ superseded?: boolean | undefined;
3226
+ };
3227
+ } | {
3228
+ requestId: string;
3229
+ page: {
3230
+ id: string;
3231
+ title: string;
3232
+ path: string;
3233
+ height?: number | undefined;
3234
+ measured?: number | undefined;
3235
+ source?: string | undefined;
3236
+ revision?: number | undefined;
3237
+ superseded?: boolean | undefined;
3238
+ app?: {
3239
+ server: string;
3240
+ tool: string;
3241
+ } | undefined;
3242
+ };
3243
+ kind: "page_ask";
3244
+ } | {
3245
+ kind: "page_draft";
3246
+ callId: string;
3247
+ at: number;
3248
+ text: string;
3249
+ title?: string | undefined;
3250
+ done?: boolean | undefined;
3251
+ } | {
3252
+ kind: "file_draft";
3253
+ callId: string;
3254
+ path: string;
3255
+ op: "edit" | "write";
3256
+ at: number;
3257
+ text: string;
3258
+ old?: string | undefined;
3259
+ replaceAll?: boolean | undefined;
3260
+ truncated?: boolean | undefined;
3261
+ done?: boolean | undefined;
3262
+ } | {
3263
+ kind: "resolved";
3264
+ requestId: string;
3265
+ reply?: {
3266
+ kind: "plan";
3267
+ requestId: string;
3268
+ approve: boolean;
3269
+ feedback?: string | undefined;
3270
+ night?: {
3271
+ outcome: "approved" | "picked" | "saved";
3272
+ until: string;
3273
+ } | undefined;
3274
+ } | {
3275
+ kind: "question";
3276
+ requestId: string;
3277
+ answers?: Record<string, string[]> | undefined;
3278
+ attachments?: Record<string, string[]> | undefined;
3279
+ cancelled?: boolean | undefined;
3280
+ night?: {
3281
+ outcome: "approved" | "picked" | "saved";
3282
+ until: string;
3283
+ } | undefined;
3284
+ } | {
3285
+ kind: "permission";
3286
+ requestId: string;
3287
+ decision: "always" | "deny" | "everything" | "once";
3288
+ feedback?: string | undefined;
3289
+ child?: {
3290
+ provider: string;
3291
+ model: string;
3292
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
3293
+ account?: string | undefined;
3294
+ effort?: string | undefined;
3295
+ thinking?: boolean | undefined;
3296
+ fast?: boolean | undefined;
3297
+ } | undefined;
3298
+ } | {
3299
+ kind: "browser_help";
3300
+ requestId: string;
3301
+ helped: boolean;
3302
+ note?: string | undefined;
3303
+ } | {
3304
+ kind: "terminal_help";
3305
+ requestId: string;
3306
+ helped: boolean;
3307
+ note?: string | undefined;
3308
+ } | {
3309
+ kind: "capability_offer";
3310
+ requestId: string;
3311
+ connect: boolean;
3312
+ } | {
3313
+ kind: "payment_offer";
3314
+ requestId: string;
3315
+ approve: boolean;
3316
+ } | {
3317
+ kind: "page_ask";
3318
+ requestId: string;
3319
+ value?: string | undefined;
3320
+ cancelled?: boolean | undefined;
3321
+ } | {
3322
+ kind: "credential_offer";
3323
+ requestId: string;
3324
+ approve: boolean;
3325
+ } | undefined;
3326
+ } | {
3327
+ kind: "mode";
3328
+ mode: "bypassPermissions" | "default" | "plan";
3329
+ } | {
3330
+ kind: "error";
3331
+ message: string;
3332
+ own?: boolean | undefined;
3333
+ code?: "account-not-allowed" | "account-not-entitled" | "acp-auth-required" | "agent-busy" | "agent-domain-refused" | "claude-not-entitled" | "claude-reauth" | "claude-token-refused" | "codex-advisory" | "codex-model-invalid" | "codex-reauth" | "context-overflow" | "context-window-too-small" | "engine-version-floor" | "grok-model-invalid" | "harness-incomplete" | "model-helper-only" | "model-unavailable" | "privacy-instructions" | "privacy-unshielded" | "provider-outage" | "rate_limit" | "safeguard-flagged" | "sandbox-disk-low" | "sandbox-memory-low" | "session-not-found" | "subscription-required" | "tools-unenforced" | "trial-exhausted" | "trial-model-unavailable" | "trial-unavailable" | "turn-cap" | "unknown-command" | "workspace-setup" | undefined;
3334
+ refusal?: {
3335
+ category?: string | undefined;
3336
+ resumeAt?: string | undefined;
3337
+ } | undefined;
3338
+ privacyRoute?: "own-key" | "runner" | "runtime" | "shared-server" | undefined;
3339
+ engine?: {
3340
+ id: string;
3341
+ running?: string | undefined;
3342
+ floor: string;
3343
+ } | undefined;
3344
+ resetsAt?: number | undefined;
3345
+ account?: string | undefined;
3346
+ autoResume?: "available" | "scheduled" | undefined;
3347
+ nextAt?: number | undefined;
3348
+ held?: {
3349
+ ran: boolean;
3350
+ contextTokens?: number | undefined;
3351
+ handoffTokens?: number | undefined;
3352
+ moving?: string | undefined;
3353
+ handoff?: {
3354
+ suggested: "carry" | "summary" | "trim";
3355
+ basis: "setting" | "size";
3356
+ carry?: {
3357
+ tokens?: number | undefined;
3358
+ } | undefined;
3359
+ trim?: {
3360
+ tokens: number;
3361
+ cleared: number;
3362
+ } | undefined;
3363
+ summary?: {
3364
+ tokens: number;
3365
+ reads?: number | undefined;
3366
+ } | undefined;
3367
+ chosen?: "carry" | "summary" | "trim" | undefined;
3368
+ } | undefined;
3369
+ pressOnly?: boolean | undefined;
3370
+ } | undefined;
3371
+ outage?: {
3372
+ retryAt: number;
3373
+ } | undefined;
3374
+ retries?: {
3375
+ made: number;
3376
+ max: number;
3377
+ } | undefined;
3378
+ memory?: {
3379
+ limitBytes: number;
3380
+ residentBytes: number;
3381
+ swapBytes: number;
3382
+ } | undefined;
3383
+ unattended?: boolean | undefined;
3384
+ } | {
3385
+ kind: "done";
3386
+ } | {
3387
+ window: number;
3388
+ omitted: string[];
3389
+ base: boolean;
3390
+ kind: "context_trim";
3391
+ } | {
3392
+ mode: "carry" | "summary" | "trim";
3393
+ tokens?: number | undefined;
3394
+ from?: number | undefined;
3395
+ cleared?: number | undefined;
3396
+ model?: string | undefined;
3397
+ fellBack?: boolean | undefined;
3398
+ reason?: string | undefined;
3399
+ kind: "handoff";
3400
+ } | {
3401
+ why: "asked" | "budget" | "cleared" | "cold";
3402
+ from?: number | undefined;
3403
+ model?: string | undefined;
3404
+ summarized: boolean;
3405
+ kind: "fresh_start";
3406
+ } | {
3407
+ segment: "account" | "loop" | "model" | "provider";
3408
+ provider: string;
3409
+ model?: string | undefined;
3410
+ account?: string | undefined;
3411
+ loop?: string | undefined;
3412
+ fresh: boolean;
3413
+ kind: "switched";
3414
+ } | {
3415
+ readTokens: number;
3416
+ writtenTokens: number;
3417
+ kept?: {
3418
+ forMs: number;
3419
+ refreshes: number;
3420
+ } | undefined;
3421
+ kind: "prompt_cache";
3422
+ } | {
3423
+ status: "allowed" | "allowed_warning" | "rejected";
3424
+ resetsAt?: number | undefined;
3425
+ rateLimitType?: string | undefined;
3426
+ utilization?: number | undefined;
3427
+ kind: "rate_limit_info";
3428
+ account?: string | undefined;
3429
+ } | {
3430
+ tokens: number;
3431
+ contextWindow: number;
3432
+ cachedAt?: number | undefined;
3433
+ cacheTtlMs?: number | undefined;
3434
+ kind: "context_usage";
3435
+ } | {
3436
+ toolName: string;
3437
+ title?: string | undefined;
3438
+ displayName?: string | undefined;
3439
+ description?: string | undefined;
3440
+ reason?: string | undefined;
3441
+ path?: string | undefined;
3442
+ alwaysLabel?: string | undefined;
3443
+ alwaysAsks?: true | undefined;
3444
+ program?: {
3445
+ text: string;
3446
+ language: "bash" | "javascript";
3447
+ truncated: boolean;
3448
+ spans: {
3449
+ start: number;
3450
+ end: number;
3451
+ }[];
3452
+ } | undefined;
3453
+ child?: {
3454
+ provider: string;
3455
+ model: string;
3456
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
3457
+ account?: string | undefined;
3458
+ effort?: string | undefined;
3459
+ thinking?: boolean | undefined;
3460
+ fast?: boolean | undefined;
3461
+ move: "answer" | "send" | "spawn";
3462
+ child?: string | undefined;
3463
+ task?: string | undefined;
3464
+ message?: string | undefined;
3465
+ on?: string | undefined;
3466
+ proposed?: {
3467
+ provider: string;
3468
+ model: string;
3469
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
3470
+ account?: string | undefined;
3471
+ effort?: string | undefined;
3472
+ thinking?: boolean | undefined;
3473
+ fast?: boolean | undefined;
3474
+ } | undefined;
3475
+ } | undefined;
3476
+ explain?: string | undefined;
3477
+ requestId: string;
3478
+ kind: "permission";
3479
+ } | {
3480
+ outcome: "connected" | "unfinished";
3481
+ id?: string | undefined;
3482
+ kind: "capability_outcome";
3483
+ requestId: string;
3484
+ } | {
3485
+ outcome: "failed" | "paid";
3486
+ amountUsd: string;
3487
+ transaction?: string | undefined;
3488
+ network?: string | undefined;
3489
+ kind: "payment_receipt";
3490
+ requestId: string;
3491
+ } | {
3492
+ outcome: "refused" | "released";
3493
+ approvedBy?: string | undefined;
3494
+ kind: "credential_receipt";
3495
+ requestId: string;
3496
+ }, unknown, void>, import("@orpc/contract").AsyncIteratorClass<{
3497
+ kind: "session";
3498
+ sessionId: string;
3499
+ account?: string | undefined;
3500
+ } | {
3501
+ kind: "worktree";
3502
+ branch: string;
3503
+ base: string;
3504
+ unenforced?: boolean | undefined;
3505
+ sync?: {
3506
+ commits: number;
3507
+ blocked: string[];
3508
+ } | undefined;
3509
+ remote?: string | undefined;
3510
+ } | {
3511
+ kind: "landed";
3512
+ landed: boolean;
3513
+ conflicts?: {
3514
+ repo: string;
3515
+ paths: {
3516
+ path: string;
3517
+ reason: "binary" | "diverged" | "workspace";
3518
+ }[];
3519
+ clean: number;
3520
+ mainBranch?: string | undefined;
3521
+ }[] | undefined;
3522
+ held?: boolean | undefined;
3523
+ deps?: {
3524
+ missing: number;
3525
+ started: string[];
3526
+ deferred: boolean;
3527
+ } | undefined;
3528
+ into?: string | undefined;
3529
+ land?: string | undefined;
3530
+ } | {
3531
+ kind: "preamble";
3532
+ notes: {
3533
+ title: string;
3534
+ text: string;
3535
+ }[];
3536
+ } | {
3537
+ kind: "init";
3538
+ model: string;
3539
+ prompt?: {
3540
+ hash: string;
3541
+ parts: Record<string, string>;
3542
+ } | undefined;
3543
+ } | {
3544
+ kind: "checkpoint";
3545
+ id: string;
3546
+ index?: number | undefined;
3547
+ } | {
3548
+ kind: "steer";
3549
+ text: string;
3550
+ sentAt: number;
3551
+ attachments?: string[] | undefined;
3552
+ voice?: "agent" | "sandbox" | undefined;
3553
+ errand?: "ci-fix" | "ci-fix-nudge" | "land-breakage" | "land-conflict" | "land-fix" | "land-fix-nudge" | "land-held" | "push-fix" | "push-fix-nudge" | "verify-nudge" | undefined;
3554
+ messageId?: string | undefined;
3555
+ } | {
3556
+ kind: "delta";
3557
+ text: string;
3558
+ parentToolUseId?: string | undefined;
3559
+ } | {
3560
+ kind: "text_end";
3561
+ parentToolUseId?: string | undefined;
3562
+ } | {
3563
+ kind: "thinking";
3564
+ text: string;
3565
+ parentToolUseId?: string | undefined;
3566
+ } | {
3567
+ kind: "tool_call";
3568
+ id: string;
3569
+ name: string;
3570
+ category: "delete" | "edit" | "execute" | "fetch" | "move" | "other" | "read" | "search" | "think";
3571
+ status: "completed" | "failed" | "in_progress" | "interrupted" | "pending";
3572
+ target?: string | undefined;
3573
+ locations?: {
3574
+ path: string;
3575
+ line?: number | undefined;
3576
+ }[] | undefined;
3577
+ content?: ({
3578
+ type: "text";
3579
+ text: string;
3580
+ } | {
3581
+ type: "diff";
3582
+ path: string;
3583
+ oldText?: string | undefined;
3584
+ newText: string;
3585
+ truncated?: boolean | undefined;
3586
+ } | {
3587
+ type: "image";
3588
+ path: string;
3589
+ })[] | undefined;
3590
+ input?: string | undefined;
3591
+ description?: string | undefined;
3592
+ server?: string | undefined;
3593
+ parentToolUseId?: string | undefined;
3594
+ } | {
3595
+ kind: "tool_call_update";
3596
+ id: string;
3597
+ status?: "completed" | "failed" | "in_progress" | "interrupted" | "pending" | undefined;
3598
+ content?: ({
3599
+ type: "text";
3600
+ text: string;
3601
+ } | {
3602
+ type: "diff";
3603
+ path: string;
3604
+ oldText?: string | undefined;
3605
+ newText: string;
3606
+ truncated?: boolean | undefined;
3607
+ } | {
3608
+ type: "image";
3609
+ path: string;
3610
+ })[] | undefined;
3611
+ locations?: {
3612
+ path: string;
3613
+ line?: number | undefined;
3614
+ }[] | undefined;
3615
+ exitCode?: number | undefined;
3616
+ input?: string | undefined;
3617
+ } | {
3618
+ kind: "terminal";
3619
+ session: string;
3620
+ } | {
3621
+ kind: "browser";
3622
+ session: string;
3623
+ } | {
3624
+ kind: "subagent";
3625
+ id: string;
3626
+ subagentKind: "linked" | "spawned" | "subagent";
3627
+ agentType?: string | undefined;
3628
+ description?: string | undefined;
3629
+ model?: string | undefined;
3630
+ provider?: string | undefined;
3631
+ background?: boolean | undefined;
3632
+ } | {
3633
+ kind: "subagent_update";
3634
+ id: string;
3635
+ status?: "blocked" | "completed" | "failed" | "killed" | "paused" | "pending" | "running" | undefined;
3636
+ tokens?: number | undefined;
3637
+ toolUses?: number | undefined;
3638
+ lastTool?: string | undefined;
3639
+ summary?: string | undefined;
3640
+ error?: string | undefined;
3641
+ verification?: {
3642
+ state: "failing" | "no-code" | "unproven" | "verified";
3643
+ paths?: string[] | undefined;
3644
+ check?: string | undefined;
3645
+ } | undefined;
3646
+ sdk?: {
3647
+ sessionId: string;
3648
+ agentId: string;
3649
+ } | undefined;
3650
+ } | {
3651
+ kind: "todos";
3652
+ items: {
3653
+ content: string;
3654
+ status: "completed" | "in_progress" | "pending";
3655
+ activeForm?: string | undefined;
3656
+ }[];
3657
+ } | {
3658
+ kind: "commands";
3659
+ items: {
3660
+ name: string;
3661
+ description: string;
3662
+ hint?: string | undefined;
3663
+ builtin?: boolean | undefined;
3664
+ }[];
3665
+ } | {
3666
+ kind: "usage";
3667
+ account?: string | undefined;
3668
+ costUsd?: number | undefined;
3669
+ inputTokens?: number | undefined;
3670
+ outputTokens?: number | undefined;
3671
+ cacheReadTokens?: number | undefined;
3672
+ cacheCreationTokens?: number | undefined;
3673
+ durationMs?: number | undefined;
3674
+ numTurns?: number | undefined;
3675
+ openingCacheReadTokens?: number | undefined;
3676
+ openingCacheCreationTokens?: number | undefined;
3677
+ promptFingerprint?: string | undefined;
3678
+ } | {
3679
+ kind: "fast_mode";
3680
+ state: "cooldown" | "off" | "on";
3681
+ reason?: string | undefined;
3682
+ } | {
3683
+ kind: "provider_retry";
3684
+ attempt: number;
3685
+ maxAttempts?: number | undefined;
3686
+ nextAttemptAt?: number | undefined;
3687
+ status?: number | undefined;
3688
+ } | {
3689
+ kind: "account_usage";
3690
+ account?: string | undefined;
3691
+ windows: {
3692
+ kind: string;
3693
+ label?: string | undefined;
3694
+ utilization: number;
3695
+ resetsAt?: number | undefined;
3696
+ gates: "all" | "none" | {
3697
+ models: string[];
3698
+ };
3699
+ rounded?: boolean | undefined;
3700
+ lapsedAt?: number | undefined;
3701
+ missingSince?: number | undefined;
3702
+ }[];
3703
+ } | {
3704
+ kind: "compact";
3705
+ trigger: string;
3706
+ preTokens?: number | undefined;
3707
+ postTokens?: number | undefined;
3708
+ } | {
3709
+ kind: "install";
3710
+ reach: "main-tree" | "own-copy";
3711
+ projects: string[];
3712
+ } | {
3713
+ kind: "agent_status";
3714
+ key: string;
3715
+ text: string | null;
3716
+ source?: string | undefined;
3717
+ } | {
3718
+ level: "error" | "info" | "warning";
3719
+ source?: string | undefined;
3720
+ sent?: string | undefined;
3721
+ kind: "agent_notice";
3722
+ text: string;
3723
+ } | {
3724
+ requestId: string;
3725
+ text: string;
3726
+ document?: {
3727
+ path: string;
3728
+ title: string;
3729
+ markdown: string;
3730
+ truncated?: boolean | undefined;
3731
+ plan?: boolean | undefined;
3732
+ } | undefined;
3733
+ kind: "plan";
3734
+ } | {
3735
+ requestId: string;
3736
+ questions: {
3737
+ question: string;
3738
+ header: string;
3739
+ multiSelect: boolean;
3740
+ options: {
3741
+ label: string;
3742
+ description: string;
3743
+ preview?: string | undefined;
3744
+ }[];
3745
+ }[];
3746
+ document?: {
3747
+ path: string;
3748
+ title: string;
3749
+ markdown: string;
3750
+ truncated?: boolean | undefined;
3751
+ plan?: boolean | undefined;
3752
+ } | undefined;
3753
+ kind: "question";
3754
+ } | {
3755
+ requestId: string;
3756
+ session: string;
3757
+ account: string;
3758
+ message: string;
3759
+ kind: "browser_help";
3760
+ } | {
3761
+ requestId: string;
3762
+ session: string;
3763
+ message: string;
3764
+ kind: "terminal_help";
3765
+ } | {
3766
+ requestId: string;
3767
+ offer: {
3768
+ entry: string;
3769
+ name: string;
3770
+ why?: string | undefined;
3771
+ };
3772
+ kind: "capability_offer";
3773
+ } | {
3774
+ requestId: string;
3775
+ offer: {
3776
+ url: string;
3777
+ description?: string | undefined;
3778
+ payTo: string;
3779
+ network: string;
3780
+ asset: string;
3781
+ assetName: string;
3782
+ amountUsd: string;
3783
+ spentTodayUsd: string;
3784
+ dailyCapUsd: string;
3785
+ why?: string | undefined;
3786
+ };
3787
+ kind: "payment_offer";
3788
+ } | {
3789
+ requestId: string;
3790
+ offer: {
3791
+ subject: string;
3792
+ kind: "capability" | "secret";
3793
+ lane: "browser" | "code" | "desktop" | "device" | "gateway" | "otp" | "session" | "shell" | "ssh";
3794
+ detail?: string | undefined;
3795
+ why?: string | undefined;
3796
+ approvers: string[];
3797
+ scope: "conversation" | "use";
3798
+ };
3799
+ kind: "credential_offer";
3800
+ } | {
3801
+ kind: "need";
3802
+ need: {
3803
+ id: string;
3804
+ conversationId: string;
3805
+ subject: {
3806
+ kind: "capability";
3807
+ entry: string;
3808
+ name: string;
3809
+ mode: "change" | "connect" | "reconnect" | "remove";
3810
+ instance?: string | undefined;
3811
+ target?: string | undefined;
3812
+ prefill?: Record<string, string> | undefined;
3813
+ changes?: Record<string, string> | undefined;
3814
+ reason?: string | undefined;
3815
+ reported?: boolean | undefined;
3816
+ } | {
3817
+ kind: "secret";
3818
+ name: string;
3819
+ where?: string | undefined;
3820
+ link?: string | undefined;
3821
+ hint?: string | undefined;
3822
+ replace?: boolean | undefined;
3823
+ } | {
3824
+ kind: "grant";
3825
+ subject: "capability" | "folder" | "shelf" | "site";
3826
+ what: string;
3827
+ label: string;
3828
+ persona?: string | undefined;
3829
+ scope?: "conversation" | "persona" | undefined;
3830
+ } | {
3831
+ kind: "release";
3832
+ subject: string;
3833
+ approvers: string[];
3834
+ } | {
3835
+ kind: "environment";
3836
+ tool: string;
3837
+ steps: string;
3838
+ approvedHash?: string | undefined;
3839
+ } | {
3840
+ kind: "automation";
3841
+ automation: {
3842
+ id: string;
3843
+ trigger: {
3844
+ kind: "schedule";
3845
+ cron: string;
3846
+ tz?: (string & {
3847
+ readonly __brand: "Zone";
3848
+ }) | undefined;
3849
+ afterSessions?: number | undefined;
3850
+ } | {
3851
+ kind: "once";
3852
+ at: number;
3853
+ } | {
3854
+ kind: "event";
3855
+ dailyMax?: number | undefined;
3856
+ } | {
3857
+ kind: "listener";
3858
+ provider: string;
3859
+ channelId?: string | undefined;
3860
+ eventType?: string | undefined;
3861
+ mentioned?: boolean | undefined;
3862
+ branch?: string | undefined;
3863
+ allowedOrigins?: string[] | undefined;
3864
+ } | {
3865
+ kind: "workspace";
3866
+ event: "agent.landed" | "deps.broken" | "deps.fixed" | "turn.settled";
3867
+ repo?: string | undefined;
3868
+ };
3869
+ guard?: string | undefined;
3870
+ source?: {
3871
+ kind: "npm";
3872
+ package: string;
3873
+ range?: string | undefined;
3874
+ tag?: string | undefined;
3875
+ } | {
3876
+ kind: "github-release";
3877
+ repo: string;
3878
+ prereleases?: boolean | undefined;
3879
+ } | {
3880
+ kind: "url";
3881
+ url: string;
3882
+ select?: string | undefined;
3883
+ } | undefined;
3884
+ fireOn?: "change" | "pass" | undefined;
3885
+ until?: "first-fire" | undefined;
3886
+ expiresAt?: number | undefined;
3887
+ target?: {
3888
+ kind: "agent";
3889
+ } | {
3890
+ kind: "conversation";
3891
+ conversationId: string;
3892
+ } | {
3893
+ kind: "notify";
3894
+ } | undefined;
3895
+ note?: string | undefined;
3896
+ prompt: string;
3897
+ webchat?: {
3898
+ access?: "google" | "public" | undefined;
3899
+ requireName?: boolean | undefined;
3900
+ antiBot?: "pow" | "turnstile" | undefined;
3901
+ turnstileSiteKey?: string | undefined;
3902
+ turnstileSecret?: string | undefined;
3903
+ googleClientId?: string | undefined;
3904
+ title?: string | undefined;
3905
+ greeting?: string | undefined;
3906
+ accent?: string | undefined;
3907
+ position?: "bottom-left" | "bottom-right" | "top-left" | "top-right" | undefined;
3908
+ dailyMessageMax?: number | undefined;
3909
+ conversationMessageMax?: number | undefined;
3910
+ sessionTtlMinutes?: number | undefined;
3911
+ aiDisclosure?: boolean | undefined;
3912
+ aiDisclosureText?: string | undefined;
3913
+ } | undefined;
3914
+ issues?: {
3915
+ keyFromBrowsers?: boolean | undefined;
3916
+ dailyReportMax?: number | undefined;
3917
+ escalateAfter?: number | undefined;
3918
+ antiBot?: "pow" | undefined;
3919
+ title?: string | undefined;
3920
+ prompt?: string | undefined;
3921
+ thanks?: string | undefined;
3922
+ askEmail?: boolean | undefined;
3923
+ accent?: string | undefined;
3924
+ captureCrashes?: boolean | undefined;
3925
+ } | undefined;
3926
+ allowedTools?: string[] | undefined;
3927
+ models?: {
3928
+ provider: string;
3929
+ model: string;
3930
+ effort?: string | undefined;
3931
+ thinking?: boolean | undefined;
3932
+ fast?: boolean | undefined;
3933
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
3934
+ }[] | undefined;
3935
+ account?: string | undefined;
3936
+ actsAs?: string | undefined;
3937
+ runAs?: string | undefined;
3938
+ senders?: {
3939
+ rules: {
3940
+ label?: string | undefined;
3941
+ ids?: string[] | undefined;
3942
+ groups?: string[] | undefined;
3943
+ actsAs?: string | undefined;
3944
+ runAs?: string | undefined;
3945
+ requireApproval?: boolean | undefined;
3946
+ }[];
3947
+ others: "allow" | "hold" | "ignore";
3948
+ } | undefined;
3949
+ requireApproval?: boolean | undefined;
3950
+ holdForSeconds?: number | undefined;
3951
+ chore?: boolean | undefined;
3952
+ group?: string | undefined;
3953
+ enabled: boolean;
3954
+ };
3955
+ replaces?: boolean | undefined;
3956
+ firstCheck?: {
3957
+ pass: boolean;
3958
+ saw: string;
3959
+ at: number;
3960
+ } | undefined;
3961
+ };
3962
+ title: string;
3963
+ why?: string | undefined;
3964
+ status: "cancelled" | "declined" | "met" | "open" | "working";
3965
+ createdAt: number;
3966
+ updatedAt: number;
3967
+ answeredBy?: string | undefined;
3968
+ byAgent?: boolean | undefined;
3969
+ outcome?: string | undefined;
3970
+ told?: "call" | "queued" | "turn" | undefined;
3971
+ unattended?: boolean | undefined;
3972
+ };
3973
+ } | {
3974
+ kind: "page";
3975
+ page: {
3976
+ id: string;
3977
+ title: string;
3978
+ path: string;
3979
+ height?: number | undefined;
3980
+ measured?: number | undefined;
3981
+ source?: string | undefined;
3982
+ revision?: number | undefined;
3983
+ superseded?: boolean | undefined;
3984
+ app?: {
3985
+ server: string;
3986
+ tool: string;
3987
+ } | undefined;
3988
+ };
3989
+ } | {
3990
+ kind: "review";
3991
+ review: {
3992
+ id: string;
3993
+ source: "claude" | "codex";
3994
+ level?: "high" | "low" | "max" | "medium" | "xhigh" | undefined;
3995
+ findings: {
3996
+ file: string;
3997
+ line?: number | undefined;
3998
+ endLine?: number | undefined;
3999
+ summary: string;
4000
+ title?: string | undefined;
4001
+ scenario?: string | undefined;
4002
+ body?: string | undefined;
4003
+ category?: string | undefined;
4004
+ verdict?: "CONFIRMED" | "PLAUSIBLE" | undefined;
4005
+ priority?: number | undefined;
4006
+ outcome?: "fixed" | "no_change_needed" | "skipped" | undefined;
4007
+ }[];
4008
+ superseded?: boolean | undefined;
4009
+ };
4010
+ } | {
4011
+ requestId: string;
4012
+ page: {
4013
+ id: string;
4014
+ title: string;
4015
+ path: string;
4016
+ height?: number | undefined;
4017
+ measured?: number | undefined;
4018
+ source?: string | undefined;
4019
+ revision?: number | undefined;
4020
+ superseded?: boolean | undefined;
4021
+ app?: {
4022
+ server: string;
4023
+ tool: string;
4024
+ } | undefined;
4025
+ };
4026
+ kind: "page_ask";
4027
+ } | {
4028
+ kind: "page_draft";
4029
+ callId: string;
4030
+ at: number;
4031
+ text: string;
4032
+ title?: string | undefined;
4033
+ done?: boolean | undefined;
4034
+ } | {
4035
+ kind: "file_draft";
4036
+ callId: string;
4037
+ path: string;
4038
+ op: "edit" | "write";
4039
+ at: number;
4040
+ text: string;
4041
+ old?: string | undefined;
4042
+ replaceAll?: boolean | undefined;
4043
+ truncated?: boolean | undefined;
4044
+ done?: boolean | undefined;
4045
+ } | {
4046
+ kind: "resolved";
4047
+ requestId: string;
4048
+ reply?: {
4049
+ kind: "plan";
4050
+ requestId: string;
4051
+ approve: boolean;
4052
+ feedback?: string | undefined;
4053
+ night?: {
4054
+ outcome: "approved" | "picked" | "saved";
4055
+ until: string;
4056
+ } | undefined;
4057
+ } | {
4058
+ kind: "question";
4059
+ requestId: string;
4060
+ answers?: Record<string, string[]> | undefined;
4061
+ attachments?: Record<string, string[]> | undefined;
4062
+ cancelled?: boolean | undefined;
4063
+ night?: {
4064
+ outcome: "approved" | "picked" | "saved";
4065
+ until: string;
4066
+ } | undefined;
4067
+ } | {
4068
+ kind: "permission";
4069
+ requestId: string;
4070
+ decision: "always" | "deny" | "everything" | "once";
4071
+ feedback?: string | undefined;
4072
+ child?: {
4073
+ provider: string;
4074
+ model: string;
4075
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
4076
+ account?: string | undefined;
4077
+ effort?: string | undefined;
4078
+ thinking?: boolean | undefined;
4079
+ fast?: boolean | undefined;
4080
+ } | undefined;
4081
+ } | {
4082
+ kind: "browser_help";
4083
+ requestId: string;
4084
+ helped: boolean;
4085
+ note?: string | undefined;
4086
+ } | {
4087
+ kind: "terminal_help";
4088
+ requestId: string;
4089
+ helped: boolean;
4090
+ note?: string | undefined;
4091
+ } | {
4092
+ kind: "capability_offer";
4093
+ requestId: string;
4094
+ connect: boolean;
4095
+ } | {
4096
+ kind: "payment_offer";
4097
+ requestId: string;
4098
+ approve: boolean;
4099
+ } | {
4100
+ kind: "page_ask";
4101
+ requestId: string;
4102
+ value?: string | undefined;
4103
+ cancelled?: boolean | undefined;
4104
+ } | {
4105
+ kind: "credential_offer";
4106
+ requestId: string;
4107
+ approve: boolean;
4108
+ } | undefined;
4109
+ } | {
4110
+ kind: "mode";
4111
+ mode: "bypassPermissions" | "default" | "plan";
4112
+ } | {
4113
+ kind: "error";
4114
+ message: string;
4115
+ own?: boolean | undefined;
4116
+ code?: "account-not-allowed" | "account-not-entitled" | "acp-auth-required" | "agent-busy" | "agent-domain-refused" | "claude-not-entitled" | "claude-reauth" | "claude-token-refused" | "codex-advisory" | "codex-model-invalid" | "codex-reauth" | "context-overflow" | "context-window-too-small" | "engine-version-floor" | "grok-model-invalid" | "harness-incomplete" | "model-helper-only" | "model-unavailable" | "privacy-instructions" | "privacy-unshielded" | "provider-outage" | "rate_limit" | "safeguard-flagged" | "sandbox-disk-low" | "sandbox-memory-low" | "session-not-found" | "subscription-required" | "tools-unenforced" | "trial-exhausted" | "trial-model-unavailable" | "trial-unavailable" | "turn-cap" | "unknown-command" | "workspace-setup" | undefined;
4117
+ refusal?: {
4118
+ category?: string | undefined;
4119
+ resumeAt?: string | undefined;
4120
+ } | undefined;
4121
+ privacyRoute?: "own-key" | "runner" | "runtime" | "shared-server" | undefined;
4122
+ engine?: {
4123
+ id: string;
4124
+ running?: string | undefined;
4125
+ floor: string;
4126
+ } | undefined;
4127
+ resetsAt?: number | undefined;
4128
+ account?: string | undefined;
4129
+ autoResume?: "available" | "scheduled" | undefined;
4130
+ nextAt?: number | undefined;
4131
+ held?: {
4132
+ ran: boolean;
4133
+ contextTokens?: number | undefined;
4134
+ handoffTokens?: number | undefined;
4135
+ moving?: string | undefined;
4136
+ handoff?: {
4137
+ suggested: "carry" | "summary" | "trim";
4138
+ basis: "setting" | "size";
4139
+ carry?: {
4140
+ tokens?: number | undefined;
4141
+ } | undefined;
4142
+ trim?: {
4143
+ tokens: number;
4144
+ cleared: number;
4145
+ } | undefined;
4146
+ summary?: {
4147
+ tokens: number;
4148
+ reads?: number | undefined;
4149
+ } | undefined;
4150
+ chosen?: "carry" | "summary" | "trim" | undefined;
4151
+ } | undefined;
4152
+ pressOnly?: boolean | undefined;
4153
+ } | undefined;
4154
+ outage?: {
4155
+ retryAt: number;
4156
+ } | undefined;
4157
+ retries?: {
4158
+ made: number;
4159
+ max: number;
4160
+ } | undefined;
4161
+ memory?: {
4162
+ limitBytes: number;
4163
+ residentBytes: number;
4164
+ swapBytes: number;
4165
+ } | undefined;
4166
+ unattended?: boolean | undefined;
4167
+ } | {
4168
+ kind: "done";
4169
+ } | {
4170
+ window: number;
4171
+ omitted: string[];
4172
+ base: boolean;
4173
+ kind: "context_trim";
4174
+ } | {
4175
+ mode: "carry" | "summary" | "trim";
4176
+ tokens?: number | undefined;
4177
+ from?: number | undefined;
4178
+ cleared?: number | undefined;
4179
+ model?: string | undefined;
4180
+ fellBack?: boolean | undefined;
4181
+ reason?: string | undefined;
4182
+ kind: "handoff";
4183
+ } | {
4184
+ why: "asked" | "budget" | "cleared" | "cold";
4185
+ from?: number | undefined;
4186
+ model?: string | undefined;
4187
+ summarized: boolean;
4188
+ kind: "fresh_start";
4189
+ } | {
4190
+ segment: "account" | "loop" | "model" | "provider";
4191
+ provider: string;
4192
+ model?: string | undefined;
4193
+ account?: string | undefined;
4194
+ loop?: string | undefined;
4195
+ fresh: boolean;
4196
+ kind: "switched";
4197
+ } | {
4198
+ readTokens: number;
4199
+ writtenTokens: number;
4200
+ kept?: {
4201
+ forMs: number;
4202
+ refreshes: number;
4203
+ } | undefined;
4204
+ kind: "prompt_cache";
4205
+ } | {
4206
+ status: "allowed" | "allowed_warning" | "rejected";
4207
+ resetsAt?: number | undefined;
4208
+ rateLimitType?: string | undefined;
4209
+ utilization?: number | undefined;
4210
+ kind: "rate_limit_info";
4211
+ account?: string | undefined;
4212
+ } | {
4213
+ tokens: number;
4214
+ contextWindow: number;
4215
+ cachedAt?: number | undefined;
4216
+ cacheTtlMs?: number | undefined;
4217
+ kind: "context_usage";
4218
+ } | {
4219
+ toolName: string;
4220
+ title?: string | undefined;
4221
+ displayName?: string | undefined;
4222
+ description?: string | undefined;
4223
+ reason?: string | undefined;
4224
+ path?: string | undefined;
4225
+ alwaysLabel?: string | undefined;
4226
+ alwaysAsks?: true | undefined;
4227
+ program?: {
4228
+ text: string;
4229
+ language: "bash" | "javascript";
4230
+ truncated: boolean;
4231
+ spans: {
4232
+ start: number;
4233
+ end: number;
4234
+ }[];
4235
+ } | undefined;
4236
+ child?: {
4237
+ provider: string;
4238
+ model: string;
4239
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
4240
+ account?: string | undefined;
4241
+ effort?: string | undefined;
4242
+ thinking?: boolean | undefined;
4243
+ fast?: boolean | undefined;
4244
+ move: "answer" | "send" | "spawn";
4245
+ child?: string | undefined;
4246
+ task?: string | undefined;
4247
+ message?: string | undefined;
4248
+ on?: string | undefined;
4249
+ proposed?: {
4250
+ provider: string;
4251
+ model: string;
4252
+ harness?: "claude-code" | "codex" | "muse" | "native" | "opencode" | "pi" | "vendor" | undefined;
4253
+ account?: string | undefined;
4254
+ effort?: string | undefined;
4255
+ thinking?: boolean | undefined;
4256
+ fast?: boolean | undefined;
4257
+ } | undefined;
4258
+ } | undefined;
4259
+ explain?: string | undefined;
4260
+ requestId: string;
4261
+ kind: "permission";
4262
+ } | {
4263
+ outcome: "connected" | "unfinished";
4264
+ id?: string | undefined;
4265
+ kind: "capability_outcome";
4266
+ requestId: string;
4267
+ } | {
4268
+ outcome: "failed" | "paid";
4269
+ amountUsd: string;
4270
+ transaction?: string | undefined;
4271
+ network?: string | undefined;
4272
+ kind: "payment_receipt";
4273
+ requestId: string;
4274
+ } | {
4275
+ outcome: "refused" | "released";
4276
+ approvedBy?: string | undefined;
4277
+ kind: "credential_receipt";
4278
+ requestId: string;
4279
+ }, unknown, void>> & {
4280
+ [x: symbol]: z.ZodDiscriminatedUnion<[z.ZodObject<{
4281
+ kind: z.ZodLiteral<"session">;
4282
+ sessionId: z.ZodString;
4283
+ account: z.ZodOptional<z.ZodString>;
4284
+ }, z.core.$strip>, z.ZodObject<{
4285
+ kind: z.ZodLiteral<"worktree">;
4286
+ branch: z.ZodString;
4287
+ base: z.ZodString;
4288
+ unenforced: z.ZodOptional<z.ZodBoolean>;
4289
+ sync: z.ZodOptional<z.ZodObject<{
4290
+ commits: z.ZodNumber;
4291
+ blocked: z.ZodArray<z.ZodString>;
4292
+ }, z.core.$strip>>;
4293
+ remote: z.ZodOptional<z.ZodString>;
4294
+ }, z.core.$strip>, z.ZodObject<{
4295
+ kind: z.ZodLiteral<"landed">;
4296
+ landed: z.ZodBoolean;
4297
+ conflicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
4298
+ repo: z.ZodString;
4299
+ paths: z.ZodArray<z.ZodObject<{
4300
+ path: z.ZodString;
4301
+ reason: z.ZodEnum<{
4302
+ binary: "binary";
4303
+ diverged: "diverged";
4304
+ workspace: "workspace";
4305
+ }>;
4306
+ }, z.core.$strip>>;
4307
+ clean: z.ZodNumber;
4308
+ mainBranch: z.ZodOptional<z.ZodString>;
4309
+ }, z.core.$strip>>>;
4310
+ held: z.ZodOptional<z.ZodBoolean>;
4311
+ deps: z.ZodOptional<z.ZodObject<{
4312
+ missing: z.ZodNumber;
4313
+ started: z.ZodArray<z.ZodString>;
4314
+ deferred: z.ZodBoolean;
4315
+ }, z.core.$strip>>;
4316
+ into: z.ZodOptional<z.ZodString>;
4317
+ land: z.ZodOptional<z.ZodString>;
4318
+ }, z.core.$strip>, z.ZodObject<{
4319
+ kind: z.ZodLiteral<"preamble">;
4320
+ notes: z.ZodArray<z.ZodObject<{
4321
+ title: z.ZodString;
4322
+ text: z.ZodString;
4323
+ }, z.core.$strip>>;
4324
+ }, z.core.$strip>, z.ZodObject<{
4325
+ window: z.ZodNumber;
4326
+ omitted: z.ZodArray<z.ZodString>;
4327
+ base: z.ZodBoolean;
4328
+ kind: z.ZodLiteral<"context_trim">;
4329
+ }, z.core.$strip>, z.ZodObject<{
4330
+ mode: z.ZodEnum<{
4331
+ carry: "carry";
4332
+ summary: "summary";
4333
+ trim: "trim";
4334
+ }>;
4335
+ tokens: z.ZodOptional<z.ZodNumber>;
4336
+ from: z.ZodOptional<z.ZodNumber>;
4337
+ cleared: z.ZodOptional<z.ZodNumber>;
4338
+ model: z.ZodOptional<z.ZodString>;
4339
+ fellBack: z.ZodOptional<z.ZodBoolean>;
4340
+ reason: z.ZodOptional<z.ZodString>;
4341
+ kind: z.ZodLiteral<"handoff">;
4342
+ }, z.core.$strip>, z.ZodObject<{
4343
+ why: z.ZodEnum<{
4344
+ asked: "asked";
4345
+ budget: "budget";
4346
+ cleared: "cleared";
4347
+ cold: "cold";
4348
+ }>;
4349
+ from: z.ZodOptional<z.ZodNumber>;
4350
+ model: z.ZodOptional<z.ZodString>;
4351
+ summarized: z.ZodBoolean;
4352
+ kind: z.ZodLiteral<"fresh_start">;
4353
+ }, z.core.$strip>, z.ZodObject<{
4354
+ segment: z.ZodEnum<{
4355
+ account: "account";
4356
+ loop: "loop";
4357
+ model: "model";
4358
+ provider: "provider";
4359
+ }>;
4360
+ provider: z.ZodString;
4361
+ model: z.ZodOptional<z.ZodString>;
4362
+ account: z.ZodOptional<z.ZodString>;
4363
+ loop: z.ZodOptional<z.ZodString>;
4364
+ fresh: z.ZodBoolean;
4365
+ kind: z.ZodLiteral<"switched">;
4366
+ }, z.core.$strip>, z.ZodObject<{
4367
+ kind: z.ZodLiteral<"init">;
4368
+ model: z.ZodString;
4369
+ prompt: z.ZodOptional<z.ZodObject<{
4370
+ hash: z.ZodString;
4371
+ parts: z.ZodRecord<z.ZodString, z.ZodString>;
4372
+ }, z.core.$strip>>;
4373
+ }, z.core.$strip>, z.ZodObject<{
4374
+ kind: z.ZodLiteral<"checkpoint">;
4375
+ id: z.ZodString;
4376
+ index: z.ZodOptional<z.ZodNumber>;
4377
+ }, z.core.$strip>, z.ZodObject<{
4378
+ kind: z.ZodLiteral<"steer">;
4379
+ text: z.ZodString;
4380
+ sentAt: z.ZodNumber;
4381
+ attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
4382
+ voice: z.ZodOptional<z.ZodEnum<{
4383
+ agent: "agent";
4384
+ sandbox: "sandbox";
4385
+ }>>;
4386
+ errand: z.ZodOptional<z.ZodEnum<{
4387
+ "ci-fix": "ci-fix";
4388
+ "ci-fix-nudge": "ci-fix-nudge";
4389
+ "land-breakage": "land-breakage";
4390
+ "land-conflict": "land-conflict";
4391
+ "land-fix": "land-fix";
4392
+ "land-fix-nudge": "land-fix-nudge";
4393
+ "land-held": "land-held";
4394
+ "push-fix": "push-fix";
4395
+ "push-fix-nudge": "push-fix-nudge";
4396
+ "verify-nudge": "verify-nudge";
4397
+ }>>;
4398
+ messageId: z.ZodOptional<z.ZodString>;
4399
+ }, z.core.$strip>, z.ZodObject<{
4400
+ kind: z.ZodLiteral<"delta">;
4401
+ text: z.ZodString;
4402
+ parentToolUseId: z.ZodOptional<z.ZodString>;
4403
+ }, z.core.$strip>, z.ZodObject<{
4404
+ kind: z.ZodLiteral<"text_end">;
4405
+ parentToolUseId: z.ZodOptional<z.ZodString>;
4406
+ }, z.core.$strip>, z.ZodObject<{
4407
+ kind: z.ZodLiteral<"thinking">;
4408
+ text: z.ZodString;
4409
+ parentToolUseId: z.ZodOptional<z.ZodString>;
4410
+ }, z.core.$strip>, z.ZodObject<{
4411
+ kind: z.ZodLiteral<"tool_call">;
4412
+ id: z.ZodString;
4413
+ name: z.ZodString;
4414
+ category: z.ZodEnum<{
4415
+ delete: "delete";
4416
+ edit: "edit";
4417
+ execute: "execute";
4418
+ fetch: "fetch";
4419
+ move: "move";
4420
+ other: "other";
4421
+ read: "read";
4422
+ search: "search";
4423
+ think: "think";
4424
+ }>;
4425
+ status: z.ZodEnum<{
4426
+ completed: "completed";
4427
+ failed: "failed";
4428
+ in_progress: "in_progress";
4429
+ interrupted: "interrupted";
4430
+ pending: "pending";
4431
+ }>;
4432
+ target: z.ZodOptional<z.ZodString>;
4433
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
4434
+ path: z.ZodString;
4435
+ line: z.ZodOptional<z.ZodNumber>;
4436
+ }, z.core.$strip>>>;
4437
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4438
+ type: z.ZodLiteral<"text">;
4439
+ text: z.ZodString;
4440
+ }, z.core.$strip>, z.ZodObject<{
4441
+ type: z.ZodLiteral<"diff">;
4442
+ path: z.ZodString;
4443
+ oldText: z.ZodOptional<z.ZodString>;
4444
+ newText: z.ZodString;
4445
+ truncated: z.ZodOptional<z.ZodBoolean>;
4446
+ }, z.core.$strip>, z.ZodObject<{
4447
+ type: z.ZodLiteral<"image">;
4448
+ path: z.ZodString;
4449
+ }, z.core.$strip>], "type">>>;
4450
+ input: z.ZodOptional<z.ZodString>;
4451
+ description: z.ZodOptional<z.ZodString>;
4452
+ server: z.ZodOptional<z.ZodString>;
4453
+ parentToolUseId: z.ZodOptional<z.ZodString>;
4454
+ }, z.core.$strip>, z.ZodObject<{
4455
+ kind: z.ZodLiteral<"tool_call_update">;
4456
+ id: z.ZodString;
4457
+ status: z.ZodOptional<z.ZodEnum<{
4458
+ completed: "completed";
4459
+ failed: "failed";
4460
+ in_progress: "in_progress";
4461
+ interrupted: "interrupted";
4462
+ pending: "pending";
4463
+ }>>;
4464
+ content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4465
+ type: z.ZodLiteral<"text">;
4466
+ text: z.ZodString;
4467
+ }, z.core.$strip>, z.ZodObject<{
4468
+ type: z.ZodLiteral<"diff">;
4469
+ path: z.ZodString;
4470
+ oldText: z.ZodOptional<z.ZodString>;
4471
+ newText: z.ZodString;
4472
+ truncated: z.ZodOptional<z.ZodBoolean>;
4473
+ }, z.core.$strip>, z.ZodObject<{
4474
+ type: z.ZodLiteral<"image">;
4475
+ path: z.ZodString;
4476
+ }, z.core.$strip>], "type">>>;
4477
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
4478
+ path: z.ZodString;
4479
+ line: z.ZodOptional<z.ZodNumber>;
4480
+ }, z.core.$strip>>>;
4481
+ exitCode: z.ZodOptional<z.ZodNumber>;
4482
+ input: z.ZodOptional<z.ZodString>;
4483
+ }, z.core.$strip>, z.ZodObject<{
4484
+ kind: z.ZodLiteral<"terminal">;
4485
+ session: z.ZodString;
4486
+ }, z.core.$strip>, z.ZodObject<{
4487
+ kind: z.ZodLiteral<"browser">;
4488
+ session: z.ZodString;
4489
+ }, z.core.$strip>, z.ZodObject<{
4490
+ kind: z.ZodLiteral<"subagent">;
4491
+ id: z.ZodString;
4492
+ subagentKind: z.ZodEnum<{
4493
+ linked: "linked";
4494
+ spawned: "spawned";
4495
+ subagent: "subagent";
4496
+ }>;
4497
+ agentType: z.ZodOptional<z.ZodString>;
4498
+ description: z.ZodOptional<z.ZodString>;
4499
+ model: z.ZodOptional<z.ZodString>;
4500
+ provider: z.ZodOptional<z.ZodString>;
4501
+ background: z.ZodOptional<z.ZodBoolean>;
4502
+ }, z.core.$strip>, z.ZodObject<{
4503
+ kind: z.ZodLiteral<"subagent_update">;
4504
+ id: z.ZodString;
4505
+ status: z.ZodOptional<z.ZodEnum<{
4506
+ blocked: "blocked";
4507
+ completed: "completed";
4508
+ failed: "failed";
4509
+ killed: "killed";
4510
+ paused: "paused";
4511
+ pending: "pending";
4512
+ running: "running";
4513
+ }>>;
4514
+ tokens: z.ZodOptional<z.ZodNumber>;
4515
+ toolUses: z.ZodOptional<z.ZodNumber>;
4516
+ lastTool: z.ZodOptional<z.ZodString>;
4517
+ summary: z.ZodOptional<z.ZodString>;
4518
+ error: z.ZodOptional<z.ZodString>;
4519
+ verification: z.ZodOptional<z.ZodObject<{
4520
+ state: z.ZodEnum<{
4521
+ failing: "failing";
4522
+ "no-code": "no-code";
4523
+ unproven: "unproven";
4524
+ verified: "verified";
4525
+ }>;
4526
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
4527
+ check: z.ZodOptional<z.ZodString>;
4528
+ }, z.core.$strip>>;
4529
+ sdk: z.ZodOptional<z.ZodObject<{
4530
+ sessionId: z.ZodString;
4531
+ agentId: z.ZodString;
4532
+ }, z.core.$strip>>;
4533
+ }, z.core.$strip>, z.ZodObject<{
4534
+ kind: z.ZodLiteral<"todos">;
4535
+ items: z.ZodArray<z.ZodObject<{
4536
+ content: z.ZodString;
4537
+ status: z.ZodEnum<{
4538
+ completed: "completed";
4539
+ in_progress: "in_progress";
4540
+ pending: "pending";
4541
+ }>;
4542
+ activeForm: z.ZodOptional<z.ZodString>;
4543
+ }, z.core.$strip>>;
4544
+ }, z.core.$strip>, z.ZodObject<{
4545
+ kind: z.ZodLiteral<"commands">;
4546
+ items: z.ZodArray<z.ZodObject<{
4547
+ name: z.ZodString;
4548
+ description: z.ZodString;
4549
+ hint: z.ZodOptional<z.ZodString>;
4550
+ builtin: z.ZodOptional<z.ZodBoolean>;
4551
+ }, z.core.$strip>>;
4552
+ }, z.core.$strip>, z.ZodObject<{
4553
+ kind: z.ZodLiteral<"usage">;
4554
+ account: z.ZodOptional<z.ZodString>;
4555
+ costUsd: z.ZodOptional<z.ZodNumber>;
4556
+ inputTokens: z.ZodOptional<z.ZodNumber>;
4557
+ outputTokens: z.ZodOptional<z.ZodNumber>;
4558
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
4559
+ cacheCreationTokens: z.ZodOptional<z.ZodNumber>;
4560
+ durationMs: z.ZodOptional<z.ZodNumber>;
4561
+ numTurns: z.ZodOptional<z.ZodNumber>;
4562
+ openingCacheReadTokens: z.ZodOptional<z.ZodNumber>;
4563
+ openingCacheCreationTokens: z.ZodOptional<z.ZodNumber>;
4564
+ promptFingerprint: z.ZodOptional<z.ZodString>;
4565
+ }, z.core.$strip>, z.ZodObject<{
4566
+ readTokens: z.ZodNumber;
4567
+ writtenTokens: z.ZodNumber;
4568
+ kept: z.ZodOptional<z.ZodObject<{
4569
+ forMs: z.ZodNumber;
4570
+ refreshes: z.ZodNumber;
4571
+ }, z.core.$strip>>;
4572
+ kind: z.ZodLiteral<"prompt_cache">;
4573
+ }, z.core.$strip>, z.ZodObject<{
4574
+ status: z.ZodEnum<{
4575
+ allowed: "allowed";
4576
+ allowed_warning: "allowed_warning";
4577
+ rejected: "rejected";
4578
+ }>;
4579
+ resetsAt: z.ZodOptional<z.ZodNumber>;
4580
+ rateLimitType: z.ZodOptional<z.ZodString>;
4581
+ utilization: z.ZodOptional<z.ZodNumber>;
4582
+ kind: z.ZodLiteral<"rate_limit_info">;
4583
+ account: z.ZodOptional<z.ZodString>;
4584
+ }, z.core.$strip>, z.ZodObject<{
4585
+ kind: z.ZodLiteral<"fast_mode">;
4586
+ state: z.ZodEnum<{
4587
+ cooldown: "cooldown";
4588
+ off: "off";
4589
+ on: "on";
4590
+ }>;
4591
+ reason: z.ZodOptional<z.ZodString>;
4592
+ }, z.core.$strip>, z.ZodObject<{
4593
+ kind: z.ZodLiteral<"provider_retry">;
4594
+ attempt: z.ZodNumber;
4595
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
4596
+ nextAttemptAt: z.ZodOptional<z.ZodNumber>;
4597
+ status: z.ZodOptional<z.ZodNumber>;
4598
+ }, z.core.$strip>, z.ZodObject<{
4599
+ kind: z.ZodLiteral<"account_usage">;
4600
+ account: z.ZodOptional<z.ZodString>;
4601
+ windows: z.ZodArray<z.ZodObject<{
4602
+ kind: z.ZodString;
4603
+ label: z.ZodOptional<z.ZodString>;
4604
+ utilization: z.ZodNumber;
4605
+ resetsAt: z.ZodOptional<z.ZodNumber>;
4606
+ gates: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodObject<{
4607
+ models: z.ZodArray<z.ZodString>;
4608
+ }, z.core.$strip>]>;
4609
+ rounded: z.ZodOptional<z.ZodBoolean>;
4610
+ lapsedAt: z.ZodOptional<z.ZodNumber>;
4611
+ missingSince: z.ZodOptional<z.ZodNumber>;
4612
+ }, z.core.$strip>>;
4613
+ }, z.core.$strip>, z.ZodObject<{
4614
+ tokens: z.ZodNumber;
4615
+ contextWindow: z.ZodNumber;
4616
+ cachedAt: z.ZodOptional<z.ZodNumber>;
4617
+ cacheTtlMs: z.ZodOptional<z.ZodNumber>;
4618
+ kind: z.ZodLiteral<"context_usage">;
4619
+ }, z.core.$strip>, z.ZodObject<{
4620
+ kind: z.ZodLiteral<"compact">;
4621
+ trigger: z.ZodString;
4622
+ preTokens: z.ZodOptional<z.ZodNumber>;
4623
+ postTokens: z.ZodOptional<z.ZodNumber>;
4624
+ }, z.core.$strip>, z.ZodObject<{
4625
+ kind: z.ZodLiteral<"install">;
4626
+ reach: z.ZodEnum<{
4627
+ "main-tree": "main-tree";
4628
+ "own-copy": "own-copy";
4629
+ }>;
4630
+ projects: z.ZodArray<z.ZodString>;
4631
+ }, z.core.$strip>, z.ZodObject<{
4632
+ kind: z.ZodLiteral<"agent_status">;
4633
+ key: z.ZodString;
4634
+ text: z.ZodNullable<z.ZodString>;
4635
+ source: z.ZodOptional<z.ZodString>;
4636
+ }, z.core.$strip>, z.ZodObject<{
4637
+ level: z.ZodEnum<{
4638
+ error: "error";
4639
+ info: "info";
4640
+ warning: "warning";
4641
+ }>;
4642
+ source: z.ZodOptional<z.ZodString>;
4643
+ sent: z.ZodOptional<z.ZodString>;
4644
+ kind: z.ZodLiteral<"agent_notice">;
4645
+ text: z.ZodString;
4646
+ }, z.core.$strip>, z.ZodObject<{
4647
+ requestId: z.ZodString;
4648
+ text: z.ZodString;
4649
+ document: z.ZodOptional<z.ZodObject<{
4650
+ path: z.ZodString;
4651
+ title: z.ZodString;
4652
+ markdown: z.ZodString;
4653
+ truncated: z.ZodOptional<z.ZodBoolean>;
4654
+ plan: z.ZodOptional<z.ZodBoolean>;
4655
+ }, z.core.$strip>>;
4656
+ kind: z.ZodLiteral<"plan">;
4657
+ }, z.core.$strip>, z.ZodObject<{
4658
+ requestId: z.ZodString;
4659
+ questions: z.ZodArray<z.ZodObject<{
4660
+ question: z.ZodString;
4661
+ header: z.ZodString;
4662
+ multiSelect: z.ZodBoolean;
4663
+ options: z.ZodArray<z.ZodObject<{
4664
+ label: z.ZodString;
4665
+ description: z.ZodString;
4666
+ preview: z.ZodOptional<z.ZodString>;
4667
+ }, z.core.$strip>>;
4668
+ }, z.core.$strip>>;
4669
+ document: z.ZodOptional<z.ZodObject<{
4670
+ path: z.ZodString;
4671
+ title: z.ZodString;
4672
+ markdown: z.ZodString;
4673
+ truncated: z.ZodOptional<z.ZodBoolean>;
4674
+ plan: z.ZodOptional<z.ZodBoolean>;
4675
+ }, z.core.$strip>>;
4676
+ kind: z.ZodLiteral<"question">;
4677
+ }, z.core.$strip>, z.ZodObject<{
4678
+ toolName: z.ZodString;
4679
+ title: z.ZodOptional<z.ZodString>;
4680
+ displayName: z.ZodOptional<z.ZodString>;
4681
+ description: z.ZodOptional<z.ZodString>;
4682
+ reason: z.ZodOptional<z.ZodString>;
4683
+ path: z.ZodOptional<z.ZodString>;
4684
+ alwaysLabel: z.ZodOptional<z.ZodString>;
4685
+ alwaysAsks: z.ZodOptional<z.ZodLiteral<true>>;
4686
+ program: z.ZodOptional<z.ZodObject<{
4687
+ text: z.ZodString;
4688
+ language: z.ZodEnum<{
4689
+ bash: "bash";
4690
+ javascript: "javascript";
4691
+ }>;
4692
+ truncated: z.ZodBoolean;
4693
+ spans: z.ZodArray<z.ZodObject<{
4694
+ start: z.ZodNumber;
4695
+ end: z.ZodNumber;
4696
+ }, z.core.$strip>>;
4697
+ }, z.core.$strip>>;
4698
+ child: z.ZodOptional<z.ZodObject<{
4699
+ provider: z.ZodString;
4700
+ model: z.ZodString;
4701
+ harness: z.ZodOptional<z.ZodEnum<{
4702
+ "claude-code": "claude-code";
4703
+ codex: "codex";
4704
+ muse: "muse";
4705
+ native: "native";
4706
+ opencode: "opencode";
4707
+ pi: "pi";
4708
+ vendor: "vendor";
4709
+ }>>;
4710
+ account: z.ZodOptional<z.ZodString>;
4711
+ effort: z.ZodOptional<z.ZodString>;
4712
+ thinking: z.ZodOptional<z.ZodBoolean>;
4713
+ fast: z.ZodOptional<z.ZodBoolean>;
4714
+ move: z.ZodEnum<{
4715
+ answer: "answer";
4716
+ send: "send";
4717
+ spawn: "spawn";
4718
+ }>;
4719
+ child: z.ZodOptional<z.ZodString>;
4720
+ task: z.ZodOptional<z.ZodString>;
4721
+ message: z.ZodOptional<z.ZodString>;
4722
+ on: z.ZodOptional<z.ZodString>;
4723
+ proposed: z.ZodOptional<z.ZodObject<{
4724
+ provider: z.ZodString;
4725
+ model: z.ZodString;
4726
+ harness: z.ZodOptional<z.ZodEnum<{
4727
+ "claude-code": "claude-code";
4728
+ codex: "codex";
4729
+ muse: "muse";
4730
+ native: "native";
4731
+ opencode: "opencode";
4732
+ pi: "pi";
4733
+ vendor: "vendor";
4734
+ }>>;
4735
+ account: z.ZodOptional<z.ZodString>;
4736
+ effort: z.ZodOptional<z.ZodString>;
4737
+ thinking: z.ZodOptional<z.ZodBoolean>;
4738
+ fast: z.ZodOptional<z.ZodBoolean>;
4739
+ }, z.core.$strip>>;
4740
+ }, z.core.$strip>>;
4741
+ explain: z.ZodOptional<z.ZodString>;
4742
+ requestId: z.ZodString;
4743
+ kind: z.ZodLiteral<"permission">;
4744
+ }, z.core.$strip>, z.ZodObject<{
4745
+ requestId: z.ZodString;
4746
+ session: z.ZodString;
4747
+ account: z.ZodString;
4748
+ message: z.ZodString;
4749
+ kind: z.ZodLiteral<"browser_help">;
4750
+ }, z.core.$strip>, z.ZodObject<{
4751
+ requestId: z.ZodString;
4752
+ session: z.ZodString;
4753
+ message: z.ZodString;
4754
+ kind: z.ZodLiteral<"terminal_help">;
4755
+ }, z.core.$strip>, z.ZodObject<{
4756
+ requestId: z.ZodString;
4757
+ offer: z.ZodObject<{
4758
+ entry: z.ZodString;
4759
+ name: z.ZodString;
4760
+ why: z.ZodOptional<z.ZodString>;
4761
+ }, z.core.$strip>;
4762
+ kind: z.ZodLiteral<"capability_offer">;
4763
+ }, z.core.$strip>, z.ZodObject<{
4764
+ outcome: z.ZodEnum<{
4765
+ connected: "connected";
4766
+ unfinished: "unfinished";
4767
+ }>;
4768
+ id: z.ZodOptional<z.ZodString>;
4769
+ kind: z.ZodLiteral<"capability_outcome">;
4770
+ requestId: z.ZodString;
4771
+ }, z.core.$strip>, z.ZodObject<{
4772
+ requestId: z.ZodString;
4773
+ offer: z.ZodObject<{
4774
+ url: z.ZodString;
4775
+ description: z.ZodOptional<z.ZodString>;
4776
+ payTo: z.ZodString;
4777
+ network: z.ZodString;
4778
+ asset: z.ZodString;
4779
+ assetName: z.ZodString;
4780
+ amountUsd: z.ZodString;
4781
+ spentTodayUsd: z.ZodString;
4782
+ dailyCapUsd: z.ZodString;
4783
+ why: z.ZodOptional<z.ZodString>;
4784
+ }, z.core.$strip>;
4785
+ kind: z.ZodLiteral<"payment_offer">;
4786
+ }, z.core.$strip>, z.ZodObject<{
4787
+ outcome: z.ZodEnum<{
4788
+ failed: "failed";
4789
+ paid: "paid";
4790
+ }>;
4791
+ amountUsd: z.ZodString;
4792
+ transaction: z.ZodOptional<z.ZodString>;
4793
+ network: z.ZodOptional<z.ZodString>;
4794
+ kind: z.ZodLiteral<"payment_receipt">;
4795
+ requestId: z.ZodString;
4796
+ }, z.core.$strip>, z.ZodObject<{
4797
+ requestId: z.ZodString;
4798
+ offer: z.ZodObject<{
4799
+ subject: z.ZodString;
4800
+ kind: z.ZodEnum<{
4801
+ capability: "capability";
4802
+ secret: "secret";
4803
+ }>;
4804
+ lane: z.ZodEnum<{
4805
+ browser: "browser";
4806
+ code: "code";
4807
+ desktop: "desktop";
4808
+ device: "device";
4809
+ gateway: "gateway";
4810
+ otp: "otp";
4811
+ session: "session";
4812
+ shell: "shell";
4813
+ ssh: "ssh";
4814
+ }>;
4815
+ detail: z.ZodOptional<z.ZodString>;
4816
+ why: z.ZodOptional<z.ZodString>;
4817
+ approvers: z.ZodArray<z.ZodString>;
4818
+ scope: z.ZodEnum<{
4819
+ conversation: "conversation";
4820
+ use: "use";
4821
+ }>;
4822
+ }, z.core.$strip>;
4823
+ kind: z.ZodLiteral<"credential_offer">;
4824
+ }, z.core.$strip>, z.ZodObject<{
4825
+ outcome: z.ZodEnum<{
4826
+ refused: "refused";
4827
+ released: "released";
4828
+ }>;
4829
+ approvedBy: z.ZodOptional<z.ZodString>;
4830
+ kind: z.ZodLiteral<"credential_receipt">;
4831
+ requestId: z.ZodString;
4832
+ }, z.core.$strip>, z.ZodObject<{
4833
+ kind: z.ZodLiteral<"need">;
4834
+ need: z.ZodObject<{
4835
+ id: z.ZodString;
4836
+ conversationId: z.ZodString;
4837
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
4838
+ kind: z.ZodLiteral<"capability">;
4839
+ entry: z.ZodString;
4840
+ name: z.ZodString;
4841
+ mode: z.ZodEnum<{
4842
+ change: "change";
4843
+ connect: "connect";
4844
+ reconnect: "reconnect";
4845
+ remove: "remove";
4846
+ }>;
4847
+ instance: z.ZodOptional<z.ZodString>;
4848
+ target: z.ZodOptional<z.ZodString>;
4849
+ prefill: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4850
+ changes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4851
+ reason: z.ZodOptional<z.ZodString>;
4852
+ reported: z.ZodOptional<z.ZodBoolean>;
4853
+ }, z.core.$strip>, z.ZodObject<{
4854
+ kind: z.ZodLiteral<"secret">;
4855
+ name: z.ZodString;
4856
+ where: z.ZodOptional<z.ZodString>;
4857
+ link: z.ZodOptional<z.ZodString>;
4858
+ hint: z.ZodOptional<z.ZodString>;
4859
+ replace: z.ZodOptional<z.ZodBoolean>;
4860
+ }, z.core.$strip>, z.ZodObject<{
4861
+ kind: z.ZodLiteral<"grant">;
4862
+ subject: z.ZodEnum<{
4863
+ capability: "capability";
4864
+ folder: "folder";
4865
+ shelf: "shelf";
4866
+ site: "site";
4867
+ }>;
4868
+ what: z.ZodString;
4869
+ label: z.ZodString;
4870
+ persona: z.ZodOptional<z.ZodString>;
4871
+ scope: z.ZodOptional<z.ZodEnum<{
4872
+ conversation: "conversation";
4873
+ persona: "persona";
4874
+ }>>;
4875
+ }, z.core.$strip>, z.ZodObject<{
4876
+ kind: z.ZodLiteral<"release">;
4877
+ subject: z.ZodString;
4878
+ approvers: z.ZodArray<z.ZodString>;
4879
+ }, z.core.$strip>, z.ZodObject<{
4880
+ kind: z.ZodLiteral<"environment">;
4881
+ tool: z.ZodString;
4882
+ steps: z.ZodString;
4883
+ approvedHash: z.ZodOptional<z.ZodString>;
4884
+ }, z.core.$strip>, z.ZodObject<{
4885
+ kind: z.ZodLiteral<"automation">;
4886
+ automation: z.ZodObject<{
4887
+ id: z.ZodString;
4888
+ trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
4889
+ kind: z.ZodLiteral<"schedule">;
4890
+ cron: z.ZodString;
4891
+ tz: z.ZodOptional<z.ZodString & z.ZodType<import("../time/zone.js").Zone, string, z.core.$ZodTypeInternals<import("../time/zone.js").Zone, string>>>;
4892
+ afterSessions: z.ZodOptional<z.ZodNumber>;
4893
+ }, z.core.$strip>, z.ZodObject<{
4894
+ kind: z.ZodLiteral<"once">;
4895
+ at: z.ZodNumber;
4896
+ }, z.core.$strip>, z.ZodObject<{
4897
+ kind: z.ZodLiteral<"event">;
4898
+ dailyMax: z.ZodOptional<z.ZodNumber>;
4899
+ }, z.core.$strip>, z.ZodObject<{
4900
+ kind: z.ZodLiteral<"listener">;
4901
+ provider: z.ZodString;
4902
+ channelId: z.ZodOptional<z.ZodString>;
4903
+ eventType: z.ZodOptional<z.ZodString>;
4904
+ mentioned: z.ZodOptional<z.ZodBoolean>;
4905
+ branch: z.ZodOptional<z.ZodString>;
4906
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
4907
+ }, z.core.$strip>, z.ZodObject<{
4908
+ kind: z.ZodLiteral<"workspace">;
4909
+ event: z.ZodEnum<{
4910
+ "agent.landed": "agent.landed";
4911
+ "deps.broken": "deps.broken";
4912
+ "deps.fixed": "deps.fixed";
4913
+ "turn.settled": "turn.settled";
4914
+ }>;
4915
+ repo: z.ZodOptional<z.ZodString>;
4916
+ }, z.core.$strip>], "kind">;
4917
+ guard: z.ZodOptional<z.ZodString>;
4918
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
4919
+ kind: z.ZodLiteral<"npm">;
4920
+ package: z.ZodString;
4921
+ range: z.ZodOptional<z.ZodString>;
4922
+ tag: z.ZodOptional<z.ZodString>;
4923
+ }, z.core.$strip>, z.ZodObject<{
4924
+ kind: z.ZodLiteral<"github-release">;
4925
+ repo: z.ZodString;
4926
+ prereleases: z.ZodOptional<z.ZodBoolean>;
4927
+ }, z.core.$strip>, z.ZodObject<{
4928
+ kind: z.ZodLiteral<"url">;
4929
+ url: z.ZodString;
4930
+ select: z.ZodOptional<z.ZodString>;
4931
+ }, z.core.$strip>], "kind">>;
4932
+ fireOn: z.ZodOptional<z.ZodEnum<{
4933
+ change: "change";
4934
+ pass: "pass";
4935
+ }>>;
4936
+ until: z.ZodOptional<z.ZodEnum<{
4937
+ "first-fire": "first-fire";
4938
+ }>>;
4939
+ expiresAt: z.ZodOptional<z.ZodNumber>;
4940
+ target: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
4941
+ kind: z.ZodLiteral<"agent">;
4942
+ }, z.core.$strip>, z.ZodObject<{
4943
+ kind: z.ZodLiteral<"conversation">;
4944
+ conversationId: z.ZodString;
4945
+ }, z.core.$strip>, z.ZodObject<{
4946
+ kind: z.ZodLiteral<"notify">;
4947
+ }, z.core.$strip>], "kind">>;
4948
+ note: z.ZodOptional<z.ZodString>;
4949
+ prompt: z.ZodString;
4950
+ webchat: z.ZodOptional<z.ZodObject<{
4951
+ access: z.ZodOptional<z.ZodEnum<{
4952
+ google: "google";
4953
+ public: "public";
4954
+ }>>;
4955
+ requireName: z.ZodOptional<z.ZodBoolean>;
4956
+ antiBot: z.ZodOptional<z.ZodEnum<{
4957
+ pow: "pow";
4958
+ turnstile: "turnstile";
4959
+ }>>;
4960
+ turnstileSiteKey: z.ZodOptional<z.ZodString>;
4961
+ turnstileSecret: z.ZodOptional<z.ZodString>;
4962
+ googleClientId: z.ZodOptional<z.ZodString>;
4963
+ title: z.ZodOptional<z.ZodString>;
4964
+ greeting: z.ZodOptional<z.ZodString>;
4965
+ accent: z.ZodOptional<z.ZodString>;
4966
+ position: z.ZodOptional<z.ZodEnum<{
4967
+ "bottom-left": "bottom-left";
4968
+ "bottom-right": "bottom-right";
4969
+ "top-left": "top-left";
4970
+ "top-right": "top-right";
4971
+ }>>;
4972
+ dailyMessageMax: z.ZodOptional<z.ZodNumber>;
4973
+ conversationMessageMax: z.ZodOptional<z.ZodNumber>;
4974
+ sessionTtlMinutes: z.ZodOptional<z.ZodNumber>;
4975
+ aiDisclosure: z.ZodOptional<z.ZodBoolean>;
4976
+ aiDisclosureText: z.ZodOptional<z.ZodString>;
4977
+ }, z.core.$strip>>;
4978
+ issues: z.ZodOptional<z.ZodObject<{
4979
+ keyFromBrowsers: z.ZodOptional<z.ZodBoolean>;
4980
+ dailyReportMax: z.ZodOptional<z.ZodNumber>;
4981
+ escalateAfter: z.ZodOptional<z.ZodNumber>;
4982
+ antiBot: z.ZodOptional<z.ZodEnum<{
4983
+ pow: "pow";
4984
+ }>>;
4985
+ title: z.ZodOptional<z.ZodString>;
4986
+ prompt: z.ZodOptional<z.ZodString>;
4987
+ thanks: z.ZodOptional<z.ZodString>;
4988
+ askEmail: z.ZodOptional<z.ZodBoolean>;
4989
+ accent: z.ZodOptional<z.ZodString>;
4990
+ captureCrashes: z.ZodOptional<z.ZodBoolean>;
4991
+ }, z.core.$strip>>;
4992
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
4993
+ models: z.ZodOptional<z.ZodArray<z.ZodObject<{
4994
+ provider: z.ZodString;
4995
+ model: z.ZodString;
4996
+ effort: z.ZodOptional<z.ZodString>;
4997
+ thinking: z.ZodOptional<z.ZodBoolean>;
4998
+ fast: z.ZodOptional<z.ZodBoolean>;
4999
+ harness: z.ZodOptional<z.ZodEnum<{
5000
+ "claude-code": "claude-code";
5001
+ codex: "codex";
5002
+ muse: "muse";
5003
+ native: "native";
5004
+ opencode: "opencode";
5005
+ pi: "pi";
5006
+ vendor: "vendor";
5007
+ }>>;
5008
+ }, z.core.$strip>>>;
5009
+ account: z.ZodOptional<z.ZodString>;
5010
+ actsAs: z.ZodOptional<z.ZodString>;
5011
+ runAs: z.ZodOptional<z.ZodString>;
5012
+ senders: z.ZodOptional<z.ZodObject<{
5013
+ rules: z.ZodArray<z.ZodObject<{
5014
+ label: z.ZodOptional<z.ZodString>;
5015
+ ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
5016
+ groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
5017
+ actsAs: z.ZodOptional<z.ZodString>;
5018
+ runAs: z.ZodOptional<z.ZodString>;
5019
+ requireApproval: z.ZodOptional<z.ZodBoolean>;
5020
+ }, z.core.$strip>>;
5021
+ others: z.ZodEnum<{
5022
+ allow: "allow";
5023
+ hold: "hold";
5024
+ ignore: "ignore";
5025
+ }>;
5026
+ }, z.core.$strip>>;
5027
+ requireApproval: z.ZodOptional<z.ZodBoolean>;
5028
+ holdForSeconds: z.ZodOptional<z.ZodNumber>;
5029
+ chore: z.ZodOptional<z.ZodBoolean>;
5030
+ group: z.ZodOptional<z.ZodString>;
5031
+ enabled: z.ZodBoolean;
5032
+ }, z.core.$strip>;
5033
+ replaces: z.ZodOptional<z.ZodBoolean>;
5034
+ firstCheck: z.ZodOptional<z.ZodObject<{
5035
+ pass: z.ZodBoolean;
5036
+ saw: z.ZodString;
5037
+ at: z.ZodNumber;
5038
+ }, z.core.$strip>>;
5039
+ }, z.core.$strip>], "kind">;
5040
+ title: z.ZodString;
5041
+ why: z.ZodOptional<z.ZodString>;
5042
+ status: z.ZodEnum<{
5043
+ cancelled: "cancelled";
5044
+ declined: "declined";
5045
+ met: "met";
5046
+ open: "open";
5047
+ working: "working";
5048
+ }>;
5049
+ createdAt: z.ZodNumber;
5050
+ updatedAt: z.ZodNumber;
5051
+ answeredBy: z.ZodOptional<z.ZodString>;
5052
+ byAgent: z.ZodOptional<z.ZodBoolean>;
5053
+ outcome: z.ZodOptional<z.ZodString>;
5054
+ told: z.ZodOptional<z.ZodEnum<{
5055
+ call: "call";
5056
+ queued: "queued";
5057
+ turn: "turn";
5058
+ }>>;
5059
+ unattended: z.ZodOptional<z.ZodBoolean>;
5060
+ }, z.core.$strip>;
5061
+ }, z.core.$strip>, z.ZodObject<{
5062
+ kind: z.ZodLiteral<"page">;
5063
+ page: z.ZodObject<{
5064
+ id: z.ZodString;
5065
+ title: z.ZodString;
5066
+ path: z.ZodString;
5067
+ height: z.ZodOptional<z.ZodNumber>;
5068
+ measured: z.ZodOptional<z.ZodNumber>;
5069
+ source: z.ZodOptional<z.ZodString>;
5070
+ revision: z.ZodOptional<z.ZodNumber>;
5071
+ superseded: z.ZodOptional<z.ZodBoolean>;
5072
+ app: z.ZodOptional<z.ZodObject<{
5073
+ server: z.ZodString;
5074
+ tool: z.ZodString;
5075
+ }, z.core.$strip>>;
5076
+ }, z.core.$strip>;
5077
+ }, z.core.$strip>, z.ZodObject<{
5078
+ kind: z.ZodLiteral<"review">;
5079
+ review: z.ZodObject<{
5080
+ id: z.ZodString;
5081
+ source: z.ZodEnum<{
5082
+ claude: "claude";
5083
+ codex: "codex";
5084
+ }>;
5085
+ level: z.ZodOptional<z.ZodEnum<{
5086
+ high: "high";
5087
+ low: "low";
5088
+ max: "max";
5089
+ medium: "medium";
5090
+ xhigh: "xhigh";
5091
+ }>>;
5092
+ findings: z.ZodArray<z.ZodObject<{
5093
+ file: z.ZodString;
5094
+ line: z.ZodOptional<z.ZodNumber>;
5095
+ endLine: z.ZodOptional<z.ZodNumber>;
5096
+ summary: z.ZodString;
5097
+ title: z.ZodOptional<z.ZodString>;
5098
+ scenario: z.ZodOptional<z.ZodString>;
5099
+ body: z.ZodOptional<z.ZodString>;
5100
+ category: z.ZodOptional<z.ZodString>;
5101
+ verdict: z.ZodOptional<z.ZodEnum<{
5102
+ CONFIRMED: "CONFIRMED";
5103
+ PLAUSIBLE: "PLAUSIBLE";
5104
+ }>>;
5105
+ priority: z.ZodOptional<z.ZodNumber>;
5106
+ outcome: z.ZodOptional<z.ZodEnum<{
5107
+ fixed: "fixed";
5108
+ no_change_needed: "no_change_needed";
5109
+ skipped: "skipped";
5110
+ }>>;
5111
+ }, z.core.$strip>>;
5112
+ superseded: z.ZodOptional<z.ZodBoolean>;
5113
+ }, z.core.$strip>;
5114
+ }, z.core.$strip>, z.ZodObject<{
5115
+ requestId: z.ZodString;
5116
+ page: z.ZodObject<{
5117
+ id: z.ZodString;
5118
+ title: z.ZodString;
5119
+ path: z.ZodString;
5120
+ height: z.ZodOptional<z.ZodNumber>;
5121
+ measured: z.ZodOptional<z.ZodNumber>;
5122
+ source: z.ZodOptional<z.ZodString>;
5123
+ revision: z.ZodOptional<z.ZodNumber>;
5124
+ superseded: z.ZodOptional<z.ZodBoolean>;
5125
+ app: z.ZodOptional<z.ZodObject<{
5126
+ server: z.ZodString;
5127
+ tool: z.ZodString;
5128
+ }, z.core.$strip>>;
5129
+ }, z.core.$strip>;
5130
+ kind: z.ZodLiteral<"page_ask">;
5131
+ }, z.core.$strip>, z.ZodObject<{
5132
+ kind: z.ZodLiteral<"page_draft">;
5133
+ callId: z.ZodString;
5134
+ at: z.ZodNumber;
5135
+ text: z.ZodString;
5136
+ title: z.ZodOptional<z.ZodString>;
5137
+ done: z.ZodOptional<z.ZodBoolean>;
5138
+ }, z.core.$strip>, z.ZodObject<{
5139
+ kind: z.ZodLiteral<"file_draft">;
5140
+ callId: z.ZodString;
5141
+ path: z.ZodString;
5142
+ op: z.ZodEnum<{
5143
+ edit: "edit";
5144
+ write: "write";
5145
+ }>;
5146
+ at: z.ZodNumber;
5147
+ text: z.ZodString;
5148
+ old: z.ZodOptional<z.ZodString>;
5149
+ replaceAll: z.ZodOptional<z.ZodBoolean>;
5150
+ truncated: z.ZodOptional<z.ZodBoolean>;
5151
+ done: z.ZodOptional<z.ZodBoolean>;
5152
+ }, z.core.$strip>, z.ZodObject<{
5153
+ kind: z.ZodLiteral<"resolved">;
5154
+ requestId: z.ZodString;
5155
+ reply: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5156
+ kind: z.ZodLiteral<"plan">;
5157
+ requestId: z.ZodString;
5158
+ approve: z.ZodBoolean;
5159
+ feedback: z.ZodOptional<z.ZodString>;
5160
+ night: z.ZodOptional<z.ZodObject<{
5161
+ outcome: z.ZodEnum<{
5162
+ approved: "approved";
5163
+ picked: "picked";
5164
+ saved: "saved";
5165
+ }>;
5166
+ until: z.ZodString;
5167
+ }, z.core.$strip>>;
5168
+ }, z.core.$strip>, z.ZodObject<{
5169
+ kind: z.ZodLiteral<"question">;
5170
+ requestId: z.ZodString;
5171
+ answers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
5172
+ attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
5173
+ cancelled: z.ZodOptional<z.ZodBoolean>;
5174
+ night: z.ZodOptional<z.ZodObject<{
5175
+ outcome: z.ZodEnum<{
5176
+ approved: "approved";
5177
+ picked: "picked";
5178
+ saved: "saved";
5179
+ }>;
5180
+ until: z.ZodString;
5181
+ }, z.core.$strip>>;
5182
+ }, z.core.$strip>, z.ZodObject<{
5183
+ kind: z.ZodLiteral<"permission">;
5184
+ requestId: z.ZodString;
5185
+ decision: z.ZodEnum<{
5186
+ always: "always";
5187
+ deny: "deny";
5188
+ everything: "everything";
5189
+ once: "once";
5190
+ }>;
5191
+ feedback: z.ZodOptional<z.ZodString>;
5192
+ child: z.ZodOptional<z.ZodObject<{
5193
+ provider: z.ZodString;
5194
+ model: z.ZodString;
5195
+ harness: z.ZodOptional<z.ZodEnum<{
5196
+ "claude-code": "claude-code";
5197
+ codex: "codex";
5198
+ muse: "muse";
5199
+ native: "native";
5200
+ opencode: "opencode";
5201
+ pi: "pi";
5202
+ vendor: "vendor";
5203
+ }>>;
5204
+ account: z.ZodOptional<z.ZodString>;
5205
+ effort: z.ZodOptional<z.ZodString>;
5206
+ thinking: z.ZodOptional<z.ZodBoolean>;
5207
+ fast: z.ZodOptional<z.ZodBoolean>;
5208
+ }, z.core.$strip>>;
5209
+ }, z.core.$strip>, z.ZodObject<{
5210
+ kind: z.ZodLiteral<"browser_help">;
5211
+ requestId: z.ZodString;
5212
+ helped: z.ZodBoolean;
5213
+ note: z.ZodOptional<z.ZodString>;
5214
+ }, z.core.$strip>, z.ZodObject<{
5215
+ kind: z.ZodLiteral<"terminal_help">;
5216
+ requestId: z.ZodString;
5217
+ helped: z.ZodBoolean;
5218
+ note: z.ZodOptional<z.ZodString>;
5219
+ }, z.core.$strip>, z.ZodObject<{
5220
+ kind: z.ZodLiteral<"capability_offer">;
5221
+ requestId: z.ZodString;
5222
+ connect: z.ZodBoolean;
5223
+ }, z.core.$strip>, z.ZodObject<{
5224
+ kind: z.ZodLiteral<"payment_offer">;
5225
+ requestId: z.ZodString;
5226
+ approve: z.ZodBoolean;
5227
+ }, z.core.$strip>, z.ZodObject<{
5228
+ kind: z.ZodLiteral<"page_ask">;
5229
+ requestId: z.ZodString;
5230
+ value: z.ZodOptional<z.ZodString>;
5231
+ cancelled: z.ZodOptional<z.ZodBoolean>;
5232
+ }, z.core.$strip>, z.ZodObject<{
5233
+ kind: z.ZodLiteral<"credential_offer">;
5234
+ requestId: z.ZodString;
5235
+ approve: z.ZodBoolean;
5236
+ }, z.core.$strip>], "kind">>;
5237
+ }, z.core.$strip>, z.ZodObject<{
5238
+ kind: z.ZodLiteral<"mode">;
5239
+ mode: z.ZodEnum<{
5240
+ bypassPermissions: "bypassPermissions";
5241
+ default: "default";
5242
+ plan: "plan";
5243
+ }>;
5244
+ }, z.core.$strip>, z.ZodObject<{
5245
+ kind: z.ZodLiteral<"error">;
5246
+ message: z.ZodString;
5247
+ own: z.ZodOptional<z.ZodBoolean>;
5248
+ code: z.ZodOptional<z.ZodEnum<{
5249
+ "account-not-allowed": "account-not-allowed";
5250
+ "account-not-entitled": "account-not-entitled";
5251
+ "acp-auth-required": "acp-auth-required";
5252
+ "agent-busy": "agent-busy";
5253
+ "agent-domain-refused": "agent-domain-refused";
5254
+ "claude-not-entitled": "claude-not-entitled";
5255
+ "claude-reauth": "claude-reauth";
5256
+ "claude-token-refused": "claude-token-refused";
5257
+ "codex-advisory": "codex-advisory";
5258
+ "codex-model-invalid": "codex-model-invalid";
5259
+ "codex-reauth": "codex-reauth";
5260
+ "context-overflow": "context-overflow";
5261
+ "context-window-too-small": "context-window-too-small";
5262
+ "engine-version-floor": "engine-version-floor";
5263
+ "grok-model-invalid": "grok-model-invalid";
5264
+ "harness-incomplete": "harness-incomplete";
5265
+ "model-helper-only": "model-helper-only";
5266
+ "model-unavailable": "model-unavailable";
5267
+ "privacy-instructions": "privacy-instructions";
5268
+ "privacy-unshielded": "privacy-unshielded";
5269
+ "provider-outage": "provider-outage";
5270
+ rate_limit: "rate_limit";
5271
+ "safeguard-flagged": "safeguard-flagged";
5272
+ "sandbox-disk-low": "sandbox-disk-low";
5273
+ "sandbox-memory-low": "sandbox-memory-low";
5274
+ "session-not-found": "session-not-found";
5275
+ "subscription-required": "subscription-required";
5276
+ "tools-unenforced": "tools-unenforced";
5277
+ "trial-exhausted": "trial-exhausted";
5278
+ "trial-model-unavailable": "trial-model-unavailable";
5279
+ "trial-unavailable": "trial-unavailable";
5280
+ "turn-cap": "turn-cap";
5281
+ "unknown-command": "unknown-command";
5282
+ "workspace-setup": "workspace-setup";
5283
+ }>>;
5284
+ refusal: z.ZodOptional<z.ZodObject<{
5285
+ category: z.ZodOptional<z.ZodString>;
5286
+ resumeAt: z.ZodOptional<z.ZodString>;
5287
+ }, z.core.$strip>>;
5288
+ privacyRoute: z.ZodOptional<z.ZodEnum<{
5289
+ "own-key": "own-key";
5290
+ runner: "runner";
5291
+ runtime: "runtime";
5292
+ "shared-server": "shared-server";
5293
+ }>>;
5294
+ engine: z.ZodOptional<z.ZodObject<{
5295
+ id: z.ZodString;
5296
+ running: z.ZodOptional<z.ZodString>;
5297
+ floor: z.ZodString;
5298
+ }, z.core.$strip>>;
5299
+ resetsAt: z.ZodOptional<z.ZodNumber>;
5300
+ account: z.ZodOptional<z.ZodString>;
5301
+ autoResume: z.ZodOptional<z.ZodEnum<{
5302
+ available: "available";
5303
+ scheduled: "scheduled";
5304
+ }>>;
5305
+ nextAt: z.ZodOptional<z.ZodNumber>;
5306
+ held: z.ZodOptional<z.ZodObject<{
5307
+ ran: z.ZodBoolean;
5308
+ contextTokens: z.ZodOptional<z.ZodNumber>;
5309
+ handoffTokens: z.ZodOptional<z.ZodNumber>;
5310
+ moving: z.ZodOptional<z.ZodString>;
5311
+ handoff: z.ZodOptional<z.ZodObject<{
5312
+ suggested: z.ZodEnum<{
5313
+ carry: "carry";
5314
+ summary: "summary";
5315
+ trim: "trim";
5316
+ }>;
5317
+ basis: z.ZodEnum<{
5318
+ setting: "setting";
5319
+ size: "size";
5320
+ }>;
5321
+ carry: z.ZodOptional<z.ZodObject<{
5322
+ tokens: z.ZodOptional<z.ZodNumber>;
5323
+ }, z.core.$strip>>;
5324
+ trim: z.ZodOptional<z.ZodObject<{
5325
+ tokens: z.ZodNumber;
5326
+ cleared: z.ZodNumber;
5327
+ }, z.core.$strip>>;
5328
+ summary: z.ZodOptional<z.ZodObject<{
5329
+ tokens: z.ZodNumber;
5330
+ reads: z.ZodOptional<z.ZodNumber>;
5331
+ }, z.core.$strip>>;
5332
+ chosen: z.ZodOptional<z.ZodEnum<{
5333
+ carry: "carry";
5334
+ summary: "summary";
5335
+ trim: "trim";
5336
+ }>>;
5337
+ }, z.core.$strip>>;
5338
+ pressOnly: z.ZodOptional<z.ZodBoolean>;
5339
+ }, z.core.$strip>>;
5340
+ outage: z.ZodOptional<z.ZodObject<{
5341
+ retryAt: z.ZodNumber;
5342
+ }, z.core.$strip>>;
5343
+ retries: z.ZodOptional<z.ZodObject<{
5344
+ made: z.ZodNumber;
5345
+ max: z.ZodNumber;
5346
+ }, z.core.$strip>>;
5347
+ memory: z.ZodOptional<z.ZodObject<{
5348
+ limitBytes: z.ZodNumber;
5349
+ residentBytes: z.ZodNumber;
5350
+ swapBytes: z.ZodNumber;
5351
+ }, z.core.$strip>>;
5352
+ unattended: z.ZodOptional<z.ZodBoolean>;
5353
+ }, z.core.$strip>, z.ZodObject<{
5354
+ kind: z.ZodLiteral<"done">;
5355
+ }, z.core.$strip>], "kind">;
5356
+ }, Record<never, never>, Record<never, never>>;
5357
+ heldTurn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
5358
+ conversationId: z.ZodString;
5359
+ }, z.core.$strip>, z.ZodObject<{
5360
+ state: z.ZodEnum<{
5361
+ finished: "finished";
5362
+ live: "live";
5363
+ none: "none";
5364
+ }>;
5365
+ events: z.ZodNumber;
5366
+ acked: z.ZodNumber;
5367
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
5368
+ ackTurn: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
5369
+ conversationId: z.ZodString;
5370
+ after: z.ZodNumber;
5371
+ }, z.core.$strip>, z.ZodObject<{
5372
+ ok: z.ZodLiteral<true>;
5373
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
5374
+ reply: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodDiscriminatedUnion<[z.ZodObject<{
5375
+ kind: z.ZodLiteral<"plan">;
5376
+ requestId: z.ZodString;
5377
+ approve: z.ZodBoolean;
5378
+ feedback: z.ZodOptional<z.ZodString>;
5379
+ night: z.ZodOptional<z.ZodObject<{
5380
+ outcome: z.ZodEnum<{
5381
+ approved: "approved";
5382
+ picked: "picked";
5383
+ saved: "saved";
5384
+ }>;
5385
+ until: z.ZodString;
5386
+ }, z.core.$strip>>;
5387
+ }, z.core.$strip>, z.ZodObject<{
5388
+ kind: z.ZodLiteral<"question">;
5389
+ requestId: z.ZodString;
5390
+ answers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
5391
+ attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
5392
+ cancelled: z.ZodOptional<z.ZodBoolean>;
5393
+ night: z.ZodOptional<z.ZodObject<{
5394
+ outcome: z.ZodEnum<{
5395
+ approved: "approved";
5396
+ picked: "picked";
5397
+ saved: "saved";
5398
+ }>;
5399
+ until: z.ZodString;
5400
+ }, z.core.$strip>>;
2647
5401
  }, z.core.$strip>, z.ZodObject<{
2648
5402
  kind: z.ZodLiteral<"permission">;
2649
5403
  requestId: z.ZodString;