@get-bb/plugin-sdk 0.6.37 → 0.6.39
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 +207 -280
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +1 -10
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +9 -23
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +606 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +32 -90
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +11 -10
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +66 -220
- package/bundled-types/bb-plugin-sdk-testing.d.ts +7 -3
- package/bundled-types/bb-plugin-sdk.d.ts +225 -283
- package/dist/internal/host-policy.js +13 -7
- package/dist/provider-bridge-acp-next.js +24029 -0
- package/dist/provider-bridge-acp.js +959 -873
- package/dist/provider-bridge-testing.js +571 -510
- package/dist/provider-bridge.js +633 -559
- package/dist/testing/index.js +15 -7
- package/package.json +8 -1
package/dist/provider-bridge.js
CHANGED
|
@@ -1030,7 +1030,7 @@ function withoutBridgeRuntimeEnv(env) {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
1032
|
// ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
|
|
1033
|
-
import { z as
|
|
1033
|
+
import { z as z23 } from "zod";
|
|
1034
1034
|
|
|
1035
1035
|
// ../domain/src/context-snapshot.ts
|
|
1036
1036
|
import { z as z3 } from "zod";
|
|
@@ -1114,7 +1114,10 @@ var reasoningLevelValues = [
|
|
|
1114
1114
|
"max",
|
|
1115
1115
|
"ultra"
|
|
1116
1116
|
];
|
|
1117
|
-
var reasoningLevelSchema = z5.
|
|
1117
|
+
var reasoningLevelSchema = z5.string().min(1);
|
|
1118
|
+
function isStandardReasoningLevel(level) {
|
|
1119
|
+
return reasoningLevelValues.includes(level);
|
|
1120
|
+
}
|
|
1118
1121
|
var serviceTierSchema = z5.string().min(1);
|
|
1119
1122
|
var instructionModeValues = ["append", "replace"];
|
|
1120
1123
|
var instructionModeSchema = z5.enum(instructionModeValues);
|
|
@@ -1386,11 +1389,17 @@ var runtimePermissionPolicySchema = z5.discriminatedUnion(
|
|
|
1386
1389
|
]
|
|
1387
1390
|
);
|
|
1388
1391
|
var promptModeSchema = z5.literal("plan");
|
|
1392
|
+
var sessionOptionValueSchema = z5.union([z5.string(), z5.boolean()]);
|
|
1393
|
+
var sessionOptionSelectionsSchema = z5.record(
|
|
1394
|
+
z5.string().min(1),
|
|
1395
|
+
sessionOptionValueSchema
|
|
1396
|
+
);
|
|
1389
1397
|
var runtimeThreadExecutionBaseOptionsSchema = z5.object({
|
|
1390
1398
|
model: z5.string().min(1),
|
|
1391
1399
|
serviceTier: serviceTierSchema,
|
|
1392
1400
|
reasoningLevel: reasoningLevelSchema,
|
|
1393
1401
|
promptMode: promptModeSchema.optional(),
|
|
1402
|
+
sessionOptions: sessionOptionSelectionsSchema.optional(),
|
|
1394
1403
|
providerOptions: jsonObjectSchema
|
|
1395
1404
|
});
|
|
1396
1405
|
var runtimeThreadExecutionOptionsSchema = runtimeThreadExecutionBaseOptionsSchema.and(runtimePermissionPolicySchema);
|
|
@@ -1419,7 +1428,7 @@ var providerNativeSkillRootsSchema = z6.object({
|
|
|
1419
1428
|
user: uniqueProviderSkillRootPathsSchema.default([]),
|
|
1420
1429
|
project: uniqueProviderSkillRootPathsSchema.default([])
|
|
1421
1430
|
}).strict();
|
|
1422
|
-
var acpReasoningCliLevelValueOverridesSchema = z6.
|
|
1431
|
+
var acpReasoningCliLevelValueOverridesSchema = z6.record(
|
|
1423
1432
|
reasoningLevelSchema,
|
|
1424
1433
|
z6.string().min(1)
|
|
1425
1434
|
);
|
|
@@ -2845,11 +2854,16 @@ var threadEventTokenUsageBreakdownSchema = z18.object({
|
|
|
2845
2854
|
outputTokens: z18.number(),
|
|
2846
2855
|
reasoningOutputTokens: z18.number()
|
|
2847
2856
|
});
|
|
2857
|
+
var threadUsageCostSchema = z18.object({
|
|
2858
|
+
amount: z18.number().nonnegative(),
|
|
2859
|
+
currency: z18.string().min(1)
|
|
2860
|
+
});
|
|
2848
2861
|
var threadEventContextWindowUsageSchema = z18.object({
|
|
2849
2862
|
snapshot: contextSnapshotSchema.optional(),
|
|
2850
2863
|
usedTokens: z18.number().nullable(),
|
|
2851
2864
|
modelContextWindow: z18.number().nullable(),
|
|
2852
|
-
estimated: z18.boolean()
|
|
2865
|
+
estimated: z18.boolean(),
|
|
2866
|
+
cost: threadUsageCostSchema.optional()
|
|
2853
2867
|
});
|
|
2854
2868
|
var threadEventTokenUsageSchema = z18.object({
|
|
2855
2869
|
total: threadEventTokenUsageBreakdownSchema,
|
|
@@ -3032,7 +3046,8 @@ var unscopedProviderEventSchema = z18.discriminatedUnion("type", [
|
|
|
3032
3046
|
type: z18.literal("thread/name/updated"),
|
|
3033
3047
|
threadId: z18.string(),
|
|
3034
3048
|
providerThreadId: z18.string(),
|
|
3035
|
-
threadName: z18.string()
|
|
3049
|
+
threadName: z18.string(),
|
|
3050
|
+
source: z18.literal("agent").optional()
|
|
3036
3051
|
}),
|
|
3037
3052
|
z18.object({
|
|
3038
3053
|
type: z18.literal("thread/compacted"),
|
|
@@ -3303,103 +3318,154 @@ function toPositiveNumber(value) {
|
|
|
3303
3318
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
3304
3319
|
}
|
|
3305
3320
|
|
|
3306
|
-
// ../domain/src/provider-
|
|
3321
|
+
// ../domain/src/thread-provider-state.ts
|
|
3307
3322
|
import { z as z19 } from "zod";
|
|
3323
|
+
var THREAD_PROVIDER_COMMANDS_STATE_KIND = "bb/provider-commands";
|
|
3324
|
+
var THREAD_SESSION_OPTIONS_STATE_KIND = "bb/session-options";
|
|
3325
|
+
var threadProviderCommandSchema = z19.object({
|
|
3326
|
+
name: z19.string().min(1),
|
|
3327
|
+
description: z19.string(),
|
|
3328
|
+
inputHint: z19.string().min(1).optional()
|
|
3329
|
+
});
|
|
3330
|
+
var threadProviderCommandsStateSchema = z19.object({
|
|
3331
|
+
commands: z19.array(threadProviderCommandSchema).max(500)
|
|
3332
|
+
});
|
|
3333
|
+
var threadSessionOptionValueSchema = z19.object({
|
|
3334
|
+
id: z19.string().min(1),
|
|
3335
|
+
label: z19.string().min(1),
|
|
3336
|
+
description: z19.string().min(1).optional(),
|
|
3337
|
+
group: z19.string().min(1).optional()
|
|
3338
|
+
});
|
|
3339
|
+
var threadSessionOptionBaseShape = {
|
|
3340
|
+
id: z19.string().min(1),
|
|
3341
|
+
label: z19.string().min(1),
|
|
3342
|
+
description: z19.string().min(1).optional(),
|
|
3343
|
+
category: z19.string().min(1).optional()
|
|
3344
|
+
};
|
|
3345
|
+
var threadSessionOptionSchema = z19.discriminatedUnion("type", [
|
|
3346
|
+
z19.object({
|
|
3347
|
+
...threadSessionOptionBaseShape,
|
|
3348
|
+
type: z19.literal("select"),
|
|
3349
|
+
value: z19.string(),
|
|
3350
|
+
values: z19.array(threadSessionOptionValueSchema).max(1e3)
|
|
3351
|
+
}),
|
|
3352
|
+
z19.object({
|
|
3353
|
+
...threadSessionOptionBaseShape,
|
|
3354
|
+
type: z19.literal("boolean"),
|
|
3355
|
+
value: z19.boolean(),
|
|
3356
|
+
fixed: z19.boolean().optional()
|
|
3357
|
+
})
|
|
3358
|
+
]);
|
|
3359
|
+
var threadSessionOptionsStateSchema = z19.object({
|
|
3360
|
+
options: z19.array(threadSessionOptionSchema).max(64)
|
|
3361
|
+
});
|
|
3362
|
+
var threadSessionOptionSelectionsStateSchema = z19.object({
|
|
3363
|
+
selections: sessionOptionSelectionsSchema
|
|
3364
|
+
});
|
|
3365
|
+
var CORE_THREAD_STATE_SCHEMAS = {
|
|
3366
|
+
[THREAD_PROVIDER_COMMANDS_STATE_KIND]: threadProviderCommandsStateSchema,
|
|
3367
|
+
[THREAD_SESSION_OPTIONS_STATE_KIND]: threadSessionOptionsStateSchema
|
|
3368
|
+
};
|
|
3369
|
+
|
|
3370
|
+
// ../domain/src/provider-fork.ts
|
|
3371
|
+
import { z as z20 } from "zod";
|
|
3308
3372
|
var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
|
|
3309
|
-
var providerForkSchema =
|
|
3373
|
+
var providerForkSchema = z20.enum(PROVIDER_FORK_VALUES);
|
|
3310
3374
|
|
|
3311
3375
|
// ../domain/src/provider-types.ts
|
|
3312
|
-
import { z as
|
|
3313
|
-
var modelReasoningEffortSchema =
|
|
3376
|
+
import { z as z21 } from "zod";
|
|
3377
|
+
var modelReasoningEffortSchema = z21.object({
|
|
3314
3378
|
reasoningEffort: reasoningLevelSchema,
|
|
3315
|
-
|
|
3379
|
+
label: z21.string().min(1).optional(),
|
|
3380
|
+
description: z21.string()
|
|
3316
3381
|
});
|
|
3317
|
-
var modelServiceTierSchema =
|
|
3382
|
+
var modelServiceTierSchema = z21.object({
|
|
3318
3383
|
id: serviceTierSchema,
|
|
3319
|
-
label:
|
|
3320
|
-
description:
|
|
3321
|
-
});
|
|
3322
|
-
var availableModelSchema =
|
|
3323
|
-
id:
|
|
3324
|
-
model:
|
|
3325
|
-
displayName:
|
|
3326
|
-
routeProviderId:
|
|
3327
|
-
description:
|
|
3328
|
-
supportedReasoningEfforts:
|
|
3384
|
+
label: z21.string().min(1).optional(),
|
|
3385
|
+
description: z21.string().min(1).optional()
|
|
3386
|
+
});
|
|
3387
|
+
var availableModelSchema = z21.object({
|
|
3388
|
+
id: z21.string(),
|
|
3389
|
+
model: z21.string(),
|
|
3390
|
+
displayName: z21.string(),
|
|
3391
|
+
routeProviderId: z21.string().min(1).optional(),
|
|
3392
|
+
description: z21.string(),
|
|
3393
|
+
supportedReasoningEfforts: z21.array(modelReasoningEffortSchema),
|
|
3329
3394
|
defaultReasoningEffort: reasoningLevelSchema,
|
|
3330
|
-
supportedServiceTiers:
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
var
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3395
|
+
supportedServiceTiers: z21.array(modelServiceTierSchema).optional(),
|
|
3396
|
+
sessionOptions: z21.array(threadSessionOptionSchema).max(64).optional(),
|
|
3397
|
+
isDefault: z21.boolean()
|
|
3398
|
+
});
|
|
3399
|
+
var providerModelCatalogScopeSchema = z21.enum(["host", "workspace"]);
|
|
3400
|
+
var providerCapabilitiesSchema = z21.object({
|
|
3401
|
+
supportsThreadArchive: z21.boolean(),
|
|
3402
|
+
supportsThreadRename: z21.boolean(),
|
|
3403
|
+
supportsServiceTier: z21.boolean(),
|
|
3404
|
+
supportsNativeUserQuestion: z21.boolean(),
|
|
3405
|
+
supportsFork: z21.boolean(),
|
|
3406
|
+
supportsSessionRewind: z21.boolean(),
|
|
3407
|
+
permissionModes: z21.array(permissionModeSchema).min(1),
|
|
3342
3408
|
modelCatalogScope: providerModelCatalogScopeSchema
|
|
3343
3409
|
});
|
|
3344
|
-
var providerComposerCommandSchema =
|
|
3410
|
+
var providerComposerCommandSchema = z21.object({
|
|
3345
3411
|
trigger: promptMentionCommandTriggerSchema,
|
|
3346
|
-
name:
|
|
3347
|
-
trailingText:
|
|
3412
|
+
name: z21.string().min(1).regex(/^[^\s/$]+$/u),
|
|
3413
|
+
trailingText: z21.string().regex(/^\s*$/u)
|
|
3348
3414
|
});
|
|
3349
|
-
var providerComposerActionSchema =
|
|
3350
|
-
|
|
3351
|
-
kind:
|
|
3415
|
+
var providerComposerActionSchema = z21.discriminatedUnion("kind", [
|
|
3416
|
+
z21.object({
|
|
3417
|
+
kind: z21.literal("skills"),
|
|
3352
3418
|
trigger: promptMentionCommandTriggerSchema
|
|
3353
3419
|
}),
|
|
3354
|
-
|
|
3355
|
-
kind:
|
|
3420
|
+
z21.object({
|
|
3421
|
+
kind: z21.literal("plan"),
|
|
3356
3422
|
command: providerComposerCommandSchema
|
|
3357
3423
|
}),
|
|
3358
|
-
|
|
3359
|
-
kind:
|
|
3424
|
+
z21.object({
|
|
3425
|
+
kind: z21.literal("goal"),
|
|
3360
3426
|
command: providerComposerCommandSchema
|
|
3361
3427
|
})
|
|
3362
3428
|
]);
|
|
3363
|
-
var providerStringsSchema =
|
|
3364
|
-
signInHint:
|
|
3365
|
-
expiredHint:
|
|
3366
|
-
installUrl:
|
|
3367
|
-
brandPrefix:
|
|
3368
|
-
planModeCopy:
|
|
3369
|
-
iconTint:
|
|
3370
|
-
});
|
|
3371
|
-
var providerOptionDescriptorSchema =
|
|
3372
|
-
id:
|
|
3373
|
-
label:
|
|
3374
|
-
description:
|
|
3375
|
-
});
|
|
3376
|
-
var providerExtensionKindInfoSchema =
|
|
3377
|
-
item:
|
|
3378
|
-
state:
|
|
3379
|
-
});
|
|
3380
|
-
var providerExtensionKindsSchema =
|
|
3429
|
+
var providerStringsSchema = z21.object({
|
|
3430
|
+
signInHint: z21.string().min(1),
|
|
3431
|
+
expiredHint: z21.string().min(1),
|
|
3432
|
+
installUrl: z21.string().min(1),
|
|
3433
|
+
brandPrefix: z21.string().min(1).optional(),
|
|
3434
|
+
planModeCopy: z21.string().min(1).optional(),
|
|
3435
|
+
iconTint: z21.object({ light: z21.string().min(1), dark: z21.string().min(1) }).optional()
|
|
3436
|
+
});
|
|
3437
|
+
var providerOptionDescriptorSchema = z21.object({
|
|
3438
|
+
id: z21.string().min(1),
|
|
3439
|
+
label: z21.string().min(1),
|
|
3440
|
+
description: z21.string().min(1).optional()
|
|
3441
|
+
});
|
|
3442
|
+
var providerExtensionKindInfoSchema = z21.object({
|
|
3443
|
+
item: z21.boolean(),
|
|
3444
|
+
state: z21.boolean()
|
|
3445
|
+
});
|
|
3446
|
+
var providerExtensionKindsSchema = z21.record(
|
|
3381
3447
|
extensionKindSchema,
|
|
3382
3448
|
providerExtensionKindInfoSchema
|
|
3383
3449
|
);
|
|
3384
|
-
var providerInfoSchema =
|
|
3385
|
-
id:
|
|
3386
|
-
pluginId:
|
|
3387
|
-
displayName:
|
|
3388
|
-
family:
|
|
3389
|
-
icon:
|
|
3390
|
-
logoUrl:
|
|
3391
|
-
maintenance:
|
|
3392
|
-
health:
|
|
3393
|
-
usage:
|
|
3394
|
-
installation:
|
|
3450
|
+
var providerInfoSchema = z21.object({
|
|
3451
|
+
id: z21.string(),
|
|
3452
|
+
pluginId: z21.string().min(1),
|
|
3453
|
+
displayName: z21.string(),
|
|
3454
|
+
family: z21.string().min(1).optional(),
|
|
3455
|
+
icon: z21.object({ glyph: z21.string().min(1) }).optional(),
|
|
3456
|
+
logoUrl: z21.string().min(1).nullable(),
|
|
3457
|
+
maintenance: z21.object({
|
|
3458
|
+
health: z21.boolean(),
|
|
3459
|
+
usage: z21.boolean(),
|
|
3460
|
+
installation: z21.boolean()
|
|
3395
3461
|
}),
|
|
3396
3462
|
capabilities: providerCapabilitiesSchema,
|
|
3397
|
-
composerActions:
|
|
3463
|
+
composerActions: z21.array(providerComposerActionSchema),
|
|
3398
3464
|
completedTurnDisplay: completedTurnDisplaySchema,
|
|
3399
|
-
available:
|
|
3465
|
+
available: z21.boolean(),
|
|
3400
3466
|
strings: providerStringsSchema.optional(),
|
|
3401
|
-
serviceTiers:
|
|
3402
|
-
reasoningLevels:
|
|
3467
|
+
serviceTiers: z21.array(providerOptionDescriptorSchema).optional(),
|
|
3468
|
+
reasoningLevels: z21.array(providerOptionDescriptorSchema).optional(),
|
|
3403
3469
|
extensionKinds: providerExtensionKindsSchema.optional()
|
|
3404
3470
|
});
|
|
3405
3471
|
var providerRecoveryKindValues = [
|
|
@@ -3409,34 +3475,34 @@ var providerRecoveryKindValues = [
|
|
|
3409
3475
|
"staleTurn",
|
|
3410
3476
|
"rateLimited"
|
|
3411
3477
|
];
|
|
3412
|
-
var providerRecoveryKindSchema =
|
|
3413
|
-
var toolCallOutputItemSchema =
|
|
3414
|
-
|
|
3415
|
-
type:
|
|
3416
|
-
text:
|
|
3478
|
+
var providerRecoveryKindSchema = z21.enum(providerRecoveryKindValues);
|
|
3479
|
+
var toolCallOutputItemSchema = z21.discriminatedUnion("type", [
|
|
3480
|
+
z21.object({
|
|
3481
|
+
type: z21.literal("inputText"),
|
|
3482
|
+
text: z21.string()
|
|
3417
3483
|
}),
|
|
3418
|
-
|
|
3419
|
-
type:
|
|
3420
|
-
imageUrl:
|
|
3484
|
+
z21.object({
|
|
3485
|
+
type: z21.literal("inputImage"),
|
|
3486
|
+
imageUrl: z21.string()
|
|
3421
3487
|
})
|
|
3422
3488
|
]);
|
|
3423
|
-
var toolCallRequestSchema =
|
|
3424
|
-
requestId:
|
|
3425
|
-
threadId:
|
|
3426
|
-
providerThreadId:
|
|
3427
|
-
turnId:
|
|
3428
|
-
callId:
|
|
3429
|
-
tool:
|
|
3430
|
-
arguments:
|
|
3431
|
-
});
|
|
3432
|
-
var toolCallResponseSchema =
|
|
3433
|
-
contentItems:
|
|
3434
|
-
success:
|
|
3435
|
-
});
|
|
3436
|
-
var dynamicToolSchema =
|
|
3437
|
-
name:
|
|
3438
|
-
description:
|
|
3439
|
-
inputSchema:
|
|
3489
|
+
var toolCallRequestSchema = z21.object({
|
|
3490
|
+
requestId: z21.union([z21.string().min(1), z21.number()]),
|
|
3491
|
+
threadId: z21.string().min(1),
|
|
3492
|
+
providerThreadId: z21.string().min(1),
|
|
3493
|
+
turnId: z21.string().min(1),
|
|
3494
|
+
callId: z21.string().min(1),
|
|
3495
|
+
tool: z21.string().min(1),
|
|
3496
|
+
arguments: z21.unknown().optional()
|
|
3497
|
+
});
|
|
3498
|
+
var toolCallResponseSchema = z21.object({
|
|
3499
|
+
contentItems: z21.array(toolCallOutputItemSchema),
|
|
3500
|
+
success: z21.boolean()
|
|
3501
|
+
});
|
|
3502
|
+
var dynamicToolSchema = z21.object({
|
|
3503
|
+
name: z21.string(),
|
|
3504
|
+
description: z21.string(),
|
|
3505
|
+
inputSchema: z21.unknown(),
|
|
3440
3506
|
presentation: threadEventItemPresentationSchema.optional()
|
|
3441
3507
|
});
|
|
3442
3508
|
|
|
@@ -3484,64 +3550,66 @@ var REASONING_EFFORT_BY_LEVEL = {
|
|
|
3484
3550
|
ultra: ULTRA_REASONING_EFFORT
|
|
3485
3551
|
};
|
|
3486
3552
|
function reasoningEffortsForLevels(levels) {
|
|
3487
|
-
return levels.map(
|
|
3553
|
+
return levels.map(
|
|
3554
|
+
(level) => isStandardReasoningLevel(level) ? { ...REASONING_EFFORT_BY_LEVEL[level] } : { reasoningEffort: level, description: level }
|
|
3555
|
+
);
|
|
3488
3556
|
}
|
|
3489
3557
|
|
|
3490
3558
|
// ../provider-bridge-protocol/src/bridge-requests.ts
|
|
3491
|
-
import { z as
|
|
3559
|
+
import { z as z22 } from "zod";
|
|
3492
3560
|
var BRIDGE_INBOUND_REQUEST_METHODS = {
|
|
3493
3561
|
toolCall: "item/tool/call",
|
|
3494
3562
|
interactionRequest: "interaction/request"
|
|
3495
3563
|
};
|
|
3496
|
-
var toolCallRequestParamsSchema =
|
|
3497
|
-
providerThreadId:
|
|
3498
|
-
threadId:
|
|
3499
|
-
turnId:
|
|
3500
|
-
callId:
|
|
3501
|
-
tool:
|
|
3502
|
-
arguments:
|
|
3503
|
-
providerNativeIds:
|
|
3564
|
+
var toolCallRequestParamsSchema = z22.object({
|
|
3565
|
+
providerThreadId: z22.string().min(1),
|
|
3566
|
+
threadId: z22.string().min(1).optional(),
|
|
3567
|
+
turnId: z22.union([z22.string().min(1), z22.null()]),
|
|
3568
|
+
callId: z22.string().min(1),
|
|
3569
|
+
tool: z22.string().min(1),
|
|
3570
|
+
arguments: z22.unknown(),
|
|
3571
|
+
providerNativeIds: z22.boolean().optional()
|
|
3504
3572
|
}).passthrough();
|
|
3505
|
-
var toolCallResultSchema =
|
|
3506
|
-
success:
|
|
3507
|
-
contentItems:
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
type:
|
|
3512
|
-
imageUrl:
|
|
3573
|
+
var toolCallResultSchema = z22.object({
|
|
3574
|
+
success: z22.boolean(),
|
|
3575
|
+
contentItems: z22.array(
|
|
3576
|
+
z22.discriminatedUnion("type", [
|
|
3577
|
+
z22.object({ type: z22.literal("inputText"), text: z22.string() }),
|
|
3578
|
+
z22.object({
|
|
3579
|
+
type: z22.literal("inputImage"),
|
|
3580
|
+
imageUrl: z22.string().min(1)
|
|
3513
3581
|
})
|
|
3514
3582
|
])
|
|
3515
3583
|
)
|
|
3516
3584
|
}).passthrough();
|
|
3517
|
-
var interactionRequestParamsSchema =
|
|
3518
|
-
providerThreadId:
|
|
3519
|
-
threadId:
|
|
3520
|
-
turnId:
|
|
3585
|
+
var interactionRequestParamsSchema = z22.object({
|
|
3586
|
+
providerThreadId: z22.string().min(1),
|
|
3587
|
+
threadId: z22.string().min(1).optional(),
|
|
3588
|
+
turnId: z22.union([z22.string().min(1), z22.null()]),
|
|
3521
3589
|
payload: pendingInteractionPayloadSchema,
|
|
3522
|
-
providerNativeIds:
|
|
3590
|
+
providerNativeIds: z22.boolean().optional()
|
|
3523
3591
|
}).passthrough();
|
|
3524
3592
|
|
|
3525
3593
|
// ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
|
|
3526
|
-
var bridgeRequestEnvelopeSchema =
|
|
3527
|
-
jsonrpc:
|
|
3528
|
-
id:
|
|
3529
|
-
method:
|
|
3530
|
-
params:
|
|
3531
|
-
});
|
|
3532
|
-
var jsonRpcErrorSchema =
|
|
3533
|
-
code:
|
|
3534
|
-
message:
|
|
3535
|
-
data:
|
|
3536
|
-
});
|
|
3537
|
-
var jsonRpcSuccessResponseSchema =
|
|
3538
|
-
jsonrpc:
|
|
3539
|
-
id:
|
|
3540
|
-
result:
|
|
3541
|
-
});
|
|
3542
|
-
var jsonRpcErrorResponseSchema =
|
|
3543
|
-
jsonrpc:
|
|
3544
|
-
id:
|
|
3594
|
+
var bridgeRequestEnvelopeSchema = z23.object({
|
|
3595
|
+
jsonrpc: z23.literal("2.0"),
|
|
3596
|
+
id: z23.union([z23.string(), z23.number()]),
|
|
3597
|
+
method: z23.string(),
|
|
3598
|
+
params: z23.record(z23.string(), z23.unknown()).optional()
|
|
3599
|
+
});
|
|
3600
|
+
var jsonRpcErrorSchema = z23.object({
|
|
3601
|
+
code: z23.number(),
|
|
3602
|
+
message: z23.string().optional(),
|
|
3603
|
+
data: z23.unknown().optional()
|
|
3604
|
+
});
|
|
3605
|
+
var jsonRpcSuccessResponseSchema = z23.object({
|
|
3606
|
+
jsonrpc: z23.literal("2.0"),
|
|
3607
|
+
id: z23.union([z23.string(), z23.number()]),
|
|
3608
|
+
result: z23.unknown()
|
|
3609
|
+
});
|
|
3610
|
+
var jsonRpcErrorResponseSchema = z23.object({
|
|
3611
|
+
jsonrpc: z23.literal("2.0"),
|
|
3612
|
+
id: z23.union([z23.string(), z23.number()]),
|
|
3545
3613
|
error: jsonRpcErrorSchema
|
|
3546
3614
|
});
|
|
3547
3615
|
function isJsonRpcRequest(input) {
|
|
@@ -3629,47 +3697,47 @@ function buildBridgeToolCallContent(result) {
|
|
|
3629
3697
|
}
|
|
3630
3698
|
|
|
3631
3699
|
// ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
|
|
3632
|
-
import { z as
|
|
3633
|
-
var recordSchema =
|
|
3634
|
-
var jsonRpcEnvelopeSchema =
|
|
3635
|
-
jsonrpc:
|
|
3636
|
-
method:
|
|
3700
|
+
import { z as z24 } from "zod";
|
|
3701
|
+
var recordSchema = z24.record(z24.string(), z24.unknown());
|
|
3702
|
+
var jsonRpcEnvelopeSchema = z24.object({
|
|
3703
|
+
jsonrpc: z24.literal("2.0"),
|
|
3704
|
+
method: z24.string(),
|
|
3637
3705
|
params: recordSchema.optional()
|
|
3638
3706
|
}).passthrough();
|
|
3639
|
-
var sdkMessageEnvelopeSchema =
|
|
3640
|
-
jsonrpc:
|
|
3641
|
-
method:
|
|
3642
|
-
params:
|
|
3643
|
-
message:
|
|
3644
|
-
threadId:
|
|
3645
|
-
parent_tool_use_id:
|
|
3707
|
+
var sdkMessageEnvelopeSchema = z24.object({
|
|
3708
|
+
jsonrpc: z24.literal("2.0"),
|
|
3709
|
+
method: z24.literal("sdk/message"),
|
|
3710
|
+
params: z24.object({
|
|
3711
|
+
message: z24.unknown(),
|
|
3712
|
+
threadId: z24.string().optional(),
|
|
3713
|
+
parent_tool_use_id: z24.string().optional()
|
|
3646
3714
|
}).passthrough()
|
|
3647
3715
|
}).passthrough();
|
|
3648
|
-
var threadIdentityEnvelopeSchema =
|
|
3649
|
-
jsonrpc:
|
|
3650
|
-
method:
|
|
3651
|
-
params:
|
|
3652
|
-
threadId:
|
|
3653
|
-
providerThreadId:
|
|
3716
|
+
var threadIdentityEnvelopeSchema = z24.object({
|
|
3717
|
+
jsonrpc: z24.literal("2.0"),
|
|
3718
|
+
method: z24.literal("thread/identity"),
|
|
3719
|
+
params: z24.object({
|
|
3720
|
+
threadId: z24.string().optional(),
|
|
3721
|
+
providerThreadId: z24.string().optional()
|
|
3654
3722
|
}).passthrough()
|
|
3655
3723
|
}).passthrough();
|
|
3656
|
-
var threadContextWindowUsageEnvelopeSchema =
|
|
3657
|
-
jsonrpc:
|
|
3658
|
-
method:
|
|
3659
|
-
params:
|
|
3660
|
-
threadId:
|
|
3661
|
-
contextWindowUsage:
|
|
3662
|
-
usedTokens:
|
|
3663
|
-
modelContextWindow:
|
|
3664
|
-
estimated:
|
|
3724
|
+
var threadContextWindowUsageEnvelopeSchema = z24.object({
|
|
3725
|
+
jsonrpc: z24.literal("2.0"),
|
|
3726
|
+
method: z24.literal("thread/contextWindowUsage/updated"),
|
|
3727
|
+
params: z24.object({
|
|
3728
|
+
threadId: z24.string().optional(),
|
|
3729
|
+
contextWindowUsage: z24.object({
|
|
3730
|
+
usedTokens: z24.number().nullable(),
|
|
3731
|
+
modelContextWindow: z24.number().nullable(),
|
|
3732
|
+
estimated: z24.boolean()
|
|
3665
3733
|
})
|
|
3666
3734
|
}).passthrough()
|
|
3667
3735
|
}).passthrough();
|
|
3668
|
-
var errorEnvelopeSchema =
|
|
3669
|
-
jsonrpc:
|
|
3670
|
-
method:
|
|
3671
|
-
params:
|
|
3672
|
-
message:
|
|
3736
|
+
var errorEnvelopeSchema = z24.object({
|
|
3737
|
+
jsonrpc: z24.literal("2.0"),
|
|
3738
|
+
method: z24.literal("error"),
|
|
3739
|
+
params: z24.object({
|
|
3740
|
+
message: z24.string().optional()
|
|
3673
3741
|
}).passthrough().optional()
|
|
3674
3742
|
}).passthrough();
|
|
3675
3743
|
|
|
@@ -11089,7 +11157,7 @@ import { constants as fsConstants } from "node:fs";
|
|
|
11089
11157
|
import { access } from "node:fs/promises";
|
|
11090
11158
|
import path8 from "node:path";
|
|
11091
11159
|
import { promisify as promisify4 } from "node:util";
|
|
11092
|
-
import { z as
|
|
11160
|
+
import { z as z25 } from "zod";
|
|
11093
11161
|
var execFileAsync2 = promisify4(execFile3);
|
|
11094
11162
|
var CLI_PROBE_TIMEOUT_MS = 5e3;
|
|
11095
11163
|
var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
|
|
@@ -11198,8 +11266,8 @@ function firstLine(value) {
|
|
|
11198
11266
|
function npmGlobalPackageVersion(value, npmPackage) {
|
|
11199
11267
|
if (value === null) return null;
|
|
11200
11268
|
try {
|
|
11201
|
-
const parsed =
|
|
11202
|
-
dependencies:
|
|
11269
|
+
const parsed = z25.object({
|
|
11270
|
+
dependencies: z25.record(z25.string(), z25.object({ version: z25.string().min(1) })).default({})
|
|
11203
11271
|
}).safeParse(JSON.parse(value));
|
|
11204
11272
|
return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
|
|
11205
11273
|
} catch {
|
|
@@ -11250,9 +11318,9 @@ function clampPercent(value) {
|
|
|
11250
11318
|
}
|
|
11251
11319
|
|
|
11252
11320
|
// ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
|
|
11253
|
-
import { z as
|
|
11254
|
-
var providerToolCallCancellationSchema =
|
|
11255
|
-
requestId:
|
|
11321
|
+
import { z as z26 } from "zod";
|
|
11322
|
+
var providerToolCallCancellationSchema = z26.object({
|
|
11323
|
+
requestId: z26.union([z26.string(), z26.number().int()])
|
|
11256
11324
|
});
|
|
11257
11325
|
|
|
11258
11326
|
// ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
|
|
@@ -11267,10 +11335,10 @@ function createProviderVisibilityMetadata(args) {
|
|
|
11267
11335
|
}
|
|
11268
11336
|
|
|
11269
11337
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
11270
|
-
import { z as
|
|
11338
|
+
import { z as z28 } from "zod";
|
|
11271
11339
|
|
|
11272
11340
|
// ../provider-bridge-protocol/src/errors.ts
|
|
11273
|
-
import { z as
|
|
11341
|
+
import { z as z27 } from "zod";
|
|
11274
11342
|
var BRIDGE_JSON_RPC_ERRORS = {
|
|
11275
11343
|
INVALID_PARAMS: -32602,
|
|
11276
11344
|
METHOD_NOT_FOUND: -32601,
|
|
@@ -11280,12 +11348,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
|
|
|
11280
11348
|
FORK_CHECKPOINT_UNSUPPORTED: -32003,
|
|
11281
11349
|
MISSING_EXECUTABLE: -32004
|
|
11282
11350
|
};
|
|
11283
|
-
var providerRecoveryHintSchema =
|
|
11351
|
+
var providerRecoveryHintSchema = z27.object({
|
|
11284
11352
|
kind: providerRecoveryKindSchema,
|
|
11285
|
-
message:
|
|
11286
|
-
retryable:
|
|
11353
|
+
message: z27.string().min(1),
|
|
11354
|
+
retryable: z27.boolean()
|
|
11287
11355
|
});
|
|
11288
|
-
var bridgeErrorDataSchema =
|
|
11356
|
+
var bridgeErrorDataSchema = z27.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
|
|
11289
11357
|
|
|
11290
11358
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
11291
11359
|
var JSON_RPC_INVALID_PARAMS_CODE = -32602;
|
|
@@ -11303,7 +11371,7 @@ var ProviderResponseEncodeError = class extends Error {
|
|
|
11303
11371
|
this.name = "ProviderResponseEncodeError";
|
|
11304
11372
|
}
|
|
11305
11373
|
};
|
|
11306
|
-
var ignoredJsonRpcResultSchema =
|
|
11374
|
+
var ignoredJsonRpcResultSchema = z28.unknown();
|
|
11307
11375
|
|
|
11308
11376
|
// ../provider-bridge-protocol/src/version.ts
|
|
11309
11377
|
var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
|
|
@@ -11311,67 +11379,68 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
|
|
|
11311
11379
|
var THREAD_DELTA_GRAMMAR_V3 = 3;
|
|
11312
11380
|
|
|
11313
11381
|
// ../provider-bridge-protocol/src/handshake.ts
|
|
11314
|
-
import { z as
|
|
11315
|
-
var bridgeGrammarVersionsSchema =
|
|
11382
|
+
import { z as z29 } from "zod";
|
|
11383
|
+
var bridgeGrammarVersionsSchema = z29.tuple([z29.number().int().positive(), z29.number().int().positive()]).refine(([min, max]) => min <= max, {
|
|
11316
11384
|
message: "grammarVersions must be an ascending [min, max] range"
|
|
11317
11385
|
});
|
|
11318
|
-
var bridgeSteerModeSchema =
|
|
11319
|
-
var bridgeCapabilitiesSchema =
|
|
11320
|
-
sessionRestore:
|
|
11321
|
-
threadArchive:
|
|
11322
|
-
threadRename:
|
|
11323
|
-
threadGoalClear:
|
|
11386
|
+
var bridgeSteerModeSchema = z29.enum(["inject", "queue"]);
|
|
11387
|
+
var bridgeCapabilitiesSchema = z29.object({
|
|
11388
|
+
sessionRestore: z29.boolean().default(false),
|
|
11389
|
+
threadArchive: z29.boolean().default(false),
|
|
11390
|
+
threadRename: z29.boolean().default(false),
|
|
11391
|
+
threadGoalClear: z29.boolean().default(false),
|
|
11324
11392
|
fork: providerForkSchema.default("none"),
|
|
11325
|
-
approvalEnforcedBy:
|
|
11393
|
+
approvalEnforcedBy: z29.enum(["runtime", "provider"]).default("runtime"),
|
|
11326
11394
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
11327
11395
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
11328
11396
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
11329
11397
|
]),
|
|
11330
11398
|
steerMode: bridgeSteerModeSchema.default("queue"),
|
|
11331
|
-
skills:
|
|
11399
|
+
skills: z29.object({ configure: z29.boolean().default(false) }).default({ configure: false })
|
|
11332
11400
|
}).passthrough();
|
|
11333
|
-
var initializeParamsSchema =
|
|
11334
|
-
protocolVersion:
|
|
11335
|
-
client:
|
|
11401
|
+
var initializeParamsSchema = z29.object({
|
|
11402
|
+
protocolVersion: z29.number().int().positive(),
|
|
11403
|
+
client: z29.object({ name: z29.string().min(1), version: z29.string().min(1) }),
|
|
11336
11404
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
11337
11405
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
11338
11406
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
11339
11407
|
])
|
|
11340
11408
|
}).passthrough();
|
|
11341
|
-
var initializeResultSchema =
|
|
11342
|
-
protocolVersion:
|
|
11343
|
-
capabilities:
|
|
11409
|
+
var initializeResultSchema = z29.object({
|
|
11410
|
+
protocolVersion: z29.number().int().positive(),
|
|
11411
|
+
capabilities: z29.preprocess(
|
|
11344
11412
|
(value) => value ?? {},
|
|
11345
11413
|
bridgeCapabilitiesSchema
|
|
11346
11414
|
)
|
|
11347
11415
|
}).passthrough();
|
|
11348
11416
|
|
|
11349
11417
|
// ../provider-bridge-protocol/src/execution-options.ts
|
|
11350
|
-
import { z as
|
|
11351
|
-
var bridgeExecutionOptionsSchema =
|
|
11352
|
-
model:
|
|
11418
|
+
import { z as z30 } from "zod";
|
|
11419
|
+
var bridgeExecutionOptionsSchema = z30.object({
|
|
11420
|
+
model: z30.string().min(1).optional(),
|
|
11353
11421
|
serviceTier: serviceTierSchema.optional(),
|
|
11354
11422
|
reasoningLevel: reasoningLevelSchema.optional(),
|
|
11355
11423
|
promptMode: promptModeSchema.optional(),
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11424
|
+
sessionOptions: sessionOptionSelectionsSchema.optional(),
|
|
11425
|
+
instructions: z30.string().optional(),
|
|
11426
|
+
envVars: z30.record(z30.string(), z30.string()).optional(),
|
|
11427
|
+
providerOptions: z30.record(z30.string(), z30.unknown()).optional()
|
|
11359
11428
|
}).and(runtimePermissionPolicySchema);
|
|
11360
11429
|
|
|
11361
11430
|
// ../provider-bridge-protocol/src/provider-maintenance.ts
|
|
11362
|
-
import { z as
|
|
11363
|
-
var providerMaintenanceParamsSchema =
|
|
11364
|
-
providerId:
|
|
11365
|
-
cwd:
|
|
11366
|
-
providerOptions:
|
|
11431
|
+
import { z as z31 } from "zod";
|
|
11432
|
+
var providerMaintenanceParamsSchema = z31.object({
|
|
11433
|
+
providerId: z31.string().min(1),
|
|
11434
|
+
cwd: z31.string().min(1).optional(),
|
|
11435
|
+
providerOptions: z31.record(z31.string(), z31.unknown()).optional()
|
|
11367
11436
|
}).passthrough();
|
|
11368
|
-
var providerInstallationRequirementSchema =
|
|
11437
|
+
var providerInstallationRequirementSchema = z31.enum(["thread_rewind"]);
|
|
11369
11438
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
11370
11439
|
requirement: providerInstallationRequirementSchema.optional(),
|
|
11371
|
-
checkUpdates:
|
|
11440
|
+
checkUpdates: z31.boolean().default(true)
|
|
11372
11441
|
});
|
|
11373
|
-
var providerHealthSchema =
|
|
11374
|
-
status:
|
|
11442
|
+
var providerHealthSchema = z31.object({
|
|
11443
|
+
status: z31.enum([
|
|
11375
11444
|
"ready",
|
|
11376
11445
|
"not_installed",
|
|
11377
11446
|
"unauthenticated",
|
|
@@ -11379,115 +11448,115 @@ var providerHealthSchema = z30.object({
|
|
|
11379
11448
|
"unsupported_version",
|
|
11380
11449
|
"unknown"
|
|
11381
11450
|
]),
|
|
11382
|
-
statusMessage:
|
|
11383
|
-
accountEmail:
|
|
11384
|
-
planLabel:
|
|
11385
|
-
installedVersion:
|
|
11386
|
-
minimumSupportedVersion:
|
|
11387
|
-
canInstall:
|
|
11388
|
-
canUpdate:
|
|
11389
|
-
loginCommand:
|
|
11390
|
-
localLoginCommand:
|
|
11451
|
+
statusMessage: z31.string().min(1).nullable(),
|
|
11452
|
+
accountEmail: z31.string().nullable(),
|
|
11453
|
+
planLabel: z31.string().min(1).nullable(),
|
|
11454
|
+
installedVersion: z31.string().min(1).nullable(),
|
|
11455
|
+
minimumSupportedVersion: z31.string().min(1).nullable(),
|
|
11456
|
+
canInstall: z31.boolean(),
|
|
11457
|
+
canUpdate: z31.boolean(),
|
|
11458
|
+
loginCommand: z31.string().min(1).nullable(),
|
|
11459
|
+
localLoginCommand: z31.string().min(1).nullable().optional()
|
|
11391
11460
|
}).passthrough();
|
|
11392
|
-
var providerUsageWindowSchema =
|
|
11393
|
-
label:
|
|
11394
|
-
usedPercent:
|
|
11395
|
-
resetsAt:
|
|
11396
|
-
cost:
|
|
11397
|
-
usedUsdCents:
|
|
11398
|
-
limitUsdCents:
|
|
11461
|
+
var providerUsageWindowSchema = z31.object({
|
|
11462
|
+
label: z31.string().min(1),
|
|
11463
|
+
usedPercent: z31.number().min(0).max(100),
|
|
11464
|
+
resetsAt: z31.string().min(1).nullable(),
|
|
11465
|
+
cost: z31.object({
|
|
11466
|
+
usedUsdCents: z31.number().int().nonnegative(),
|
|
11467
|
+
limitUsdCents: z31.number().int().positive()
|
|
11399
11468
|
}).optional()
|
|
11400
11469
|
}).passthrough();
|
|
11401
|
-
var providerUsageSchema =
|
|
11402
|
-
|
|
11403
|
-
status:
|
|
11404
|
-
accountEmail:
|
|
11405
|
-
planLabel:
|
|
11406
|
-
windows:
|
|
11470
|
+
var providerUsageSchema = z31.discriminatedUnion("status", [
|
|
11471
|
+
z31.object({
|
|
11472
|
+
status: z31.literal("ok"),
|
|
11473
|
+
accountEmail: z31.string().email().nullable(),
|
|
11474
|
+
planLabel: z31.string().min(1).nullable(),
|
|
11475
|
+
windows: z31.array(providerUsageWindowSchema)
|
|
11407
11476
|
}).passthrough(),
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
status:
|
|
11413
|
-
message:
|
|
11414
|
-
planLabel:
|
|
11415
|
-
accountEmail:
|
|
11477
|
+
z31.object({ status: z31.literal("not_installed") }).passthrough(),
|
|
11478
|
+
z31.object({ status: z31.literal("unauthenticated") }).passthrough(),
|
|
11479
|
+
z31.object({ status: z31.literal("expired") }).passthrough(),
|
|
11480
|
+
z31.object({
|
|
11481
|
+
status: z31.literal("error"),
|
|
11482
|
+
message: z31.string().min(1),
|
|
11483
|
+
planLabel: z31.string().min(1).nullable().default(null),
|
|
11484
|
+
accountEmail: z31.string().nullable().default(null)
|
|
11416
11485
|
}).passthrough()
|
|
11417
11486
|
]);
|
|
11418
|
-
var providerHealthResultSchema =
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
supported:
|
|
11487
|
+
var providerHealthResultSchema = z31.discriminatedUnion("supported", [
|
|
11488
|
+
z31.object({ supported: z31.literal(false) }).passthrough(),
|
|
11489
|
+
z31.object({
|
|
11490
|
+
supported: z31.literal(true),
|
|
11422
11491
|
health: providerHealthSchema
|
|
11423
11492
|
}).passthrough()
|
|
11424
11493
|
]);
|
|
11425
|
-
var providerUsageResultSchema =
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
supported:
|
|
11494
|
+
var providerUsageResultSchema = z31.discriminatedUnion("supported", [
|
|
11495
|
+
z31.object({ supported: z31.literal(false) }).passthrough(),
|
|
11496
|
+
z31.object({
|
|
11497
|
+
supported: z31.literal(true),
|
|
11429
11498
|
usage: providerUsageSchema
|
|
11430
11499
|
}).passthrough()
|
|
11431
11500
|
]);
|
|
11432
|
-
var providerInstallationActionKindSchema =
|
|
11501
|
+
var providerInstallationActionKindSchema = z31.enum([
|
|
11433
11502
|
"install",
|
|
11434
11503
|
"update"
|
|
11435
11504
|
]);
|
|
11436
|
-
var providerInstallationActionSchema =
|
|
11505
|
+
var providerInstallationActionSchema = z31.object({
|
|
11437
11506
|
kind: providerInstallationActionKindSchema,
|
|
11438
|
-
label:
|
|
11439
|
-
command:
|
|
11507
|
+
label: z31.enum(["Install", "Update"]),
|
|
11508
|
+
command: z31.string().min(1)
|
|
11440
11509
|
}).passthrough();
|
|
11441
|
-
var providerInstallationSourceSchema =
|
|
11510
|
+
var providerInstallationSourceSchema = z31.enum([
|
|
11442
11511
|
"notInstalled",
|
|
11443
11512
|
"npmGlobal",
|
|
11444
11513
|
"external"
|
|
11445
11514
|
]);
|
|
11446
|
-
var providerInstallationStatusSchema =
|
|
11447
|
-
executableName:
|
|
11448
|
-
executablePath:
|
|
11449
|
-
installed:
|
|
11515
|
+
var providerInstallationStatusSchema = z31.object({
|
|
11516
|
+
executableName: z31.string().min(1),
|
|
11517
|
+
executablePath: z31.string().min(1).nullable(),
|
|
11518
|
+
installed: z31.boolean(),
|
|
11450
11519
|
installSource: providerInstallationSourceSchema,
|
|
11451
|
-
currentVersion:
|
|
11452
|
-
latestVersion:
|
|
11453
|
-
minimumSupportedVersion:
|
|
11454
|
-
npmPackageName:
|
|
11455
|
-
npmGlobalPackageVersion:
|
|
11520
|
+
currentVersion: z31.string().min(1).nullable(),
|
|
11521
|
+
latestVersion: z31.string().min(1).nullable(),
|
|
11522
|
+
minimumSupportedVersion: z31.string().min(1).nullable(),
|
|
11523
|
+
npmPackageName: z31.string().min(1).nullable(),
|
|
11524
|
+
npmGlobalPackageVersion: z31.string().min(1).nullable(),
|
|
11456
11525
|
installAction: providerInstallationActionSchema.nullable(),
|
|
11457
|
-
needsUpdate:
|
|
11458
|
-
versionUnsupported:
|
|
11526
|
+
needsUpdate: z31.boolean(),
|
|
11527
|
+
versionUnsupported: z31.boolean()
|
|
11459
11528
|
}).passthrough();
|
|
11460
11529
|
var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
11461
11530
|
action: providerInstallationActionKindSchema
|
|
11462
11531
|
});
|
|
11463
|
-
var providerInstallationCommandSchema =
|
|
11464
|
-
command:
|
|
11465
|
-
args:
|
|
11466
|
-
displayCommand:
|
|
11532
|
+
var providerInstallationCommandSchema = z31.object({
|
|
11533
|
+
command: z31.string().min(1),
|
|
11534
|
+
args: z31.array(z31.string()).max(64),
|
|
11535
|
+
displayCommand: z31.string().min(1)
|
|
11467
11536
|
}).passthrough();
|
|
11468
|
-
var providerInstallationVerificationSchema =
|
|
11537
|
+
var providerInstallationVerificationSchema = z31.discriminatedUnion(
|
|
11469
11538
|
"kind",
|
|
11470
11539
|
[
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
kind:
|
|
11474
|
-
previousVersion:
|
|
11540
|
+
z31.object({ kind: z31.literal("installed") }).passthrough(),
|
|
11541
|
+
z31.object({
|
|
11542
|
+
kind: z31.literal("version_changed"),
|
|
11543
|
+
previousVersion: z31.string().min(1)
|
|
11475
11544
|
}).passthrough(),
|
|
11476
|
-
|
|
11477
|
-
kind:
|
|
11478
|
-
version:
|
|
11545
|
+
z31.object({
|
|
11546
|
+
kind: z31.literal("version_at_least"),
|
|
11547
|
+
version: z31.string().min(1)
|
|
11479
11548
|
}).passthrough()
|
|
11480
11549
|
]
|
|
11481
11550
|
);
|
|
11482
|
-
var providerInstallationRunResultSchema =
|
|
11551
|
+
var providerInstallationRunResultSchema = z31.discriminatedUnion(
|
|
11483
11552
|
"available",
|
|
11484
11553
|
[
|
|
11485
|
-
|
|
11486
|
-
available:
|
|
11487
|
-
message:
|
|
11554
|
+
z31.object({
|
|
11555
|
+
available: z31.literal(false),
|
|
11556
|
+
message: z31.string().min(1)
|
|
11488
11557
|
}).passthrough(),
|
|
11489
|
-
|
|
11490
|
-
available:
|
|
11558
|
+
z31.object({
|
|
11559
|
+
available: z31.literal(true),
|
|
11491
11560
|
command: providerInstallationCommandSchema,
|
|
11492
11561
|
verification: providerInstallationVerificationSchema
|
|
11493
11562
|
}).passthrough()
|
|
@@ -11495,7 +11564,7 @@ var providerInstallationRunResultSchema = z30.discriminatedUnion(
|
|
|
11495
11564
|
);
|
|
11496
11565
|
|
|
11497
11566
|
// ../provider-bridge-protocol/src/requests.ts
|
|
11498
|
-
import { z as
|
|
11567
|
+
import { z as z32 } from "zod";
|
|
11499
11568
|
var BRIDGE_REQUEST_METHODS = {
|
|
11500
11569
|
initialize: "initialize",
|
|
11501
11570
|
modelList: "model/list",
|
|
@@ -11517,78 +11586,78 @@ var BRIDGE_REQUEST_METHODS = {
|
|
|
11517
11586
|
skillsConfigure: "skills/configure"
|
|
11518
11587
|
};
|
|
11519
11588
|
var sessionConstructionFields = {
|
|
11520
|
-
threadId:
|
|
11521
|
-
cwd:
|
|
11589
|
+
threadId: z32.string().min(1),
|
|
11590
|
+
cwd: z32.string().min(1),
|
|
11522
11591
|
options: bridgeExecutionOptionsSchema,
|
|
11523
|
-
dynamicTools:
|
|
11524
|
-
disallowedTools:
|
|
11592
|
+
dynamicTools: z32.array(dynamicToolSchema).optional(),
|
|
11593
|
+
disallowedTools: z32.array(z32.string().min(1)).optional(),
|
|
11525
11594
|
instructionMode: instructionModeSchema
|
|
11526
11595
|
};
|
|
11527
|
-
var modelListParamsSchema =
|
|
11528
|
-
var threadStartParamsSchema =
|
|
11596
|
+
var modelListParamsSchema = z32.object({ cwd: z32.string().min(1).optional() }).passthrough();
|
|
11597
|
+
var threadStartParamsSchema = z32.object({
|
|
11529
11598
|
...sessionConstructionFields,
|
|
11530
|
-
input:
|
|
11599
|
+
input: z32.array(promptInputSchema).optional()
|
|
11531
11600
|
}).passthrough();
|
|
11532
|
-
var threadResumeParamsSchema =
|
|
11601
|
+
var threadResumeParamsSchema = z32.object({
|
|
11533
11602
|
...sessionConstructionFields,
|
|
11534
|
-
providerThreadId:
|
|
11603
|
+
providerThreadId: z32.string().min(1)
|
|
11535
11604
|
}).passthrough();
|
|
11536
|
-
var threadForkParamsSchema =
|
|
11605
|
+
var threadForkParamsSchema = z32.object({
|
|
11537
11606
|
...sessionConstructionFields,
|
|
11538
|
-
sourceProviderThreadId:
|
|
11539
|
-
sourceProviderCheckpointId:
|
|
11607
|
+
sourceProviderThreadId: z32.string().min(1),
|
|
11608
|
+
sourceProviderCheckpointId: z32.string().min(1).optional()
|
|
11540
11609
|
}).passthrough();
|
|
11541
|
-
var threadStopParamsSchema =
|
|
11542
|
-
threadId:
|
|
11543
|
-
providerThreadId:
|
|
11544
|
-
intent:
|
|
11545
|
-
activeTurnId:
|
|
11610
|
+
var threadStopParamsSchema = z32.object({
|
|
11611
|
+
threadId: z32.string().min(1),
|
|
11612
|
+
providerThreadId: z32.string().min(1),
|
|
11613
|
+
intent: z32.enum(["interrupt", "release"]),
|
|
11614
|
+
activeTurnId: z32.string().min(1).nullable()
|
|
11546
11615
|
}).passthrough();
|
|
11547
|
-
var threadRefParams =
|
|
11548
|
-
threadId:
|
|
11549
|
-
providerThreadId:
|
|
11616
|
+
var threadRefParams = z32.object({
|
|
11617
|
+
threadId: z32.string().min(1),
|
|
11618
|
+
providerThreadId: z32.string().min(1)
|
|
11550
11619
|
}).passthrough();
|
|
11551
11620
|
var threadDiscardParamsSchema = threadRefParams;
|
|
11552
11621
|
var threadArchiveParamsSchema = threadRefParams;
|
|
11553
11622
|
var threadUnarchiveParamsSchema = threadRefParams;
|
|
11554
11623
|
var threadGoalClearParamsSchema = threadRefParams;
|
|
11555
|
-
var threadNameSetParamsSchema =
|
|
11556
|
-
threadId:
|
|
11557
|
-
providerThreadId:
|
|
11558
|
-
title:
|
|
11624
|
+
var threadNameSetParamsSchema = z32.object({
|
|
11625
|
+
threadId: z32.string().min(1),
|
|
11626
|
+
providerThreadId: z32.string().min(1),
|
|
11627
|
+
title: z32.string().min(1)
|
|
11559
11628
|
}).passthrough();
|
|
11560
11629
|
var turnInputFields = {
|
|
11561
|
-
threadId:
|
|
11562
|
-
providerThreadId:
|
|
11563
|
-
input:
|
|
11630
|
+
threadId: z32.string().min(1),
|
|
11631
|
+
providerThreadId: z32.string().min(1),
|
|
11632
|
+
input: z32.array(promptInputSchema),
|
|
11564
11633
|
clientRequestId: clientTurnRequestIdSchema,
|
|
11565
11634
|
options: bridgeExecutionOptionsSchema
|
|
11566
11635
|
};
|
|
11567
|
-
var turnStartParamsSchema =
|
|
11568
|
-
var turnSteerParamsSchema =
|
|
11636
|
+
var turnStartParamsSchema = z32.object(turnInputFields).passthrough();
|
|
11637
|
+
var turnSteerParamsSchema = z32.object({
|
|
11569
11638
|
...turnInputFields,
|
|
11570
|
-
expectedTurnId:
|
|
11639
|
+
expectedTurnId: z32.string().min(1)
|
|
11571
11640
|
}).passthrough();
|
|
11572
|
-
var skillsConfigureRootSchema =
|
|
11573
|
-
id:
|
|
11574
|
-
path:
|
|
11575
|
-
skills:
|
|
11576
|
-
|
|
11577
|
-
name:
|
|
11578
|
-
description:
|
|
11641
|
+
var skillsConfigureRootSchema = z32.object({
|
|
11642
|
+
id: z32.string().min(1),
|
|
11643
|
+
path: z32.string().min(1),
|
|
11644
|
+
skills: z32.array(
|
|
11645
|
+
z32.object({
|
|
11646
|
+
name: z32.string().min(1),
|
|
11647
|
+
description: z32.string()
|
|
11579
11648
|
}).passthrough()
|
|
11580
11649
|
)
|
|
11581
11650
|
}).passthrough();
|
|
11582
|
-
var skillsConfigureParamsSchema =
|
|
11583
|
-
roots:
|
|
11651
|
+
var skillsConfigureParamsSchema = z32.object({
|
|
11652
|
+
roots: z32.array(skillsConfigureRootSchema)
|
|
11584
11653
|
}).passthrough();
|
|
11585
|
-
var threadIdentityResultSchema =
|
|
11586
|
-
providerThreadId:
|
|
11587
|
-
sessionRestorable:
|
|
11654
|
+
var threadIdentityResultSchema = z32.object({
|
|
11655
|
+
providerThreadId: z32.string().min(1),
|
|
11656
|
+
sessionRestorable: z32.boolean().optional()
|
|
11588
11657
|
}).passthrough();
|
|
11589
11658
|
|
|
11590
11659
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
11591
|
-
import { z as
|
|
11660
|
+
import { z as z33 } from "zod";
|
|
11592
11661
|
var BRIDGE_NOTIFICATION_METHODS = {
|
|
11593
11662
|
threadIdentity: "thread/identity",
|
|
11594
11663
|
sessionReplaced: "session/replaced",
|
|
@@ -11596,142 +11665,142 @@ var BRIDGE_NOTIFICATION_METHODS = {
|
|
|
11596
11665
|
providerRecovery: "provider/recovery",
|
|
11597
11666
|
error: "error"
|
|
11598
11667
|
};
|
|
11599
|
-
var threadIdentityNotificationSchema =
|
|
11600
|
-
threadId:
|
|
11601
|
-
providerThreadId:
|
|
11602
|
-
sessionRestorable:
|
|
11668
|
+
var threadIdentityNotificationSchema = z33.object({
|
|
11669
|
+
threadId: z33.string().min(1),
|
|
11670
|
+
providerThreadId: z33.string().min(1),
|
|
11671
|
+
sessionRestorable: z33.boolean().optional()
|
|
11603
11672
|
}).passthrough();
|
|
11604
|
-
var sessionReplacedNotificationSchema =
|
|
11605
|
-
threadId:
|
|
11606
|
-
providerThreadId:
|
|
11607
|
-
reason:
|
|
11608
|
-
contextLost:
|
|
11609
|
-
showRuntimeNote:
|
|
11673
|
+
var sessionReplacedNotificationSchema = z33.object({
|
|
11674
|
+
threadId: z33.string().min(1),
|
|
11675
|
+
providerThreadId: z33.string().min(1).nullable(),
|
|
11676
|
+
reason: z33.string().min(1),
|
|
11677
|
+
contextLost: z33.boolean().default(false),
|
|
11678
|
+
showRuntimeNote: z33.boolean().default(false)
|
|
11610
11679
|
}).passthrough();
|
|
11611
|
-
var providerRecoveryNotificationSchema =
|
|
11612
|
-
threadId:
|
|
11680
|
+
var providerRecoveryNotificationSchema = z33.object({
|
|
11681
|
+
threadId: z33.string().min(1).optional(),
|
|
11613
11682
|
...providerRecoveryHintSchema.shape
|
|
11614
11683
|
}).passthrough();
|
|
11615
|
-
var errorNotificationSchema =
|
|
11616
|
-
threadId:
|
|
11617
|
-
providerThreadId:
|
|
11618
|
-
message:
|
|
11684
|
+
var errorNotificationSchema = z33.object({
|
|
11685
|
+
threadId: z33.string().min(1).optional(),
|
|
11686
|
+
providerThreadId: z33.string().min(1).optional(),
|
|
11687
|
+
message: z33.string().min(1)
|
|
11619
11688
|
}).passthrough();
|
|
11620
11689
|
|
|
11621
11690
|
// ../provider-bridge-protocol/src/thread-delta.ts
|
|
11622
|
-
import { z as
|
|
11691
|
+
import { z as z34 } from "zod";
|
|
11623
11692
|
var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
|
|
11624
11693
|
var deltaPresentationSchema = threadEventItemPresentationSchema;
|
|
11625
11694
|
var THREAD_DELTA_KEY_SEPARATOR = "";
|
|
11626
|
-
var deltaKeyPartSchema =
|
|
11695
|
+
var deltaKeyPartSchema = z34.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
|
|
11627
11696
|
message: "provider keys must not contain the internal key separator (\\u001f)"
|
|
11628
11697
|
});
|
|
11629
|
-
var deltaItemKeySchema =
|
|
11698
|
+
var deltaItemKeySchema = z34.object({
|
|
11630
11699
|
providerItemId: deltaKeyPartSchema.optional(),
|
|
11631
11700
|
channel: deltaKeyPartSchema.optional(),
|
|
11632
11701
|
parentRef: deltaKeyPartSchema.optional()
|
|
11633
11702
|
});
|
|
11634
11703
|
var providerTurnIdSchema = deltaKeyPartSchema;
|
|
11635
|
-
var deltaFileChangeSchema =
|
|
11636
|
-
path:
|
|
11637
|
-
kind:
|
|
11638
|
-
movePath:
|
|
11639
|
-
diff:
|
|
11640
|
-
oldText:
|
|
11641
|
-
newText:
|
|
11642
|
-
});
|
|
11643
|
-
var deltaBackgroundTaskShapeSchema =
|
|
11644
|
-
type:
|
|
11645
|
-
familyId:
|
|
11646
|
-
taskType:
|
|
11647
|
-
description:
|
|
11704
|
+
var deltaFileChangeSchema = z34.object({
|
|
11705
|
+
path: z34.string(),
|
|
11706
|
+
kind: z34.enum(["add", "update", "delete"]),
|
|
11707
|
+
movePath: z34.string().optional(),
|
|
11708
|
+
diff: z34.string().optional(),
|
|
11709
|
+
oldText: z34.string().optional(),
|
|
11710
|
+
newText: z34.string().optional()
|
|
11711
|
+
});
|
|
11712
|
+
var deltaBackgroundTaskShapeSchema = z34.object({
|
|
11713
|
+
type: z34.literal("backgroundTask"),
|
|
11714
|
+
familyId: z34.string().min(1),
|
|
11715
|
+
taskType: z34.string(),
|
|
11716
|
+
description: z34.string(),
|
|
11648
11717
|
status: threadEventItemStatusSchema,
|
|
11649
11718
|
taskStatus: backgroundTaskStatusSchema,
|
|
11650
|
-
skipTranscript:
|
|
11651
|
-
workflowName:
|
|
11719
|
+
skipTranscript: z34.boolean(),
|
|
11720
|
+
workflowName: z34.string().optional(),
|
|
11652
11721
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
11653
11722
|
usage: backgroundTaskUsageSchema.optional(),
|
|
11654
|
-
summary:
|
|
11655
|
-
error:
|
|
11656
|
-
outputFile:
|
|
11723
|
+
summary: z34.string().optional(),
|
|
11724
|
+
error: z34.string().optional(),
|
|
11725
|
+
outputFile: z34.string().optional()
|
|
11657
11726
|
});
|
|
11658
|
-
var deltaFileReadShapeSchema =
|
|
11659
|
-
type:
|
|
11660
|
-
path:
|
|
11661
|
-
cmd:
|
|
11727
|
+
var deltaFileReadShapeSchema = z34.object({
|
|
11728
|
+
type: z34.literal("fileRead"),
|
|
11729
|
+
path: z34.string(),
|
|
11730
|
+
cmd: z34.string().optional()
|
|
11662
11731
|
});
|
|
11663
|
-
var deltaSearchShapeSchema =
|
|
11664
|
-
type:
|
|
11732
|
+
var deltaSearchShapeSchema = z34.object({
|
|
11733
|
+
type: z34.literal("search"),
|
|
11665
11734
|
mode: threadEventSearchModeSchema,
|
|
11666
|
-
query:
|
|
11667
|
-
path:
|
|
11668
|
-
cmd:
|
|
11735
|
+
query: z34.string(),
|
|
11736
|
+
path: z34.string().optional(),
|
|
11737
|
+
cmd: z34.string().optional()
|
|
11669
11738
|
});
|
|
11670
|
-
var deltaDelegationShapeSchema =
|
|
11671
|
-
type:
|
|
11739
|
+
var deltaDelegationShapeSchema = z34.object({
|
|
11740
|
+
type: z34.literal("delegation"),
|
|
11672
11741
|
childRef: deltaKeyPartSchema,
|
|
11673
|
-
label:
|
|
11674
|
-
background:
|
|
11675
|
-
summary:
|
|
11742
|
+
label: z34.string(),
|
|
11743
|
+
background: z34.boolean(),
|
|
11744
|
+
summary: z34.string().optional()
|
|
11676
11745
|
});
|
|
11677
|
-
var deltaPlanStepsShapeSchema =
|
|
11678
|
-
type:
|
|
11679
|
-
steps:
|
|
11680
|
-
explanation:
|
|
11746
|
+
var deltaPlanStepsShapeSchema = z34.object({
|
|
11747
|
+
type: z34.literal("planSteps"),
|
|
11748
|
+
steps: z34.array(threadEventPlanStepSchema),
|
|
11749
|
+
explanation: z34.string().optional()
|
|
11681
11750
|
});
|
|
11682
|
-
var deltaExtensionShapeSchema =
|
|
11683
|
-
type:
|
|
11751
|
+
var deltaExtensionShapeSchema = z34.object({
|
|
11752
|
+
type: z34.literal("extension"),
|
|
11684
11753
|
kind: extensionKindSchema,
|
|
11685
11754
|
payload: jsonValueSchema
|
|
11686
11755
|
});
|
|
11687
|
-
var deltaItemShapeSchema =
|
|
11688
|
-
|
|
11689
|
-
type:
|
|
11690
|
-
command:
|
|
11691
|
-
cwd:
|
|
11692
|
-
aggregatedOutput:
|
|
11693
|
-
exitCode:
|
|
11694
|
-
durationMs:
|
|
11756
|
+
var deltaItemShapeSchema = z34.discriminatedUnion("type", [
|
|
11757
|
+
z34.object({
|
|
11758
|
+
type: z34.literal("command"),
|
|
11759
|
+
command: z34.string(),
|
|
11760
|
+
cwd: z34.string(),
|
|
11761
|
+
aggregatedOutput: z34.string().optional(),
|
|
11762
|
+
exitCode: z34.number().optional(),
|
|
11763
|
+
durationMs: z34.number().optional()
|
|
11695
11764
|
}),
|
|
11696
|
-
|
|
11697
|
-
type:
|
|
11698
|
-
changes:
|
|
11765
|
+
z34.object({
|
|
11766
|
+
type: z34.literal("fileChange"),
|
|
11767
|
+
changes: z34.array(deltaFileChangeSchema)
|
|
11699
11768
|
}),
|
|
11700
|
-
|
|
11701
|
-
type:
|
|
11702
|
-
tool:
|
|
11703
|
-
server:
|
|
11704
|
-
args:
|
|
11705
|
-
result:
|
|
11706
|
-
error:
|
|
11707
|
-
durationMs:
|
|
11769
|
+
z34.object({
|
|
11770
|
+
type: z34.literal("tool"),
|
|
11771
|
+
tool: z34.string(),
|
|
11772
|
+
server: z34.string().optional(),
|
|
11773
|
+
args: z34.unknown().optional(),
|
|
11774
|
+
result: z34.unknown().optional(),
|
|
11775
|
+
error: z34.string().optional(),
|
|
11776
|
+
durationMs: z34.number().optional()
|
|
11708
11777
|
}),
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
type:
|
|
11713
|
-
summary:
|
|
11714
|
-
content:
|
|
11778
|
+
z34.object({ type: z34.literal("compaction") }),
|
|
11779
|
+
z34.object({ type: z34.literal("agentMessage"), text: z34.string() }),
|
|
11780
|
+
z34.object({
|
|
11781
|
+
type: z34.literal("reasoning"),
|
|
11782
|
+
summary: z34.array(z34.string()),
|
|
11783
|
+
content: z34.array(z34.string())
|
|
11715
11784
|
}),
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
type:
|
|
11719
|
-
queries:
|
|
11785
|
+
z34.object({ type: z34.literal("plan"), text: z34.string() }),
|
|
11786
|
+
z34.object({
|
|
11787
|
+
type: z34.literal("webSearch"),
|
|
11788
|
+
queries: z34.array(z34.string()).min(1)
|
|
11720
11789
|
}),
|
|
11721
|
-
|
|
11722
|
-
type:
|
|
11723
|
-
url:
|
|
11724
|
-
prompt:
|
|
11725
|
-
pattern:
|
|
11790
|
+
z34.object({
|
|
11791
|
+
type: z34.literal("webFetch"),
|
|
11792
|
+
url: z34.string(),
|
|
11793
|
+
prompt: z34.string().nullable().optional(),
|
|
11794
|
+
pattern: z34.string().nullable()
|
|
11726
11795
|
}),
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
type:
|
|
11730
|
-
prompt:
|
|
11731
|
-
path:
|
|
11732
|
-
result:
|
|
11733
|
-
error:
|
|
11734
|
-
transparentBackground:
|
|
11796
|
+
z34.object({ type: z34.literal("imageView"), path: z34.string() }),
|
|
11797
|
+
z34.object({
|
|
11798
|
+
type: z34.literal("imageGeneration"),
|
|
11799
|
+
prompt: z34.string().nullable(),
|
|
11800
|
+
path: z34.string().nullable(),
|
|
11801
|
+
result: z34.string().optional(),
|
|
11802
|
+
error: z34.string().nullable(),
|
|
11803
|
+
transparentBackground: z34.boolean()
|
|
11735
11804
|
}),
|
|
11736
11805
|
deltaBackgroundTaskShapeSchema,
|
|
11737
11806
|
deltaFileReadShapeSchema,
|
|
@@ -11740,22 +11809,22 @@ var deltaItemShapeSchema = z33.discriminatedUnion("type", [
|
|
|
11740
11809
|
deltaPlanStepsShapeSchema,
|
|
11741
11810
|
deltaExtensionShapeSchema
|
|
11742
11811
|
]);
|
|
11743
|
-
var deltaProgressSnapshotSchema =
|
|
11812
|
+
var deltaProgressSnapshotSchema = z34.discriminatedUnion("type", [
|
|
11744
11813
|
deltaBackgroundTaskShapeSchema,
|
|
11745
11814
|
deltaDelegationShapeSchema
|
|
11746
11815
|
]);
|
|
11747
|
-
var deltaTextChannelSchema =
|
|
11816
|
+
var deltaTextChannelSchema = z34.enum([
|
|
11748
11817
|
"agentMessage",
|
|
11749
11818
|
"reasoningSummary",
|
|
11750
11819
|
"reasoningText",
|
|
11751
11820
|
"plan"
|
|
11752
11821
|
]);
|
|
11753
|
-
var deltaOutputChannelSchema =
|
|
11754
|
-
var deltaErrorSchema =
|
|
11755
|
-
var deltaAttachSchema =
|
|
11756
|
-
var deltaNoTurnFallbackSchema =
|
|
11822
|
+
var deltaOutputChannelSchema = z34.enum(["command", "fileChange"]);
|
|
11823
|
+
var deltaErrorSchema = z34.object({ message: z34.string() });
|
|
11824
|
+
var deltaAttachSchema = z34.enum(["open", "currentOrLast"]);
|
|
11825
|
+
var deltaNoTurnFallbackSchema = z34.object({
|
|
11757
11826
|
raw: providerRawEventSchema,
|
|
11758
|
-
rawType:
|
|
11827
|
+
rawType: z34.string()
|
|
11759
11828
|
});
|
|
11760
11829
|
function requireExtensionPresentation(delta, ctx) {
|
|
11761
11830
|
if (delta.item.type === "extension" && delta.presentation === void 0) {
|
|
@@ -11766,32 +11835,32 @@ function requireExtensionPresentation(delta, ctx) {
|
|
|
11766
11835
|
});
|
|
11767
11836
|
}
|
|
11768
11837
|
}
|
|
11769
|
-
var threadDeltaSchema =
|
|
11770
|
-
|
|
11771
|
-
kind:
|
|
11838
|
+
var threadDeltaSchema = z34.discriminatedUnion("kind", [
|
|
11839
|
+
z34.object({
|
|
11840
|
+
kind: z34.literal("input.accepted"),
|
|
11772
11841
|
clientRequestId: clientTurnRequestIdSchema,
|
|
11773
11842
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11774
11843
|
}),
|
|
11775
|
-
|
|
11776
|
-
kind:
|
|
11777
|
-
text:
|
|
11844
|
+
z34.object({
|
|
11845
|
+
kind: z34.literal("input.provider"),
|
|
11846
|
+
text: z34.string().min(1),
|
|
11778
11847
|
parentRef: deltaKeyPartSchema.optional()
|
|
11779
11848
|
}),
|
|
11780
|
-
|
|
11781
|
-
kind:
|
|
11849
|
+
z34.object({
|
|
11850
|
+
kind: z34.literal("turn.open"),
|
|
11782
11851
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11783
11852
|
parentRef: deltaKeyPartSchema.optional()
|
|
11784
11853
|
}),
|
|
11785
|
-
|
|
11786
|
-
kind:
|
|
11854
|
+
z34.object({
|
|
11855
|
+
kind: z34.literal("turn.boundary"),
|
|
11787
11856
|
status: threadEventTurnStatusSchema,
|
|
11788
11857
|
error: deltaErrorSchema.optional(),
|
|
11789
|
-
providerCheckpointId:
|
|
11790
|
-
claimIfIdle:
|
|
11858
|
+
providerCheckpointId: z34.string().min(1).optional(),
|
|
11859
|
+
claimIfIdle: z34.boolean().optional(),
|
|
11791
11860
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11792
11861
|
}),
|
|
11793
|
-
|
|
11794
|
-
kind:
|
|
11862
|
+
z34.object({
|
|
11863
|
+
kind: z34.literal("item.open"),
|
|
11795
11864
|
key: deltaItemKeySchema,
|
|
11796
11865
|
item: deltaItemShapeSchema,
|
|
11797
11866
|
presentation: deltaPresentationSchema.optional(),
|
|
@@ -11799,147 +11868,152 @@ var threadDeltaSchema = z33.discriminatedUnion("kind", [
|
|
|
11799
11868
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11800
11869
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11801
11870
|
}).superRefine(requireExtensionPresentation),
|
|
11802
|
-
|
|
11803
|
-
kind:
|
|
11871
|
+
z34.object({
|
|
11872
|
+
kind: z34.literal("item.close"),
|
|
11804
11873
|
key: deltaItemKeySchema,
|
|
11805
11874
|
status: threadEventItemStatusSchema,
|
|
11806
|
-
resultText:
|
|
11807
|
-
exitCode:
|
|
11808
|
-
aggregatedOutput:
|
|
11809
|
-
approvalStatus:
|
|
11875
|
+
resultText: z34.string().optional(),
|
|
11876
|
+
exitCode: z34.number().optional(),
|
|
11877
|
+
aggregatedOutput: z34.string().optional(),
|
|
11878
|
+
approvalStatus: z34.literal("denied").optional(),
|
|
11810
11879
|
item: deltaItemShapeSchema,
|
|
11811
11880
|
presentation: deltaPresentationSchema.optional(),
|
|
11812
11881
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11813
11882
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11814
11883
|
}).superRefine(requireExtensionPresentation),
|
|
11815
|
-
|
|
11816
|
-
kind:
|
|
11884
|
+
z34.object({
|
|
11885
|
+
kind: z34.literal("item.progress"),
|
|
11817
11886
|
key: deltaItemKeySchema,
|
|
11818
|
-
message:
|
|
11887
|
+
message: z34.string().optional(),
|
|
11819
11888
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
11820
|
-
flush:
|
|
11889
|
+
flush: z34.boolean().optional(),
|
|
11821
11890
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11822
11891
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11823
11892
|
}),
|
|
11824
|
-
|
|
11825
|
-
kind:
|
|
11893
|
+
z34.object({
|
|
11894
|
+
kind: z34.literal("item.textDelta"),
|
|
11826
11895
|
key: deltaItemKeySchema,
|
|
11827
11896
|
channel: deltaTextChannelSchema,
|
|
11828
|
-
text:
|
|
11897
|
+
text: z34.string(),
|
|
11829
11898
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11830
11899
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11831
11900
|
}),
|
|
11832
|
-
|
|
11833
|
-
kind:
|
|
11901
|
+
z34.object({
|
|
11902
|
+
kind: z34.literal("item.textClose"),
|
|
11834
11903
|
key: deltaItemKeySchema,
|
|
11835
11904
|
channel: deltaTextChannelSchema,
|
|
11836
|
-
text:
|
|
11905
|
+
text: z34.string().optional(),
|
|
11837
11906
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11838
11907
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11839
11908
|
}),
|
|
11840
|
-
|
|
11841
|
-
kind:
|
|
11909
|
+
z34.object({
|
|
11910
|
+
kind: z34.literal("item.outputDelta"),
|
|
11842
11911
|
key: deltaItemKeySchema,
|
|
11843
11912
|
channel: deltaOutputChannelSchema,
|
|
11844
|
-
text:
|
|
11913
|
+
text: z34.string(),
|
|
11845
11914
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11846
11915
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11847
11916
|
}),
|
|
11848
|
-
|
|
11849
|
-
kind:
|
|
11917
|
+
z34.object({
|
|
11918
|
+
kind: z34.literal("command.outputSnapshot"),
|
|
11850
11919
|
key: deltaItemKeySchema,
|
|
11851
|
-
text:
|
|
11920
|
+
text: z34.string(),
|
|
11852
11921
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11853
11922
|
}),
|
|
11854
|
-
|
|
11855
|
-
kind:
|
|
11923
|
+
z34.object({
|
|
11924
|
+
kind: z34.literal("usage"),
|
|
11856
11925
|
total: threadEventTokenUsageBreakdownSchema,
|
|
11857
11926
|
last: threadEventTokenUsageBreakdownSchema,
|
|
11858
|
-
modelContextWindow:
|
|
11927
|
+
modelContextWindow: z34.number().nullable(),
|
|
11859
11928
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11860
11929
|
}),
|
|
11861
|
-
|
|
11862
|
-
kind:
|
|
11930
|
+
z34.object({
|
|
11931
|
+
kind: z34.literal("contextWindow"),
|
|
11863
11932
|
snapshot: contextSnapshotSchema.optional(),
|
|
11864
|
-
used:
|
|
11865
|
-
size:
|
|
11866
|
-
estimated:
|
|
11933
|
+
used: z34.number().nullable(),
|
|
11934
|
+
size: z34.number().nullable().optional(),
|
|
11935
|
+
estimated: z34.boolean(),
|
|
11936
|
+
cost: threadUsageCostSchema.optional(),
|
|
11867
11937
|
attach: deltaAttachSchema,
|
|
11868
11938
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11869
11939
|
}),
|
|
11870
|
-
|
|
11871
|
-
kind:
|
|
11940
|
+
z34.object({
|
|
11941
|
+
kind: z34.literal("context.compacted"),
|
|
11872
11942
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11873
11943
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
11874
11944
|
}),
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
kind:
|
|
11878
|
-
diff:
|
|
11945
|
+
z34.object({ kind: z34.literal("context.cleared") }),
|
|
11946
|
+
z34.object({
|
|
11947
|
+
kind: z34.literal("turn.diff"),
|
|
11948
|
+
diff: z34.string(),
|
|
11879
11949
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11880
11950
|
}),
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
kind:
|
|
11884
|
-
providerThreadId:
|
|
11951
|
+
z34.object({ kind: z34.literal("thread.started") }),
|
|
11952
|
+
z34.object({
|
|
11953
|
+
kind: z34.literal("thread.identity"),
|
|
11954
|
+
providerThreadId: z34.string().min(1)
|
|
11885
11955
|
}),
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11956
|
+
z34.object({
|
|
11957
|
+
kind: z34.literal("thread.name"),
|
|
11958
|
+
name: z34.string().min(1),
|
|
11959
|
+
source: z34.literal("agent").optional()
|
|
11960
|
+
}),
|
|
11961
|
+
z34.object({
|
|
11962
|
+
kind: z34.literal("extension.state"),
|
|
11889
11963
|
extensionKind: extensionKindSchema,
|
|
11890
11964
|
payload: jsonValueSchema
|
|
11891
11965
|
}),
|
|
11892
|
-
|
|
11893
|
-
kind:
|
|
11966
|
+
z34.object({
|
|
11967
|
+
kind: z34.literal("provider.rateLimits"),
|
|
11894
11968
|
rateLimits: providerRateLimitStateSchema
|
|
11895
11969
|
}),
|
|
11896
|
-
|
|
11897
|
-
kind:
|
|
11898
|
-
message:
|
|
11899
|
-
detail:
|
|
11900
|
-
willRetry:
|
|
11970
|
+
z34.object({
|
|
11971
|
+
kind: z34.literal("provider.error"),
|
|
11972
|
+
message: z34.string(),
|
|
11973
|
+
detail: z34.string().optional(),
|
|
11974
|
+
willRetry: z34.boolean().optional(),
|
|
11901
11975
|
category: providerErrorCategorySchema.optional(),
|
|
11902
11976
|
errorInfo: providerErrorInfoSchema.optional(),
|
|
11903
|
-
settlesTurn:
|
|
11977
|
+
settlesTurn: z34.boolean().optional(),
|
|
11904
11978
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
11905
|
-
threadScoped:
|
|
11979
|
+
threadScoped: z34.boolean().optional()
|
|
11906
11980
|
}),
|
|
11907
|
-
|
|
11908
|
-
kind:
|
|
11909
|
-
originalModel:
|
|
11910
|
-
fallbackModel:
|
|
11911
|
-
reason:
|
|
11912
|
-
message:
|
|
11981
|
+
z34.object({
|
|
11982
|
+
kind: z34.literal("provider.modelFallback"),
|
|
11983
|
+
originalModel: z34.string().min(1),
|
|
11984
|
+
fallbackModel: z34.string().min(1),
|
|
11985
|
+
reason: z34.enum(["refusal", "provider"]),
|
|
11986
|
+
message: z34.string()
|
|
11913
11987
|
}),
|
|
11914
|
-
|
|
11915
|
-
kind:
|
|
11916
|
-
summary:
|
|
11917
|
-
details:
|
|
11988
|
+
z34.object({
|
|
11989
|
+
kind: z34.literal("provider.warning"),
|
|
11990
|
+
summary: z34.string().optional(),
|
|
11991
|
+
details: z34.string().optional(),
|
|
11918
11992
|
category: threadEventWarningCategorySchema.optional(),
|
|
11919
|
-
vouchedTurn:
|
|
11993
|
+
vouchedTurn: z34.boolean().optional()
|
|
11920
11994
|
}),
|
|
11921
|
-
|
|
11922
|
-
kind:
|
|
11995
|
+
z34.object({
|
|
11996
|
+
kind: z34.literal("unhandled"),
|
|
11923
11997
|
raw: providerRawEventSchema,
|
|
11924
|
-
rawType:
|
|
11925
|
-
vouchedTurn:
|
|
11926
|
-
onlyIfNoTurn:
|
|
11998
|
+
rawType: z34.string(),
|
|
11999
|
+
vouchedTurn: z34.boolean(),
|
|
12000
|
+
onlyIfNoTurn: z34.boolean().optional(),
|
|
11927
12001
|
parentRef: deltaKeyPartSchema.optional(),
|
|
11928
12002
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11929
12003
|
}),
|
|
11930
|
-
|
|
11931
|
-
|
|
12004
|
+
z34.object({ kind: z34.literal("session.ended") }),
|
|
12005
|
+
z34.object({ kind: z34.literal("session.reset") })
|
|
11932
12006
|
]);
|
|
11933
|
-
var threadDeltaNotificationParamsSchema =
|
|
11934
|
-
threadId:
|
|
11935
|
-
deltas:
|
|
12007
|
+
var threadDeltaNotificationParamsSchema = z34.object({
|
|
12008
|
+
threadId: z34.string().min(1),
|
|
12009
|
+
deltas: z34.array(threadDeltaSchema)
|
|
11936
12010
|
}).passthrough();
|
|
11937
12011
|
|
|
11938
12012
|
// ../provider-bridge-acp/src/launch-spec.ts
|
|
11939
|
-
import { z as
|
|
11940
|
-
var acpNativeSkillRootsSchema =
|
|
11941
|
-
user:
|
|
11942
|
-
project:
|
|
12013
|
+
import { z as z35 } from "zod";
|
|
12014
|
+
var acpNativeSkillRootsSchema = z35.object({
|
|
12015
|
+
user: z35.array(providerNativeRootInputSchema).default([]),
|
|
12016
|
+
project: z35.array(providerNativeRootInputSchema).default([])
|
|
11943
12017
|
}).strict().superRefine((roots, context) => {
|
|
11944
12018
|
const normalized = providerNativeRootsSchema.safeParse(
|
|
11945
12019
|
normalizeProviderNativeRoots(roots)
|
|
@@ -11955,16 +12029,16 @@ var acpNativeSkillRootsSchema = z34.object({
|
|
|
11955
12029
|
});
|
|
11956
12030
|
}
|
|
11957
12031
|
});
|
|
11958
|
-
var acpLaunchSpecSchema =
|
|
11959
|
-
displayName:
|
|
11960
|
-
command:
|
|
11961
|
-
args:
|
|
11962
|
-
env:
|
|
11963
|
-
cwd:
|
|
11964
|
-
modelCli:
|
|
11965
|
-
listArgs:
|
|
11966
|
-
selectFlag:
|
|
11967
|
-
primaryModels:
|
|
12032
|
+
var acpLaunchSpecSchema = z35.object({
|
|
12033
|
+
displayName: z35.string().min(1),
|
|
12034
|
+
command: z35.string().min(1),
|
|
12035
|
+
args: z35.array(z35.string()),
|
|
12036
|
+
env: z35.record(z35.string().min(1), z35.string()),
|
|
12037
|
+
cwd: z35.string().min(1).optional(),
|
|
12038
|
+
modelCli: z35.object({
|
|
12039
|
+
listArgs: z35.array(z35.string()),
|
|
12040
|
+
selectFlag: z35.string().min(1).optional(),
|
|
12041
|
+
primaryModels: z35.array(z35.string())
|
|
11968
12042
|
}).strict().transform(
|
|
11969
12043
|
(modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
|
|
11970
12044
|
).optional(),
|
|
@@ -12002,35 +12076,35 @@ function normalizeAcpLaunchSpec(spec) {
|
|
|
12002
12076
|
}
|
|
12003
12077
|
|
|
12004
12078
|
// src/claude-task-tools.ts
|
|
12005
|
-
import { z as
|
|
12006
|
-
var claudeTaskToolNameSchema =
|
|
12079
|
+
import { z as z36 } from "zod";
|
|
12080
|
+
var claudeTaskToolNameSchema = z36.enum([
|
|
12007
12081
|
"TaskCreate",
|
|
12008
12082
|
"TaskGet",
|
|
12009
12083
|
"TaskList",
|
|
12010
12084
|
"TaskUpdate"
|
|
12011
12085
|
]);
|
|
12012
|
-
var claudeTaskStatusSchema =
|
|
12013
|
-
var claudeTaskCreateOutputSchema =
|
|
12014
|
-
task:
|
|
12015
|
-
id:
|
|
12016
|
-
subject:
|
|
12086
|
+
var claudeTaskStatusSchema = z36.enum(["pending", "in_progress", "completed"]);
|
|
12087
|
+
var claudeTaskCreateOutputSchema = z36.object({
|
|
12088
|
+
task: z36.object({
|
|
12089
|
+
id: z36.string(),
|
|
12090
|
+
subject: z36.string()
|
|
12017
12091
|
}).passthrough()
|
|
12018
12092
|
}).passthrough();
|
|
12019
|
-
var claudeTaskGetOutputSchema =
|
|
12020
|
-
task:
|
|
12021
|
-
id:
|
|
12093
|
+
var claudeTaskGetOutputSchema = z36.object({
|
|
12094
|
+
task: z36.object({
|
|
12095
|
+
id: z36.string(),
|
|
12022
12096
|
status: claudeTaskStatusSchema,
|
|
12023
|
-
subject:
|
|
12097
|
+
subject: z36.string()
|
|
12024
12098
|
}).passthrough().nullable()
|
|
12025
12099
|
}).passthrough();
|
|
12026
|
-
var claudeTaskUpdateOutputSchema =
|
|
12027
|
-
success:
|
|
12028
|
-
taskId:
|
|
12100
|
+
var claudeTaskUpdateOutputSchema = z36.object({
|
|
12101
|
+
success: z36.boolean(),
|
|
12102
|
+
taskId: z36.string()
|
|
12029
12103
|
}).passthrough();
|
|
12030
|
-
var claudeTaskListOutputSchema =
|
|
12031
|
-
tasks:
|
|
12104
|
+
var claudeTaskListOutputSchema = z36.object({
|
|
12105
|
+
tasks: z36.array(z36.unknown())
|
|
12032
12106
|
}).passthrough();
|
|
12033
|
-
var claudeTaskToolOutputSchema =
|
|
12107
|
+
var claudeTaskToolOutputSchema = z36.union([
|
|
12034
12108
|
claudeTaskCreateOutputSchema,
|
|
12035
12109
|
claudeTaskGetOutputSchema,
|
|
12036
12110
|
claudeTaskListOutputSchema,
|