@ai-sdk/harness 1.0.99 → 1.0.101

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/dist/index.js CHANGED
@@ -1,46 +1,100 @@
1
1
  // src/v1/harness-v1-builtin-tool.ts
2
2
  import { tool } from "@ai-sdk/provider-utils";
3
+ import { z as z2 } from "zod/v4";
4
+
5
+ // src/v1/harness-v1-questions-tool.ts
3
6
  import { z } from "zod/v4";
7
+ var harnessV1QuestionSchema = z.object({
8
+ id: z.string().min(1),
9
+ question: z.string().min(1),
10
+ header: z.string().optional(),
11
+ options: z.array(
12
+ z.object({
13
+ id: z.string().min(1),
14
+ label: z.string().min(1),
15
+ description: z.string().optional(),
16
+ preview: z.string().optional()
17
+ })
18
+ ).optional(),
19
+ allowMultiple: z.boolean().optional(),
20
+ allowFreeForm: z.union([
21
+ z.boolean(),
22
+ z.object({
23
+ secret: z.boolean()
24
+ })
25
+ ]).optional()
26
+ });
27
+ var harnessV1QuestionsToolInputSchema = z.object({
28
+ allowPartialAnswers: z.boolean(),
29
+ questions: z.array(harnessV1QuestionSchema).min(1)
30
+ });
31
+ var harnessV1QuestionAnswerSchema = z.object({
32
+ optionIds: z.array(z.string()),
33
+ freeform: z.string().optional()
34
+ });
35
+ var harnessV1QuestionsToolOutputSchema = z.discriminatedUnion(
36
+ "action",
37
+ [
38
+ z.object({
39
+ action: z.literal("answered"),
40
+ answers: z.record(z.string(), harnessV1QuestionAnswerSchema)
41
+ }),
42
+ z.object({
43
+ action: z.literal("partially-answered"),
44
+ answers: z.record(z.string(), harnessV1QuestionAnswerSchema)
45
+ }),
46
+ z.object({ action: z.literal("declined") }),
47
+ z.object({ action: z.literal("cancelled") })
48
+ ]
49
+ );
50
+ var harnessV1QuestionsTool = {
51
+ description: "Ask the user one or more questions",
52
+ inputSchema: harnessV1QuestionsToolInputSchema,
53
+ outputSchema: harnessV1QuestionsToolOutputSchema
54
+ };
55
+
56
+ // src/v1/harness-v1-builtin-tool.ts
4
57
  var HARNESS_V1_BUILTIN_TOOLS = {
5
58
  read: tool({
6
59
  description: "Read file contents",
7
- inputSchema: z.object({ file_path: z.string() }),
8
- outputSchema: z.unknown()
60
+ inputSchema: z2.object({ file_path: z2.string() }),
61
+ outputSchema: z2.unknown()
9
62
  }),
10
63
  write: tool({
11
64
  description: "Write content to a file",
12
- inputSchema: z.object({ file_path: z.string(), content: z.string() }),
13
- outputSchema: z.unknown()
65
+ inputSchema: z2.object({ file_path: z2.string(), content: z2.string() }),
66
+ outputSchema: z2.unknown()
14
67
  }),
15
68
  edit: tool({
16
69
  description: "Edit a file by replacing text",
17
- inputSchema: z.object({
18
- file_path: z.string(),
19
- old_string: z.string(),
20
- new_string: z.string()
70
+ inputSchema: z2.object({
71
+ file_path: z2.string(),
72
+ old_string: z2.string(),
73
+ new_string: z2.string()
21
74
  }),
22
- outputSchema: z.unknown()
75
+ outputSchema: z2.unknown()
23
76
  }),
24
77
  bash: tool({
25
78
  description: "Execute a shell command",
26
- inputSchema: z.object({ command: z.string() }),
27
- outputSchema: z.unknown()
79
+ inputSchema: z2.object({ command: z2.string() }),
80
+ outputSchema: z2.unknown()
28
81
  }),
29
82
  grep: tool({
30
83
  description: "Search file contents with regex",
31
- inputSchema: z.object({ pattern: z.string() }),
32
- outputSchema: z.unknown()
84
+ inputSchema: z2.object({ pattern: z2.string() }),
85
+ outputSchema: z2.unknown()
33
86
  }),
34
87
  glob: tool({
35
88
  description: "Find files matching a glob pattern",
36
- inputSchema: z.object({ pattern: z.string() }),
37
- outputSchema: z.unknown()
89
+ inputSchema: z2.object({ pattern: z2.string() }),
90
+ outputSchema: z2.unknown()
38
91
  }),
39
92
  webSearch: tool({
40
93
  description: "Search the web",
41
- inputSchema: z.object({ query: z.string() }),
42
- outputSchema: z.unknown()
43
- })
94
+ inputSchema: z2.object({ query: z2.string() }),
95
+ outputSchema: z2.unknown()
96
+ }),
97
+ askUserQuestions: harnessV1QuestionsTool
44
98
  };
