@get-bb/plugin-sdk 0.4.14 → 0.4.16
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.
- package/README.md +3 -3
- package/bundled-types/bb-plugin-sdk-ai-services.d.ts +141 -0
- package/bundled-types/bb-plugin-sdk-app.d.ts +144 -21
- package/bundled-types/bb-plugin-sdk-host.d.ts +479 -2
- package/bundled-types/bb-plugin-sdk-internal-composer-customization-validation.d.ts +10 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +339 -32
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +807 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +1742 -211
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +2985 -2442
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +4 -3
- package/bundled-types/bb-plugin-sdk-testing.d.ts +551 -9
- package/bundled-types/bb-plugin-sdk.d.ts +1335 -1350
- package/dist/ai-services.js +91 -0
- package/dist/app.js +2 -2
- package/dist/host.js +14547 -1
- package/dist/internal/composer-customization-validation.js +11 -0
- package/dist/internal/host-policy.js +656 -91
- package/dist/internal/plugin-app-collector.js +58 -14
- package/dist/provider-bridge-acp.js +9753 -0
- package/dist/provider-bridge-testing.js +3355 -1771
- package/dist/provider-bridge-worker-entry.mjs +917 -0
- package/dist/provider-bridge.js +2255 -3718
- package/dist/replay-provider-child.mjs +650 -0
- package/dist/testing/app.js +63 -19
- package/dist/testing/index.js +803 -115
- package/package.json +14 -1
|
@@ -12,6 +12,976 @@ interface JsonObject {
|
|
|
12
12
|
}
|
|
13
13
|
type JsonValue = string | number | boolean | null | JsonValue[] | JsonObject;
|
|
14
14
|
|
|
15
|
+
declare const threadEventItemPresentationLabelSchema: z.ZodObject<{
|
|
16
|
+
completed: z.ZodString;
|
|
17
|
+
pending: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
type ThreadEventItemPresentationLabel = z.infer<typeof threadEventItemPresentationLabelSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* The row's leading icon, by name. Two vocabularies share the one field:
|
|
22
|
+
*
|
|
23
|
+
* - a host glyph (`{ glyph: "FileText" }`), the same names the plugin
|
|
24
|
+
* branding and provider declaration icons use;
|
|
25
|
+
* - a plugin-declared icon (`{ glyph: "echo-provider/receipt" }`), the
|
|
26
|
+
* namespaced form `"<pluginId>/<name>"` that names an entry of the
|
|
27
|
+
* plugin's manifest map `bb.branding.experimental_icons`
|
|
28
|
+
* (`NAMESPACED_GLYPH_PATTERN` in plugin-icon.ts). The server rejects at
|
|
29
|
+
* ingest a namespaced glyph that is not the emitting plugin's own declared
|
|
30
|
+
* icon; clients resolve the name against the plugin inventory they hold
|
|
31
|
+
* and draw the SVG tinted with `currentColor`.
|
|
32
|
+
*
|
|
33
|
+
* Both are names, never bytes or paths: the row persists the name and
|
|
34
|
+
* follows the plugin's current map at render time. If the plugin is gone or
|
|
35
|
+
* the name is unknown when the row renders, the icon is simply not found and
|
|
36
|
+
* the per-kind fallback glyph draws instead — accepted, so a persisted row
|
|
37
|
+
* never depends on a file that may have moved. The schema stays a plain
|
|
38
|
+
* non-blank string on purpose: persisted rows must parse forever.
|
|
39
|
+
*/
|
|
40
|
+
declare const threadEventItemPresentationIconSchema: z.ZodObject<{
|
|
41
|
+
glyph: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
type ThreadEventItemPresentationIcon = z.infer<typeof threadEventItemPresentationIconSchema>;
|
|
44
|
+
declare const threadEventItemPresentationTintSchema: z.ZodObject<{
|
|
45
|
+
dark: z.ZodString;
|
|
46
|
+
light: z.ZodString;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
type ThreadEventItemPresentationTint = z.infer<typeof threadEventItemPresentationTintSchema>;
|
|
49
|
+
declare const threadEventItemPresentationSchema: z.ZodObject<{
|
|
50
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
51
|
+
icon: z.ZodObject<{
|
|
52
|
+
glyph: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
label: z.ZodObject<{
|
|
55
|
+
completed: z.ZodString;
|
|
56
|
+
pending: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
dark: z.ZodString;
|
|
61
|
+
light: z.ZodString;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
title: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
type ThreadEventItemPresentation = z.infer<typeof threadEventItemPresentationSchema>;
|
|
66
|
+
|
|
67
|
+
declare const threadEventWebSearchItemSchema: z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
72
|
+
icon: z.ZodObject<{
|
|
73
|
+
glyph: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
label: z.ZodObject<{
|
|
76
|
+
completed: z.ZodString;
|
|
77
|
+
pending: z.ZodString;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
dark: z.ZodString;
|
|
82
|
+
light: z.ZodString;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
title: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
queries: z.ZodArray<z.ZodString>;
|
|
87
|
+
resultText: z.ZodNullable<z.ZodString>;
|
|
88
|
+
type: z.ZodLiteral<"webSearch">;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
type ThreadEventWebSearchItem = z.infer<typeof threadEventWebSearchItemSchema>;
|
|
91
|
+
declare const threadEventWebFetchItemSchema: z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
94
|
+
pattern: z.ZodNullable<z.ZodString>;
|
|
95
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
97
|
+
icon: z.ZodObject<{
|
|
98
|
+
glyph: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
label: z.ZodObject<{
|
|
101
|
+
completed: z.ZodString;
|
|
102
|
+
pending: z.ZodString;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
dark: z.ZodString;
|
|
107
|
+
light: z.ZodString;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
title: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
112
|
+
resultText: z.ZodNullable<z.ZodString>;
|
|
113
|
+
type: z.ZodLiteral<"webFetch">;
|
|
114
|
+
url: z.ZodString;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type ThreadEventWebFetchItem = z.infer<typeof threadEventWebFetchItemSchema>;
|
|
117
|
+
/**
|
|
118
|
+
* A file the agent read. The single most common generic tool in the
|
|
119
|
+
* production corpus (Claude `Read`: 7,568 calls across 141 threads rendered
|
|
120
|
+
* as an opaque `toolCall`), so it earns a core kind: clients show the path,
|
|
121
|
+
* the permission matrix treats it as a read, and no tool-name table is
|
|
122
|
+
* needed to recognise it. `cmd` carries the native shell form when the
|
|
123
|
+
* provider read through a command (`cat`, `sed -n`) rather than a structured
|
|
124
|
+
* tool, so the row can still show what actually ran.
|
|
125
|
+
*/
|
|
126
|
+
declare const threadEventFileReadItemSchema: z.ZodObject<{
|
|
127
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
130
|
+
path: z.ZodString;
|
|
131
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
133
|
+
icon: z.ZodObject<{
|
|
134
|
+
glyph: z.ZodString;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
label: z.ZodObject<{
|
|
137
|
+
completed: z.ZodString;
|
|
138
|
+
pending: z.ZodString;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
dark: z.ZodString;
|
|
143
|
+
light: z.ZodString;
|
|
144
|
+
}, z.core.$strip>>;
|
|
145
|
+
title: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
status: z.ZodEnum<{
|
|
148
|
+
completed: "completed";
|
|
149
|
+
failed: "failed";
|
|
150
|
+
interrupted: "interrupted";
|
|
151
|
+
pending: "pending";
|
|
152
|
+
}>;
|
|
153
|
+
type: z.ZodLiteral<"fileRead">;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
type ThreadEventFileReadItem = z.infer<typeof threadEventFileReadItemSchema>;
|
|
156
|
+
/**
|
|
157
|
+
* One kind for every exploration tool that is not a file read: grep, glob,
|
|
158
|
+
* and directory listing, discriminated by `mode`. Claude `Grep` + `Glob` and
|
|
159
|
+
* the shell `rg`/`ls`/`find` commands bridges already classify into
|
|
160
|
+
* `command` activity intents all fold into it. `query` is the pattern: text
|
|
161
|
+
* or a regex for `content`, a glob for `path`, and an optional filter for
|
|
162
|
+
* `list` (empty when the whole directory is listed). `path` is the root the
|
|
163
|
+
* search ran under when the provider named one. `cmd` carries the native
|
|
164
|
+
* shell form when the provider searched through a command.
|
|
165
|
+
*/
|
|
166
|
+
declare const threadEventSearchItemSchema: z.ZodObject<{
|
|
167
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
mode: z.ZodEnum<{
|
|
170
|
+
content: "content";
|
|
171
|
+
list: "list";
|
|
172
|
+
path: "path";
|
|
173
|
+
}>;
|
|
174
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
path: z.ZodOptional<z.ZodString>;
|
|
176
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
178
|
+
icon: z.ZodObject<{
|
|
179
|
+
glyph: z.ZodString;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
label: z.ZodObject<{
|
|
182
|
+
completed: z.ZodString;
|
|
183
|
+
pending: z.ZodString;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
dark: z.ZodString;
|
|
188
|
+
light: z.ZodString;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
title: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>>;
|
|
192
|
+
query: z.ZodString;
|
|
193
|
+
status: z.ZodEnum<{
|
|
194
|
+
completed: "completed";
|
|
195
|
+
failed: "failed";
|
|
196
|
+
interrupted: "interrupted";
|
|
197
|
+
pending: "pending";
|
|
198
|
+
}>;
|
|
199
|
+
type: z.ZodLiteral<"search">;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
type ThreadEventSearchItem = z.infer<typeof threadEventSearchItemSchema>;
|
|
202
|
+
/**
|
|
203
|
+
* The agent delegated work to a child agent. One kind replaces the three
|
|
204
|
+
* encodings in the production data — codex `spawnAgent`/`wait` tool calls,
|
|
205
|
+
* the Claude `Agent` tool call with nested child turns, and backgrounded
|
|
206
|
+
* `local_agent` background tasks — and the `thread/openWork` notification:
|
|
207
|
+
* an open delegation IS open work.
|
|
208
|
+
*
|
|
209
|
+
* `childRef` is the provider-native id of the child (a codex agent id, a
|
|
210
|
+
* Claude subagent id, a bb child thread id when the delegation became a bb
|
|
211
|
+
* thread); child turns link back through their `parentToolCallId`.
|
|
212
|
+
* `background: true` marks a delegation that outlives its spawning turn, in
|
|
213
|
+
* which case its progress and terminal state ride the thread-scoped
|
|
214
|
+
* `item/delegation/progress` and `item/delegation/completed` events exactly
|
|
215
|
+
* as `backgroundTask` does; a foreground delegation settles through the
|
|
216
|
+
* ordinary turn-scoped `item/completed`.
|
|
217
|
+
*/
|
|
218
|
+
declare const threadEventDelegationItemSchema: z.ZodObject<{
|
|
219
|
+
background: z.ZodBoolean;
|
|
220
|
+
childRef: z.ZodString;
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
label: z.ZodString;
|
|
223
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
224
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
226
|
+
icon: z.ZodObject<{
|
|
227
|
+
glyph: z.ZodString;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
label: z.ZodObject<{
|
|
230
|
+
completed: z.ZodString;
|
|
231
|
+
pending: z.ZodString;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
dark: z.ZodString;
|
|
236
|
+
light: z.ZodString;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
title: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, z.core.$strip>>;
|
|
240
|
+
status: z.ZodEnum<{
|
|
241
|
+
completed: "completed";
|
|
242
|
+
failed: "failed";
|
|
243
|
+
interrupted: "interrupted";
|
|
244
|
+
pending: "pending";
|
|
245
|
+
}>;
|
|
246
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
247
|
+
type: z.ZodLiteral<"delegation">;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
type ThreadEventDelegationItem = z.infer<typeof threadEventDelegationItemSchema>;
|
|
250
|
+
/**
|
|
251
|
+
* A structured plan snapshot the agent maintains as an item: codex
|
|
252
|
+
* `update_plan` (its `turn/plan/updated` notification reaches 295 threads in
|
|
253
|
+
* the production corpus and the UI discards it today) and the Claude
|
|
254
|
+
* `TaskCreate`/`TaskUpdate`/`TodoWrite` family. Each snapshot carries the
|
|
255
|
+
* full step list; a later snapshot supersedes an earlier one. Distinct from
|
|
256
|
+
* the `plan` item, which is the free-text plan-mode document.
|
|
257
|
+
*/
|
|
258
|
+
declare const threadEventPlanStepsItemSchema: z.ZodObject<{
|
|
259
|
+
explanation: z.ZodOptional<z.ZodString>;
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
262
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
264
|
+
icon: z.ZodObject<{
|
|
265
|
+
glyph: z.ZodString;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
label: z.ZodObject<{
|
|
268
|
+
completed: z.ZodString;
|
|
269
|
+
pending: z.ZodString;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
dark: z.ZodString;
|
|
274
|
+
light: z.ZodString;
|
|
275
|
+
}, z.core.$strip>>;
|
|
276
|
+
title: z.ZodOptional<z.ZodString>;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
status: z.ZodEnum<{
|
|
279
|
+
completed: "completed";
|
|
280
|
+
failed: "failed";
|
|
281
|
+
interrupted: "interrupted";
|
|
282
|
+
pending: "pending";
|
|
283
|
+
}>;
|
|
284
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
285
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
286
|
+
active: "active";
|
|
287
|
+
completed: "completed";
|
|
288
|
+
failed: "failed";
|
|
289
|
+
pending: "pending";
|
|
290
|
+
}>>;
|
|
291
|
+
step: z.ZodString;
|
|
292
|
+
}, z.core.$strip>>;
|
|
293
|
+
type: z.ZodLiteral<"planSteps">;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
type ThreadEventPlanStepsItem = z.infer<typeof threadEventPlanStepsItemSchema>;
|
|
296
|
+
/**
|
|
297
|
+
* A plugin-defined item kind outside the core vocabulary
|
|
298
|
+
* (`"<pluginId>/<name>"`, see provider-extension-kind.ts). The payload is
|
|
299
|
+
* opaque JSON here; the server validates it against the owning plugin's
|
|
300
|
+
* declared schema at ingest. `presentation` is REQUIRED — an
|
|
301
|
+
* extension item has no core renderer to fall back on, so the declarative
|
|
302
|
+
* base is the only thing every client can show.
|
|
303
|
+
*/
|
|
304
|
+
declare const threadEventExtensionItemSchema: z.ZodObject<{
|
|
305
|
+
id: z.ZodString;
|
|
306
|
+
kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
|
|
307
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
308
|
+
payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
309
|
+
presentation: z.ZodObject<{
|
|
310
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
311
|
+
icon: z.ZodObject<{
|
|
312
|
+
glyph: z.ZodString;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
label: z.ZodObject<{
|
|
315
|
+
completed: z.ZodString;
|
|
316
|
+
pending: z.ZodString;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
319
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
320
|
+
dark: z.ZodString;
|
|
321
|
+
light: z.ZodString;
|
|
322
|
+
}, z.core.$strip>>;
|
|
323
|
+
title: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
status: z.ZodEnum<{
|
|
326
|
+
completed: "completed";
|
|
327
|
+
failed: "failed";
|
|
328
|
+
interrupted: "interrupted";
|
|
329
|
+
pending: "pending";
|
|
330
|
+
}>;
|
|
331
|
+
type: z.ZodLiteral<"extension">;
|
|
332
|
+
}, z.core.$strip>;
|
|
333
|
+
type ThreadEventExtensionItem = z.infer<typeof threadEventExtensionItemSchema>;
|
|
334
|
+
/**
|
|
335
|
+
* A materialized provider background task. Dynamic workflows (taskType
|
|
336
|
+
* "local_workflow"), backgrounded shell commands (taskType "local_bash"), and
|
|
337
|
+
* backgrounded subagents (taskType "local_agent" / "local_subagent") become
|
|
338
|
+
* items. The item id is derived from the provider task id and stays stable
|
|
339
|
+
* across the started → progress* → completed lifecycle.
|
|
340
|
+
*/
|
|
341
|
+
declare const threadEventBackgroundTaskItemSchema: z.ZodObject<{
|
|
342
|
+
description: z.ZodString;
|
|
343
|
+
error: z.ZodOptional<z.ZodString>;
|
|
344
|
+
familyId: z.ZodOptional<z.ZodString>;
|
|
345
|
+
id: z.ZodString;
|
|
346
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
347
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
348
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
349
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
350
|
+
icon: z.ZodObject<{
|
|
351
|
+
glyph: z.ZodString;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
label: z.ZodObject<{
|
|
354
|
+
completed: z.ZodString;
|
|
355
|
+
pending: z.ZodString;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
359
|
+
dark: z.ZodString;
|
|
360
|
+
light: z.ZodString;
|
|
361
|
+
}, z.core.$strip>>;
|
|
362
|
+
title: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, z.core.$strip>>;
|
|
364
|
+
skipTranscript: z.ZodBoolean;
|
|
365
|
+
status: z.ZodEnum<{
|
|
366
|
+
completed: "completed";
|
|
367
|
+
failed: "failed";
|
|
368
|
+
interrupted: "interrupted";
|
|
369
|
+
pending: "pending";
|
|
370
|
+
}>;
|
|
371
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
372
|
+
taskStatus: z.ZodEnum<{
|
|
373
|
+
completed: "completed";
|
|
374
|
+
failed: "failed";
|
|
375
|
+
killed: "killed";
|
|
376
|
+
paused: "paused";
|
|
377
|
+
pending: "pending";
|
|
378
|
+
running: "running";
|
|
379
|
+
stopped: "stopped";
|
|
380
|
+
}>;
|
|
381
|
+
taskType: z.ZodString;
|
|
382
|
+
type: z.ZodLiteral<"backgroundTask">;
|
|
383
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
384
|
+
durationMs: z.ZodNumber;
|
|
385
|
+
toolUses: z.ZodNumber;
|
|
386
|
+
totalTokens: z.ZodNumber;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
workflow: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
390
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
391
|
+
attempt: z.ZodNumber;
|
|
392
|
+
cached: z.ZodBoolean;
|
|
393
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
394
|
+
error: z.ZodOptional<z.ZodString>;
|
|
395
|
+
index: z.ZodNumber;
|
|
396
|
+
isolation: z.ZodOptional<z.ZodString>;
|
|
397
|
+
label: z.ZodString;
|
|
398
|
+
lastProgressAt: z.ZodNumber;
|
|
399
|
+
lastToolName: z.ZodOptional<z.ZodString>;
|
|
400
|
+
lastToolSummary: z.ZodOptional<z.ZodString>;
|
|
401
|
+
model: z.ZodString;
|
|
402
|
+
phaseIndex: z.ZodOptional<z.ZodNumber>;
|
|
403
|
+
phaseTitle: z.ZodOptional<z.ZodString>;
|
|
404
|
+
promptPreview: z.ZodOptional<z.ZodString>;
|
|
405
|
+
queuedAt: z.ZodOptional<z.ZodNumber>;
|
|
406
|
+
resultPreview: z.ZodOptional<z.ZodString>;
|
|
407
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
408
|
+
state: z.ZodEnum<{
|
|
409
|
+
done: "done";
|
|
410
|
+
failed: "failed";
|
|
411
|
+
queued: "queued";
|
|
412
|
+
running: "running";
|
|
413
|
+
skipped: "skipped";
|
|
414
|
+
}>;
|
|
415
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
416
|
+
toolCalls: z.ZodOptional<z.ZodNumber>;
|
|
417
|
+
}, z.core.$strip>>;
|
|
418
|
+
phases: z.ZodArray<z.ZodObject<{
|
|
419
|
+
index: z.ZodNumber;
|
|
420
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
421
|
+
title: z.ZodString;
|
|
422
|
+
}, z.core.$strip>>;
|
|
423
|
+
}, z.core.$strip>>;
|
|
424
|
+
workflowName: z.ZodOptional<z.ZodString>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
type ThreadEventBackgroundTaskItem = z.infer<typeof threadEventBackgroundTaskItemSchema>;
|
|
427
|
+
declare const threadEventItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
428
|
+
clientRequestId: z.ZodOptional<z.ZodString>;
|
|
429
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
430
|
+
text: z.ZodString;
|
|
431
|
+
type: z.ZodLiteral<"text">;
|
|
432
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
433
|
+
type: z.ZodLiteral<"image">;
|
|
434
|
+
url: z.ZodString;
|
|
435
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
436
|
+
path: z.ZodString;
|
|
437
|
+
type: z.ZodLiteral<"localImage">;
|
|
438
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
439
|
+
path: z.ZodString;
|
|
440
|
+
type: z.ZodLiteral<"localFile">;
|
|
441
|
+
}, z.core.$strip>], "type">>;
|
|
442
|
+
id: z.ZodString;
|
|
443
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
444
|
+
type: z.ZodLiteral<"userMessage">;
|
|
445
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
446
|
+
id: z.ZodString;
|
|
447
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
448
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
449
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
450
|
+
icon: z.ZodObject<{
|
|
451
|
+
glyph: z.ZodString;
|
|
452
|
+
}, z.core.$strip>;
|
|
453
|
+
label: z.ZodObject<{
|
|
454
|
+
completed: z.ZodString;
|
|
455
|
+
pending: z.ZodString;
|
|
456
|
+
}, z.core.$strip>;
|
|
457
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
458
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
459
|
+
dark: z.ZodString;
|
|
460
|
+
light: z.ZodString;
|
|
461
|
+
}, z.core.$strip>>;
|
|
462
|
+
title: z.ZodOptional<z.ZodString>;
|
|
463
|
+
}, z.core.$strip>>;
|
|
464
|
+
text: z.ZodString;
|
|
465
|
+
type: z.ZodLiteral<"agentMessage">;
|
|
466
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
467
|
+
aggregatedOutput: z.ZodOptional<z.ZodString>;
|
|
468
|
+
approvalStatus: z.ZodNullable<z.ZodEnum<{
|
|
469
|
+
denied: "denied";
|
|
470
|
+
waiting_for_approval: "waiting_for_approval";
|
|
471
|
+
}>>;
|
|
472
|
+
command: z.ZodString;
|
|
473
|
+
cwd: z.ZodString;
|
|
474
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
475
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
476
|
+
id: z.ZodString;
|
|
477
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
478
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
479
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
480
|
+
icon: z.ZodObject<{
|
|
481
|
+
glyph: z.ZodString;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
label: z.ZodObject<{
|
|
484
|
+
completed: z.ZodString;
|
|
485
|
+
pending: z.ZodString;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
489
|
+
dark: z.ZodString;
|
|
490
|
+
light: z.ZodString;
|
|
491
|
+
}, z.core.$strip>>;
|
|
492
|
+
title: z.ZodOptional<z.ZodString>;
|
|
493
|
+
}, z.core.$strip>>;
|
|
494
|
+
status: z.ZodEnum<{
|
|
495
|
+
completed: "completed";
|
|
496
|
+
failed: "failed";
|
|
497
|
+
interrupted: "interrupted";
|
|
498
|
+
pending: "pending";
|
|
499
|
+
}>;
|
|
500
|
+
truncation: z.ZodOptional<z.ZodObject<{
|
|
501
|
+
aggregatedOutput: z.ZodOptional<z.ZodObject<{
|
|
502
|
+
originalLength: z.ZodNumber;
|
|
503
|
+
retainedHeadLength: z.ZodNumber;
|
|
504
|
+
retainedTailLength: z.ZodNumber;
|
|
505
|
+
truncatedAt: z.ZodNumber;
|
|
506
|
+
}, z.core.$strip>>;
|
|
507
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
508
|
+
originalLength: z.ZodNumber;
|
|
509
|
+
retainedHeadLength: z.ZodNumber;
|
|
510
|
+
retainedTailLength: z.ZodNumber;
|
|
511
|
+
truncatedAt: z.ZodNumber;
|
|
512
|
+
}, z.core.$strip>>;
|
|
513
|
+
resultText: z.ZodOptional<z.ZodObject<{
|
|
514
|
+
originalLength: z.ZodNumber;
|
|
515
|
+
retainedHeadLength: z.ZodNumber;
|
|
516
|
+
retainedTailLength: z.ZodNumber;
|
|
517
|
+
truncatedAt: z.ZodNumber;
|
|
518
|
+
}, z.core.$strip>>;
|
|
519
|
+
}, z.core.$strip>>;
|
|
520
|
+
type: z.ZodLiteral<"commandExecution">;
|
|
521
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
522
|
+
approvalStatus: z.ZodNullable<z.ZodEnum<{
|
|
523
|
+
denied: "denied";
|
|
524
|
+
waiting_for_approval: "waiting_for_approval";
|
|
525
|
+
}>>;
|
|
526
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
527
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
528
|
+
kind: z.ZodEnum<{
|
|
529
|
+
add: "add";
|
|
530
|
+
delete: "delete";
|
|
531
|
+
update: "update";
|
|
532
|
+
}>;
|
|
533
|
+
movePath: z.ZodOptional<z.ZodString>;
|
|
534
|
+
path: z.ZodString;
|
|
535
|
+
}, z.core.$strip>>;
|
|
536
|
+
id: z.ZodString;
|
|
537
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
538
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
539
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
540
|
+
icon: z.ZodObject<{
|
|
541
|
+
glyph: z.ZodString;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
label: z.ZodObject<{
|
|
544
|
+
completed: z.ZodString;
|
|
545
|
+
pending: z.ZodString;
|
|
546
|
+
}, z.core.$strip>;
|
|
547
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
548
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
549
|
+
dark: z.ZodString;
|
|
550
|
+
light: z.ZodString;
|
|
551
|
+
}, z.core.$strip>>;
|
|
552
|
+
title: z.ZodOptional<z.ZodString>;
|
|
553
|
+
}, z.core.$strip>>;
|
|
554
|
+
status: z.ZodEnum<{
|
|
555
|
+
completed: "completed";
|
|
556
|
+
failed: "failed";
|
|
557
|
+
interrupted: "interrupted";
|
|
558
|
+
pending: "pending";
|
|
559
|
+
}>;
|
|
560
|
+
type: z.ZodLiteral<"fileChange">;
|
|
561
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
562
|
+
id: z.ZodString;
|
|
563
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
564
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
565
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
566
|
+
icon: z.ZodObject<{
|
|
567
|
+
glyph: z.ZodString;
|
|
568
|
+
}, z.core.$strip>;
|
|
569
|
+
label: z.ZodObject<{
|
|
570
|
+
completed: z.ZodString;
|
|
571
|
+
pending: z.ZodString;
|
|
572
|
+
}, z.core.$strip>;
|
|
573
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
574
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
575
|
+
dark: z.ZodString;
|
|
576
|
+
light: z.ZodString;
|
|
577
|
+
}, z.core.$strip>>;
|
|
578
|
+
title: z.ZodOptional<z.ZodString>;
|
|
579
|
+
}, z.core.$strip>>;
|
|
580
|
+
queries: z.ZodArray<z.ZodString>;
|
|
581
|
+
resultText: z.ZodNullable<z.ZodString>;
|
|
582
|
+
type: z.ZodLiteral<"webSearch">;
|
|
583
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
584
|
+
id: z.ZodString;
|
|
585
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
586
|
+
pattern: z.ZodNullable<z.ZodString>;
|
|
587
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
588
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
589
|
+
icon: z.ZodObject<{
|
|
590
|
+
glyph: z.ZodString;
|
|
591
|
+
}, z.core.$strip>;
|
|
592
|
+
label: z.ZodObject<{
|
|
593
|
+
completed: z.ZodString;
|
|
594
|
+
pending: z.ZodString;
|
|
595
|
+
}, z.core.$strip>;
|
|
596
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
597
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
598
|
+
dark: z.ZodString;
|
|
599
|
+
light: z.ZodString;
|
|
600
|
+
}, z.core.$strip>>;
|
|
601
|
+
title: z.ZodOptional<z.ZodString>;
|
|
602
|
+
}, z.core.$strip>>;
|
|
603
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
604
|
+
resultText: z.ZodNullable<z.ZodString>;
|
|
605
|
+
type: z.ZodLiteral<"webFetch">;
|
|
606
|
+
url: z.ZodString;
|
|
607
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
608
|
+
id: z.ZodString;
|
|
609
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
610
|
+
path: z.ZodString;
|
|
611
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
612
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
613
|
+
icon: z.ZodObject<{
|
|
614
|
+
glyph: z.ZodString;
|
|
615
|
+
}, z.core.$strip>;
|
|
616
|
+
label: z.ZodObject<{
|
|
617
|
+
completed: z.ZodString;
|
|
618
|
+
pending: z.ZodString;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
621
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
622
|
+
dark: z.ZodString;
|
|
623
|
+
light: z.ZodString;
|
|
624
|
+
}, z.core.$strip>>;
|
|
625
|
+
title: z.ZodOptional<z.ZodString>;
|
|
626
|
+
}, z.core.$strip>>;
|
|
627
|
+
type: z.ZodLiteral<"imageView">;
|
|
628
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
629
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
630
|
+
id: z.ZodString;
|
|
631
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
632
|
+
path: z.ZodString;
|
|
633
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
634
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
635
|
+
icon: z.ZodObject<{
|
|
636
|
+
glyph: z.ZodString;
|
|
637
|
+
}, z.core.$strip>;
|
|
638
|
+
label: z.ZodObject<{
|
|
639
|
+
completed: z.ZodString;
|
|
640
|
+
pending: z.ZodString;
|
|
641
|
+
}, z.core.$strip>;
|
|
642
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
643
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
644
|
+
dark: z.ZodString;
|
|
645
|
+
light: z.ZodString;
|
|
646
|
+
}, z.core.$strip>>;
|
|
647
|
+
title: z.ZodOptional<z.ZodString>;
|
|
648
|
+
}, z.core.$strip>>;
|
|
649
|
+
status: z.ZodEnum<{
|
|
650
|
+
completed: "completed";
|
|
651
|
+
failed: "failed";
|
|
652
|
+
interrupted: "interrupted";
|
|
653
|
+
pending: "pending";
|
|
654
|
+
}>;
|
|
655
|
+
type: z.ZodLiteral<"fileRead">;
|
|
656
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
657
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
658
|
+
id: z.ZodString;
|
|
659
|
+
mode: z.ZodEnum<{
|
|
660
|
+
content: "content";
|
|
661
|
+
list: "list";
|
|
662
|
+
path: "path";
|
|
663
|
+
}>;
|
|
664
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
665
|
+
path: z.ZodOptional<z.ZodString>;
|
|
666
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
667
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
668
|
+
icon: z.ZodObject<{
|
|
669
|
+
glyph: z.ZodString;
|
|
670
|
+
}, z.core.$strip>;
|
|
671
|
+
label: z.ZodObject<{
|
|
672
|
+
completed: z.ZodString;
|
|
673
|
+
pending: z.ZodString;
|
|
674
|
+
}, z.core.$strip>;
|
|
675
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
676
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
677
|
+
dark: z.ZodString;
|
|
678
|
+
light: z.ZodString;
|
|
679
|
+
}, z.core.$strip>>;
|
|
680
|
+
title: z.ZodOptional<z.ZodString>;
|
|
681
|
+
}, z.core.$strip>>;
|
|
682
|
+
query: z.ZodString;
|
|
683
|
+
status: z.ZodEnum<{
|
|
684
|
+
completed: "completed";
|
|
685
|
+
failed: "failed";
|
|
686
|
+
interrupted: "interrupted";
|
|
687
|
+
pending: "pending";
|
|
688
|
+
}>;
|
|
689
|
+
type: z.ZodLiteral<"search">;
|
|
690
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
691
|
+
arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
692
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
693
|
+
error: z.ZodOptional<z.ZodString>;
|
|
694
|
+
id: z.ZodString;
|
|
695
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
696
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
697
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
698
|
+
icon: z.ZodObject<{
|
|
699
|
+
glyph: z.ZodString;
|
|
700
|
+
}, z.core.$strip>;
|
|
701
|
+
label: z.ZodObject<{
|
|
702
|
+
completed: z.ZodString;
|
|
703
|
+
pending: z.ZodString;
|
|
704
|
+
}, z.core.$strip>;
|
|
705
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
706
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
707
|
+
dark: z.ZodString;
|
|
708
|
+
light: z.ZodString;
|
|
709
|
+
}, z.core.$strip>>;
|
|
710
|
+
title: z.ZodOptional<z.ZodString>;
|
|
711
|
+
}, z.core.$strip>>;
|
|
712
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
713
|
+
server: z.ZodOptional<z.ZodString>;
|
|
714
|
+
status: z.ZodEnum<{
|
|
715
|
+
completed: "completed";
|
|
716
|
+
failed: "failed";
|
|
717
|
+
interrupted: "interrupted";
|
|
718
|
+
pending: "pending";
|
|
719
|
+
}>;
|
|
720
|
+
tool: z.ZodString;
|
|
721
|
+
truncation: z.ZodOptional<z.ZodObject<{
|
|
722
|
+
aggregatedOutput: z.ZodOptional<z.ZodObject<{
|
|
723
|
+
originalLength: z.ZodNumber;
|
|
724
|
+
retainedHeadLength: z.ZodNumber;
|
|
725
|
+
retainedTailLength: z.ZodNumber;
|
|
726
|
+
truncatedAt: z.ZodNumber;
|
|
727
|
+
}, z.core.$strip>>;
|
|
728
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
729
|
+
originalLength: z.ZodNumber;
|
|
730
|
+
retainedHeadLength: z.ZodNumber;
|
|
731
|
+
retainedTailLength: z.ZodNumber;
|
|
732
|
+
truncatedAt: z.ZodNumber;
|
|
733
|
+
}, z.core.$strip>>;
|
|
734
|
+
resultText: z.ZodOptional<z.ZodObject<{
|
|
735
|
+
originalLength: z.ZodNumber;
|
|
736
|
+
retainedHeadLength: z.ZodNumber;
|
|
737
|
+
retainedTailLength: z.ZodNumber;
|
|
738
|
+
truncatedAt: z.ZodNumber;
|
|
739
|
+
}, z.core.$strip>>;
|
|
740
|
+
}, z.core.$strip>>;
|
|
741
|
+
type: z.ZodLiteral<"toolCall">;
|
|
742
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
743
|
+
content: z.ZodArray<z.ZodString>;
|
|
744
|
+
id: z.ZodString;
|
|
745
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
746
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
747
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
748
|
+
icon: z.ZodObject<{
|
|
749
|
+
glyph: z.ZodString;
|
|
750
|
+
}, z.core.$strip>;
|
|
751
|
+
label: z.ZodObject<{
|
|
752
|
+
completed: z.ZodString;
|
|
753
|
+
pending: z.ZodString;
|
|
754
|
+
}, z.core.$strip>;
|
|
755
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
756
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
757
|
+
dark: z.ZodString;
|
|
758
|
+
light: z.ZodString;
|
|
759
|
+
}, z.core.$strip>>;
|
|
760
|
+
title: z.ZodOptional<z.ZodString>;
|
|
761
|
+
}, z.core.$strip>>;
|
|
762
|
+
summary: z.ZodArray<z.ZodString>;
|
|
763
|
+
type: z.ZodLiteral<"reasoning">;
|
|
764
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
765
|
+
id: z.ZodString;
|
|
766
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
767
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
768
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
769
|
+
icon: z.ZodObject<{
|
|
770
|
+
glyph: z.ZodString;
|
|
771
|
+
}, z.core.$strip>;
|
|
772
|
+
label: z.ZodObject<{
|
|
773
|
+
completed: z.ZodString;
|
|
774
|
+
pending: z.ZodString;
|
|
775
|
+
}, z.core.$strip>;
|
|
776
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
777
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
778
|
+
dark: z.ZodString;
|
|
779
|
+
light: z.ZodString;
|
|
780
|
+
}, z.core.$strip>>;
|
|
781
|
+
title: z.ZodOptional<z.ZodString>;
|
|
782
|
+
}, z.core.$strip>>;
|
|
783
|
+
text: z.ZodString;
|
|
784
|
+
type: z.ZodLiteral<"plan">;
|
|
785
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
786
|
+
explanation: z.ZodOptional<z.ZodString>;
|
|
787
|
+
id: z.ZodString;
|
|
788
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
789
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
790
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
791
|
+
icon: z.ZodObject<{
|
|
792
|
+
glyph: z.ZodString;
|
|
793
|
+
}, z.core.$strip>;
|
|
794
|
+
label: z.ZodObject<{
|
|
795
|
+
completed: z.ZodString;
|
|
796
|
+
pending: z.ZodString;
|
|
797
|
+
}, z.core.$strip>;
|
|
798
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
799
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
800
|
+
dark: z.ZodString;
|
|
801
|
+
light: z.ZodString;
|
|
802
|
+
}, z.core.$strip>>;
|
|
803
|
+
title: z.ZodOptional<z.ZodString>;
|
|
804
|
+
}, z.core.$strip>>;
|
|
805
|
+
status: z.ZodEnum<{
|
|
806
|
+
completed: "completed";
|
|
807
|
+
failed: "failed";
|
|
808
|
+
interrupted: "interrupted";
|
|
809
|
+
pending: "pending";
|
|
810
|
+
}>;
|
|
811
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
812
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
813
|
+
active: "active";
|
|
814
|
+
completed: "completed";
|
|
815
|
+
failed: "failed";
|
|
816
|
+
pending: "pending";
|
|
817
|
+
}>>;
|
|
818
|
+
step: z.ZodString;
|
|
819
|
+
}, z.core.$strip>>;
|
|
820
|
+
type: z.ZodLiteral<"planSteps">;
|
|
821
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
822
|
+
id: z.ZodString;
|
|
823
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
824
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
825
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
826
|
+
icon: z.ZodObject<{
|
|
827
|
+
glyph: z.ZodString;
|
|
828
|
+
}, z.core.$strip>;
|
|
829
|
+
label: z.ZodObject<{
|
|
830
|
+
completed: z.ZodString;
|
|
831
|
+
pending: z.ZodString;
|
|
832
|
+
}, z.core.$strip>;
|
|
833
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
834
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
835
|
+
dark: z.ZodString;
|
|
836
|
+
light: z.ZodString;
|
|
837
|
+
}, z.core.$strip>>;
|
|
838
|
+
title: z.ZodOptional<z.ZodString>;
|
|
839
|
+
}, z.core.$strip>>;
|
|
840
|
+
type: z.ZodLiteral<"contextCompaction">;
|
|
841
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
842
|
+
description: z.ZodString;
|
|
843
|
+
error: z.ZodOptional<z.ZodString>;
|
|
844
|
+
familyId: z.ZodOptional<z.ZodString>;
|
|
845
|
+
id: z.ZodString;
|
|
846
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
847
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
848
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
849
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
850
|
+
icon: z.ZodObject<{
|
|
851
|
+
glyph: z.ZodString;
|
|
852
|
+
}, z.core.$strip>;
|
|
853
|
+
label: z.ZodObject<{
|
|
854
|
+
completed: z.ZodString;
|
|
855
|
+
pending: z.ZodString;
|
|
856
|
+
}, z.core.$strip>;
|
|
857
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
858
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
859
|
+
dark: z.ZodString;
|
|
860
|
+
light: z.ZodString;
|
|
861
|
+
}, z.core.$strip>>;
|
|
862
|
+
title: z.ZodOptional<z.ZodString>;
|
|
863
|
+
}, z.core.$strip>>;
|
|
864
|
+
skipTranscript: z.ZodBoolean;
|
|
865
|
+
status: z.ZodEnum<{
|
|
866
|
+
completed: "completed";
|
|
867
|
+
failed: "failed";
|
|
868
|
+
interrupted: "interrupted";
|
|
869
|
+
pending: "pending";
|
|
870
|
+
}>;
|
|
871
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
872
|
+
taskStatus: z.ZodEnum<{
|
|
873
|
+
completed: "completed";
|
|
874
|
+
failed: "failed";
|
|
875
|
+
killed: "killed";
|
|
876
|
+
paused: "paused";
|
|
877
|
+
pending: "pending";
|
|
878
|
+
running: "running";
|
|
879
|
+
stopped: "stopped";
|
|
880
|
+
}>;
|
|
881
|
+
taskType: z.ZodString;
|
|
882
|
+
type: z.ZodLiteral<"backgroundTask">;
|
|
883
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
884
|
+
durationMs: z.ZodNumber;
|
|
885
|
+
toolUses: z.ZodNumber;
|
|
886
|
+
totalTokens: z.ZodNumber;
|
|
887
|
+
}, z.core.$strip>>;
|
|
888
|
+
workflow: z.ZodOptional<z.ZodObject<{
|
|
889
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
890
|
+
agentType: z.ZodOptional<z.ZodString>;
|
|
891
|
+
attempt: z.ZodNumber;
|
|
892
|
+
cached: z.ZodBoolean;
|
|
893
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
894
|
+
error: z.ZodOptional<z.ZodString>;
|
|
895
|
+
index: z.ZodNumber;
|
|
896
|
+
isolation: z.ZodOptional<z.ZodString>;
|
|
897
|
+
label: z.ZodString;
|
|
898
|
+
lastProgressAt: z.ZodNumber;
|
|
899
|
+
lastToolName: z.ZodOptional<z.ZodString>;
|
|
900
|
+
lastToolSummary: z.ZodOptional<z.ZodString>;
|
|
901
|
+
model: z.ZodString;
|
|
902
|
+
phaseIndex: z.ZodOptional<z.ZodNumber>;
|
|
903
|
+
phaseTitle: z.ZodOptional<z.ZodString>;
|
|
904
|
+
promptPreview: z.ZodOptional<z.ZodString>;
|
|
905
|
+
queuedAt: z.ZodOptional<z.ZodNumber>;
|
|
906
|
+
resultPreview: z.ZodOptional<z.ZodString>;
|
|
907
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
908
|
+
state: z.ZodEnum<{
|
|
909
|
+
done: "done";
|
|
910
|
+
failed: "failed";
|
|
911
|
+
queued: "queued";
|
|
912
|
+
running: "running";
|
|
913
|
+
skipped: "skipped";
|
|
914
|
+
}>;
|
|
915
|
+
tokens: z.ZodOptional<z.ZodNumber>;
|
|
916
|
+
toolCalls: z.ZodOptional<z.ZodNumber>;
|
|
917
|
+
}, z.core.$strip>>;
|
|
918
|
+
phases: z.ZodArray<z.ZodObject<{
|
|
919
|
+
index: z.ZodNumber;
|
|
920
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
921
|
+
title: z.ZodString;
|
|
922
|
+
}, z.core.$strip>>;
|
|
923
|
+
}, z.core.$strip>>;
|
|
924
|
+
workflowName: z.ZodOptional<z.ZodString>;
|
|
925
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
926
|
+
background: z.ZodBoolean;
|
|
927
|
+
childRef: z.ZodString;
|
|
928
|
+
id: z.ZodString;
|
|
929
|
+
label: z.ZodString;
|
|
930
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
931
|
+
presentation: z.ZodOptional<z.ZodObject<{
|
|
932
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
933
|
+
icon: z.ZodObject<{
|
|
934
|
+
glyph: z.ZodString;
|
|
935
|
+
}, z.core.$strip>;
|
|
936
|
+
label: z.ZodObject<{
|
|
937
|
+
completed: z.ZodString;
|
|
938
|
+
pending: z.ZodString;
|
|
939
|
+
}, z.core.$strip>;
|
|
940
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
941
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
942
|
+
dark: z.ZodString;
|
|
943
|
+
light: z.ZodString;
|
|
944
|
+
}, z.core.$strip>>;
|
|
945
|
+
title: z.ZodOptional<z.ZodString>;
|
|
946
|
+
}, z.core.$strip>>;
|
|
947
|
+
status: z.ZodEnum<{
|
|
948
|
+
completed: "completed";
|
|
949
|
+
failed: "failed";
|
|
950
|
+
interrupted: "interrupted";
|
|
951
|
+
pending: "pending";
|
|
952
|
+
}>;
|
|
953
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
954
|
+
type: z.ZodLiteral<"delegation">;
|
|
955
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
956
|
+
id: z.ZodString;
|
|
957
|
+
kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
|
|
958
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
959
|
+
payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
960
|
+
presentation: z.ZodObject<{
|
|
961
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
962
|
+
icon: z.ZodObject<{
|
|
963
|
+
glyph: z.ZodString;
|
|
964
|
+
}, z.core.$strip>;
|
|
965
|
+
label: z.ZodObject<{
|
|
966
|
+
completed: z.ZodString;
|
|
967
|
+
pending: z.ZodString;
|
|
968
|
+
}, z.core.$strip>;
|
|
969
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
970
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
971
|
+
dark: z.ZodString;
|
|
972
|
+
light: z.ZodString;
|
|
973
|
+
}, z.core.$strip>>;
|
|
974
|
+
title: z.ZodOptional<z.ZodString>;
|
|
975
|
+
}, z.core.$strip>;
|
|
976
|
+
status: z.ZodEnum<{
|
|
977
|
+
completed: "completed";
|
|
978
|
+
failed: "failed";
|
|
979
|
+
interrupted: "interrupted";
|
|
980
|
+
pending: "pending";
|
|
981
|
+
}>;
|
|
982
|
+
type: z.ZodLiteral<"extension">;
|
|
983
|
+
}, z.core.$strip>], "type">;
|
|
984
|
+
type ThreadEventItem = z.infer<typeof threadEventItemSchema>;
|
|
15
985
|
/** All thread events — provider-originated or system-originated. */
|
|
16
986
|
declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
987
|
threadId: z.ZodString;
|
|
@@ -374,10 +1344,6 @@ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.
|
|
|
374
1344
|
interrupted: "interrupted";
|
|
375
1345
|
pending: "pending";
|
|
376
1346
|
}>;
|
|
377
|
-
statusLabels: z.ZodOptional<z.ZodObject<{
|
|
378
|
-
completed: z.ZodString;
|
|
379
|
-
pending: z.ZodString;
|
|
380
|
-
}, z.core.$strip>>;
|
|
381
1347
|
tool: z.ZodString;
|
|
382
1348
|
truncation: z.ZodOptional<z.ZodObject<{
|
|
383
1349
|
aggregatedOutput: z.ZodOptional<z.ZodObject<{
|
|
@@ -939,10 +1905,6 @@ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.
|
|
|
939
1905
|
interrupted: "interrupted";
|
|
940
1906
|
pending: "pending";
|
|
941
1907
|
}>;
|
|
942
|
-
statusLabels: z.ZodOptional<z.ZodObject<{
|
|
943
|
-
completed: z.ZodString;
|
|
944
|
-
pending: z.ZodString;
|
|
945
|
-
}, z.core.$strip>>;
|
|
946
1908
|
tool: z.ZodString;
|
|
947
1909
|
truncation: z.ZodOptional<z.ZodObject<{
|
|
948
1910
|
aggregatedOutput: z.ZodOptional<z.ZodObject<{
|
|
@@ -2003,6 +2965,215 @@ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.
|
|
|
2003
2965
|
status: z.ZodString;
|
|
2004
2966
|
threadId: z.ZodString;
|
|
2005
2967
|
type: z.ZodLiteral<"system/operation">;
|
|
2968
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2969
|
+
interaction: z.ZodUnion<readonly [z.ZodObject<{
|
|
2970
|
+
id: z.ZodString;
|
|
2971
|
+
origin: z.ZodObject<{
|
|
2972
|
+
kind: z.ZodLiteral<"provider">;
|
|
2973
|
+
providerId: z.ZodString;
|
|
2974
|
+
providerRequestId: z.ZodString;
|
|
2975
|
+
}, z.core.$strip>;
|
|
2976
|
+
payload: z.ZodObject<{
|
|
2977
|
+
kind: z.ZodLiteral<"approval">;
|
|
2978
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
2979
|
+
subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2980
|
+
actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2981
|
+
command: z.ZodString;
|
|
2982
|
+
name: z.ZodString;
|
|
2983
|
+
path: z.ZodString;
|
|
2984
|
+
type: z.ZodLiteral<"read">;
|
|
2985
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2986
|
+
command: z.ZodString;
|
|
2987
|
+
path: z.ZodNullable<z.ZodString>;
|
|
2988
|
+
type: z.ZodLiteral<"listFiles">;
|
|
2989
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2990
|
+
command: z.ZodString;
|
|
2991
|
+
path: z.ZodNullable<z.ZodString>;
|
|
2992
|
+
query: z.ZodNullable<z.ZodString>;
|
|
2993
|
+
type: z.ZodLiteral<"search">;
|
|
2994
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2995
|
+
command: z.ZodString;
|
|
2996
|
+
type: z.ZodLiteral<"unknown">;
|
|
2997
|
+
}, z.core.$strip>], "type">>;
|
|
2998
|
+
command: z.ZodString;
|
|
2999
|
+
cwd: z.ZodNullable<z.ZodString>;
|
|
3000
|
+
itemId: z.ZodString;
|
|
3001
|
+
kind: z.ZodLiteral<"command">;
|
|
3002
|
+
sessionGrant: z.ZodNullable<z.ZodObject<{
|
|
3003
|
+
fileSystem: z.ZodNullable<z.ZodObject<{
|
|
3004
|
+
read: z.ZodArray<z.ZodString>;
|
|
3005
|
+
write: z.ZodArray<z.ZodString>;
|
|
3006
|
+
}, z.core.$strip>>;
|
|
3007
|
+
network: z.ZodNullable<z.ZodObject<{
|
|
3008
|
+
enabled: z.ZodNullable<z.ZodBoolean>;
|
|
3009
|
+
}, z.core.$strip>>;
|
|
3010
|
+
}, z.core.$strict>>;
|
|
3011
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3012
|
+
itemId: z.ZodString;
|
|
3013
|
+
kind: z.ZodLiteral<"file_change">;
|
|
3014
|
+
sessionGrant: z.ZodNullable<z.ZodObject<{
|
|
3015
|
+
fileSystem: z.ZodNullable<z.ZodObject<{
|
|
3016
|
+
read: z.ZodArray<z.ZodString>;
|
|
3017
|
+
write: z.ZodArray<z.ZodString>;
|
|
3018
|
+
}, z.core.$strip>>;
|
|
3019
|
+
network: z.ZodNullable<z.ZodObject<{
|
|
3020
|
+
enabled: z.ZodNullable<z.ZodBoolean>;
|
|
3021
|
+
}, z.core.$strip>>;
|
|
3022
|
+
}, z.core.$strict>>;
|
|
3023
|
+
writeScope: z.ZodNullable<z.ZodString>;
|
|
3024
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3025
|
+
itemId: z.ZodString;
|
|
3026
|
+
kind: z.ZodLiteral<"permission_grant">;
|
|
3027
|
+
permissions: z.ZodObject<{
|
|
3028
|
+
fileSystem: z.ZodNullable<z.ZodObject<{
|
|
3029
|
+
read: z.ZodArray<z.ZodString>;
|
|
3030
|
+
write: z.ZodArray<z.ZodString>;
|
|
3031
|
+
}, z.core.$strip>>;
|
|
3032
|
+
network: z.ZodNullable<z.ZodObject<{
|
|
3033
|
+
enabled: z.ZodNullable<z.ZodBoolean>;
|
|
3034
|
+
}, z.core.$strip>>;
|
|
3035
|
+
}, z.core.$strict>;
|
|
3036
|
+
toolName: z.ZodNullable<z.ZodString>;
|
|
3037
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3038
|
+
itemId: z.ZodString;
|
|
3039
|
+
kind: z.ZodLiteral<"plan">;
|
|
3040
|
+
plan: z.ZodString;
|
|
3041
|
+
planFilePath: z.ZodNullable<z.ZodString>;
|
|
3042
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3043
|
+
itemId: z.ZodString;
|
|
3044
|
+
kind: z.ZodLiteral<"tool_use">;
|
|
3045
|
+
presentation: z.ZodObject<{
|
|
3046
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3047
|
+
icon: z.ZodObject<{
|
|
3048
|
+
glyph: z.ZodString;
|
|
3049
|
+
}, z.core.$strip>;
|
|
3050
|
+
label: z.ZodObject<{
|
|
3051
|
+
completed: z.ZodString;
|
|
3052
|
+
pending: z.ZodString;
|
|
3053
|
+
}, z.core.$strip>;
|
|
3054
|
+
suppress: z.ZodOptional<z.ZodBoolean>;
|
|
3055
|
+
tint: z.ZodOptional<z.ZodObject<{
|
|
3056
|
+
dark: z.ZodString;
|
|
3057
|
+
light: z.ZodString;
|
|
3058
|
+
}, z.core.$strip>>;
|
|
3059
|
+
title: z.ZodOptional<z.ZodString>;
|
|
3060
|
+
}, z.core.$strip>;
|
|
3061
|
+
tool: z.ZodString;
|
|
3062
|
+
}, z.core.$strip>], "kind">;
|
|
3063
|
+
}, z.core.$strip>;
|
|
3064
|
+
resolution: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3065
|
+
decision: z.ZodLiteral<"allow_once">;
|
|
3066
|
+
grantedPermissions: z.ZodNullable<z.ZodObject<{
|
|
3067
|
+
fileSystem: z.ZodNullable<z.ZodObject<{
|
|
3068
|
+
read: z.ZodArray<z.ZodString>;
|
|
3069
|
+
write: z.ZodArray<z.ZodString>;
|
|
3070
|
+
}, z.core.$strip>>;
|
|
3071
|
+
network: z.ZodNullable<z.ZodObject<{
|
|
3072
|
+
enabled: z.ZodNullable<z.ZodBoolean>;
|
|
3073
|
+
}, z.core.$strip>>;
|
|
3074
|
+
}, z.core.$strict>>;
|
|
3075
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3076
|
+
decision: z.ZodLiteral<"allow_for_session">;
|
|
3077
|
+
grantedPermissions: z.ZodNullable<z.ZodObject<{
|
|
3078
|
+
fileSystem: z.ZodNullable<z.ZodObject<{
|
|
3079
|
+
read: z.ZodArray<z.ZodString>;
|
|
3080
|
+
write: z.ZodArray<z.ZodString>;
|
|
3081
|
+
}, z.core.$strip>>;
|
|
3082
|
+
network: z.ZodNullable<z.ZodObject<{
|
|
3083
|
+
enabled: z.ZodNullable<z.ZodBoolean>;
|
|
3084
|
+
}, z.core.$strip>>;
|
|
3085
|
+
}, z.core.$strict>>;
|
|
3086
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3087
|
+
decision: z.ZodLiteral<"deny">;
|
|
3088
|
+
}, z.core.$strip>], "decision">>;
|
|
3089
|
+
status: z.ZodEnum<{
|
|
3090
|
+
interrupted: "interrupted";
|
|
3091
|
+
pending: "pending";
|
|
3092
|
+
resolved: "resolved";
|
|
3093
|
+
resolving: "resolving";
|
|
3094
|
+
}>;
|
|
3095
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
3096
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3097
|
+
id: z.ZodString;
|
|
3098
|
+
origin: z.ZodObject<{
|
|
3099
|
+
kind: z.ZodLiteral<"provider">;
|
|
3100
|
+
providerId: z.ZodString;
|
|
3101
|
+
providerRequestId: z.ZodString;
|
|
3102
|
+
}, z.core.$strip>;
|
|
3103
|
+
payload: z.ZodObject<{
|
|
3104
|
+
kind: z.ZodLiteral<"user_question">;
|
|
3105
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
3106
|
+
allowFreeText: z.ZodBoolean;
|
|
3107
|
+
id: z.ZodString;
|
|
3108
|
+
multiSelect: z.ZodBoolean;
|
|
3109
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3110
|
+
description: z.ZodOptional<z.ZodString>;
|
|
3111
|
+
label: z.ZodString;
|
|
3112
|
+
value: z.ZodString;
|
|
3113
|
+
}, z.core.$strip>>>;
|
|
3114
|
+
prompt: z.ZodString;
|
|
3115
|
+
shortLabel: z.ZodOptional<z.ZodString>;
|
|
3116
|
+
}, z.core.$strip>>;
|
|
3117
|
+
}, z.core.$strip>;
|
|
3118
|
+
resolution: z.ZodNullable<z.ZodObject<{
|
|
3119
|
+
answers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3120
|
+
freeText: z.ZodOptional<z.ZodString>;
|
|
3121
|
+
selected: z.ZodArray<z.ZodString>;
|
|
3122
|
+
}, z.core.$strip>>;
|
|
3123
|
+
kind: z.ZodLiteral<"user_answer">;
|
|
3124
|
+
}, z.core.$strip>>;
|
|
3125
|
+
status: z.ZodEnum<{
|
|
3126
|
+
interrupted: "interrupted";
|
|
3127
|
+
pending: "pending";
|
|
3128
|
+
resolved: "resolved";
|
|
3129
|
+
resolving: "resolving";
|
|
3130
|
+
}>;
|
|
3131
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
3132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3133
|
+
id: z.ZodString;
|
|
3134
|
+
origin: z.ZodObject<{
|
|
3135
|
+
kind: z.ZodLiteral<"plugin">;
|
|
3136
|
+
pluginId: z.ZodString;
|
|
3137
|
+
rendererId: z.ZodString;
|
|
3138
|
+
}, z.core.$strip>;
|
|
3139
|
+
payload: z.ZodObject<{
|
|
3140
|
+
kind: z.ZodLiteral<"plugin">;
|
|
3141
|
+
title: z.ZodString;
|
|
3142
|
+
}, z.core.$strip>;
|
|
3143
|
+
resolution: z.ZodNullable<z.ZodObject<{
|
|
3144
|
+
kind: z.ZodLiteral<"plugin_submitted">;
|
|
3145
|
+
}, z.core.$strip>>;
|
|
3146
|
+
status: z.ZodEnum<{
|
|
3147
|
+
interrupted: "interrupted";
|
|
3148
|
+
pending: "pending";
|
|
3149
|
+
resolved: "resolved";
|
|
3150
|
+
resolving: "resolving";
|
|
3151
|
+
}>;
|
|
3152
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
3153
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3154
|
+
id: z.ZodString;
|
|
3155
|
+
origin: z.ZodObject<{
|
|
3156
|
+
kind: z.ZodLiteral<"provider">;
|
|
3157
|
+
providerId: z.ZodString;
|
|
3158
|
+
providerRequestId: z.ZodString;
|
|
3159
|
+
}, z.core.$strip>;
|
|
3160
|
+
payload: z.ZodObject<{
|
|
3161
|
+
kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
|
|
3162
|
+
title: z.ZodString;
|
|
3163
|
+
}, z.core.$strip>;
|
|
3164
|
+
resolution: z.ZodNullable<z.ZodObject<{
|
|
3165
|
+
kind: z.ZodLiteral<"request_answer">;
|
|
3166
|
+
}, z.core.$strip>>;
|
|
3167
|
+
status: z.ZodEnum<{
|
|
3168
|
+
interrupted: "interrupted";
|
|
3169
|
+
pending: "pending";
|
|
3170
|
+
resolved: "resolved";
|
|
3171
|
+
resolving: "resolving";
|
|
3172
|
+
}>;
|
|
3173
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
3174
|
+
}, z.core.$strip>]>;
|
|
3175
|
+
threadId: z.ZodString;
|
|
3176
|
+
type: z.ZodLiteral<"system/interaction/lifecycle">;
|
|
2006
3177
|
}, z.core.$strip>, z.ZodObject<{
|
|
2007
3178
|
interactionId: z.ZodString;
|
|
2008
3179
|
providerId: z.ZodString;
|
|
@@ -2181,167 +3352,47 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2181
3352
|
source: z.ZodEnum<{
|
|
2182
3353
|
command: "command";
|
|
2183
3354
|
skill: "skill";
|
|
2184
|
-
}>;
|
|
2185
|
-
trigger: z.ZodEnum<{
|
|
2186
|
-
"/": "/";
|
|
2187
|
-
}>;
|
|
2188
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2189
|
-
icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2190
|
-
itemId: z.ZodString;
|
|
2191
|
-
kind: z.ZodLiteral<"plugin">;
|
|
2192
|
-
label: z.ZodString;
|
|
2193
|
-
pluginId: z.ZodString;
|
|
2194
|
-
}, z.core.$strip>], "kind">>;
|
|
2195
|
-
start: z.ZodNumber;
|
|
2196
|
-
}, z.core.$strip>>>;
|
|
2197
|
-
text: z.ZodString;
|
|
2198
|
-
type: z.ZodLiteral<"text">;
|
|
2199
|
-
visibility: z.ZodOptional<z.ZodEnum<{
|
|
2200
|
-
"agent-only": "agent-only";
|
|
2201
|
-
}>>;
|
|
2202
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2203
|
-
type: z.ZodLiteral<"image">;
|
|
2204
|
-
url: z.ZodString;
|
|
2205
|
-
visibility: z.ZodOptional<z.ZodEnum<{
|
|
2206
|
-
"agent-only": "agent-only";
|
|
2207
|
-
}>>;
|
|
2208
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2209
|
-
path: z.ZodString;
|
|
2210
|
-
type: z.ZodLiteral<"localImage">;
|
|
2211
|
-
visibility: z.ZodOptional<z.ZodEnum<{
|
|
2212
|
-
"agent-only": "agent-only";
|
|
2213
|
-
}>>;
|
|
2214
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2215
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
2216
|
-
name: z.ZodOptional<z.ZodString>;
|
|
2217
|
-
path: z.ZodString;
|
|
2218
|
-
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
2219
|
-
type: z.ZodLiteral<"localFile">;
|
|
2220
|
-
visibility: z.ZodOptional<z.ZodEnum<{
|
|
2221
|
-
"agent-only": "agent-only";
|
|
2222
|
-
}>>;
|
|
2223
|
-
}, z.core.$strip>], "type">;
|
|
2224
|
-
type PromptInput = z.infer<typeof promptInputSchema>;
|
|
2225
|
-
|
|
2226
|
-
/**
|
|
2227
|
-
* Transport abstraction the conformance kit drives. Black-box at the message
|
|
2228
|
-
* level: lines in, JSON-RPC messages out. Two expected implementations — an
|
|
2229
|
-
* in-process bridge (`send` = the bridge's exported line handler,
|
|
2230
|
-
* `takeMessages` drains a captured-output buffer) and a spawned bridge binary
|
|
2231
|
-
* (stdin write + stdout readline). The kit never sees which.
|
|
2232
|
-
*/
|
|
2233
|
-
interface BridgeConformanceTransport {
|
|
2234
|
-
/** Deliver one raw line to the bridge. */
|
|
2235
|
-
send(line: string): void;
|
|
2236
|
-
/** Drain every message the bridge emitted since the last call. */
|
|
2237
|
-
takeMessages(): unknown[];
|
|
2238
|
-
close?(): Promise<void> | void;
|
|
2239
|
-
}
|
|
2240
|
-
/**
|
|
2241
|
-
* The kit-internal assembled-event lane. The wire carries `thread/delta`, but
|
|
2242
|
-
* the grammar checks run over canonical `ThreadEvent`s, so a conformance
|
|
2243
|
-
* transport assembles the bridge's deltas (through the runtime's real delta
|
|
2244
|
-
* assembler) and re-emits each assembled event as a notification with this
|
|
2245
|
-
* method and `{ threadId, event }` params. It is not a protocol method — it
|
|
2246
|
-
* exists only between a conformance transport and this kit.
|
|
2247
|
-
*/
|
|
2248
|
-
declare const CONFORMANCE_ASSEMBLED_EVENT_METHOD = "conformance/assembledEvent";
|
|
2249
|
-
type ConformanceStatus = "fail" | "pass" | "skipped";
|
|
2250
|
-
interface ConformanceCheckResult {
|
|
2251
|
-
/** Stable rule id, e.g. "rpc/unknown-method". */
|
|
2252
|
-
id: string;
|
|
2253
|
-
title: string;
|
|
2254
|
-
status: ConformanceStatus;
|
|
2255
|
-
/** Failure or skip explanation; empty on pass. */
|
|
2256
|
-
detail: string;
|
|
2257
|
-
}
|
|
2258
|
-
interface ConformanceReport {
|
|
2259
|
-
results: ConformanceCheckResult[];
|
|
2260
|
-
passed: boolean;
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
interface JsonRpcWireMessage {
|
|
2264
|
-
jsonrpc?: unknown;
|
|
2265
|
-
id?: string | number;
|
|
2266
|
-
method?: string;
|
|
2267
|
-
params?: unknown;
|
|
2268
|
-
result?: unknown;
|
|
2269
|
-
error?: {
|
|
2270
|
-
code?: unknown;
|
|
2271
|
-
message?: unknown;
|
|
2272
|
-
};
|
|
2273
|
-
}
|
|
2274
|
-
/**
|
|
2275
|
-
* A polling JSON-RPC client over a conformance transport. Accumulates every
|
|
2276
|
-
* message the bridge emits (responses, notifications, bridge-initiated
|
|
2277
|
-
* requests) into one ordered log so grammar checks can assert sequences.
|
|
2278
|
-
*/
|
|
2279
|
-
declare class ConformanceClient {
|
|
2280
|
-
private readonly transport;
|
|
2281
|
-
private readonly timeoutMs;
|
|
2282
|
-
private nextId;
|
|
2283
|
-
readonly log: JsonRpcWireMessage[];
|
|
2284
|
-
constructor(transport: BridgeConformanceTransport, timeoutMs: number);
|
|
2285
|
-
drainIntoLog(): void;
|
|
2286
|
-
sendRaw(line: string): void;
|
|
2287
|
-
notify(method: string, params?: unknown): void;
|
|
2288
|
-
request(method: string, params?: unknown): number;
|
|
2289
|
-
/** Poll until `resolve` yields a value or the deadline passes (→ null). */
|
|
2290
|
-
waitFor<T>(resolve: () => T | undefined): Promise<T | null>;
|
|
2291
|
-
waitForResponse(id: number): Promise<JsonRpcWireMessage | null>;
|
|
2292
|
-
/** A settle window: drain for the given quiet period without expectations. */
|
|
2293
|
-
settle(quietMs: number): Promise<void>;
|
|
2294
|
-
responsesFor(id: number): JsonRpcWireMessage[];
|
|
2295
|
-
notifications(method?: string): JsonRpcWireMessage[];
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
|
-
interface ConformanceSessionFixture {
|
|
2299
|
-
/** Workspace directory for the session under test. */
|
|
2300
|
-
cwd: string;
|
|
2301
|
-
/** Prompt expected to elicit at least one assistant-message item. */
|
|
2302
|
-
promptInput: PromptInput[];
|
|
2303
|
-
/**
|
|
2304
|
-
* A prompt this provider accepts and completes locally, without producing
|
|
2305
|
-
* any of the activity that opens a bb turn — Claude Code's `/clear` is the
|
|
2306
|
-
* canonical example (#1431). Opting in enables
|
|
2307
|
-
* `turn/settles-without-activity`.
|
|
2308
|
-
*
|
|
2309
|
-
* The kit cannot elicit this shape generically: only the bridge knows what
|
|
2310
|
-
* its provider handles as zero work. A fixture that omits it produces no
|
|
2311
|
-
* result for that rule rather than a skip, so bridges that have not opted in
|
|
2312
|
-
* keep a fully green report.
|
|
2313
|
-
*/
|
|
2314
|
-
zeroWorkPromptInput?: PromptInput[];
|
|
2315
|
-
/** Execution options for the session; the kit defaults to full mode. */
|
|
2316
|
-
options?: Record<string, unknown>;
|
|
2317
|
-
}
|
|
2318
|
-
/**
|
|
2319
|
-
* item/opens-before-delta: no event may stream into an item id that no
|
|
2320
|
-
* item/started has opened yet. Pure over an event log so it is unit-testable
|
|
2321
|
-
* without a live bridge — the streaming grammar machine the host runs live,
|
|
2322
|
-
* fed a recording and filtered to this one rule.
|
|
2323
|
-
*/
|
|
2324
|
-
declare function checkItemOpensBeforeDelta(events: ThreadEvent[]): ConformanceCheckResult;
|
|
2325
|
-
|
|
2326
|
-
interface RunBridgeConformanceOptions {
|
|
2327
|
-
transport: BridgeConformanceTransport;
|
|
2328
|
-
session: ConformanceSessionFixture;
|
|
2329
|
-
/** Per-wait timeout. Conformant bridges answer fast; keep this tight. */
|
|
2330
|
-
timeoutMs?: number;
|
|
2331
|
-
}
|
|
2332
|
-
/**
|
|
2333
|
-
* Drive one bridge through the conformance scenarios: JSON-RPC hygiene, the
|
|
2334
|
-
* initialize handshake, then a shared session lifecycle (start → turn →
|
|
2335
|
-
* grammar checks → release stop → resume → id-uniqueness). One transport for
|
|
2336
|
-
* the whole run, mirroring a real bridge lifetime.
|
|
2337
|
-
*
|
|
2338
|
-
* Against a conformant bridge every result passes. Against a bridge that is
|
|
2339
|
-
* not yet protocol-pure, the failures ARE the migration work list — run it
|
|
2340
|
-
* before migrating and pin the report, then make it shrink.
|
|
2341
|
-
*/
|
|
2342
|
-
declare function runBridgeConformance(options: RunBridgeConformanceOptions): Promise<ConformanceReport>;
|
|
2343
|
-
/** Compact single-line-per-rule rendering for test snapshots and logs. */
|
|
2344
|
-
declare function formatConformanceReport(report: ConformanceReport): string;
|
|
3355
|
+
}>;
|
|
3356
|
+
trigger: z.ZodEnum<{
|
|
3357
|
+
"/": "/";
|
|
3358
|
+
}>;
|
|
3359
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3360
|
+
icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3361
|
+
itemId: z.ZodString;
|
|
3362
|
+
kind: z.ZodLiteral<"plugin">;
|
|
3363
|
+
label: z.ZodString;
|
|
3364
|
+
pluginId: z.ZodString;
|
|
3365
|
+
}, z.core.$strip>], "kind">>;
|
|
3366
|
+
start: z.ZodNumber;
|
|
3367
|
+
}, z.core.$strip>>>;
|
|
3368
|
+
text: z.ZodString;
|
|
3369
|
+
type: z.ZodLiteral<"text">;
|
|
3370
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
3371
|
+
"agent-only": "agent-only";
|
|
3372
|
+
}>>;
|
|
3373
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3374
|
+
type: z.ZodLiteral<"image">;
|
|
3375
|
+
url: z.ZodString;
|
|
3376
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
3377
|
+
"agent-only": "agent-only";
|
|
3378
|
+
}>>;
|
|
3379
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3380
|
+
path: z.ZodString;
|
|
3381
|
+
type: z.ZodLiteral<"localImage">;
|
|
3382
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
3383
|
+
"agent-only": "agent-only";
|
|
3384
|
+
}>>;
|
|
3385
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3386
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
3387
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3388
|
+
path: z.ZodString;
|
|
3389
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
3390
|
+
type: z.ZodLiteral<"localFile">;
|
|
3391
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
3392
|
+
"agent-only": "agent-only";
|
|
3393
|
+
}>>;
|
|
3394
|
+
}, z.core.$strip>], "type">;
|
|
3395
|
+
type PromptInput = z.infer<typeof promptInputSchema>;
|
|
2345
3396
|
|
|
2346
3397
|
/**
|
|
2347
3398
|
* The inclusive `[min, max]` range of `thread/delta` grammar versions a bridge
|
|
@@ -3153,12 +4204,6 @@ interface DiffCumulativeTextResult {
|
|
|
3153
4204
|
nextText: string;
|
|
3154
4205
|
reset: boolean;
|
|
3155
4206
|
}
|
|
3156
|
-
/**
|
|
3157
|
-
* Diffs a cumulative text snapshot against the previous one: emits only the
|
|
3158
|
-
* appended suffix when the provider keeps appending, or the full text with
|
|
3159
|
-
* `reset: true` when the snapshot restarted.
|
|
3160
|
-
*/
|
|
3161
|
-
declare function diffCumulativeText(args: DiffCumulativeTextArgs): DiffCumulativeTextResult | null;
|
|
3162
4207
|
interface CreateDeltaAssemblerOptions {
|
|
3163
4208
|
/** Provider id stamped onto provider/unhandled events. */
|
|
3164
4209
|
providerId: string;
|
|
@@ -3209,6 +4254,198 @@ interface DeltaAssembler {
|
|
|
3209
4254
|
}
|
|
3210
4255
|
declare function createDeltaAssembler(options: CreateDeltaAssemblerOptions): DeltaAssembler;
|
|
3211
4256
|
|
|
4257
|
+
/**
|
|
4258
|
+
* Test-side view of the runtime's delta assembly: bridge tests capture raw
|
|
4259
|
+
* JSON-RPC output, and bridges emit `thread/delta` notifications rather than
|
|
4260
|
+
* finished `ThreadEvent`s. These helpers run captured notifications through
|
|
4261
|
+
* the real delta assembler — the exact translation the bridge protocol
|
|
4262
|
+
* adapter performs — so assertions keep working against canonical
|
|
4263
|
+
* `ThreadEvent`s.
|
|
4264
|
+
*/
|
|
4265
|
+
|
|
4266
|
+
interface CapturedBridgeNotification {
|
|
4267
|
+
method?: string;
|
|
4268
|
+
params?: unknown;
|
|
4269
|
+
}
|
|
4270
|
+
interface BridgeDeltaEventCollector {
|
|
4271
|
+
assembler: DeltaAssembler;
|
|
4272
|
+
/** Canonical events for one captured notification (empty for non-deltas). */
|
|
4273
|
+
assembleMessage(message: CapturedBridgeNotification): ThreadEvent[];
|
|
4274
|
+
}
|
|
4275
|
+
declare function createBridgeDeltaEventCollector(providerId?: string): BridgeDeltaEventCollector;
|
|
4276
|
+
/**
|
|
4277
|
+
* All canonical events an ordered capture of bridge notifications assembles
|
|
4278
|
+
* to. Builds a fresh assembler per call, so feed it the full capture (not an
|
|
4279
|
+
* incremental slice) for deterministic ids.
|
|
4280
|
+
*/
|
|
4281
|
+
declare function assembleCapturedThreadEvents(messages: readonly CapturedBridgeNotification[], providerId?: string): ThreadEvent[];
|
|
4282
|
+
/**
|
|
4283
|
+
* Removed (SDK 0.4.16): the conformance kit assembles `thread/delta` itself.
|
|
4284
|
+
* A transport hands `runBridgeConformance` the raw captured messages
|
|
4285
|
+
* (`CapturedBridgeJsonRpcOutput.takeMessages`) and the run names its
|
|
4286
|
+
* `providerId`; this stub stays one release so a suite written against the
|
|
4287
|
+
* old transport shape fails with the replacement named, not a missing export.
|
|
4288
|
+
*/
|
|
4289
|
+
declare function toConformanceMessages(): never;
|
|
4290
|
+
|
|
4291
|
+
/**
|
|
4292
|
+
* Transport abstraction the conformance kit drives. Black-box at the message
|
|
4293
|
+
* level: lines in, JSON-RPC messages out. Two expected implementations — an
|
|
4294
|
+
* in-process bridge (`send` = the bridge's exported line handler,
|
|
4295
|
+
* `takeMessages` = the captured output's drain) and a spawned bridge binary
|
|
4296
|
+
* (stdin write + stdout readline). The kit never sees which: it assembles
|
|
4297
|
+
* the bridge's `thread/delta` notifications itself, through the runtime's
|
|
4298
|
+
* real delta assembler, so the transport hands over raw wire messages only.
|
|
4299
|
+
*/
|
|
4300
|
+
interface BridgeConformanceTransport {
|
|
4301
|
+
/** Deliver one raw line to the bridge. */
|
|
4302
|
+
send(line: string): void;
|
|
4303
|
+
/**
|
|
4304
|
+
* Every JSON-RPC message the bridge emitted since the last call, in order:
|
|
4305
|
+
* responses, notifications (`thread/delta` included) and bridge-initiated
|
|
4306
|
+
* requests, as parsed JSON.
|
|
4307
|
+
*/
|
|
4308
|
+
takeMessages(): unknown[];
|
|
4309
|
+
close?(): Promise<void> | void;
|
|
4310
|
+
}
|
|
4311
|
+
/**
|
|
4312
|
+
* Retired. The kit once read its canonical events from a notification the
|
|
4313
|
+
* transport assembled under this method; it now assembles `thread/delta`
|
|
4314
|
+
* itself and reads nothing under this name. Kept because SDK 0.4.x published
|
|
4315
|
+
* it from `@get-bb/plugin-sdk/provider-bridge/testing`; removed at the next
|
|
4316
|
+
* major version.
|
|
4317
|
+
*/
|
|
4318
|
+
declare const CONFORMANCE_ASSEMBLED_EVENT_METHOD = "conformance/assembledEvent";
|
|
4319
|
+
type ConformanceStatus = "fail" | "pass" | "skipped";
|
|
4320
|
+
interface ConformanceCheckResult {
|
|
4321
|
+
/** Stable rule id, e.g. "rpc/unknown-method". */
|
|
4322
|
+
id: string;
|
|
4323
|
+
title: string;
|
|
4324
|
+
status: ConformanceStatus;
|
|
4325
|
+
/** Failure or skip explanation; empty on pass. */
|
|
4326
|
+
detail: string;
|
|
4327
|
+
}
|
|
4328
|
+
interface ConformanceReport {
|
|
4329
|
+
results: ConformanceCheckResult[];
|
|
4330
|
+
passed: boolean;
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
interface ConformanceSessionFixture {
|
|
4334
|
+
/** Workspace directory for the session under test. */
|
|
4335
|
+
cwd: string;
|
|
4336
|
+
/** Prompt expected to elicit at least one assistant-message item. */
|
|
4337
|
+
promptInput: PromptInput[];
|
|
4338
|
+
/**
|
|
4339
|
+
* A prompt this provider accepts and completes locally, without producing
|
|
4340
|
+
* any of the activity that opens a bb turn — Claude Code's `/clear` is the
|
|
4341
|
+
* canonical example (#1431). Opting in enables
|
|
4342
|
+
* `turn/settles-without-activity`.
|
|
4343
|
+
*
|
|
4344
|
+
* The kit cannot elicit this shape generically: only the bridge knows what
|
|
4345
|
+
* its provider handles as zero work. A fixture that omits it produces no
|
|
4346
|
+
* result for that rule rather than a skip, so bridges that have not opted in
|
|
4347
|
+
* keep a fully green report.
|
|
4348
|
+
*/
|
|
4349
|
+
zeroWorkPromptInput?: PromptInput[];
|
|
4350
|
+
/**
|
|
4351
|
+
* A prompt that opens a turn and never settles it on its own, so the kit
|
|
4352
|
+
* can interrupt it. Opting in enables `session/threads-independent` and
|
|
4353
|
+
* `stop/interrupt-settles-before-result` (the kit names the turn to the
|
|
4354
|
+
* bridge through its own assembler's reverse map). A fixture that omits it
|
|
4355
|
+
* produces no result for those rules.
|
|
4356
|
+
*/
|
|
4357
|
+
interruptiblePromptInput?: PromptInput[];
|
|
4358
|
+
/** Execution options for the session; the kit defaults to full mode. */
|
|
4359
|
+
options?: Record<string, unknown>;
|
|
4360
|
+
/**
|
|
4361
|
+
* The plugin's declared icons (`bb.branding.experimental_icons`): its
|
|
4362
|
+
* plugin id and the declared names. Opting in enables
|
|
4363
|
+
* `presentation/icon-namespaced-declared`, which fails when any item's
|
|
4364
|
+
* `presentation.icon.glyph` is a namespaced glyph (`"<pluginId>/<name>"`)
|
|
4365
|
+
* that names another plugin or an undeclared name — what the server
|
|
4366
|
+
* would refuse at ingest with `provider/unhandled`. A `server: "bb"` tool
|
|
4367
|
+
* row is not inspected: its presentation came from the plugin that
|
|
4368
|
+
* registered the tool, and the server checks it against that plugin. A
|
|
4369
|
+
* fixture that omits `icons` produces no result for the rule, like the
|
|
4370
|
+
* other opt-in rules, so a bridge whose plugin declares no icons keeps a
|
|
4371
|
+
* fully green report.
|
|
4372
|
+
*/
|
|
4373
|
+
icons?: {
|
|
4374
|
+
pluginId: string;
|
|
4375
|
+
names: readonly string[];
|
|
4376
|
+
};
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4379
|
+
/**
|
|
4380
|
+
* Recorded-traffic conformance.
|
|
4381
|
+
*
|
|
4382
|
+
* The scripted scenarios in `scenarios.ts` drive a bridge with a fake
|
|
4383
|
+
* provider the kit authors wrote. This set drives it with what the provider
|
|
4384
|
+
* CLI really emitted: a committed recording (`recordings/<provider>/<cell>`),
|
|
4385
|
+
* replayed through the bridge by `testing/parity.ts`, checked with the same
|
|
4386
|
+
* grammar rules. A bridge passes when the replay reproduces a complete,
|
|
4387
|
+
* schema-valid, grammar-clean session for every recorded cell — so a
|
|
4388
|
+
* translation change that only the real dialect exercises fails conformance,
|
|
4389
|
+
* not just a golden.
|
|
4390
|
+
*
|
|
4391
|
+
* Pure over a replay's output, like `checkItemOpensBeforeDelta`: the caller
|
|
4392
|
+
* owns the bridge transport and the replay; this module owns the verdicts.
|
|
4393
|
+
*/
|
|
4394
|
+
|
|
4395
|
+
/** The cells every bridge is expected to reproduce (the live-QA matrix core). */
|
|
4396
|
+
declare const RECORDED_CONFORMANCE_CELLS: readonly ["turn-tools", "steer", "stop-interrupt", "approval-allow", "approval-deny", "user-question", "resume", "fork"];
|
|
4397
|
+
type RecordedConformanceCell = (typeof RECORDED_CONFORMANCE_CELLS)[number];
|
|
4398
|
+
interface RecordedCellReplay {
|
|
4399
|
+
provider: string;
|
|
4400
|
+
cell: string;
|
|
4401
|
+
/** Events the replayed bridge output assembled to, in order. */
|
|
4402
|
+
events: readonly ThreadEvent[];
|
|
4403
|
+
/**
|
|
4404
|
+
* Events the recording's own bridge output assembled to: the turn count the
|
|
4405
|
+
* replay must reach. A provider that legitimately refused a cell (an ACP
|
|
4406
|
+
* agent without `session/fork`) recorded no turns, and the replay must
|
|
4407
|
+
* reproduce that rather than invent one.
|
|
4408
|
+
*/
|
|
4409
|
+
recordedEvents: readonly ThreadEvent[];
|
|
4410
|
+
/** Requests the harness had to answer for the bridge, or gates that timed out. */
|
|
4411
|
+
stalls: readonly string[];
|
|
4412
|
+
}
|
|
4413
|
+
/**
|
|
4414
|
+
* The verdicts for one replayed cell. Rule ids are `recorded/<cell>/<rule>`
|
|
4415
|
+
* so a report lists every cell and a regression names the one it broke.
|
|
4416
|
+
*/
|
|
4417
|
+
declare function checkRecordedCellReplay(replay: RecordedCellReplay): ConformanceCheckResult[];
|
|
4418
|
+
|
|
4419
|
+
interface RunBridgeConformanceOptions {
|
|
4420
|
+
transport: BridgeConformanceTransport;
|
|
4421
|
+
session: ConformanceSessionFixture;
|
|
4422
|
+
/**
|
|
4423
|
+
* The provider id the bridge's plugin registers. The kit assembles the
|
|
4424
|
+
* bridge's `thread/delta` stream through the runtime's real delta
|
|
4425
|
+
* assembler, and the canonical events it builds carry this id, as the
|
|
4426
|
+
* runtime's would.
|
|
4427
|
+
*/
|
|
4428
|
+
providerId: string;
|
|
4429
|
+
/** Per-wait timeout. Conformant bridges answer fast; keep this tight. */
|
|
4430
|
+
timeoutMs?: number;
|
|
4431
|
+
}
|
|
4432
|
+
/**
|
|
4433
|
+
* Drive one bridge through the conformance scenarios: JSON-RPC hygiene, the
|
|
4434
|
+
* initialize handshake, then a shared session lifecycle (start → turn →
|
|
4435
|
+
* grammar checks → release stop → resume with its identity → id-uniqueness
|
|
4436
|
+
* → fork with its identity when the handshake declares fork → the opt-in
|
|
4437
|
+
* rules), released at the end the way the runtime releases a thread it
|
|
4438
|
+
* detaches. One transport for the whole run, mirroring a real bridge
|
|
4439
|
+
* lifetime.
|
|
4440
|
+
*
|
|
4441
|
+
* Against a conformant bridge every result passes. Against a bridge that is
|
|
4442
|
+
* not yet protocol-pure, the failures ARE the migration work list — run it
|
|
4443
|
+
* before migrating and pin the report, then make it shrink.
|
|
4444
|
+
*/
|
|
4445
|
+
declare function runBridgeConformance(options: RunBridgeConformanceOptions): Promise<ConformanceReport>;
|
|
4446
|
+
/** Compact single-line-per-rule rendering for test snapshots and logs. */
|
|
4447
|
+
declare function formatConformanceReport(report: ConformanceReport): string;
|
|
4448
|
+
|
|
3212
4449
|
type BridgeJsonRpcId = string | number;
|
|
3213
4450
|
type BridgeJsonRpcLineHandler = (line: string) => void;
|
|
3214
4451
|
interface BridgeJsonRpcObject {
|
|
@@ -3228,10 +4465,17 @@ interface BridgeJsonRpcOutputMessage {
|
|
|
3228
4465
|
}
|
|
3229
4466
|
interface CapturedBridgeJsonRpcOutput {
|
|
3230
4467
|
messages: BridgeJsonRpcOutputMessage[];
|
|
4468
|
+
/**
|
|
4469
|
+
* Every message since the last call: the conformance transport's drain
|
|
4470
|
+
* (`{ send: handleLine, takeMessages: output.takeMessages }`).
|
|
4471
|
+
*/
|
|
4472
|
+
takeMessages(): BridgeJsonRpcOutputMessage[];
|
|
3231
4473
|
restore(): void;
|
|
3232
4474
|
}
|
|
3233
4475
|
interface BridgeJsonRpcTestHarness {
|
|
3234
4476
|
messages: BridgeJsonRpcOutputMessage[];
|
|
4477
|
+
/** Every message since the last call: the conformance transport's drain. */
|
|
4478
|
+
takeMessages(): BridgeJsonRpcOutputMessage[];
|
|
3235
4479
|
flushWork(): Promise<void>;
|
|
3236
4480
|
hasResponse(id: BridgeJsonRpcId): boolean;
|
|
3237
4481
|
restore(): void;
|
|
@@ -3246,40 +4490,6 @@ interface BridgeJsonRpcTestHarness {
|
|
|
3246
4490
|
declare function captureBridgeJsonRpcOutput(): CapturedBridgeJsonRpcOutput;
|
|
3247
4491
|
declare function createBridgeJsonRpcTestHarness(handleLine: BridgeJsonRpcLineHandler): BridgeJsonRpcTestHarness;
|
|
3248
4492
|
|
|
3249
|
-
/**
|
|
3250
|
-
* Test-side view of the runtime's delta assembly: bridge tests capture raw
|
|
3251
|
-
* JSON-RPC output, and bridges emit `thread/delta` notifications rather than
|
|
3252
|
-
* finished `ThreadEvent`s. These helpers run captured notifications through
|
|
3253
|
-
* the real delta assembler — the exact translation the bridge protocol
|
|
3254
|
-
* adapter performs — so assertions keep working against canonical
|
|
3255
|
-
* `ThreadEvent`s.
|
|
3256
|
-
*/
|
|
3257
|
-
|
|
3258
|
-
interface CapturedBridgeNotification {
|
|
3259
|
-
method?: string;
|
|
3260
|
-
params?: unknown;
|
|
3261
|
-
}
|
|
3262
|
-
interface BridgeDeltaEventCollector {
|
|
3263
|
-
assembler: DeltaAssembler;
|
|
3264
|
-
/** Canonical events for one captured notification (empty for non-deltas). */
|
|
3265
|
-
assembleMessage(message: CapturedBridgeNotification): ThreadEvent[];
|
|
3266
|
-
}
|
|
3267
|
-
declare function createBridgeDeltaEventCollector(providerId?: string): BridgeDeltaEventCollector;
|
|
3268
|
-
/**
|
|
3269
|
-
* All canonical events an ordered capture of bridge notifications assembles
|
|
3270
|
-
* to. Builds a fresh assembler per call, so feed it the full capture (not an
|
|
3271
|
-
* incremental slice) for deterministic ids.
|
|
3272
|
-
*/
|
|
3273
|
-
declare function assembleCapturedThreadEvents(messages: readonly CapturedBridgeNotification[], providerId?: string): ThreadEvent[];
|
|
3274
|
-
/**
|
|
3275
|
-
* Map one captured bridge message for the conformance kit's transport: a
|
|
3276
|
-
* `thread/delta` notification is assembled (statefully, through the
|
|
3277
|
-
* collector's real assembler — hold one collector for the whole run) and each
|
|
3278
|
-
* assembled event is re-emitted on the kit's internal assembled-event lane;
|
|
3279
|
-
* every other message passes through untouched.
|
|
3280
|
-
*/
|
|
3281
|
-
declare function toConformanceMessages(message: CapturedBridgeNotification, collector: BridgeDeltaEventCollector): unknown[];
|
|
3282
|
-
|
|
3283
4493
|
/**
|
|
3284
4494
|
* Dual-path calibration support.
|
|
3285
4495
|
*
|
|
@@ -3314,5 +4524,326 @@ declare function normalizeCalibrationEvents(events: readonly ThreadEvent[], opti
|
|
|
3314
4524
|
/** Compact `type` (+ item type) rendering for asserting a known-divergence list. */
|
|
3315
4525
|
declare function describeCalibrationEvents(events: readonly unknown[]): string[];
|
|
3316
4526
|
|
|
3317
|
-
|
|
3318
|
-
|
|
4527
|
+
declare const BRIDGE_RECORDING_DIRECTIONS: readonly ["runtime→bridge", "bridge→runtime", "provider→bridge", "bridge→provider"];
|
|
4528
|
+
type BridgeRecordingDirection = (typeof BRIDGE_RECORDING_DIRECTIONS)[number];
|
|
4529
|
+
interface BridgeRecordingEntry {
|
|
4530
|
+
/** Wall-clock milliseconds when the line crossed. */
|
|
4531
|
+
ts: number;
|
|
4532
|
+
/**
|
|
4533
|
+
* The recorder's start time, identifying the bridge process that wrote the
|
|
4534
|
+
* entry. A thread can span several bridge processes (the runtime restarts a
|
|
4535
|
+
* bridge, or releases and later resumes the thread), each appending to the
|
|
4536
|
+
* same files with its own `seq`; `(run, seq)` orders entries exactly.
|
|
4537
|
+
*/
|
|
4538
|
+
run: number;
|
|
4539
|
+
/** Process-wide monotonic counter across all four lanes. */
|
|
4540
|
+
seq: number;
|
|
4541
|
+
dir: BridgeRecordingDirection;
|
|
4542
|
+
/** The raw line, without its terminator. */
|
|
4543
|
+
line: string;
|
|
4544
|
+
}
|
|
4545
|
+
|
|
4546
|
+
interface BridgeRecordingManifest {
|
|
4547
|
+
provider: string;
|
|
4548
|
+
cell: string;
|
|
4549
|
+
threadId: string | null;
|
|
4550
|
+
scope: "process" | "thread";
|
|
4551
|
+
cliVersion: string;
|
|
4552
|
+
recordedAt: string;
|
|
4553
|
+
description: string;
|
|
4554
|
+
note: string;
|
|
4555
|
+
bridgeRuns: number;
|
|
4556
|
+
lines: Partial<Record<BridgeRecordingDirection, number>>;
|
|
4557
|
+
}
|
|
4558
|
+
interface BridgeRecording {
|
|
4559
|
+
dir: string;
|
|
4560
|
+
manifest: BridgeRecordingManifest | null;
|
|
4561
|
+
/** Every lane merged back into wire order: by bridge process, then seq. */
|
|
4562
|
+
entries: BridgeRecordingEntry[];
|
|
4563
|
+
}
|
|
4564
|
+
/**
|
|
4565
|
+
* The file a bridge change re-records its side of the wire into
|
|
4566
|
+
* (`pnpm rerecord`): the `bridge→runtime` lane as THIS checkout's bridge
|
|
4567
|
+
* emits it for the recording's provider and runtime lanes. The recorded lane
|
|
4568
|
+
* itself is never rewritten — it is the recording, and a pre-migration
|
|
4569
|
+
* checkout paces its replay from it — so the current expectation lives
|
|
4570
|
+
* beside it. Absent until a bridge change first needs one.
|
|
4571
|
+
*/
|
|
4572
|
+
declare const CURRENT_BRIDGE_LANE_FILE = "bridge\u2192runtime.current.ndjson";
|
|
4573
|
+
/**
|
|
4574
|
+
* The recording with its `bridge→runtime` lane replaced by the current
|
|
4575
|
+
* expectation when one exists: what the self-suite pins and compares.
|
|
4576
|
+
*/
|
|
4577
|
+
declare function withCurrentBridgeLane(recording: BridgeRecording): BridgeRecording;
|
|
4578
|
+
declare function readBridgeRecording(dir: string): BridgeRecording;
|
|
4579
|
+
interface RecordedCell {
|
|
4580
|
+
provider: string;
|
|
4581
|
+
cell: string;
|
|
4582
|
+
dir: string;
|
|
4583
|
+
}
|
|
4584
|
+
/**
|
|
4585
|
+
* Every `<provider>/<cell>` directory under a recordings root that holds at
|
|
4586
|
+
* least one lane, sorted for stable iteration.
|
|
4587
|
+
*/
|
|
4588
|
+
declare function listRecordedCells(root: string): RecordedCell[];
|
|
4589
|
+
|
|
4590
|
+
/** One stateful assembler: `thread/delta` notifications in, events out. */
|
|
4591
|
+
interface ParityAssembler {
|
|
4592
|
+
assembleMessage(message: {
|
|
4593
|
+
method?: string;
|
|
4594
|
+
params?: unknown;
|
|
4595
|
+
}): ThreadEvent[];
|
|
4596
|
+
}
|
|
4597
|
+
type CreateParityAssembler = (providerId: string) => ParityAssembler;
|
|
4598
|
+
/** Project canonical events into timeline rows (the server's projection). */
|
|
4599
|
+
type ParityRowProjector = (args: {
|
|
4600
|
+
events: readonly ThreadEvent[];
|
|
4601
|
+
providerId: string;
|
|
4602
|
+
}) => unknown[];
|
|
4603
|
+
/** A bridge process, ready to spawn: the bootstrap, the module, its scope. */
|
|
4604
|
+
interface ProviderBridgeLaunch {
|
|
4605
|
+
command: string;
|
|
4606
|
+
args: string[];
|
|
4607
|
+
cwd: string;
|
|
4608
|
+
/** Added to the harness's own environment for the bridge process. */
|
|
4609
|
+
env: Record<string, string>;
|
|
4610
|
+
}
|
|
4611
|
+
interface ResolveProviderBridgeLaunchOptions {
|
|
4612
|
+
/**
|
|
4613
|
+
* The bridge module: the file whose `experimental_providerBridge` export the
|
|
4614
|
+
* bootstrap runs. Absolute; a built artifact (`host.mjs`) or, with a
|
|
4615
|
+
* TypeScript loader among `nodeArgs`, the source file.
|
|
4616
|
+
*/
|
|
4617
|
+
modulePath: string;
|
|
4618
|
+
/** The plugin the bridge belongs to (its data and temp directories). */
|
|
4619
|
+
pluginId: string;
|
|
4620
|
+
/** Working directory of the bridge process; defaults to the caller's. */
|
|
4621
|
+
cwd?: string;
|
|
4622
|
+
/**
|
|
4623
|
+
* The plugin data directory the bootstrap hands the bridge; defaults to a
|
|
4624
|
+
* fresh temp directory per launch.
|
|
4625
|
+
*/
|
|
4626
|
+
dataDir?: string;
|
|
4627
|
+
/**
|
|
4628
|
+
* The provider-bridge bootstrap (`bridge-worker-entry`) that runs the
|
|
4629
|
+
* module; defaults to the kit's own — the source entry in a bb checkout,
|
|
4630
|
+
* the bundled one in the published SDK.
|
|
4631
|
+
*/
|
|
4632
|
+
bootstrapPath?: string;
|
|
4633
|
+
/**
|
|
4634
|
+
* Node flags before the bootstrap. Defaults: in a bb checkout (source
|
|
4635
|
+
* bootstrap) `--conditions=source` plus the tsx loader; otherwise the tsx
|
|
4636
|
+
* loader for a TypeScript module and nothing for a built one.
|
|
4637
|
+
*/
|
|
4638
|
+
nodeArgs?: string[];
|
|
4639
|
+
}
|
|
4640
|
+
/**
|
|
4641
|
+
* The process that runs one bridge module through the bootstrap — exactly the
|
|
4642
|
+
* shape the runtime spawns, so a replayed bridge sees the argv, stdin framing
|
|
4643
|
+
* and signal handling it gets in production.
|
|
4644
|
+
*/
|
|
4645
|
+
declare function resolveProviderBridgeLaunch(options: ResolveProviderBridgeLaunchOptions): ProviderBridgeLaunch;
|
|
4646
|
+
type ReplayDialect = "claude-cli" | "json-rpc" | "pi-rpc";
|
|
4647
|
+
/**
|
|
4648
|
+
* How a provider's bridge is pointed at the replay child. Codex reads its
|
|
4649
|
+
* app-server command from env, Claude its CLI path from env, pi its RPC
|
|
4650
|
+
* command from env (`pi-rpc`: JSON lines plus the extension channel on fds
|
|
4651
|
+
* 3/4), and an ACP bridge its agent command from the launch spec inside
|
|
4652
|
+
* `thread/start`. A bridge with no provider child (the echo example) needs no
|
|
4653
|
+
* profile at all.
|
|
4654
|
+
*/
|
|
4655
|
+
interface ReplayProviderProfile {
|
|
4656
|
+
/** The protocol the replay child speaks on its pipe. */
|
|
4657
|
+
dialect: ReplayDialect;
|
|
4658
|
+
/** Environment the bridge reads the child's command from. */
|
|
4659
|
+
env(args: {
|
|
4660
|
+
replayCommand: string[];
|
|
4661
|
+
wrapperPath: string;
|
|
4662
|
+
stateDir: string;
|
|
4663
|
+
}): Record<string, string>;
|
|
4664
|
+
/** Rewrite a recorded runtime request that carries the child's command. */
|
|
4665
|
+
rewriteRuntimeLine?(line: string, args: {
|
|
4666
|
+
replayCommand: string[];
|
|
4667
|
+
}): string;
|
|
4668
|
+
/**
|
|
4669
|
+
* Provider state a bridge reads outside its provider pipe, seeded before
|
|
4670
|
+
* the replay starts (the Claude SDK forks by copying the source session's
|
|
4671
|
+
* transcript from disk).
|
|
4672
|
+
*/
|
|
4673
|
+
prepareState?(args: {
|
|
4674
|
+
recording: BridgeRecording;
|
|
4675
|
+
stateDir: string;
|
|
4676
|
+
workspaceDir: string;
|
|
4677
|
+
}): void;
|
|
4678
|
+
}
|
|
4679
|
+
/** A bridge that spawns no provider, or one whose child command is fixed. */
|
|
4680
|
+
declare const DEFAULT_REPLAY_PROFILE: ReplayProviderProfile;
|
|
4681
|
+
interface ReplayRecordingOptions {
|
|
4682
|
+
recordingDir: string;
|
|
4683
|
+
/** The provider the recording belongs to; keys the assembler's ids. */
|
|
4684
|
+
providerId: string;
|
|
4685
|
+
/** The bridge process to replay through (see `resolveProviderBridgeLaunch`). */
|
|
4686
|
+
bridge: ProviderBridgeLaunch;
|
|
4687
|
+
/** How the bridge reaches the replay child; `DEFAULT_REPLAY_PROFILE` when omitted. */
|
|
4688
|
+
profile?: ReplayProviderProfile;
|
|
4689
|
+
createAssembler: CreateParityAssembler;
|
|
4690
|
+
/**
|
|
4691
|
+
* The assembler that plans the replay's gates from the recorded
|
|
4692
|
+
* `bridge→runtime` lane; defaults to `createAssembler`. A re-recording run
|
|
4693
|
+
* on a checkout whose grammar no longer accepts the whole recorded lane
|
|
4694
|
+
* plans with the recording-time checkout's assembler instead.
|
|
4695
|
+
*/
|
|
4696
|
+
createPlanAssembler?: CreateParityAssembler;
|
|
4697
|
+
/**
|
|
4698
|
+
* Plan the replay's gates from the cell's current bridge lane
|
|
4699
|
+
* (`bridge→runtime.current.ndjson`, see `withCurrentBridgeLane`) when one
|
|
4700
|
+
* exists, instead of the recorded lane. The leg whose bridge wrote that
|
|
4701
|
+
* lane parses all of it; the recording-time leg parses the recorded lane.
|
|
4702
|
+
*/
|
|
4703
|
+
planFromCurrentLane?: boolean;
|
|
4704
|
+
/** Per-wait timeout for a gate or a response. */
|
|
4705
|
+
timeoutMs?: number;
|
|
4706
|
+
/**
|
|
4707
|
+
* The quiet period after which a request is sent even though the bridge
|
|
4708
|
+
* has emitted fewer lines than the recording had before it — a divergent
|
|
4709
|
+
* bridge pays this once per request instead of stalling. Only a plan from
|
|
4710
|
+
* the recorded lane can be short for that reason: a plan from the current
|
|
4711
|
+
* lane (`planFromCurrentLane`) was written by this very bridge, so a
|
|
4712
|
+
* shortfall there is latency, never divergence, and the request waits for
|
|
4713
|
+
* its events up to `timeoutMs` instead — a starved bridge (a loaded CI
|
|
4714
|
+
* runner) still has provider lines to read, and a request sent on quiet
|
|
4715
|
+
* alone lands before them, at a point the recording never had.
|
|
4716
|
+
*/
|
|
4717
|
+
orderTimeoutMs?: number;
|
|
4718
|
+
/** Quiet period after the last request before the bridge is closed. */
|
|
4719
|
+
settleMs?: number;
|
|
4720
|
+
/**
|
|
4721
|
+
* Quiet period a request waits for once the gates are met. The replay child
|
|
4722
|
+
* plays every provider line before the request's cursor point a couple of
|
|
4723
|
+
* milliseconds apart, so a short silence means the bridge has emitted all
|
|
4724
|
+
* that the pre-request stream produces; without it a request the bridge
|
|
4725
|
+
* acknowledges at once (a steer) lands at a load-dependent point.
|
|
4726
|
+
*/
|
|
4727
|
+
drainMs?: number;
|
|
4728
|
+
/** Mirror the bridge's stderr (and the replay child's logs) here. */
|
|
4729
|
+
onStderr?: (text: string) => void;
|
|
4730
|
+
}
|
|
4731
|
+
interface ParityGrammarViolation {
|
|
4732
|
+
rule: string;
|
|
4733
|
+
reason: string;
|
|
4734
|
+
eventType: string;
|
|
4735
|
+
}
|
|
4736
|
+
interface ParityRun {
|
|
4737
|
+
providerId: string;
|
|
4738
|
+
recordingDir: string;
|
|
4739
|
+
/** Raw `bridge→runtime` lines, in order. */
|
|
4740
|
+
lines: string[];
|
|
4741
|
+
/** When each line arrived, ms since the replay started (diagnostics). */
|
|
4742
|
+
lineTimes: number[];
|
|
4743
|
+
/**
|
|
4744
|
+
* For each line, the recorded `runtime→bridge` entry written last before
|
|
4745
|
+
* it arrived (null before any was sent) — where the line sits in the
|
|
4746
|
+
* recording's wire order, for a lane re-recorded through this bridge.
|
|
4747
|
+
*/
|
|
4748
|
+
lineAfter: Array<{
|
|
4749
|
+
run: number;
|
|
4750
|
+
seq: number;
|
|
4751
|
+
ts: number;
|
|
4752
|
+
} | null>;
|
|
4753
|
+
/** Assembled events, minus the ones the grammar dropped (as the runtime does). */
|
|
4754
|
+
events: ThreadEvent[];
|
|
4755
|
+
grammarViolations: ParityGrammarViolation[];
|
|
4756
|
+
/** Gates that timed out or requests that were never answered. */
|
|
4757
|
+
stalls: string[];
|
|
4758
|
+
stderr: string;
|
|
4759
|
+
exitCode: number | null;
|
|
4760
|
+
}
|
|
4761
|
+
/** The id of the harness's own `initialize` request; never part of a recording. */
|
|
4762
|
+
declare const PARITY_INITIALIZE_ID = "parity-initialize";
|
|
4763
|
+
/**
|
|
4764
|
+
* Replay one recording through one bridge. Resolves when the bridge exits
|
|
4765
|
+
* after the last recorded runtime line has been sent and answered.
|
|
4766
|
+
*/
|
|
4767
|
+
declare function replayRecording(options: ReplayRecordingOptions): Promise<ParityRun>;
|
|
4768
|
+
/**
|
|
4769
|
+
* The events the recorded `bridge→runtime` lane assembles to, without any
|
|
4770
|
+
* bridge in the loop: the recording's own view of what the bridge emitted.
|
|
4771
|
+
*/
|
|
4772
|
+
declare function assembleRecordedEvents(recording: BridgeRecording, createAssembler: CreateParityAssembler, providerId: string): {
|
|
4773
|
+
events: ThreadEvent[];
|
|
4774
|
+
grammarViolations: ParityGrammarViolation[];
|
|
4775
|
+
invalidDeltas: string[];
|
|
4776
|
+
};
|
|
4777
|
+
interface ParityAllowlistEntry {
|
|
4778
|
+
provider: string | "*";
|
|
4779
|
+
cell: string | "*";
|
|
4780
|
+
layer: "events" | "rows";
|
|
4781
|
+
/** A JSON pointer over the normalized list, with `*` and `**` wildcards. */
|
|
4782
|
+
path: string;
|
|
4783
|
+
pr: string;
|
|
4784
|
+
reason: string;
|
|
4785
|
+
}
|
|
4786
|
+
interface ParityLayerDiff {
|
|
4787
|
+
onlyInOld: unknown[];
|
|
4788
|
+
onlyInNew: unknown[];
|
|
4789
|
+
}
|
|
4790
|
+
interface ParityComparison {
|
|
4791
|
+
provider: string;
|
|
4792
|
+
cell: string;
|
|
4793
|
+
events: ParityLayerDiff;
|
|
4794
|
+
rows: ParityLayerDiff;
|
|
4795
|
+
/** Grammar drops, compared as `rule:eventType` multisets. */
|
|
4796
|
+
grammar: ParityLayerDiff;
|
|
4797
|
+
/** Allowlist entries that matched this cell but masked nothing. */
|
|
4798
|
+
staleAllowlist: ParityAllowlistEntry[];
|
|
4799
|
+
passed: boolean;
|
|
4800
|
+
}
|
|
4801
|
+
interface ParityInputs {
|
|
4802
|
+
events: readonly ThreadEvent[];
|
|
4803
|
+
rows: readonly unknown[];
|
|
4804
|
+
/** Events the grammar dropped; a regression when the lists differ. */
|
|
4805
|
+
grammarViolations?: readonly ParityGrammarViolation[];
|
|
4806
|
+
}
|
|
4807
|
+
declare function compareParity(oldRun: ParityInputs, newRun: ParityInputs, allowlist: readonly ParityAllowlistEntry[], scope: {
|
|
4808
|
+
provider: string;
|
|
4809
|
+
cell: string;
|
|
4810
|
+
}): ParityComparison;
|
|
4811
|
+
interface ReplayRecordedCellsOptions {
|
|
4812
|
+
/** The `<provider>/<cell>` tree to read (see `listRecordedCells`). */
|
|
4813
|
+
recordingsRoot: string;
|
|
4814
|
+
/** Which recorded providers this bridge serves (`acp` serves `acp-*`). */
|
|
4815
|
+
servesProvider: (providerId: string) => boolean;
|
|
4816
|
+
/** Cell names to replay; defaults to every cell of those providers. */
|
|
4817
|
+
cells?: readonly string[];
|
|
4818
|
+
/** The bridge process and replay profile for one cell's provider. */
|
|
4819
|
+
bridge: (cell: RecordedCell) => {
|
|
4820
|
+
launch: ProviderBridgeLaunch;
|
|
4821
|
+
profile?: ReplayProviderProfile;
|
|
4822
|
+
};
|
|
4823
|
+
createAssembler: CreateParityAssembler;
|
|
4824
|
+
timeoutMs?: number;
|
|
4825
|
+
onStderr?: (text: string) => void;
|
|
4826
|
+
}
|
|
4827
|
+
|
|
4828
|
+
type RerecordCurrentBridgeLaneOptions = Omit<ReplayRecordingOptions, "planFromCurrentLane">;
|
|
4829
|
+
interface RerecordCurrentBridgeLaneResult {
|
|
4830
|
+
/** The file written, or null when the replay stalled and nothing was. */
|
|
4831
|
+
file: string | null;
|
|
4832
|
+
/** Lines in the new lane (the harness's own handshake excluded). */
|
|
4833
|
+
lines: number;
|
|
4834
|
+
/** Events the replay assembled. */
|
|
4835
|
+
events: number;
|
|
4836
|
+
/** A stalled replay leaves the current lane untouched. */
|
|
4837
|
+
stalls: string[];
|
|
4838
|
+
}
|
|
4839
|
+
/**
|
|
4840
|
+
* Replay one recording through a bridge and write what the bridge emitted
|
|
4841
|
+
* as the recording's current bridge lane. The replay plans its gates from
|
|
4842
|
+
* the recorded lane (or `createPlanAssembler`'s view of it), never from a
|
|
4843
|
+
* previous current lane: the new lane must reproduce the recorded session,
|
|
4844
|
+
* not the last re-recording of it.
|
|
4845
|
+
*/
|
|
4846
|
+
declare function rerecordCurrentBridgeLane(options: RerecordCurrentBridgeLaneOptions): Promise<RerecordCurrentBridgeLaneResult>;
|
|
4847
|
+
|
|
4848
|
+
export { ASSEMBLER_GRAMMAR_VERSIONS, CONFORMANCE_ASSEMBLED_EVENT_METHOD, CURRENT_BRIDGE_LANE_FILE, DEFAULT_REPLAY_PROFILE, PARITY_INITIALIZE_ID, RECORDED_CONFORMANCE_CELLS, assembleCapturedThreadEvents as experimental_assembleCapturedThreadEvents, assembleRecordedEvents as experimental_assembleRecordedEvents, captureBridgeJsonRpcOutput as experimental_captureBridgeJsonRpcOutput, checkRecordedCellReplay as experimental_checkRecordedCellReplay, compareParity as experimental_compareParity, createBridgeDeltaEventCollector as experimental_createBridgeDeltaEventCollector, createBridgeJsonRpcTestHarness as experimental_createBridgeJsonRpcTestHarness, createDeltaAssembler as experimental_createDeltaAssembler, describeCalibrationEvents as experimental_describeCalibrationEvents, formatConformanceReport as experimental_formatConformanceReport, listRecordedCells as experimental_listRecordedCells, normalizeCalibrationEvents as experimental_normalizeCalibrationEvents, readBridgeRecording as experimental_readBridgeRecording, replayRecording as experimental_replayRecording, rerecordCurrentBridgeLane as experimental_rerecordCurrentBridgeLane, resolveProviderBridgeLaunch as experimental_resolveProviderBridgeLaunch, runBridgeConformance as experimental_runBridgeConformance, toConformanceMessages as experimental_toConformanceMessages, withCurrentBridgeLane as experimental_withCurrentBridgeLane };
|
|
4849
|
+
export type { AssembleDeltasArgs, BridgeConformanceTransport, BridgeDeltaEventCollector, BridgeJsonRpcId, BridgeJsonRpcLineHandler, BridgeJsonRpcObject, BridgeJsonRpcOutputMessage, BridgeJsonRpcTestHarness, BridgeRecording, BridgeRecordingDirection, BridgeRecordingEntry, BridgeRecordingManifest, CapturedBridgeJsonRpcOutput, CapturedBridgeNotification, ConformanceCheckResult, ConformanceReport, ConformanceSessionFixture, CreateDeltaAssemblerOptions, CreateParityAssembler, DeltaAssembler, DiffCumulativeTextArgs, DiffCumulativeTextResult, NormalizeCalibrationEventsOptions, ParityAllowlistEntry, ParityAssembler, ParityComparison, ParityGrammarViolation, ParityInputs, ParityLayerDiff, ParityRowProjector, ParityRun, ProviderBridgeLaunch, RecordedCell, RecordedCellReplay, RecordedConformanceCell, ReplayDialect, ReplayProviderProfile, ReplayRecordedCellsOptions, ReplayRecordingOptions, RerecordCurrentBridgeLaneOptions, RerecordCurrentBridgeLaneResult, ResolveProviderBridgeLaunchOptions, RunBridgeConformanceOptions, ThreadEvent, ThreadEventBackgroundTaskItem, ThreadEventDelegationItem, ThreadEventExtensionItem, ThreadEventFileReadItem, ThreadEventItem, ThreadEventItemPresentation, ThreadEventItemPresentationIcon, ThreadEventItemPresentationLabel, ThreadEventItemPresentationTint, ThreadEventPlanStepsItem, ThreadEventSearchItem, ThreadEventWebFetchItem, ThreadEventWebSearchItem };
|