@nyte-ai/schema 0.0.0-stage → 0.0.18

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 (148) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD-PARTY-NOTICES.md +800 -0
  3. package/dist/chunks/browser-0byq2fja.js +50 -0
  4. package/dist/chunks/browser-0ebnhqs2.js +36 -0
  5. package/dist/chunks/browser-0g0z3617.js +47 -0
  6. package/dist/chunks/browser-0khex2b1.js +33 -0
  7. package/dist/chunks/browser-1sfp0bcx.js +73 -0
  8. package/dist/chunks/browser-40enyw9r.js +75 -0
  9. package/dist/chunks/browser-48g24pes.js +106 -0
  10. package/dist/chunks/browser-4et7qtz3.js +7 -0
  11. package/dist/chunks/browser-5n1dh580.js +66 -0
  12. package/dist/chunks/browser-5pvw8svn.js +243 -0
  13. package/dist/chunks/browser-6e1madxa.js +83 -0
  14. package/dist/chunks/browser-6yby604e.js +96 -0
  15. package/dist/chunks/browser-7195qf3t.js +14 -0
  16. package/dist/chunks/browser-7gjnxy9m.js +172 -0
  17. package/dist/chunks/browser-8t9anqfc.js +113 -0
  18. package/dist/chunks/browser-9ystjh78.js +0 -0
  19. package/dist/chunks/browser-ad9yebg7.js +101 -0
  20. package/dist/chunks/browser-b519jtez.js +102 -0
  21. package/dist/chunks/browser-bg1esaw0.js +82 -0
  22. package/dist/chunks/browser-bxz3z1v6.js +181 -0
  23. package/dist/chunks/browser-e5xgzd28.js +82 -0
  24. package/dist/chunks/browser-ebr6k189.js +120 -0
  25. package/dist/chunks/browser-ekbecx9r.js +73 -0
  26. package/dist/chunks/browser-fd3accdr.js +159 -0
  27. package/dist/chunks/browser-fth801bw.js +50 -0
  28. package/dist/chunks/browser-g5khdcap.js +170 -0
  29. package/dist/chunks/browser-gchr2880.js +135 -0
  30. package/dist/chunks/browser-h86zs54a.js +65 -0
  31. package/dist/chunks/browser-hq5q56sf.js +79 -0
  32. package/dist/chunks/browser-j629a6wa.js +17 -0
  33. package/dist/chunks/browser-k20f6cvv.js +0 -0
  34. package/dist/chunks/browser-m0wzr0g8.js +5 -0
  35. package/dist/chunks/browser-mnejgne0.js +125 -0
  36. package/dist/chunks/browser-mzfc0v5j.js +58 -0
  37. package/dist/chunks/browser-pdv675va.js +135 -0
  38. package/dist/chunks/browser-pdx38ng3.js +301 -0
  39. package/dist/chunks/browser-qkxe0fwp.js +6 -0
  40. package/dist/chunks/browser-r00v3vwv.js +238 -0
  41. package/dist/chunks/browser-r87w64mz.js +32 -0
  42. package/dist/chunks/browser-s7907azt.js +118 -0
  43. package/dist/chunks/browser-sgwxbek9.js +37 -0
  44. package/dist/chunks/browser-v70eq512.js +215 -0
  45. package/dist/chunks/browser-vapnjwp3.js +35 -0
  46. package/dist/chunks/browser-vkh2tpmf.js +283 -0
  47. package/dist/chunks/browser-vzc3r2r3.js +64 -0
  48. package/dist/chunks/browser-ypez6s7v.js +52 -0
  49. package/dist/src/browser.d.ts +64 -0
  50. package/dist/src/browser.js +26 -0
  51. package/dist/src/configuration.d.ts +26 -0
  52. package/dist/src/configuration.js +17 -0
  53. package/dist/src/connection.d.ts +189 -0
  54. package/dist/src/connection.js +35 -0
  55. package/dist/src/declaration.d.ts +12 -0
  56. package/dist/src/declaration.js +1 -0
  57. package/dist/src/errors.d.ts +56 -0
  58. package/dist/src/errors.js +23 -0
  59. package/dist/src/events.d.ts +1750 -0
  60. package/dist/src/events.js +36 -0
  61. package/dist/src/files.d.ts +130 -0
  62. package/dist/src/files.js +49 -0
  63. package/dist/src/git.d.ts +271 -0
  64. package/dist/src/git.js +64 -0
  65. package/dist/src/github.d.ts +174 -0
  66. package/dist/src/github.js +31 -0
  67. package/dist/src/heads.d.ts +255 -0
  68. package/dist/src/heads.js +48 -0
  69. package/dist/src/hooks.d.ts +201 -0
  70. package/dist/src/hooks.js +28 -0
  71. package/dist/src/host.d.ts +137 -0
  72. package/dist/src/host.js +49 -0
  73. package/dist/src/ids.d.ts +66 -0
  74. package/dist/src/ids.js +67 -0
  75. package/dist/src/index.d.ts +30 -0
  76. package/dist/src/index.js +779 -0
  77. package/dist/src/jobs.d.ts +152 -0
  78. package/dist/src/jobs.js +34 -0
  79. package/dist/src/json.d.ts +24 -0
  80. package/dist/src/json.js +21 -0
  81. package/dist/src/mcp.d.ts +212 -0
  82. package/dist/src/mcp.js +34 -0
  83. package/dist/src/messages.d.ts +114 -0
  84. package/dist/src/messages.js +28 -0
  85. package/dist/src/model/index.d.ts +6 -0
  86. package/dist/src/model/index.js +61 -0
  87. package/dist/src/model/message.d.ts +178 -0
  88. package/dist/src/model/message.js +7 -0
  89. package/dist/src/model/model.d.ts +154 -0
  90. package/dist/src/model/model.js +11 -0
  91. package/dist/src/model/text.d.ts +6 -0
  92. package/dist/src/model/text.js +10 -0
  93. package/dist/src/model/tool.d.ts +36 -0
  94. package/dist/src/model/tool.js +1 -0
  95. package/dist/src/model/transcript.d.ts +34 -0
  96. package/dist/src/model/transcript.js +37 -0
  97. package/dist/src/model/typed.d.ts +6 -0
  98. package/dist/src/model/typed.js +8 -0
  99. package/dist/src/models.d.ts +195 -0
  100. package/dist/src/models.js +45 -0
  101. package/dist/src/parts.d.ts +364 -0
  102. package/dist/src/parts.js +35 -0
  103. package/dist/src/patch.d.ts +21 -0
  104. package/dist/src/patch.js +11 -0
  105. package/dist/src/plugins.d.ts +36 -0
  106. package/dist/src/plugins.js +9 -0
  107. package/dist/src/primitives.d.ts +83 -0
  108. package/dist/src/primitives.js +26 -0
  109. package/dist/src/runs.d.ts +433 -0
  110. package/dist/src/runs.js +39 -0
  111. package/dist/src/schema.d.ts +14 -0
  112. package/dist/src/schema.js +8 -0
  113. package/dist/src/serial.d.ts +18 -0
  114. package/dist/src/serial.js +39 -0
  115. package/dist/src/sessions.d.ts +578 -0
  116. package/dist/src/sessions.js +74 -0
  117. package/dist/src/store.d.ts +831 -0
  118. package/dist/src/store.js +33 -0
  119. package/dist/src/tools.d.ts +76 -0
  120. package/dist/src/tools.js +24 -0
  121. package/dist/src/views.d.ts +2737 -0
  122. package/dist/src/views.js +50 -0
  123. package/dist/src/wire/base64.d.ts +2 -0
  124. package/dist/src/wire/base64.js +6 -0
  125. package/dist/src/wire/nullable.d.ts +2 -0
  126. package/dist/src/wire/nullable.js +6 -0
  127. package/dist/src/wire/operations/browser.d.ts +535 -0
  128. package/dist/src/wire/operations/browser.js +12 -0
  129. package/dist/src/wire/operations/fields.d.ts +54 -0
  130. package/dist/src/wire/operations/fields.js +30 -0
  131. package/dist/src/wire/operations/files.d.ts +244 -0
  132. package/dist/src/wire/operations/files.js +13 -0
  133. package/dist/src/wire/operations/git.d.ts +513 -0
  134. package/dist/src/wire/operations/git.js +15 -0
  135. package/dist/src/wire/operations/github.d.ts +172 -0
  136. package/dist/src/wire/operations/github.js +12 -0
  137. package/dist/src/wire/operations/host.d.ts +1011 -0
  138. package/dist/src/wire/operations/host.js +27 -0
  139. package/dist/src/wire/operations/index.d.ts +6703 -0
  140. package/dist/src/wire/operations/index.js +40 -0
  141. package/dist/src/wire/operations/session.d.ts +3411 -0
  142. package/dist/src/wire/operations/session.js +25 -0
  143. package/dist/src/wire/operations/workspace.d.ts +830 -0
  144. package/dist/src/wire/operations/workspace.js +24 -0
  145. package/dist/src/workspaces.d.ts +119 -0
  146. package/dist/src/workspaces.js +38 -0
  147. package/package.json +51 -3
  148. package/README.md +0 -3