45
99
  var HARNESS_V1_BUILTIN_TOOL_NAMES = Object.keys(
46
100
  HARNESS_V1_BUILTIN_TOOLS
@@ -58,59 +112,59 @@ function commonTool(commonName, opts) {
58
112
  }
59
113
 
60
114
  // src/v1/harness-v1-stream-part.ts
61
- import { z as z2 } from "zod/v4";
62
- var harnessV1JsonValueSchema = z2.lazy(
63
- () => z2.union([
64
- z2.string(),
65
- z2.number(),
66
- z2.boolean(),
67
- z2.null(),
68
- z2.array(harnessV1JsonValueSchema),
69
- z2.record(z2.string(), harnessV1JsonValueSchema)
115
+ import { z as z3 } from "zod/v4";
116
+ var harnessV1JsonValueSchema = z3.lazy(
117
+ () => z3.union([
118
+ z3.string(),
119
+ z3.number(),
120
+ z3.boolean(),
121
+ z3.null(),
122
+ z3.array(harnessV1JsonValueSchema),
123
+ z3.record(z3.string(), harnessV1JsonValueSchema)
70
124
  ])
71
125
  );
72
126
  var harnessV1ToolResultValueSchema = harnessV1JsonValueSchema;
73
- var harnessV1JsonObjectSchema = z2.record(
74
- z2.string(),
127
+ var harnessV1JsonObjectSchema = z3.record(
128
+ z3.string(),
75
129
  harnessV1JsonValueSchema
76
130
  );
77
- var harnessV1MetadataSchema = z2.record(
78
- z2.string(),
79
- z2.record(z2.string(), harnessV1JsonValueSchema)
131
+ var harnessV1MetadataSchema = z3.record(
132
+ z3.string(),
133
+ z3.record(z3.string(), harnessV1JsonValueSchema)
80
134
  );
81
- var harnessV1ProviderMetadataSchema = z2.record(
82
- z2.string(),
83
- z2.record(z2.string(), harnessV1JsonValueSchema)
135
+ var harnessV1ProviderMetadataSchema = z3.record(
136
+ z3.string(),
137
+ z3.record(z3.string(), harnessV1JsonValueSchema)
84
138
  );
85
- var harnessV1CallWarningSchema = z2.union([
86
- z2.object({
87
- type: z2.literal("unsupported-setting"),
88
- setting: z2.string(),
89
- details: z2.string().optional()
139
+ var harnessV1CallWarningSchema = z3.union([
140
+ z3.object({
141
+ type: z3.literal("unsupported-setting"),
142
+ setting: z3.string(),
143
+ details: z3.string().optional()
90
144
  }),
91
- z2.object({
92
- type: z2.literal("unsupported-tool"),
93
- tool: z2.string(),
94
- details: z2.string().optional()
145
+ z3.object({
146
+ type: z3.literal("unsupported-tool"),
147
+ tool: z3.string(),
148
+ details: z3.string().optional()
95
149
  }),
96
- z2.object({ type: z2.literal("other"), message: z2.string() })
150
+ z3.object({ type: z3.literal("other"), message: z3.string() })
97
151
  ]);
98
- var harnessV1UsageSchema = z2.object({
99
- inputTokens: z2.object({
100
- total: z2.number().optional(),
101
- noCache: z2.number().optional(),
102
- cacheRead: z2.number().optional(),
103
- cacheWrite: z2.number().optional()
152
+ var harnessV1UsageSchema = z3.object({
153
+ inputTokens: z3.object({
154
+ total: z3.number().optional(),
155
+ noCache: z3.number().optional(),
156
+ cacheRead: z3.number().optional(),
157
+ cacheWrite: z3.number().optional()
104
158
  }),
105
- outputTokens: z2.object({
106
- total: z2.number().optional(),
107
- text: z2.number().optional(),
108
- reasoning: z2.number().optional()
159
+ outputTokens: z3.object({
160
+ total: z3.number().optional(),
161
+ text: z3.number().optional(),
162
+ reasoning: z3.number().optional()
109
163
  }),
110
164
  raw: harnessV1JsonObjectSchema.optional()
111
165
  });
112
- var harnessV1FinishReasonSchema = z2.object({
113
- unified: z2.enum([
166
+ var harnessV1FinishReasonSchema = z3.object({
167
+ unified: z3.enum([
114
168
  "stop",
115
169
  "length",
116
170
  "content-filter",
@@ -118,127 +172,127 @@ var harnessV1FinishReasonSchema = z2.object({
118
172
  "error",
119
173
  "other"
120
174
  ]),
121
- raw: z2.string().optional()
175
+ raw: z3.string().optional()
122
176
  });
123
- var harnessV1StreamStartPartSchema = z2.object({
124
- type: z2.literal("stream-start"),
125
- warnings: z2.array(harnessV1CallWarningSchema).readonly().optional(),
126
- modelId: z2.string().optional()
177
+ var harnessV1StreamStartPartSchema = z3.object({
178
+ type: z3.literal("stream-start"),
179
+ warnings: z3.array(harnessV1CallWarningSchema).readonly().optional(),
180
+ modelId: z3.string().optional()
127
181
  });
128
- var harnessV1TextStartPartSchema = z2.object({
129
- type: z2.literal("text-start"),
130
- id: z2.string(),
182
+ var harnessV1TextStartPartSchema = z3.object({
183
+ type: z3.literal("text-start"),
184
+ id: z3.string(),
131
185
  harnessMetadata: harnessV1MetadataSchema.optional()
132
186
  });
133
- var harnessV1TextDeltaPartSchema = z2.object({
134
- type: z2.literal("text-delta"),
135
- id: z2.string(),
136
- delta: z2.string(),
187
+ var harnessV1TextDeltaPartSchema = z3.object({
188
+ type: z3.literal("text-delta"),
189
+ id: z3.string(),
190
+ delta: z3.string(),
137
191
  harnessMetadata: harnessV1MetadataSchema.optional()
138
192
  });
139
- var harnessV1TextEndPartSchema = z2.object({
140
- type: z2.literal("text-end"),
141
- id: z2.string(),
193
+ var harnessV1TextEndPartSchema = z3.object({
194
+ type: z3.literal("text-end"),
195
+ id: z3.string(),
142
196
  harnessMetadata: harnessV1MetadataSchema.optional()
143
197
  });
144
- var harnessV1ReasoningStartPartSchema = z2.object({
145
- type: z2.literal("reasoning-start"),
146
- id: z2.string(),
198
+ var harnessV1ReasoningStartPartSchema = z3.object({
199
+ type: z3.literal("reasoning-start"),
200
+ id: z3.string(),
147
201
  harnessMetadata: harnessV1MetadataSchema.optional()
148
202
  });
149
- var harnessV1ReasoningDeltaPartSchema = z2.object({
150
- type: z2.literal("reasoning-delta"),
151
- id: z2.string(),
152
- delta: z2.string(),
203
+ var harnessV1ReasoningDeltaPartSchema = z3.object({
204
+ type: z3.literal("reasoning-delta"),
205
+ id: z3.string(),
206
+ delta: z3.string(),
153
207
  harnessMetadata: harnessV1MetadataSchema.optional()
154
208
  });
155
- var harnessV1ReasoningEndPartSchema = z2.object({
156
- type: z2.literal("reasoning-end"),
157
- id: z2.string(),
209
+ var harnessV1ReasoningEndPartSchema = z3.object({
210
+ type: z3.literal("reasoning-end"),
211
+ id: z3.string(),
158
212
  harnessMetadata: harnessV1MetadataSchema.optional()
159
213
  });
160
- var harnessV1ToolInputStartPartSchema = z2.object({
161
- type: z2.literal("tool-input-start"),
162
- id: z2.string(),
163
- toolName: z2.string(),
214
+ var harnessV1ToolInputStartPartSchema = z3.object({
215
+ type: z3.literal("tool-input-start"),
216
+ id: z3.string(),
217
+ toolName: z3.string(),
164
218
  providerMetadata: harnessV1ProviderMetadataSchema.optional(),
165
- providerExecuted: z2.boolean().optional(),
166
- dynamic: z2.boolean().optional(),
167
- title: z2.string().optional()
168
- });
169
- var harnessV1ToolInputDeltaPartSchema = z2.object({
170
- type: z2.literal("tool-input-delta"),
171
- id: z2.string(),
172
- delta: z2.string(),
219
+ providerExecuted: z3.boolean().optional(),
220
+ dynamic: z3.boolean().optional(),
221
+ title: z3.string().optional()
222
+ });
223
+ var harnessV1ToolInputDeltaPartSchema = z3.object({
224
+ type: z3.literal("tool-input-delta"),
225
+ id: z3.string(),
226
+ delta: z3.string(),
173
227
  providerMetadata: harnessV1ProviderMetadataSchema.optional()
174
228
  });
175
- var harnessV1ToolInputEndPartSchema = z2.object({
176
- type: z2.literal("tool-input-end"),
177
- id: z2.string(),
229
+ var harnessV1ToolInputEndPartSchema = z3.object({
230
+ type: z3.literal("tool-input-end"),
231
+ id: z3.string(),
178
232
  providerMetadata: harnessV1ProviderMetadataSchema.optional()
179
233
  });
180
- var harnessV1ToolCallPartSchema = z2.object({
181
- type: z2.literal("tool-call"),
182
- toolCallId: z2.string(),
183
- toolName: z2.string(),
184
- input: z2.string(),
185
- providerExecuted: z2.boolean().optional(),
186
- dynamic: z2.boolean().optional(),
234
+ var harnessV1ToolCallPartSchema = z3.object({
235
+ type: z3.literal("tool-call"),
236
+ toolCallId: z3.string(),
237
+ toolName: z3.string(),
238
+ input: z3.string(),
239
+ providerExecuted: z3.boolean().optional(),
240
+ dynamic: z3.boolean().optional(),
187
241
  providerMetadata: harnessV1ProviderMetadataSchema.optional(),
188
- nativeName: z2.string().optional(),
189
- stepToolCallCount: z2.number().int().positive().optional()
242
+ nativeName: z3.string().optional(),
243
+ stepToolCallCount: z3.number().int().positive().optional()
190
244
  });
191
- var harnessV1ToolApprovalRequestPartSchema = z2.object({
192
- type: z2.literal("tool-approval-request"),
193
- approvalId: z2.string(),
194
- toolCallId: z2.string(),
245
+ var harnessV1ToolApprovalRequestPartSchema = z3.object({
246
+ type: z3.literal("tool-approval-request"),
247
+ approvalId: z3.string(),
248
+ toolCallId: z3.string(),
195
249
  providerMetadata: harnessV1ProviderMetadataSchema.optional()
196
250
  });
197
- var harnessV1ToolResultPartSchema = z2.object({
198
- type: z2.literal("tool-result"),
199
- toolCallId: z2.string(),
200
- toolName: z2.string(),
251
+ var harnessV1ToolResultPartSchema = z3.object({
252
+ type: z3.literal("tool-result"),
253
+ toolCallId: z3.string(),
254
+ toolName: z3.string(),
201
255
  result: harnessV1ToolResultValueSchema,
202
- isError: z2.boolean().optional(),
203
- preliminary: z2.boolean().optional(),
204
- dynamic: z2.boolean().optional(),
256
+ isError: z3.boolean().optional(),
257
+ preliminary: z3.boolean().optional(),
258
+ dynamic: z3.boolean().optional(),
205
259
  providerMetadata: harnessV1ProviderMetadataSchema.optional()
206
260
  });
207
- var harnessV1FinishStepPartSchema = z2.object({
208
- type: z2.literal("finish-step"),
261
+ var harnessV1FinishStepPartSchema = z3.object({
262
+ type: z3.literal("finish-step"),
209
263
  finishReason: harnessV1FinishReasonSchema,
210
264
  usage: harnessV1UsageSchema,
211
265
  harnessMetadata: harnessV1MetadataSchema.optional()
212
266
  });
213
- var harnessV1FinishPartSchema = z2.object({
214
- type: z2.literal("finish"),
267
+ var harnessV1FinishPartSchema = z3.object({
268
+ type: z3.literal("finish"),
215
269
  finishReason: harnessV1FinishReasonSchema,
216
270
  totalUsage: harnessV1UsageSchema,
217
271
  harnessMetadata: harnessV1MetadataSchema.optional()
218
272
  });
219
- var harnessV1FileChangePartSchema = z2.object({
220
- type: z2.literal("file-change"),
221
- event: z2.enum(["create", "modify", "delete"]),
222
- path: z2.string(),
273
+ var harnessV1FileChangePartSchema = z3.object({
274
+ type: z3.literal("file-change"),
275
+ event: z3.enum(["create", "modify", "delete"]),
276
+ path: z3.string(),
223
277
  harnessMetadata: harnessV1MetadataSchema.optional()
224
278
  });
225
- var harnessV1CompactionPartSchema = z2.object({
226
- type: z2.literal("compaction"),
227
- trigger: z2.enum(["manual", "auto"]),
228
- summary: z2.string(),
229
- tokensBefore: z2.number().optional(),
230
- tokensAfter: z2.number().optional(),
279
+ var harnessV1CompactionPartSchema = z3.object({
280
+ type: z3.literal("compaction"),
281
+ trigger: z3.enum(["manual", "auto"]),
282
+ summary: z3.string(),
283
+ tokensBefore: z3.number().optional(),
284
+ tokensAfter: z3.number().optional(),
231
285
  harnessMetadata: harnessV1MetadataSchema.optional()
232
286
  });
233
- var harnessV1ErrorPartSchema = z2.object({
234
- type: z2.literal("error"),
235
- error: z2.unknown()
287
+ var harnessV1ErrorPartSchema = z3.object({
288
+ type: z3.literal("error"),
289
+ error: z3.unknown()
236
290
  });
237
- var harnessV1RawPartSchema = z2.object({
238
- type: z2.literal("raw"),
239
- rawValue: z2.unknown()
291
+ var harnessV1RawPartSchema = z3.object({
292
+ type: z3.literal("raw"),
293
+ rawValue: z3.unknown()
240
294
  });
241
- var harnessV1StreamPartSchema = z2.discriminatedUnion("type", [
295
+ var harnessV1StreamPartSchema = z3.discriminatedUnion("type", [
242
296
  harnessV1StreamStartPartSchema,
243
297
  harnessV1TextStartPartSchema,
244
298
  harnessV1TextDeltaPartSchema,
@@ -261,107 +315,107 @@ var harnessV1StreamPartSchema = z2.discriminatedUnion("type", [
261
315
  ]);
262
316
 
263
317
  // src/v1/harness-v1-bridge-protocol.ts
264
- import { z as z4 } from "zod/v4";
318
+ import { z as z5 } from "zod/v4";
265
319
 
266
320
  // src/v1/harness-v1-diagnostic.ts
267
- import { z as z3 } from "zod/v4";
268
- var harnessV1DebugLevelSchema = z3.enum([
321
+ import { z as z4 } from "zod/v4";
322
+ var harnessV1DebugLevelSchema = z4.enum([
269
323
  "error",
270
324
  "warn",
271
325
  "info",
272
326
  "debug",
273
327
  "trace"
274
328
  ]);
275
- var harnessV1DebugConfigSchema = z3.object({
276
- enabled: z3.boolean().optional(),
329
+ var harnessV1DebugConfigSchema = z4.object({
330
+ enabled: z4.boolean().optional(),
277
331
  level: harnessV1DebugLevelSchema.optional(),
278
- subsystems: z3.array(z3.string()).optional()
332
+ subsystems: z4.array(z4.string()).optional()
279
333
  });
280
334
 
281
335
  // src/v1/harness-v1-bridge-protocol.ts
282
- var harnessV1BridgeToolWireSchema = z4.object({
283
- name: z4.string(),
284
- description: z4.string().optional(),
285
- inputSchema: z4.unknown().optional()
336
+ var harnessV1BridgeToolWireSchema = z5.object({
337
+ name: z5.string(),
338
+ description: z5.string().optional(),
339
+ inputSchema: z5.unknown().optional()
286
340
  });
287
- var harnessV1BridgePermissionModeSchema = z4.enum([
341
+ var harnessV1BridgePermissionModeSchema = z5.enum([
288
342
  "allow-reads",
289
343
  "allow-edits",
290
344
  "allow-all"
291
345
  ]);
292
- var harnessV1BridgeBuiltinToolFilteringSchema = z4.discriminatedUnion(
346
+ var harnessV1BridgeBuiltinToolFilteringSchema = z5.discriminatedUnion(
293
347
  "mode",
294
348
  [
295
- z4.object({
296
- mode: z4.literal("allow"),
297
- toolNames: z4.array(z4.string())
349
+ z5.object({
350
+ mode: z5.literal("allow"),
351
+ toolNames: z5.array(z5.string())
298
352
  }),
299
- z4.object({
300
- mode: z4.literal("deny"),
301
- toolNames: z4.array(z4.string())
353
+ z5.object({
354
+ mode: z5.literal("deny"),
355
+ toolNames: z5.array(z5.string())
302
356
  })
303
357
  ]
304
358
  );
305
- var harnessV1BridgeResponseFormatSchema = z4.discriminatedUnion("type", [
306
- z4.object({ type: z4.literal("text") }),
307
- z4.object({
308
- type: z4.literal("json"),
309
- schema: z4.record(z4.string(), z4.json()).optional(),
310
- name: z4.string().optional(),
311
- description: z4.string().optional()
359
+ var harnessV1BridgeResponseFormatSchema = z5.discriminatedUnion("type", [
360
+ z5.object({ type: z5.literal("text") }),
361
+ z5.object({
362
+ type: z5.literal("json"),
363
+ schema: z5.record(z5.string(), z5.json()).optional(),
364
+ name: z5.string().optional(),
365
+ description: z5.string().optional()
312
366
  })
313
367
  ]);
314
- var harnessV1BridgeStartBaseSchema = z4.object({
315
- type: z4.literal("start"),
316
- prompt: z4.string(),
317
- tools: z4.array(harnessV1BridgeToolWireSchema).optional(),
318
- model: z4.string().optional(),
368
+ var harnessV1BridgeStartBaseSchema = z5.object({
369
+ type: z5.literal("start"),
370
+ prompt: z5.string(),
371
+ tools: z5.array(harnessV1BridgeToolWireSchema).optional(),
372
+ model: z5.string().optional(),
319
373
  debug: harnessV1DebugConfigSchema.optional(),
320
374
  permissionMode: harnessV1BridgePermissionModeSchema.optional(),
321
375
  builtinToolFiltering: harnessV1BridgeBuiltinToolFilteringSchema.optional(),
322
376
  responseFormat: harnessV1BridgeResponseFormatSchema.optional()
323
377
  });
324
- var harnessV1BridgeHelloSchema = z4.object({
325
- type: z4.literal("bridge-hello"),
326
- state: z4.string().optional(),
327
- lastSeq: z4.number().optional(),
328
- capabilities: z4.object({
329
- experimental_userMessageResponses: z4.boolean().optional()
378
+ var harnessV1BridgeHelloSchema = z5.object({
379
+ type: z5.literal("bridge-hello"),
380
+ state: z5.string().optional(),
381
+ lastSeq: z5.number().optional(),
382
+ capabilities: z5.object({
383
+ experimental_userMessageResponses: z5.boolean().optional()
330
384
  }).optional()
331
385
  });
332
- var experimental_harnessV1BridgeUserMessageResponseSchema = z4.object({
333
- type: z4.literal("user-message-response"),
334
- messageId: z4.string(),
335
- accepted: z4.boolean(),
336
- error: z4.object({ message: z4.string() }).optional()
386
+ var experimental_harnessV1BridgeUserMessageResponseSchema = z5.object({
387
+ type: z5.literal("user-message-response"),
388
+ messageId: z5.string(),
389
+ accepted: z5.boolean(),
390
+ error: z5.object({ message: z5.string() }).optional()
337
391
  });
338
- var harnessV1BridgeStopSchema = z4.object({
339
- type: z4.literal("bridge-stop"),
340
- data: z4.unknown()
392
+ var harnessV1BridgeStopSchema = z5.object({
393
+ type: z5.literal("bridge-stop"),
394
+ data: z5.unknown()
341
395
  });
342
- var harnessV1BridgeThreadSchema = z4.object({
343
- type: z4.literal("bridge-thread"),
344
- threadId: z4.string()
396
+ var harnessV1BridgeThreadSchema = z5.object({
397
+ type: z5.literal("bridge-thread"),
398
+ threadId: z5.string()
345
399
  });
346
- var harnessV1BridgeSandboxLogSchema = z4.object({
347
- type: z4.literal("sandbox-log"),
348
- source: z4.string(),
349
- stream: z4.enum(["stdout", "stderr"]),
350
- line: z4.string()
400
+ var harnessV1BridgeSandboxLogSchema = z5.object({
401
+ type: z5.literal("sandbox-log"),
402
+ source: z5.string(),
403
+ stream: z5.enum(["stdout", "stderr"]),
404
+ line: z5.string()
351
405
  });
352
- var harnessV1BridgeDebugEventSchema = z4.object({
353
- type: z4.literal("debug-event"),
406
+ var harnessV1BridgeDebugEventSchema = z5.object({
407
+ type: z5.literal("debug-event"),
354
408
  level: harnessV1DebugLevelSchema,
355
- subsystem: z4.string(),
356
- message: z4.string(),
357
- attrs: z4.record(z4.string(), z4.unknown()).optional(),
358
- error: z4.object({
359
- name: z4.string().optional(),
360
- message: z4.string(),
361
- stack: z4.string().optional()
409
+ subsystem: z5.string(),
410
+ message: z5.string(),
411
+ attrs: z5.record(z5.string(), z5.unknown()).optional(),
412
+ error: z5.object({
413
+ name: z5.string().optional(),
414
+ message: z5.string(),
415
+ stack: z5.string().optional()
362
416
  }).optional()
363
417
  });
364
- var harnessV1BridgeOutboundMessageSchema = z4.discriminatedUnion(
418
+ var harnessV1BridgeOutboundMessageSchema = z5.discriminatedUnion(
365
419
  "type",
366
420
  [
367
421
  harnessV1StreamStartPartSchema,
@@ -415,38 +469,39 @@ function harnessV1DiagnosticFromBridgeFrame(frame, context) {
415
469
  timestamp: context.timestamp
416
470
  };
417
471
  }
418
- var harnessV1BridgeToolResultInboundSchema = z4.object({
419
- type: z4.literal("tool-result"),
420
- toolCallId: z4.string(),
421
- output: z4.unknown(),
422
- isError: z4.boolean().optional()
423
- });
424
- var harnessV1BridgeToolApprovalResponseInboundSchema = z4.object({
425
- type: z4.literal("tool-approval-response"),
426
- approvalId: z4.string(),
427
- approved: z4.boolean(),
428
- reason: z4.string().optional()
429
- });
430
- var harnessV1BridgeUserMessageInboundSchema = z4.object({
431
- type: z4.literal("user-message"),
432
- messageId: z4.string().optional(),
433
- text: z4.string()
472
+ var harnessV1BridgeToolResultInboundSchema = z5.object({
473
+ type: z5.literal("tool-result"),
474
+ toolCallId: z5.string(),
475
+ output: z5.unknown(),
476
+ isError: z5.boolean().optional(),
477
+ toolResult: z5.unknown().optional()
478
+ });
479
+ var harnessV1BridgeToolApprovalResponseInboundSchema = z5.object({
480
+ type: z5.literal("tool-approval-response"),
481
+ approvalId: z5.string(),
482
+ approved: z5.boolean(),
483
+ reason: z5.string().optional()
484
+ });
485
+ var harnessV1BridgeUserMessageInboundSchema = z5.object({
486
+ type: z5.literal("user-message"),
487
+ messageId: z5.string().optional(),
488
+ text: z5.string()
434
489
  });
435
490
  var experimental_harnessV1BridgeUserMessageInboundSchema = harnessV1BridgeUserMessageInboundSchema.extend({
436
- messageId: z4.string()
491
+ messageId: z5.string()
437
492
  });
438
- var harnessV1BridgeAbortInboundSchema = z4.object({
439
- type: z4.literal("abort")
493
+ var harnessV1BridgeAbortInboundSchema = z5.object({
494
+ type: z5.literal("abort")
440
495
  });
441
- var harnessV1BridgeDestroyInboundSchema = z4.object({
442
- type: z4.literal("destroy")
496
+ var harnessV1BridgeDestroyInboundSchema = z5.object({
497
+ type: z5.literal("destroy")
443
498
  });
444
- var harnessV1BridgeResumeInboundSchema = z4.object({
445
- type: z4.literal("resume"),
446
- lastSeenEventId: z4.number()
499
+ var harnessV1BridgeResumeInboundSchema = z5.object({
500
+ type: z5.literal("resume"),
501
+ lastSeenEventId: z5.number()
447
502
  });
448
- var harnessV1BridgeStopInboundSchema = z4.object({
449
- type: z4.literal("stop")
503
+ var harnessV1BridgeStopInboundSchema = z5.object({
504
+ type: z5.literal("stop")
450
505
  });
451
506
  var harnessV1BridgeInboundCommandSchemas = [
452
507
  harnessV1BridgeToolResultInboundSchema,
@@ -457,9 +512,9 @@ var harnessV1BridgeInboundCommandSchemas = [
457
512
  harnessV1BridgeResumeInboundSchema,
458
513
  harnessV1BridgeStopInboundSchema
459
514
  ];
460
- var harnessV1BridgeReadySchema = z4.object({
461
- type: z4.literal("bridge-ready"),
462
- port: z4.number()
515
+ var harnessV1BridgeReadySchema = z5.object({
516
+ type: z5.literal("bridge-ready"),
517
+ port: z5.number()
463
518
  });
464
519
 
465
520
  // src/v1/harness-v1-tool-filtering.ts
@@ -567,6 +622,8 @@ export {
567
622
  harnessV1FileChangePartSchema,
568
623
  harnessV1FinishPartSchema,
569
624
  harnessV1FinishStepPartSchema,
625
+ harnessV1QuestionsToolInputSchema,
626
+ harnessV1QuestionsToolOutputSchema,
570
627
  harnessV1RawPartSchema,
571
628
  harnessV1ReasoningDeltaPartSchema,
572
629
  harnessV1ReasoningEndPartSchema,