@agent-harness-experimental/protocol 0.0.0 → 0.0.1

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/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright Vercel Inc. Pre-release. Not licensed as OSS yet.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-schema.d.ts","sourceRoot":"","sources":["../src/generate-schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { z } from 'zod';
5
+ import { PROTOCOL_VERSION, adapterKeySchema, agentConfigSchema, bridgeReadyMessageSchema, bridgeStartMessageSchema, bridgeInboundMessageSchema, bridgePrepareStepConfigSchema, harnessMessageSchema, sandboxMessageSchema, toolSchemaSchema, } from './index.js';
6
+ const outputPath = join(dirname(fileURLToPath(import.meta.url)), 'protocol.schema.json');
7
+ const schema = {
8
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
9
+ $id: 'https://agent-harness-experimental.local/protocol.schema.json',
10
+ protocolVersion: PROTOCOL_VERSION,
11
+ definitions: {
12
+ adapterKey: z.toJSONSchema(adapterKeySchema),
13
+ agentConfig: z.toJSONSchema(agentConfigSchema),
14
+ bridgePrepareStepConfig: z.toJSONSchema(bridgePrepareStepConfigSchema),
15
+ bridgeReadyMessage: z.toJSONSchema(bridgeReadyMessageSchema),
16
+ bridgeStartMessage: z.toJSONSchema(bridgeStartMessageSchema),
17
+ toolSchema: z.toJSONSchema(toolSchemaSchema),
18
+ harnessMessage: z.toJSONSchema(harnessMessageSchema),
19
+ sandboxMessage: z.toJSONSchema(sandboxMessageSchema),
20
+ bridgeInboundMessage: z.toJSONSchema(bridgeInboundMessageSchema),
21
+ },
22
+ };
23
+ writeFileSync(outputPath, `${JSON.stringify(schema, null, 2)}\n`);
24
+ //# sourceMappingURL=generate-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-schema.js","sourceRoot":"","sources":["../src/generate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC7B,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC;AAEzF,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,+DAA+D;IACpE,eAAe,EAAE,gBAAgB;IACjC,WAAW,EAAE;QACX,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC;QAC5C,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC;QAC9C,uBAAuB,EAAE,CAAC,CAAC,YAAY,CAAC,6BAA6B,CAAC;QACtE,kBAAkB,EAAE,CAAC,CAAC,YAAY,CAAC,wBAAwB,CAAC;QAC5D,kBAAkB,EAAE,CAAC,CAAC,YAAY,CAAC,wBAAwB,CAAC;QAC5D,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC;QAC5C,cAAc,EAAE,CAAC,CAAC,YAAY,CAAC,oBAAoB,CAAC;QACpD,cAAc,EAAE,CAAC,CAAC,YAAY,CAAC,oBAAoB,CAAC;QACpD,oBAAoB,EAAE,CAAC,CAAC,YAAY,CAAC,0BAA0B,CAAC;KACjE;CACF,CAAC;AAEF,aAAa,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,519 @@
1
+ import { z } from 'zod';
2
+ export declare const PROTOCOL_VERSION = 1;
3
+ declare const jsonSchemaBrand: unique symbol;
4
+ export type AdapterKey = (typeof ADAPTER_KEYS)[number];
5
+ export type JsonSchema = Record<string, unknown> & {
6
+ readonly [jsonSchemaBrand]: true;
7
+ };
8
+ export type ToolInput = unknown;
9
+ export type ToolOutput = unknown;
10
+ export declare const ADAPTER_KEYS: readonly ["claude-code", "codex", "goose", "mastra", "opencode", "deepagents", "pi", "openai-agents"];
11
+ export declare const adapterKeySchema: z.ZodEnum<{
12
+ "claude-code": "claude-code";
13
+ codex: "codex";
14
+ goose: "goose";
15
+ mastra: "mastra";
16
+ opencode: "opencode";
17
+ deepagents: "deepagents";
18
+ pi: "pi";
19
+ "openai-agents": "openai-agents";
20
+ }>;
21
+ export declare function isAdapterKey(value: string): value is AdapterKey;
22
+ export declare function assertAdapterKey(value: string): AdapterKey;
23
+ export declare const protocolRecordSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
24
+ export declare const jsonSchemaSchema: z.ZodType<JsonSchema>;
25
+ export declare function jsonSchema(value: Record<string, unknown>): JsonSchema;
26
+ export declare function toolInput(value: unknown): ToolInput;
27
+ export declare function toolOutput(value: unknown): ToolOutput;
28
+ export declare const toolSchemaSchema: z.ZodObject<{
29
+ name: z.ZodString;
30
+ nativeName: z.ZodOptional<z.ZodString>;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ inputSchema: z.ZodType<JsonSchema, unknown, z.core.$ZodTypeInternals<JsonSchema, unknown>>;
33
+ }, z.core.$strip>;
34
+ export declare const bridgePrepareStepConfigSchema: z.ZodObject<{
35
+ activeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ activeSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ forcedSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
38
+ instructions: z.ZodOptional<z.ZodString>;
39
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
40
+ }, z.core.$strip>;
41
+ export declare const agentConfigSchema: z.ZodObject<{
42
+ model: z.ZodOptional<z.ZodString>;
43
+ maxTurns: z.ZodOptional<z.ZodNumber>;
44
+ interceptBuiltinTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
45
+ builtinToolMappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ name: z.ZodString;
47
+ nativeName: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>>>;
49
+ toolTimeout: z.ZodOptional<z.ZodNumber>;
50
+ contextWindow: z.ZodOptional<z.ZodNumber>;
51
+ toolSearchMode: z.ZodOptional<z.ZodBoolean>;
52
+ traceContext: z.ZodOptional<z.ZodObject<{
53
+ traceparent: z.ZodOptional<z.ZodString>;
54
+ tracestate: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>>;
56
+ instructions: z.ZodOptional<z.ZodString>;
57
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
58
+ watch: z.ZodOptional<z.ZodString>;
59
+ debug: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
60
+ }, z.core.$strip>;
61
+ export declare const usageSchema: z.ZodObject<{
62
+ inputTokens: z.ZodNumber;
63
+ outputTokens: z.ZodNumber;
64
+ costUsd: z.ZodOptional<z.ZodNumber>;
65
+ }, z.core.$strip>;
66
+ export declare const todoTaskSchema: z.ZodObject<{
67
+ id: z.ZodString;
68
+ content: z.ZodString;
69
+ status: z.ZodEnum<{
70
+ pending: "pending";
71
+ in_progress: "in_progress";
72
+ completed: "completed";
73
+ }>;
74
+ priority: z.ZodOptional<z.ZodEnum<{
75
+ low: "low";
76
+ medium: "medium";
77
+ high: "high";
78
+ }>>;
79
+ }, z.core.$strip>;
80
+ export declare const httpPathRuleSchema: z.ZodObject<{
81
+ origin: z.ZodString;
82
+ pathPrefix: z.ZodString;
83
+ }, z.core.$strip>;
84
+ export declare const harnessMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
85
+ type: z.ZodLiteral<"start">;
86
+ protocolVersion: z.ZodLiteral<1>;
87
+ prompt: z.ZodString;
88
+ tools: z.ZodArray<z.ZodObject<{
89
+ name: z.ZodString;
90
+ nativeName: z.ZodOptional<z.ZodString>;
91
+ description: z.ZodOptional<z.ZodString>;
92
+ inputSchema: z.ZodType<JsonSchema, unknown, z.core.$ZodTypeInternals<JsonSchema, unknown>>;
93
+ }, z.core.$strip>>;
94
+ config: z.ZodObject<{
95
+ model: z.ZodOptional<z.ZodString>;
96
+ maxTurns: z.ZodOptional<z.ZodNumber>;
97
+ interceptBuiltinTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
98
+ builtinToolMappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
99
+ name: z.ZodString;
100
+ nativeName: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>>>;
102
+ toolTimeout: z.ZodOptional<z.ZodNumber>;
103
+ contextWindow: z.ZodOptional<z.ZodNumber>;
104
+ toolSearchMode: z.ZodOptional<z.ZodBoolean>;
105
+ traceContext: z.ZodOptional<z.ZodObject<{
106
+ traceparent: z.ZodOptional<z.ZodString>;
107
+ tracestate: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strip>>;
109
+ instructions: z.ZodOptional<z.ZodString>;
110
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
111
+ watch: z.ZodOptional<z.ZodString>;
112
+ debug: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
+ }, z.core.$catchall<z.ZodUnknown>>;
114
+ }, z.core.$strip>, z.ZodObject<{
115
+ type: z.ZodLiteral<"resume">;
116
+ lastSeenEventId: z.ZodNumber;
117
+ }, z.core.$strip>, z.ZodObject<{
118
+ type: z.ZodLiteral<"prepare-step-response">;
119
+ stepNumber: z.ZodNumber;
120
+ config: z.ZodOptional<z.ZodObject<{
121
+ activeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ activeSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
+ forcedSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
124
+ instructions: z.ZodOptional<z.ZodString>;
125
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
126
+ }, z.core.$strip>>;
127
+ error: z.ZodOptional<z.ZodString>;
128
+ }, z.core.$strip>, z.ZodObject<{
129
+ type: z.ZodLiteral<"tool-result">;
130
+ requestId: z.ZodString;
131
+ output: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ type: z.ZodLiteral<"tool-result-response">;
134
+ requestId: z.ZodString;
135
+ output: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
136
+ config: z.ZodOptional<z.ZodObject<{
137
+ activeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
+ activeSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
+ forcedSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ instructions: z.ZodOptional<z.ZodString>;
141
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
142
+ }, z.core.$strip>>;
143
+ }, z.core.$strip>, z.ZodObject<{
144
+ type: z.ZodLiteral<"tool-decision">;
145
+ requestId: z.ZodString;
146
+ approved: z.ZodBoolean;
147
+ reason: z.ZodOptional<z.ZodString>;
148
+ config: z.ZodOptional<z.ZodObject<{
149
+ activeTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
150
+ activeSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
+ forcedSkillNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
152
+ instructions: z.ZodOptional<z.ZodString>;
153
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
154
+ }, z.core.$strip>>;
155
+ }, z.core.$strip>, z.ZodObject<{
156
+ type: z.ZodLiteral<"user-message">;
157
+ text: z.ZodString;
158
+ }, z.core.$strip>, z.ZodObject<{
159
+ type: z.ZodLiteral<"compact">;
160
+ }, z.core.$strip>, z.ZodObject<{
161
+ type: z.ZodLiteral<"update-network">;
162
+ allowedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
163
+ deniedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
164
+ allowedHttpPaths: z.ZodOptional<z.ZodArray<z.ZodObject<{
165
+ origin: z.ZodString;
166
+ pathPrefix: z.ZodString;
167
+ }, z.core.$strip>>>;
168
+ deniedHttpPaths: z.ZodOptional<z.ZodArray<z.ZodObject<{
169
+ origin: z.ZodString;
170
+ pathPrefix: z.ZodString;
171
+ }, z.core.$strip>>>;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ type: z.ZodLiteral<"abort">;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ type: z.ZodLiteral<"ping">;
176
+ }, z.core.$strip>], "type">;
177
+ export declare const bridgeStartMessageSchema: z.ZodObject<{
178
+ protocolVersion: z.ZodLiteral<1>;
179
+ prompt: z.ZodString;
180
+ tools: z.ZodArray<z.ZodObject<{
181
+ name: z.ZodString;
182
+ nativeName: z.ZodOptional<z.ZodString>;
183
+ description: z.ZodOptional<z.ZodString>;
184
+ inputSchema: z.ZodType<JsonSchema, unknown, z.core.$ZodTypeInternals<JsonSchema, unknown>>;
185
+ }, z.core.$strip>>;
186
+ config: z.ZodObject<{
187
+ model: z.ZodOptional<z.ZodString>;
188
+ maxTurns: z.ZodOptional<z.ZodNumber>;
189
+ interceptBuiltinTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
190
+ builtinToolMappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
+ name: z.ZodString;
192
+ nativeName: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strip>>>;
194
+ toolTimeout: z.ZodOptional<z.ZodNumber>;
195
+ contextWindow: z.ZodOptional<z.ZodNumber>;
196
+ toolSearchMode: z.ZodOptional<z.ZodBoolean>;
197
+ traceContext: z.ZodOptional<z.ZodObject<{
198
+ traceparent: z.ZodOptional<z.ZodString>;
199
+ tracestate: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strip>>;
201
+ instructions: z.ZodOptional<z.ZodString>;
202
+ responseFormat: z.ZodOptional<z.ZodUnknown>;
203
+ watch: z.ZodOptional<z.ZodString>;
204
+ debug: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
205
+ }, z.core.$catchall<z.ZodUnknown>>;
206
+ }, z.core.$strip>;
207
+ export declare const bridgeReadyMessageSchema: z.ZodObject<{
208
+ type: z.ZodLiteral<"bridge-ready">;
209
+ protocolVersion: z.ZodLiteral<1>;
210
+ port: z.ZodNumber;
211
+ state: z.ZodString;
212
+ }, z.core.$strip>;
213
+ export declare const sandboxMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
214
+ id: z.ZodNumber;
215
+ type: z.ZodLiteral<"text-delta">;
216
+ delta: z.ZodString;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ id: z.ZodNumber;
219
+ type: z.ZodLiteral<"reasoning-delta">;
220
+ delta: z.ZodString;
221
+ }, z.core.$strip>, z.ZodObject<{
222
+ id: z.ZodNumber;
223
+ type: z.ZodLiteral<"subagent-start">;
224
+ agentName: z.ZodString;
225
+ parentToolCallId: z.ZodString;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ id: z.ZodNumber;
228
+ type: z.ZodLiteral<"subagent-finish">;
229
+ agentName: z.ZodString;
230
+ parentToolCallId: z.ZodString;
231
+ output: z.ZodOptional<z.ZodUnknown>;
232
+ usage: z.ZodOptional<z.ZodObject<{
233
+ inputTokens: z.ZodNumber;
234
+ outputTokens: z.ZodNumber;
235
+ costUsd: z.ZodOptional<z.ZodNumber>;
236
+ }, z.core.$strip>>;
237
+ }, z.core.$strip>, z.ZodObject<{
238
+ id: z.ZodNumber;
239
+ type: z.ZodLiteral<"tool-call">;
240
+ requestId: z.ZodString;
241
+ toolName: z.ZodString;
242
+ toolCallId: z.ZodString;
243
+ input: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
244
+ observeOnly: z.ZodOptional<z.ZodBoolean>;
245
+ }, z.core.$strip>, z.ZodObject<{
246
+ id: z.ZodNumber;
247
+ type: z.ZodLiteral<"tool-result">;
248
+ toolName: z.ZodString;
249
+ toolCallId: z.ZodString;
250
+ output: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ id: z.ZodNumber;
253
+ type: z.ZodLiteral<"host-approval-request">;
254
+ approvalId: z.ZodString;
255
+ requestId: z.ZodString;
256
+ toolCallId: z.ZodString;
257
+ host: z.ZodString;
258
+ access: z.ZodEnum<{
259
+ proxy: "proxy";
260
+ direct: "direct";
261
+ }>;
262
+ protocol: z.ZodEnum<{
263
+ http: "http";
264
+ https: "https";
265
+ connect: "connect";
266
+ }>;
267
+ port: z.ZodOptional<z.ZodNumber>;
268
+ url: z.ZodOptional<z.ZodString>;
269
+ }, z.core.$strip>, z.ZodObject<{
270
+ id: z.ZodNumber;
271
+ type: z.ZodLiteral<"step-finish">;
272
+ stepIndex: z.ZodNumber;
273
+ }, z.core.$strip>, z.ZodObject<{
274
+ id: z.ZodNumber;
275
+ type: z.ZodLiteral<"finish">;
276
+ finishReason: z.ZodString;
277
+ usage: z.ZodObject<{
278
+ inputTokens: z.ZodNumber;
279
+ outputTokens: z.ZodNumber;
280
+ costUsd: z.ZodOptional<z.ZodNumber>;
281
+ }, z.core.$strip>;
282
+ }, z.core.$strip>, z.ZodObject<{
283
+ id: z.ZodNumber;
284
+ type: z.ZodLiteral<"error">;
285
+ message: z.ZodString;
286
+ }, z.core.$strip>, z.ZodObject<{
287
+ id: z.ZodNumber;
288
+ type: z.ZodLiteral<"pong">;
289
+ }, z.core.$strip>, z.ZodObject<{
290
+ id: z.ZodNumber;
291
+ type: z.ZodLiteral<"task-update">;
292
+ tasks: z.ZodArray<z.ZodObject<{
293
+ id: z.ZodString;
294
+ content: z.ZodString;
295
+ status: z.ZodEnum<{
296
+ pending: "pending";
297
+ in_progress: "in_progress";
298
+ completed: "completed";
299
+ }>;
300
+ priority: z.ZodOptional<z.ZodEnum<{
301
+ low: "low";
302
+ medium: "medium";
303
+ high: "high";
304
+ }>>;
305
+ }, z.core.$strip>>;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ id: z.ZodNumber;
308
+ type: z.ZodLiteral<"file-change">;
309
+ event: z.ZodEnum<{
310
+ create: "create";
311
+ modify: "modify";
312
+ delete: "delete";
313
+ }>;
314
+ path: z.ZodString;
315
+ content: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>], "type">;
317
+ export declare const debugErrorSchema: z.ZodObject<{
318
+ name: z.ZodOptional<z.ZodString>;
319
+ message: z.ZodString;
320
+ stack: z.ZodOptional<z.ZodString>;
321
+ cause: z.ZodOptional<z.ZodString>;
322
+ }, z.core.$strip>;
323
+ export declare const bridgeInboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
324
+ id: z.ZodNumber;
325
+ type: z.ZodLiteral<"text-delta">;
326
+ delta: z.ZodString;
327
+ }, z.core.$strip>, z.ZodObject<{
328
+ id: z.ZodNumber;
329
+ type: z.ZodLiteral<"reasoning-delta">;
330
+ delta: z.ZodString;
331
+ }, z.core.$strip>, z.ZodObject<{
332
+ id: z.ZodNumber;
333
+ type: z.ZodLiteral<"subagent-start">;
334
+ agentName: z.ZodString;
335
+ parentToolCallId: z.ZodString;
336
+ }, z.core.$strip>, z.ZodObject<{
337
+ id: z.ZodNumber;
338
+ type: z.ZodLiteral<"subagent-finish">;
339
+ agentName: z.ZodString;
340
+ parentToolCallId: z.ZodString;
341
+ output: z.ZodOptional<z.ZodUnknown>;
342
+ usage: z.ZodOptional<z.ZodObject<{
343
+ inputTokens: z.ZodNumber;
344
+ outputTokens: z.ZodNumber;
345
+ costUsd: z.ZodOptional<z.ZodNumber>;
346
+ }, z.core.$strip>>;
347
+ }, z.core.$strip>, z.ZodObject<{
348
+ id: z.ZodNumber;
349
+ type: z.ZodLiteral<"tool-call">;
350
+ requestId: z.ZodString;
351
+ toolName: z.ZodString;
352
+ toolCallId: z.ZodString;
353
+ input: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
354
+ observeOnly: z.ZodOptional<z.ZodBoolean>;
355
+ }, z.core.$strip>, z.ZodObject<{
356
+ id: z.ZodNumber;
357
+ type: z.ZodLiteral<"tool-result">;
358
+ toolName: z.ZodString;
359
+ toolCallId: z.ZodString;
360
+ output: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
361
+ }, z.core.$strip>, z.ZodObject<{
362
+ id: z.ZodNumber;
363
+ type: z.ZodLiteral<"host-approval-request">;
364
+ approvalId: z.ZodString;
365
+ requestId: z.ZodString;
366
+ toolCallId: z.ZodString;
367
+ host: z.ZodString;
368
+ access: z.ZodEnum<{
369
+ proxy: "proxy";
370
+ direct: "direct";
371
+ }>;
372
+ protocol: z.ZodEnum<{
373
+ http: "http";
374
+ https: "https";
375
+ connect: "connect";
376
+ }>;
377
+ port: z.ZodOptional<z.ZodNumber>;
378
+ url: z.ZodOptional<z.ZodString>;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ id: z.ZodNumber;
381
+ type: z.ZodLiteral<"step-finish">;
382
+ stepIndex: z.ZodNumber;
383
+ }, z.core.$strip>, z.ZodObject<{
384
+ id: z.ZodNumber;
385
+ type: z.ZodLiteral<"finish">;
386
+ finishReason: z.ZodString;
387
+ usage: z.ZodObject<{
388
+ inputTokens: z.ZodNumber;
389
+ outputTokens: z.ZodNumber;
390
+ costUsd: z.ZodOptional<z.ZodNumber>;
391
+ }, z.core.$strip>;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ id: z.ZodNumber;
394
+ type: z.ZodLiteral<"error">;
395
+ message: z.ZodString;
396
+ }, z.core.$strip>, z.ZodObject<{
397
+ id: z.ZodNumber;
398
+ type: z.ZodLiteral<"pong">;
399
+ }, z.core.$strip>, z.ZodObject<{
400
+ id: z.ZodNumber;
401
+ type: z.ZodLiteral<"task-update">;
402
+ tasks: z.ZodArray<z.ZodObject<{
403
+ id: z.ZodString;
404
+ content: z.ZodString;
405
+ status: z.ZodEnum<{
406
+ pending: "pending";
407
+ in_progress: "in_progress";
408
+ completed: "completed";
409
+ }>;
410
+ priority: z.ZodOptional<z.ZodEnum<{
411
+ low: "low";
412
+ medium: "medium";
413
+ high: "high";
414
+ }>>;
415
+ }, z.core.$strip>>;
416
+ }, z.core.$strip>, z.ZodObject<{
417
+ id: z.ZodNumber;
418
+ type: z.ZodLiteral<"file-change">;
419
+ event: z.ZodEnum<{
420
+ create: "create";
421
+ modify: "modify";
422
+ delete: "delete";
423
+ }>;
424
+ path: z.ZodString;
425
+ content: z.ZodOptional<z.ZodString>;
426
+ }, z.core.$strip>], "type">, z.ZodObject<{
427
+ type: z.ZodLiteral<"debug">;
428
+ message: z.ZodString;
429
+ }, z.core.$strip>, z.ZodObject<{
430
+ type: z.ZodLiteral<"debug-event">;
431
+ level: z.ZodEnum<{
432
+ debug: "debug";
433
+ error: "error";
434
+ warn: "warn";
435
+ info: "info";
436
+ trace: "trace";
437
+ }>;
438
+ subsystem: z.ZodString;
439
+ event: z.ZodString;
440
+ status: z.ZodOptional<z.ZodEnum<{
441
+ start: "start";
442
+ error: "error";
443
+ ok: "ok";
444
+ timeout: "timeout";
445
+ retry: "retry";
446
+ blocked: "blocked";
447
+ slow: "slow";
448
+ }>>;
449
+ durationMs: z.ZodOptional<z.ZodNumber>;
450
+ traceId: z.ZodOptional<z.ZodString>;
451
+ spanId: z.ZodOptional<z.ZodString>;
452
+ parentSpanId: z.ZodOptional<z.ZodString>;
453
+ attrs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
454
+ error: z.ZodOptional<z.ZodObject<{
455
+ name: z.ZodOptional<z.ZodString>;
456
+ message: z.ZodString;
457
+ stack: z.ZodOptional<z.ZodString>;
458
+ cause: z.ZodOptional<z.ZodString>;
459
+ }, z.core.$strip>>;
460
+ }, z.core.$strip>, z.ZodObject<{
461
+ type: z.ZodLiteral<"sandbox-log">;
462
+ source: z.ZodString;
463
+ stream: z.ZodEnum<{
464
+ stdout: "stdout";
465
+ stderr: "stderr";
466
+ }>;
467
+ line: z.ZodString;
468
+ }, z.core.$strip>, z.ZodObject<{
469
+ type: z.ZodLiteral<"prepare-step-request">;
470
+ stepNumber: z.ZodNumber;
471
+ }, z.core.$strip>], "type">;
472
+ export type ToolSchema = z.infer<typeof toolSchemaSchema>;
473
+ export type BridgePrepareStepConfig = z.infer<typeof bridgePrepareStepConfigSchema>;
474
+ export type AgentConfig = z.infer<typeof agentConfigSchema>;
475
+ export type Usage = z.infer<typeof usageSchema>;
476
+ export type TodoTask = z.infer<typeof todoTaskSchema>;
477
+ export type HarnessMessage = z.infer<typeof harnessMessageSchema>;
478
+ export type BridgeStartMessage = z.infer<typeof bridgeStartMessageSchema>;
479
+ export type BridgeReadyMessage = z.infer<typeof bridgeReadyMessageSchema>;
480
+ export type SandboxMessage = z.infer<typeof sandboxMessageSchema>;
481
+ export type BridgeInboundMessage = z.infer<typeof bridgeInboundMessageSchema>;
482
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
483
+ type MessageOf<TYPE extends SandboxMessage['type']> = Extract<SandboxMessage, {
484
+ type: TYPE;
485
+ }>;
486
+ type SandboxEventOf<TYPE extends SandboxMessage['type']> = DistributiveOmit<MessageOf<TYPE>, 'id'>;
487
+ type MessageInput<TYPE extends SandboxMessage['type']> = DistributiveOmit<SandboxEventOf<TYPE>, 'type'>;
488
+ export type SandboxEvent = DistributiveOmit<SandboxMessage, 'id'>;
489
+ export declare function createToolCallMessage(message: MessageInput<'tool-call'>): SandboxEventOf<'tool-call'>;
490
+ export declare function createToolResultMessage(message: MessageInput<'tool-result'>): SandboxEventOf<'tool-result'>;
491
+ export declare function createFinishMessage(message: MessageInput<'finish'>): SandboxEventOf<'finish'>;
492
+ export declare function createErrorMessage(message: MessageInput<'error'>): SandboxEventOf<'error'>;
493
+ export declare function createTextDeltaMessage(message: MessageInput<'text-delta'>): SandboxEventOf<'text-delta'>;
494
+ export declare function createReasoningDeltaMessage(message: MessageInput<'reasoning-delta'>): SandboxEventOf<'reasoning-delta'>;
495
+ export declare function createSubagentStartMessage(message: MessageInput<'subagent-start'>): SandboxEventOf<'subagent-start'>;
496
+ export declare function createSubagentFinishMessage(message: MessageInput<'subagent-finish'>): SandboxEventOf<'subagent-finish'>;
497
+ export declare function createHostApprovalRequestMessage(message: MessageInput<'host-approval-request'>): SandboxEventOf<'host-approval-request'>;
498
+ export declare function createStepFinishMessage(message: MessageInput<'step-finish'>): SandboxEventOf<'step-finish'>;
499
+ export declare function createPongMessage(_message?: MessageInput<'pong'>): SandboxEventOf<'pong'>;
500
+ export declare function createTaskUpdateMessage(message: MessageInput<'task-update'>): SandboxEventOf<'task-update'>;
501
+ export declare function createFileChangeMessage(message: MessageInput<'file-change'>): SandboxEventOf<'file-change'>;
502
+ export declare const msg: {
503
+ readonly toolCall: typeof createToolCallMessage;
504
+ readonly toolResult: typeof createToolResultMessage;
505
+ readonly finish: typeof createFinishMessage;
506
+ readonly error: typeof createErrorMessage;
507
+ readonly textDelta: typeof createTextDeltaMessage;
508
+ readonly reasoningDelta: typeof createReasoningDeltaMessage;
509
+ readonly subagentStart: typeof createSubagentStartMessage;
510
+ readonly subagentFinish: typeof createSubagentFinishMessage;
511
+ readonly hostApprovalRequest: typeof createHostApprovalRequestMessage;
512
+ readonly stepFinish: typeof createStepFinishMessage;
513
+ readonly pong: typeof createPongMessage;
514
+ readonly taskUpdate: typeof createTaskUpdateMessage;
515
+ readonly fileChange: typeof createFileChangeMessage;
516
+ };
517
+ export declare function assertNever(value: never): never;
518
+ export {};
519
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,QAAA,MAAM,eAAe,EAAE,OAAO,MAA6B,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACxF,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAEjC,eAAO,MAAM,YAAY,uGAAwG,CAAC;AAElI,eAAO,MAAM,gBAAgB;;;;;;;;;EAAuB,CAAC;AAErD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAE1D;AAED,eAAO,MAAM,oBAAoB,wCAAoC,CAAC;AACtE,eAAO,MAAM,gBAAgB,EAAsC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAIzF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAErE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAEnD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,UAA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