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