@@ -0,0 +1,2737 @@
1
+ import { Type } from "typebox";
2
+ import type { Decoded, Schema } from "./schema.ts";
3
+ export declare const ViewOptionsType: Type.TObject<{
4
+ tail: Type.TOptional<Type.TNumber>;
5
+ }>;
6
+ export type ViewOptions = Decoded<typeof ViewOptionsType>;
7
+ export declare const UserStatusType: Type.TUnion<[Type.TObject<{
8
+ kind: Type.TLiteral<"unsent">;
9
+ attempts: Type.TNumber;
10
+ retrying: Type.TUnion<[Type.TObject<{
11
+ at: Type.TNumber;
12
+ reason: Type.TString;
13
+ }>, Type.TNull]>;
14
+ }>, Type.TObject<{
15
+ kind: Type.TLiteral<"pending">;
16
+ schedule: Type.TUnion<[Type.TObject<{
17
+ kind: Type.TLiteral<"joined">;
18
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
19
+ }>, Type.TObject<{
20
+ kind: Type.TLiteral<"next-turn">;
21
+ reason: Type.TEnum<["requested", "idle", "run-ended", "configuration"]>;
22
+ }>, Type.TObject<{
23
+ kind: Type.TLiteral<"attached">;
24
+ }>, Type.TObject<{
25
+ kind: Type.TLiteral<"deciding">;
26
+ }>]>;
27
+ covered: Type.TBoolean;
28
+ }>, Type.TObject<{
29
+ kind: Type.TLiteral<"landed">;
30
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
31
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
32
+ replaced: Type.TUnion<[Type.TObject<{
33
+ previous: Type.TUnsafe<import("./ids.ts").Id<"message">>;
34
+ stopped: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
35
+ }>, Type.TNull]>;
36
+ }>]>;
37
+ export type UserStatus = Decoded<typeof UserStatusType>;
38
+ export declare const MessageType: Type.TUnion<[Type.TObject<{
39
+ kind: Type.TLiteral<"user">;
40
+ content: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TObject<{
41
+ kind: Type.TLiteral<"text">;
42
+ text: Type.TString;
43
+ }>, Type.TObject<{
44
+ kind: Type.TLiteral<"file">;
45
+ blob: Type.TUnsafe<import("./ids.ts").Id<"blob">>;
46
+ mime: Type.TString;
47
+ name: Type.TString;
48
+ }>, Type.TObject<{
49
+ kind: Type.TLiteral<"reference">;
50
+ path: Type.TString;
51
+ blob: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"blob">>>;
52
+ }>, Type.TObject<{
53
+ kind: Type.TLiteral<"skill">;
54
+ name: Type.TString;
55
+ location: Type.TString;
56
+ }>, Type.TObject<{
57
+ kind: Type.TLiteral<"excerpt">;
58
+ source: Type.TUnion<[Type.TObject<{
59
+ kind: Type.TLiteral<"diff">;
60
+ path: Type.TString;
61
+ side: Type.TEnum<["old", "new"]>;
62
+ start: Type.TNumber;
63
+ end: Type.TNumber;
64
+ }>, Type.TObject<{
65
+ kind: Type.TLiteral<"terminal">;
66
+ command: Type.TOptional<Type.TString>;
67
+ }>, Type.TObject<{
68
+ kind: Type.TLiteral<"browser">;
69
+ url: Type.TString;
70
+ selector: Type.TString;
71
+ }>]>;
72
+ text: Type.TString;
73
+ }>]>>]>;
74
+ source: Type.TUnion<[Type.TObject<{
75
+ kind: Type.TLiteral<"user">;
76
+ }>, Type.TObject<{
77
+ kind: Type.TLiteral<"child">;
78
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
79
+ end: Type.TEnum<["completed", "stopped", "failed"]>;
80
+ }>, Type.TObject<{
81
+ kind: Type.TLiteral<"job">;
82
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
83
+ }>, Type.TObject<{
84
+ kind: Type.TLiteral<"shell">;
85
+ }>, Type.TObject<{
86
+ kind: Type.TLiteral<"action">;
87
+ label: Type.TString;
88
+ command: Type.TOptional<Type.TString>;
89
+ }>]>;
90
+ delivery: Type.TEnum<["steer", "queue", "attach"]>;
91
+ status: Type.TUnion<[Type.TObject<{
92
+ kind: Type.TLiteral<"unsent">;
93
+ attempts: Type.TNumber;
94
+ retrying: Type.TUnion<[Type.TObject<{
95
+ at: Type.TNumber;
96
+ reason: Type.TString;
97
+ }>, Type.TNull]>;
98
+ }>, Type.TObject<{
99
+ kind: Type.TLiteral<"pending">;
100
+ schedule: Type.TUnion<[Type.TObject<{
101
+ kind: Type.TLiteral<"joined">;
102
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
103
+ }>, Type.TObject<{
104
+ kind: Type.TLiteral<"next-turn">;
105
+ reason: Type.TEnum<["requested", "idle", "run-ended", "configuration"]>;
106
+ }>, Type.TObject<{
107
+ kind: Type.TLiteral<"attached">;
108
+ }>, Type.TObject<{
109
+ kind: Type.TLiteral<"deciding">;
110
+ }>]>;
111
+ covered: Type.TBoolean;
112
+ }>, Type.TObject<{
113
+ kind: Type.TLiteral<"landed">;
114
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
115
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
116
+ replaced: Type.TUnion<[Type.TObject<{
117
+ previous: Type.TUnsafe<import("./ids.ts").Id<"message">>;
118
+ stopped: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
119
+ }>, Type.TNull]>;
120
+ }>]>;
121
+ siblings: Type.TObject<{
122
+ index: Type.TNumber;
123
+ count: Type.TNumber;
124
+ ids: Type.TArray<Type.TUnsafe<import("./ids.ts").Id<"commit">>>;
125
+ }>;
126
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
127
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
128
+ at: Type.TNumber;
129
+ }>, Type.TObject<{
130
+ kind: Type.TLiteral<"part">;
131
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
132
+ partKind: Type.TString;
133
+ role: Type.TEnum<["step", "answer", "note"]>;
134
+ state: Type.TUnknown;
135
+ version: Type.TNumber;
136
+ status: Type.TUnion<[Type.TObject<{
137
+ kind: Type.TLiteral<"live">;
138
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
139
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
140
+ answer: Type.TOptional<Type.TObject<{
141
+ action: Type.TString;
142
+ input: Type.TUnsafe<import("./json.ts").Json>;
143
+ }>>;
144
+ }>, Type.TObject<{
145
+ kind: Type.TLiteral<"waiting">;
146
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
147
+ on: Type.TUnion<[Type.TObject<{
148
+ kind: Type.TLiteral<"run">;
149
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
150
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
151
+ deadline: Type.TOptional<Type.TNumber>;
152
+ }>, Type.TObject<{
153
+ kind: Type.TLiteral<"job">;
154
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
155
+ deadline: Type.TOptional<Type.TNumber>;
156
+ }>, Type.TObject<{
157
+ kind: Type.TLiteral<"part">;
158
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
159
+ deadline: Type.TOptional<Type.TNumber>;
160
+ }>, Type.TObject<{
161
+ kind: Type.TLiteral<"timer">;
162
+ until: Type.TNumber;
163
+ deadline: Type.TOptional<Type.TNumber>;
164
+ }>]>;
165
+ }>, Type.TObject<{
166
+ kind: Type.TLiteral<"settled">;
167
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
168
+ endedAt: Type.TNumber;
169
+ }>, Type.TObject<{
170
+ kind: Type.TLiteral<"failed">;
171
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
172
+ failure: Type.TObject<{
173
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
174
+ message: Type.TString;
175
+ retryAfterMs: Type.TOptional<Type.TNumber>;
176
+ }>;
177
+ }>]>;
178
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
179
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
180
+ at: Type.TNumber;
181
+ }>]>;
182
+ export type Message = Decoded<typeof MessageType>;
183
+ export declare const TurnInfoType: Type.TObject<{
184
+ id: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
185
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
186
+ prompt: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"message">>, Type.TNull]>;
187
+ state: Type.TUnion<[Type.TObject<{
188
+ kind: Type.TLiteral<"working">;
189
+ activity: Type.TUnion<[Type.TString, Type.TNull]>;
190
+ }>, Type.TObject<{
191
+ kind: Type.TLiteral<"waiting">;
192
+ on: Type.TUnion<[Type.TObject<{
193
+ kind: Type.TLiteral<"run">;
194
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
195
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
196
+ deadline: Type.TOptional<Type.TNumber>;
197
+ }>, Type.TObject<{
198
+ kind: Type.TLiteral<"job">;
199
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
200
+ deadline: Type.TOptional<Type.TNumber>;
201
+ }>, Type.TObject<{
202
+ kind: Type.TLiteral<"part">;
203
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
204
+ deadline: Type.TOptional<Type.TNumber>;
205
+ }>, Type.TObject<{
206
+ kind: Type.TLiteral<"timer">;
207
+ until: Type.TNumber;
208
+ deadline: Type.TOptional<Type.TNumber>;
209
+ }>]>;
210
+ }>, Type.TObject<{
211
+ kind: Type.TLiteral<"ended">;
212
+ end: Type.TUnion<[Type.TObject<{
213
+ kind: Type.TLiteral<"completed">;
214
+ usage: Type.TObject<{
215
+ input: Type.TNumber;
216
+ output: Type.TNumber;
217
+ cacheRead: Type.TNumber;
218
+ cacheWrite: Type.TNumber;
219
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
220
+ total: Type.TNumber;
221
+ cost: Type.TObject<{
222
+ input: Type.TNumber;
223
+ output: Type.TNumber;
224
+ cacheRead: Type.TNumber;
225
+ cacheWrite: Type.TNumber;
226
+ total: Type.TNumber;
227
+ }>;
228
+ }>;
229
+ }>, Type.TObject<{
230
+ kind: Type.TLiteral<"stopped">;
231
+ }>, Type.TObject<{
232
+ kind: Type.TLiteral<"failed">;
233
+ failure: Type.TObject<{
234
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
235
+ message: Type.TString;
236
+ retryAfterMs: Type.TOptional<Type.TNumber>;
237
+ }>;
238
+ }>]>;
239
+ }>]>;
240
+ startedAt: Type.TNumber;
241
+ endedAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
242
+ steps: Type.TNumber;
243
+ thinkingOnly: Type.TBoolean;
244
+ summary: Type.TObject<{
245
+ byClass: Type.TObject<{
246
+ read: Type.TObject<{
247
+ count: Type.TNumber;
248
+ paths: Type.TArray<Type.TString>;
249
+ }>;
250
+ list: Type.TObject<{
251
+ count: Type.TNumber;
252
+ paths: Type.TArray<Type.TString>;
253
+ }>;
254
+ edit: Type.TObject<{
255
+ count: Type.TNumber;
256
+ paths: Type.TArray<Type.TString>;
257
+ }>;
258
+ shell: Type.TObject<{
259
+ count: Type.TNumber;
260
+ paths: Type.TArray<Type.TString>;
261
+ }>;
262
+ delegate: Type.TObject<{
263
+ count: Type.TNumber;
264
+ paths: Type.TArray<Type.TString>;
265
+ }>;
266
+ custom: Type.TObject<{
267
+ count: Type.TNumber;
268
+ paths: Type.TArray<Type.TString>;
269
+ }>;
270
+ }>;
271
+ failed: Type.TNumber;
272
+ stopped: Type.TNumber;
273
+ added: Type.TNumber;
274
+ removed: Type.TNumber;
275
+ }>;
276
+ }>;
277
+ export type TurnInfo = Decoded<typeof TurnInfoType>;
278
+ export declare const SessionViewType: Type.TObject<{
279
+ revision: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"revision">>, Type.TNull]>;
280
+ seq: Type.TUnsafe<import("./ids.ts").Seq>;
281
+ activation: Type.TUnion<[Type.TObject<{
282
+ kind: Type.TLiteral<"active">;
283
+ }>, Type.TObject<{
284
+ kind: Type.TLiteral<"inactive">;
285
+ }>, Type.TObject<{
286
+ kind: Type.TLiteral<"unavailable">;
287
+ reason: Type.TEnum<["unsupported", "unreachable"]>;
288
+ workspace: Type.TUnsafe<import("./ids.ts").Id<"workspace">>;
289
+ }>, Type.TObject<{
290
+ kind: Type.TLiteral<"failed">;
291
+ message: Type.TString;
292
+ }>]>;
293
+ messages: Type.TArray<Type.TUnion<[Type.TObject<{
294
+ kind: Type.TLiteral<"user">;
295
+ content: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TObject<{
296
+ kind: Type.TLiteral<"text">;
297
+ text: Type.TString;
298
+ }>, Type.TObject<{
299
+ kind: Type.TLiteral<"file">;
300
+ blob: Type.TUnsafe<import("./ids.ts").Id<"blob">>;
301
+ mime: Type.TString;
302
+ name: Type.TString;
303
+ }>, Type.TObject<{
304
+ kind: Type.TLiteral<"reference">;
305
+ path: Type.TString;
306
+ blob: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"blob">>>;
307
+ }>, Type.TObject<{
308
+ kind: Type.TLiteral<"skill">;
309
+ name: Type.TString;
310
+ location: Type.TString;
311
+ }>, Type.TObject<{
312
+ kind: Type.TLiteral<"excerpt">;
313
+ source: Type.TUnion<[Type.TObject<{
314
+ kind: Type.TLiteral<"diff">;
315
+ path: Type.TString;
316
+ side: Type.TEnum<["old", "new"]>;
317
+ start: Type.TNumber;
318
+ end: Type.TNumber;
319
+ }>, Type.TObject<{
320
+ kind: Type.TLiteral<"terminal">;
321
+ command: Type.TOptional<Type.TString>;
322
+ }>, Type.TObject<{
323
+ kind: Type.TLiteral<"browser">;
324
+ url: Type.TString;
325
+ selector: Type.TString;
326
+ }>]>;
327
+ text: Type.TString;
328
+ }>]>>]>;
329
+ source: Type.TUnion<[Type.TObject<{
330
+ kind: Type.TLiteral<"user">;
331
+ }>, Type.TObject<{
332
+ kind: Type.TLiteral<"child">;
333
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
334
+ end: Type.TEnum<["completed", "stopped", "failed"]>;
335
+ }>, Type.TObject<{
336
+ kind: Type.TLiteral<"job">;
337
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
338
+ }>, Type.TObject<{
339
+ kind: Type.TLiteral<"shell">;
340
+ }>, Type.TObject<{
341
+ kind: Type.TLiteral<"action">;
342
+ label: Type.TString;
343
+ command: Type.TOptional<Type.TString>;
344
+ }>]>;
345
+ delivery: Type.TEnum<["steer", "queue", "attach"]>;
346
+ status: Type.TUnion<[Type.TObject<{
347
+ kind: Type.TLiteral<"unsent">;
348
+ attempts: Type.TNumber;
349
+ retrying: Type.TUnion<[Type.TObject<{
350
+ at: Type.TNumber;
351
+ reason: Type.TString;
352
+ }>, Type.TNull]>;
353
+ }>, Type.TObject<{
354
+ kind: Type.TLiteral<"pending">;
355
+ schedule: Type.TUnion<[Type.TObject<{
356
+ kind: Type.TLiteral<"joined">;
357
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
358
+ }>, Type.TObject<{
359
+ kind: Type.TLiteral<"next-turn">;
360
+ reason: Type.TEnum<["requested", "idle", "run-ended", "configuration"]>;
361
+ }>, Type.TObject<{
362
+ kind: Type.TLiteral<"attached">;
363
+ }>, Type.TObject<{
364
+ kind: Type.TLiteral<"deciding">;
365
+ }>]>;
366
+ covered: Type.TBoolean;
367
+ }>, Type.TObject<{
368
+ kind: Type.TLiteral<"landed">;
369
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
370
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
371
+ replaced: Type.TUnion<[Type.TObject<{
372
+ previous: Type.TUnsafe<import("./ids.ts").Id<"message">>;
373
+ stopped: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
374
+ }>, Type.TNull]>;
375
+ }>]>;
376
+ siblings: Type.TObject<{
377
+ index: Type.TNumber;
378
+ count: Type.TNumber;
379
+ ids: Type.TArray<Type.TUnsafe<import("./ids.ts").Id<"commit">>>;
380
+ }>;
381
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
382
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
383
+ at: Type.TNumber;
384
+ }>, Type.TObject<{
385
+ kind: Type.TLiteral<"part">;
386
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
387
+ partKind: Type.TString;
388
+ role: Type.TEnum<["step", "answer", "note"]>;
389
+ state: Type.TUnknown;
390
+ version: Type.TNumber;
391
+ status: Type.TUnion<[Type.TObject<{
392
+ kind: Type.TLiteral<"live">;
393
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
394
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
395
+ answer: Type.TOptional<Type.TObject<{
396
+ action: Type.TString;
397
+ input: Type.TUnsafe<import("./json.ts").Json>;
398
+ }>>;
399
+ }>, Type.TObject<{
400
+ kind: Type.TLiteral<"waiting">;
401
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
402
+ on: Type.TUnion<[Type.TObject<{
403
+ kind: Type.TLiteral<"run">;
404
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
405
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
406
+ deadline: Type.TOptional<Type.TNumber>;
407
+ }>, Type.TObject<{
408
+ kind: Type.TLiteral<"job">;
409
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
410
+ deadline: Type.TOptional<Type.TNumber>;
411
+ }>, Type.TObject<{
412
+ kind: Type.TLiteral<"part">;
413
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
414
+ deadline: Type.TOptional<Type.TNumber>;
415
+ }>, Type.TObject<{
416
+ kind: Type.TLiteral<"timer">;
417
+ until: Type.TNumber;
418
+ deadline: Type.TOptional<Type.TNumber>;
419
+ }>]>;
420
+ }>, Type.TObject<{
421
+ kind: Type.TLiteral<"settled">;
422
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
423
+ endedAt: Type.TNumber;
424
+ }>, Type.TObject<{
425
+ kind: Type.TLiteral<"failed">;
426
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
427
+ failure: Type.TObject<{
428
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
429
+ message: Type.TString;
430
+ retryAfterMs: Type.TOptional<Type.TNumber>;
431
+ }>;
432
+ }>]>;
433
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
434
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
435
+ at: Type.TNumber;
436
+ }>]>>;
437
+ parts: Type.TArray<Type.TObject<{
438
+ id: Type.TUnsafe<import("./ids.ts").Id<"part">>;
439
+ partKind: Type.TString;
440
+ placement: Type.TUnion<[Type.TObject<{
441
+ kind: Type.TLiteral<"transcript">;
442
+ role: Type.TEnum<["step", "answer", "note"]>;
443
+ }>, Type.TObject<{
444
+ kind: Type.TLiteral<"modal">;
445
+ }>, Type.TIntersect<[Type.TObject<{
446
+ kind: Type.TString;
447
+ }>, Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>]>]>;
448
+ state: Type.TUnsafe<import("./json.ts").Json>;
449
+ version: Type.TNumber;
450
+ status: Type.TUnion<[Type.TObject<{
451
+ kind: Type.TLiteral<"live">;
452
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
453
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
454
+ answer: Type.TOptional<Type.TObject<{
455
+ action: Type.TString;
456
+ input: Type.TUnsafe<import("./json.ts").Json>;
457
+ }>>;
458
+ }>, Type.TObject<{
459
+ kind: Type.TLiteral<"waiting">;
460
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
461
+ on: Type.TUnion<[Type.TObject<{
462
+ kind: Type.TLiteral<"run">;
463
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
464
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
465
+ deadline: Type.TOptional<Type.TNumber>;
466
+ }>, Type.TObject<{
467
+ kind: Type.TLiteral<"job">;
468
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
469
+ deadline: Type.TOptional<Type.TNumber>;
470
+ }>, Type.TObject<{
471
+ kind: Type.TLiteral<"part">;
472
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
473
+ deadline: Type.TOptional<Type.TNumber>;
474
+ }>, Type.TObject<{
475
+ kind: Type.TLiteral<"timer">;
476
+ until: Type.TNumber;
477
+ deadline: Type.TOptional<Type.TNumber>;
478
+ }>]>;
479
+ }>, Type.TObject<{
480
+ kind: Type.TLiteral<"settled">;
481
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
482
+ endedAt: Type.TNumber;
483
+ }>, Type.TObject<{
484
+ kind: Type.TLiteral<"failed">;
485
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
486
+ failure: Type.TObject<{
487
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
488
+ message: Type.TString;
489
+ retryAfterMs: Type.TOptional<Type.TNumber>;
490
+ }>;
491
+ }>]>;
492
+ owner: Type.TUnion<[Type.TString, Type.TNull]>;
493
+ }>>;
494
+ turns: Type.TArray<Type.TObject<{
495
+ id: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
496
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
497
+ prompt: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"message">>, Type.TNull]>;
498
+ state: Type.TUnion<[Type.TObject<{
499
+ kind: Type.TLiteral<"working">;
500
+ activity: Type.TUnion<[Type.TString, Type.TNull]>;
501
+ }>, Type.TObject<{
502
+ kind: Type.TLiteral<"waiting">;
503
+ on: Type.TUnion<[Type.TObject<{
504
+ kind: Type.TLiteral<"run">;
505
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
506
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
507
+ deadline: Type.TOptional<Type.TNumber>;
508
+ }>, Type.TObject<{
509
+ kind: Type.TLiteral<"job">;
510
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
511
+ deadline: Type.TOptional<Type.TNumber>;
512
+ }>, Type.TObject<{
513
+ kind: Type.TLiteral<"part">;
514
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
515
+ deadline: Type.TOptional<Type.TNumber>;
516
+ }>, Type.TObject<{
517
+ kind: Type.TLiteral<"timer">;
518
+ until: Type.TNumber;
519
+ deadline: Type.TOptional<Type.TNumber>;
520
+ }>]>;
521
+ }>, Type.TObject<{
522
+ kind: Type.TLiteral<"ended">;
523
+ end: Type.TUnion<[Type.TObject<{
524
+ kind: Type.TLiteral<"completed">;
525
+ usage: Type.TObject<{
526
+ input: Type.TNumber;
527
+ output: Type.TNumber;
528
+ cacheRead: Type.TNumber;
529
+ cacheWrite: Type.TNumber;
530
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
531
+ total: Type.TNumber;
532
+ cost: Type.TObject<{
533
+ input: Type.TNumber;
534
+ output: Type.TNumber;
535
+ cacheRead: Type.TNumber;
536
+ cacheWrite: Type.TNumber;
537
+ total: Type.TNumber;
538
+ }>;
539
+ }>;
540
+ }>, Type.TObject<{
541
+ kind: Type.TLiteral<"stopped">;
542
+ }>, Type.TObject<{
543
+ kind: Type.TLiteral<"failed">;
544
+ failure: Type.TObject<{
545
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
546
+ message: Type.TString;
547
+ retryAfterMs: Type.TOptional<Type.TNumber>;
548
+ }>;
549
+ }>]>;
550
+ }>]>;
551
+ startedAt: Type.TNumber;
552
+ endedAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
553
+ steps: Type.TNumber;
554
+ thinkingOnly: Type.TBoolean;
555
+ summary: Type.TObject<{
556
+ byClass: Type.TObject<{
557
+ read: Type.TObject<{
558
+ count: Type.TNumber;
559
+ paths: Type.TArray<Type.TString>;
560
+ }>;
561
+ list: Type.TObject<{
562
+ count: Type.TNumber;
563
+ paths: Type.TArray<Type.TString>;
564
+ }>;
565
+ edit: Type.TObject<{
566
+ count: Type.TNumber;
567
+ paths: Type.TArray<Type.TString>;
568
+ }>;
569
+ shell: Type.TObject<{
570
+ count: Type.TNumber;
571
+ paths: Type.TArray<Type.TString>;
572
+ }>;
573
+ delegate: Type.TObject<{
574
+ count: Type.TNumber;
575
+ paths: Type.TArray<Type.TString>;
576
+ }>;
577
+ custom: Type.TObject<{
578
+ count: Type.TNumber;
579
+ paths: Type.TArray<Type.TString>;
580
+ }>;
581
+ }>;
582
+ failed: Type.TNumber;
583
+ stopped: Type.TNumber;
584
+ added: Type.TNumber;
585
+ removed: Type.TNumber;
586
+ }>;
587
+ }>>;
588
+ usage: Type.TObject<{
589
+ input: Type.TNumber;
590
+ output: Type.TNumber;
591
+ cacheRead: Type.TNumber;
592
+ cacheWrite: Type.TNumber;
593
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
594
+ total: Type.TNumber;
595
+ cost: Type.TObject<{
596
+ input: Type.TNumber;
597
+ output: Type.TNumber;
598
+ cacheRead: Type.TNumber;
599
+ cacheWrite: Type.TNumber;
600
+ total: Type.TNumber;
601
+ }>;
602
+ }>;
603
+ execution: Type.TUnion<[Type.TObject<{
604
+ kind: Type.TLiteral<"idle">;
605
+ lastRun: Type.TUnion<[Type.TObject<{
606
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
607
+ end: Type.TUnion<[Type.TObject<{
608
+ kind: Type.TLiteral<"completed">;
609
+ usage: Type.TObject<{
610
+ input: Type.TNumber;
611
+ output: Type.TNumber;
612
+ cacheRead: Type.TNumber;
613
+ cacheWrite: Type.TNumber;
614
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
615
+ total: Type.TNumber;
616
+ cost: Type.TObject<{
617
+ input: Type.TNumber;
618
+ output: Type.TNumber;
619
+ cacheRead: Type.TNumber;
620
+ cacheWrite: Type.TNumber;
621
+ total: Type.TNumber;
622
+ }>;
623
+ }>;
624
+ }>, Type.TObject<{
625
+ kind: Type.TLiteral<"stopped">;
626
+ }>, Type.TObject<{
627
+ kind: Type.TLiteral<"failed">;
628
+ failure: Type.TObject<{
629
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
630
+ message: Type.TString;
631
+ retryAfterMs: Type.TOptional<Type.TNumber>;
632
+ }>;
633
+ }>]>;
634
+ endedAt: Type.TNumber;
635
+ }>, Type.TNull]>;
636
+ }>, Type.TObject<{
637
+ kind: Type.TLiteral<"live">;
638
+ run: Type.TObject<{
639
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
640
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
641
+ startedAt: Type.TNumber;
642
+ attempt: Type.TNumber;
643
+ configuration: Type.TObject<{
644
+ kind: Type.TLiteral<"exact">;
645
+ model: Type.TObject<{
646
+ provider: Type.TString;
647
+ id: Type.TString;
648
+ }>;
649
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
650
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
651
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
652
+ settingsVersion: Type.TString;
653
+ }>;
654
+ origin: Type.TUnion<[Type.TObject<{
655
+ kind: Type.TLiteral<"input">;
656
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
657
+ }>, Type.TObject<{
658
+ kind: Type.TLiteral<"continuation">;
659
+ from: Type.TEnum<["child", "job", "wake"]>;
660
+ }>]>;
661
+ }>;
662
+ phase: Type.TEnum<["responding", "executing"]>;
663
+ stopping: Type.TBoolean;
664
+ }>, Type.TObject<{
665
+ kind: Type.TLiteral<"waiting">;
666
+ run: Type.TObject<{
667
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
668
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
669
+ startedAt: Type.TNumber;
670
+ attempt: Type.TNumber;
671
+ configuration: Type.TObject<{
672
+ kind: Type.TLiteral<"exact">;
673
+ model: Type.TObject<{
674
+ provider: Type.TString;
675
+ id: Type.TString;
676
+ }>;
677
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
678
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
679
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
680
+ settingsVersion: Type.TString;
681
+ }>;
682
+ origin: Type.TUnion<[Type.TObject<{
683
+ kind: Type.TLiteral<"input">;
684
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
685
+ }>, Type.TObject<{
686
+ kind: Type.TLiteral<"continuation">;
687
+ from: Type.TEnum<["child", "job", "wake"]>;
688
+ }>]>;
689
+ }>;
690
+ on: Type.TUnion<[Type.TObject<{
691
+ kind: Type.TLiteral<"run">;
692
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
693
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
694
+ deadline: Type.TOptional<Type.TNumber>;
695
+ }>, Type.TObject<{
696
+ kind: Type.TLiteral<"job">;
697
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
698
+ deadline: Type.TOptional<Type.TNumber>;
699
+ }>, Type.TObject<{
700
+ kind: Type.TLiteral<"part">;
701
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
702
+ deadline: Type.TOptional<Type.TNumber>;
703
+ }>, Type.TObject<{
704
+ kind: Type.TLiteral<"timer">;
705
+ until: Type.TNumber;
706
+ deadline: Type.TOptional<Type.TNumber>;
707
+ }>]>;
708
+ }>, Type.TObject<{
709
+ kind: Type.TLiteral<"retrying">;
710
+ run: Type.TObject<{
711
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
712
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
713
+ startedAt: Type.TNumber;
714
+ attempt: Type.TNumber;
715
+ configuration: Type.TObject<{
716
+ kind: Type.TLiteral<"exact">;
717
+ model: Type.TObject<{
718
+ provider: Type.TString;
719
+ id: Type.TString;
720
+ }>;
721
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
722
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
723
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
724
+ settingsVersion: Type.TString;
725
+ }>;
726
+ origin: Type.TUnion<[Type.TObject<{
727
+ kind: Type.TLiteral<"input">;
728
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
729
+ }>, Type.TObject<{
730
+ kind: Type.TLiteral<"continuation">;
731
+ from: Type.TEnum<["child", "job", "wake"]>;
732
+ }>]>;
733
+ }>;
734
+ until: Type.TNumber;
735
+ reason: Type.TString;
736
+ }>]>;
737
+ background: Type.TArray<Type.TObject<{
738
+ kind: Type.TEnum<["child", "job", "page"]>;
739
+ id: Type.TString;
740
+ title: Type.TString;
741
+ state: Type.TEnum<["working", "waiting", "done", "failed"]>;
742
+ startedBy: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"call">>, Type.TNull]>;
743
+ }>>;
744
+ configuration: Type.TObject<{
745
+ selected: Type.TUnion<[Type.TObject<{
746
+ kind: Type.TLiteral<"exact">;
747
+ model: Type.TObject<{
748
+ provider: Type.TString;
749
+ id: Type.TString;
750
+ }>;
751
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
752
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
753
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
754
+ settingsVersion: Type.TString;
755
+ }>, Type.TNull]>;
756
+ effective: Type.TUnion<[Type.TObject<{
757
+ kind: Type.TLiteral<"exact">;
758
+ model: Type.TObject<{
759
+ provider: Type.TString;
760
+ id: Type.TString;
761
+ }>;
762
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
763
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
764
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
765
+ settingsVersion: Type.TString;
766
+ }>, Type.TNull]>;
767
+ }>;
768
+ context: Type.TObject<{
769
+ tokens: Type.TNumber;
770
+ window: Type.TNumber;
771
+ lastRequest: Type.TUnion<[Type.TObject<{
772
+ input: Type.TNumber;
773
+ output: Type.TNumber;
774
+ cacheRead: Type.TNumber;
775
+ cacheWrite: Type.TNumber;
776
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
777
+ total: Type.TNumber;
778
+ cost: Type.TObject<{
779
+ input: Type.TNumber;
780
+ output: Type.TNumber;
781
+ cacheRead: Type.TNumber;
782
+ cacheWrite: Type.TNumber;
783
+ total: Type.TNumber;
784
+ }>;
785
+ }>, Type.TNull]>;
786
+ }>;
787
+ heads: Type.TArray<Type.TObject<{
788
+ name: Type.TUnsafe<import("./ids.ts").Id<"head">>;
789
+ tip: Type.TUnion<[Type.TObject<{
790
+ kind: Type.TLiteral<"start">;
791
+ }>, Type.TObject<{
792
+ kind: Type.TLiteral<"commit">;
793
+ id: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
794
+ }>]>;
795
+ stack: Type.TUnion<[Type.TObject<{
796
+ parent: Type.TUnsafe<import("./ids.ts").Id<"head">>;
797
+ base: Type.TUnion<[Type.TObject<{
798
+ kind: Type.TLiteral<"start">;
799
+ }>, Type.TObject<{
800
+ kind: Type.TLiteral<"commit">;
801
+ id: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
802
+ }>]>;
803
+ stale: Type.TBoolean;
804
+ }>, Type.TNull]>;
805
+ execution: Type.TUnion<[Type.TObject<{
806
+ kind: Type.TLiteral<"idle">;
807
+ lastRun: Type.TUnion<[Type.TObject<{
808
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
809
+ end: Type.TUnion<[Type.TObject<{
810
+ kind: Type.TLiteral<"completed">;
811
+ usage: Type.TObject<{
812
+ input: Type.TNumber;
813
+ output: Type.TNumber;
814
+ cacheRead: Type.TNumber;
815
+ cacheWrite: Type.TNumber;
816
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
817
+ total: Type.TNumber;
818
+ cost: Type.TObject<{
819
+ input: Type.TNumber;
820
+ output: Type.TNumber;
821
+ cacheRead: Type.TNumber;
822
+ cacheWrite: Type.TNumber;
823
+ total: Type.TNumber;
824
+ }>;
825
+ }>;
826
+ }>, Type.TObject<{
827
+ kind: Type.TLiteral<"stopped">;
828
+ }>, Type.TObject<{
829
+ kind: Type.TLiteral<"failed">;
830
+ failure: Type.TObject<{
831
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
832
+ message: Type.TString;
833
+ retryAfterMs: Type.TOptional<Type.TNumber>;
834
+ }>;
835
+ }>]>;
836
+ endedAt: Type.TNumber;
837
+ }>, Type.TNull]>;
838
+ }>, Type.TObject<{
839
+ kind: Type.TLiteral<"live">;
840
+ run: Type.TObject<{
841
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
842
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
843
+ startedAt: Type.TNumber;
844
+ attempt: Type.TNumber;
845
+ configuration: Type.TObject<{
846
+ kind: Type.TLiteral<"exact">;
847
+ model: Type.TObject<{
848
+ provider: Type.TString;
849
+ id: Type.TString;
850
+ }>;
851
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
852
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
853
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
854
+ settingsVersion: Type.TString;
855
+ }>;
856
+ origin: Type.TUnion<[Type.TObject<{
857
+ kind: Type.TLiteral<"input">;
858
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
859
+ }>, Type.TObject<{
860
+ kind: Type.TLiteral<"continuation">;
861
+ from: Type.TEnum<["child", "job", "wake"]>;
862
+ }>]>;
863
+ }>;
864
+ phase: Type.TEnum<["responding", "executing"]>;
865
+ stopping: Type.TBoolean;
866
+ }>, Type.TObject<{
867
+ kind: Type.TLiteral<"waiting">;
868
+ run: Type.TObject<{
869
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
870
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
871
+ startedAt: Type.TNumber;
872
+ attempt: Type.TNumber;
873
+ configuration: Type.TObject<{
874
+ kind: Type.TLiteral<"exact">;
875
+ model: Type.TObject<{
876
+ provider: Type.TString;
877
+ id: Type.TString;
878
+ }>;
879
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
880
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
881
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
882
+ settingsVersion: Type.TString;
883
+ }>;
884
+ origin: Type.TUnion<[Type.TObject<{
885
+ kind: Type.TLiteral<"input">;
886
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
887
+ }>, Type.TObject<{
888
+ kind: Type.TLiteral<"continuation">;
889
+ from: Type.TEnum<["child", "job", "wake"]>;
890
+ }>]>;
891
+ }>;
892
+ on: Type.TUnion<[Type.TObject<{
893
+ kind: Type.TLiteral<"run">;
894
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
895
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
896
+ deadline: Type.TOptional<Type.TNumber>;
897
+ }>, Type.TObject<{
898
+ kind: Type.TLiteral<"job">;
899
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
900
+ deadline: Type.TOptional<Type.TNumber>;
901
+ }>, Type.TObject<{
902
+ kind: Type.TLiteral<"part">;
903
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
904
+ deadline: Type.TOptional<Type.TNumber>;
905
+ }>, Type.TObject<{
906
+ kind: Type.TLiteral<"timer">;
907
+ until: Type.TNumber;
908
+ deadline: Type.TOptional<Type.TNumber>;
909
+ }>]>;
910
+ }>, Type.TObject<{
911
+ kind: Type.TLiteral<"retrying">;
912
+ run: Type.TObject<{
913
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
914
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
915
+ startedAt: Type.TNumber;
916
+ attempt: Type.TNumber;
917
+ configuration: Type.TObject<{
918
+ kind: Type.TLiteral<"exact">;
919
+ model: Type.TObject<{
920
+ provider: Type.TString;
921
+ id: Type.TString;
922
+ }>;
923
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
924
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
925
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
926
+ settingsVersion: Type.TString;
927
+ }>;
928
+ origin: Type.TUnion<[Type.TObject<{
929
+ kind: Type.TLiteral<"input">;
930
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
931
+ }>, Type.TObject<{
932
+ kind: Type.TLiteral<"continuation">;
933
+ from: Type.TEnum<["child", "job", "wake"]>;
934
+ }>]>;
935
+ }>;
936
+ until: Type.TNumber;
937
+ reason: Type.TString;
938
+ }>]>;
939
+ unread: Type.TBoolean;
940
+ }>>;
941
+ changes: Type.TArray<Type.TObject<{
942
+ path: Type.TString;
943
+ status: Type.TEnum<["added", "modified", "deleted", "renamed", "untracked", "conflicted"]>;
944
+ added: Type.TNumber;
945
+ removed: Type.TNumber;
946
+ from: Type.TOptional<Type.TString>;
947
+ }>>;
948
+ catalog: Type.TObject<{
949
+ commands: Type.TArray<Type.TObject<{
950
+ name: Type.TString;
951
+ owner: Type.TString;
952
+ side: Type.TEnum<["core", "client"]>;
953
+ title: Type.TString;
954
+ description: Type.TString;
955
+ takesText: Type.TBoolean;
956
+ completes: Type.TBoolean;
957
+ category: Type.TOptional<Type.TString>;
958
+ keywords: Type.TOptional<Type.TArray<Type.TString>>;
959
+ }>>;
960
+ settings: Type.TArray<Type.TObject<{
961
+ id: Type.TString;
962
+ owner: Type.TString;
963
+ scope: Type.TEnum<["host", "session"]>;
964
+ label: Type.TString;
965
+ schema: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
966
+ choices: Type.TUnion<[Type.TArray<Type.TObject<{
967
+ value: Type.TUnsafe<import("./json.ts").Json>;
968
+ label: Type.TString;
969
+ badge: Type.TOptional<Type.TString>;
970
+ }>>, Type.TNull]>;
971
+ value: Type.TUnsafe<import("./json.ts").Json>;
972
+ from: Type.TEnum<["default", "host", "session"]>;
973
+ }>>;
974
+ skills: Type.TArray<Type.TObject<{
975
+ name: Type.TString;
976
+ owner: Type.TString;
977
+ description: Type.TString;
978
+ location: Type.TString;
979
+ }>>;
980
+ agents: Type.TArray<Type.TObject<{
981
+ id: Type.TString;
982
+ owner: Type.TString;
983
+ description: Type.TUnion<[Type.TString, Type.TNull]>;
984
+ model: Type.TUnion<[Type.TObject<{
985
+ provider: Type.TString;
986
+ id: Type.TString;
987
+ }>, Type.TNull]>;
988
+ mode: Type.TEnum<["primary", "subagent", "all"]>;
989
+ }>>;
990
+ tools: Type.TArray<Type.TObject<{
991
+ name: Type.TString;
992
+ owner: Type.TString;
993
+ namespace: Type.TUnion<[Type.TString, Type.TNull]>;
994
+ description: Type.TString;
995
+ parameters: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
996
+ output: Type.TUnion<[Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>, Type.TNull]>;
997
+ exposure: Type.TEnum<["model", "deferred", "code", "hidden"]>;
998
+ }>>;
999
+ }>;
1000
+ }>;
1001
+ /** A head's view: its last `tail` messages, the turns those messages belong to from the earliest one on (older turns arrive with older messages through `head.history`), and `usage`, the sum of every completed run on the head's history. */
1002
+ export type SessionView = Decoded<typeof SessionViewType>;
1003
+ export declare const HistoryPageType: Type.TObject<{
1004
+ messages: Type.TArray<Type.TUnion<[Type.TObject<{
1005
+ kind: Type.TLiteral<"user">;
1006
+ content: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TObject<{
1007
+ kind: Type.TLiteral<"text">;
1008
+ text: Type.TString;
1009
+ }>, Type.TObject<{
1010
+ kind: Type.TLiteral<"file">;
1011
+ blob: Type.TUnsafe<import("./ids.ts").Id<"blob">>;
1012
+ mime: Type.TString;
1013
+ name: Type.TString;
1014
+ }>, Type.TObject<{
1015
+ kind: Type.TLiteral<"reference">;
1016
+ path: Type.TString;
1017
+ blob: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"blob">>>;
1018
+ }>, Type.TObject<{
1019
+ kind: Type.TLiteral<"skill">;
1020
+ name: Type.TString;
1021
+ location: Type.TString;
1022
+ }>, Type.TObject<{
1023
+ kind: Type.TLiteral<"excerpt">;
1024
+ source: Type.TUnion<[Type.TObject<{
1025
+ kind: Type.TLiteral<"diff">;
1026
+ path: Type.TString;
1027
+ side: Type.TEnum<["old", "new"]>;
1028
+ start: Type.TNumber;
1029
+ end: Type.TNumber;
1030
+ }>, Type.TObject<{
1031
+ kind: Type.TLiteral<"terminal">;
1032
+ command: Type.TOptional<Type.TString>;
1033
+ }>, Type.TObject<{
1034
+ kind: Type.TLiteral<"browser">;
1035
+ url: Type.TString;
1036
+ selector: Type.TString;
1037
+ }>]>;
1038
+ text: Type.TString;
1039
+ }>]>>]>;
1040
+ source: Type.TUnion<[Type.TObject<{
1041
+ kind: Type.TLiteral<"user">;
1042
+ }>, Type.TObject<{
1043
+ kind: Type.TLiteral<"child">;
1044
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1045
+ end: Type.TEnum<["completed", "stopped", "failed"]>;
1046
+ }>, Type.TObject<{
1047
+ kind: Type.TLiteral<"job">;
1048
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1049
+ }>, Type.TObject<{
1050
+ kind: Type.TLiteral<"shell">;
1051
+ }>, Type.TObject<{
1052
+ kind: Type.TLiteral<"action">;
1053
+ label: Type.TString;
1054
+ command: Type.TOptional<Type.TString>;
1055
+ }>]>;
1056
+ delivery: Type.TEnum<["steer", "queue", "attach"]>;
1057
+ status: Type.TUnion<[Type.TObject<{
1058
+ kind: Type.TLiteral<"unsent">;
1059
+ attempts: Type.TNumber;
1060
+ retrying: Type.TUnion<[Type.TObject<{
1061
+ at: Type.TNumber;
1062
+ reason: Type.TString;
1063
+ }>, Type.TNull]>;
1064
+ }>, Type.TObject<{
1065
+ kind: Type.TLiteral<"pending">;
1066
+ schedule: Type.TUnion<[Type.TObject<{
1067
+ kind: Type.TLiteral<"joined">;
1068
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1069
+ }>, Type.TObject<{
1070
+ kind: Type.TLiteral<"next-turn">;
1071
+ reason: Type.TEnum<["requested", "idle", "run-ended", "configuration"]>;
1072
+ }>, Type.TObject<{
1073
+ kind: Type.TLiteral<"attached">;
1074
+ }>, Type.TObject<{
1075
+ kind: Type.TLiteral<"deciding">;
1076
+ }>]>;
1077
+ covered: Type.TBoolean;
1078
+ }>, Type.TObject<{
1079
+ kind: Type.TLiteral<"landed">;
1080
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1081
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1082
+ replaced: Type.TUnion<[Type.TObject<{
1083
+ previous: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1084
+ stopped: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1085
+ }>, Type.TNull]>;
1086
+ }>]>;
1087
+ siblings: Type.TObject<{
1088
+ index: Type.TNumber;
1089
+ count: Type.TNumber;
1090
+ ids: Type.TArray<Type.TUnsafe<import("./ids.ts").Id<"commit">>>;
1091
+ }>;
1092
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1093
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
1094
+ at: Type.TNumber;
1095
+ }>, Type.TObject<{
1096
+ kind: Type.TLiteral<"part">;
1097
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1098
+ partKind: Type.TString;
1099
+ role: Type.TEnum<["step", "answer", "note"]>;
1100
+ state: Type.TUnknown;
1101
+ version: Type.TNumber;
1102
+ status: Type.TUnion<[Type.TObject<{
1103
+ kind: Type.TLiteral<"live">;
1104
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1105
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
1106
+ answer: Type.TOptional<Type.TObject<{
1107
+ action: Type.TString;
1108
+ input: Type.TUnsafe<import("./json.ts").Json>;
1109
+ }>>;
1110
+ }>, Type.TObject<{
1111
+ kind: Type.TLiteral<"waiting">;
1112
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1113
+ on: Type.TUnion<[Type.TObject<{
1114
+ kind: Type.TLiteral<"run">;
1115
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1116
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1117
+ deadline: Type.TOptional<Type.TNumber>;
1118
+ }>, Type.TObject<{
1119
+ kind: Type.TLiteral<"job">;
1120
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1121
+ deadline: Type.TOptional<Type.TNumber>;
1122
+ }>, Type.TObject<{
1123
+ kind: Type.TLiteral<"part">;
1124
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1125
+ deadline: Type.TOptional<Type.TNumber>;
1126
+ }>, Type.TObject<{
1127
+ kind: Type.TLiteral<"timer">;
1128
+ until: Type.TNumber;
1129
+ deadline: Type.TOptional<Type.TNumber>;
1130
+ }>]>;
1131
+ }>, Type.TObject<{
1132
+ kind: Type.TLiteral<"settled">;
1133
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1134
+ endedAt: Type.TNumber;
1135
+ }>, Type.TObject<{
1136
+ kind: Type.TLiteral<"failed">;
1137
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1138
+ failure: Type.TObject<{
1139
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1140
+ message: Type.TString;
1141
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1142
+ }>;
1143
+ }>]>;
1144
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1145
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
1146
+ at: Type.TNumber;
1147
+ }>]>>;
1148
+ turns: Type.TArray<Type.TObject<{
1149
+ id: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
1150
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1151
+ prompt: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"message">>, Type.TNull]>;
1152
+ state: Type.TUnion<[Type.TObject<{
1153
+ kind: Type.TLiteral<"working">;
1154
+ activity: Type.TUnion<[Type.TString, Type.TNull]>;
1155
+ }>, Type.TObject<{
1156
+ kind: Type.TLiteral<"waiting">;
1157
+ on: Type.TUnion<[Type.TObject<{
1158
+ kind: Type.TLiteral<"run">;
1159
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1160
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1161
+ deadline: Type.TOptional<Type.TNumber>;
1162
+ }>, Type.TObject<{
1163
+ kind: Type.TLiteral<"job">;
1164
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1165
+ deadline: Type.TOptional<Type.TNumber>;
1166
+ }>, Type.TObject<{
1167
+ kind: Type.TLiteral<"part">;
1168
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1169
+ deadline: Type.TOptional<Type.TNumber>;
1170
+ }>, Type.TObject<{
1171
+ kind: Type.TLiteral<"timer">;
1172
+ until: Type.TNumber;
1173
+ deadline: Type.TOptional<Type.TNumber>;
1174
+ }>]>;
1175
+ }>, Type.TObject<{
1176
+ kind: Type.TLiteral<"ended">;
1177
+ end: Type.TUnion<[Type.TObject<{
1178
+ kind: Type.TLiteral<"completed">;
1179
+ usage: Type.TObject<{
1180
+ input: Type.TNumber;
1181
+ output: Type.TNumber;
1182
+ cacheRead: Type.TNumber;
1183
+ cacheWrite: Type.TNumber;
1184
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
1185
+ total: Type.TNumber;
1186
+ cost: Type.TObject<{
1187
+ input: Type.TNumber;
1188
+ output: Type.TNumber;
1189
+ cacheRead: Type.TNumber;
1190
+ cacheWrite: Type.TNumber;
1191
+ total: Type.TNumber;
1192
+ }>;
1193
+ }>;
1194
+ }>, Type.TObject<{
1195
+ kind: Type.TLiteral<"stopped">;
1196
+ }>, Type.TObject<{
1197
+ kind: Type.TLiteral<"failed">;
1198
+ failure: Type.TObject<{
1199
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1200
+ message: Type.TString;
1201
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1202
+ }>;
1203
+ }>]>;
1204
+ }>]>;
1205
+ startedAt: Type.TNumber;
1206
+ endedAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
1207
+ steps: Type.TNumber;
1208
+ thinkingOnly: Type.TBoolean;
1209
+ summary: Type.TObject<{
1210
+ byClass: Type.TObject<{
1211
+ read: Type.TObject<{
1212
+ count: Type.TNumber;
1213
+ paths: Type.TArray<Type.TString>;
1214
+ }>;
1215
+ list: Type.TObject<{
1216
+ count: Type.TNumber;
1217
+ paths: Type.TArray<Type.TString>;
1218
+ }>;
1219
+ edit: Type.TObject<{
1220
+ count: Type.TNumber;
1221
+ paths: Type.TArray<Type.TString>;
1222
+ }>;
1223
+ shell: Type.TObject<{
1224
+ count: Type.TNumber;
1225
+ paths: Type.TArray<Type.TString>;
1226
+ }>;
1227
+ delegate: Type.TObject<{
1228
+ count: Type.TNumber;
1229
+ paths: Type.TArray<Type.TString>;
1230
+ }>;
1231
+ custom: Type.TObject<{
1232
+ count: Type.TNumber;
1233
+ paths: Type.TArray<Type.TString>;
1234
+ }>;
1235
+ }>;
1236
+ failed: Type.TNumber;
1237
+ stopped: Type.TNumber;
1238
+ added: Type.TNumber;
1239
+ removed: Type.TNumber;
1240
+ }>;
1241
+ }>>;
1242
+ }>;
1243
+ /** Messages before a view's window, with the turns they belong to. */
1244
+ export type HistoryPage = Decoded<typeof HistoryPageType>;
1245
+ export declare const ViewAppendType: Type.TObject<{
1246
+ at: Type.TNumber;
1247
+ append: Type.TString;
1248
+ version: Type.TNumber;
1249
+ }>;
1250
+ /** Text a streaming part streamed since the previous frame: the message at `at` of the spliced messages, its `state.markdown` grown by `append`, now at `version`. */
1251
+ export type ViewAppend = Decoded<typeof ViewAppendType>;
1252
+ export declare const ViewFrameType: Type.TUnion<[Type.TObject<{
1253
+ kind: Type.TLiteral<"view">;
1254
+ view: Type.TObject<{
1255
+ revision: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"revision">>, Type.TNull]>;
1256
+ seq: Type.TUnsafe<import("./ids.ts").Seq>;
1257
+ activation: Type.TUnion<[Type.TObject<{
1258
+ kind: Type.TLiteral<"active">;
1259
+ }>, Type.TObject<{
1260
+ kind: Type.TLiteral<"inactive">;
1261
+ }>, Type.TObject<{
1262
+ kind: Type.TLiteral<"unavailable">;
1263
+ reason: Type.TEnum<["unsupported", "unreachable"]>;
1264
+ workspace: Type.TUnsafe<import("./ids.ts").Id<"workspace">>;
1265
+ }>, Type.TObject<{
1266
+ kind: Type.TLiteral<"failed">;
1267
+ message: Type.TString;
1268
+ }>]>;
1269
+ messages: Type.TArray<Type.TUnion<[Type.TObject<{
1270
+ kind: Type.TLiteral<"user">;
1271
+ content: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TObject<{
1272
+ kind: Type.TLiteral<"text">;
1273
+ text: Type.TString;
1274
+ }>, Type.TObject<{
1275
+ kind: Type.TLiteral<"file">;
1276
+ blob: Type.TUnsafe<import("./ids.ts").Id<"blob">>;
1277
+ mime: Type.TString;
1278
+ name: Type.TString;
1279
+ }>, Type.TObject<{
1280
+ kind: Type.TLiteral<"reference">;
1281
+ path: Type.TString;
1282
+ blob: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"blob">>>;
1283
+ }>, Type.TObject<{
1284
+ kind: Type.TLiteral<"skill">;
1285
+ name: Type.TString;
1286
+ location: Type.TString;
1287
+ }>, Type.TObject<{
1288
+ kind: Type.TLiteral<"excerpt">;
1289
+ source: Type.TUnion<[Type.TObject<{
1290
+ kind: Type.TLiteral<"diff">;
1291
+ path: Type.TString;
1292
+ side: Type.TEnum<["old", "new"]>;
1293
+ start: Type.TNumber;
1294
+ end: Type.TNumber;
1295
+ }>, Type.TObject<{
1296
+ kind: Type.TLiteral<"terminal">;
1297
+ command: Type.TOptional<Type.TString>;
1298
+ }>, Type.TObject<{
1299
+ kind: Type.TLiteral<"browser">;
1300
+ url: Type.TString;
1301
+ selector: Type.TString;
1302
+ }>]>;
1303
+ text: Type.TString;
1304
+ }>]>>]>;
1305
+ source: Type.TUnion<[Type.TObject<{
1306
+ kind: Type.TLiteral<"user">;
1307
+ }>, Type.TObject<{
1308
+ kind: Type.TLiteral<"child">;
1309
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1310
+ end: Type.TEnum<["completed", "stopped", "failed"]>;
1311
+ }>, Type.TObject<{
1312
+ kind: Type.TLiteral<"job">;
1313
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1314
+ }>, Type.TObject<{
1315
+ kind: Type.TLiteral<"shell">;
1316
+ }>, Type.TObject<{
1317
+ kind: Type.TLiteral<"action">;
1318
+ label: Type.TString;
1319
+ command: Type.TOptional<Type.TString>;
1320
+ }>]>;
1321
+ delivery: Type.TEnum<["steer", "queue", "attach"]>;
1322
+ status: Type.TUnion<[Type.TObject<{
1323
+ kind: Type.TLiteral<"unsent">;
1324
+ attempts: Type.TNumber;
1325
+ retrying: Type.TUnion<[Type.TObject<{
1326
+ at: Type.TNumber;
1327
+ reason: Type.TString;
1328
+ }>, Type.TNull]>;
1329
+ }>, Type.TObject<{
1330
+ kind: Type.TLiteral<"pending">;
1331
+ schedule: Type.TUnion<[Type.TObject<{
1332
+ kind: Type.TLiteral<"joined">;
1333
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1334
+ }>, Type.TObject<{
1335
+ kind: Type.TLiteral<"next-turn">;
1336
+ reason: Type.TEnum<["requested", "idle", "run-ended", "configuration"]>;
1337
+ }>, Type.TObject<{
1338
+ kind: Type.TLiteral<"attached">;
1339
+ }>, Type.TObject<{
1340
+ kind: Type.TLiteral<"deciding">;
1341
+ }>]>;
1342
+ covered: Type.TBoolean;
1343
+ }>, Type.TObject<{
1344
+ kind: Type.TLiteral<"landed">;
1345
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1346
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1347
+ replaced: Type.TUnion<[Type.TObject<{
1348
+ previous: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1349
+ stopped: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1350
+ }>, Type.TNull]>;
1351
+ }>]>;
1352
+ siblings: Type.TObject<{
1353
+ index: Type.TNumber;
1354
+ count: Type.TNumber;
1355
+ ids: Type.TArray<Type.TUnsafe<import("./ids.ts").Id<"commit">>>;
1356
+ }>;
1357
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1358
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
1359
+ at: Type.TNumber;
1360
+ }>, Type.TObject<{
1361
+ kind: Type.TLiteral<"part">;
1362
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1363
+ partKind: Type.TString;
1364
+ role: Type.TEnum<["step", "answer", "note"]>;
1365
+ state: Type.TUnknown;
1366
+ version: Type.TNumber;
1367
+ status: Type.TUnion<[Type.TObject<{
1368
+ kind: Type.TLiteral<"live">;
1369
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1370
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
1371
+ answer: Type.TOptional<Type.TObject<{
1372
+ action: Type.TString;
1373
+ input: Type.TUnsafe<import("./json.ts").Json>;
1374
+ }>>;
1375
+ }>, Type.TObject<{
1376
+ kind: Type.TLiteral<"waiting">;
1377
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1378
+ on: Type.TUnion<[Type.TObject<{
1379
+ kind: Type.TLiteral<"run">;
1380
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1381
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1382
+ deadline: Type.TOptional<Type.TNumber>;
1383
+ }>, Type.TObject<{
1384
+ kind: Type.TLiteral<"job">;
1385
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1386
+ deadline: Type.TOptional<Type.TNumber>;
1387
+ }>, Type.TObject<{
1388
+ kind: Type.TLiteral<"part">;
1389
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1390
+ deadline: Type.TOptional<Type.TNumber>;
1391
+ }>, Type.TObject<{
1392
+ kind: Type.TLiteral<"timer">;
1393
+ until: Type.TNumber;
1394
+ deadline: Type.TOptional<Type.TNumber>;
1395
+ }>]>;
1396
+ }>, Type.TObject<{
1397
+ kind: Type.TLiteral<"settled">;
1398
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1399
+ endedAt: Type.TNumber;
1400
+ }>, Type.TObject<{
1401
+ kind: Type.TLiteral<"failed">;
1402
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1403
+ failure: Type.TObject<{
1404
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1405
+ message: Type.TString;
1406
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1407
+ }>;
1408
+ }>]>;
1409
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1410
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
1411
+ at: Type.TNumber;
1412
+ }>]>>;
1413
+ parts: Type.TArray<Type.TObject<{
1414
+ id: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1415
+ partKind: Type.TString;
1416
+ placement: Type.TUnion<[Type.TObject<{
1417
+ kind: Type.TLiteral<"transcript">;
1418
+ role: Type.TEnum<["step", "answer", "note"]>;
1419
+ }>, Type.TObject<{
1420
+ kind: Type.TLiteral<"modal">;
1421
+ }>, Type.TIntersect<[Type.TObject<{
1422
+ kind: Type.TString;
1423
+ }>, Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>]>]>;
1424
+ state: Type.TUnsafe<import("./json.ts").Json>;
1425
+ version: Type.TNumber;
1426
+ status: Type.TUnion<[Type.TObject<{
1427
+ kind: Type.TLiteral<"live">;
1428
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1429
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
1430
+ answer: Type.TOptional<Type.TObject<{
1431
+ action: Type.TString;
1432
+ input: Type.TUnsafe<import("./json.ts").Json>;
1433
+ }>>;
1434
+ }>, Type.TObject<{
1435
+ kind: Type.TLiteral<"waiting">;
1436
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1437
+ on: Type.TUnion<[Type.TObject<{
1438
+ kind: Type.TLiteral<"run">;
1439
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1440
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1441
+ deadline: Type.TOptional<Type.TNumber>;
1442
+ }>, Type.TObject<{
1443
+ kind: Type.TLiteral<"job">;
1444
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1445
+ deadline: Type.TOptional<Type.TNumber>;
1446
+ }>, Type.TObject<{
1447
+ kind: Type.TLiteral<"part">;
1448
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1449
+ deadline: Type.TOptional<Type.TNumber>;
1450
+ }>, Type.TObject<{
1451
+ kind: Type.TLiteral<"timer">;
1452
+ until: Type.TNumber;
1453
+ deadline: Type.TOptional<Type.TNumber>;
1454
+ }>]>;
1455
+ }>, Type.TObject<{
1456
+ kind: Type.TLiteral<"settled">;
1457
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1458
+ endedAt: Type.TNumber;
1459
+ }>, Type.TObject<{
1460
+ kind: Type.TLiteral<"failed">;
1461
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1462
+ failure: Type.TObject<{
1463
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1464
+ message: Type.TString;
1465
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1466
+ }>;
1467
+ }>]>;
1468
+ owner: Type.TUnion<[Type.TString, Type.TNull]>;
1469
+ }>>;
1470
+ turns: Type.TArray<Type.TObject<{
1471
+ id: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
1472
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
1473
+ prompt: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"message">>, Type.TNull]>;
1474
+ state: Type.TUnion<[Type.TObject<{
1475
+ kind: Type.TLiteral<"working">;
1476
+ activity: Type.TUnion<[Type.TString, Type.TNull]>;
1477
+ }>, Type.TObject<{
1478
+ kind: Type.TLiteral<"waiting">;
1479
+ on: Type.TUnion<[Type.TObject<{
1480
+ kind: Type.TLiteral<"run">;
1481
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1482
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1483
+ deadline: Type.TOptional<Type.TNumber>;
1484
+ }>, Type.TObject<{
1485
+ kind: Type.TLiteral<"job">;
1486
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1487
+ deadline: Type.TOptional<Type.TNumber>;
1488
+ }>, Type.TObject<{
1489
+ kind: Type.TLiteral<"part">;
1490
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1491
+ deadline: Type.TOptional<Type.TNumber>;
1492
+ }>, Type.TObject<{
1493
+ kind: Type.TLiteral<"timer">;
1494
+ until: Type.TNumber;
1495
+ deadline: Type.TOptional<Type.TNumber>;
1496
+ }>]>;
1497
+ }>, Type.TObject<{
1498
+ kind: Type.TLiteral<"ended">;
1499
+ end: Type.TUnion<[Type.TObject<{
1500
+ kind: Type.TLiteral<"completed">;
1501
+ usage: Type.TObject<{
1502
+ input: Type.TNumber;
1503
+ output: Type.TNumber;
1504
+ cacheRead: Type.TNumber;
1505
+ cacheWrite: Type.TNumber;
1506
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
1507
+ total: Type.TNumber;
1508
+ cost: Type.TObject<{
1509
+ input: Type.TNumber;
1510
+ output: Type.TNumber;
1511
+ cacheRead: Type.TNumber;
1512
+ cacheWrite: Type.TNumber;
1513
+ total: Type.TNumber;
1514
+ }>;
1515
+ }>;
1516
+ }>, Type.TObject<{
1517
+ kind: Type.TLiteral<"stopped">;
1518
+ }>, Type.TObject<{
1519
+ kind: Type.TLiteral<"failed">;
1520
+ failure: Type.TObject<{
1521
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1522
+ message: Type.TString;
1523
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1524
+ }>;
1525
+ }>]>;
1526
+ }>]>;
1527
+ startedAt: Type.TNumber;
1528
+ endedAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
1529
+ steps: Type.TNumber;
1530
+ thinkingOnly: Type.TBoolean;
1531
+ summary: Type.TObject<{
1532
+ byClass: Type.TObject<{
1533
+ read: Type.TObject<{
1534
+ count: Type.TNumber;
1535
+ paths: Type.TArray<Type.TString>;
1536
+ }>;
1537
+ list: Type.TObject<{
1538
+ count: Type.TNumber;
1539
+ paths: Type.TArray<Type.TString>;
1540
+ }>;
1541
+ edit: Type.TObject<{
1542
+ count: Type.TNumber;
1543
+ paths: Type.TArray<Type.TString>;
1544
+ }>;
1545
+ shell: Type.TObject<{
1546
+ count: Type.TNumber;
1547
+ paths: Type.TArray<Type.TString>;
1548
+ }>;
1549
+ delegate: Type.TObject<{
1550
+ count: Type.TNumber;
1551
+ paths: Type.TArray<Type.TString>;
1552
+ }>;
1553
+ custom: Type.TObject<{
1554
+ count: Type.TNumber;
1555
+ paths: Type.TArray<Type.TString>;
1556
+ }>;
1557
+ }>;
1558
+ failed: Type.TNumber;
1559
+ stopped: Type.TNumber;
1560
+ added: Type.TNumber;
1561
+ removed: Type.TNumber;
1562
+ }>;
1563
+ }>>;
1564
+ usage: Type.TObject<{
1565
+ input: Type.TNumber;
1566
+ output: Type.TNumber;
1567
+ cacheRead: Type.TNumber;
1568
+ cacheWrite: Type.TNumber;
1569
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
1570
+ total: Type.TNumber;
1571
+ cost: Type.TObject<{
1572
+ input: Type.TNumber;
1573
+ output: Type.TNumber;
1574
+ cacheRead: Type.TNumber;
1575
+ cacheWrite: Type.TNumber;
1576
+ total: Type.TNumber;
1577
+ }>;
1578
+ }>;
1579
+ execution: Type.TUnion<[Type.TObject<{
1580
+ kind: Type.TLiteral<"idle">;
1581
+ lastRun: Type.TUnion<[Type.TObject<{
1582
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1583
+ end: Type.TUnion<[Type.TObject<{
1584
+ kind: Type.TLiteral<"completed">;
1585
+ usage: Type.TObject<{
1586
+ input: Type.TNumber;
1587
+ output: Type.TNumber;
1588
+ cacheRead: Type.TNumber;
1589
+ cacheWrite: Type.TNumber;
1590
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
1591
+ total: Type.TNumber;
1592
+ cost: Type.TObject<{
1593
+ input: Type.TNumber;
1594
+ output: Type.TNumber;
1595
+ cacheRead: Type.TNumber;
1596
+ cacheWrite: Type.TNumber;
1597
+ total: Type.TNumber;
1598
+ }>;
1599
+ }>;
1600
+ }>, Type.TObject<{
1601
+ kind: Type.TLiteral<"stopped">;
1602
+ }>, Type.TObject<{
1603
+ kind: Type.TLiteral<"failed">;
1604
+ failure: Type.TObject<{
1605
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1606
+ message: Type.TString;
1607
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1608
+ }>;
1609
+ }>]>;
1610
+ endedAt: Type.TNumber;
1611
+ }>, Type.TNull]>;
1612
+ }>, Type.TObject<{
1613
+ kind: Type.TLiteral<"live">;
1614
+ run: Type.TObject<{
1615
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1616
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1617
+ startedAt: Type.TNumber;
1618
+ attempt: Type.TNumber;
1619
+ configuration: Type.TObject<{
1620
+ kind: Type.TLiteral<"exact">;
1621
+ model: Type.TObject<{
1622
+ provider: Type.TString;
1623
+ id: Type.TString;
1624
+ }>;
1625
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1626
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1627
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1628
+ settingsVersion: Type.TString;
1629
+ }>;
1630
+ origin: Type.TUnion<[Type.TObject<{
1631
+ kind: Type.TLiteral<"input">;
1632
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1633
+ }>, Type.TObject<{
1634
+ kind: Type.TLiteral<"continuation">;
1635
+ from: Type.TEnum<["child", "job", "wake"]>;
1636
+ }>]>;
1637
+ }>;
1638
+ phase: Type.TEnum<["responding", "executing"]>;
1639
+ stopping: Type.TBoolean;
1640
+ }>, Type.TObject<{
1641
+ kind: Type.TLiteral<"waiting">;
1642
+ run: Type.TObject<{
1643
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1644
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1645
+ startedAt: Type.TNumber;
1646
+ attempt: Type.TNumber;
1647
+ configuration: Type.TObject<{
1648
+ kind: Type.TLiteral<"exact">;
1649
+ model: Type.TObject<{
1650
+ provider: Type.TString;
1651
+ id: Type.TString;
1652
+ }>;
1653
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1654
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1655
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1656
+ settingsVersion: Type.TString;
1657
+ }>;
1658
+ origin: Type.TUnion<[Type.TObject<{
1659
+ kind: Type.TLiteral<"input">;
1660
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1661
+ }>, Type.TObject<{
1662
+ kind: Type.TLiteral<"continuation">;
1663
+ from: Type.TEnum<["child", "job", "wake"]>;
1664
+ }>]>;
1665
+ }>;
1666
+ on: Type.TUnion<[Type.TObject<{
1667
+ kind: Type.TLiteral<"run">;
1668
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1669
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1670
+ deadline: Type.TOptional<Type.TNumber>;
1671
+ }>, Type.TObject<{
1672
+ kind: Type.TLiteral<"job">;
1673
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1674
+ deadline: Type.TOptional<Type.TNumber>;
1675
+ }>, Type.TObject<{
1676
+ kind: Type.TLiteral<"part">;
1677
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1678
+ deadline: Type.TOptional<Type.TNumber>;
1679
+ }>, Type.TObject<{
1680
+ kind: Type.TLiteral<"timer">;
1681
+ until: Type.TNumber;
1682
+ deadline: Type.TOptional<Type.TNumber>;
1683
+ }>]>;
1684
+ }>, Type.TObject<{
1685
+ kind: Type.TLiteral<"retrying">;
1686
+ run: Type.TObject<{
1687
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1688
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1689
+ startedAt: Type.TNumber;
1690
+ attempt: Type.TNumber;
1691
+ configuration: Type.TObject<{
1692
+ kind: Type.TLiteral<"exact">;
1693
+ model: Type.TObject<{
1694
+ provider: Type.TString;
1695
+ id: Type.TString;
1696
+ }>;
1697
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1698
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1699
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1700
+ settingsVersion: Type.TString;
1701
+ }>;
1702
+ origin: Type.TUnion<[Type.TObject<{
1703
+ kind: Type.TLiteral<"input">;
1704
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1705
+ }>, Type.TObject<{
1706
+ kind: Type.TLiteral<"continuation">;
1707
+ from: Type.TEnum<["child", "job", "wake"]>;
1708
+ }>]>;
1709
+ }>;
1710
+ until: Type.TNumber;
1711
+ reason: Type.TString;
1712
+ }>]>;
1713
+ background: Type.TArray<Type.TObject<{
1714
+ kind: Type.TEnum<["child", "job", "page"]>;
1715
+ id: Type.TString;
1716
+ title: Type.TString;
1717
+ state: Type.TEnum<["working", "waiting", "done", "failed"]>;
1718
+ startedBy: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"call">>, Type.TNull]>;
1719
+ }>>;
1720
+ configuration: Type.TObject<{
1721
+ selected: Type.TUnion<[Type.TObject<{
1722
+ kind: Type.TLiteral<"exact">;
1723
+ model: Type.TObject<{
1724
+ provider: Type.TString;
1725
+ id: Type.TString;
1726
+ }>;
1727
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1728
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1729
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1730
+ settingsVersion: Type.TString;
1731
+ }>, Type.TNull]>;
1732
+ effective: Type.TUnion<[Type.TObject<{
1733
+ kind: Type.TLiteral<"exact">;
1734
+ model: Type.TObject<{
1735
+ provider: Type.TString;
1736
+ id: Type.TString;
1737
+ }>;
1738
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1739
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1740
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1741
+ settingsVersion: Type.TString;
1742
+ }>, Type.TNull]>;
1743
+ }>;
1744
+ context: Type.TObject<{
1745
+ tokens: Type.TNumber;
1746
+ window: Type.TNumber;
1747
+ lastRequest: Type.TUnion<[Type.TObject<{
1748
+ input: Type.TNumber;
1749
+ output: Type.TNumber;
1750
+ cacheRead: Type.TNumber;
1751
+ cacheWrite: Type.TNumber;
1752
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
1753
+ total: Type.TNumber;
1754
+ cost: Type.TObject<{
1755
+ input: Type.TNumber;
1756
+ output: Type.TNumber;
1757
+ cacheRead: Type.TNumber;
1758
+ cacheWrite: Type.TNumber;
1759
+ total: Type.TNumber;
1760
+ }>;
1761
+ }>, Type.TNull]>;
1762
+ }>;
1763
+ heads: Type.TArray<Type.TObject<{
1764
+ name: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1765
+ tip: Type.TUnion<[Type.TObject<{
1766
+ kind: Type.TLiteral<"start">;
1767
+ }>, Type.TObject<{
1768
+ kind: Type.TLiteral<"commit">;
1769
+ id: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1770
+ }>]>;
1771
+ stack: Type.TUnion<[Type.TObject<{
1772
+ parent: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1773
+ base: Type.TUnion<[Type.TObject<{
1774
+ kind: Type.TLiteral<"start">;
1775
+ }>, Type.TObject<{
1776
+ kind: Type.TLiteral<"commit">;
1777
+ id: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
1778
+ }>]>;
1779
+ stale: Type.TBoolean;
1780
+ }>, Type.TNull]>;
1781
+ execution: Type.TUnion<[Type.TObject<{
1782
+ kind: Type.TLiteral<"idle">;
1783
+ lastRun: Type.TUnion<[Type.TObject<{
1784
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1785
+ end: Type.TUnion<[Type.TObject<{
1786
+ kind: Type.TLiteral<"completed">;
1787
+ usage: Type.TObject<{
1788
+ input: Type.TNumber;
1789
+ output: Type.TNumber;
1790
+ cacheRead: Type.TNumber;
1791
+ cacheWrite: Type.TNumber;
1792
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
1793
+ total: Type.TNumber;
1794
+ cost: Type.TObject<{
1795
+ input: Type.TNumber;
1796
+ output: Type.TNumber;
1797
+ cacheRead: Type.TNumber;
1798
+ cacheWrite: Type.TNumber;
1799
+ total: Type.TNumber;
1800
+ }>;
1801
+ }>;
1802
+ }>, Type.TObject<{
1803
+ kind: Type.TLiteral<"stopped">;
1804
+ }>, Type.TObject<{
1805
+ kind: Type.TLiteral<"failed">;
1806
+ failure: Type.TObject<{
1807
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
1808
+ message: Type.TString;
1809
+ retryAfterMs: Type.TOptional<Type.TNumber>;
1810
+ }>;
1811
+ }>]>;
1812
+ endedAt: Type.TNumber;
1813
+ }>, Type.TNull]>;
1814
+ }>, Type.TObject<{
1815
+ kind: Type.TLiteral<"live">;
1816
+ run: Type.TObject<{
1817
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1818
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1819
+ startedAt: Type.TNumber;
1820
+ attempt: Type.TNumber;
1821
+ configuration: Type.TObject<{
1822
+ kind: Type.TLiteral<"exact">;
1823
+ model: Type.TObject<{
1824
+ provider: Type.TString;
1825
+ id: Type.TString;
1826
+ }>;
1827
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1828
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1829
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1830
+ settingsVersion: Type.TString;
1831
+ }>;
1832
+ origin: Type.TUnion<[Type.TObject<{
1833
+ kind: Type.TLiteral<"input">;
1834
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1835
+ }>, Type.TObject<{
1836
+ kind: Type.TLiteral<"continuation">;
1837
+ from: Type.TEnum<["child", "job", "wake"]>;
1838
+ }>]>;
1839
+ }>;
1840
+ phase: Type.TEnum<["responding", "executing"]>;
1841
+ stopping: Type.TBoolean;
1842
+ }>, Type.TObject<{
1843
+ kind: Type.TLiteral<"waiting">;
1844
+ run: Type.TObject<{
1845
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1846
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1847
+ startedAt: Type.TNumber;
1848
+ attempt: Type.TNumber;
1849
+ configuration: Type.TObject<{
1850
+ kind: Type.TLiteral<"exact">;
1851
+ model: Type.TObject<{
1852
+ provider: Type.TString;
1853
+ id: Type.TString;
1854
+ }>;
1855
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1856
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1857
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1858
+ settingsVersion: Type.TString;
1859
+ }>;
1860
+ origin: Type.TUnion<[Type.TObject<{
1861
+ kind: Type.TLiteral<"input">;
1862
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1863
+ }>, Type.TObject<{
1864
+ kind: Type.TLiteral<"continuation">;
1865
+ from: Type.TEnum<["child", "job", "wake"]>;
1866
+ }>]>;
1867
+ }>;
1868
+ on: Type.TUnion<[Type.TObject<{
1869
+ kind: Type.TLiteral<"run">;
1870
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
1871
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1872
+ deadline: Type.TOptional<Type.TNumber>;
1873
+ }>, Type.TObject<{
1874
+ kind: Type.TLiteral<"job">;
1875
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
1876
+ deadline: Type.TOptional<Type.TNumber>;
1877
+ }>, Type.TObject<{
1878
+ kind: Type.TLiteral<"part">;
1879
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
1880
+ deadline: Type.TOptional<Type.TNumber>;
1881
+ }>, Type.TObject<{
1882
+ kind: Type.TLiteral<"timer">;
1883
+ until: Type.TNumber;
1884
+ deadline: Type.TOptional<Type.TNumber>;
1885
+ }>]>;
1886
+ }>, Type.TObject<{
1887
+ kind: Type.TLiteral<"retrying">;
1888
+ run: Type.TObject<{
1889
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
1890
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
1891
+ startedAt: Type.TNumber;
1892
+ attempt: Type.TNumber;
1893
+ configuration: Type.TObject<{
1894
+ kind: Type.TLiteral<"exact">;
1895
+ model: Type.TObject<{
1896
+ provider: Type.TString;
1897
+ id: Type.TString;
1898
+ }>;
1899
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
1900
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
1901
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1902
+ settingsVersion: Type.TString;
1903
+ }>;
1904
+ origin: Type.TUnion<[Type.TObject<{
1905
+ kind: Type.TLiteral<"input">;
1906
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
1907
+ }>, Type.TObject<{
1908
+ kind: Type.TLiteral<"continuation">;
1909
+ from: Type.TEnum<["child", "job", "wake"]>;
1910
+ }>]>;
1911
+ }>;
1912
+ until: Type.TNumber;
1913
+ reason: Type.TString;
1914
+ }>]>;
1915
+ unread: Type.TBoolean;
1916
+ }>>;
1917
+ changes: Type.TArray<Type.TObject<{
1918
+ path: Type.TString;
1919
+ status: Type.TEnum<["added", "modified", "deleted", "renamed", "untracked", "conflicted"]>;
1920
+ added: Type.TNumber;
1921
+ removed: Type.TNumber;
1922
+ from: Type.TOptional<Type.TString>;
1923
+ }>>;
1924
+ catalog: Type.TObject<{
1925
+ commands: Type.TArray<Type.TObject<{
1926
+ name: Type.TString;
1927
+ owner: Type.TString;
1928
+ side: Type.TEnum<["core", "client"]>;
1929
+ title: Type.TString;
1930
+ description: Type.TString;
1931
+ takesText: Type.TBoolean;
1932
+ completes: Type.TBoolean;
1933
+ category: Type.TOptional<Type.TString>;
1934
+ keywords: Type.TOptional<Type.TArray<Type.TString>>;
1935
+ }>>;
1936
+ settings: Type.TArray<Type.TObject<{
1937
+ id: Type.TString;
1938
+ owner: Type.TString;
1939
+ scope: Type.TEnum<["host", "session"]>;
1940
+ label: Type.TString;
1941
+ schema: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1942
+ choices: Type.TUnion<[Type.TArray<Type.TObject<{
1943
+ value: Type.TUnsafe<import("./json.ts").Json>;
1944
+ label: Type.TString;
1945
+ badge: Type.TOptional<Type.TString>;
1946
+ }>>, Type.TNull]>;
1947
+ value: Type.TUnsafe<import("./json.ts").Json>;
1948
+ from: Type.TEnum<["default", "host", "session"]>;
1949
+ }>>;
1950
+ skills: Type.TArray<Type.TObject<{
1951
+ name: Type.TString;
1952
+ owner: Type.TString;
1953
+ description: Type.TString;
1954
+ location: Type.TString;
1955
+ }>>;
1956
+ agents: Type.TArray<Type.TObject<{
1957
+ id: Type.TString;
1958
+ owner: Type.TString;
1959
+ description: Type.TUnion<[Type.TString, Type.TNull]>;
1960
+ model: Type.TUnion<[Type.TObject<{
1961
+ provider: Type.TString;
1962
+ id: Type.TString;
1963
+ }>, Type.TNull]>;
1964
+ mode: Type.TEnum<["primary", "subagent", "all"]>;
1965
+ }>>;
1966
+ tools: Type.TArray<Type.TObject<{
1967
+ name: Type.TString;
1968
+ owner: Type.TString;
1969
+ namespace: Type.TUnion<[Type.TString, Type.TNull]>;
1970
+ description: Type.TString;
1971
+ parameters: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
1972
+ output: Type.TUnion<[Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>, Type.TNull]>;
1973
+ exposure: Type.TEnum<["model", "deferred", "code", "hidden"]>;
1974
+ }>>;
1975
+ }>;
1976
+ }>;
1977
+ }>, Type.TObject<{
1978
+ kind: Type.TLiteral<"delta">;
1979
+ seq: Type.TUnsafe<import("./ids.ts").Seq>;
1980
+ revision: Type.TOptional<Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"revision">>, Type.TNull]>>;
1981
+ activation: Type.TOptional<Type.TUnion<[Type.TObject<{
1982
+ kind: Type.TLiteral<"active">;
1983
+ }>, Type.TObject<{
1984
+ kind: Type.TLiteral<"inactive">;
1985
+ }>, Type.TObject<{
1986
+ kind: Type.TLiteral<"unavailable">;
1987
+ reason: Type.TEnum<["unsupported", "unreachable"]>;
1988
+ workspace: Type.TUnsafe<import("./ids.ts").Id<"workspace">>;
1989
+ }>, Type.TObject<{
1990
+ kind: Type.TLiteral<"failed">;
1991
+ message: Type.TString;
1992
+ }>]>>;
1993
+ messages: Type.TOptional<Type.TObject<{
1994
+ runs: Type.TArray<Type.TNumber>;
1995
+ items: Type.TArray<Type.TUnion<[Type.TObject<{
1996
+ kind: Type.TLiteral<"user">;
1997
+ content: Type.TUnion<[Type.TString, Type.TArray<Type.TUnion<[Type.TObject<{
1998
+ kind: Type.TLiteral<"text">;
1999
+ text: Type.TString;
2000
+ }>, Type.TObject<{
2001
+ kind: Type.TLiteral<"file">;
2002
+ blob: Type.TUnsafe<import("./ids.ts").Id<"blob">>;
2003
+ mime: Type.TString;
2004
+ name: Type.TString;
2005
+ }>, Type.TObject<{
2006
+ kind: Type.TLiteral<"reference">;
2007
+ path: Type.TString;
2008
+ blob: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"blob">>>;
2009
+ }>, Type.TObject<{
2010
+ kind: Type.TLiteral<"skill">;
2011
+ name: Type.TString;
2012
+ location: Type.TString;
2013
+ }>, Type.TObject<{
2014
+ kind: Type.TLiteral<"excerpt">;
2015
+ source: Type.TUnion<[Type.TObject<{
2016
+ kind: Type.TLiteral<"diff">;
2017
+ path: Type.TString;
2018
+ side: Type.TEnum<["old", "new"]>;
2019
+ start: Type.TNumber;
2020
+ end: Type.TNumber;
2021
+ }>, Type.TObject<{
2022
+ kind: Type.TLiteral<"terminal">;
2023
+ command: Type.TOptional<Type.TString>;
2024
+ }>, Type.TObject<{
2025
+ kind: Type.TLiteral<"browser">;
2026
+ url: Type.TString;
2027
+ selector: Type.TString;
2028
+ }>]>;
2029
+ text: Type.TString;
2030
+ }>]>>]>;
2031
+ source: Type.TUnion<[Type.TObject<{
2032
+ kind: Type.TLiteral<"user">;
2033
+ }>, Type.TObject<{
2034
+ kind: Type.TLiteral<"child">;
2035
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
2036
+ end: Type.TEnum<["completed", "stopped", "failed"]>;
2037
+ }>, Type.TObject<{
2038
+ kind: Type.TLiteral<"job">;
2039
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
2040
+ }>, Type.TObject<{
2041
+ kind: Type.TLiteral<"shell">;
2042
+ }>, Type.TObject<{
2043
+ kind: Type.TLiteral<"action">;
2044
+ label: Type.TString;
2045
+ command: Type.TOptional<Type.TString>;
2046
+ }>]>;
2047
+ delivery: Type.TEnum<["steer", "queue", "attach"]>;
2048
+ status: Type.TUnion<[Type.TObject<{
2049
+ kind: Type.TLiteral<"unsent">;
2050
+ attempts: Type.TNumber;
2051
+ retrying: Type.TUnion<[Type.TObject<{
2052
+ at: Type.TNumber;
2053
+ reason: Type.TString;
2054
+ }>, Type.TNull]>;
2055
+ }>, Type.TObject<{
2056
+ kind: Type.TLiteral<"pending">;
2057
+ schedule: Type.TUnion<[Type.TObject<{
2058
+ kind: Type.TLiteral<"joined">;
2059
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2060
+ }>, Type.TObject<{
2061
+ kind: Type.TLiteral<"next-turn">;
2062
+ reason: Type.TEnum<["requested", "idle", "run-ended", "configuration"]>;
2063
+ }>, Type.TObject<{
2064
+ kind: Type.TLiteral<"attached">;
2065
+ }>, Type.TObject<{
2066
+ kind: Type.TLiteral<"deciding">;
2067
+ }>]>;
2068
+ covered: Type.TBoolean;
2069
+ }>, Type.TObject<{
2070
+ kind: Type.TLiteral<"landed">;
2071
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
2072
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2073
+ replaced: Type.TUnion<[Type.TObject<{
2074
+ previous: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2075
+ stopped: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2076
+ }>, Type.TNull]>;
2077
+ }>]>;
2078
+ siblings: Type.TObject<{
2079
+ index: Type.TNumber;
2080
+ count: Type.TNumber;
2081
+ ids: Type.TArray<Type.TUnsafe<import("./ids.ts").Id<"commit">>>;
2082
+ }>;
2083
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2084
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
2085
+ at: Type.TNumber;
2086
+ }>, Type.TObject<{
2087
+ kind: Type.TLiteral<"part">;
2088
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2089
+ partKind: Type.TString;
2090
+ role: Type.TEnum<["step", "answer", "note"]>;
2091
+ state: Type.TUnknown;
2092
+ version: Type.TNumber;
2093
+ status: Type.TUnion<[Type.TObject<{
2094
+ kind: Type.TLiteral<"live">;
2095
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2096
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
2097
+ answer: Type.TOptional<Type.TObject<{
2098
+ action: Type.TString;
2099
+ input: Type.TUnsafe<import("./json.ts").Json>;
2100
+ }>>;
2101
+ }>, Type.TObject<{
2102
+ kind: Type.TLiteral<"waiting">;
2103
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2104
+ on: Type.TUnion<[Type.TObject<{
2105
+ kind: Type.TLiteral<"run">;
2106
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
2107
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2108
+ deadline: Type.TOptional<Type.TNumber>;
2109
+ }>, Type.TObject<{
2110
+ kind: Type.TLiteral<"job">;
2111
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
2112
+ deadline: Type.TOptional<Type.TNumber>;
2113
+ }>, Type.TObject<{
2114
+ kind: Type.TLiteral<"part">;
2115
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2116
+ deadline: Type.TOptional<Type.TNumber>;
2117
+ }>, Type.TObject<{
2118
+ kind: Type.TLiteral<"timer">;
2119
+ until: Type.TNumber;
2120
+ deadline: Type.TOptional<Type.TNumber>;
2121
+ }>]>;
2122
+ }>, Type.TObject<{
2123
+ kind: Type.TLiteral<"settled">;
2124
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
2125
+ endedAt: Type.TNumber;
2126
+ }>, Type.TObject<{
2127
+ kind: Type.TLiteral<"failed">;
2128
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2129
+ failure: Type.TObject<{
2130
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
2131
+ message: Type.TString;
2132
+ retryAfterMs: Type.TOptional<Type.TNumber>;
2133
+ }>;
2134
+ }>]>;
2135
+ id: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2136
+ turn: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
2137
+ at: Type.TNumber;
2138
+ }>]>>;
2139
+ }>>;
2140
+ appends: Type.TOptional<Type.TArray<Type.TObject<{
2141
+ at: Type.TNumber;
2142
+ append: Type.TString;
2143
+ version: Type.TNumber;
2144
+ }>>>;
2145
+ parts: Type.TOptional<Type.TObject<{
2146
+ runs: Type.TArray<Type.TNumber>;
2147
+ items: Type.TArray<Type.TObject<{
2148
+ id: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2149
+ partKind: Type.TString;
2150
+ placement: Type.TUnion<[Type.TObject<{
2151
+ kind: Type.TLiteral<"transcript">;
2152
+ role: Type.TEnum<["step", "answer", "note"]>;
2153
+ }>, Type.TObject<{
2154
+ kind: Type.TLiteral<"modal">;
2155
+ }>, Type.TIntersect<[Type.TObject<{
2156
+ kind: Type.TString;
2157
+ }>, Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>]>]>;
2158
+ state: Type.TUnsafe<import("./json.ts").Json>;
2159
+ version: Type.TNumber;
2160
+ status: Type.TUnion<[Type.TObject<{
2161
+ kind: Type.TLiteral<"live">;
2162
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2163
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
2164
+ answer: Type.TOptional<Type.TObject<{
2165
+ action: Type.TString;
2166
+ input: Type.TUnsafe<import("./json.ts").Json>;
2167
+ }>>;
2168
+ }>, Type.TObject<{
2169
+ kind: Type.TLiteral<"waiting">;
2170
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2171
+ on: Type.TUnion<[Type.TObject<{
2172
+ kind: Type.TLiteral<"run">;
2173
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
2174
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2175
+ deadline: Type.TOptional<Type.TNumber>;
2176
+ }>, Type.TObject<{
2177
+ kind: Type.TLiteral<"job">;
2178
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
2179
+ deadline: Type.TOptional<Type.TNumber>;
2180
+ }>, Type.TObject<{
2181
+ kind: Type.TLiteral<"part">;
2182
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2183
+ deadline: Type.TOptional<Type.TNumber>;
2184
+ }>, Type.TObject<{
2185
+ kind: Type.TLiteral<"timer">;
2186
+ until: Type.TNumber;
2187
+ deadline: Type.TOptional<Type.TNumber>;
2188
+ }>]>;
2189
+ }>, Type.TObject<{
2190
+ kind: Type.TLiteral<"settled">;
2191
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
2192
+ endedAt: Type.TNumber;
2193
+ }>, Type.TObject<{
2194
+ kind: Type.TLiteral<"failed">;
2195
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2196
+ failure: Type.TObject<{
2197
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
2198
+ message: Type.TString;
2199
+ retryAfterMs: Type.TOptional<Type.TNumber>;
2200
+ }>;
2201
+ }>]>;
2202
+ owner: Type.TUnion<[Type.TString, Type.TNull]>;
2203
+ }>>;
2204
+ }>>;
2205
+ turns: Type.TOptional<Type.TObject<{
2206
+ runs: Type.TArray<Type.TNumber>;
2207
+ items: Type.TArray<Type.TObject<{
2208
+ id: Type.TUnsafe<import("./ids.ts").Id<"turn">>;
2209
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
2210
+ prompt: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"message">>, Type.TNull]>;
2211
+ state: Type.TUnion<[Type.TObject<{
2212
+ kind: Type.TLiteral<"working">;
2213
+ activity: Type.TUnion<[Type.TString, Type.TNull]>;
2214
+ }>, Type.TObject<{
2215
+ kind: Type.TLiteral<"waiting">;
2216
+ on: Type.TUnion<[Type.TObject<{
2217
+ kind: Type.TLiteral<"run">;
2218
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
2219
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2220
+ deadline: Type.TOptional<Type.TNumber>;
2221
+ }>, Type.TObject<{
2222
+ kind: Type.TLiteral<"job">;
2223
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
2224
+ deadline: Type.TOptional<Type.TNumber>;
2225
+ }>, Type.TObject<{
2226
+ kind: Type.TLiteral<"part">;
2227
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2228
+ deadline: Type.TOptional<Type.TNumber>;
2229
+ }>, Type.TObject<{
2230
+ kind: Type.TLiteral<"timer">;
2231
+ until: Type.TNumber;
2232
+ deadline: Type.TOptional<Type.TNumber>;
2233
+ }>]>;
2234
+ }>, Type.TObject<{
2235
+ kind: Type.TLiteral<"ended">;
2236
+ end: Type.TUnion<[Type.TObject<{
2237
+ kind: Type.TLiteral<"completed">;
2238
+ usage: Type.TObject<{
2239
+ input: Type.TNumber;
2240
+ output: Type.TNumber;
2241
+ cacheRead: Type.TNumber;
2242
+ cacheWrite: Type.TNumber;
2243
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
2244
+ total: Type.TNumber;
2245
+ cost: Type.TObject<{
2246
+ input: Type.TNumber;
2247
+ output: Type.TNumber;
2248
+ cacheRead: Type.TNumber;
2249
+ cacheWrite: Type.TNumber;
2250
+ total: Type.TNumber;
2251
+ }>;
2252
+ }>;
2253
+ }>, Type.TObject<{
2254
+ kind: Type.TLiteral<"stopped">;
2255
+ }>, Type.TObject<{
2256
+ kind: Type.TLiteral<"failed">;
2257
+ failure: Type.TObject<{
2258
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
2259
+ message: Type.TString;
2260
+ retryAfterMs: Type.TOptional<Type.TNumber>;
2261
+ }>;
2262
+ }>]>;
2263
+ }>]>;
2264
+ startedAt: Type.TNumber;
2265
+ endedAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
2266
+ steps: Type.TNumber;
2267
+ thinkingOnly: Type.TBoolean;
2268
+ summary: Type.TObject<{
2269
+ byClass: Type.TObject<{
2270
+ read: Type.TObject<{
2271
+ count: Type.TNumber;
2272
+ paths: Type.TArray<Type.TString>;
2273
+ }>;
2274
+ list: Type.TObject<{
2275
+ count: Type.TNumber;
2276
+ paths: Type.TArray<Type.TString>;
2277
+ }>;
2278
+ edit: Type.TObject<{
2279
+ count: Type.TNumber;
2280
+ paths: Type.TArray<Type.TString>;
2281
+ }>;
2282
+ shell: Type.TObject<{
2283
+ count: Type.TNumber;
2284
+ paths: Type.TArray<Type.TString>;
2285
+ }>;
2286
+ delegate: Type.TObject<{
2287
+ count: Type.TNumber;
2288
+ paths: Type.TArray<Type.TString>;
2289
+ }>;
2290
+ custom: Type.TObject<{
2291
+ count: Type.TNumber;
2292
+ paths: Type.TArray<Type.TString>;
2293
+ }>;
2294
+ }>;
2295
+ failed: Type.TNumber;
2296
+ stopped: Type.TNumber;
2297
+ added: Type.TNumber;
2298
+ removed: Type.TNumber;
2299
+ }>;
2300
+ }>>;
2301
+ }>>;
2302
+ usage: Type.TOptional<Type.TObject<{
2303
+ input: Type.TNumber;
2304
+ output: Type.TNumber;
2305
+ cacheRead: Type.TNumber;
2306
+ cacheWrite: Type.TNumber;
2307
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
2308
+ total: Type.TNumber;
2309
+ cost: Type.TObject<{
2310
+ input: Type.TNumber;
2311
+ output: Type.TNumber;
2312
+ cacheRead: Type.TNumber;
2313
+ cacheWrite: Type.TNumber;
2314
+ total: Type.TNumber;
2315
+ }>;
2316
+ }>>;
2317
+ execution: Type.TOptional<Type.TUnion<[Type.TObject<{
2318
+ kind: Type.TLiteral<"idle">;
2319
+ lastRun: Type.TUnion<[Type.TObject<{
2320
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2321
+ end: Type.TUnion<[Type.TObject<{
2322
+ kind: Type.TLiteral<"completed">;
2323
+ usage: Type.TObject<{
2324
+ input: Type.TNumber;
2325
+ output: Type.TNumber;
2326
+ cacheRead: Type.TNumber;
2327
+ cacheWrite: Type.TNumber;
2328
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
2329
+ total: Type.TNumber;
2330
+ cost: Type.TObject<{
2331
+ input: Type.TNumber;
2332
+ output: Type.TNumber;
2333
+ cacheRead: Type.TNumber;
2334
+ cacheWrite: Type.TNumber;
2335
+ total: Type.TNumber;
2336
+ }>;
2337
+ }>;
2338
+ }>, Type.TObject<{
2339
+ kind: Type.TLiteral<"stopped">;
2340
+ }>, Type.TObject<{
2341
+ kind: Type.TLiteral<"failed">;
2342
+ failure: Type.TObject<{
2343
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
2344
+ message: Type.TString;
2345
+ retryAfterMs: Type.TOptional<Type.TNumber>;
2346
+ }>;
2347
+ }>]>;
2348
+ endedAt: Type.TNumber;
2349
+ }>, Type.TNull]>;
2350
+ }>, Type.TObject<{
2351
+ kind: Type.TLiteral<"live">;
2352
+ run: Type.TObject<{
2353
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2354
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2355
+ startedAt: Type.TNumber;
2356
+ attempt: Type.TNumber;
2357
+ configuration: Type.TObject<{
2358
+ kind: Type.TLiteral<"exact">;
2359
+ model: Type.TObject<{
2360
+ provider: Type.TString;
2361
+ id: Type.TString;
2362
+ }>;
2363
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2364
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2365
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2366
+ settingsVersion: Type.TString;
2367
+ }>;
2368
+ origin: Type.TUnion<[Type.TObject<{
2369
+ kind: Type.TLiteral<"input">;
2370
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2371
+ }>, Type.TObject<{
2372
+ kind: Type.TLiteral<"continuation">;
2373
+ from: Type.TEnum<["child", "job", "wake"]>;
2374
+ }>]>;
2375
+ }>;
2376
+ phase: Type.TEnum<["responding", "executing"]>;
2377
+ stopping: Type.TBoolean;
2378
+ }>, Type.TObject<{
2379
+ kind: Type.TLiteral<"waiting">;
2380
+ run: Type.TObject<{
2381
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2382
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2383
+ startedAt: Type.TNumber;
2384
+ attempt: Type.TNumber;
2385
+ configuration: Type.TObject<{
2386
+ kind: Type.TLiteral<"exact">;
2387
+ model: Type.TObject<{
2388
+ provider: Type.TString;
2389
+ id: Type.TString;
2390
+ }>;
2391
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2392
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2393
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2394
+ settingsVersion: Type.TString;
2395
+ }>;
2396
+ origin: Type.TUnion<[Type.TObject<{
2397
+ kind: Type.TLiteral<"input">;
2398
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2399
+ }>, Type.TObject<{
2400
+ kind: Type.TLiteral<"continuation">;
2401
+ from: Type.TEnum<["child", "job", "wake"]>;
2402
+ }>]>;
2403
+ }>;
2404
+ on: Type.TUnion<[Type.TObject<{
2405
+ kind: Type.TLiteral<"run">;
2406
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
2407
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2408
+ deadline: Type.TOptional<Type.TNumber>;
2409
+ }>, Type.TObject<{
2410
+ kind: Type.TLiteral<"job">;
2411
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
2412
+ deadline: Type.TOptional<Type.TNumber>;
2413
+ }>, Type.TObject<{
2414
+ kind: Type.TLiteral<"part">;
2415
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2416
+ deadline: Type.TOptional<Type.TNumber>;
2417
+ }>, Type.TObject<{
2418
+ kind: Type.TLiteral<"timer">;
2419
+ until: Type.TNumber;
2420
+ deadline: Type.TOptional<Type.TNumber>;
2421
+ }>]>;
2422
+ }>, Type.TObject<{
2423
+ kind: Type.TLiteral<"retrying">;
2424
+ run: Type.TObject<{
2425
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2426
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2427
+ startedAt: Type.TNumber;
2428
+ attempt: Type.TNumber;
2429
+ configuration: Type.TObject<{
2430
+ kind: Type.TLiteral<"exact">;
2431
+ model: Type.TObject<{
2432
+ provider: Type.TString;
2433
+ id: Type.TString;
2434
+ }>;
2435
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2436
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2437
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2438
+ settingsVersion: Type.TString;
2439
+ }>;
2440
+ origin: Type.TUnion<[Type.TObject<{
2441
+ kind: Type.TLiteral<"input">;
2442
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2443
+ }>, Type.TObject<{
2444
+ kind: Type.TLiteral<"continuation">;
2445
+ from: Type.TEnum<["child", "job", "wake"]>;
2446
+ }>]>;
2447
+ }>;
2448
+ until: Type.TNumber;
2449
+ reason: Type.TString;
2450
+ }>]>>;
2451
+ background: Type.TOptional<Type.TObject<{
2452
+ runs: Type.TArray<Type.TNumber>;
2453
+ items: Type.TArray<Type.TObject<{
2454
+ kind: Type.TEnum<["child", "job", "page"]>;
2455
+ id: Type.TString;
2456
+ title: Type.TString;
2457
+ state: Type.TEnum<["working", "waiting", "done", "failed"]>;
2458
+ startedBy: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"call">>, Type.TNull]>;
2459
+ }>>;
2460
+ }>>;
2461
+ configuration: Type.TOptional<Type.TObject<{
2462
+ selected: Type.TUnion<[Type.TObject<{
2463
+ kind: Type.TLiteral<"exact">;
2464
+ model: Type.TObject<{
2465
+ provider: Type.TString;
2466
+ id: Type.TString;
2467
+ }>;
2468
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2469
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2470
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2471
+ settingsVersion: Type.TString;
2472
+ }>, Type.TNull]>;
2473
+ effective: Type.TUnion<[Type.TObject<{
2474
+ kind: Type.TLiteral<"exact">;
2475
+ model: Type.TObject<{
2476
+ provider: Type.TString;
2477
+ id: Type.TString;
2478
+ }>;
2479
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2480
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2481
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2482
+ settingsVersion: Type.TString;
2483
+ }>, Type.TNull]>;
2484
+ }>>;
2485
+ context: Type.TOptional<Type.TObject<{
2486
+ tokens: Type.TNumber;
2487
+ window: Type.TNumber;
2488
+ lastRequest: Type.TUnion<[Type.TObject<{
2489
+ input: Type.TNumber;
2490
+ output: Type.TNumber;
2491
+ cacheRead: Type.TNumber;
2492
+ cacheWrite: Type.TNumber;
2493
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
2494
+ total: Type.TNumber;
2495
+ cost: Type.TObject<{
2496
+ input: Type.TNumber;
2497
+ output: Type.TNumber;
2498
+ cacheRead: Type.TNumber;
2499
+ cacheWrite: Type.TNumber;
2500
+ total: Type.TNumber;
2501
+ }>;
2502
+ }>, Type.TNull]>;
2503
+ }>>;
2504
+ heads: Type.TOptional<Type.TObject<{
2505
+ runs: Type.TArray<Type.TNumber>;
2506
+ items: Type.TArray<Type.TObject<{
2507
+ name: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2508
+ tip: Type.TUnion<[Type.TObject<{
2509
+ kind: Type.TLiteral<"start">;
2510
+ }>, Type.TObject<{
2511
+ kind: Type.TLiteral<"commit">;
2512
+ id: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
2513
+ }>]>;
2514
+ stack: Type.TUnion<[Type.TObject<{
2515
+ parent: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2516
+ base: Type.TUnion<[Type.TObject<{
2517
+ kind: Type.TLiteral<"start">;
2518
+ }>, Type.TObject<{
2519
+ kind: Type.TLiteral<"commit">;
2520
+ id: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
2521
+ }>]>;
2522
+ stale: Type.TBoolean;
2523
+ }>, Type.TNull]>;
2524
+ execution: Type.TUnion<[Type.TObject<{
2525
+ kind: Type.TLiteral<"idle">;
2526
+ lastRun: Type.TUnion<[Type.TObject<{
2527
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2528
+ end: Type.TUnion<[Type.TObject<{
2529
+ kind: Type.TLiteral<"completed">;
2530
+ usage: Type.TObject<{
2531
+ input: Type.TNumber;
2532
+ output: Type.TNumber;
2533
+ cacheRead: Type.TNumber;
2534
+ cacheWrite: Type.TNumber;
2535
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
2536
+ total: Type.TNumber;
2537
+ cost: Type.TObject<{
2538
+ input: Type.TNumber;
2539
+ output: Type.TNumber;
2540
+ cacheRead: Type.TNumber;
2541
+ cacheWrite: Type.TNumber;
2542
+ total: Type.TNumber;
2543
+ }>;
2544
+ }>;
2545
+ }>, Type.TObject<{
2546
+ kind: Type.TLiteral<"stopped">;
2547
+ }>, Type.TObject<{
2548
+ kind: Type.TLiteral<"failed">;
2549
+ failure: Type.TObject<{
2550
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
2551
+ message: Type.TString;
2552
+ retryAfterMs: Type.TOptional<Type.TNumber>;
2553
+ }>;
2554
+ }>]>;
2555
+ endedAt: Type.TNumber;
2556
+ }>, Type.TNull]>;
2557
+ }>, Type.TObject<{
2558
+ kind: Type.TLiteral<"live">;
2559
+ run: Type.TObject<{
2560
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2561
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2562
+ startedAt: Type.TNumber;
2563
+ attempt: Type.TNumber;
2564
+ configuration: Type.TObject<{
2565
+ kind: Type.TLiteral<"exact">;
2566
+ model: Type.TObject<{
2567
+ provider: Type.TString;
2568
+ id: Type.TString;
2569
+ }>;
2570
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2571
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2572
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2573
+ settingsVersion: Type.TString;
2574
+ }>;
2575
+ origin: Type.TUnion<[Type.TObject<{
2576
+ kind: Type.TLiteral<"input">;
2577
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2578
+ }>, Type.TObject<{
2579
+ kind: Type.TLiteral<"continuation">;
2580
+ from: Type.TEnum<["child", "job", "wake"]>;
2581
+ }>]>;
2582
+ }>;
2583
+ phase: Type.TEnum<["responding", "executing"]>;
2584
+ stopping: Type.TBoolean;
2585
+ }>, Type.TObject<{
2586
+ kind: Type.TLiteral<"waiting">;
2587
+ run: Type.TObject<{
2588
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2589
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2590
+ startedAt: Type.TNumber;
2591
+ attempt: Type.TNumber;
2592
+ configuration: Type.TObject<{
2593
+ kind: Type.TLiteral<"exact">;
2594
+ model: Type.TObject<{
2595
+ provider: Type.TString;
2596
+ id: Type.TString;
2597
+ }>;
2598
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2599
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2600
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2601
+ settingsVersion: Type.TString;
2602
+ }>;
2603
+ origin: Type.TUnion<[Type.TObject<{
2604
+ kind: Type.TLiteral<"input">;
2605
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2606
+ }>, Type.TObject<{
2607
+ kind: Type.TLiteral<"continuation">;
2608
+ from: Type.TEnum<["child", "job", "wake"]>;
2609
+ }>]>;
2610
+ }>;
2611
+ on: Type.TUnion<[Type.TObject<{
2612
+ kind: Type.TLiteral<"run">;
2613
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
2614
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2615
+ deadline: Type.TOptional<Type.TNumber>;
2616
+ }>, Type.TObject<{
2617
+ kind: Type.TLiteral<"job">;
2618
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
2619
+ deadline: Type.TOptional<Type.TNumber>;
2620
+ }>, Type.TObject<{
2621
+ kind: Type.TLiteral<"part">;
2622
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
2623
+ deadline: Type.TOptional<Type.TNumber>;
2624
+ }>, Type.TObject<{
2625
+ kind: Type.TLiteral<"timer">;
2626
+ until: Type.TNumber;
2627
+ deadline: Type.TOptional<Type.TNumber>;
2628
+ }>]>;
2629
+ }>, Type.TObject<{
2630
+ kind: Type.TLiteral<"retrying">;
2631
+ run: Type.TObject<{
2632
+ id: Type.TUnsafe<import("./ids.ts").Id<"run">>;
2633
+ head: Type.TUnsafe<import("./ids.ts").Id<"head">>;
2634
+ startedAt: Type.TNumber;
2635
+ attempt: Type.TNumber;
2636
+ configuration: Type.TObject<{
2637
+ kind: Type.TLiteral<"exact">;
2638
+ model: Type.TObject<{
2639
+ provider: Type.TString;
2640
+ id: Type.TString;
2641
+ }>;
2642
+ thinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
2643
+ agent: Type.TUnion<[Type.TString, Type.TNull]>;
2644
+ settings: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2645
+ settingsVersion: Type.TString;
2646
+ }>;
2647
+ origin: Type.TUnion<[Type.TObject<{
2648
+ kind: Type.TLiteral<"input">;
2649
+ message: Type.TUnsafe<import("./ids.ts").Id<"message">>;
2650
+ }>, Type.TObject<{
2651
+ kind: Type.TLiteral<"continuation">;
2652
+ from: Type.TEnum<["child", "job", "wake"]>;
2653
+ }>]>;
2654
+ }>;
2655
+ until: Type.TNumber;
2656
+ reason: Type.TString;
2657
+ }>]>;
2658
+ unread: Type.TBoolean;
2659
+ }>>;
2660
+ }>>;
2661
+ changes: Type.TOptional<Type.TObject<{
2662
+ runs: Type.TArray<Type.TNumber>;
2663
+ items: Type.TArray<Type.TObject<{
2664
+ path: Type.TString;
2665
+ status: Type.TEnum<["added", "modified", "deleted", "renamed", "untracked", "conflicted"]>;
2666
+ added: Type.TNumber;
2667
+ removed: Type.TNumber;
2668
+ from: Type.TOptional<Type.TString>;
2669
+ }>>;
2670
+ }>>;
2671
+ catalog: Type.TOptional<Type.TObject<{
2672
+ commands: Type.TArray<Type.TObject<{
2673
+ name: Type.TString;
2674
+ owner: Type.TString;
2675
+ side: Type.TEnum<["core", "client"]>;
2676
+ title: Type.TString;
2677
+ description: Type.TString;
2678
+ takesText: Type.TBoolean;
2679
+ completes: Type.TBoolean;
2680
+ category: Type.TOptional<Type.TString>;
2681
+ keywords: Type.TOptional<Type.TArray<Type.TString>>;
2682
+ }>>;
2683
+ settings: Type.TArray<Type.TObject<{
2684
+ id: Type.TString;
2685
+ owner: Type.TString;
2686
+ scope: Type.TEnum<["host", "session"]>;
2687
+ label: Type.TString;
2688
+ schema: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2689
+ choices: Type.TUnion<[Type.TArray<Type.TObject<{
2690
+ value: Type.TUnsafe<import("./json.ts").Json>;
2691
+ label: Type.TString;
2692
+ badge: Type.TOptional<Type.TString>;
2693
+ }>>, Type.TNull]>;
2694
+ value: Type.TUnsafe<import("./json.ts").Json>;
2695
+ from: Type.TEnum<["default", "host", "session"]>;
2696
+ }>>;
2697
+ skills: Type.TArray<Type.TObject<{
2698
+ name: Type.TString;
2699
+ owner: Type.TString;
2700
+ description: Type.TString;
2701
+ location: Type.TString;
2702
+ }>>;
2703
+ agents: Type.TArray<Type.TObject<{
2704
+ id: Type.TString;
2705
+ owner: Type.TString;
2706
+ description: Type.TUnion<[Type.TString, Type.TNull]>;
2707
+ model: Type.TUnion<[Type.TObject<{
2708
+ provider: Type.TString;
2709
+ id: Type.TString;
2710
+ }>, Type.TNull]>;
2711
+ mode: Type.TEnum<["primary", "subagent", "all"]>;
2712
+ }>>;
2713
+ tools: Type.TArray<Type.TObject<{
2714
+ name: Type.TString;
2715
+ owner: Type.TString;
2716
+ namespace: Type.TUnion<[Type.TString, Type.TNull]>;
2717
+ description: Type.TString;
2718
+ parameters: Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>;
2719
+ output: Type.TUnion<[Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>, Type.TNull]>;
2720
+ exposure: Type.TEnum<["model", "deferred", "code", "hidden"]>;
2721
+ }>>;
2722
+ }>>;
2723
+ }>]>;
2724
+ /** One frame of a head's watch on the wire: the whole view first, then each later view as what changed since the frame before it, an absent field unchanged. */
2725
+ export type ViewFrame = Decoded<typeof ViewFrameType>;
2726
+ export declare const ViewOptionsSchema: Schema<ViewOptions>;
2727
+ export declare const UserStatusSchema: Schema<UserStatus>;
2728
+ export declare const MessageSchema: Schema<Message>;
2729
+ export declare const TurnInfoSchema: Schema<TurnInfo>;
2730
+ export declare const SessionViewSchema: Schema<SessionView>;
2731
+ export declare const HistoryPageSchema: Schema<HistoryPage>;
2732
+ export declare const ViewFrameSchema: Schema<ViewFrame>;
2733
+ /** One array of a view as the previous frame's array spliced: `runs` holds `[from, count]` pairs, each copying `count` items of the previous array from `from`, or with `from` -1 taking the next `count` of `items`. */
2734
+ export type ViewSplice<T> = {
2735
+ readonly runs: readonly number[];
2736
+ readonly items: readonly T[];
2737
+ };