@get-bb/plugin-sdk 0.4.88 → 0.4.97
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/bundled-types/bb-plugin-sdk-app.d.ts +94 -33
- package/bundled-types/bb-plugin-sdk-host.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +66 -2
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +16 -3
- package/bundled-types/bb-plugin-sdk-machine-provider.d.ts +2 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +8 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +10 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +3 -4
- package/bundled-types/bb-plugin-sdk-testing.d.ts +42 -6
- package/bundled-types/bb-plugin-sdk.d.ts +222 -44
- package/dist/internal/host-policy.js +175 -91
- package/dist/internal/plugin-app-collector.js +13834 -22
- package/dist/provider-bridge-acp.js +2207 -1578
- package/dist/provider-bridge-testing.js +1232 -1224
- package/dist/provider-bridge.js +1821 -1305
- package/dist/testing/app.js +13987 -175
- package/dist/testing/index.js +182 -93
- package/package.json +1 -1
|
@@ -261,8 +261,13 @@ var projectExecutionDefaultsSchema = z3.object({
|
|
|
261
261
|
permissionMode: permissionModeSchema
|
|
262
262
|
});
|
|
263
263
|
|
|
264
|
-
// ../domain/src/
|
|
264
|
+
// ../domain/src/completed-turn-display.ts
|
|
265
265
|
import { z as z4 } from "zod";
|
|
266
|
+
var COMPLETED_TURN_DISPLAY_VALUES = ["collapse", "flat"];
|
|
267
|
+
var completedTurnDisplaySchema = z4.enum(COMPLETED_TURN_DISPLAY_VALUES);
|
|
268
|
+
|
|
269
|
+
// ../domain/src/background-task.ts
|
|
270
|
+
import { z as z5 } from "zod";
|
|
266
271
|
var backgroundTaskStatusValues = [
|
|
267
272
|
"pending",
|
|
268
273
|
"running",
|
|
@@ -272,7 +277,7 @@ var backgroundTaskStatusValues = [
|
|
|
272
277
|
"killed",
|
|
273
278
|
"stopped"
|
|
274
279
|
];
|
|
275
|
-
var backgroundTaskStatusSchema =
|
|
280
|
+
var backgroundTaskStatusSchema = z5.enum(backgroundTaskStatusValues);
|
|
276
281
|
var workflowAgentStateValues = [
|
|
277
282
|
"queued",
|
|
278
283
|
"running",
|
|
@@ -280,53 +285,53 @@ var workflowAgentStateValues = [
|
|
|
280
285
|
"failed",
|
|
281
286
|
"skipped"
|
|
282
287
|
];
|
|
283
|
-
var workflowAgentStateSchema =
|
|
284
|
-
var workflowAgentSnapshotSchema =
|
|
285
|
-
index:
|
|
286
|
-
label:
|
|
288
|
+
var workflowAgentStateSchema = z5.enum(workflowAgentStateValues);
|
|
289
|
+
var workflowAgentSnapshotSchema = z5.object({
|
|
290
|
+
index: z5.number().int().positive(),
|
|
291
|
+
label: z5.string(),
|
|
287
292
|
state: workflowAgentStateSchema,
|
|
288
|
-
model:
|
|
289
|
-
attempt:
|
|
290
|
-
cached:
|
|
291
|
-
lastProgressAt:
|
|
292
|
-
phaseIndex:
|
|
293
|
-
phaseTitle:
|
|
294
|
-
agentType:
|
|
295
|
-
isolation:
|
|
296
|
-
queuedAt:
|
|
297
|
-
startedAt:
|
|
298
|
-
lastToolName:
|
|
299
|
-
lastToolSummary:
|
|
300
|
-
promptPreview:
|
|
301
|
-
resultPreview:
|
|
302
|
-
error:
|
|
303
|
-
tokens:
|
|
304
|
-
toolCalls:
|
|
305
|
-
durationMs:
|
|
306
|
-
});
|
|
307
|
-
var workflowPhaseSnapshotSchema =
|
|
308
|
-
index:
|
|
309
|
-
title:
|
|
310
|
-
kind:
|
|
311
|
-
});
|
|
312
|
-
var workflowProgressSnapshotSchema =
|
|
313
|
-
phases:
|
|
314
|
-
agents:
|
|
315
|
-
});
|
|
316
|
-
var backgroundTaskUsageSchema =
|
|
317
|
-
totalTokens:
|
|
318
|
-
toolUses:
|
|
319
|
-
durationMs:
|
|
293
|
+
model: z5.string(),
|
|
294
|
+
attempt: z5.number().int().positive(),
|
|
295
|
+
cached: z5.boolean(),
|
|
296
|
+
lastProgressAt: z5.number(),
|
|
297
|
+
phaseIndex: z5.number().int().positive().optional(),
|
|
298
|
+
phaseTitle: z5.string().optional(),
|
|
299
|
+
agentType: z5.string().optional(),
|
|
300
|
+
isolation: z5.string().optional(),
|
|
301
|
+
queuedAt: z5.number().optional(),
|
|
302
|
+
startedAt: z5.number().optional(),
|
|
303
|
+
lastToolName: z5.string().optional(),
|
|
304
|
+
lastToolSummary: z5.string().optional(),
|
|
305
|
+
promptPreview: z5.string().optional(),
|
|
306
|
+
resultPreview: z5.string().optional(),
|
|
307
|
+
error: z5.string().optional(),
|
|
308
|
+
tokens: z5.number().optional(),
|
|
309
|
+
toolCalls: z5.number().optional(),
|
|
310
|
+
durationMs: z5.number().optional()
|
|
311
|
+
});
|
|
312
|
+
var workflowPhaseSnapshotSchema = z5.object({
|
|
313
|
+
index: z5.number().int().positive(),
|
|
314
|
+
title: z5.string(),
|
|
315
|
+
kind: z5.string().optional()
|
|
316
|
+
});
|
|
317
|
+
var workflowProgressSnapshotSchema = z5.object({
|
|
318
|
+
phases: z5.array(workflowPhaseSnapshotSchema),
|
|
319
|
+
agents: z5.array(workflowAgentSnapshotSchema)
|
|
320
|
+
});
|
|
321
|
+
var backgroundTaskUsageSchema = z5.object({
|
|
322
|
+
totalTokens: z5.number(),
|
|
323
|
+
toolUses: z5.number(),
|
|
324
|
+
durationMs: z5.number()
|
|
320
325
|
});
|
|
321
326
|
|
|
322
327
|
// ../domain/src/provider-event.ts
|
|
323
|
-
import { z as
|
|
328
|
+
import { z as z14 } from "zod";
|
|
324
329
|
|
|
325
330
|
// ../domain/src/thread-events.ts
|
|
326
|
-
import { z as
|
|
331
|
+
import { z as z11 } from "zod";
|
|
327
332
|
|
|
328
333
|
// ../domain/src/pending-interactions.ts
|
|
329
|
-
import { z as
|
|
334
|
+
import { z as z8 } from "zod";
|
|
330
335
|
|
|
331
336
|
// ../domain/src/plugin-interaction-limits.ts
|
|
332
337
|
var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
|
|
@@ -336,223 +341,223 @@ function jsonByteLength(value) {
|
|
|
336
341
|
}
|
|
337
342
|
|
|
338
343
|
// ../domain/src/item-presentation.ts
|
|
339
|
-
import { z as
|
|
344
|
+
import { z as z6 } from "zod";
|
|
340
345
|
var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
|
|
341
|
-
var threadEventItemPresentationLabelSchema =
|
|
342
|
-
pending:
|
|
343
|
-
completed:
|
|
346
|
+
var threadEventItemPresentationLabelSchema = z6.object({
|
|
347
|
+
pending: z6.string().min(1),
|
|
348
|
+
completed: z6.string().min(1)
|
|
344
349
|
});
|
|
345
|
-
var threadEventItemPresentationIconSchema =
|
|
346
|
-
glyph:
|
|
350
|
+
var threadEventItemPresentationIconSchema = z6.object({
|
|
351
|
+
glyph: z6.string().min(1)
|
|
347
352
|
});
|
|
348
|
-
var threadEventItemPresentationTintSchema =
|
|
349
|
-
light:
|
|
350
|
-
dark:
|
|
353
|
+
var threadEventItemPresentationTintSchema = z6.object({
|
|
354
|
+
light: z6.string().min(1),
|
|
355
|
+
dark: z6.string().min(1)
|
|
351
356
|
});
|
|
352
357
|
var THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH = 80;
|
|
353
|
-
var threadEventItemPresentationBadgeSchema =
|
|
354
|
-
glyph:
|
|
355
|
-
label:
|
|
356
|
-
hint:
|
|
357
|
-
tone:
|
|
358
|
+
var threadEventItemPresentationBadgeSchema = z6.object({
|
|
359
|
+
glyph: z6.string().min(1),
|
|
360
|
+
label: z6.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
|
|
361
|
+
hint: z6.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
|
|
362
|
+
tone: z6.enum(["neutral", "destructive"])
|
|
358
363
|
});
|
|
359
|
-
var threadEventItemPresentationSchema =
|
|
364
|
+
var threadEventItemPresentationSchema = z6.object({
|
|
360
365
|
label: threadEventItemPresentationLabelSchema,
|
|
361
366
|
icon: threadEventItemPresentationIconSchema,
|
|
362
|
-
title:
|
|
363
|
-
detail:
|
|
364
|
-
suppress:
|
|
367
|
+
title: z6.string().optional(),
|
|
368
|
+
detail: z6.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
|
|
369
|
+
suppress: z6.boolean().optional(),
|
|
365
370
|
tint: threadEventItemPresentationTintSchema.optional(),
|
|
366
371
|
badge: threadEventItemPresentationBadgeSchema.optional()
|
|
367
372
|
});
|
|
368
373
|
|
|
369
374
|
// ../domain/src/provider-extension-kind.ts
|
|
370
|
-
import { z as
|
|
375
|
+
import { z as z7 } from "zod";
|
|
371
376
|
var EXTENSION_KIND_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
|
|
372
377
|
function isExtensionKind(value) {
|
|
373
378
|
return EXTENSION_KIND_PATTERN.test(value);
|
|
374
379
|
}
|
|
375
|
-
var extensionKindSchema =
|
|
380
|
+
var extensionKindSchema = z7.string().refine(isExtensionKind, {
|
|
376
381
|
message: 'extension kinds are "<pluginId>/<name>" (lowercase letters, digits, and "-")'
|
|
377
382
|
});
|
|
378
383
|
|
|
379
384
|
// ../domain/src/pending-interactions.ts
|
|
380
|
-
var pendingInteractionStatusSchema =
|
|
385
|
+
var pendingInteractionStatusSchema = z8.enum([
|
|
381
386
|
"pending",
|
|
382
387
|
"resolving",
|
|
383
388
|
"resolved",
|
|
384
389
|
"interrupted"
|
|
385
390
|
]);
|
|
386
|
-
var pendingInteractionCommandActionSchema =
|
|
391
|
+
var pendingInteractionCommandActionSchema = z8.discriminatedUnion(
|
|
387
392
|
"type",
|
|
388
393
|
[
|
|
389
|
-
|
|
390
|
-
type:
|
|
391
|
-
command:
|
|
392
|
-
name:
|
|
393
|
-
path:
|
|
394
|
+
z8.object({
|
|
395
|
+
type: z8.literal("read"),
|
|
396
|
+
command: z8.string(),
|
|
397
|
+
name: z8.string(),
|
|
398
|
+
path: z8.string()
|
|
394
399
|
}),
|
|
395
|
-
|
|
396
|
-
type:
|
|
397
|
-
command:
|
|
398
|
-
path:
|
|
400
|
+
z8.object({
|
|
401
|
+
type: z8.literal("listFiles"),
|
|
402
|
+
command: z8.string(),
|
|
403
|
+
path: z8.string().nullable()
|
|
399
404
|
}),
|
|
400
|
-
|
|
401
|
-
type:
|
|
402
|
-
command:
|
|
403
|
-
query:
|
|
404
|
-
path:
|
|
405
|
+
z8.object({
|
|
406
|
+
type: z8.literal("search"),
|
|
407
|
+
command: z8.string(),
|
|
408
|
+
query: z8.string().nullable(),
|
|
409
|
+
path: z8.string().nullable()
|
|
405
410
|
}),
|
|
406
|
-
|
|
407
|
-
type:
|
|
408
|
-
command:
|
|
411
|
+
z8.object({
|
|
412
|
+
type: z8.literal("unknown"),
|
|
413
|
+
command: z8.string()
|
|
409
414
|
})
|
|
410
415
|
]
|
|
411
416
|
);
|
|
412
|
-
var pendingInteractionNetworkPermissionsSchema =
|
|
413
|
-
enabled:
|
|
417
|
+
var pendingInteractionNetworkPermissionsSchema = z8.object({
|
|
418
|
+
enabled: z8.boolean().nullable()
|
|
414
419
|
});
|
|
415
|
-
var pendingInteractionFileSystemPermissionsSchema =
|
|
416
|
-
read:
|
|
417
|
-
write:
|
|
420
|
+
var pendingInteractionFileSystemPermissionsSchema = z8.object({
|
|
421
|
+
read: z8.array(z8.string()),
|
|
422
|
+
write: z8.array(z8.string())
|
|
418
423
|
});
|
|
419
|
-
var pendingInteractionMacOsPreferencesPermissionSchema =
|
|
424
|
+
var pendingInteractionMacOsPreferencesPermissionSchema = z8.enum([
|
|
420
425
|
"none",
|
|
421
426
|
"read_only",
|
|
422
427
|
"read_write"
|
|
423
428
|
]);
|
|
424
|
-
var pendingInteractionMacOsContactsPermissionSchema =
|
|
429
|
+
var pendingInteractionMacOsContactsPermissionSchema = z8.enum([
|
|
425
430
|
"none",
|
|
426
431
|
"read_only",
|
|
427
432
|
"read_write"
|
|
428
433
|
]);
|
|
429
|
-
var pendingInteractionMacOsAutomationPermissionSchema =
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
kind:
|
|
434
|
-
bundleIds:
|
|
434
|
+
var pendingInteractionMacOsAutomationPermissionSchema = z8.union([
|
|
435
|
+
z8.literal("none"),
|
|
436
|
+
z8.literal("all"),
|
|
437
|
+
z8.object({
|
|
438
|
+
kind: z8.literal("bundle_ids"),
|
|
439
|
+
bundleIds: z8.array(z8.string())
|
|
435
440
|
})
|
|
436
441
|
]);
|
|
437
|
-
var pendingInteractionMacOsPermissionsSchema =
|
|
442
|
+
var pendingInteractionMacOsPermissionsSchema = z8.object({
|
|
438
443
|
preferences: pendingInteractionMacOsPreferencesPermissionSchema,
|
|
439
444
|
automations: pendingInteractionMacOsAutomationPermissionSchema,
|
|
440
|
-
launchServices:
|
|
441
|
-
accessibility:
|
|
442
|
-
calendar:
|
|
443
|
-
reminders:
|
|
445
|
+
launchServices: z8.boolean(),
|
|
446
|
+
accessibility: z8.boolean(),
|
|
447
|
+
calendar: z8.boolean(),
|
|
448
|
+
reminders: z8.boolean(),
|
|
444
449
|
contacts: pendingInteractionMacOsContactsPermissionSchema
|
|
445
450
|
});
|
|
446
|
-
var pendingInteractionRequestedPermissionProfileSchema =
|
|
451
|
+
var pendingInteractionRequestedPermissionProfileSchema = z8.object({
|
|
447
452
|
network: pendingInteractionNetworkPermissionsSchema.nullable(),
|
|
448
453
|
fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable(),
|
|
449
454
|
macos: pendingInteractionMacOsPermissionsSchema.nullable()
|
|
450
455
|
});
|
|
451
|
-
var pendingInteractionGrantablePermissionProfileSchema =
|
|
456
|
+
var pendingInteractionGrantablePermissionProfileSchema = z8.object({
|
|
452
457
|
network: pendingInteractionNetworkPermissionsSchema.nullable(),
|
|
453
458
|
fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable()
|
|
454
459
|
}).strict();
|
|
455
460
|
var pendingInteractionGrantedPermissionProfileSchema = pendingInteractionGrantablePermissionProfileSchema;
|
|
456
|
-
var pendingInteractionApprovalDecisionSchema =
|
|
461
|
+
var pendingInteractionApprovalDecisionSchema = z8.enum([
|
|
457
462
|
"allow_once",
|
|
458
463
|
"allow_for_session",
|
|
459
464
|
"deny"
|
|
460
465
|
]);
|
|
461
|
-
var pendingInteractionFileChangeWriteScopeSchema =
|
|
462
|
-
var pendingInteractionCommandApprovalSubjectSchema =
|
|
463
|
-
kind:
|
|
464
|
-
itemId:
|
|
465
|
-
command:
|
|
466
|
-
cwd:
|
|
467
|
-
actions:
|
|
466
|
+
var pendingInteractionFileChangeWriteScopeSchema = z8.string().min(1);
|
|
467
|
+
var pendingInteractionCommandApprovalSubjectSchema = z8.object({
|
|
468
|
+
kind: z8.literal("command"),
|
|
469
|
+
itemId: z8.string().min(1),
|
|
470
|
+
command: z8.string().min(1),
|
|
471
|
+
cwd: z8.string().nullable(),
|
|
472
|
+
actions: z8.array(pendingInteractionCommandActionSchema),
|
|
468
473
|
sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
|
|
469
474
|
});
|
|
470
|
-
var pendingInteractionFileChangeApprovalSubjectSchema =
|
|
471
|
-
kind:
|
|
472
|
-
itemId:
|
|
475
|
+
var pendingInteractionFileChangeApprovalSubjectSchema = z8.object({
|
|
476
|
+
kind: z8.literal("file_change"),
|
|
477
|
+
itemId: z8.string().min(1),
|
|
473
478
|
writeScope: pendingInteractionFileChangeWriteScopeSchema.nullable(),
|
|
474
479
|
sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
|
|
475
480
|
});
|
|
476
|
-
var pendingInteractionPermissionGrantApprovalSubjectSchema =
|
|
477
|
-
kind:
|
|
478
|
-
itemId:
|
|
479
|
-
toolName:
|
|
481
|
+
var pendingInteractionPermissionGrantApprovalSubjectSchema = z8.object({
|
|
482
|
+
kind: z8.literal("permission_grant"),
|
|
483
|
+
itemId: z8.string().min(1),
|
|
484
|
+
toolName: z8.string().nullable(),
|
|
480
485
|
permissions: pendingInteractionGrantablePermissionProfileSchema
|
|
481
486
|
});
|
|
482
|
-
var pendingInteractionPlanApprovalSubjectSchema =
|
|
483
|
-
kind:
|
|
484
|
-
itemId:
|
|
485
|
-
plan:
|
|
486
|
-
planFilePath:
|
|
487
|
+
var pendingInteractionPlanApprovalSubjectSchema = z8.object({
|
|
488
|
+
kind: z8.literal("plan"),
|
|
489
|
+
itemId: z8.string().min(1),
|
|
490
|
+
plan: z8.string().min(1),
|
|
491
|
+
planFilePath: z8.string().min(1).nullable()
|
|
487
492
|
});
|
|
488
|
-
var pendingInteractionToolUseApprovalSubjectSchema =
|
|
489
|
-
kind:
|
|
490
|
-
itemId:
|
|
491
|
-
tool:
|
|
493
|
+
var pendingInteractionToolUseApprovalSubjectSchema = z8.object({
|
|
494
|
+
kind: z8.literal("tool_use"),
|
|
495
|
+
itemId: z8.string().min(1),
|
|
496
|
+
tool: z8.string().min(1),
|
|
492
497
|
presentation: threadEventItemPresentationSchema
|
|
493
498
|
});
|
|
494
|
-
var pendingInteractionApprovalSubjectSchema =
|
|
499
|
+
var pendingInteractionApprovalSubjectSchema = z8.discriminatedUnion("kind", [
|
|
495
500
|
pendingInteractionCommandApprovalSubjectSchema,
|
|
496
501
|
pendingInteractionFileChangeApprovalSubjectSchema,
|
|
497
502
|
pendingInteractionPermissionGrantApprovalSubjectSchema,
|
|
498
503
|
pendingInteractionPlanApprovalSubjectSchema,
|
|
499
504
|
pendingInteractionToolUseApprovalSubjectSchema
|
|
500
505
|
]);
|
|
501
|
-
var approvalPendingInteractionPayloadSchema =
|
|
502
|
-
kind:
|
|
506
|
+
var approvalPendingInteractionPayloadSchema = z8.object({
|
|
507
|
+
kind: z8.literal("approval"),
|
|
503
508
|
subject: pendingInteractionApprovalSubjectSchema,
|
|
504
|
-
reason:
|
|
505
|
-
availableDecisions:
|
|
509
|
+
reason: z8.string().nullable(),
|
|
510
|
+
availableDecisions: z8.array(pendingInteractionApprovalDecisionSchema).min(1)
|
|
506
511
|
});
|
|
507
512
|
var USER_QUESTION_MAX_QUESTIONS = 4;
|
|
508
513
|
var USER_QUESTION_MAX_OPTIONS = 4;
|
|
509
514
|
var USER_QUESTION_MAX_SELECTED = 4;
|
|
510
515
|
var USER_QUESTION_MAX_FREE_TEXT_LENGTH = 4096;
|
|
511
|
-
var pendingInteractionUserQuestionIdSchema =
|
|
516
|
+
var pendingInteractionUserQuestionIdSchema = z8.string().min(1).refine((value) => value.trim().length > 0, {
|
|
512
517
|
message: "User question ids cannot be blank"
|
|
513
518
|
});
|
|
514
|
-
var pendingInteractionUserQuestionPromptSchema =
|
|
519
|
+
var pendingInteractionUserQuestionPromptSchema = z8.string().min(1).refine((value) => value.trim().length > 0, {
|
|
515
520
|
message: "User question prompts cannot be blank"
|
|
516
521
|
});
|
|
517
|
-
var pendingInteractionUserQuestionShortLabelSchema =
|
|
522
|
+
var pendingInteractionUserQuestionShortLabelSchema = z8.string().min(1).refine((value) => value.trim().length > 0, {
|
|
518
523
|
message: "User question short labels cannot be blank"
|
|
519
524
|
});
|
|
520
|
-
var pendingInteractionUserQuestionOptionValueSchema =
|
|
525
|
+
var pendingInteractionUserQuestionOptionValueSchema = z8.string().min(1).refine((value) => value.trim().length > 0, {
|
|
521
526
|
message: "User question option values cannot be blank"
|
|
522
527
|
});
|
|
523
|
-
var pendingInteractionUserQuestionOptionLabelSchema =
|
|
528
|
+
var pendingInteractionUserQuestionOptionLabelSchema = z8.string().min(1).refine((value) => value.trim().length > 0, {
|
|
524
529
|
message: "User question option labels cannot be blank"
|
|
525
530
|
});
|
|
526
|
-
var pendingInteractionUserQuestionOptionDescriptionSchema =
|
|
531
|
+
var pendingInteractionUserQuestionOptionDescriptionSchema = z8.string().min(1).refine((value) => value.trim().length > 0, {
|
|
527
532
|
message: "User question option descriptions cannot be blank"
|
|
528
533
|
});
|
|
529
|
-
var pendingInteractionUserQuestionFreeTextSchema =
|
|
534
|
+
var pendingInteractionUserQuestionFreeTextSchema = z8.string().min(1).max(
|
|
530
535
|
USER_QUESTION_MAX_FREE_TEXT_LENGTH,
|
|
531
536
|
`User question free text cannot exceed ${USER_QUESTION_MAX_FREE_TEXT_LENGTH} characters`
|
|
532
537
|
).refine((value) => value.trim().length > 0, {
|
|
533
538
|
message: "User question free text cannot be blank"
|
|
534
539
|
});
|
|
535
|
-
var pendingInteractionUserQuestionOptionSchema =
|
|
540
|
+
var pendingInteractionUserQuestionOptionSchema = z8.object({
|
|
536
541
|
value: pendingInteractionUserQuestionOptionValueSchema,
|
|
537
542
|
label: pendingInteractionUserQuestionOptionLabelSchema,
|
|
538
543
|
description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
|
|
539
544
|
});
|
|
540
|
-
var pendingInteractionUserQuestionQuestionSchema =
|
|
545
|
+
var pendingInteractionUserQuestionQuestionSchema = z8.object({
|
|
541
546
|
id: pendingInteractionUserQuestionIdSchema,
|
|
542
547
|
prompt: pendingInteractionUserQuestionPromptSchema,
|
|
543
548
|
shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
|
|
544
|
-
multiSelect:
|
|
545
|
-
options:
|
|
549
|
+
multiSelect: z8.boolean(),
|
|
550
|
+
options: z8.array(pendingInteractionUserQuestionOptionSchema).max(
|
|
546
551
|
USER_QUESTION_MAX_OPTIONS,
|
|
547
552
|
`User questions cannot include more than ${USER_QUESTION_MAX_OPTIONS} options`
|
|
548
553
|
).optional(),
|
|
549
|
-
allowFreeText:
|
|
554
|
+
allowFreeText: z8.boolean()
|
|
550
555
|
}).superRefine((question, context) => {
|
|
551
556
|
const optionValues = /* @__PURE__ */ new Set();
|
|
552
557
|
question.options?.forEach((option, index) => {
|
|
553
558
|
if (optionValues.has(option.value)) {
|
|
554
559
|
context.addIssue({
|
|
555
|
-
code:
|
|
560
|
+
code: z8.ZodIssueCode.custom,
|
|
556
561
|
message: "User question option values must be unique",
|
|
557
562
|
path: ["options", index, "value"]
|
|
558
563
|
});
|
|
@@ -567,9 +572,9 @@ var pendingInteractionUserQuestionQuestionSchema = z7.object({
|
|
|
567
572
|
path: ["options"]
|
|
568
573
|
}
|
|
569
574
|
);
|
|
570
|
-
var userQuestionPendingInteractionPayloadSchema =
|
|
571
|
-
kind:
|
|
572
|
-
questions:
|
|
575
|
+
var userQuestionPendingInteractionPayloadSchema = z8.object({
|
|
576
|
+
kind: z8.literal("user_question"),
|
|
577
|
+
questions: z8.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
|
|
573
578
|
USER_QUESTION_MAX_QUESTIONS,
|
|
574
579
|
`User questions cannot include more than ${USER_QUESTION_MAX_QUESTIONS} questions`
|
|
575
580
|
)
|
|
@@ -578,7 +583,7 @@ var userQuestionPendingInteractionPayloadSchema = z7.object({
|
|
|
578
583
|
payload.questions.forEach((question, index) => {
|
|
579
584
|
if (questionIds.has(question.id)) {
|
|
580
585
|
context.addIssue({
|
|
581
|
-
code:
|
|
586
|
+
code: z8.ZodIssueCode.custom,
|
|
582
587
|
message: "User question ids must be unique",
|
|
583
588
|
path: ["questions", index, "id"]
|
|
584
589
|
});
|
|
@@ -587,65 +592,65 @@ var userQuestionPendingInteractionPayloadSchema = z7.object({
|
|
|
587
592
|
questionIds.add(question.id);
|
|
588
593
|
});
|
|
589
594
|
});
|
|
590
|
-
var pluginPendingInteractionPayloadSchema =
|
|
591
|
-
kind:
|
|
592
|
-
title:
|
|
595
|
+
var pluginPendingInteractionPayloadSchema = z8.object({
|
|
596
|
+
kind: z8.literal("plugin"),
|
|
597
|
+
title: z8.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
|
|
593
598
|
data: jsonValueSchema
|
|
594
599
|
});
|
|
595
|
-
var pluginExtensionInteractionRequestPayloadSchema =
|
|
600
|
+
var pluginExtensionInteractionRequestPayloadSchema = z8.object({
|
|
596
601
|
kind: extensionKindSchema,
|
|
597
|
-
title:
|
|
602
|
+
title: z8.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
|
|
598
603
|
data: jsonValueSchema.refine(
|
|
599
604
|
(value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
|
|
600
605
|
{ message: "Plugin request data exceeds 64 KiB" }
|
|
601
606
|
)
|
|
602
607
|
});
|
|
603
|
-
var interactionRequestPayloadSchema =
|
|
608
|
+
var interactionRequestPayloadSchema = z8.union([
|
|
604
609
|
userQuestionPendingInteractionPayloadSchema,
|
|
605
610
|
pluginExtensionInteractionRequestPayloadSchema
|
|
606
611
|
]);
|
|
607
|
-
var pendingInteractionPayloadSchema =
|
|
612
|
+
var pendingInteractionPayloadSchema = z8.union([
|
|
608
613
|
approvalPendingInteractionPayloadSchema,
|
|
609
614
|
userQuestionPendingInteractionPayloadSchema,
|
|
610
615
|
pluginExtensionInteractionRequestPayloadSchema
|
|
611
616
|
]);
|
|
612
617
|
var approvalDecisionDiscriminatorError = "Invalid discriminator value. Expected 'allow_once' | 'allow_for_session' | 'deny'";
|
|
613
|
-
var approvalPendingInteractionResolutionSchema =
|
|
618
|
+
var approvalPendingInteractionResolutionSchema = z8.discriminatedUnion(
|
|
614
619
|
"decision",
|
|
615
620
|
[
|
|
616
|
-
|
|
617
|
-
decision:
|
|
621
|
+
z8.object({
|
|
622
|
+
decision: z8.literal("allow_once"),
|
|
618
623
|
grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
|
|
619
624
|
}),
|
|
620
|
-
|
|
621
|
-
decision:
|
|
625
|
+
z8.object({
|
|
626
|
+
decision: z8.literal("allow_for_session"),
|
|
622
627
|
grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
|
|
623
628
|
}),
|
|
624
|
-
|
|
625
|
-
decision:
|
|
629
|
+
z8.object({
|
|
630
|
+
decision: z8.literal("deny")
|
|
626
631
|
})
|
|
627
632
|
],
|
|
628
633
|
approvalDecisionDiscriminatorError
|
|
629
634
|
);
|
|
630
|
-
var pendingInteractionUserAnswerSchema =
|
|
631
|
-
selected:
|
|
635
|
+
var pendingInteractionUserAnswerSchema = z8.object({
|
|
636
|
+
selected: z8.array(z8.string().min(1)).max(
|
|
632
637
|
USER_QUESTION_MAX_SELECTED,
|
|
633
638
|
`User question selected choices cannot exceed ${USER_QUESTION_MAX_SELECTED}`
|
|
634
639
|
),
|
|
635
640
|
freeText: pendingInteractionUserQuestionFreeTextSchema.optional()
|
|
636
641
|
});
|
|
637
|
-
var userQuestionPendingInteractionResolutionSchema =
|
|
638
|
-
kind:
|
|
639
|
-
answers:
|
|
642
|
+
var userQuestionPendingInteractionResolutionSchema = z8.object({
|
|
643
|
+
kind: z8.literal("user_answer"),
|
|
644
|
+
answers: z8.record(z8.string().min(1), pendingInteractionUserAnswerSchema)
|
|
640
645
|
});
|
|
641
|
-
var pluginPendingInteractionResolutionSchema =
|
|
642
|
-
kind:
|
|
646
|
+
var pluginPendingInteractionResolutionSchema = z8.object({
|
|
647
|
+
kind: z8.literal("plugin_submitted")
|
|
643
648
|
});
|
|
644
|
-
var pluginExtensionInteractionResolutionSchema =
|
|
645
|
-
kind:
|
|
649
|
+
var pluginExtensionInteractionResolutionSchema = z8.object({
|
|
650
|
+
kind: z8.literal("request_answer"),
|
|
646
651
|
value: jsonValueSchema
|
|
647
652
|
});
|
|
648
|
-
var pendingInteractionResolutionSchema =
|
|
653
|
+
var pendingInteractionResolutionSchema = z8.union(
|
|
649
654
|
[
|
|
650
655
|
approvalPendingInteractionResolutionSchema,
|
|
651
656
|
userQuestionPendingInteractionResolutionSchema,
|
|
@@ -654,56 +659,56 @@ var pendingInteractionResolutionSchema = z7.union(
|
|
|
654
659
|
],
|
|
655
660
|
approvalDecisionDiscriminatorError
|
|
656
661
|
);
|
|
657
|
-
var approvalInteractionOutcomeSchema =
|
|
662
|
+
var approvalInteractionOutcomeSchema = z8.object({
|
|
658
663
|
payload: approvalPendingInteractionPayloadSchema,
|
|
659
664
|
resolution: approvalPendingInteractionResolutionSchema
|
|
660
665
|
});
|
|
661
|
-
var userQuestionInteractionOutcomeSchema =
|
|
666
|
+
var userQuestionInteractionOutcomeSchema = z8.object({
|
|
662
667
|
payload: userQuestionPendingInteractionPayloadSchema,
|
|
663
668
|
resolution: userQuestionPendingInteractionResolutionSchema
|
|
664
669
|
});
|
|
665
|
-
var pluginExtensionInteractionOutcomeSchema =
|
|
670
|
+
var pluginExtensionInteractionOutcomeSchema = z8.object({
|
|
666
671
|
payload: pluginExtensionInteractionRequestPayloadSchema,
|
|
667
672
|
resolution: pluginExtensionInteractionResolutionSchema
|
|
668
673
|
});
|
|
669
|
-
var providerInteractionOutcomeSchema =
|
|
674
|
+
var providerInteractionOutcomeSchema = z8.union([
|
|
670
675
|
approvalInteractionOutcomeSchema,
|
|
671
676
|
userQuestionInteractionOutcomeSchema,
|
|
672
677
|
pluginExtensionInteractionOutcomeSchema
|
|
673
678
|
]);
|
|
674
|
-
var pendingInteractionProviderOriginSchema =
|
|
675
|
-
kind:
|
|
676
|
-
providerId:
|
|
677
|
-
providerThreadId:
|
|
678
|
-
providerRequestId:
|
|
679
|
-
});
|
|
680
|
-
var pendingInteractionPluginOriginSchema =
|
|
681
|
-
kind:
|
|
682
|
-
pluginId:
|
|
683
|
-
rendererId:
|
|
684
|
-
});
|
|
685
|
-
var pendingInteractionCreateSchema =
|
|
686
|
-
threadId:
|
|
687
|
-
turnId:
|
|
688
|
-
providerId:
|
|
689
|
-
providerThreadId:
|
|
690
|
-
providerRequestId:
|
|
679
|
+
var pendingInteractionProviderOriginSchema = z8.object({
|
|
680
|
+
kind: z8.literal("provider"),
|
|
681
|
+
providerId: z8.string().min(1),
|
|
682
|
+
providerThreadId: z8.string().min(1),
|
|
683
|
+
providerRequestId: z8.string().min(1)
|
|
684
|
+
});
|
|
685
|
+
var pendingInteractionPluginOriginSchema = z8.object({
|
|
686
|
+
kind: z8.literal("plugin"),
|
|
687
|
+
pluginId: z8.string().min(1),
|
|
688
|
+
rendererId: z8.string().min(1)
|
|
689
|
+
});
|
|
690
|
+
var pendingInteractionCreateSchema = z8.object({
|
|
691
|
+
threadId: z8.string().min(1),
|
|
692
|
+
turnId: z8.string().min(1),
|
|
693
|
+
providerId: z8.string().min(1),
|
|
694
|
+
providerThreadId: z8.string().min(1),
|
|
695
|
+
providerRequestId: z8.string().min(1),
|
|
691
696
|
payload: pendingInteractionPayloadSchema
|
|
692
697
|
});
|
|
693
|
-
var pendingInteractionBaseSchema =
|
|
694
|
-
id:
|
|
695
|
-
threadId:
|
|
698
|
+
var pendingInteractionBaseSchema = z8.object({
|
|
699
|
+
id: z8.string().min(1),
|
|
700
|
+
threadId: z8.string().min(1),
|
|
696
701
|
status: pendingInteractionStatusSchema,
|
|
697
|
-
statusReason:
|
|
698
|
-
createdAt:
|
|
699
|
-
expiresAt:
|
|
700
|
-
resolvedAt:
|
|
702
|
+
statusReason: z8.string().nullable(),
|
|
703
|
+
createdAt: z8.number().int().nonnegative(),
|
|
704
|
+
expiresAt: z8.number().int().nonnegative().nullable().optional(),
|
|
705
|
+
resolvedAt: z8.number().int().nonnegative().nullable()
|
|
701
706
|
});
|
|
702
707
|
var providerPendingInteractionBaseSchema = pendingInteractionBaseSchema.extend({
|
|
703
|
-
turnId:
|
|
704
|
-
providerId:
|
|
705
|
-
providerThreadId:
|
|
706
|
-
providerRequestId:
|
|
708
|
+
turnId: z8.string().min(1),
|
|
709
|
+
providerId: z8.string().min(1),
|
|
710
|
+
providerThreadId: z8.string().min(1),
|
|
711
|
+
providerRequestId: z8.string().min(1),
|
|
707
712
|
origin: pendingInteractionProviderOriginSchema.optional()
|
|
708
713
|
});
|
|
709
714
|
var approvalPendingInteractionSchema = providerPendingInteractionBaseSchema.extend({
|
|
@@ -718,30 +723,30 @@ var pluginExtensionPendingInteractionSchema = providerPendingInteractionBaseSche
|
|
|
718
723
|
payload: pluginExtensionInteractionRequestPayloadSchema,
|
|
719
724
|
resolution: pluginExtensionInteractionResolutionSchema.nullable()
|
|
720
725
|
});
|
|
721
|
-
var providerPendingInteractionSchema =
|
|
726
|
+
var providerPendingInteractionSchema = z8.union([
|
|
722
727
|
approvalPendingInteractionSchema,
|
|
723
728
|
userQuestionPendingInteractionSchema,
|
|
724
729
|
pluginExtensionPendingInteractionSchema
|
|
725
730
|
]);
|
|
726
731
|
var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
|
|
727
|
-
turnId:
|
|
732
|
+
turnId: z8.string().min(1).nullable(),
|
|
728
733
|
origin: pendingInteractionPluginOriginSchema,
|
|
729
734
|
payload: pluginPendingInteractionPayloadSchema,
|
|
730
735
|
resolution: pluginPendingInteractionResolutionSchema.nullable()
|
|
731
736
|
});
|
|
732
|
-
var pendingInteractionSchema =
|
|
737
|
+
var pendingInteractionSchema = z8.union([
|
|
733
738
|
providerPendingInteractionSchema,
|
|
734
739
|
pluginPendingInteractionSchema
|
|
735
740
|
]);
|
|
736
|
-
var interactionLifecycleRecordBaseSchema =
|
|
737
|
-
id:
|
|
741
|
+
var interactionLifecycleRecordBaseSchema = z8.object({
|
|
742
|
+
id: z8.string().min(1),
|
|
738
743
|
status: pendingInteractionStatusSchema,
|
|
739
|
-
statusReason:
|
|
744
|
+
statusReason: z8.string().nullable()
|
|
740
745
|
});
|
|
741
|
-
var interactionLifecycleProviderOriginSchema =
|
|
742
|
-
kind:
|
|
743
|
-
providerId:
|
|
744
|
-
providerRequestId:
|
|
746
|
+
var interactionLifecycleProviderOriginSchema = z8.object({
|
|
747
|
+
kind: z8.literal("provider"),
|
|
748
|
+
providerId: z8.string().min(1),
|
|
749
|
+
providerRequestId: z8.string().min(1)
|
|
745
750
|
});
|
|
746
751
|
var approvalInteractionLifecycleRecordPayloadSchema = approvalPendingInteractionPayloadSchema.omit({ availableDecisions: true });
|
|
747
752
|
var approvalInteractionLifecycleSchema = interactionLifecycleRecordBaseSchema.extend({
|
|
@@ -766,7 +771,7 @@ var pluginExtensionInteractionLifecycleSchema = interactionLifecycleRecordBaseSc
|
|
|
766
771
|
}),
|
|
767
772
|
resolution: pluginExtensionInteractionResolutionSchema.omit({ value: true }).nullable()
|
|
768
773
|
});
|
|
769
|
-
var interactionLifecycleSchema =
|
|
774
|
+
var interactionLifecycleSchema = z8.union([
|
|
770
775
|
approvalInteractionLifecycleSchema,
|
|
771
776
|
userQuestionInteractionLifecycleSchema,
|
|
772
777
|
pluginInteractionLifecycleSchema,
|
|
@@ -774,11 +779,11 @@ var interactionLifecycleSchema = z7.union([
|
|
|
774
779
|
]);
|
|
775
780
|
|
|
776
781
|
// ../domain/src/protocol-ids.ts
|
|
777
|
-
import { z as
|
|
778
|
-
var clientTurnRequestIdSchema =
|
|
782
|
+
import { z as z9 } from "zod";
|
|
783
|
+
var clientTurnRequestIdSchema = z9.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
|
|
779
784
|
|
|
780
785
|
// ../domain/src/system-message.ts
|
|
781
|
-
import { z as
|
|
786
|
+
import { z as z10 } from "zod";
|
|
782
787
|
var systemMessageKindValues = [
|
|
783
788
|
"ownership-assigned",
|
|
784
789
|
"ownership-removed",
|
|
@@ -789,16 +794,16 @@ var systemMessageKindValues = [
|
|
|
789
794
|
"child-outcome-batch",
|
|
790
795
|
"unlabeled"
|
|
791
796
|
];
|
|
792
|
-
var systemMessageKindSchema =
|
|
793
|
-
var systemMessageSubjectSchema =
|
|
794
|
-
|
|
795
|
-
kind:
|
|
796
|
-
threadId:
|
|
797
|
-
threadName:
|
|
797
|
+
var systemMessageKindSchema = z10.enum(systemMessageKindValues);
|
|
798
|
+
var systemMessageSubjectSchema = z10.discriminatedUnion("kind", [
|
|
799
|
+
z10.object({
|
|
800
|
+
kind: z10.literal("thread"),
|
|
801
|
+
threadId: z10.string(),
|
|
802
|
+
threadName: z10.string()
|
|
798
803
|
}),
|
|
799
|
-
|
|
800
|
-
kind:
|
|
801
|
-
count:
|
|
804
|
+
z10.object({
|
|
805
|
+
kind: z10.literal("thread-batch"),
|
|
806
|
+
count: z10.number()
|
|
802
807
|
})
|
|
803
808
|
]);
|
|
804
809
|
|
|
@@ -821,31 +826,31 @@ var systemEventTypeValues = [
|
|
|
821
826
|
"system/provider-turn-watchdog"
|
|
822
827
|
];
|
|
823
828
|
var threadTurnInitiatorValues = ["user", "agent", "system"];
|
|
824
|
-
var threadTurnInitiatorSchema =
|
|
829
|
+
var threadTurnInitiatorSchema = z11.enum(threadTurnInitiatorValues);
|
|
825
830
|
var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
|
|
826
|
-
var turnRequestTargetSchema =
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
kind:
|
|
831
|
-
expectedTurnId:
|
|
831
|
+
var turnRequestTargetSchema = z11.discriminatedUnion("kind", [
|
|
832
|
+
z11.object({ kind: z11.literal("thread-start") }),
|
|
833
|
+
z11.object({ kind: z11.literal("new-turn") }),
|
|
834
|
+
z11.object({
|
|
835
|
+
kind: z11.literal("auto"),
|
|
836
|
+
expectedTurnId: z11.string().nullable()
|
|
832
837
|
}),
|
|
833
|
-
|
|
834
|
-
kind:
|
|
835
|
-
expectedTurnId:
|
|
838
|
+
z11.object({
|
|
839
|
+
kind: z11.literal("steer"),
|
|
840
|
+
expectedTurnId: z11.string().nullable()
|
|
836
841
|
})
|
|
837
842
|
]);
|
|
838
|
-
var clientTurnLifecycleEventDataSchema =
|
|
839
|
-
direction:
|
|
840
|
-
source:
|
|
843
|
+
var clientTurnLifecycleEventDataSchema = z11.object({
|
|
844
|
+
direction: z11.literal("outbound"),
|
|
845
|
+
source: z11.enum(["spawn", "tell"]),
|
|
841
846
|
initiator: threadTurnInitiatorSchema,
|
|
842
|
-
request:
|
|
843
|
-
method:
|
|
844
|
-
params:
|
|
847
|
+
request: z11.object({
|
|
848
|
+
method: z11.enum(["thread/start", "turn/start"]),
|
|
849
|
+
params: z11.record(z11.string(), z11.unknown())
|
|
845
850
|
})
|
|
846
851
|
});
|
|
847
|
-
var turnRequestEventDataSchema =
|
|
848
|
-
direction:
|
|
852
|
+
var turnRequestEventDataSchema = z11.object({
|
|
853
|
+
direction: z11.literal("outbound"),
|
|
849
854
|
requestId: clientTurnRequestIdSchema,
|
|
850
855
|
// Retry provenance, written only when a `turn.failed` gate's retry row
|
|
851
856
|
// dispatches. Both fields are present together or not at all: absence means
|
|
@@ -855,45 +860,45 @@ var turnRequestEventDataSchema = z10.object({
|
|
|
855
860
|
/** The original request this attempt re-submits, unchanged across attempts. */
|
|
856
861
|
retryOfRequestId: clientTurnRequestIdSchema.optional(),
|
|
857
862
|
/** Which attempt this is: 2 is the first retry of the original request. */
|
|
858
|
-
retryAttempt:
|
|
859
|
-
source:
|
|
863
|
+
retryAttempt: z11.number().int().min(2).optional(),
|
|
864
|
+
source: z11.enum(["spawn", "tell"]),
|
|
860
865
|
initiator: threadTurnInitiatorSchema,
|
|
861
|
-
senderThreadId:
|
|
866
|
+
senderThreadId: z11.string().nullable(),
|
|
862
867
|
systemMessageKind: systemMessageKindSchema.optional(),
|
|
863
868
|
systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
|
|
864
|
-
input:
|
|
865
|
-
inputGroups:
|
|
869
|
+
input: z11.array(promptInputSchema),
|
|
870
|
+
inputGroups: z11.array(z11.array(promptInputSchema).min(1)).min(1).optional(),
|
|
866
871
|
target: turnRequestTargetSchema,
|
|
867
|
-
request:
|
|
868
|
-
method:
|
|
869
|
-
params:
|
|
872
|
+
request: z11.object({
|
|
873
|
+
method: z11.enum(["thread/start", "turn/start"]),
|
|
874
|
+
params: z11.record(z11.string(), z11.unknown())
|
|
870
875
|
}),
|
|
871
876
|
execution: turnRequestOptionsSchema
|
|
872
877
|
});
|
|
873
|
-
var turnRequestRejectedEventDataSchema =
|
|
878
|
+
var turnRequestRejectedEventDataSchema = z11.object({
|
|
874
879
|
requestId: clientTurnRequestIdSchema,
|
|
875
|
-
reason:
|
|
876
|
-
message:
|
|
877
|
-
});
|
|
878
|
-
var systemErrorEventDataSchema =
|
|
879
|
-
code:
|
|
880
|
-
message:
|
|
881
|
-
detail:
|
|
882
|
-
reconnectAttempt:
|
|
883
|
-
reconnectTotal:
|
|
880
|
+
reason: z11.string().min(1),
|
|
881
|
+
message: z11.string().min(1)
|
|
882
|
+
});
|
|
883
|
+
var systemErrorEventDataSchema = z11.object({
|
|
884
|
+
code: z11.string().optional(),
|
|
885
|
+
message: z11.string(),
|
|
886
|
+
detail: z11.string().optional(),
|
|
887
|
+
reconnectAttempt: z11.number().int().positive().optional(),
|
|
888
|
+
reconnectTotal: z11.number().int().positive().optional()
|
|
884
889
|
}).superRefine((value, ctx) => {
|
|
885
890
|
const hasReconnectAttempt = value.reconnectAttempt !== void 0;
|
|
886
891
|
const hasReconnectTotal = value.reconnectTotal !== void 0;
|
|
887
892
|
if (hasReconnectAttempt !== hasReconnectTotal) {
|
|
888
893
|
ctx.addIssue({
|
|
889
|
-
code:
|
|
894
|
+
code: z11.ZodIssueCode.custom,
|
|
890
895
|
message: "system/error reconnectAttempt and reconnectTotal must be provided together"
|
|
891
896
|
});
|
|
892
897
|
return;
|
|
893
898
|
}
|
|
894
899
|
if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
|
|
895
900
|
ctx.addIssue({
|
|
896
|
-
code:
|
|
901
|
+
code: z11.ZodIssueCode.custom,
|
|
897
902
|
message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
|
|
898
903
|
});
|
|
899
904
|
}
|
|
@@ -903,42 +908,42 @@ var ownershipChangeOperationActionValues = [
|
|
|
903
908
|
"release",
|
|
904
909
|
"transfer"
|
|
905
910
|
];
|
|
906
|
-
var ownershipChangeOperationActionSchema =
|
|
911
|
+
var ownershipChangeOperationActionSchema = z11.enum(
|
|
907
912
|
ownershipChangeOperationActionValues
|
|
908
913
|
);
|
|
909
|
-
var ownershipChangeOperationMetadataSchema =
|
|
914
|
+
var ownershipChangeOperationMetadataSchema = z11.object({
|
|
910
915
|
action: ownershipChangeOperationActionSchema,
|
|
911
|
-
nextParentThreadId:
|
|
912
|
-
nextParentThreadTitle:
|
|
913
|
-
previousParentThreadId:
|
|
914
|
-
previousParentThreadTitle:
|
|
915
|
-
});
|
|
916
|
-
var systemOperationEventDataSchema =
|
|
917
|
-
operation:
|
|
918
|
-
status:
|
|
919
|
-
message:
|
|
920
|
-
operationId:
|
|
921
|
-
metadata:
|
|
922
|
-
});
|
|
923
|
-
var systemInteractionLifecycleEventDataSchema =
|
|
916
|
+
nextParentThreadId: z11.string().nullable(),
|
|
917
|
+
nextParentThreadTitle: z11.string().nullable(),
|
|
918
|
+
previousParentThreadId: z11.string().nullable(),
|
|
919
|
+
previousParentThreadTitle: z11.string().nullable()
|
|
920
|
+
});
|
|
921
|
+
var systemOperationEventDataSchema = z11.object({
|
|
922
|
+
operation: z11.string(),
|
|
923
|
+
status: z11.string(),
|
|
924
|
+
message: z11.string(),
|
|
925
|
+
operationId: z11.string(),
|
|
926
|
+
metadata: z11.record(z11.string(), jsonValueSchema).optional()
|
|
927
|
+
});
|
|
928
|
+
var systemInteractionLifecycleEventDataSchema = z11.object({
|
|
924
929
|
interaction: interactionLifecycleSchema
|
|
925
930
|
});
|
|
926
|
-
var systemPermissionGrantLifecycleEventDataSchema =
|
|
927
|
-
interactionId:
|
|
928
|
-
providerId:
|
|
929
|
-
providerRequestId:
|
|
931
|
+
var systemPermissionGrantLifecycleEventDataSchema = z11.object({
|
|
932
|
+
interactionId: z11.string(),
|
|
933
|
+
providerId: z11.string(),
|
|
934
|
+
providerRequestId: z11.string(),
|
|
930
935
|
status: pendingInteractionStatusSchema,
|
|
931
936
|
resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
|
|
932
|
-
statusReason:
|
|
937
|
+
statusReason: z11.string().nullable().default(null),
|
|
933
938
|
subject: pendingInteractionPermissionGrantApprovalSubjectSchema
|
|
934
939
|
});
|
|
935
|
-
var systemUserQuestionLifecycleEventDataSchema =
|
|
936
|
-
interactionId:
|
|
937
|
-
providerId:
|
|
938
|
-
providerRequestId:
|
|
940
|
+
var systemUserQuestionLifecycleEventDataSchema = z11.object({
|
|
941
|
+
interactionId: z11.string(),
|
|
942
|
+
providerId: z11.string(),
|
|
943
|
+
providerRequestId: z11.string(),
|
|
939
944
|
status: pendingInteractionStatusSchema,
|
|
940
945
|
resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
|
|
941
|
-
statusReason:
|
|
946
|
+
statusReason: z11.string().nullable().default(null),
|
|
942
947
|
payload: userQuestionPendingInteractionPayloadSchema
|
|
943
948
|
});
|
|
944
949
|
var systemThreadInterruptedReasonValues = [
|
|
@@ -946,20 +951,20 @@ var systemThreadInterruptedReasonValues = [
|
|
|
946
951
|
"host-daemon-restarted",
|
|
947
952
|
"provider-turn-idle"
|
|
948
953
|
];
|
|
949
|
-
var systemThreadInterruptedReasonSchema =
|
|
954
|
+
var systemThreadInterruptedReasonSchema = z11.enum(
|
|
950
955
|
systemThreadInterruptedReasonValues
|
|
951
956
|
);
|
|
952
|
-
var systemThreadInterruptedEventDataSchema =
|
|
957
|
+
var systemThreadInterruptedEventDataSchema = z11.object({
|
|
953
958
|
reason: systemThreadInterruptedReasonSchema,
|
|
954
|
-
cause:
|
|
959
|
+
cause: z11.literal("host-connection-lost").optional()
|
|
955
960
|
});
|
|
956
|
-
var provisioningTranscriptEntrySchema =
|
|
957
|
-
type:
|
|
958
|
-
key:
|
|
959
|
-
text:
|
|
960
|
-
startedAt:
|
|
961
|
-
status:
|
|
962
|
-
metadata:
|
|
961
|
+
var provisioningTranscriptEntrySchema = z11.object({
|
|
962
|
+
type: z11.enum(["step", "output"]),
|
|
963
|
+
key: z11.string(),
|
|
964
|
+
text: z11.string(),
|
|
965
|
+
startedAt: z11.number().optional(),
|
|
966
|
+
status: z11.enum(["started", "completed", "failed"]).optional(),
|
|
967
|
+
metadata: z11.record(z11.string(), z11.unknown()).optional()
|
|
963
968
|
});
|
|
964
969
|
var systemThreadProvisioningStatusValues = [
|
|
965
970
|
"active",
|
|
@@ -967,48 +972,48 @@ var systemThreadProvisioningStatusValues = [
|
|
|
967
972
|
"failed",
|
|
968
973
|
"cancelled"
|
|
969
974
|
];
|
|
970
|
-
var systemThreadProvisioningStatusSchema =
|
|
975
|
+
var systemThreadProvisioningStatusSchema = z11.enum(
|
|
971
976
|
systemThreadProvisioningStatusValues
|
|
972
977
|
);
|
|
973
|
-
var systemThreadProvisioningEventDataSchema =
|
|
974
|
-
provisioningId:
|
|
978
|
+
var systemThreadProvisioningEventDataSchema = z11.object({
|
|
979
|
+
provisioningId: z11.string(),
|
|
975
980
|
status: systemThreadProvisioningStatusSchema,
|
|
976
|
-
environmentId:
|
|
977
|
-
entries:
|
|
978
|
-
});
|
|
979
|
-
var systemLegacyUserMessageEventDataSchema =
|
|
980
|
-
text:
|
|
981
|
-
toolCallId:
|
|
982
|
-
turnId:
|
|
983
|
-
});
|
|
984
|
-
var systemProviderTurnWatchdogEventDataSchema =
|
|
985
|
-
reason:
|
|
986
|
-
thresholdMs:
|
|
987
|
-
elapsedMs:
|
|
988
|
-
activeTurnId:
|
|
989
|
-
activeTurnStartedAt:
|
|
990
|
-
lastActivityEventSequence:
|
|
991
|
-
lastActivityEventType:
|
|
992
|
-
lastActivityEventAt:
|
|
993
|
-
providerId:
|
|
994
|
-
providerThreadId:
|
|
995
|
-
firedAt:
|
|
981
|
+
environmentId: z11.string().nullable(),
|
|
982
|
+
entries: z11.array(provisioningTranscriptEntrySchema)
|
|
983
|
+
});
|
|
984
|
+
var systemLegacyUserMessageEventDataSchema = z11.object({
|
|
985
|
+
text: z11.string(),
|
|
986
|
+
toolCallId: z11.string().optional(),
|
|
987
|
+
turnId: z11.string().optional()
|
|
988
|
+
});
|
|
989
|
+
var systemProviderTurnWatchdogEventDataSchema = z11.object({
|
|
990
|
+
reason: z11.literal("provider-turn-idle"),
|
|
991
|
+
thresholdMs: z11.number().int().positive(),
|
|
992
|
+
elapsedMs: z11.number().int().nonnegative(),
|
|
993
|
+
activeTurnId: z11.string().min(1),
|
|
994
|
+
activeTurnStartedAt: z11.number().int().nonnegative(),
|
|
995
|
+
lastActivityEventSequence: z11.number().int().positive(),
|
|
996
|
+
lastActivityEventType: z11.string().min(1),
|
|
997
|
+
lastActivityEventAt: z11.number().int().nonnegative(),
|
|
998
|
+
providerId: z11.string().min(1),
|
|
999
|
+
providerThreadId: z11.string().min(1).nullable(),
|
|
1000
|
+
firedAt: z11.number().int().nonnegative()
|
|
996
1001
|
});
|
|
997
1002
|
|
|
998
1003
|
// ../domain/src/thread-event-scope.ts
|
|
999
|
-
import { z as
|
|
1004
|
+
import { z as z12 } from "zod";
|
|
1000
1005
|
var threadEventScopeKindValues = ["thread", "turn"];
|
|
1001
|
-
var threadEventScopeKindSchema =
|
|
1002
|
-
var threadEventScopeSchema =
|
|
1003
|
-
|
|
1004
|
-
|
|
1006
|
+
var threadEventScopeKindSchema = z12.enum(threadEventScopeKindValues);
|
|
1007
|
+
var threadEventScopeSchema = z12.discriminatedUnion("kind", [
|
|
1008
|
+
z12.object({ kind: z12.literal("thread") }),
|
|
1009
|
+
z12.object({ kind: z12.literal("turn"), turnId: z12.string().min(1) })
|
|
1005
1010
|
]);
|
|
1006
1011
|
var threadEventScopePolicyValues = [
|
|
1007
1012
|
"thread",
|
|
1008
1013
|
"turn",
|
|
1009
1014
|
"thread-or-turn"
|
|
1010
1015
|
];
|
|
1011
|
-
var threadEventScopePolicySchema =
|
|
1016
|
+
var threadEventScopePolicySchema = z12.enum(threadEventScopePolicyValues);
|
|
1012
1017
|
var threadEventScopeDefinitionByType = {
|
|
1013
1018
|
"thread/started": {
|
|
1014
1019
|
policy: "thread",
|
|
@@ -1183,32 +1188,32 @@ function validateThreadEventScope(args) {
|
|
|
1183
1188
|
}
|
|
1184
1189
|
|
|
1185
1190
|
// ../domain/src/thread-timeline-goal.ts
|
|
1186
|
-
import { z as
|
|
1187
|
-
var threadTimelineGoalStatusSchema =
|
|
1191
|
+
import { z as z13 } from "zod";
|
|
1192
|
+
var threadTimelineGoalStatusSchema = z13.enum([
|
|
1188
1193
|
"active",
|
|
1189
1194
|
"paused",
|
|
1190
1195
|
"budgetLimited",
|
|
1191
1196
|
"complete"
|
|
1192
1197
|
]);
|
|
1193
|
-
var threadTimelineGoalSchema =
|
|
1194
|
-
sourceSeq:
|
|
1195
|
-
updatedAt:
|
|
1196
|
-
objective:
|
|
1198
|
+
var threadTimelineGoalSchema = z13.object({
|
|
1199
|
+
sourceSeq: z13.number().int().nonnegative(),
|
|
1200
|
+
updatedAt: z13.number(),
|
|
1201
|
+
objective: z13.string(),
|
|
1197
1202
|
status: threadTimelineGoalStatusSchema,
|
|
1198
|
-
tokenBudget:
|
|
1199
|
-
tokensUsed:
|
|
1200
|
-
timeUsedSeconds:
|
|
1203
|
+
tokenBudget: z13.number().nullable(),
|
|
1204
|
+
tokensUsed: z13.number(),
|
|
1205
|
+
timeUsedSeconds: z13.number()
|
|
1201
1206
|
});
|
|
1202
1207
|
|
|
1203
1208
|
// ../domain/src/provider-event.ts
|
|
1204
|
-
var threadEventItemStatusSchema =
|
|
1209
|
+
var threadEventItemStatusSchema = z14.enum([
|
|
1205
1210
|
"pending",
|
|
1206
1211
|
"completed",
|
|
1207
1212
|
"failed",
|
|
1208
1213
|
"interrupted"
|
|
1209
1214
|
]);
|
|
1210
|
-
var threadEventItemApprovalStatusSchema =
|
|
1211
|
-
var threadEventTurnStatusSchema =
|
|
1215
|
+
var threadEventItemApprovalStatusSchema = z14.enum(["waiting_for_approval", "denied"]).nullable();
|
|
1216
|
+
var threadEventTurnStatusSchema = z14.enum([
|
|
1212
1217
|
"completed",
|
|
1213
1218
|
"failed",
|
|
1214
1219
|
"interrupted"
|
|
@@ -1234,260 +1239,262 @@ var providerErrorCategoryValues = [
|
|
|
1234
1239
|
"unauthorized",
|
|
1235
1240
|
"unknown"
|
|
1236
1241
|
];
|
|
1237
|
-
var providerErrorCategorySchema =
|
|
1238
|
-
var providerErrorInfoSchema =
|
|
1242
|
+
var providerErrorCategorySchema = z14.enum(providerErrorCategoryValues);
|
|
1243
|
+
var providerErrorInfoSchema = z14.object({
|
|
1239
1244
|
category: providerErrorCategorySchema,
|
|
1240
|
-
providerCode:
|
|
1241
|
-
httpStatusCode:
|
|
1245
|
+
providerCode: z14.string().nullable(),
|
|
1246
|
+
httpStatusCode: z14.number().nullable()
|
|
1242
1247
|
});
|
|
1243
|
-
var providerRateLimitStatusSchema =
|
|
1248
|
+
var providerRateLimitStatusSchema = z14.enum([
|
|
1244
1249
|
"allowed",
|
|
1245
1250
|
"warning",
|
|
1246
1251
|
"blocked",
|
|
1247
1252
|
"unknown"
|
|
1248
1253
|
]);
|
|
1249
|
-
var providerRateLimitWindowSchema =
|
|
1250
|
-
providerKey:
|
|
1251
|
-
label:
|
|
1254
|
+
var providerRateLimitWindowSchema = z14.object({
|
|
1255
|
+
providerKey: z14.string().min(1).nullable(),
|
|
1256
|
+
label: z14.string().min(1).nullable(),
|
|
1252
1257
|
status: providerRateLimitStatusSchema,
|
|
1253
|
-
resetsAtMs:
|
|
1258
|
+
resetsAtMs: z14.number().int().nonnegative().nullable()
|
|
1254
1259
|
});
|
|
1255
|
-
var providerRateLimitStateSchema =
|
|
1256
|
-
providerId:
|
|
1260
|
+
var providerRateLimitStateSchema = z14.object({
|
|
1261
|
+
providerId: z14.string().min(1),
|
|
1257
1262
|
status: providerRateLimitStatusSchema,
|
|
1258
|
-
kind:
|
|
1259
|
-
windows:
|
|
1260
|
-
reachedReason:
|
|
1261
|
-
overageStatus:
|
|
1262
|
-
overageReason:
|
|
1263
|
-
});
|
|
1264
|
-
var threadEventFileChangeKindSchema =
|
|
1265
|
-
var threadEventFileChangeSchema =
|
|
1266
|
-
path:
|
|
1263
|
+
kind: z14.enum(["subscription-window", "credits", "spend-control", "unknown"]),
|
|
1264
|
+
windows: z14.array(providerRateLimitWindowSchema),
|
|
1265
|
+
reachedReason: z14.string().min(1).nullable(),
|
|
1266
|
+
overageStatus: z14.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
|
|
1267
|
+
overageReason: z14.string().min(1).nullable()
|
|
1268
|
+
});
|
|
1269
|
+
var threadEventFileChangeKindSchema = z14.enum(["add", "delete", "update"]);
|
|
1270
|
+
var threadEventFileChangeSchema = z14.object({
|
|
1271
|
+
path: z14.string(),
|
|
1267
1272
|
kind: threadEventFileChangeKindSchema,
|
|
1268
|
-
movePath:
|
|
1269
|
-
diff:
|
|
1273
|
+
movePath: z14.string().optional(),
|
|
1274
|
+
diff: z14.string().optional()
|
|
1270
1275
|
});
|
|
1271
|
-
var threadEventPlanStepStatusSchema =
|
|
1276
|
+
var threadEventPlanStepStatusSchema = z14.enum([
|
|
1272
1277
|
"pending",
|
|
1273
1278
|
"active",
|
|
1274
1279
|
"completed",
|
|
1275
1280
|
"failed"
|
|
1276
1281
|
]);
|
|
1277
|
-
var threadEventPlanStepSchema =
|
|
1278
|
-
step:
|
|
1282
|
+
var threadEventPlanStepSchema = z14.object({
|
|
1283
|
+
step: z14.string(),
|
|
1279
1284
|
status: threadEventPlanStepStatusSchema.optional()
|
|
1280
1285
|
});
|
|
1281
1286
|
var itemPresentationField = {
|
|
1282
1287
|
presentation: threadEventItemPresentationSchema.optional()
|
|
1283
1288
|
};
|
|
1284
|
-
var threadEventWebSearchItemSchema =
|
|
1285
|
-
type:
|
|
1286
|
-
id:
|
|
1287
|
-
queries:
|
|
1288
|
-
resultText:
|
|
1289
|
+
var threadEventWebSearchItemSchema = z14.object({
|
|
1290
|
+
type: z14.literal("webSearch"),
|
|
1291
|
+
id: z14.string(),
|
|
1292
|
+
queries: z14.array(z14.string()).min(1),
|
|
1293
|
+
resultText: z14.string().nullable(),
|
|
1289
1294
|
...itemPresentationField,
|
|
1290
|
-
parentToolCallId:
|
|
1291
|
-
});
|
|
1292
|
-
var threadEventWebFetchItemSchema =
|
|
1293
|
-
type:
|
|
1294
|
-
id:
|
|
1295
|
-
url:
|
|
1296
|
-
prompt:
|
|
1297
|
-
pattern:
|
|
1298
|
-
resultText:
|
|
1295
|
+
parentToolCallId: z14.string().optional()
|
|
1296
|
+
});
|
|
1297
|
+
var threadEventWebFetchItemSchema = z14.object({
|
|
1298
|
+
type: z14.literal("webFetch"),
|
|
1299
|
+
id: z14.string(),
|
|
1300
|
+
url: z14.string(),
|
|
1301
|
+
prompt: z14.string().nullable(),
|
|
1302
|
+
pattern: z14.string().nullable(),
|
|
1303
|
+
resultText: z14.string().nullable(),
|
|
1299
1304
|
...itemPresentationField,
|
|
1300
|
-
parentToolCallId:
|
|
1305
|
+
parentToolCallId: z14.string().optional()
|
|
1301
1306
|
});
|
|
1302
|
-
var threadEventImageViewItemSchema =
|
|
1303
|
-
type:
|
|
1304
|
-
id:
|
|
1305
|
-
path:
|
|
1307
|
+
var threadEventImageViewItemSchema = z14.object({
|
|
1308
|
+
type: z14.literal("imageView"),
|
|
1309
|
+
id: z14.string(),
|
|
1310
|
+
path: z14.string(),
|
|
1306
1311
|
...itemPresentationField,
|
|
1307
|
-
parentToolCallId:
|
|
1312
|
+
parentToolCallId: z14.string().optional()
|
|
1308
1313
|
});
|
|
1309
|
-
var threadEventFileReadItemSchema =
|
|
1310
|
-
type:
|
|
1311
|
-
id:
|
|
1312
|
-
path:
|
|
1313
|
-
cmd:
|
|
1314
|
+
var threadEventFileReadItemSchema = z14.object({
|
|
1315
|
+
type: z14.literal("fileRead"),
|
|
1316
|
+
id: z14.string(),
|
|
1317
|
+
path: z14.string(),
|
|
1318
|
+
cmd: z14.string().optional(),
|
|
1314
1319
|
status: threadEventItemStatusSchema,
|
|
1315
1320
|
...itemPresentationField,
|
|
1316
|
-
parentToolCallId:
|
|
1321
|
+
parentToolCallId: z14.string().optional()
|
|
1317
1322
|
});
|
|
1318
|
-
var threadEventSearchModeSchema =
|
|
1319
|
-
var threadEventSearchItemSchema =
|
|
1320
|
-
type:
|
|
1321
|
-
id:
|
|
1323
|
+
var threadEventSearchModeSchema = z14.enum(["content", "path", "list"]);
|
|
1324
|
+
var threadEventSearchItemSchema = z14.object({
|
|
1325
|
+
type: z14.literal("search"),
|
|
1326
|
+
id: z14.string(),
|
|
1322
1327
|
mode: threadEventSearchModeSchema,
|
|
1323
|
-
query:
|
|
1324
|
-
path:
|
|
1325
|
-
cmd:
|
|
1328
|
+
query: z14.string(),
|
|
1329
|
+
path: z14.string().optional(),
|
|
1330
|
+
cmd: z14.string().optional(),
|
|
1326
1331
|
status: threadEventItemStatusSchema,
|
|
1327
1332
|
...itemPresentationField,
|
|
1328
|
-
parentToolCallId:
|
|
1333
|
+
parentToolCallId: z14.string().optional()
|
|
1329
1334
|
});
|
|
1330
|
-
var threadEventDelegationItemSchema =
|
|
1331
|
-
type:
|
|
1332
|
-
id:
|
|
1333
|
-
childRef:
|
|
1334
|
-
label:
|
|
1335
|
+
var threadEventDelegationItemSchema = z14.object({
|
|
1336
|
+
type: z14.literal("delegation"),
|
|
1337
|
+
id: z14.string(),
|
|
1338
|
+
childRef: z14.string().min(1),
|
|
1339
|
+
label: z14.string(),
|
|
1335
1340
|
status: threadEventItemStatusSchema,
|
|
1336
|
-
background:
|
|
1337
|
-
summary:
|
|
1341
|
+
background: z14.boolean(),
|
|
1342
|
+
summary: z14.string().optional(),
|
|
1338
1343
|
...itemPresentationField,
|
|
1339
|
-
parentToolCallId:
|
|
1344
|
+
parentToolCallId: z14.string().optional()
|
|
1340
1345
|
});
|
|
1341
|
-
var threadEventPlanStepsItemSchema =
|
|
1342
|
-
type:
|
|
1343
|
-
id:
|
|
1344
|
-
steps:
|
|
1345
|
-
explanation:
|
|
1346
|
+
var threadEventPlanStepsItemSchema = z14.object({
|
|
1347
|
+
type: z14.literal("planSteps"),
|
|
1348
|
+
id: z14.string(),
|
|
1349
|
+
steps: z14.array(threadEventPlanStepSchema),
|
|
1350
|
+
explanation: z14.string().optional(),
|
|
1346
1351
|
status: threadEventItemStatusSchema,
|
|
1347
1352
|
...itemPresentationField,
|
|
1348
|
-
parentToolCallId:
|
|
1353
|
+
parentToolCallId: z14.string().optional()
|
|
1349
1354
|
});
|
|
1350
|
-
var threadEventExtensionItemSchema =
|
|
1351
|
-
type:
|
|
1352
|
-
id:
|
|
1355
|
+
var threadEventExtensionItemSchema = z14.object({
|
|
1356
|
+
type: z14.literal("extension"),
|
|
1357
|
+
id: z14.string(),
|
|
1353
1358
|
kind: extensionKindSchema,
|
|
1354
1359
|
payload: jsonValueSchema,
|
|
1355
1360
|
status: threadEventItemStatusSchema,
|
|
1356
1361
|
presentation: threadEventItemPresentationSchema,
|
|
1357
|
-
parentToolCallId:
|
|
1362
|
+
parentToolCallId: z14.string().optional()
|
|
1358
1363
|
});
|
|
1359
|
-
var threadEventTextTruncationSchema =
|
|
1360
|
-
originalLength:
|
|
1361
|
-
retainedHeadLength:
|
|
1362
|
-
retainedTailLength:
|
|
1363
|
-
truncatedAt:
|
|
1364
|
+
var threadEventTextTruncationSchema = z14.object({
|
|
1365
|
+
originalLength: z14.number(),
|
|
1366
|
+
retainedHeadLength: z14.number(),
|
|
1367
|
+
retainedTailLength: z14.number(),
|
|
1368
|
+
truncatedAt: z14.number()
|
|
1364
1369
|
});
|
|
1365
|
-
var threadEventItemTruncationSchema =
|
|
1370
|
+
var threadEventItemTruncationSchema = z14.object({
|
|
1366
1371
|
aggregatedOutput: threadEventTextTruncationSchema.optional(),
|
|
1367
1372
|
result: threadEventTextTruncationSchema.optional(),
|
|
1368
1373
|
resultText: threadEventTextTruncationSchema.optional()
|
|
1369
1374
|
});
|
|
1370
|
-
var threadEventImageGenerationItemSchema =
|
|
1371
|
-
type:
|
|
1372
|
-
id:
|
|
1375
|
+
var threadEventImageGenerationItemSchema = z14.object({
|
|
1376
|
+
type: z14.literal("imageGeneration"),
|
|
1377
|
+
id: z14.string(),
|
|
1373
1378
|
status: threadEventItemStatusSchema,
|
|
1374
|
-
prompt:
|
|
1375
|
-
path:
|
|
1376
|
-
result:
|
|
1377
|
-
error:
|
|
1378
|
-
transparentBackground:
|
|
1379
|
+
prompt: z14.string().nullable(),
|
|
1380
|
+
path: z14.string().nullable(),
|
|
1381
|
+
result: z14.string().optional(),
|
|
1382
|
+
error: z14.string().nullable(),
|
|
1383
|
+
transparentBackground: z14.boolean(),
|
|
1379
1384
|
truncation: threadEventItemTruncationSchema.optional(),
|
|
1380
1385
|
...itemPresentationField,
|
|
1381
|
-
parentToolCallId:
|
|
1386
|
+
parentToolCallId: z14.string().optional()
|
|
1382
1387
|
});
|
|
1383
|
-
var threadEventUserContentSchema =
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
+
var threadEventUserContentSchema = z14.discriminatedUnion("type", [
|
|
1389
|
+
z14.object({ type: z14.literal("text"), text: z14.string() }),
|
|
1390
|
+
z14.object({ type: z14.literal("image"), url: z14.string() }),
|
|
1391
|
+
z14.object({ type: z14.literal("localImage"), path: z14.string() }),
|
|
1392
|
+
z14.object({ type: z14.literal("localFile"), path: z14.string() })
|
|
1388
1393
|
]);
|
|
1389
|
-
var threadEventTokenUsageBreakdownSchema =
|
|
1390
|
-
totalTokens:
|
|
1391
|
-
inputTokens:
|
|
1392
|
-
cachedInputTokens:
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1394
|
+
var threadEventTokenUsageBreakdownSchema = z14.object({
|
|
1395
|
+
totalTokens: z14.number(),
|
|
1396
|
+
inputTokens: z14.number(),
|
|
1397
|
+
cachedInputTokens: z14.number(),
|
|
1398
|
+
cacheReadInputTokens: z14.number().nonnegative().optional(),
|
|
1399
|
+
cacheWriteInputTokens: z14.number().nonnegative().optional(),
|
|
1400
|
+
outputTokens: z14.number(),
|
|
1401
|
+
reasoningOutputTokens: z14.number()
|
|
1402
|
+
});
|
|
1403
|
+
var threadEventContextWindowUsageSchema = z14.object({
|
|
1397
1404
|
snapshot: contextSnapshotSchema.optional(),
|
|
1398
|
-
usedTokens:
|
|
1399
|
-
modelContextWindow:
|
|
1400
|
-
estimated:
|
|
1405
|
+
usedTokens: z14.number().nullable(),
|
|
1406
|
+
modelContextWindow: z14.number().nullable(),
|
|
1407
|
+
estimated: z14.boolean()
|
|
1401
1408
|
});
|
|
1402
|
-
var threadEventTokenUsageSchema =
|
|
1409
|
+
var threadEventTokenUsageSchema = z14.object({
|
|
1403
1410
|
total: threadEventTokenUsageBreakdownSchema,
|
|
1404
1411
|
last: threadEventTokenUsageBreakdownSchema,
|
|
1405
|
-
modelContextWindow:
|
|
1412
|
+
modelContextWindow: z14.number().nullable()
|
|
1406
1413
|
});
|
|
1407
|
-
var threadEventWarningCategorySchema =
|
|
1414
|
+
var threadEventWarningCategorySchema = z14.enum([
|
|
1408
1415
|
"deprecation",
|
|
1409
1416
|
"config",
|
|
1410
1417
|
"general",
|
|
1411
1418
|
"compaction-skipped"
|
|
1412
1419
|
]);
|
|
1413
|
-
var providerRawEventSchema =
|
|
1414
|
-
jsonrpc:
|
|
1415
|
-
id:
|
|
1416
|
-
method:
|
|
1420
|
+
var providerRawEventSchema = z14.object({
|
|
1421
|
+
jsonrpc: z14.literal("2.0"),
|
|
1422
|
+
id: z14.union([z14.string(), z14.number()]).optional(),
|
|
1423
|
+
method: z14.string(),
|
|
1417
1424
|
params: jsonValueSchema.optional()
|
|
1418
1425
|
});
|
|
1419
|
-
var providerUnhandledEventSchema =
|
|
1420
|
-
type:
|
|
1421
|
-
threadId:
|
|
1422
|
-
providerThreadId:
|
|
1423
|
-
providerId:
|
|
1424
|
-
rawType:
|
|
1426
|
+
var providerUnhandledEventSchema = z14.object({
|
|
1427
|
+
type: z14.literal("provider/unhandled"),
|
|
1428
|
+
threadId: z14.string(),
|
|
1429
|
+
providerThreadId: z14.string(),
|
|
1430
|
+
providerId: z14.string(),
|
|
1431
|
+
rawType: z14.string(),
|
|
1425
1432
|
rawEvent: providerRawEventSchema,
|
|
1426
|
-
parentToolCallId:
|
|
1427
|
-
});
|
|
1428
|
-
var toolCallProgressEventSchema =
|
|
1429
|
-
type:
|
|
1430
|
-
threadId:
|
|
1431
|
-
providerThreadId:
|
|
1432
|
-
itemId:
|
|
1433
|
-
message:
|
|
1434
|
-
parentToolCallId:
|
|
1435
|
-
});
|
|
1436
|
-
var threadEventBackgroundTaskItemSchema =
|
|
1437
|
-
type:
|
|
1438
|
-
id:
|
|
1439
|
-
familyId:
|
|
1440
|
-
taskType:
|
|
1441
|
-
description:
|
|
1433
|
+
parentToolCallId: z14.string().optional()
|
|
1434
|
+
});
|
|
1435
|
+
var toolCallProgressEventSchema = z14.object({
|
|
1436
|
+
type: z14.literal("item/toolCall/progress"),
|
|
1437
|
+
threadId: z14.string(),
|
|
1438
|
+
providerThreadId: z14.string(),
|
|
1439
|
+
itemId: z14.string(),
|
|
1440
|
+
message: z14.string().optional(),
|
|
1441
|
+
parentToolCallId: z14.string().optional()
|
|
1442
|
+
});
|
|
1443
|
+
var threadEventBackgroundTaskItemSchema = z14.object({
|
|
1444
|
+
type: z14.literal("backgroundTask"),
|
|
1445
|
+
id: z14.string(),
|
|
1446
|
+
familyId: z14.string().optional(),
|
|
1447
|
+
taskType: z14.string(),
|
|
1448
|
+
description: z14.string(),
|
|
1442
1449
|
status: threadEventItemStatusSchema,
|
|
1443
1450
|
taskStatus: backgroundTaskStatusSchema,
|
|
1444
|
-
skipTranscript:
|
|
1445
|
-
workflowName:
|
|
1451
|
+
skipTranscript: z14.boolean(),
|
|
1452
|
+
workflowName: z14.string().optional(),
|
|
1446
1453
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
1447
1454
|
usage: backgroundTaskUsageSchema.optional(),
|
|
1448
|
-
summary:
|
|
1449
|
-
error:
|
|
1450
|
-
outputFile:
|
|
1455
|
+
summary: z14.string().optional(),
|
|
1456
|
+
error: z14.string().optional(),
|
|
1457
|
+
outputFile: z14.string().optional(),
|
|
1451
1458
|
...itemPresentationField,
|
|
1452
|
-
parentToolCallId:
|
|
1459
|
+
parentToolCallId: z14.string().optional()
|
|
1453
1460
|
});
|
|
1454
|
-
var threadEventItemSchema =
|
|
1455
|
-
|
|
1456
|
-
type:
|
|
1457
|
-
id:
|
|
1458
|
-
content:
|
|
1461
|
+
var threadEventItemSchema = z14.discriminatedUnion("type", [
|
|
1462
|
+
z14.object({
|
|
1463
|
+
type: z14.literal("userMessage"),
|
|
1464
|
+
id: z14.string(),
|
|
1465
|
+
content: z14.array(threadEventUserContentSchema),
|
|
1459
1466
|
clientRequestId: clientTurnRequestIdSchema.optional(),
|
|
1460
|
-
parentToolCallId:
|
|
1467
|
+
parentToolCallId: z14.string().optional()
|
|
1461
1468
|
}).strict(),
|
|
1462
|
-
|
|
1463
|
-
type:
|
|
1464
|
-
id:
|
|
1465
|
-
text:
|
|
1469
|
+
z14.object({
|
|
1470
|
+
type: z14.literal("agentMessage"),
|
|
1471
|
+
id: z14.string(),
|
|
1472
|
+
text: z14.string(),
|
|
1466
1473
|
...itemPresentationField,
|
|
1467
|
-
parentToolCallId:
|
|
1474
|
+
parentToolCallId: z14.string().optional()
|
|
1468
1475
|
}),
|
|
1469
|
-
|
|
1470
|
-
type:
|
|
1471
|
-
id:
|
|
1472
|
-
command:
|
|
1473
|
-
cwd:
|
|
1476
|
+
z14.object({
|
|
1477
|
+
type: z14.literal("commandExecution"),
|
|
1478
|
+
id: z14.string(),
|
|
1479
|
+
command: z14.string(),
|
|
1480
|
+
cwd: z14.string(),
|
|
1474
1481
|
status: threadEventItemStatusSchema,
|
|
1475
1482
|
approvalStatus: threadEventItemApprovalStatusSchema,
|
|
1476
|
-
aggregatedOutput:
|
|
1477
|
-
exitCode:
|
|
1478
|
-
durationMs:
|
|
1483
|
+
aggregatedOutput: z14.string().optional(),
|
|
1484
|
+
exitCode: z14.number().optional(),
|
|
1485
|
+
durationMs: z14.number().optional(),
|
|
1479
1486
|
truncation: threadEventItemTruncationSchema.optional(),
|
|
1480
1487
|
...itemPresentationField,
|
|
1481
|
-
parentToolCallId:
|
|
1488
|
+
parentToolCallId: z14.string().optional()
|
|
1482
1489
|
}),
|
|
1483
|
-
|
|
1484
|
-
type:
|
|
1485
|
-
id:
|
|
1486
|
-
changes:
|
|
1490
|
+
z14.object({
|
|
1491
|
+
type: z14.literal("fileChange"),
|
|
1492
|
+
id: z14.string(),
|
|
1493
|
+
changes: z14.array(threadEventFileChangeSchema),
|
|
1487
1494
|
status: threadEventItemStatusSchema,
|
|
1488
1495
|
approvalStatus: threadEventItemApprovalStatusSchema,
|
|
1489
1496
|
...itemPresentationField,
|
|
1490
|
-
parentToolCallId:
|
|
1497
|
+
parentToolCallId: z14.string().optional()
|
|
1491
1498
|
}),
|
|
1492
1499
|
threadEventWebSearchItemSchema,
|
|
1493
1500
|
threadEventWebFetchItemSchema,
|
|
@@ -1495,264 +1502,264 @@ var threadEventItemSchema = z13.discriminatedUnion("type", [
|
|
|
1495
1502
|
threadEventImageGenerationItemSchema,
|
|
1496
1503
|
threadEventFileReadItemSchema,
|
|
1497
1504
|
threadEventSearchItemSchema,
|
|
1498
|
-
|
|
1499
|
-
type:
|
|
1500
|
-
id:
|
|
1501
|
-
server:
|
|
1502
|
-
tool:
|
|
1503
|
-
arguments:
|
|
1505
|
+
z14.object({
|
|
1506
|
+
type: z14.literal("toolCall"),
|
|
1507
|
+
id: z14.string(),
|
|
1508
|
+
server: z14.string().optional(),
|
|
1509
|
+
tool: z14.string(),
|
|
1510
|
+
arguments: z14.record(z14.string(), z14.unknown()).optional(),
|
|
1504
1511
|
status: threadEventItemStatusSchema,
|
|
1505
|
-
result:
|
|
1506
|
-
error:
|
|
1507
|
-
durationMs:
|
|
1512
|
+
result: z14.unknown().optional(),
|
|
1513
|
+
error: z14.string().optional(),
|
|
1514
|
+
durationMs: z14.number().optional(),
|
|
1508
1515
|
truncation: threadEventItemTruncationSchema.optional(),
|
|
1509
1516
|
...itemPresentationField,
|
|
1510
|
-
parentToolCallId:
|
|
1517
|
+
parentToolCallId: z14.string().optional()
|
|
1511
1518
|
}),
|
|
1512
|
-
|
|
1513
|
-
type:
|
|
1514
|
-
id:
|
|
1515
|
-
summary:
|
|
1516
|
-
content:
|
|
1519
|
+
z14.object({
|
|
1520
|
+
type: z14.literal("reasoning"),
|
|
1521
|
+
id: z14.string(),
|
|
1522
|
+
summary: z14.array(z14.string()),
|
|
1523
|
+
content: z14.array(z14.string()),
|
|
1517
1524
|
...itemPresentationField,
|
|
1518
|
-
parentToolCallId:
|
|
1525
|
+
parentToolCallId: z14.string().optional()
|
|
1519
1526
|
}),
|
|
1520
|
-
|
|
1521
|
-
type:
|
|
1522
|
-
id:
|
|
1523
|
-
text:
|
|
1527
|
+
z14.object({
|
|
1528
|
+
type: z14.literal("plan"),
|
|
1529
|
+
id: z14.string(),
|
|
1530
|
+
text: z14.string(),
|
|
1524
1531
|
...itemPresentationField,
|
|
1525
|
-
parentToolCallId:
|
|
1532
|
+
parentToolCallId: z14.string().optional()
|
|
1526
1533
|
}),
|
|
1527
1534
|
threadEventPlanStepsItemSchema,
|
|
1528
|
-
|
|
1529
|
-
type:
|
|
1530
|
-
id:
|
|
1535
|
+
z14.object({
|
|
1536
|
+
type: z14.literal("contextCompaction"),
|
|
1537
|
+
id: z14.string(),
|
|
1531
1538
|
...itemPresentationField,
|
|
1532
|
-
parentToolCallId:
|
|
1539
|
+
parentToolCallId: z14.string().optional()
|
|
1533
1540
|
}),
|
|
1534
1541
|
threadEventBackgroundTaskItemSchema,
|
|
1535
1542
|
threadEventDelegationItemSchema,
|
|
1536
1543
|
threadEventExtensionItemSchema
|
|
1537
1544
|
]);
|
|
1538
1545
|
function itemTextDeltaEventSchema(type) {
|
|
1539
|
-
return
|
|
1540
|
-
type:
|
|
1541
|
-
threadId:
|
|
1542
|
-
providerThreadId:
|
|
1543
|
-
itemId:
|
|
1544
|
-
delta:
|
|
1545
|
-
parentToolCallId:
|
|
1546
|
+
return z14.object({
|
|
1547
|
+
type: z14.literal(type),
|
|
1548
|
+
threadId: z14.string(),
|
|
1549
|
+
providerThreadId: z14.string(),
|
|
1550
|
+
itemId: z14.string(),
|
|
1551
|
+
delta: z14.string(),
|
|
1552
|
+
parentToolCallId: z14.string().optional()
|
|
1546
1553
|
});
|
|
1547
1554
|
}
|
|
1548
|
-
var unscopedProviderEventSchema =
|
|
1549
|
-
|
|
1550
|
-
type:
|
|
1551
|
-
threadId:
|
|
1555
|
+
var unscopedProviderEventSchema = z14.discriminatedUnion("type", [
|
|
1556
|
+
z14.object({
|
|
1557
|
+
type: z14.literal("thread/started"),
|
|
1558
|
+
threadId: z14.string()
|
|
1552
1559
|
}),
|
|
1553
|
-
|
|
1554
|
-
type:
|
|
1555
|
-
threadId:
|
|
1556
|
-
providerThreadId:
|
|
1560
|
+
z14.object({
|
|
1561
|
+
type: z14.literal("thread/identity"),
|
|
1562
|
+
threadId: z14.string(),
|
|
1563
|
+
providerThreadId: z14.string()
|
|
1557
1564
|
}),
|
|
1558
|
-
|
|
1559
|
-
type:
|
|
1560
|
-
threadId:
|
|
1561
|
-
providerThreadId:
|
|
1562
|
-
parentToolCallId:
|
|
1565
|
+
z14.object({
|
|
1566
|
+
type: z14.literal("turn/started"),
|
|
1567
|
+
threadId: z14.string(),
|
|
1568
|
+
providerThreadId: z14.string(),
|
|
1569
|
+
parentToolCallId: z14.string().optional()
|
|
1563
1570
|
}),
|
|
1564
|
-
|
|
1565
|
-
type:
|
|
1566
|
-
threadId:
|
|
1567
|
-
providerThreadId:
|
|
1571
|
+
z14.object({
|
|
1572
|
+
type: z14.literal("turn/completed"),
|
|
1573
|
+
threadId: z14.string(),
|
|
1574
|
+
providerThreadId: z14.string().nullable(),
|
|
1568
1575
|
status: threadEventTurnStatusSchema,
|
|
1569
|
-
error:
|
|
1570
|
-
providerCheckpointId:
|
|
1576
|
+
error: z14.object({ message: z14.string() }).optional(),
|
|
1577
|
+
providerCheckpointId: z14.string().min(1).optional()
|
|
1571
1578
|
}),
|
|
1572
|
-
|
|
1573
|
-
type:
|
|
1574
|
-
threadId:
|
|
1575
|
-
providerThreadId:
|
|
1579
|
+
z14.object({
|
|
1580
|
+
type: z14.literal("turn/input/accepted"),
|
|
1581
|
+
threadId: z14.string(),
|
|
1582
|
+
providerThreadId: z14.string(),
|
|
1576
1583
|
clientRequestId: clientTurnRequestIdSchema,
|
|
1577
1584
|
scope: threadEventScopeSchema
|
|
1578
1585
|
}).strict(),
|
|
1579
|
-
|
|
1580
|
-
type:
|
|
1581
|
-
threadId:
|
|
1582
|
-
providerThreadId:
|
|
1583
|
-
threadName:
|
|
1586
|
+
z14.object({
|
|
1587
|
+
type: z14.literal("thread/name/updated"),
|
|
1588
|
+
threadId: z14.string(),
|
|
1589
|
+
providerThreadId: z14.string(),
|
|
1590
|
+
threadName: z14.string()
|
|
1584
1591
|
}),
|
|
1585
|
-
|
|
1586
|
-
type:
|
|
1587
|
-
threadId:
|
|
1588
|
-
providerThreadId:
|
|
1592
|
+
z14.object({
|
|
1593
|
+
type: z14.literal("thread/compacted"),
|
|
1594
|
+
threadId: z14.string(),
|
|
1595
|
+
providerThreadId: z14.string()
|
|
1589
1596
|
}),
|
|
1590
|
-
|
|
1591
|
-
type:
|
|
1592
|
-
threadId:
|
|
1593
|
-
providerThreadId:
|
|
1597
|
+
z14.object({
|
|
1598
|
+
type: z14.literal("thread/context/cleared"),
|
|
1599
|
+
threadId: z14.string(),
|
|
1600
|
+
providerThreadId: z14.string()
|
|
1594
1601
|
}),
|
|
1595
|
-
|
|
1596
|
-
type:
|
|
1597
|
-
threadId:
|
|
1598
|
-
providerThreadId:
|
|
1599
|
-
objective:
|
|
1602
|
+
z14.object({
|
|
1603
|
+
type: z14.literal("thread/goal/updated"),
|
|
1604
|
+
threadId: z14.string(),
|
|
1605
|
+
providerThreadId: z14.string(),
|
|
1606
|
+
objective: z14.string(),
|
|
1600
1607
|
status: threadTimelineGoalStatusSchema,
|
|
1601
|
-
tokenBudget:
|
|
1602
|
-
tokensUsed:
|
|
1603
|
-
timeUsedSeconds:
|
|
1608
|
+
tokenBudget: z14.number().nullable(),
|
|
1609
|
+
tokensUsed: z14.number(),
|
|
1610
|
+
timeUsedSeconds: z14.number()
|
|
1604
1611
|
}),
|
|
1605
|
-
|
|
1606
|
-
type:
|
|
1607
|
-
threadId:
|
|
1608
|
-
providerThreadId:
|
|
1612
|
+
z14.object({
|
|
1613
|
+
type: z14.literal("thread/goal/cleared"),
|
|
1614
|
+
threadId: z14.string(),
|
|
1615
|
+
providerThreadId: z14.string()
|
|
1609
1616
|
}),
|
|
1610
|
-
|
|
1611
|
-
type:
|
|
1612
|
-
threadId:
|
|
1613
|
-
providerThreadId:
|
|
1617
|
+
z14.object({
|
|
1618
|
+
type: z14.literal("item/started"),
|
|
1619
|
+
threadId: z14.string(),
|
|
1620
|
+
providerThreadId: z14.string(),
|
|
1614
1621
|
item: threadEventItemSchema
|
|
1615
1622
|
}),
|
|
1616
|
-
|
|
1617
|
-
type:
|
|
1618
|
-
threadId:
|
|
1619
|
-
providerThreadId:
|
|
1623
|
+
z14.object({
|
|
1624
|
+
type: z14.literal("item/completed"),
|
|
1625
|
+
threadId: z14.string(),
|
|
1626
|
+
providerThreadId: z14.string(),
|
|
1620
1627
|
item: threadEventItemSchema
|
|
1621
1628
|
}),
|
|
1622
1629
|
itemTextDeltaEventSchema("item/agentMessage/delta"),
|
|
1623
|
-
|
|
1624
|
-
type:
|
|
1625
|
-
threadId:
|
|
1626
|
-
providerThreadId:
|
|
1627
|
-
itemId:
|
|
1628
|
-
delta:
|
|
1629
|
-
reset:
|
|
1630
|
-
parentToolCallId:
|
|
1630
|
+
z14.object({
|
|
1631
|
+
type: z14.literal("item/commandExecution/outputDelta"),
|
|
1632
|
+
threadId: z14.string(),
|
|
1633
|
+
providerThreadId: z14.string(),
|
|
1634
|
+
itemId: z14.string(),
|
|
1635
|
+
delta: z14.string(),
|
|
1636
|
+
reset: z14.boolean().optional(),
|
|
1637
|
+
parentToolCallId: z14.string().optional()
|
|
1631
1638
|
}),
|
|
1632
1639
|
itemTextDeltaEventSchema("item/fileChange/outputDelta"),
|
|
1633
1640
|
itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
|
|
1634
1641
|
itemTextDeltaEventSchema("item/reasoning/textDelta"),
|
|
1635
1642
|
itemTextDeltaEventSchema("item/plan/delta"),
|
|
1636
|
-
|
|
1637
|
-
type:
|
|
1638
|
-
threadId:
|
|
1639
|
-
providerThreadId:
|
|
1640
|
-
itemId:
|
|
1641
|
-
message:
|
|
1642
|
-
parentToolCallId:
|
|
1643
|
+
z14.object({
|
|
1644
|
+
type: z14.literal("item/mcpToolCall/progress"),
|
|
1645
|
+
threadId: z14.string(),
|
|
1646
|
+
providerThreadId: z14.string(),
|
|
1647
|
+
itemId: z14.string(),
|
|
1648
|
+
message: z14.string().optional(),
|
|
1649
|
+
parentToolCallId: z14.string().optional()
|
|
1643
1650
|
}),
|
|
1644
1651
|
toolCallProgressEventSchema,
|
|
1645
|
-
|
|
1646
|
-
type:
|
|
1647
|
-
threadId:
|
|
1648
|
-
providerThreadId:
|
|
1652
|
+
z14.object({
|
|
1653
|
+
type: z14.literal("item/backgroundTask/progress"),
|
|
1654
|
+
threadId: z14.string(),
|
|
1655
|
+
providerThreadId: z14.string(),
|
|
1649
1656
|
item: threadEventBackgroundTaskItemSchema
|
|
1650
1657
|
}),
|
|
1651
|
-
|
|
1652
|
-
type:
|
|
1653
|
-
threadId:
|
|
1654
|
-
providerThreadId:
|
|
1658
|
+
z14.object({
|
|
1659
|
+
type: z14.literal("item/backgroundTask/completed"),
|
|
1660
|
+
threadId: z14.string(),
|
|
1661
|
+
providerThreadId: z14.string(),
|
|
1655
1662
|
item: threadEventBackgroundTaskItemSchema
|
|
1656
1663
|
}),
|
|
1657
|
-
|
|
1658
|
-
type:
|
|
1659
|
-
threadId:
|
|
1660
|
-
providerThreadId:
|
|
1664
|
+
z14.object({
|
|
1665
|
+
type: z14.literal("item/delegation/progress"),
|
|
1666
|
+
threadId: z14.string(),
|
|
1667
|
+
providerThreadId: z14.string(),
|
|
1661
1668
|
item: threadEventDelegationItemSchema
|
|
1662
1669
|
}),
|
|
1663
|
-
|
|
1664
|
-
type:
|
|
1665
|
-
threadId:
|
|
1666
|
-
providerThreadId:
|
|
1670
|
+
z14.object({
|
|
1671
|
+
type: z14.literal("item/delegation/completed"),
|
|
1672
|
+
threadId: z14.string(),
|
|
1673
|
+
providerThreadId: z14.string(),
|
|
1667
1674
|
item: threadEventDelegationItemSchema
|
|
1668
1675
|
}),
|
|
1669
|
-
|
|
1670
|
-
type:
|
|
1671
|
-
threadId:
|
|
1672
|
-
providerThreadId:
|
|
1676
|
+
z14.object({
|
|
1677
|
+
type: z14.literal("thread/tokenUsage/updated"),
|
|
1678
|
+
threadId: z14.string(),
|
|
1679
|
+
providerThreadId: z14.string(),
|
|
1673
1680
|
tokenUsage: threadEventTokenUsageSchema
|
|
1674
1681
|
}),
|
|
1675
|
-
|
|
1676
|
-
type:
|
|
1677
|
-
threadId:
|
|
1678
|
-
providerThreadId:
|
|
1682
|
+
z14.object({
|
|
1683
|
+
type: z14.literal("thread/contextWindowUsage/updated"),
|
|
1684
|
+
threadId: z14.string(),
|
|
1685
|
+
providerThreadId: z14.string(),
|
|
1679
1686
|
contextWindowUsage: threadEventContextWindowUsageSchema
|
|
1680
1687
|
}),
|
|
1681
|
-
|
|
1682
|
-
type:
|
|
1683
|
-
threadId:
|
|
1684
|
-
providerThreadId:
|
|
1685
|
-
plan:
|
|
1686
|
-
explanation:
|
|
1688
|
+
z14.object({
|
|
1689
|
+
type: z14.literal("turn/plan/updated"),
|
|
1690
|
+
threadId: z14.string(),
|
|
1691
|
+
providerThreadId: z14.string(),
|
|
1692
|
+
plan: z14.array(threadEventPlanStepSchema),
|
|
1693
|
+
explanation: z14.string().optional()
|
|
1687
1694
|
}),
|
|
1688
|
-
|
|
1689
|
-
type:
|
|
1690
|
-
threadId:
|
|
1691
|
-
providerThreadId:
|
|
1692
|
-
diff:
|
|
1695
|
+
z14.object({
|
|
1696
|
+
type: z14.literal("turn/diff/updated"),
|
|
1697
|
+
threadId: z14.string(),
|
|
1698
|
+
providerThreadId: z14.string(),
|
|
1699
|
+
diff: z14.string().optional()
|
|
1693
1700
|
}),
|
|
1694
|
-
|
|
1695
|
-
type:
|
|
1696
|
-
threadId:
|
|
1697
|
-
providerThreadId:
|
|
1698
|
-
message:
|
|
1699
|
-
detail:
|
|
1700
|
-
willRetry:
|
|
1701
|
+
z14.object({
|
|
1702
|
+
type: z14.literal("provider/error"),
|
|
1703
|
+
threadId: z14.string(),
|
|
1704
|
+
providerThreadId: z14.string(),
|
|
1705
|
+
message: z14.string(),
|
|
1706
|
+
detail: z14.string().optional(),
|
|
1707
|
+
willRetry: z14.boolean().optional(),
|
|
1701
1708
|
errorInfo: providerErrorInfoSchema.optional()
|
|
1702
1709
|
}),
|
|
1703
|
-
|
|
1704
|
-
type:
|
|
1705
|
-
threadId:
|
|
1706
|
-
providerThreadId:
|
|
1710
|
+
z14.object({
|
|
1711
|
+
type: z14.literal("provider/rateLimits/updated"),
|
|
1712
|
+
threadId: z14.string(),
|
|
1713
|
+
providerThreadId: z14.string(),
|
|
1707
1714
|
rateLimits: providerRateLimitStateSchema
|
|
1708
1715
|
}),
|
|
1709
|
-
|
|
1710
|
-
type:
|
|
1711
|
-
threadId:
|
|
1712
|
-
providerThreadId:
|
|
1713
|
-
entries:
|
|
1714
|
-
|
|
1715
|
-
name:
|
|
1716
|
-
source:
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1716
|
+
z14.object({
|
|
1717
|
+
type: z14.literal("provider.env-resolved"),
|
|
1718
|
+
threadId: z14.string(),
|
|
1719
|
+
providerThreadId: z14.string(),
|
|
1720
|
+
entries: z14.array(
|
|
1721
|
+
z14.object({
|
|
1722
|
+
name: z14.string(),
|
|
1723
|
+
source: z14.union([
|
|
1724
|
+
z14.literal("shell"),
|
|
1725
|
+
z14.object({ plugin: z14.string() }).strict(),
|
|
1726
|
+
z14.object({ core: z14.enum(["machine-git", "machine-environment"]) }).strict()
|
|
1720
1727
|
]),
|
|
1721
|
-
value:
|
|
1722
|
-
|
|
1723
|
-
|
|
1728
|
+
value: z14.union([
|
|
1729
|
+
z14.string(),
|
|
1730
|
+
z14.object({ masked: z14.literal(true) }).strict()
|
|
1724
1731
|
]),
|
|
1725
|
-
reason:
|
|
1732
|
+
reason: z14.string().optional()
|
|
1726
1733
|
}).strict()
|
|
1727
1734
|
)
|
|
1728
1735
|
}),
|
|
1729
|
-
|
|
1730
|
-
type:
|
|
1731
|
-
threadId:
|
|
1732
|
-
providerThreadId:
|
|
1736
|
+
z14.object({
|
|
1737
|
+
type: z14.literal("thread/extensionState/updated"),
|
|
1738
|
+
threadId: z14.string(),
|
|
1739
|
+
providerThreadId: z14.string(),
|
|
1733
1740
|
kind: extensionKindSchema,
|
|
1734
1741
|
payload: jsonValueSchema
|
|
1735
1742
|
}),
|
|
1736
|
-
|
|
1737
|
-
type:
|
|
1738
|
-
threadId:
|
|
1739
|
-
providerThreadId:
|
|
1743
|
+
z14.object({
|
|
1744
|
+
type: z14.literal("provider/warning"),
|
|
1745
|
+
threadId: z14.string(),
|
|
1746
|
+
providerThreadId: z14.string(),
|
|
1740
1747
|
category: threadEventWarningCategorySchema,
|
|
1741
|
-
summary:
|
|
1742
|
-
details:
|
|
1748
|
+
summary: z14.string().optional(),
|
|
1749
|
+
details: z14.string().optional()
|
|
1743
1750
|
}),
|
|
1744
|
-
|
|
1745
|
-
type:
|
|
1746
|
-
threadId:
|
|
1747
|
-
providerThreadId:
|
|
1748
|
-
originalModel:
|
|
1749
|
-
fallbackModel:
|
|
1750
|
-
reason:
|
|
1751
|
-
message:
|
|
1751
|
+
z14.object({
|
|
1752
|
+
type: z14.literal("provider/modelFallback"),
|
|
1753
|
+
threadId: z14.string(),
|
|
1754
|
+
providerThreadId: z14.string(),
|
|
1755
|
+
originalModel: z14.string().min(1),
|
|
1756
|
+
fallbackModel: z14.string().min(1),
|
|
1757
|
+
reason: z14.enum(["refusal", "provider"]),
|
|
1758
|
+
message: z14.string()
|
|
1752
1759
|
}),
|
|
1753
1760
|
providerUnhandledEventSchema
|
|
1754
1761
|
]);
|
|
1755
|
-
var scopedEventDataSchema =
|
|
1762
|
+
var scopedEventDataSchema = z14.object({
|
|
1756
1763
|
scope: threadEventScopeSchema
|
|
1757
1764
|
});
|
|
1758
1765
|
var providerEventSchema = unscopedProviderEventSchema.and(
|
|
@@ -1761,58 +1768,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
|
|
|
1761
1768
|
var providerEventTypeValues = unscopedProviderEventSchema.options.map(
|
|
1762
1769
|
(option) => option.shape.type.value
|
|
1763
1770
|
);
|
|
1764
|
-
var unscopedSystemEventSchema =
|
|
1765
|
-
|
|
1766
|
-
type:
|
|
1767
|
-
threadId:
|
|
1771
|
+
var unscopedSystemEventSchema = z14.discriminatedUnion("type", [
|
|
1772
|
+
z14.object({
|
|
1773
|
+
type: z14.literal("client/thread/start"),
|
|
1774
|
+
threadId: z14.string()
|
|
1768
1775
|
}).merge(clientTurnLifecycleEventDataSchema),
|
|
1769
|
-
|
|
1770
|
-
type:
|
|
1771
|
-
threadId:
|
|
1776
|
+
z14.object({
|
|
1777
|
+
type: z14.literal("client/turn/requested"),
|
|
1778
|
+
threadId: z14.string()
|
|
1772
1779
|
}).merge(turnRequestEventDataSchema),
|
|
1773
|
-
|
|
1774
|
-
type:
|
|
1775
|
-
threadId:
|
|
1780
|
+
z14.object({
|
|
1781
|
+
type: z14.literal("client/turn/rejected"),
|
|
1782
|
+
threadId: z14.string()
|
|
1776
1783
|
}).merge(turnRequestRejectedEventDataSchema),
|
|
1777
|
-
|
|
1778
|
-
type:
|
|
1779
|
-
threadId:
|
|
1784
|
+
z14.object({
|
|
1785
|
+
type: z14.literal("client/turn/start"),
|
|
1786
|
+
threadId: z14.string()
|
|
1780
1787
|
}).merge(clientTurnLifecycleEventDataSchema),
|
|
1781
|
-
|
|
1782
|
-
type:
|
|
1783
|
-
threadId:
|
|
1788
|
+
z14.object({
|
|
1789
|
+
type: z14.literal("system/error"),
|
|
1790
|
+
threadId: z14.string()
|
|
1784
1791
|
}).merge(systemErrorEventDataSchema),
|
|
1785
|
-
|
|
1786
|
-
type:
|
|
1787
|
-
threadId:
|
|
1792
|
+
z14.object({
|
|
1793
|
+
type: z14.literal("system/manager/user_message"),
|
|
1794
|
+
threadId: z14.string()
|
|
1788
1795
|
}).merge(systemLegacyUserMessageEventDataSchema),
|
|
1789
|
-
|
|
1790
|
-
type:
|
|
1791
|
-
threadId:
|
|
1796
|
+
z14.object({
|
|
1797
|
+
type: z14.literal("system/thread/interrupted"),
|
|
1798
|
+
threadId: z14.string()
|
|
1792
1799
|
}).merge(systemThreadInterruptedEventDataSchema),
|
|
1793
|
-
|
|
1794
|
-
type:
|
|
1795
|
-
threadId:
|
|
1800
|
+
z14.object({
|
|
1801
|
+
type: z14.literal("system/operation"),
|
|
1802
|
+
threadId: z14.string()
|
|
1796
1803
|
}).merge(systemOperationEventDataSchema),
|
|
1797
|
-
|
|
1798
|
-
type:
|
|
1799
|
-
threadId:
|
|
1804
|
+
z14.object({
|
|
1805
|
+
type: z14.literal("system/interaction/lifecycle"),
|
|
1806
|
+
threadId: z14.string()
|
|
1800
1807
|
}).merge(systemInteractionLifecycleEventDataSchema),
|
|
1801
|
-
|
|
1802
|
-
type:
|
|
1803
|
-
threadId:
|
|
1808
|
+
z14.object({
|
|
1809
|
+
type: z14.literal("system/permissionGrant/lifecycle"),
|
|
1810
|
+
threadId: z14.string()
|
|
1804
1811
|
}).merge(systemPermissionGrantLifecycleEventDataSchema),
|
|
1805
|
-
|
|
1806
|
-
type:
|
|
1807
|
-
threadId:
|
|
1812
|
+
z14.object({
|
|
1813
|
+
type: z14.literal("system/userQuestion/lifecycle"),
|
|
1814
|
+
threadId: z14.string()
|
|
1808
1815
|
}).merge(systemUserQuestionLifecycleEventDataSchema),
|
|
1809
|
-
|
|
1810
|
-
type:
|
|
1811
|
-
threadId:
|
|
1816
|
+
z14.object({
|
|
1817
|
+
type: z14.literal("system/thread-provisioning"),
|
|
1818
|
+
threadId: z14.string()
|
|
1812
1819
|
}).merge(systemThreadProvisioningEventDataSchema),
|
|
1813
|
-
|
|
1814
|
-
type:
|
|
1815
|
-
threadId:
|
|
1820
|
+
z14.object({
|
|
1821
|
+
type: z14.literal("system/provider-turn-watchdog"),
|
|
1822
|
+
threadId: z14.string()
|
|
1816
1823
|
}).merge(systemProviderTurnWatchdogEventDataSchema)
|
|
1817
1824
|
]);
|
|
1818
1825
|
var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
|
|
@@ -1820,13 +1827,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
|
|
|
1820
1827
|
function isEventPropertyBag(value) {
|
|
1821
1828
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1822
1829
|
}
|
|
1823
|
-
var rejectLegacyClientRequestSequenceSchema =
|
|
1830
|
+
var rejectLegacyClientRequestSequenceSchema = z14.unknown().superRefine((value, ctx) => {
|
|
1824
1831
|
if (!isEventPropertyBag(value)) {
|
|
1825
1832
|
return;
|
|
1826
1833
|
}
|
|
1827
1834
|
if (Object.hasOwn(value, legacyClientRequestKey)) {
|
|
1828
1835
|
ctx.addIssue({
|
|
1829
|
-
code:
|
|
1836
|
+
code: z14.ZodIssueCode.custom,
|
|
1830
1837
|
message: "legacy request sequence field is no longer accepted",
|
|
1831
1838
|
path: [legacyClientRequestKey]
|
|
1832
1839
|
});
|
|
@@ -1834,21 +1841,21 @@ var rejectLegacyClientRequestSequenceSchema = z13.unknown().superRefine((value,
|
|
|
1834
1841
|
const item = value.item;
|
|
1835
1842
|
if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
|
|
1836
1843
|
ctx.addIssue({
|
|
1837
|
-
code:
|
|
1844
|
+
code: z14.ZodIssueCode.custom,
|
|
1838
1845
|
message: "legacy user-message request sequence field is no longer accepted",
|
|
1839
1846
|
path: ["item", legacyClientRequestKey]
|
|
1840
1847
|
});
|
|
1841
1848
|
}
|
|
1842
1849
|
});
|
|
1843
1850
|
var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
|
|
1844
|
-
|
|
1851
|
+
z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
1845
1852
|
const result2 = validateThreadEventScope({
|
|
1846
1853
|
type: event.type,
|
|
1847
1854
|
scope: event.scope
|
|
1848
1855
|
});
|
|
1849
1856
|
if (!result2.valid) {
|
|
1850
1857
|
ctx.addIssue({
|
|
1851
|
-
code:
|
|
1858
|
+
code: z14.ZodIssueCode.custom,
|
|
1852
1859
|
message: result2.message ?? "Invalid thread event scope",
|
|
1853
1860
|
path: ["scope"]
|
|
1854
1861
|
});
|
|
@@ -1874,7 +1881,7 @@ var threadEventTypeValues = [
|
|
|
1874
1881
|
...systemEventTypeValues
|
|
1875
1882
|
];
|
|
1876
1883
|
var threadEventTypeSet = new Set(threadEventTypeValues);
|
|
1877
|
-
var threadEventTypeSchema =
|
|
1884
|
+
var threadEventTypeSchema = z14.string().refine(
|
|
1878
1885
|
(value) => threadEventTypeSet.has(value),
|
|
1879
1886
|
"Invalid thread event type"
|
|
1880
1887
|
);
|
|
@@ -1897,95 +1904,96 @@ function parseNamespacedGlyph(glyph) {
|
|
|
1897
1904
|
}
|
|
1898
1905
|
|
|
1899
1906
|
// ../domain/src/provider-fork.ts
|
|
1900
|
-
import { z as
|
|
1907
|
+
import { z as z15 } from "zod";
|
|
1901
1908
|
var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
|
|
1902
|
-
var providerForkSchema =
|
|
1909
|
+
var providerForkSchema = z15.enum(PROVIDER_FORK_VALUES);
|
|
1903
1910
|
|
|
1904
1911
|
// ../domain/src/provider-types.ts
|
|
1905
|
-
import { z as
|
|
1906
|
-
var modelReasoningEffortSchema =
|
|
1912
|
+
import { z as z16 } from "zod";
|
|
1913
|
+
var modelReasoningEffortSchema = z16.object({
|
|
1907
1914
|
reasoningEffort: reasoningLevelSchema,
|
|
1908
|
-
description:
|
|
1909
|
-
});
|
|
1910
|
-
var availableModelSchema =
|
|
1911
|
-
id:
|
|
1912
|
-
model:
|
|
1913
|
-
displayName:
|
|
1914
|
-
routeProviderId:
|
|
1915
|
-
description:
|
|
1916
|
-
supportedReasoningEfforts:
|
|
1915
|
+
description: z16.string()
|
|
1916
|
+
});
|
|
1917
|
+
var availableModelSchema = z16.object({
|
|
1918
|
+
id: z16.string(),
|
|
1919
|
+
model: z16.string(),
|
|
1920
|
+
displayName: z16.string(),
|
|
1921
|
+
routeProviderId: z16.string().min(1).optional(),
|
|
1922
|
+
description: z16.string(),
|
|
1923
|
+
supportedReasoningEfforts: z16.array(modelReasoningEffortSchema),
|
|
1917
1924
|
defaultReasoningEffort: reasoningLevelSchema,
|
|
1918
|
-
isDefault:
|
|
1919
|
-
});
|
|
1920
|
-
var providerModelCatalogScopeSchema =
|
|
1921
|
-
var providerCapabilitiesSchema =
|
|
1922
|
-
supportsThreadArchive:
|
|
1923
|
-
supportsThreadRename:
|
|
1924
|
-
supportsServiceTier:
|
|
1925
|
-
supportsNativeUserQuestion:
|
|
1926
|
-
supportsFork:
|
|
1927
|
-
supportsSessionRewind:
|
|
1928
|
-
permissionModes:
|
|
1925
|
+
isDefault: z16.boolean()
|
|
1926
|
+
});
|
|
1927
|
+
var providerModelCatalogScopeSchema = z16.enum(["host", "workspace"]);
|
|
1928
|
+
var providerCapabilitiesSchema = z16.object({
|
|
1929
|
+
supportsThreadArchive: z16.boolean(),
|
|
1930
|
+
supportsThreadRename: z16.boolean(),
|
|
1931
|
+
supportsServiceTier: z16.boolean(),
|
|
1932
|
+
supportsNativeUserQuestion: z16.boolean(),
|
|
1933
|
+
supportsFork: z16.boolean(),
|
|
1934
|
+
supportsSessionRewind: z16.boolean(),
|
|
1935
|
+
permissionModes: z16.array(permissionModeSchema).min(1),
|
|
1929
1936
|
modelCatalogScope: providerModelCatalogScopeSchema
|
|
1930
1937
|
});
|
|
1931
|
-
var providerComposerCommandSchema =
|
|
1938
|
+
var providerComposerCommandSchema = z16.object({
|
|
1932
1939
|
trigger: promptMentionCommandTriggerSchema,
|
|
1933
|
-
name:
|
|
1934
|
-
trailingText:
|
|
1940
|
+
name: z16.string().min(1).regex(/^[^\s/$]+$/u),
|
|
1941
|
+
trailingText: z16.string().regex(/^\s*$/u)
|
|
1935
1942
|
});
|
|
1936
|
-
var providerComposerActionSchema =
|
|
1937
|
-
|
|
1938
|
-
kind:
|
|
1943
|
+
var providerComposerActionSchema = z16.discriminatedUnion("kind", [
|
|
1944
|
+
z16.object({
|
|
1945
|
+
kind: z16.literal("skills"),
|
|
1939
1946
|
trigger: promptMentionCommandTriggerSchema
|
|
1940
1947
|
}),
|
|
1941
|
-
|
|
1942
|
-
kind:
|
|
1948
|
+
z16.object({
|
|
1949
|
+
kind: z16.literal("plan"),
|
|
1943
1950
|
command: providerComposerCommandSchema
|
|
1944
1951
|
}),
|
|
1945
|
-
|
|
1946
|
-
kind:
|
|
1952
|
+
z16.object({
|
|
1953
|
+
kind: z16.literal("goal"),
|
|
1947
1954
|
command: providerComposerCommandSchema
|
|
1948
1955
|
})
|
|
1949
1956
|
]);
|
|
1950
|
-
var providerStringsSchema =
|
|
1951
|
-
signInHint:
|
|
1952
|
-
expiredHint:
|
|
1953
|
-
installUrl:
|
|
1954
|
-
brandPrefix:
|
|
1955
|
-
planModeCopy:
|
|
1956
|
-
iconTint:
|
|
1957
|
-
});
|
|
1958
|
-
var providerOptionDescriptorSchema =
|
|
1959
|
-
id:
|
|
1960
|
-
label:
|
|
1961
|
-
description:
|
|
1962
|
-
});
|
|
1963
|
-
var providerExtensionKindInfoSchema =
|
|
1964
|
-
item:
|
|
1965
|
-
state:
|
|
1966
|
-
});
|
|
1967
|
-
var providerExtensionKindsSchema =
|
|
1957
|
+
var providerStringsSchema = z16.object({
|
|
1958
|
+
signInHint: z16.string().min(1),
|
|
1959
|
+
expiredHint: z16.string().min(1),
|
|
1960
|
+
installUrl: z16.string().min(1),
|
|
1961
|
+
brandPrefix: z16.string().min(1).optional(),
|
|
1962
|
+
planModeCopy: z16.string().min(1).optional(),
|
|
1963
|
+
iconTint: z16.object({ light: z16.string().min(1), dark: z16.string().min(1) }).optional()
|
|
1964
|
+
});
|
|
1965
|
+
var providerOptionDescriptorSchema = z16.object({
|
|
1966
|
+
id: z16.string().min(1),
|
|
1967
|
+
label: z16.string().min(1),
|
|
1968
|
+
description: z16.string().min(1).optional()
|
|
1969
|
+
});
|
|
1970
|
+
var providerExtensionKindInfoSchema = z16.object({
|
|
1971
|
+
item: z16.boolean(),
|
|
1972
|
+
state: z16.boolean()
|
|
1973
|
+
});
|
|
1974
|
+
var providerExtensionKindsSchema = z16.record(
|
|
1968
1975
|
extensionKindSchema,
|
|
1969
1976
|
providerExtensionKindInfoSchema
|
|
1970
1977
|
);
|
|
1971
|
-
var providerInfoSchema =
|
|
1972
|
-
id:
|
|
1973
|
-
pluginId:
|
|
1974
|
-
displayName:
|
|
1975
|
-
family:
|
|
1976
|
-
icon:
|
|
1977
|
-
logoUrl:
|
|
1978
|
-
maintenance:
|
|
1979
|
-
health:
|
|
1980
|
-
usage:
|
|
1981
|
-
installation:
|
|
1978
|
+
var providerInfoSchema = z16.object({
|
|
1979
|
+
id: z16.string(),
|
|
1980
|
+
pluginId: z16.string().min(1),
|
|
1981
|
+
displayName: z16.string(),
|
|
1982
|
+
family: z16.string().min(1).optional(),
|
|
1983
|
+
icon: z16.object({ glyph: z16.string().min(1) }).optional(),
|
|
1984
|
+
logoUrl: z16.string().min(1).nullable(),
|
|
1985
|
+
maintenance: z16.object({
|
|
1986
|
+
health: z16.boolean(),
|
|
1987
|
+
usage: z16.boolean(),
|
|
1988
|
+
installation: z16.boolean()
|
|
1982
1989
|
}),
|
|
1983
1990
|
capabilities: providerCapabilitiesSchema,
|
|
1984
|
-
composerActions:
|
|
1985
|
-
|
|
1991
|
+
composerActions: z16.array(providerComposerActionSchema),
|
|
1992
|
+
completedTurnDisplay: completedTurnDisplaySchema,
|
|
1993
|
+
available: z16.boolean(),
|
|
1986
1994
|
strings: providerStringsSchema.optional(),
|
|
1987
|
-
serviceTiers:
|
|
1988
|
-
reasoningLevels:
|
|
1995
|
+
serviceTiers: z16.array(providerOptionDescriptorSchema).optional(),
|
|
1996
|
+
reasoningLevels: z16.array(providerOptionDescriptorSchema).optional(),
|
|
1989
1997
|
extensionKinds: providerExtensionKindsSchema.optional()
|
|
1990
1998
|
});
|
|
1991
1999
|
var providerRecoveryKindValues = [
|
|
@@ -1995,151 +2003,151 @@ var providerRecoveryKindValues = [
|
|
|
1995
2003
|
"staleTurn",
|
|
1996
2004
|
"rateLimited"
|
|
1997
2005
|
];
|
|
1998
|
-
var providerRecoveryKindSchema =
|
|
1999
|
-
var toolCallOutputItemSchema =
|
|
2000
|
-
|
|
2001
|
-
type:
|
|
2002
|
-
text:
|
|
2006
|
+
var providerRecoveryKindSchema = z16.enum(providerRecoveryKindValues);
|
|
2007
|
+
var toolCallOutputItemSchema = z16.discriminatedUnion("type", [
|
|
2008
|
+
z16.object({
|
|
2009
|
+
type: z16.literal("inputText"),
|
|
2010
|
+
text: z16.string()
|
|
2003
2011
|
}),
|
|
2004
|
-
|
|
2005
|
-
type:
|
|
2006
|
-
imageUrl:
|
|
2012
|
+
z16.object({
|
|
2013
|
+
type: z16.literal("inputImage"),
|
|
2014
|
+
imageUrl: z16.string()
|
|
2007
2015
|
})
|
|
2008
2016
|
]);
|
|
2009
|
-
var toolCallRequestSchema =
|
|
2010
|
-
requestId:
|
|
2011
|
-
threadId:
|
|
2012
|
-
providerThreadId:
|
|
2013
|
-
turnId:
|
|
2014
|
-
callId:
|
|
2015
|
-
tool:
|
|
2016
|
-
arguments:
|
|
2017
|
-
});
|
|
2018
|
-
var toolCallResponseSchema =
|
|
2019
|
-
contentItems:
|
|
2020
|
-
success:
|
|
2021
|
-
});
|
|
2022
|
-
var dynamicToolSchema =
|
|
2023
|
-
name:
|
|
2024
|
-
description:
|
|
2025
|
-
inputSchema:
|
|
2017
|
+
var toolCallRequestSchema = z16.object({
|
|
2018
|
+
requestId: z16.union([z16.string().min(1), z16.number()]),
|
|
2019
|
+
threadId: z16.string().min(1),
|
|
2020
|
+
providerThreadId: z16.string().min(1),
|
|
2021
|
+
turnId: z16.string().min(1),
|
|
2022
|
+
callId: z16.string().min(1),
|
|
2023
|
+
tool: z16.string().min(1),
|
|
2024
|
+
arguments: z16.unknown().optional()
|
|
2025
|
+
});
|
|
2026
|
+
var toolCallResponseSchema = z16.object({
|
|
2027
|
+
contentItems: z16.array(toolCallOutputItemSchema),
|
|
2028
|
+
success: z16.boolean()
|
|
2029
|
+
});
|
|
2030
|
+
var dynamicToolSchema = z16.object({
|
|
2031
|
+
name: z16.string(),
|
|
2032
|
+
description: z16.string(),
|
|
2033
|
+
inputSchema: z16.unknown(),
|
|
2026
2034
|
presentation: threadEventItemPresentationSchema.optional()
|
|
2027
2035
|
});
|
|
2028
2036
|
|
|
2029
2037
|
// ../provider-bridge-protocol/src/thread-delta.ts
|
|
2030
|
-
import { z as
|
|
2038
|
+
import { z as z17 } from "zod";
|
|
2031
2039
|
var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
|
|
2032
2040
|
var deltaPresentationSchema = threadEventItemPresentationSchema;
|
|
2033
2041
|
var THREAD_DELTA_KEY_SEPARATOR = "";
|
|
2034
|
-
var deltaKeyPartSchema =
|
|
2042
|
+
var deltaKeyPartSchema = z17.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
|
|
2035
2043
|
message: "provider keys must not contain the internal key separator (\\u001f)"
|
|
2036
2044
|
});
|
|
2037
|
-
var deltaItemKeySchema =
|
|
2045
|
+
var deltaItemKeySchema = z17.object({
|
|
2038
2046
|
providerItemId: deltaKeyPartSchema.optional(),
|
|
2039
2047
|
channel: deltaKeyPartSchema.optional(),
|
|
2040
2048
|
parentRef: deltaKeyPartSchema.optional()
|
|
2041
2049
|
});
|
|
2042
2050
|
var providerTurnIdSchema = deltaKeyPartSchema;
|
|
2043
|
-
var deltaFileChangeSchema =
|
|
2044
|
-
path:
|
|
2045
|
-
kind:
|
|
2046
|
-
movePath:
|
|
2047
|
-
diff:
|
|
2048
|
-
oldText:
|
|
2049
|
-
newText:
|
|
2050
|
-
});
|
|
2051
|
-
var deltaBackgroundTaskShapeSchema =
|
|
2052
|
-
type:
|
|
2053
|
-
familyId:
|
|
2054
|
-
taskType:
|
|
2055
|
-
description:
|
|
2051
|
+
var deltaFileChangeSchema = z17.object({
|
|
2052
|
+
path: z17.string(),
|
|
2053
|
+
kind: z17.enum(["add", "update", "delete"]),
|
|
2054
|
+
movePath: z17.string().optional(),
|
|
2055
|
+
diff: z17.string().optional(),
|
|
2056
|
+
oldText: z17.string().optional(),
|
|
2057
|
+
newText: z17.string().optional()
|
|
2058
|
+
});
|
|
2059
|
+
var deltaBackgroundTaskShapeSchema = z17.object({
|
|
2060
|
+
type: z17.literal("backgroundTask"),
|
|
2061
|
+
familyId: z17.string().min(1),
|
|
2062
|
+
taskType: z17.string(),
|
|
2063
|
+
description: z17.string(),
|
|
2056
2064
|
status: threadEventItemStatusSchema,
|
|
2057
2065
|
taskStatus: backgroundTaskStatusSchema,
|
|
2058
|
-
skipTranscript:
|
|
2059
|
-
workflowName:
|
|
2066
|
+
skipTranscript: z17.boolean(),
|
|
2067
|
+
workflowName: z17.string().optional(),
|
|
2060
2068
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2061
2069
|
usage: backgroundTaskUsageSchema.optional(),
|
|
2062
|
-
summary:
|
|
2063
|
-
error:
|
|
2064
|
-
outputFile:
|
|
2070
|
+
summary: z17.string().optional(),
|
|
2071
|
+
error: z17.string().optional(),
|
|
2072
|
+
outputFile: z17.string().optional()
|
|
2065
2073
|
});
|
|
2066
|
-
var deltaFileReadShapeSchema =
|
|
2067
|
-
type:
|
|
2068
|
-
path:
|
|
2069
|
-
cmd:
|
|
2074
|
+
var deltaFileReadShapeSchema = z17.object({
|
|
2075
|
+
type: z17.literal("fileRead"),
|
|
2076
|
+
path: z17.string(),
|
|
2077
|
+
cmd: z17.string().optional()
|
|
2070
2078
|
});
|
|
2071
|
-
var deltaSearchShapeSchema =
|
|
2072
|
-
type:
|
|
2079
|
+
var deltaSearchShapeSchema = z17.object({
|
|
2080
|
+
type: z17.literal("search"),
|
|
2073
2081
|
mode: threadEventSearchModeSchema,
|
|
2074
|
-
query:
|
|
2075
|
-
path:
|
|
2076
|
-
cmd:
|
|
2082
|
+
query: z17.string(),
|
|
2083
|
+
path: z17.string().optional(),
|
|
2084
|
+
cmd: z17.string().optional()
|
|
2077
2085
|
});
|
|
2078
|
-
var deltaDelegationShapeSchema =
|
|
2079
|
-
type:
|
|
2086
|
+
var deltaDelegationShapeSchema = z17.object({
|
|
2087
|
+
type: z17.literal("delegation"),
|
|
2080
2088
|
childRef: deltaKeyPartSchema,
|
|
2081
|
-
label:
|
|
2082
|
-
background:
|
|
2083
|
-
summary:
|
|
2089
|
+
label: z17.string(),
|
|
2090
|
+
background: z17.boolean(),
|
|
2091
|
+
summary: z17.string().optional()
|
|
2084
2092
|
});
|
|
2085
|
-
var deltaPlanStepsShapeSchema =
|
|
2086
|
-
type:
|
|
2087
|
-
steps:
|
|
2088
|
-
explanation:
|
|
2093
|
+
var deltaPlanStepsShapeSchema = z17.object({
|
|
2094
|
+
type: z17.literal("planSteps"),
|
|
2095
|
+
steps: z17.array(threadEventPlanStepSchema),
|
|
2096
|
+
explanation: z17.string().optional()
|
|
2089
2097
|
});
|
|
2090
|
-
var deltaExtensionShapeSchema =
|
|
2091
|
-
type:
|
|
2098
|
+
var deltaExtensionShapeSchema = z17.object({
|
|
2099
|
+
type: z17.literal("extension"),
|
|
2092
2100
|
kind: extensionKindSchema,
|
|
2093
2101
|
payload: jsonValueSchema
|
|
2094
2102
|
});
|
|
2095
|
-
var deltaItemShapeSchema =
|
|
2096
|
-
|
|
2097
|
-
type:
|
|
2098
|
-
command:
|
|
2099
|
-
cwd:
|
|
2100
|
-
aggregatedOutput:
|
|
2101
|
-
exitCode:
|
|
2102
|
-
durationMs:
|
|
2103
|
+
var deltaItemShapeSchema = z17.discriminatedUnion("type", [
|
|
2104
|
+
z17.object({
|
|
2105
|
+
type: z17.literal("command"),
|
|
2106
|
+
command: z17.string(),
|
|
2107
|
+
cwd: z17.string(),
|
|
2108
|
+
aggregatedOutput: z17.string().optional(),
|
|
2109
|
+
exitCode: z17.number().optional(),
|
|
2110
|
+
durationMs: z17.number().optional()
|
|
2103
2111
|
}),
|
|
2104
|
-
|
|
2105
|
-
type:
|
|
2106
|
-
changes:
|
|
2112
|
+
z17.object({
|
|
2113
|
+
type: z17.literal("fileChange"),
|
|
2114
|
+
changes: z17.array(deltaFileChangeSchema)
|
|
2107
2115
|
}),
|
|
2108
|
-
|
|
2109
|
-
type:
|
|
2110
|
-
tool:
|
|
2111
|
-
server:
|
|
2112
|
-
args:
|
|
2113
|
-
result:
|
|
2114
|
-
error:
|
|
2115
|
-
durationMs:
|
|
2116
|
+
z17.object({
|
|
2117
|
+
type: z17.literal("tool"),
|
|
2118
|
+
tool: z17.string(),
|
|
2119
|
+
server: z17.string().optional(),
|
|
2120
|
+
args: z17.unknown().optional(),
|
|
2121
|
+
result: z17.unknown().optional(),
|
|
2122
|
+
error: z17.string().optional(),
|
|
2123
|
+
durationMs: z17.number().optional()
|
|
2116
2124
|
}),
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
type:
|
|
2121
|
-
summary:
|
|
2122
|
-
content:
|
|
2125
|
+
z17.object({ type: z17.literal("compaction") }),
|
|
2126
|
+
z17.object({ type: z17.literal("agentMessage"), text: z17.string() }),
|
|
2127
|
+
z17.object({
|
|
2128
|
+
type: z17.literal("reasoning"),
|
|
2129
|
+
summary: z17.array(z17.string()),
|
|
2130
|
+
content: z17.array(z17.string())
|
|
2123
2131
|
}),
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
type:
|
|
2127
|
-
queries:
|
|
2132
|
+
z17.object({ type: z17.literal("plan"), text: z17.string() }),
|
|
2133
|
+
z17.object({
|
|
2134
|
+
type: z17.literal("webSearch"),
|
|
2135
|
+
queries: z17.array(z17.string()).min(1)
|
|
2128
2136
|
}),
|
|
2129
|
-
|
|
2130
|
-
type:
|
|
2131
|
-
url:
|
|
2132
|
-
prompt:
|
|
2133
|
-
pattern:
|
|
2137
|
+
z17.object({
|
|
2138
|
+
type: z17.literal("webFetch"),
|
|
2139
|
+
url: z17.string(),
|
|
2140
|
+
prompt: z17.string().nullable().optional(),
|
|
2141
|
+
pattern: z17.string().nullable()
|
|
2134
2142
|
}),
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
type:
|
|
2138
|
-
prompt:
|
|
2139
|
-
path:
|
|
2140
|
-
result:
|
|
2141
|
-
error:
|
|
2142
|
-
transparentBackground:
|
|
2143
|
+
z17.object({ type: z17.literal("imageView"), path: z17.string() }),
|
|
2144
|
+
z17.object({
|
|
2145
|
+
type: z17.literal("imageGeneration"),
|
|
2146
|
+
prompt: z17.string().nullable(),
|
|
2147
|
+
path: z17.string().nullable(),
|
|
2148
|
+
result: z17.string().optional(),
|
|
2149
|
+
error: z17.string().nullable(),
|
|
2150
|
+
transparentBackground: z17.boolean()
|
|
2143
2151
|
}),
|
|
2144
2152
|
deltaBackgroundTaskShapeSchema,
|
|
2145
2153
|
deltaFileReadShapeSchema,
|
|
@@ -2148,22 +2156,22 @@ var deltaItemShapeSchema = z16.discriminatedUnion("type", [
|
|
|
2148
2156
|
deltaPlanStepsShapeSchema,
|
|
2149
2157
|
deltaExtensionShapeSchema
|
|
2150
2158
|
]);
|
|
2151
|
-
var deltaProgressSnapshotSchema =
|
|
2159
|
+
var deltaProgressSnapshotSchema = z17.discriminatedUnion("type", [
|
|
2152
2160
|
deltaBackgroundTaskShapeSchema,
|
|
2153
2161
|
deltaDelegationShapeSchema
|
|
2154
2162
|
]);
|
|
2155
|
-
var deltaTextChannelSchema =
|
|
2163
|
+
var deltaTextChannelSchema = z17.enum([
|
|
2156
2164
|
"agentMessage",
|
|
2157
2165
|
"reasoningSummary",
|
|
2158
2166
|
"reasoningText",
|
|
2159
2167
|
"plan"
|
|
2160
2168
|
]);
|
|
2161
|
-
var deltaOutputChannelSchema =
|
|
2162
|
-
var deltaErrorSchema =
|
|
2163
|
-
var deltaAttachSchema =
|
|
2164
|
-
var deltaNoTurnFallbackSchema =
|
|
2169
|
+
var deltaOutputChannelSchema = z17.enum(["command", "fileChange"]);
|
|
2170
|
+
var deltaErrorSchema = z17.object({ message: z17.string() });
|
|
2171
|
+
var deltaAttachSchema = z17.enum(["open", "currentOrLast"]);
|
|
2172
|
+
var deltaNoTurnFallbackSchema = z17.object({
|
|
2165
2173
|
raw: providerRawEventSchema,
|
|
2166
|
-
rawType:
|
|
2174
|
+
rawType: z17.string()
|
|
2167
2175
|
});
|
|
2168
2176
|
function requireExtensionPresentation(delta, ctx) {
|
|
2169
2177
|
if (delta.item.type === "extension" && delta.presentation === void 0) {
|
|
@@ -2174,32 +2182,32 @@ function requireExtensionPresentation(delta, ctx) {
|
|
|
2174
2182
|
});
|
|
2175
2183
|
}
|
|
2176
2184
|
}
|
|
2177
|
-
var threadDeltaSchema =
|
|
2178
|
-
|
|
2179
|
-
kind:
|
|
2185
|
+
var threadDeltaSchema = z17.discriminatedUnion("kind", [
|
|
2186
|
+
z17.object({
|
|
2187
|
+
kind: z17.literal("input.accepted"),
|
|
2180
2188
|
clientRequestId: clientTurnRequestIdSchema,
|
|
2181
2189
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2182
2190
|
}),
|
|
2183
|
-
|
|
2184
|
-
kind:
|
|
2185
|
-
text:
|
|
2191
|
+
z17.object({
|
|
2192
|
+
kind: z17.literal("input.provider"),
|
|
2193
|
+
text: z17.string().min(1),
|
|
2186
2194
|
parentRef: deltaKeyPartSchema.optional()
|
|
2187
2195
|
}),
|
|
2188
|
-
|
|
2189
|
-
kind:
|
|
2196
|
+
z17.object({
|
|
2197
|
+
kind: z17.literal("turn.open"),
|
|
2190
2198
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2191
2199
|
parentRef: deltaKeyPartSchema.optional()
|
|
2192
2200
|
}),
|
|
2193
|
-
|
|
2194
|
-
kind:
|
|
2201
|
+
z17.object({
|
|
2202
|
+
kind: z17.literal("turn.boundary"),
|
|
2195
2203
|
status: threadEventTurnStatusSchema,
|
|
2196
2204
|
error: deltaErrorSchema.optional(),
|
|
2197
|
-
providerCheckpointId:
|
|
2198
|
-
claimIfIdle:
|
|
2205
|
+
providerCheckpointId: z17.string().min(1).optional(),
|
|
2206
|
+
claimIfIdle: z17.boolean().optional(),
|
|
2199
2207
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2200
2208
|
}),
|
|
2201
|
-
|
|
2202
|
-
kind:
|
|
2209
|
+
z17.object({
|
|
2210
|
+
kind: z17.literal("item.open"),
|
|
2203
2211
|
key: deltaItemKeySchema,
|
|
2204
2212
|
item: deltaItemShapeSchema,
|
|
2205
2213
|
presentation: deltaPresentationSchema.optional(),
|
|
@@ -2207,140 +2215,140 @@ var threadDeltaSchema = z16.discriminatedUnion("kind", [
|
|
|
2207
2215
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2208
2216
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2209
2217
|
}).superRefine(requireExtensionPresentation),
|
|
2210
|
-
|
|
2211
|
-
kind:
|
|
2218
|
+
z17.object({
|
|
2219
|
+
kind: z17.literal("item.close"),
|
|
2212
2220
|
key: deltaItemKeySchema,
|
|
2213
2221
|
status: threadEventItemStatusSchema,
|
|
2214
|
-
resultText:
|
|
2215
|
-
exitCode:
|
|
2216
|
-
aggregatedOutput:
|
|
2217
|
-
approvalStatus:
|
|
2222
|
+
resultText: z17.string().optional(),
|
|
2223
|
+
exitCode: z17.number().optional(),
|
|
2224
|
+
aggregatedOutput: z17.string().optional(),
|
|
2225
|
+
approvalStatus: z17.literal("denied").optional(),
|
|
2218
2226
|
item: deltaItemShapeSchema,
|
|
2219
2227
|
presentation: deltaPresentationSchema.optional(),
|
|
2220
2228
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2221
2229
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2222
2230
|
}).superRefine(requireExtensionPresentation),
|
|
2223
|
-
|
|
2224
|
-
kind:
|
|
2231
|
+
z17.object({
|
|
2232
|
+
kind: z17.literal("item.progress"),
|
|
2225
2233
|
key: deltaItemKeySchema,
|
|
2226
|
-
message:
|
|
2234
|
+
message: z17.string().optional(),
|
|
2227
2235
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
2228
|
-
flush:
|
|
2236
|
+
flush: z17.boolean().optional(),
|
|
2229
2237
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2230
2238
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2231
2239
|
}),
|
|
2232
|
-
|
|
2233
|
-
kind:
|
|
2240
|
+
z17.object({
|
|
2241
|
+
kind: z17.literal("item.textDelta"),
|
|
2234
2242
|
key: deltaItemKeySchema,
|
|
2235
2243
|
channel: deltaTextChannelSchema,
|
|
2236
|
-
text:
|
|
2244
|
+
text: z17.string(),
|
|
2237
2245
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2238
2246
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2239
2247
|
}),
|
|
2240
|
-
|
|
2241
|
-
kind:
|
|
2248
|
+
z17.object({
|
|
2249
|
+
kind: z17.literal("item.textClose"),
|
|
2242
2250
|
key: deltaItemKeySchema,
|
|
2243
2251
|
channel: deltaTextChannelSchema,
|
|
2244
|
-
text:
|
|
2252
|
+
text: z17.string().optional(),
|
|
2245
2253
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2246
2254
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2247
2255
|
}),
|
|
2248
|
-
|
|
2249
|
-
kind:
|
|
2256
|
+
z17.object({
|
|
2257
|
+
kind: z17.literal("item.outputDelta"),
|
|
2250
2258
|
key: deltaItemKeySchema,
|
|
2251
2259
|
channel: deltaOutputChannelSchema,
|
|
2252
|
-
text:
|
|
2260
|
+
text: z17.string(),
|
|
2253
2261
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2254
2262
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2255
2263
|
}),
|
|
2256
|
-
|
|
2257
|
-
kind:
|
|
2264
|
+
z17.object({
|
|
2265
|
+
kind: z17.literal("command.outputSnapshot"),
|
|
2258
2266
|
key: deltaItemKeySchema,
|
|
2259
|
-
text:
|
|
2267
|
+
text: z17.string(),
|
|
2260
2268
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2261
2269
|
}),
|
|
2262
|
-
|
|
2263
|
-
kind:
|
|
2270
|
+
z17.object({
|
|
2271
|
+
kind: z17.literal("usage"),
|
|
2264
2272
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2265
2273
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2266
|
-
modelContextWindow:
|
|
2274
|
+
modelContextWindow: z17.number().nullable(),
|
|
2267
2275
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2268
2276
|
}),
|
|
2269
|
-
|
|
2270
|
-
kind:
|
|
2277
|
+
z17.object({
|
|
2278
|
+
kind: z17.literal("contextWindow"),
|
|
2271
2279
|
snapshot: contextSnapshotSchema.optional(),
|
|
2272
|
-
used:
|
|
2273
|
-
size:
|
|
2274
|
-
estimated:
|
|
2280
|
+
used: z17.number().nullable(),
|
|
2281
|
+
size: z17.number().nullable().optional(),
|
|
2282
|
+
estimated: z17.boolean(),
|
|
2275
2283
|
attach: deltaAttachSchema,
|
|
2276
2284
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2277
2285
|
}),
|
|
2278
|
-
|
|
2279
|
-
kind:
|
|
2286
|
+
z17.object({
|
|
2287
|
+
kind: z17.literal("context.compacted"),
|
|
2280
2288
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2281
2289
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2282
2290
|
}),
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
kind:
|
|
2286
|
-
diff:
|
|
2291
|
+
z17.object({ kind: z17.literal("context.cleared") }),
|
|
2292
|
+
z17.object({
|
|
2293
|
+
kind: z17.literal("turn.diff"),
|
|
2294
|
+
diff: z17.string(),
|
|
2287
2295
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2288
2296
|
}),
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
kind:
|
|
2292
|
-
providerThreadId:
|
|
2297
|
+
z17.object({ kind: z17.literal("thread.started") }),
|
|
2298
|
+
z17.object({
|
|
2299
|
+
kind: z17.literal("thread.identity"),
|
|
2300
|
+
providerThreadId: z17.string().min(1)
|
|
2293
2301
|
}),
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
kind:
|
|
2302
|
+
z17.object({ kind: z17.literal("thread.name"), name: z17.string().min(1) }),
|
|
2303
|
+
z17.object({
|
|
2304
|
+
kind: z17.literal("extension.state"),
|
|
2297
2305
|
extensionKind: extensionKindSchema,
|
|
2298
2306
|
payload: jsonValueSchema
|
|
2299
2307
|
}),
|
|
2300
|
-
|
|
2301
|
-
kind:
|
|
2308
|
+
z17.object({
|
|
2309
|
+
kind: z17.literal("provider.rateLimits"),
|
|
2302
2310
|
rateLimits: providerRateLimitStateSchema
|
|
2303
2311
|
}),
|
|
2304
|
-
|
|
2305
|
-
kind:
|
|
2306
|
-
message:
|
|
2307
|
-
detail:
|
|
2308
|
-
willRetry:
|
|
2312
|
+
z17.object({
|
|
2313
|
+
kind: z17.literal("provider.error"),
|
|
2314
|
+
message: z17.string(),
|
|
2315
|
+
detail: z17.string().optional(),
|
|
2316
|
+
willRetry: z17.boolean().optional(),
|
|
2309
2317
|
category: providerErrorCategorySchema.optional(),
|
|
2310
2318
|
errorInfo: providerErrorInfoSchema.optional(),
|
|
2311
|
-
settlesTurn:
|
|
2319
|
+
settlesTurn: z17.boolean().optional(),
|
|
2312
2320
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2313
|
-
threadScoped:
|
|
2321
|
+
threadScoped: z17.boolean().optional()
|
|
2314
2322
|
}),
|
|
2315
|
-
|
|
2316
|
-
kind:
|
|
2317
|
-
originalModel:
|
|
2318
|
-
fallbackModel:
|
|
2319
|
-
reason:
|
|
2320
|
-
message:
|
|
2323
|
+
z17.object({
|
|
2324
|
+
kind: z17.literal("provider.modelFallback"),
|
|
2325
|
+
originalModel: z17.string().min(1),
|
|
2326
|
+
fallbackModel: z17.string().min(1),
|
|
2327
|
+
reason: z17.enum(["refusal", "provider"]),
|
|
2328
|
+
message: z17.string()
|
|
2321
2329
|
}),
|
|
2322
|
-
|
|
2323
|
-
kind:
|
|
2324
|
-
summary:
|
|
2325
|
-
details:
|
|
2330
|
+
z17.object({
|
|
2331
|
+
kind: z17.literal("provider.warning"),
|
|
2332
|
+
summary: z17.string().optional(),
|
|
2333
|
+
details: z17.string().optional(),
|
|
2326
2334
|
category: threadEventWarningCategorySchema.optional(),
|
|
2327
|
-
vouchedTurn:
|
|
2335
|
+
vouchedTurn: z17.boolean().optional()
|
|
2328
2336
|
}),
|
|
2329
|
-
|
|
2330
|
-
kind:
|
|
2337
|
+
z17.object({
|
|
2338
|
+
kind: z17.literal("unhandled"),
|
|
2331
2339
|
raw: providerRawEventSchema,
|
|
2332
|
-
rawType:
|
|
2333
|
-
vouchedTurn:
|
|
2334
|
-
onlyIfNoTurn:
|
|
2340
|
+
rawType: z17.string(),
|
|
2341
|
+
vouchedTurn: z17.boolean(),
|
|
2342
|
+
onlyIfNoTurn: z17.boolean().optional(),
|
|
2335
2343
|
parentRef: deltaKeyPartSchema.optional(),
|
|
2336
2344
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2337
2345
|
}),
|
|
2338
|
-
|
|
2339
|
-
|
|
2346
|
+
z17.object({ kind: z17.literal("session.ended") }),
|
|
2347
|
+
z17.object({ kind: z17.literal("session.reset") })
|
|
2340
2348
|
]);
|
|
2341
|
-
var threadDeltaNotificationParamsSchema =
|
|
2342
|
-
threadId:
|
|
2343
|
-
deltas:
|
|
2349
|
+
var threadDeltaNotificationParamsSchema = z17.object({
|
|
2350
|
+
threadId: z17.string().min(1),
|
|
2351
|
+
deltas: z17.array(threadDeltaSchema)
|
|
2344
2352
|
}).passthrough();
|
|
2345
2353
|
|
|
2346
2354
|
// ../provider-bridge-protocol/src/assembler/delta-assembler.ts
|
|
@@ -2351,17 +2359,17 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
|
|
|
2351
2359
|
var THREAD_DELTA_GRAMMAR_V3 = 3;
|
|
2352
2360
|
|
|
2353
2361
|
// ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
|
|
2354
|
-
import { z as
|
|
2362
|
+
import { z as z19 } from "zod";
|
|
2355
2363
|
|
|
2356
2364
|
// ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
|
|
2357
|
-
import { z as
|
|
2358
|
-
var bashArgsSchema =
|
|
2359
|
-
command:
|
|
2360
|
-
cwd:
|
|
2365
|
+
import { z as z18 } from "zod";
|
|
2366
|
+
var bashArgsSchema = z18.object({
|
|
2367
|
+
command: z18.string().optional(),
|
|
2368
|
+
cwd: z18.string().optional()
|
|
2361
2369
|
}).passthrough();
|
|
2362
|
-
var textBlockSchema =
|
|
2363
|
-
type:
|
|
2364
|
-
text:
|
|
2370
|
+
var textBlockSchema = z18.object({
|
|
2371
|
+
type: z18.literal("text"),
|
|
2372
|
+
text: z18.string()
|
|
2365
2373
|
});
|
|
2366
2374
|
|
|
2367
2375
|
// ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
|
|
@@ -2370,10 +2378,10 @@ function isRecord(value) {
|
|
|
2370
2378
|
}
|
|
2371
2379
|
|
|
2372
2380
|
// ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
|
|
2373
|
-
var contentWrapperSchema =
|
|
2374
|
-
content:
|
|
2381
|
+
var contentWrapperSchema = z19.object({
|
|
2382
|
+
content: z19.array(z19.unknown())
|
|
2375
2383
|
}).passthrough();
|
|
2376
|
-
var shellEnvironmentVariableKeySchema =
|
|
2384
|
+
var shellEnvironmentVariableKeySchema = z19.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
|
|
2377
2385
|
var MAX_EXACT_LINE_DIFF_CELLS = 1e6;
|
|
2378
2386
|
function splitComparableLines(text) {
|
|
2379
2387
|
const normalized = text.replace(/\r\n?/gu, "\n");
|
|
@@ -4220,11 +4228,11 @@ function toConformanceMessages() {
|
|
|
4220
4228
|
}
|
|
4221
4229
|
|
|
4222
4230
|
// ../provider-bridge-protocol/src/conformance/client.ts
|
|
4223
|
-
import { z as
|
|
4231
|
+
import { z as z20 } from "zod";
|
|
4224
4232
|
function isWireMessage(value) {
|
|
4225
4233
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4226
4234
|
}
|
|
4227
|
-
var threadDeltaAddressSchema =
|
|
4235
|
+
var threadDeltaAddressSchema = z20.object({ threadId: z20.string() }).passthrough();
|
|
4228
4236
|
var ConformanceClient = class {
|
|
4229
4237
|
constructor(transport, timeoutMs, collector) {
|
|
4230
4238
|
this.transport = transport;
|
|
@@ -4333,11 +4341,11 @@ function nextConformanceClientRequestId() {
|
|
|
4333
4341
|
}
|
|
4334
4342
|
|
|
4335
4343
|
// ../provider-bridge-protocol/src/conformance/scenarios.ts
|
|
4336
|
-
import { z as
|
|
4344
|
+
import { z as z28 } from "zod";
|
|
4337
4345
|
|
|
4338
4346
|
// ../provider-bridge-protocol/src/handshake.ts
|
|
4339
|
-
import { z as
|
|
4340
|
-
var bridgeGrammarVersionsSchema =
|
|
4347
|
+
import { z as z21 } from "zod";
|
|
4348
|
+
var bridgeGrammarVersionsSchema = z21.tuple([z21.number().int().positive(), z21.number().int().positive()]).refine(([min, max]) => min <= max, {
|
|
4341
4349
|
message: "grammarVersions must be an ascending [min, max] range"
|
|
4342
4350
|
});
|
|
4343
4351
|
function negotiateGrammarVersion(runtime, bridge) {
|
|
@@ -4345,62 +4353,62 @@ function negotiateGrammarVersion(runtime, bridge) {
|
|
|
4345
4353
|
const max = Math.min(runtime[1], bridge[1]);
|
|
4346
4354
|
return min <= max ? max : null;
|
|
4347
4355
|
}
|
|
4348
|
-
var bridgeSteerModeSchema =
|
|
4349
|
-
var bridgeCapabilitiesSchema =
|
|
4350
|
-
sessionRestore:
|
|
4351
|
-
threadArchive:
|
|
4352
|
-
threadRename:
|
|
4353
|
-
threadGoalClear:
|
|
4356
|
+
var bridgeSteerModeSchema = z21.enum(["inject", "queue"]);
|
|
4357
|
+
var bridgeCapabilitiesSchema = z21.object({
|
|
4358
|
+
sessionRestore: z21.boolean().default(false),
|
|
4359
|
+
threadArchive: z21.boolean().default(false),
|
|
4360
|
+
threadRename: z21.boolean().default(false),
|
|
4361
|
+
threadGoalClear: z21.boolean().default(false),
|
|
4354
4362
|
fork: providerForkSchema.default("none"),
|
|
4355
|
-
approvalEnforcedBy:
|
|
4363
|
+
approvalEnforcedBy: z21.enum(["runtime", "provider"]).default("runtime"),
|
|
4356
4364
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
4357
4365
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
4358
4366
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
4359
4367
|
]),
|
|
4360
4368
|
steerMode: bridgeSteerModeSchema.default("queue"),
|
|
4361
|
-
skills:
|
|
4369
|
+
skills: z21.object({ configure: z21.boolean().default(false) }).default({ configure: false })
|
|
4362
4370
|
}).passthrough();
|
|
4363
|
-
var initializeParamsSchema =
|
|
4364
|
-
protocolVersion:
|
|
4365
|
-
client:
|
|
4371
|
+
var initializeParamsSchema = z21.object({
|
|
4372
|
+
protocolVersion: z21.number().int().positive(),
|
|
4373
|
+
client: z21.object({ name: z21.string().min(1), version: z21.string().min(1) }),
|
|
4366
4374
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
4367
4375
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
4368
4376
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
4369
4377
|
])
|
|
4370
4378
|
}).passthrough();
|
|
4371
|
-
var initializeResultSchema =
|
|
4372
|
-
protocolVersion:
|
|
4373
|
-
capabilities:
|
|
4379
|
+
var initializeResultSchema = z21.object({
|
|
4380
|
+
protocolVersion: z21.number().int().positive(),
|
|
4381
|
+
capabilities: z21.preprocess(
|
|
4374
4382
|
(value) => value ?? {},
|
|
4375
4383
|
bridgeCapabilitiesSchema
|
|
4376
4384
|
)
|
|
4377
4385
|
}).passthrough();
|
|
4378
4386
|
|
|
4379
4387
|
// ../provider-bridge-protocol/src/execution-options.ts
|
|
4380
|
-
import { z as
|
|
4381
|
-
var bridgeExecutionOptionsSchema =
|
|
4382
|
-
model:
|
|
4388
|
+
import { z as z22 } from "zod";
|
|
4389
|
+
var bridgeExecutionOptionsSchema = z22.object({
|
|
4390
|
+
model: z22.string().min(1).optional(),
|
|
4383
4391
|
serviceTier: serviceTierSchema.optional(),
|
|
4384
4392
|
reasoningLevel: reasoningLevelSchema.optional(),
|
|
4385
4393
|
promptMode: promptModeSchema.optional(),
|
|
4386
|
-
instructions:
|
|
4387
|
-
envVars:
|
|
4388
|
-
providerOptions:
|
|
4394
|
+
instructions: z22.string().optional(),
|
|
4395
|
+
envVars: z22.record(z22.string(), z22.string()).optional(),
|
|
4396
|
+
providerOptions: z22.record(z22.string(), z22.unknown()).optional()
|
|
4389
4397
|
}).and(runtimePermissionPolicySchema);
|
|
4390
4398
|
|
|
4391
4399
|
// ../provider-bridge-protocol/src/provider-maintenance.ts
|
|
4392
|
-
import { z as
|
|
4393
|
-
var providerMaintenanceParamsSchema =
|
|
4394
|
-
providerId:
|
|
4395
|
-
cwd:
|
|
4396
|
-
providerOptions:
|
|
4400
|
+
import { z as z23 } from "zod";
|
|
4401
|
+
var providerMaintenanceParamsSchema = z23.object({
|
|
4402
|
+
providerId: z23.string().min(1),
|
|
4403
|
+
cwd: z23.string().min(1).optional(),
|
|
4404
|
+
providerOptions: z23.record(z23.string(), z23.unknown()).optional()
|
|
4397
4405
|
}).passthrough();
|
|
4398
|
-
var providerInstallationRequirementSchema =
|
|
4406
|
+
var providerInstallationRequirementSchema = z23.enum(["thread_rewind"]);
|
|
4399
4407
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4400
4408
|
requirement: providerInstallationRequirementSchema.optional()
|
|
4401
4409
|
});
|
|
4402
|
-
var providerHealthSchema =
|
|
4403
|
-
status:
|
|
4410
|
+
var providerHealthSchema = z23.object({
|
|
4411
|
+
status: z23.enum([
|
|
4404
4412
|
"ready",
|
|
4405
4413
|
"not_installed",
|
|
4406
4414
|
"unauthenticated",
|
|
@@ -4408,114 +4416,114 @@ var providerHealthSchema = z22.object({
|
|
|
4408
4416
|
"unsupported_version",
|
|
4409
4417
|
"unknown"
|
|
4410
4418
|
]),
|
|
4411
|
-
statusMessage:
|
|
4412
|
-
accountEmail:
|
|
4413
|
-
planLabel:
|
|
4414
|
-
installedVersion:
|
|
4415
|
-
minimumSupportedVersion:
|
|
4416
|
-
canInstall:
|
|
4417
|
-
canUpdate:
|
|
4418
|
-
loginCommand:
|
|
4419
|
+
statusMessage: z23.string().min(1).nullable(),
|
|
4420
|
+
accountEmail: z23.string().nullable(),
|
|
4421
|
+
planLabel: z23.string().min(1).nullable(),
|
|
4422
|
+
installedVersion: z23.string().min(1).nullable(),
|
|
4423
|
+
minimumSupportedVersion: z23.string().min(1).nullable(),
|
|
4424
|
+
canInstall: z23.boolean(),
|
|
4425
|
+
canUpdate: z23.boolean(),
|
|
4426
|
+
loginCommand: z23.string().min(1).nullable()
|
|
4419
4427
|
}).passthrough();
|
|
4420
|
-
var providerUsageWindowSchema =
|
|
4421
|
-
label:
|
|
4422
|
-
usedPercent:
|
|
4423
|
-
resetsAt:
|
|
4424
|
-
cost:
|
|
4425
|
-
usedUsdCents:
|
|
4426
|
-
limitUsdCents:
|
|
4428
|
+
var providerUsageWindowSchema = z23.object({
|
|
4429
|
+
label: z23.string().min(1),
|
|
4430
|
+
usedPercent: z23.number().min(0).max(100),
|
|
4431
|
+
resetsAt: z23.string().min(1).nullable(),
|
|
4432
|
+
cost: z23.object({
|
|
4433
|
+
usedUsdCents: z23.number().int().nonnegative(),
|
|
4434
|
+
limitUsdCents: z23.number().int().positive()
|
|
4427
4435
|
}).optional()
|
|
4428
4436
|
}).passthrough();
|
|
4429
|
-
var providerUsageSchema =
|
|
4430
|
-
|
|
4431
|
-
status:
|
|
4432
|
-
accountEmail:
|
|
4433
|
-
planLabel:
|
|
4434
|
-
windows:
|
|
4437
|
+
var providerUsageSchema = z23.discriminatedUnion("status", [
|
|
4438
|
+
z23.object({
|
|
4439
|
+
status: z23.literal("ok"),
|
|
4440
|
+
accountEmail: z23.string().email().nullable(),
|
|
4441
|
+
planLabel: z23.string().min(1).nullable(),
|
|
4442
|
+
windows: z23.array(providerUsageWindowSchema)
|
|
4435
4443
|
}).passthrough(),
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
status:
|
|
4441
|
-
message:
|
|
4442
|
-
planLabel:
|
|
4443
|
-
accountEmail:
|
|
4444
|
+
z23.object({ status: z23.literal("not_installed") }).passthrough(),
|
|
4445
|
+
z23.object({ status: z23.literal("unauthenticated") }).passthrough(),
|
|
4446
|
+
z23.object({ status: z23.literal("expired") }).passthrough(),
|
|
4447
|
+
z23.object({
|
|
4448
|
+
status: z23.literal("error"),
|
|
4449
|
+
message: z23.string().min(1),
|
|
4450
|
+
planLabel: z23.string().min(1).nullable().default(null),
|
|
4451
|
+
accountEmail: z23.string().nullable().default(null)
|
|
4444
4452
|
}).passthrough()
|
|
4445
4453
|
]);
|
|
4446
|
-
var providerHealthResultSchema =
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
supported:
|
|
4454
|
+
var providerHealthResultSchema = z23.discriminatedUnion("supported", [
|
|
4455
|
+
z23.object({ supported: z23.literal(false) }).passthrough(),
|
|
4456
|
+
z23.object({
|
|
4457
|
+
supported: z23.literal(true),
|
|
4450
4458
|
health: providerHealthSchema
|
|
4451
4459
|
}).passthrough()
|
|
4452
4460
|
]);
|
|
4453
|
-
var providerUsageResultSchema =
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
supported:
|
|
4461
|
+
var providerUsageResultSchema = z23.discriminatedUnion("supported", [
|
|
4462
|
+
z23.object({ supported: z23.literal(false) }).passthrough(),
|
|
4463
|
+
z23.object({
|
|
4464
|
+
supported: z23.literal(true),
|
|
4457
4465
|
usage: providerUsageSchema
|
|
4458
4466
|
}).passthrough()
|
|
4459
4467
|
]);
|
|
4460
|
-
var providerInstallationActionKindSchema =
|
|
4468
|
+
var providerInstallationActionKindSchema = z23.enum([
|
|
4461
4469
|
"install",
|
|
4462
4470
|
"update"
|
|
4463
4471
|
]);
|
|
4464
|
-
var providerInstallationActionSchema =
|
|
4472
|
+
var providerInstallationActionSchema = z23.object({
|
|
4465
4473
|
kind: providerInstallationActionKindSchema,
|
|
4466
|
-
label:
|
|
4467
|
-
command:
|
|
4474
|
+
label: z23.enum(["Install", "Update"]),
|
|
4475
|
+
command: z23.string().min(1)
|
|
4468
4476
|
}).passthrough();
|
|
4469
|
-
var providerInstallationSourceSchema =
|
|
4477
|
+
var providerInstallationSourceSchema = z23.enum([
|
|
4470
4478
|
"notInstalled",
|
|
4471
4479
|
"npmGlobal",
|
|
4472
4480
|
"external"
|
|
4473
4481
|
]);
|
|
4474
|
-
var providerInstallationStatusSchema =
|
|
4475
|
-
executableName:
|
|
4476
|
-
executablePath:
|
|
4477
|
-
installed:
|
|
4482
|
+
var providerInstallationStatusSchema = z23.object({
|
|
4483
|
+
executableName: z23.string().min(1),
|
|
4484
|
+
executablePath: z23.string().min(1).nullable(),
|
|
4485
|
+
installed: z23.boolean(),
|
|
4478
4486
|
installSource: providerInstallationSourceSchema,
|
|
4479
|
-
currentVersion:
|
|
4480
|
-
latestVersion:
|
|
4481
|
-
minimumSupportedVersion:
|
|
4482
|
-
npmPackageName:
|
|
4483
|
-
npmGlobalPackageVersion:
|
|
4487
|
+
currentVersion: z23.string().min(1).nullable(),
|
|
4488
|
+
latestVersion: z23.string().min(1).nullable(),
|
|
4489
|
+
minimumSupportedVersion: z23.string().min(1).nullable(),
|
|
4490
|
+
npmPackageName: z23.string().min(1).nullable(),
|
|
4491
|
+
npmGlobalPackageVersion: z23.string().min(1).nullable(),
|
|
4484
4492
|
installAction: providerInstallationActionSchema.nullable(),
|
|
4485
|
-
needsUpdate:
|
|
4486
|
-
versionUnsupported:
|
|
4493
|
+
needsUpdate: z23.boolean(),
|
|
4494
|
+
versionUnsupported: z23.boolean()
|
|
4487
4495
|
}).passthrough();
|
|
4488
4496
|
var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4489
4497
|
action: providerInstallationActionKindSchema
|
|
4490
4498
|
});
|
|
4491
|
-
var providerInstallationCommandSchema =
|
|
4492
|
-
command:
|
|
4493
|
-
args:
|
|
4494
|
-
displayCommand:
|
|
4499
|
+
var providerInstallationCommandSchema = z23.object({
|
|
4500
|
+
command: z23.string().min(1),
|
|
4501
|
+
args: z23.array(z23.string()).max(64),
|
|
4502
|
+
displayCommand: z23.string().min(1)
|
|
4495
4503
|
}).passthrough();
|
|
4496
|
-
var providerInstallationVerificationSchema =
|
|
4504
|
+
var providerInstallationVerificationSchema = z23.discriminatedUnion(
|
|
4497
4505
|
"kind",
|
|
4498
4506
|
[
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
kind:
|
|
4502
|
-
previousVersion:
|
|
4507
|
+
z23.object({ kind: z23.literal("installed") }).passthrough(),
|
|
4508
|
+
z23.object({
|
|
4509
|
+
kind: z23.literal("version_changed"),
|
|
4510
|
+
previousVersion: z23.string().min(1)
|
|
4503
4511
|
}).passthrough(),
|
|
4504
|
-
|
|
4505
|
-
kind:
|
|
4506
|
-
version:
|
|
4512
|
+
z23.object({
|
|
4513
|
+
kind: z23.literal("version_at_least"),
|
|
4514
|
+
version: z23.string().min(1)
|
|
4507
4515
|
}).passthrough()
|
|
4508
4516
|
]
|
|
4509
4517
|
);
|
|
4510
|
-
var providerInstallationRunResultSchema =
|
|
4518
|
+
var providerInstallationRunResultSchema = z23.discriminatedUnion(
|
|
4511
4519
|
"available",
|
|
4512
4520
|
[
|
|
4513
|
-
|
|
4514
|
-
available:
|
|
4515
|
-
message:
|
|
4521
|
+
z23.object({
|
|
4522
|
+
available: z23.literal(false),
|
|
4523
|
+
message: z23.string().min(1)
|
|
4516
4524
|
}).passthrough(),
|
|
4517
|
-
|
|
4518
|
-
available:
|
|
4525
|
+
z23.object({
|
|
4526
|
+
available: z23.literal(true),
|
|
4519
4527
|
command: providerInstallationCommandSchema,
|
|
4520
4528
|
verification: providerInstallationVerificationSchema
|
|
4521
4529
|
}).passthrough()
|
|
@@ -4523,7 +4531,7 @@ var providerInstallationRunResultSchema = z22.discriminatedUnion(
|
|
|
4523
4531
|
);
|
|
4524
4532
|
|
|
4525
4533
|
// ../provider-bridge-protocol/src/requests.ts
|
|
4526
|
-
import { z as
|
|
4534
|
+
import { z as z24 } from "zod";
|
|
4527
4535
|
var BRIDGE_REQUEST_METHODS = {
|
|
4528
4536
|
initialize: "initialize",
|
|
4529
4537
|
modelList: "model/list",
|
|
@@ -4545,77 +4553,77 @@ var BRIDGE_REQUEST_METHODS = {
|
|
|
4545
4553
|
skillsConfigure: "skills/configure"
|
|
4546
4554
|
};
|
|
4547
4555
|
var sessionConstructionFields = {
|
|
4548
|
-
threadId:
|
|
4549
|
-
cwd:
|
|
4556
|
+
threadId: z24.string().min(1),
|
|
4557
|
+
cwd: z24.string().min(1),
|
|
4550
4558
|
options: bridgeExecutionOptionsSchema,
|
|
4551
|
-
dynamicTools:
|
|
4552
|
-
disallowedTools:
|
|
4559
|
+
dynamicTools: z24.array(dynamicToolSchema).optional(),
|
|
4560
|
+
disallowedTools: z24.array(z24.string().min(1)).optional(),
|
|
4553
4561
|
instructionMode: instructionModeSchema
|
|
4554
4562
|
};
|
|
4555
|
-
var modelListParamsSchema =
|
|
4556
|
-
var threadStartParamsSchema =
|
|
4563
|
+
var modelListParamsSchema = z24.object({ cwd: z24.string().min(1).optional() }).passthrough();
|
|
4564
|
+
var threadStartParamsSchema = z24.object({
|
|
4557
4565
|
...sessionConstructionFields,
|
|
4558
|
-
input:
|
|
4566
|
+
input: z24.array(promptInputSchema).optional()
|
|
4559
4567
|
}).passthrough();
|
|
4560
|
-
var threadResumeParamsSchema =
|
|
4568
|
+
var threadResumeParamsSchema = z24.object({
|
|
4561
4569
|
...sessionConstructionFields,
|
|
4562
|
-
providerThreadId:
|
|
4570
|
+
providerThreadId: z24.string().min(1)
|
|
4563
4571
|
}).passthrough();
|
|
4564
|
-
var threadForkParamsSchema =
|
|
4572
|
+
var threadForkParamsSchema = z24.object({
|
|
4565
4573
|
...sessionConstructionFields,
|
|
4566
|
-
sourceProviderThreadId:
|
|
4567
|
-
sourceProviderCheckpointId:
|
|
4574
|
+
sourceProviderThreadId: z24.string().min(1),
|
|
4575
|
+
sourceProviderCheckpointId: z24.string().min(1).optional()
|
|
4568
4576
|
}).passthrough();
|
|
4569
|
-
var threadStopParamsSchema =
|
|
4570
|
-
threadId:
|
|
4571
|
-
providerThreadId:
|
|
4572
|
-
intent:
|
|
4573
|
-
activeTurnId:
|
|
4577
|
+
var threadStopParamsSchema = z24.object({
|
|
4578
|
+
threadId: z24.string().min(1),
|
|
4579
|
+
providerThreadId: z24.string().min(1),
|
|
4580
|
+
intent: z24.enum(["interrupt", "release"]),
|
|
4581
|
+
activeTurnId: z24.string().min(1).nullable()
|
|
4574
4582
|
}).passthrough();
|
|
4575
|
-
var threadRefParams =
|
|
4576
|
-
threadId:
|
|
4577
|
-
providerThreadId:
|
|
4583
|
+
var threadRefParams = z24.object({
|
|
4584
|
+
threadId: z24.string().min(1),
|
|
4585
|
+
providerThreadId: z24.string().min(1)
|
|
4578
4586
|
}).passthrough();
|
|
4579
|
-
var threadNameSetParamsSchema =
|
|
4580
|
-
threadId:
|
|
4581
|
-
providerThreadId:
|
|
4582
|
-
title:
|
|
4587
|
+
var threadNameSetParamsSchema = z24.object({
|
|
4588
|
+
threadId: z24.string().min(1),
|
|
4589
|
+
providerThreadId: z24.string().min(1),
|
|
4590
|
+
title: z24.string().min(1)
|
|
4583
4591
|
}).passthrough();
|
|
4584
4592
|
var turnInputFields = {
|
|
4585
|
-
threadId:
|
|
4586
|
-
providerThreadId:
|
|
4587
|
-
input:
|
|
4593
|
+
threadId: z24.string().min(1),
|
|
4594
|
+
providerThreadId: z24.string().min(1),
|
|
4595
|
+
input: z24.array(promptInputSchema),
|
|
4588
4596
|
clientRequestId: clientTurnRequestIdSchema,
|
|
4589
4597
|
options: bridgeExecutionOptionsSchema
|
|
4590
4598
|
};
|
|
4591
|
-
var turnStartParamsSchema =
|
|
4592
|
-
var turnSteerParamsSchema =
|
|
4599
|
+
var turnStartParamsSchema = z24.object(turnInputFields).passthrough();
|
|
4600
|
+
var turnSteerParamsSchema = z24.object({
|
|
4593
4601
|
...turnInputFields,
|
|
4594
|
-
expectedTurnId:
|
|
4602
|
+
expectedTurnId: z24.string().min(1)
|
|
4595
4603
|
}).passthrough();
|
|
4596
|
-
var skillsConfigureRootSchema =
|
|
4597
|
-
id:
|
|
4598
|
-
path:
|
|
4599
|
-
skills:
|
|
4600
|
-
|
|
4601
|
-
name:
|
|
4602
|
-
description:
|
|
4604
|
+
var skillsConfigureRootSchema = z24.object({
|
|
4605
|
+
id: z24.string().min(1),
|
|
4606
|
+
path: z24.string().min(1),
|
|
4607
|
+
skills: z24.array(
|
|
4608
|
+
z24.object({
|
|
4609
|
+
name: z24.string().min(1),
|
|
4610
|
+
description: z24.string()
|
|
4603
4611
|
}).passthrough()
|
|
4604
4612
|
)
|
|
4605
4613
|
}).passthrough();
|
|
4606
|
-
var skillsConfigureParamsSchema =
|
|
4607
|
-
roots:
|
|
4614
|
+
var skillsConfigureParamsSchema = z24.object({
|
|
4615
|
+
roots: z24.array(skillsConfigureRootSchema)
|
|
4608
4616
|
}).passthrough();
|
|
4609
|
-
var threadIdentityResultSchema =
|
|
4610
|
-
providerThreadId:
|
|
4611
|
-
sessionRestorable:
|
|
4617
|
+
var threadIdentityResultSchema = z24.object({
|
|
4618
|
+
providerThreadId: z24.string().min(1),
|
|
4619
|
+
sessionRestorable: z24.boolean().optional()
|
|
4612
4620
|
}).passthrough();
|
|
4613
4621
|
|
|
4614
4622
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
4615
|
-
import { z as
|
|
4623
|
+
import { z as z26 } from "zod";
|
|
4616
4624
|
|
|
4617
4625
|
// ../provider-bridge-protocol/src/errors.ts
|
|
4618
|
-
import { z as
|
|
4626
|
+
import { z as z25 } from "zod";
|
|
4619
4627
|
var BRIDGE_JSON_RPC_ERRORS = {
|
|
4620
4628
|
INVALID_PARAMS: -32602,
|
|
4621
4629
|
METHOD_NOT_FOUND: -32601,
|
|
@@ -4624,65 +4632,65 @@ var BRIDGE_JSON_RPC_ERRORS = {
|
|
|
4624
4632
|
SESSION_NOT_RESTORABLE: -32002,
|
|
4625
4633
|
FORK_CHECKPOINT_UNSUPPORTED: -32003
|
|
4626
4634
|
};
|
|
4627
|
-
var providerRecoveryHintSchema =
|
|
4635
|
+
var providerRecoveryHintSchema = z25.object({
|
|
4628
4636
|
kind: providerRecoveryKindSchema,
|
|
4629
|
-
message:
|
|
4630
|
-
retryable:
|
|
4637
|
+
message: z25.string().min(1),
|
|
4638
|
+
retryable: z25.boolean()
|
|
4631
4639
|
});
|
|
4632
|
-
var bridgeErrorDataSchema =
|
|
4640
|
+
var bridgeErrorDataSchema = z25.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
|
|
4633
4641
|
|
|
4634
4642
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
4635
|
-
var threadIdentityNotificationSchema =
|
|
4636
|
-
threadId:
|
|
4637
|
-
providerThreadId:
|
|
4638
|
-
sessionRestorable:
|
|
4643
|
+
var threadIdentityNotificationSchema = z26.object({
|
|
4644
|
+
threadId: z26.string().min(1),
|
|
4645
|
+
providerThreadId: z26.string().min(1),
|
|
4646
|
+
sessionRestorable: z26.boolean().optional()
|
|
4639
4647
|
}).passthrough();
|
|
4640
|
-
var sessionReplacedNotificationSchema =
|
|
4641
|
-
threadId:
|
|
4642
|
-
providerThreadId:
|
|
4643
|
-
reason:
|
|
4644
|
-
contextLost:
|
|
4645
|
-
showRuntimeNote:
|
|
4648
|
+
var sessionReplacedNotificationSchema = z26.object({
|
|
4649
|
+
threadId: z26.string().min(1),
|
|
4650
|
+
providerThreadId: z26.string().min(1).nullable(),
|
|
4651
|
+
reason: z26.string().min(1),
|
|
4652
|
+
contextLost: z26.boolean().default(false),
|
|
4653
|
+
showRuntimeNote: z26.boolean().default(false)
|
|
4646
4654
|
}).passthrough();
|
|
4647
|
-
var providerRecoveryNotificationSchema =
|
|
4648
|
-
threadId:
|
|
4655
|
+
var providerRecoveryNotificationSchema = z26.object({
|
|
4656
|
+
threadId: z26.string().min(1).optional(),
|
|
4649
4657
|
...providerRecoveryHintSchema.shape
|
|
4650
4658
|
}).passthrough();
|
|
4651
|
-
var errorNotificationSchema =
|
|
4652
|
-
threadId:
|
|
4653
|
-
providerThreadId:
|
|
4654
|
-
message:
|
|
4659
|
+
var errorNotificationSchema = z26.object({
|
|
4660
|
+
threadId: z26.string().min(1).optional(),
|
|
4661
|
+
providerThreadId: z26.string().min(1).optional(),
|
|
4662
|
+
message: z26.string().min(1)
|
|
4655
4663
|
}).passthrough();
|
|
4656
4664
|
|
|
4657
4665
|
// ../provider-bridge-protocol/src/bridge-requests.ts
|
|
4658
|
-
import { z as
|
|
4659
|
-
var toolCallRequestParamsSchema =
|
|
4660
|
-
providerThreadId:
|
|
4661
|
-
threadId:
|
|
4662
|
-
turnId:
|
|
4663
|
-
callId:
|
|
4664
|
-
tool:
|
|
4665
|
-
arguments:
|
|
4666
|
-
providerNativeIds:
|
|
4666
|
+
import { z as z27 } from "zod";
|
|
4667
|
+
var toolCallRequestParamsSchema = z27.object({
|
|
4668
|
+
providerThreadId: z27.string().min(1),
|
|
4669
|
+
threadId: z27.string().min(1).optional(),
|
|
4670
|
+
turnId: z27.union([z27.string().min(1), z27.null()]),
|
|
4671
|
+
callId: z27.string().min(1),
|
|
4672
|
+
tool: z27.string().min(1),
|
|
4673
|
+
arguments: z27.unknown(),
|
|
4674
|
+
providerNativeIds: z27.boolean().optional()
|
|
4667
4675
|
}).passthrough();
|
|
4668
|
-
var toolCallResultSchema =
|
|
4669
|
-
success:
|
|
4670
|
-
contentItems:
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
type:
|
|
4675
|
-
imageUrl:
|
|
4676
|
+
var toolCallResultSchema = z27.object({
|
|
4677
|
+
success: z27.boolean(),
|
|
4678
|
+
contentItems: z27.array(
|
|
4679
|
+
z27.discriminatedUnion("type", [
|
|
4680
|
+
z27.object({ type: z27.literal("inputText"), text: z27.string() }),
|
|
4681
|
+
z27.object({
|
|
4682
|
+
type: z27.literal("inputImage"),
|
|
4683
|
+
imageUrl: z27.string().min(1)
|
|
4676
4684
|
})
|
|
4677
4685
|
])
|
|
4678
4686
|
)
|
|
4679
4687
|
}).passthrough();
|
|
4680
|
-
var interactionRequestParamsSchema =
|
|
4681
|
-
providerThreadId:
|
|
4682
|
-
threadId:
|
|
4683
|
-
turnId:
|
|
4688
|
+
var interactionRequestParamsSchema = z27.object({
|
|
4689
|
+
providerThreadId: z27.string().min(1),
|
|
4690
|
+
threadId: z27.string().min(1).optional(),
|
|
4691
|
+
turnId: z27.union([z27.string().min(1), z27.null()]),
|
|
4684
4692
|
payload: pendingInteractionPayloadSchema,
|
|
4685
|
-
providerNativeIds:
|
|
4693
|
+
providerNativeIds: z27.boolean().optional()
|
|
4686
4694
|
}).passthrough();
|
|
4687
4695
|
|
|
4688
4696
|
// ../provider-bridge-protocol/src/thread-event-grammar.ts
|
|
@@ -4859,7 +4867,7 @@ function threadEvents(context, threadId) {
|
|
|
4859
4867
|
context.client.drainIntoLog();
|
|
4860
4868
|
return context.client.events.filter((entry) => entry.threadId === threadId).map((entry) => entry.event);
|
|
4861
4869
|
}
|
|
4862
|
-
var persistedEventSchema =
|
|
4870
|
+
var persistedEventSchema = z28.preprocess(
|
|
4863
4871
|
(event) => JSON.parse(JSON.stringify(event)),
|
|
4864
4872
|
threadEventSchema
|
|
4865
4873
|
);
|
|
@@ -5954,26 +5962,26 @@ function formatConformanceReport(report) {
|
|
|
5954
5962
|
}
|
|
5955
5963
|
|
|
5956
5964
|
// ../provider-bridge-protocol/src/testing/bridge-json-rpc-test-helpers.ts
|
|
5957
|
-
import { z as
|
|
5958
|
-
var bridgeJsonRpcValueSchema =
|
|
5959
|
-
() =>
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5965
|
+
import { z as z29 } from "zod";
|
|
5966
|
+
var bridgeJsonRpcValueSchema = z29.lazy(
|
|
5967
|
+
() => z29.union([
|
|
5968
|
+
z29.string(),
|
|
5969
|
+
z29.number(),
|
|
5970
|
+
z29.boolean(),
|
|
5971
|
+
z29.null(),
|
|
5972
|
+
z29.array(bridgeJsonRpcValueSchema),
|
|
5973
|
+
z29.record(z29.string(), bridgeJsonRpcValueSchema)
|
|
5966
5974
|
])
|
|
5967
5975
|
);
|
|
5968
|
-
var bridgeJsonRpcOutputSchema =
|
|
5969
|
-
jsonrpc:
|
|
5970
|
-
id:
|
|
5971
|
-
method:
|
|
5976
|
+
var bridgeJsonRpcOutputSchema = z29.object({
|
|
5977
|
+
jsonrpc: z29.literal("2.0"),
|
|
5978
|
+
id: z29.union([z29.string(), z29.number()]).optional(),
|
|
5979
|
+
method: z29.string().optional(),
|
|
5972
5980
|
params: bridgeJsonRpcValueSchema.optional(),
|
|
5973
5981
|
result: bridgeJsonRpcValueSchema.optional(),
|
|
5974
|
-
error:
|
|
5975
|
-
code:
|
|
5976
|
-
message:
|
|
5982
|
+
error: z29.object({
|
|
5983
|
+
code: z29.number(),
|
|
5984
|
+
message: z29.string(),
|
|
5977
5985
|
data: bridgeJsonRpcValueSchema.optional()
|
|
5978
5986
|
}).optional()
|
|
5979
5987
|
});
|