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