@spencerboucher/switchyard-client 0.0.0-stage → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ export interface RequestOptions {
2
+ signal?: AbortSignal;
3
+ }
4
+ /** An error response from the coordinator REST API (`{error: {code, message, details}}`). */
5
+ export declare class ApiRequestError extends Error {
6
+ readonly status: number;
7
+ readonly code: string;
8
+ readonly details?: unknown;
9
+ constructor(status: number, code: string, message: string, details?: unknown);
10
+ }
11
+ export type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
12
+ export interface ApiClientOptions {
13
+ coordinatorUrl: string;
14
+ /** Device credential (or the local admin token), sent as `Authorization: Bearer`. */
15
+ credential: string | null;
16
+ fetch?: FetchLike;
17
+ }
18
+ /** Minimal JSON REST client for the coordinator. */
19
+ export declare class ApiClient {
20
+ readonly baseUrl: string;
21
+ private readonly credential;
22
+ private readonly doFetch;
23
+ constructor(opts: ApiClientOptions);
24
+ request<T>(method: string, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
25
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
26
+ post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
27
+ }
28
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,56 @@
1
+ import type { CreateSessionRequest, CreateTaskRequest, PromptRequest, Session, Task, TaskState, TranscriptPage } from "./protocol/index.js";
2
+ import type { z } from "zod";
3
+ import type { RequestOptions } from "./api.js";
4
+ import { ClientConnection, type ClientOptions, type EventNotice } from "./connection.js";
5
+ import { type WaitOptions } from "./wait.js";
6
+ export type CreateSessionInput = z.input<typeof CreateSessionRequest>;
7
+ export type CreateTaskInput = z.input<typeof CreateTaskRequest>;
8
+ export type PromptInput = z.input<typeof PromptRequest>;
9
+ export interface PromptResponse {
10
+ ok: true;
11
+ clientMessageId: string | null;
12
+ result: unknown;
13
+ automationActive: boolean;
14
+ }
15
+ export interface TranscriptQuery {
16
+ limit?: number;
17
+ before?: number;
18
+ afterRev?: number;
19
+ epoch?: number;
20
+ }
21
+ export interface TaskListQuery {
22
+ projectId?: string;
23
+ state?: TaskState[];
24
+ includeHidden?: boolean;
25
+ }
26
+ export interface EventSubscribeOptions {
27
+ cursor?: number;
28
+ projectionId?: string | null;
29
+ signal?: AbortSignal;
30
+ onError?: (error: Error) => void;
31
+ }
32
+ /** Node-only REST facade with an optional live connection, and independent subscription cursors. */
33
+ export declare class SwitchyardClient {
34
+ readonly connection: ClientConnection;
35
+ private readonly opts;
36
+ private closed;
37
+ private subscriptions;
38
+ constructor(options: ClientOptions);
39
+ connect(): void;
40
+ close(): void;
41
+ readonly sessions: {
42
+ create: (input: CreateSessionInput, options?: RequestOptions) => Promise<Session>;
43
+ send: (id: string, input: PromptInput, options?: RequestOptions) => Promise<PromptResponse>;
44
+ transcript: (id: string, query?: TranscriptQuery, options?: RequestOptions) => Promise<TranscriptPage>;
45
+ waitForFinish: (id: string, options?: WaitOptions) => Promise<Session>;
46
+ };
47
+ readonly tasks: {
48
+ create: (input: CreateTaskInput, options?: RequestOptions) => Promise<Task>;
49
+ list: (query?: TaskListQuery, options?: RequestOptions) => Promise<Task[]>;
50
+ waitForState: (id: string, states: TaskState | TaskState[], options?: WaitOptions) => Promise<Task>;
51
+ };
52
+ readonly events: {
53
+ subscribe: (listener: (notice: EventNotice) => void, options?: EventSubscribeOptions) => (() => void);
54
+ };
55
+ }
56
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { type ClientToServer, type EventEnvelope, type SyncState } from "./protocol/index.js";
2
+ import WebSocket from "ws";
3
+ import { ApiClient, type ApiClientOptions } from "./api.js";
4
+ import { Store } from "./store.js";
5
+ export declare function wsUrlFor(coordinatorUrl: string): string;
6
+ export interface ClientOptions extends ApiClientOptions {
7
+ /** WebSocket constructor (tests inject a fake). */
8
+ WebSocketImpl?: typeof WebSocket;
9
+ random?: () => number;
10
+ pingIntervalMs?: number;
11
+ /** Event-only resume: do not use this connection's unseeded entity store for waits. */
12
+ initialCursor?: number;
13
+ projectionId?: string | null;
14
+ }
15
+ export type EventNotice = {
16
+ type: "event";
17
+ event: EventEnvelope;
18
+ projectionId: string | null;
19
+ } | {
20
+ type: "reset";
21
+ seq: number;
22
+ state: SyncState;
23
+ projectionId: string | null;
24
+ };
25
+ /**
26
+ * The herdr mirror's connection to a coordinator: `/ws/client` live sync of entities into an
27
+ * in-memory `Store`, reconnect with backoff and `force_logout` handling; `api` for REST calls.
28
+ */
29
+ export declare class ClientConnection {
30
+ readonly api: ApiClient;
31
+ readonly store: Store;
32
+ private readonly opts;
33
+ private ws;
34
+ private stopped;
35
+ private revoked;
36
+ private attempts;
37
+ private retryTimer;
38
+ private pingTimer;
39
+ private pongTimer;
40
+ private logoutListeners;
41
+ private liveListeners;
42
+ private closeListeners;
43
+ private noticeListeners;
44
+ private cursor;
45
+ projectionId: string | null;
46
+ capabilities: string[];
47
+ constructor(opts: ClientOptions);
48
+ connect(): void;
49
+ close(): void;
50
+ onLogout(fn: (reason: string) => void): () => void;
51
+ /** Called each time the connection becomes live (after replay or snapshot). */
52
+ onLive(fn: () => void): () => void;
53
+ onClose(fn: () => void): () => void;
54
+ onNotice(fn: (notice: EventNotice) => void): () => void;
55
+ send(msg: ClientToServer): boolean;
56
+ private open;
57
+ private handle;
58
+ private acknowledge;
59
+ private emitNotice;
60
+ private becomeLive;
61
+ private logout;
62
+ private startPing;
63
+ private scheduleReconnect;
64
+ private clearTimers;
65
+ }
66
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1,7 @@
1
+ export type { EventEnvelope, Session, SyncState, Task, TaskState, TranscriptItem, TranscriptPage, } from "./protocol/index.js";
2
+ export { ApiClient, type ApiClientOptions, ApiRequestError, type FetchLike, type RequestOptions, } from "./api.js";
3
+ export { type CreateSessionInput, type CreateTaskInput, type EventSubscribeOptions, type PromptInput, type PromptResponse, SwitchyardClient, type TaskListQuery, type TranscriptQuery, } from "./client.js";
4
+ export { ClientConnection, type ClientOptions, type EventNotice, wsUrlFor } from "./connection.js";
5
+ export { type ClientState, Store } from "./store.js";
6
+ export { type WaitCode, WaitError, type WaitOptions } from "./wait.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,455 @@
1
+ import { z } from "zod";
2
+ export declare const ADAPTER_PREVIEW_MAX_BYTES: number;
3
+ export declare const ADAPTER_PREVIEW_MAX_STEPS = 200;
4
+ export declare const ADAPTER_PREVIEW_SESSION_ID = "ses_adapter_preview";
5
+ export declare const AdapterPreviewPiUiRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
+ id: z.ZodString;
7
+ title: z.ZodString;
8
+ method: z.ZodLiteral<"select">;
9
+ options: z.ZodArray<z.ZodString>;
10
+ timeout: z.ZodOptional<z.ZodNumber>;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ id: z.ZodString;
13
+ title: z.ZodString;
14
+ method: z.ZodLiteral<"confirm">;
15
+ message: z.ZodString;
16
+ timeout: z.ZodOptional<z.ZodNumber>;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ id: z.ZodString;
19
+ title: z.ZodString;
20
+ method: z.ZodLiteral<"input">;
21
+ placeholder: z.ZodOptional<z.ZodString>;
22
+ timeout: z.ZodOptional<z.ZodNumber>;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ id: z.ZodString;
25
+ title: z.ZodString;
26
+ method: z.ZodLiteral<"editor">;
27
+ prefill: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strict>], "method">;
29
+ export declare const AdapterPreviewStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
30
+ kind: z.ZodLiteral<"restore">;
31
+ }, z.core.$strict>, z.ZodObject<{
32
+ kind: z.ZodLiteral<"toolStart">;
33
+ data: z.ZodObject<{
34
+ toolCallId: z.ZodString;
35
+ name: z.ZodString;
36
+ args: z.ZodUnknown;
37
+ }, z.core.$strict>;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ kind: z.ZodLiteral<"toolUpdate">;
40
+ data: z.ZodObject<{
41
+ toolCallId: z.ZodString;
42
+ name: z.ZodString;
43
+ args: z.ZodUnknown;
44
+ partialResult: z.ZodUnknown;
45
+ details: z.ZodOptional<z.ZodUnknown>;
46
+ }, z.core.$strict>;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ kind: z.ZodLiteral<"toolEnd">;
49
+ data: z.ZodObject<{
50
+ toolCallId: z.ZodString;
51
+ name: z.ZodString;
52
+ args: z.ZodUnknown;
53
+ result: z.ZodUnknown;
54
+ isError: z.ZodBoolean;
55
+ details: z.ZodOptional<z.ZodUnknown>;
56
+ }, z.core.$strict>;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ kind: z.ZodLiteral<"status">;
59
+ data: z.ZodObject<{
60
+ key: z.ZodString;
61
+ text: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strict>;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ kind: z.ZodLiteral<"widget">;
65
+ data: z.ZodObject<{
66
+ key: z.ZodString;
67
+ lines: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ }, z.core.$strict>;
69
+ }, z.core.$strict>, z.ZodObject<{
70
+ kind: z.ZodLiteral<"dialog">;
71
+ data: z.ZodDiscriminatedUnion<[z.ZodObject<{
72
+ id: z.ZodString;
73
+ title: z.ZodString;
74
+ method: z.ZodLiteral<"select">;
75
+ options: z.ZodArray<z.ZodString>;
76
+ timeout: z.ZodOptional<z.ZodNumber>;
77
+ }, z.core.$strict>, z.ZodObject<{
78
+ id: z.ZodString;
79
+ title: z.ZodString;
80
+ method: z.ZodLiteral<"confirm">;
81
+ message: z.ZodString;
82
+ timeout: z.ZodOptional<z.ZodNumber>;
83
+ }, z.core.$strict>, z.ZodObject<{
84
+ id: z.ZodString;
85
+ title: z.ZodString;
86
+ method: z.ZodLiteral<"input">;
87
+ placeholder: z.ZodOptional<z.ZodString>;
88
+ timeout: z.ZodOptional<z.ZodNumber>;
89
+ }, z.core.$strict>, z.ZodObject<{
90
+ id: z.ZodString;
91
+ title: z.ZodString;
92
+ method: z.ZodLiteral<"editor">;
93
+ prefill: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strict>], "method">;
95
+ }, z.core.$strict>, z.ZodObject<{
96
+ kind: z.ZodLiteral<"answer">;
97
+ data: z.ZodObject<{
98
+ requestId: z.ZodString;
99
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ kind: z.ZodLiteral<"form">;
101
+ values: z.ZodRecord<z.ZodString, z.ZodType<import("./ui.js").FormValue, unknown, z.core.$ZodTypeInternals<import("./ui.js").FormValue, unknown>>>;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ kind: z.ZodLiteral<"confirm">;
104
+ confirmed: z.ZodBoolean;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ kind: z.ZodLiteral<"action">;
107
+ actionId: z.ZodString;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ kind: z.ZodLiteral<"cancel">;
110
+ }, z.core.$strip>], "kind">;
111
+ }, z.core.$strict>;
112
+ }, z.core.$strict>, z.ZodObject<{
113
+ kind: z.ZodLiteral<"customMessage">;
114
+ data: z.ZodObject<{
115
+ customType: z.ZodString;
116
+ content: z.ZodUnknown;
117
+ display: z.ZodOptional<z.ZodBoolean>;
118
+ details: z.ZodOptional<z.ZodUnknown>;
119
+ }, z.core.$strict>;
120
+ }, z.core.$strict>, z.ZodObject<{
121
+ kind: z.ZodLiteral<"action">;
122
+ data: z.ZodObject<{
123
+ actionId: z.ZodString;
124
+ payload: z.ZodUnknown;
125
+ }, z.core.$strict>;
126
+ }, z.core.$strict>], "kind">;
127
+ export type AdapterPreviewStep = z.infer<typeof AdapterPreviewStepSchema>;
128
+ export declare const AdapterPreviewFixtureSchema: z.ZodPipe<z.ZodPipe<z.ZodUnknown, z.ZodTransform<unknown, unknown>>, z.ZodObject<{
129
+ version: z.ZodLiteral<1>;
130
+ name: z.ZodString;
131
+ initialState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
132
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
133
+ kind: z.ZodLiteral<"restore">;
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ kind: z.ZodLiteral<"toolStart">;
136
+ data: z.ZodObject<{
137
+ toolCallId: z.ZodString;
138
+ name: z.ZodString;
139
+ args: z.ZodUnknown;
140
+ }, z.core.$strict>;
141
+ }, z.core.$strict>, z.ZodObject<{
142
+ kind: z.ZodLiteral<"toolUpdate">;
143
+ data: z.ZodObject<{
144
+ toolCallId: z.ZodString;
145
+ name: z.ZodString;
146
+ args: z.ZodUnknown;
147
+ partialResult: z.ZodUnknown;
148
+ details: z.ZodOptional<z.ZodUnknown>;
149
+ }, z.core.$strict>;
150
+ }, z.core.$strict>, z.ZodObject<{
151
+ kind: z.ZodLiteral<"toolEnd">;
152
+ data: z.ZodObject<{
153
+ toolCallId: z.ZodString;
154
+ name: z.ZodString;
155
+ args: z.ZodUnknown;
156
+ result: z.ZodUnknown;
157
+ isError: z.ZodBoolean;
158
+ details: z.ZodOptional<z.ZodUnknown>;
159
+ }, z.core.$strict>;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ kind: z.ZodLiteral<"status">;
162
+ data: z.ZodObject<{
163
+ key: z.ZodString;
164
+ text: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strict>;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ kind: z.ZodLiteral<"widget">;
168
+ data: z.ZodObject<{
169
+ key: z.ZodString;
170
+ lines: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
+ }, z.core.$strict>;
172
+ }, z.core.$strict>, z.ZodObject<{
173
+ kind: z.ZodLiteral<"dialog">;
174
+ data: z.ZodDiscriminatedUnion<[z.ZodObject<{
175
+ id: z.ZodString;
176
+ title: z.ZodString;
177
+ method: z.ZodLiteral<"select">;
178
+ options: z.ZodArray<z.ZodString>;
179
+ timeout: z.ZodOptional<z.ZodNumber>;
180
+ }, z.core.$strict>, z.ZodObject<{
181
+ id: z.ZodString;
182
+ title: z.ZodString;
183
+ method: z.ZodLiteral<"confirm">;
184
+ message: z.ZodString;
185
+ timeout: z.ZodOptional<z.ZodNumber>;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ id: z.ZodString;
188
+ title: z.ZodString;
189
+ method: z.ZodLiteral<"input">;
190
+ placeholder: z.ZodOptional<z.ZodString>;
191
+ timeout: z.ZodOptional<z.ZodNumber>;
192
+ }, z.core.$strict>, z.ZodObject<{
193
+ id: z.ZodString;
194
+ title: z.ZodString;
195
+ method: z.ZodLiteral<"editor">;
196
+ prefill: z.ZodOptional<z.ZodString>;
197
+ }, z.core.$strict>], "method">;
198
+ }, z.core.$strict>, z.ZodObject<{
199
+ kind: z.ZodLiteral<"answer">;
200
+ data: z.ZodObject<{
201
+ requestId: z.ZodString;
202
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
+ kind: z.ZodLiteral<"form">;
204
+ values: z.ZodRecord<z.ZodString, z.ZodType<import("./ui.js").FormValue, unknown, z.core.$ZodTypeInternals<import("./ui.js").FormValue, unknown>>>;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ kind: z.ZodLiteral<"confirm">;
207
+ confirmed: z.ZodBoolean;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ kind: z.ZodLiteral<"action">;
210
+ actionId: z.ZodString;
211
+ }, z.core.$strip>, z.ZodObject<{
212
+ kind: z.ZodLiteral<"cancel">;
213
+ }, z.core.$strip>], "kind">;
214
+ }, z.core.$strict>;
215
+ }, z.core.$strict>, z.ZodObject<{
216
+ kind: z.ZodLiteral<"customMessage">;
217
+ data: z.ZodObject<{
218
+ customType: z.ZodString;
219
+ content: z.ZodUnknown;
220
+ display: z.ZodOptional<z.ZodBoolean>;
221
+ details: z.ZodOptional<z.ZodUnknown>;
222
+ }, z.core.$strict>;
223
+ }, z.core.$strict>, z.ZodObject<{
224
+ kind: z.ZodLiteral<"action">;
225
+ data: z.ZodObject<{
226
+ actionId: z.ZodString;
227
+ payload: z.ZodUnknown;
228
+ }, z.core.$strict>;
229
+ }, z.core.$strict>], "kind">>;
230
+ }, z.core.$strict>>;
231
+ export type AdapterPreviewFixture = z.infer<typeof AdapterPreviewFixtureSchema>;
232
+ export declare const AdapterPreviewSchema: z.ZodPipe<z.ZodPipe<z.ZodUnknown, z.ZodTransform<unknown, unknown>>, z.ZodObject<{
233
+ version: z.ZodLiteral<1>;
234
+ name: z.ZodString;
235
+ adapter: z.ZodObject<{
236
+ id: z.ZodString;
237
+ version: z.ZodString;
238
+ }, z.core.$strict>;
239
+ steps: z.ZodArray<z.ZodObject<{
240
+ index: z.ZodNumber;
241
+ kind: z.ZodEnum<{
242
+ action: "action";
243
+ answer: "answer";
244
+ customMessage: "customMessage";
245
+ dialog: "dialog";
246
+ restore: "restore";
247
+ status: "status";
248
+ toolEnd: "toolEnd";
249
+ toolStart: "toolStart";
250
+ toolUpdate: "toolUpdate";
251
+ widget: "widget";
252
+ }>;
253
+ ok: z.ZodBoolean;
254
+ error: z.ZodNullable<z.ZodString>;
255
+ }, z.core.$strict>>;
256
+ panels: z.ZodArray<z.ZodObject<{
257
+ sessionId: z.ZodString;
258
+ adapterId: z.ZodString;
259
+ slot: z.ZodString;
260
+ title: z.ZodString;
261
+ node: z.ZodNullable<z.ZodType<import("./ui.js").UINode, unknown, z.core.$ZodTypeInternals<import("./ui.js").UINode, unknown>>>;
262
+ mobileFallback: z.ZodNullable<z.ZodString>;
263
+ contribution: z.ZodOptional<z.ZodObject<{
264
+ placement: z.ZodEnum<{
265
+ "composer.pill": "composer.pill";
266
+ "palette.item": "palette.item";
267
+ "session.panel": "session.panel";
268
+ "sidebar.footer": "sidebar.footer";
269
+ "sidebar.header": "sidebar.header";
270
+ "slash.command": "slash.command";
271
+ }>;
272
+ order: z.ZodOptional<z.ZodNumber>;
273
+ actionId: z.ZodOptional<z.ZodString>;
274
+ id: z.ZodString;
275
+ name: z.ZodOptional<z.ZodString>;
276
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
+ }, z.core.$strict>>;
278
+ state: z.ZodOptional<z.ZodUnknown>;
279
+ adapterGeneration: z.ZodOptional<z.ZodString>;
280
+ updatedAt: z.ZodString;
281
+ webRenderer: z.ZodLiteral<false>;
282
+ }, z.core.$strip>>;
283
+ interactions: z.ZodArray<z.ZodObject<{
284
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
285
+ id: z.ZodString;
286
+ title: z.ZodString;
287
+ method: z.ZodLiteral<"select">;
288
+ options: z.ZodArray<z.ZodString>;
289
+ timeout: z.ZodOptional<z.ZodNumber>;
290
+ }, z.core.$strict>, z.ZodObject<{
291
+ id: z.ZodString;
292
+ title: z.ZodString;
293
+ method: z.ZodLiteral<"confirm">;
294
+ message: z.ZodString;
295
+ timeout: z.ZodOptional<z.ZodNumber>;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ id: z.ZodString;
298
+ title: z.ZodString;
299
+ method: z.ZodLiteral<"input">;
300
+ placeholder: z.ZodOptional<z.ZodString>;
301
+ timeout: z.ZodOptional<z.ZodNumber>;
302
+ }, z.core.$strict>, z.ZodObject<{
303
+ id: z.ZodString;
304
+ title: z.ZodString;
305
+ method: z.ZodLiteral<"editor">;
306
+ prefill: z.ZodOptional<z.ZodString>;
307
+ }, z.core.$strict>], "method">;
308
+ presentation: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
309
+ t: "text";
310
+ text: string;
311
+ tone?: import("./ui.js").Tone;
312
+ } | {
313
+ t: "markdown";
314
+ text: string;
315
+ } | {
316
+ t: "code";
317
+ text: string;
318
+ lang?: string;
319
+ } | {
320
+ t: "diff";
321
+ patch: string;
322
+ } | {
323
+ t: "list";
324
+ items: import("./ui.js").UINode[];
325
+ ordered?: boolean;
326
+ } | {
327
+ t: "table";
328
+ columns: string[];
329
+ rows: string[][];
330
+ } | {
331
+ t: "section";
332
+ title?: string;
333
+ collapsible?: boolean;
334
+ children: import("./ui.js").UINode[];
335
+ } | {
336
+ t: "tabs";
337
+ tabs: {
338
+ id: string;
339
+ label: string;
340
+ children: import("./ui.js").UINode[];
341
+ }[];
342
+ } | {
343
+ t: "progress";
344
+ label: string;
345
+ value?: number;
346
+ status?: "running" | "ok" | "error";
347
+ } | {
348
+ t: "ref";
349
+ ref: import("./ui.js").UIRef;
350
+ label: string;
351
+ } | {
352
+ t: "form";
353
+ formId: string;
354
+ fields: import("./ui.js").Field[];
355
+ submitLabel: string;
356
+ cancelLabel?: string;
357
+ } | {
358
+ t: "confirm";
359
+ message: string;
360
+ confirmLabel: string;
361
+ cancelLabel: string;
362
+ destructive?: boolean;
363
+ } | {
364
+ t: "actions";
365
+ actions: {
366
+ id: string;
367
+ label: string;
368
+ tone?: import("./ui.js").ActionTone;
369
+ }[];
370
+ }, unknown>>;
371
+ state: z.ZodEnum<{
372
+ pending: "pending";
373
+ resolved: "resolved";
374
+ }>;
375
+ }, z.core.$strict>>;
376
+ cards: z.ZodArray<z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
377
+ t: "text";
378
+ text: string;
379
+ tone?: import("./ui.js").Tone;
380
+ } | {
381
+ t: "markdown";
382
+ text: string;
383
+ } | {
384
+ t: "code";
385
+ text: string;
386
+ lang?: string;
387
+ } | {
388
+ t: "diff";
389
+ patch: string;
390
+ } | {
391
+ t: "list";
392
+ items: import("./ui.js").UINode[];
393
+ ordered?: boolean;
394
+ } | {
395
+ t: "table";
396
+ columns: string[];
397
+ rows: string[][];
398
+ } | {
399
+ t: "section";
400
+ title?: string;
401
+ collapsible?: boolean;
402
+ children: import("./ui.js").UINode[];
403
+ } | {
404
+ t: "tabs";
405
+ tabs: {
406
+ id: string;
407
+ label: string;
408
+ children: import("./ui.js").UINode[];
409
+ }[];
410
+ } | {
411
+ t: "progress";
412
+ label: string;
413
+ value?: number;
414
+ status?: "running" | "ok" | "error";
415
+ } | {
416
+ t: "ref";
417
+ ref: import("./ui.js").UIRef;
418
+ label: string;
419
+ } | {
420
+ t: "form";
421
+ formId: string;
422
+ fields: import("./ui.js").Field[];
423
+ submitLabel: string;
424
+ cancelLabel?: string;
425
+ } | {
426
+ t: "confirm";
427
+ message: string;
428
+ confirmLabel: string;
429
+ cancelLabel: string;
430
+ destructive?: boolean;
431
+ } | {
432
+ t: "actions";
433
+ actions: {
434
+ id: string;
435
+ label: string;
436
+ tone?: import("./ui.js").ActionTone;
437
+ }[];
438
+ }, unknown>>>;
439
+ diagnostics: z.ZodArray<z.ZodObject<{
440
+ sessionId: z.ZodNullable<z.ZodString>;
441
+ adapterId: z.ZodNullable<z.ZodString>;
442
+ level: z.ZodEnum<{
443
+ error: "error";
444
+ info: "info";
445
+ warning: "warning";
446
+ }>;
447
+ at: z.ZodString;
448
+ message: z.ZodString;
449
+ }, z.core.$strip>>;
450
+ }, z.core.$strict>>;
451
+ export type AdapterPreview = z.infer<typeof AdapterPreviewSchema>;
452
+ /** Bound the raw UTF-8 input too (including JSON whitespace), before JSON.parse. */
453
+ export declare function parseAdapterPreviewJson(text: string): AdapterPreview;
454
+ export declare function parseAdapterPreviewFixtureJson(text: string): AdapterPreviewFixture;
455
+ //# sourceMappingURL=adapter-preview.d.ts.map