@get-bb/plugin-sdk 0.4.88 → 0.4.94
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 +81 -31
- package/bundled-types/bb-plugin-sdk-host.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +51 -2
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +16 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +8 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +10 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +3 -4
- package/bundled-types/bb-plugin-sdk-testing.d.ts +27 -6
- package/bundled-types/bb-plugin-sdk.d.ts +170 -42
- package/dist/internal/host-policy.js +63 -2
- package/dist/internal/plugin-app-collector.js +13834 -22
- package/dist/provider-bridge-acp.js +381 -305
- package/dist/provider-bridge-testing.js +2 -0
- package/dist/provider-bridge.js +390 -376
- package/dist/testing/app.js +13987 -175
- package/dist/testing/index.js +70 -4
- package/package.json +1 -1
package/dist/provider-bridge.js
CHANGED
|
@@ -679,6 +679,12 @@ function addTokenUsage(total, last) {
|
|
|
679
679
|
totalTokens: total.totalTokens + last.totalTokens,
|
|
680
680
|
inputTokens: total.inputTokens + last.inputTokens,
|
|
681
681
|
cachedInputTokens: total.cachedInputTokens + last.cachedInputTokens,
|
|
682
|
+
...total.cacheReadInputTokens === void 0 && last.cacheReadInputTokens === void 0 ? {} : {
|
|
683
|
+
cacheReadInputTokens: (total.cacheReadInputTokens ?? 0) + (last.cacheReadInputTokens ?? 0)
|
|
684
|
+
},
|
|
685
|
+
...total.cacheWriteInputTokens === void 0 && last.cacheWriteInputTokens === void 0 ? {} : {
|
|
686
|
+
cacheWriteInputTokens: (total.cacheWriteInputTokens ?? 0) + (last.cacheWriteInputTokens ?? 0)
|
|
687
|
+
},
|
|
682
688
|
outputTokens: total.outputTokens + last.outputTokens,
|
|
683
689
|
reasoningOutputTokens: total.reasoningOutputTokens + last.reasoningOutputTokens
|
|
684
690
|
};
|
|
@@ -2805,6 +2811,8 @@ var threadEventTokenUsageBreakdownSchema = z17.object({
|
|
|
2805
2811
|
totalTokens: z17.number(),
|
|
2806
2812
|
inputTokens: z17.number(),
|
|
2807
2813
|
cachedInputTokens: z17.number(),
|
|
2814
|
+
cacheReadInputTokens: z17.number().nonnegative().optional(),
|
|
2815
|
+
cacheWriteInputTokens: z17.number().nonnegative().optional(),
|
|
2808
2816
|
outputTokens: z17.number(),
|
|
2809
2817
|
reasoningOutputTokens: z17.number()
|
|
2810
2818
|
});
|
|
@@ -3975,6 +3983,12 @@ function clampPercent(value) {
|
|
|
3975
3983
|
);
|
|
3976
3984
|
}
|
|
3977
3985
|
|
|
3986
|
+
// ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
|
|
3987
|
+
import { z as z24 } from "zod";
|
|
3988
|
+
var providerToolCallCancellationSchema = z24.object({
|
|
3989
|
+
requestId: z24.union([z24.string(), z24.number().int()])
|
|
3990
|
+
});
|
|
3991
|
+
|
|
3978
3992
|
// ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
|
|
3979
3993
|
function createProviderVisibilityMetadata(args) {
|
|
3980
3994
|
return {
|
|
@@ -3987,10 +4001,10 @@ function createProviderVisibilityMetadata(args) {
|
|
|
3987
4001
|
}
|
|
3988
4002
|
|
|
3989
4003
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
3990
|
-
import { z as
|
|
4004
|
+
import { z as z26 } from "zod";
|
|
3991
4005
|
|
|
3992
4006
|
// ../provider-bridge-protocol/src/errors.ts
|
|
3993
|
-
import { z as
|
|
4007
|
+
import { z as z25 } from "zod";
|
|
3994
4008
|
var BRIDGE_JSON_RPC_ERRORS = {
|
|
3995
4009
|
INVALID_PARAMS: -32602,
|
|
3996
4010
|
METHOD_NOT_FOUND: -32601,
|
|
@@ -3999,12 +4013,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
|
|
|
3999
4013
|
SESSION_NOT_RESTORABLE: -32002,
|
|
4000
4014
|
FORK_CHECKPOINT_UNSUPPORTED: -32003
|
|
4001
4015
|
};
|
|
4002
|
-
var providerRecoveryHintSchema =
|
|
4016
|
+
var providerRecoveryHintSchema = z25.object({
|
|
4003
4017
|
kind: providerRecoveryKindSchema,
|
|
4004
|
-
message:
|
|
4005
|
-
retryable:
|
|
4018
|
+
message: z25.string().min(1),
|
|
4019
|
+
retryable: z25.boolean()
|
|
4006
4020
|
});
|
|
4007
|
-
var bridgeErrorDataSchema =
|
|
4021
|
+
var bridgeErrorDataSchema = z25.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
|
|
4008
4022
|
|
|
4009
4023
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
4010
4024
|
var JSON_RPC_INVALID_PARAMS_CODE = -32602;
|
|
@@ -4022,7 +4036,7 @@ var ProviderResponseEncodeError = class extends Error {
|
|
|
4022
4036
|
this.name = "ProviderResponseEncodeError";
|
|
4023
4037
|
}
|
|
4024
4038
|
};
|
|
4025
|
-
var ignoredJsonRpcResultSchema =
|
|
4039
|
+
var ignoredJsonRpcResultSchema = z26.unknown();
|
|
4026
4040
|
|
|
4027
4041
|
// ../provider-bridge-protocol/src/version.ts
|
|
4028
4042
|
var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
|
|
@@ -4030,66 +4044,66 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
|
|
|
4030
4044
|
var THREAD_DELTA_GRAMMAR_V3 = 3;
|
|
4031
4045
|
|
|
4032
4046
|
// ../provider-bridge-protocol/src/handshake.ts
|
|
4033
|
-
import { z as
|
|
4034
|
-
var bridgeGrammarVersionsSchema =
|
|
4047
|
+
import { z as z27 } from "zod";
|
|
4048
|
+
var bridgeGrammarVersionsSchema = z27.tuple([z27.number().int().positive(), z27.number().int().positive()]).refine(([min, max]) => min <= max, {
|
|
4035
4049
|
message: "grammarVersions must be an ascending [min, max] range"
|
|
4036
4050
|
});
|
|
4037
|
-
var bridgeSteerModeSchema =
|
|
4038
|
-
var bridgeCapabilitiesSchema =
|
|
4039
|
-
sessionRestore:
|
|
4040
|
-
threadArchive:
|
|
4041
|
-
threadRename:
|
|
4042
|
-
threadGoalClear:
|
|
4051
|
+
var bridgeSteerModeSchema = z27.enum(["inject", "queue"]);
|
|
4052
|
+
var bridgeCapabilitiesSchema = z27.object({
|
|
4053
|
+
sessionRestore: z27.boolean().default(false),
|
|
4054
|
+
threadArchive: z27.boolean().default(false),
|
|
4055
|
+
threadRename: z27.boolean().default(false),
|
|
4056
|
+
threadGoalClear: z27.boolean().default(false),
|
|
4043
4057
|
fork: providerForkSchema.default("none"),
|
|
4044
|
-
approvalEnforcedBy:
|
|
4058
|
+
approvalEnforcedBy: z27.enum(["runtime", "provider"]).default("runtime"),
|
|
4045
4059
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
4046
4060
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
4047
4061
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
4048
4062
|
]),
|
|
4049
4063
|
steerMode: bridgeSteerModeSchema.default("queue"),
|
|
4050
|
-
skills:
|
|
4064
|
+
skills: z27.object({ configure: z27.boolean().default(false) }).default({ configure: false })
|
|
4051
4065
|
}).passthrough();
|
|
4052
|
-
var initializeParamsSchema =
|
|
4053
|
-
protocolVersion:
|
|
4054
|
-
client:
|
|
4066
|
+
var initializeParamsSchema = z27.object({
|
|
4067
|
+
protocolVersion: z27.number().int().positive(),
|
|
4068
|
+
client: z27.object({ name: z27.string().min(1), version: z27.string().min(1) }),
|
|
4055
4069
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
4056
4070
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
4057
4071
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
4058
4072
|
])
|
|
4059
4073
|
}).passthrough();
|
|
4060
|
-
var initializeResultSchema =
|
|
4061
|
-
protocolVersion:
|
|
4062
|
-
capabilities:
|
|
4074
|
+
var initializeResultSchema = z27.object({
|
|
4075
|
+
protocolVersion: z27.number().int().positive(),
|
|
4076
|
+
capabilities: z27.preprocess(
|
|
4063
4077
|
(value) => value ?? {},
|
|
4064
4078
|
bridgeCapabilitiesSchema
|
|
4065
4079
|
)
|
|
4066
4080
|
}).passthrough();
|
|
4067
4081
|
|
|
4068
4082
|
// ../provider-bridge-protocol/src/execution-options.ts
|
|
4069
|
-
import { z as
|
|
4070
|
-
var bridgeExecutionOptionsSchema =
|
|
4071
|
-
model:
|
|
4083
|
+
import { z as z28 } from "zod";
|
|
4084
|
+
var bridgeExecutionOptionsSchema = z28.object({
|
|
4085
|
+
model: z28.string().min(1).optional(),
|
|
4072
4086
|
serviceTier: serviceTierSchema.optional(),
|
|
4073
4087
|
reasoningLevel: reasoningLevelSchema.optional(),
|
|
4074
4088
|
promptMode: promptModeSchema.optional(),
|
|
4075
|
-
instructions:
|
|
4076
|
-
envVars:
|
|
4077
|
-
providerOptions:
|
|
4089
|
+
instructions: z28.string().optional(),
|
|
4090
|
+
envVars: z28.record(z28.string(), z28.string()).optional(),
|
|
4091
|
+
providerOptions: z28.record(z28.string(), z28.unknown()).optional()
|
|
4078
4092
|
}).and(runtimePermissionPolicySchema);
|
|
4079
4093
|
|
|
4080
4094
|
// ../provider-bridge-protocol/src/provider-maintenance.ts
|
|
4081
|
-
import { z as
|
|
4082
|
-
var providerMaintenanceParamsSchema =
|
|
4083
|
-
providerId:
|
|
4084
|
-
cwd:
|
|
4085
|
-
providerOptions:
|
|
4095
|
+
import { z as z29 } from "zod";
|
|
4096
|
+
var providerMaintenanceParamsSchema = z29.object({
|
|
4097
|
+
providerId: z29.string().min(1),
|
|
4098
|
+
cwd: z29.string().min(1).optional(),
|
|
4099
|
+
providerOptions: z29.record(z29.string(), z29.unknown()).optional()
|
|
4086
4100
|
}).passthrough();
|
|
4087
|
-
var providerInstallationRequirementSchema =
|
|
4101
|
+
var providerInstallationRequirementSchema = z29.enum(["thread_rewind"]);
|
|
4088
4102
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4089
4103
|
requirement: providerInstallationRequirementSchema.optional()
|
|
4090
4104
|
});
|
|
4091
|
-
var providerHealthSchema =
|
|
4092
|
-
status:
|
|
4105
|
+
var providerHealthSchema = z29.object({
|
|
4106
|
+
status: z29.enum([
|
|
4093
4107
|
"ready",
|
|
4094
4108
|
"not_installed",
|
|
4095
4109
|
"unauthenticated",
|
|
@@ -4097,114 +4111,114 @@ var providerHealthSchema = z28.object({
|
|
|
4097
4111
|
"unsupported_version",
|
|
4098
4112
|
"unknown"
|
|
4099
4113
|
]),
|
|
4100
|
-
statusMessage:
|
|
4101
|
-
accountEmail:
|
|
4102
|
-
planLabel:
|
|
4103
|
-
installedVersion:
|
|
4104
|
-
minimumSupportedVersion:
|
|
4105
|
-
canInstall:
|
|
4106
|
-
canUpdate:
|
|
4107
|
-
loginCommand:
|
|
4114
|
+
statusMessage: z29.string().min(1).nullable(),
|
|
4115
|
+
accountEmail: z29.string().nullable(),
|
|
4116
|
+
planLabel: z29.string().min(1).nullable(),
|
|
4117
|
+
installedVersion: z29.string().min(1).nullable(),
|
|
4118
|
+
minimumSupportedVersion: z29.string().min(1).nullable(),
|
|
4119
|
+
canInstall: z29.boolean(),
|
|
4120
|
+
canUpdate: z29.boolean(),
|
|
4121
|
+
loginCommand: z29.string().min(1).nullable()
|
|
4108
4122
|
}).passthrough();
|
|
4109
|
-
var providerUsageWindowSchema =
|
|
4110
|
-
label:
|
|
4111
|
-
usedPercent:
|
|
4112
|
-
resetsAt:
|
|
4113
|
-
cost:
|
|
4114
|
-
usedUsdCents:
|
|
4115
|
-
limitUsdCents:
|
|
4123
|
+
var providerUsageWindowSchema = z29.object({
|
|
4124
|
+
label: z29.string().min(1),
|
|
4125
|
+
usedPercent: z29.number().min(0).max(100),
|
|
4126
|
+
resetsAt: z29.string().min(1).nullable(),
|
|
4127
|
+
cost: z29.object({
|
|
4128
|
+
usedUsdCents: z29.number().int().nonnegative(),
|
|
4129
|
+
limitUsdCents: z29.number().int().positive()
|
|
4116
4130
|
}).optional()
|
|
4117
4131
|
}).passthrough();
|
|
4118
|
-
var providerUsageSchema =
|
|
4119
|
-
|
|
4120
|
-
status:
|
|
4121
|
-
accountEmail:
|
|
4122
|
-
planLabel:
|
|
4123
|
-
windows:
|
|
4132
|
+
var providerUsageSchema = z29.discriminatedUnion("status", [
|
|
4133
|
+
z29.object({
|
|
4134
|
+
status: z29.literal("ok"),
|
|
4135
|
+
accountEmail: z29.string().email().nullable(),
|
|
4136
|
+
planLabel: z29.string().min(1).nullable(),
|
|
4137
|
+
windows: z29.array(providerUsageWindowSchema)
|
|
4124
4138
|
}).passthrough(),
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
status:
|
|
4130
|
-
message:
|
|
4131
|
-
planLabel:
|
|
4132
|
-
accountEmail:
|
|
4139
|
+
z29.object({ status: z29.literal("not_installed") }).passthrough(),
|
|
4140
|
+
z29.object({ status: z29.literal("unauthenticated") }).passthrough(),
|
|
4141
|
+
z29.object({ status: z29.literal("expired") }).passthrough(),
|
|
4142
|
+
z29.object({
|
|
4143
|
+
status: z29.literal("error"),
|
|
4144
|
+
message: z29.string().min(1),
|
|
4145
|
+
planLabel: z29.string().min(1).nullable().default(null),
|
|
4146
|
+
accountEmail: z29.string().nullable().default(null)
|
|
4133
4147
|
}).passthrough()
|
|
4134
4148
|
]);
|
|
4135
|
-
var providerHealthResultSchema =
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
supported:
|
|
4149
|
+
var providerHealthResultSchema = z29.discriminatedUnion("supported", [
|
|
4150
|
+
z29.object({ supported: z29.literal(false) }).passthrough(),
|
|
4151
|
+
z29.object({
|
|
4152
|
+
supported: z29.literal(true),
|
|
4139
4153
|
health: providerHealthSchema
|
|
4140
4154
|
}).passthrough()
|
|
4141
4155
|
]);
|
|
4142
|
-
var providerUsageResultSchema =
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
supported:
|
|
4156
|
+
var providerUsageResultSchema = z29.discriminatedUnion("supported", [
|
|
4157
|
+
z29.object({ supported: z29.literal(false) }).passthrough(),
|
|
4158
|
+
z29.object({
|
|
4159
|
+
supported: z29.literal(true),
|
|
4146
4160
|
usage: providerUsageSchema
|
|
4147
4161
|
}).passthrough()
|
|
4148
4162
|
]);
|
|
4149
|
-
var providerInstallationActionKindSchema =
|
|
4163
|
+
var providerInstallationActionKindSchema = z29.enum([
|
|
4150
4164
|
"install",
|
|
4151
4165
|
"update"
|
|
4152
4166
|
]);
|
|
4153
|
-
var providerInstallationActionSchema =
|
|
4167
|
+
var providerInstallationActionSchema = z29.object({
|
|
4154
4168
|
kind: providerInstallationActionKindSchema,
|
|
4155
|
-
label:
|
|
4156
|
-
command:
|
|
4169
|
+
label: z29.enum(["Install", "Update"]),
|
|
4170
|
+
command: z29.string().min(1)
|
|
4157
4171
|
}).passthrough();
|
|
4158
|
-
var providerInstallationSourceSchema =
|
|
4172
|
+
var providerInstallationSourceSchema = z29.enum([
|
|
4159
4173
|
"notInstalled",
|
|
4160
4174
|
"npmGlobal",
|
|
4161
4175
|
"external"
|
|
4162
4176
|
]);
|
|
4163
|
-
var providerInstallationStatusSchema =
|
|
4164
|
-
executableName:
|
|
4165
|
-
executablePath:
|
|
4166
|
-
installed:
|
|
4177
|
+
var providerInstallationStatusSchema = z29.object({
|
|
4178
|
+
executableName: z29.string().min(1),
|
|
4179
|
+
executablePath: z29.string().min(1).nullable(),
|
|
4180
|
+
installed: z29.boolean(),
|
|
4167
4181
|
installSource: providerInstallationSourceSchema,
|
|
4168
|
-
currentVersion:
|
|
4169
|
-
latestVersion:
|
|
4170
|
-
minimumSupportedVersion:
|
|
4171
|
-
npmPackageName:
|
|
4172
|
-
npmGlobalPackageVersion:
|
|
4182
|
+
currentVersion: z29.string().min(1).nullable(),
|
|
4183
|
+
latestVersion: z29.string().min(1).nullable(),
|
|
4184
|
+
minimumSupportedVersion: z29.string().min(1).nullable(),
|
|
4185
|
+
npmPackageName: z29.string().min(1).nullable(),
|
|
4186
|
+
npmGlobalPackageVersion: z29.string().min(1).nullable(),
|
|
4173
4187
|
installAction: providerInstallationActionSchema.nullable(),
|
|
4174
|
-
needsUpdate:
|
|
4175
|
-
versionUnsupported:
|
|
4188
|
+
needsUpdate: z29.boolean(),
|
|
4189
|
+
versionUnsupported: z29.boolean()
|
|
4176
4190
|
}).passthrough();
|
|
4177
4191
|
var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4178
4192
|
action: providerInstallationActionKindSchema
|
|
4179
4193
|
});
|
|
4180
|
-
var providerInstallationCommandSchema =
|
|
4181
|
-
command:
|
|
4182
|
-
args:
|
|
4183
|
-
displayCommand:
|
|
4194
|
+
var providerInstallationCommandSchema = z29.object({
|
|
4195
|
+
command: z29.string().min(1),
|
|
4196
|
+
args: z29.array(z29.string()).max(64),
|
|
4197
|
+
displayCommand: z29.string().min(1)
|
|
4184
4198
|
}).passthrough();
|
|
4185
|
-
var providerInstallationVerificationSchema =
|
|
4199
|
+
var providerInstallationVerificationSchema = z29.discriminatedUnion(
|
|
4186
4200
|
"kind",
|
|
4187
4201
|
[
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
kind:
|
|
4191
|
-
previousVersion:
|
|
4202
|
+
z29.object({ kind: z29.literal("installed") }).passthrough(),
|
|
4203
|
+
z29.object({
|
|
4204
|
+
kind: z29.literal("version_changed"),
|
|
4205
|
+
previousVersion: z29.string().min(1)
|
|
4192
4206
|
}).passthrough(),
|
|
4193
|
-
|
|
4194
|
-
kind:
|
|
4195
|
-
version:
|
|
4207
|
+
z29.object({
|
|
4208
|
+
kind: z29.literal("version_at_least"),
|
|
4209
|
+
version: z29.string().min(1)
|
|
4196
4210
|
}).passthrough()
|
|
4197
4211
|
]
|
|
4198
4212
|
);
|
|
4199
|
-
var providerInstallationRunResultSchema =
|
|
4213
|
+
var providerInstallationRunResultSchema = z29.discriminatedUnion(
|
|
4200
4214
|
"available",
|
|
4201
4215
|
[
|
|
4202
|
-
|
|
4203
|
-
available:
|
|
4204
|
-
message:
|
|
4216
|
+
z29.object({
|
|
4217
|
+
available: z29.literal(false),
|
|
4218
|
+
message: z29.string().min(1)
|
|
4205
4219
|
}).passthrough(),
|
|
4206
|
-
|
|
4207
|
-
available:
|
|
4220
|
+
z29.object({
|
|
4221
|
+
available: z29.literal(true),
|
|
4208
4222
|
command: providerInstallationCommandSchema,
|
|
4209
4223
|
verification: providerInstallationVerificationSchema
|
|
4210
4224
|
}).passthrough()
|
|
@@ -4212,7 +4226,7 @@ var providerInstallationRunResultSchema = z28.discriminatedUnion(
|
|
|
4212
4226
|
);
|
|
4213
4227
|
|
|
4214
4228
|
// ../provider-bridge-protocol/src/requests.ts
|
|
4215
|
-
import { z as
|
|
4229
|
+
import { z as z30 } from "zod";
|
|
4216
4230
|
var BRIDGE_REQUEST_METHODS = {
|
|
4217
4231
|
initialize: "initialize",
|
|
4218
4232
|
modelList: "model/list",
|
|
@@ -4234,78 +4248,78 @@ var BRIDGE_REQUEST_METHODS = {
|
|
|
4234
4248
|
skillsConfigure: "skills/configure"
|
|
4235
4249
|
};
|
|
4236
4250
|
var sessionConstructionFields = {
|
|
4237
|
-
threadId:
|
|
4238
|
-
cwd:
|
|
4251
|
+
threadId: z30.string().min(1),
|
|
4252
|
+
cwd: z30.string().min(1),
|
|
4239
4253
|
options: bridgeExecutionOptionsSchema,
|
|
4240
|
-
dynamicTools:
|
|
4241
|
-
disallowedTools:
|
|
4254
|
+
dynamicTools: z30.array(dynamicToolSchema).optional(),
|
|
4255
|
+
disallowedTools: z30.array(z30.string().min(1)).optional(),
|
|
4242
4256
|
instructionMode: instructionModeSchema
|
|
4243
4257
|
};
|
|
4244
|
-
var modelListParamsSchema =
|
|
4245
|
-
var threadStartParamsSchema =
|
|
4258
|
+
var modelListParamsSchema = z30.object({ cwd: z30.string().min(1).optional() }).passthrough();
|
|
4259
|
+
var threadStartParamsSchema = z30.object({
|
|
4246
4260
|
...sessionConstructionFields,
|
|
4247
|
-
input:
|
|
4261
|
+
input: z30.array(promptInputSchema).optional()
|
|
4248
4262
|
}).passthrough();
|
|
4249
|
-
var threadResumeParamsSchema =
|
|
4263
|
+
var threadResumeParamsSchema = z30.object({
|
|
4250
4264
|
...sessionConstructionFields,
|
|
4251
|
-
providerThreadId:
|
|
4265
|
+
providerThreadId: z30.string().min(1)
|
|
4252
4266
|
}).passthrough();
|
|
4253
|
-
var threadForkParamsSchema =
|
|
4267
|
+
var threadForkParamsSchema = z30.object({
|
|
4254
4268
|
...sessionConstructionFields,
|
|
4255
|
-
sourceProviderThreadId:
|
|
4256
|
-
sourceProviderCheckpointId:
|
|
4269
|
+
sourceProviderThreadId: z30.string().min(1),
|
|
4270
|
+
sourceProviderCheckpointId: z30.string().min(1).optional()
|
|
4257
4271
|
}).passthrough();
|
|
4258
|
-
var threadStopParamsSchema =
|
|
4259
|
-
threadId:
|
|
4260
|
-
providerThreadId:
|
|
4261
|
-
intent:
|
|
4262
|
-
activeTurnId:
|
|
4272
|
+
var threadStopParamsSchema = z30.object({
|
|
4273
|
+
threadId: z30.string().min(1),
|
|
4274
|
+
providerThreadId: z30.string().min(1),
|
|
4275
|
+
intent: z30.enum(["interrupt", "release"]),
|
|
4276
|
+
activeTurnId: z30.string().min(1).nullable()
|
|
4263
4277
|
}).passthrough();
|
|
4264
|
-
var threadRefParams =
|
|
4265
|
-
threadId:
|
|
4266
|
-
providerThreadId:
|
|
4278
|
+
var threadRefParams = z30.object({
|
|
4279
|
+
threadId: z30.string().min(1),
|
|
4280
|
+
providerThreadId: z30.string().min(1)
|
|
4267
4281
|
}).passthrough();
|
|
4268
4282
|
var threadDiscardParamsSchema = threadRefParams;
|
|
4269
4283
|
var threadArchiveParamsSchema = threadRefParams;
|
|
4270
4284
|
var threadUnarchiveParamsSchema = threadRefParams;
|
|
4271
4285
|
var threadGoalClearParamsSchema = threadRefParams;
|
|
4272
|
-
var threadNameSetParamsSchema =
|
|
4273
|
-
threadId:
|
|
4274
|
-
providerThreadId:
|
|
4275
|
-
title:
|
|
4286
|
+
var threadNameSetParamsSchema = z30.object({
|
|
4287
|
+
threadId: z30.string().min(1),
|
|
4288
|
+
providerThreadId: z30.string().min(1),
|
|
4289
|
+
title: z30.string().min(1)
|
|
4276
4290
|
}).passthrough();
|
|
4277
4291
|
var turnInputFields = {
|
|
4278
|
-
threadId:
|
|
4279
|
-
providerThreadId:
|
|
4280
|
-
input:
|
|
4292
|
+
threadId: z30.string().min(1),
|
|
4293
|
+
providerThreadId: z30.string().min(1),
|
|
4294
|
+
input: z30.array(promptInputSchema),
|
|
4281
4295
|
clientRequestId: clientTurnRequestIdSchema,
|
|
4282
4296
|
options: bridgeExecutionOptionsSchema
|
|
4283
4297
|
};
|
|
4284
|
-
var turnStartParamsSchema =
|
|
4285
|
-
var turnSteerParamsSchema =
|
|
4298
|
+
var turnStartParamsSchema = z30.object(turnInputFields).passthrough();
|
|
4299
|
+
var turnSteerParamsSchema = z30.object({
|
|
4286
4300
|
...turnInputFields,
|
|
4287
|
-
expectedTurnId:
|
|
4301
|
+
expectedTurnId: z30.string().min(1)
|
|
4288
4302
|
}).passthrough();
|
|
4289
|
-
var skillsConfigureRootSchema =
|
|
4290
|
-
id:
|
|
4291
|
-
path:
|
|
4292
|
-
skills:
|
|
4293
|
-
|
|
4294
|
-
name:
|
|
4295
|
-
description:
|
|
4303
|
+
var skillsConfigureRootSchema = z30.object({
|
|
4304
|
+
id: z30.string().min(1),
|
|
4305
|
+
path: z30.string().min(1),
|
|
4306
|
+
skills: z30.array(
|
|
4307
|
+
z30.object({
|
|
4308
|
+
name: z30.string().min(1),
|
|
4309
|
+
description: z30.string()
|
|
4296
4310
|
}).passthrough()
|
|
4297
4311
|
)
|
|
4298
4312
|
}).passthrough();
|
|
4299
|
-
var skillsConfigureParamsSchema =
|
|
4300
|
-
roots:
|
|
4313
|
+
var skillsConfigureParamsSchema = z30.object({
|
|
4314
|
+
roots: z30.array(skillsConfigureRootSchema)
|
|
4301
4315
|
}).passthrough();
|
|
4302
|
-
var threadIdentityResultSchema =
|
|
4303
|
-
providerThreadId:
|
|
4304
|
-
sessionRestorable:
|
|
4316
|
+
var threadIdentityResultSchema = z30.object({
|
|
4317
|
+
providerThreadId: z30.string().min(1),
|
|
4318
|
+
sessionRestorable: z30.boolean().optional()
|
|
4305
4319
|
}).passthrough();
|
|
4306
4320
|
|
|
4307
4321
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
4308
|
-
import { z as
|
|
4322
|
+
import { z as z31 } from "zod";
|
|
4309
4323
|
var BRIDGE_NOTIFICATION_METHODS = {
|
|
4310
4324
|
threadIdentity: "thread/identity",
|
|
4311
4325
|
sessionReplaced: "session/replaced",
|
|
@@ -4313,142 +4327,142 @@ var BRIDGE_NOTIFICATION_METHODS = {
|
|
|
4313
4327
|
providerRecovery: "provider/recovery",
|
|
4314
4328
|
error: "error"
|
|
4315
4329
|
};
|
|
4316
|
-
var threadIdentityNotificationSchema =
|
|
4317
|
-
threadId:
|
|
4318
|
-
providerThreadId:
|
|
4319
|
-
sessionRestorable:
|
|
4330
|
+
var threadIdentityNotificationSchema = z31.object({
|
|
4331
|
+
threadId: z31.string().min(1),
|
|
4332
|
+
providerThreadId: z31.string().min(1),
|
|
4333
|
+
sessionRestorable: z31.boolean().optional()
|
|
4320
4334
|
}).passthrough();
|
|
4321
|
-
var sessionReplacedNotificationSchema =
|
|
4322
|
-
threadId:
|
|
4323
|
-
providerThreadId:
|
|
4324
|
-
reason:
|
|
4325
|
-
contextLost:
|
|
4326
|
-
showRuntimeNote:
|
|
4335
|
+
var sessionReplacedNotificationSchema = z31.object({
|
|
4336
|
+
threadId: z31.string().min(1),
|
|
4337
|
+
providerThreadId: z31.string().min(1).nullable(),
|
|
4338
|
+
reason: z31.string().min(1),
|
|
4339
|
+
contextLost: z31.boolean().default(false),
|
|
4340
|
+
showRuntimeNote: z31.boolean().default(false)
|
|
4327
4341
|
}).passthrough();
|
|
4328
|
-
var providerRecoveryNotificationSchema =
|
|
4329
|
-
threadId:
|
|
4342
|
+
var providerRecoveryNotificationSchema = z31.object({
|
|
4343
|
+
threadId: z31.string().min(1).optional(),
|
|
4330
4344
|
...providerRecoveryHintSchema.shape
|
|
4331
4345
|
}).passthrough();
|
|
4332
|
-
var errorNotificationSchema =
|
|
4333
|
-
threadId:
|
|
4334
|
-
providerThreadId:
|
|
4335
|
-
message:
|
|
4346
|
+
var errorNotificationSchema = z31.object({
|
|
4347
|
+
threadId: z31.string().min(1).optional(),
|
|
4348
|
+
providerThreadId: z31.string().min(1).optional(),
|
|
4349
|
+
message: z31.string().min(1)
|
|
4336
4350
|
}).passthrough();
|
|
4337
4351
|
|
|
4338
4352
|
// ../provider-bridge-protocol/src/thread-delta.ts
|
|
4339
|
-
import { z as
|
|
4353
|
+
import { z as z32 } from "zod";
|
|
4340
4354
|
var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
|
|
4341
4355
|
var deltaPresentationSchema = threadEventItemPresentationSchema;
|
|
4342
4356
|
var THREAD_DELTA_KEY_SEPARATOR = "";
|
|
4343
|
-
var deltaKeyPartSchema =
|
|
4357
|
+
var deltaKeyPartSchema = z32.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
|
|
4344
4358
|
message: "provider keys must not contain the internal key separator (\\u001f)"
|
|
4345
4359
|
});
|
|
4346
|
-
var deltaItemKeySchema =
|
|
4360
|
+
var deltaItemKeySchema = z32.object({
|
|
4347
4361
|
providerItemId: deltaKeyPartSchema.optional(),
|
|
4348
4362
|
channel: deltaKeyPartSchema.optional(),
|
|
4349
4363
|
parentRef: deltaKeyPartSchema.optional()
|
|
4350
4364
|
});
|
|
4351
4365
|
var providerTurnIdSchema = deltaKeyPartSchema;
|
|
4352
|
-
var deltaFileChangeSchema =
|
|
4353
|
-
path:
|
|
4354
|
-
kind:
|
|
4355
|
-
movePath:
|
|
4356
|
-
diff:
|
|
4357
|
-
oldText:
|
|
4358
|
-
newText:
|
|
4359
|
-
});
|
|
4360
|
-
var deltaBackgroundTaskShapeSchema =
|
|
4361
|
-
type:
|
|
4362
|
-
familyId:
|
|
4363
|
-
taskType:
|
|
4364
|
-
description:
|
|
4366
|
+
var deltaFileChangeSchema = z32.object({
|
|
4367
|
+
path: z32.string(),
|
|
4368
|
+
kind: z32.enum(["add", "update", "delete"]),
|
|
4369
|
+
movePath: z32.string().optional(),
|
|
4370
|
+
diff: z32.string().optional(),
|
|
4371
|
+
oldText: z32.string().optional(),
|
|
4372
|
+
newText: z32.string().optional()
|
|
4373
|
+
});
|
|
4374
|
+
var deltaBackgroundTaskShapeSchema = z32.object({
|
|
4375
|
+
type: z32.literal("backgroundTask"),
|
|
4376
|
+
familyId: z32.string().min(1),
|
|
4377
|
+
taskType: z32.string(),
|
|
4378
|
+
description: z32.string(),
|
|
4365
4379
|
status: threadEventItemStatusSchema,
|
|
4366
4380
|
taskStatus: backgroundTaskStatusSchema,
|
|
4367
|
-
skipTranscript:
|
|
4368
|
-
workflowName:
|
|
4381
|
+
skipTranscript: z32.boolean(),
|
|
4382
|
+
workflowName: z32.string().optional(),
|
|
4369
4383
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
4370
4384
|
usage: backgroundTaskUsageSchema.optional(),
|
|
4371
|
-
summary:
|
|
4372
|
-
error:
|
|
4373
|
-
outputFile:
|
|
4385
|
+
summary: z32.string().optional(),
|
|
4386
|
+
error: z32.string().optional(),
|
|
4387
|
+
outputFile: z32.string().optional()
|
|
4374
4388
|
});
|
|
4375
|
-
var deltaFileReadShapeSchema =
|
|
4376
|
-
type:
|
|
4377
|
-
path:
|
|
4378
|
-
cmd:
|
|
4389
|
+
var deltaFileReadShapeSchema = z32.object({
|
|
4390
|
+
type: z32.literal("fileRead"),
|
|
4391
|
+
path: z32.string(),
|
|
4392
|
+
cmd: z32.string().optional()
|
|
4379
4393
|
});
|
|
4380
|
-
var deltaSearchShapeSchema =
|
|
4381
|
-
type:
|
|
4394
|
+
var deltaSearchShapeSchema = z32.object({
|
|
4395
|
+
type: z32.literal("search"),
|
|
4382
4396
|
mode: threadEventSearchModeSchema,
|
|
4383
|
-
query:
|
|
4384
|
-
path:
|
|
4385
|
-
cmd:
|
|
4397
|
+
query: z32.string(),
|
|
4398
|
+
path: z32.string().optional(),
|
|
4399
|
+
cmd: z32.string().optional()
|
|
4386
4400
|
});
|
|
4387
|
-
var deltaDelegationShapeSchema =
|
|
4388
|
-
type:
|
|
4401
|
+
var deltaDelegationShapeSchema = z32.object({
|
|
4402
|
+
type: z32.literal("delegation"),
|
|
4389
4403
|
childRef: deltaKeyPartSchema,
|
|
4390
|
-
label:
|
|
4391
|
-
background:
|
|
4392
|
-
summary:
|
|
4404
|
+
label: z32.string(),
|
|
4405
|
+
background: z32.boolean(),
|
|
4406
|
+
summary: z32.string().optional()
|
|
4393
4407
|
});
|
|
4394
|
-
var deltaPlanStepsShapeSchema =
|
|
4395
|
-
type:
|
|
4396
|
-
steps:
|
|
4397
|
-
explanation:
|
|
4408
|
+
var deltaPlanStepsShapeSchema = z32.object({
|
|
4409
|
+
type: z32.literal("planSteps"),
|
|
4410
|
+
steps: z32.array(threadEventPlanStepSchema),
|
|
4411
|
+
explanation: z32.string().optional()
|
|
4398
4412
|
});
|
|
4399
|
-
var deltaExtensionShapeSchema =
|
|
4400
|
-
type:
|
|
4413
|
+
var deltaExtensionShapeSchema = z32.object({
|
|
4414
|
+
type: z32.literal("extension"),
|
|
4401
4415
|
kind: extensionKindSchema,
|
|
4402
4416
|
payload: jsonValueSchema
|
|
4403
4417
|
});
|
|
4404
|
-
var deltaItemShapeSchema =
|
|
4405
|
-
|
|
4406
|
-
type:
|
|
4407
|
-
command:
|
|
4408
|
-
cwd:
|
|
4409
|
-
aggregatedOutput:
|
|
4410
|
-
exitCode:
|
|
4411
|
-
durationMs:
|
|
4418
|
+
var deltaItemShapeSchema = z32.discriminatedUnion("type", [
|
|
4419
|
+
z32.object({
|
|
4420
|
+
type: z32.literal("command"),
|
|
4421
|
+
command: z32.string(),
|
|
4422
|
+
cwd: z32.string(),
|
|
4423
|
+
aggregatedOutput: z32.string().optional(),
|
|
4424
|
+
exitCode: z32.number().optional(),
|
|
4425
|
+
durationMs: z32.number().optional()
|
|
4412
4426
|
}),
|
|
4413
|
-
|
|
4414
|
-
type:
|
|
4415
|
-
changes:
|
|
4427
|
+
z32.object({
|
|
4428
|
+
type: z32.literal("fileChange"),
|
|
4429
|
+
changes: z32.array(deltaFileChangeSchema)
|
|
4416
4430
|
}),
|
|
4417
|
-
|
|
4418
|
-
type:
|
|
4419
|
-
tool:
|
|
4420
|
-
server:
|
|
4421
|
-
args:
|
|
4422
|
-
result:
|
|
4423
|
-
error:
|
|
4424
|
-
durationMs:
|
|
4431
|
+
z32.object({
|
|
4432
|
+
type: z32.literal("tool"),
|
|
4433
|
+
tool: z32.string(),
|
|
4434
|
+
server: z32.string().optional(),
|
|
4435
|
+
args: z32.unknown().optional(),
|
|
4436
|
+
result: z32.unknown().optional(),
|
|
4437
|
+
error: z32.string().optional(),
|
|
4438
|
+
durationMs: z32.number().optional()
|
|
4425
4439
|
}),
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
type:
|
|
4430
|
-
summary:
|
|
4431
|
-
content:
|
|
4440
|
+
z32.object({ type: z32.literal("compaction") }),
|
|
4441
|
+
z32.object({ type: z32.literal("agentMessage"), text: z32.string() }),
|
|
4442
|
+
z32.object({
|
|
4443
|
+
type: z32.literal("reasoning"),
|
|
4444
|
+
summary: z32.array(z32.string()),
|
|
4445
|
+
content: z32.array(z32.string())
|
|
4432
4446
|
}),
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
type:
|
|
4436
|
-
queries:
|
|
4447
|
+
z32.object({ type: z32.literal("plan"), text: z32.string() }),
|
|
4448
|
+
z32.object({
|
|
4449
|
+
type: z32.literal("webSearch"),
|
|
4450
|
+
queries: z32.array(z32.string()).min(1)
|
|
4437
4451
|
}),
|
|
4438
|
-
|
|
4439
|
-
type:
|
|
4440
|
-
url:
|
|
4441
|
-
prompt:
|
|
4442
|
-
pattern:
|
|
4452
|
+
z32.object({
|
|
4453
|
+
type: z32.literal("webFetch"),
|
|
4454
|
+
url: z32.string(),
|
|
4455
|
+
prompt: z32.string().nullable().optional(),
|
|
4456
|
+
pattern: z32.string().nullable()
|
|
4443
4457
|
}),
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
type:
|
|
4447
|
-
prompt:
|
|
4448
|
-
path:
|
|
4449
|
-
result:
|
|
4450
|
-
error:
|
|
4451
|
-
transparentBackground:
|
|
4458
|
+
z32.object({ type: z32.literal("imageView"), path: z32.string() }),
|
|
4459
|
+
z32.object({
|
|
4460
|
+
type: z32.literal("imageGeneration"),
|
|
4461
|
+
prompt: z32.string().nullable(),
|
|
4462
|
+
path: z32.string().nullable(),
|
|
4463
|
+
result: z32.string().optional(),
|
|
4464
|
+
error: z32.string().nullable(),
|
|
4465
|
+
transparentBackground: z32.boolean()
|
|
4452
4466
|
}),
|
|
4453
4467
|
deltaBackgroundTaskShapeSchema,
|
|
4454
4468
|
deltaFileReadShapeSchema,
|
|
@@ -4457,22 +4471,22 @@ var deltaItemShapeSchema = z31.discriminatedUnion("type", [
|
|
|
4457
4471
|
deltaPlanStepsShapeSchema,
|
|
4458
4472
|
deltaExtensionShapeSchema
|
|
4459
4473
|
]);
|
|
4460
|
-
var deltaProgressSnapshotSchema =
|
|
4474
|
+
var deltaProgressSnapshotSchema = z32.discriminatedUnion("type", [
|
|
4461
4475
|
deltaBackgroundTaskShapeSchema,
|
|
4462
4476
|
deltaDelegationShapeSchema
|
|
4463
4477
|
]);
|
|
4464
|
-
var deltaTextChannelSchema =
|
|
4478
|
+
var deltaTextChannelSchema = z32.enum([
|
|
4465
4479
|
"agentMessage",
|
|
4466
4480
|
"reasoningSummary",
|
|
4467
4481
|
"reasoningText",
|
|
4468
4482
|
"plan"
|
|
4469
4483
|
]);
|
|
4470
|
-
var deltaOutputChannelSchema =
|
|
4471
|
-
var deltaErrorSchema =
|
|
4472
|
-
var deltaAttachSchema =
|
|
4473
|
-
var deltaNoTurnFallbackSchema =
|
|
4484
|
+
var deltaOutputChannelSchema = z32.enum(["command", "fileChange"]);
|
|
4485
|
+
var deltaErrorSchema = z32.object({ message: z32.string() });
|
|
4486
|
+
var deltaAttachSchema = z32.enum(["open", "currentOrLast"]);
|
|
4487
|
+
var deltaNoTurnFallbackSchema = z32.object({
|
|
4474
4488
|
raw: providerRawEventSchema,
|
|
4475
|
-
rawType:
|
|
4489
|
+
rawType: z32.string()
|
|
4476
4490
|
});
|
|
4477
4491
|
function requireExtensionPresentation(delta, ctx) {
|
|
4478
4492
|
if (delta.item.type === "extension" && delta.presentation === void 0) {
|
|
@@ -4483,32 +4497,32 @@ function requireExtensionPresentation(delta, ctx) {
|
|
|
4483
4497
|
});
|
|
4484
4498
|
}
|
|
4485
4499
|
}
|
|
4486
|
-
var threadDeltaSchema =
|
|
4487
|
-
|
|
4488
|
-
kind:
|
|
4500
|
+
var threadDeltaSchema = z32.discriminatedUnion("kind", [
|
|
4501
|
+
z32.object({
|
|
4502
|
+
kind: z32.literal("input.accepted"),
|
|
4489
4503
|
clientRequestId: clientTurnRequestIdSchema,
|
|
4490
4504
|
providerTurnId: providerTurnIdSchema.optional()
|
|
4491
4505
|
}),
|
|
4492
|
-
|
|
4493
|
-
kind:
|
|
4494
|
-
text:
|
|
4506
|
+
z32.object({
|
|
4507
|
+
kind: z32.literal("input.provider"),
|
|
4508
|
+
text: z32.string().min(1),
|
|
4495
4509
|
parentRef: deltaKeyPartSchema.optional()
|
|
4496
4510
|
}),
|
|
4497
|
-
|
|
4498
|
-
kind:
|
|
4511
|
+
z32.object({
|
|
4512
|
+
kind: z32.literal("turn.open"),
|
|
4499
4513
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4500
4514
|
parentRef: deltaKeyPartSchema.optional()
|
|
4501
4515
|
}),
|
|
4502
|
-
|
|
4503
|
-
kind:
|
|
4516
|
+
z32.object({
|
|
4517
|
+
kind: z32.literal("turn.boundary"),
|
|
4504
4518
|
status: threadEventTurnStatusSchema,
|
|
4505
4519
|
error: deltaErrorSchema.optional(),
|
|
4506
|
-
providerCheckpointId:
|
|
4507
|
-
claimIfIdle:
|
|
4520
|
+
providerCheckpointId: z32.string().min(1).optional(),
|
|
4521
|
+
claimIfIdle: z32.boolean().optional(),
|
|
4508
4522
|
providerTurnId: providerTurnIdSchema.optional()
|
|
4509
4523
|
}),
|
|
4510
|
-
|
|
4511
|
-
kind:
|
|
4524
|
+
z32.object({
|
|
4525
|
+
kind: z32.literal("item.open"),
|
|
4512
4526
|
key: deltaItemKeySchema,
|
|
4513
4527
|
item: deltaItemShapeSchema,
|
|
4514
4528
|
presentation: deltaPresentationSchema.optional(),
|
|
@@ -4516,140 +4530,140 @@ var threadDeltaSchema = z31.discriminatedUnion("kind", [
|
|
|
4516
4530
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4517
4531
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4518
4532
|
}).superRefine(requireExtensionPresentation),
|
|
4519
|
-
|
|
4520
|
-
kind:
|
|
4533
|
+
z32.object({
|
|
4534
|
+
kind: z32.literal("item.close"),
|
|
4521
4535
|
key: deltaItemKeySchema,
|
|
4522
4536
|
status: threadEventItemStatusSchema,
|
|
4523
|
-
resultText:
|
|
4524
|
-
exitCode:
|
|
4525
|
-
aggregatedOutput:
|
|
4526
|
-
approvalStatus:
|
|
4537
|
+
resultText: z32.string().optional(),
|
|
4538
|
+
exitCode: z32.number().optional(),
|
|
4539
|
+
aggregatedOutput: z32.string().optional(),
|
|
4540
|
+
approvalStatus: z32.literal("denied").optional(),
|
|
4527
4541
|
item: deltaItemShapeSchema,
|
|
4528
4542
|
presentation: deltaPresentationSchema.optional(),
|
|
4529
4543
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4530
4544
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4531
4545
|
}).superRefine(requireExtensionPresentation),
|
|
4532
|
-
|
|
4533
|
-
kind:
|
|
4546
|
+
z32.object({
|
|
4547
|
+
kind: z32.literal("item.progress"),
|
|
4534
4548
|
key: deltaItemKeySchema,
|
|
4535
|
-
message:
|
|
4549
|
+
message: z32.string().optional(),
|
|
4536
4550
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
4537
|
-
flush:
|
|
4551
|
+
flush: z32.boolean().optional(),
|
|
4538
4552
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4539
4553
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4540
4554
|
}),
|
|
4541
|
-
|
|
4542
|
-
kind:
|
|
4555
|
+
z32.object({
|
|
4556
|
+
kind: z32.literal("item.textDelta"),
|
|
4543
4557
|
key: deltaItemKeySchema,
|
|
4544
4558
|
channel: deltaTextChannelSchema,
|
|
4545
|
-
text:
|
|
4559
|
+
text: z32.string(),
|
|
4546
4560
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4547
4561
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4548
4562
|
}),
|
|
4549
|
-
|
|
4550
|
-
kind:
|
|
4563
|
+
z32.object({
|
|
4564
|
+
kind: z32.literal("item.textClose"),
|
|
4551
4565
|
key: deltaItemKeySchema,
|
|
4552
4566
|
channel: deltaTextChannelSchema,
|
|
4553
|
-
text:
|
|
4567
|
+
text: z32.string().optional(),
|
|
4554
4568
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4555
4569
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4556
4570
|
}),
|
|
4557
|
-
|
|
4558
|
-
kind:
|
|
4571
|
+
z32.object({
|
|
4572
|
+
kind: z32.literal("item.outputDelta"),
|
|
4559
4573
|
key: deltaItemKeySchema,
|
|
4560
4574
|
channel: deltaOutputChannelSchema,
|
|
4561
|
-
text:
|
|
4575
|
+
text: z32.string(),
|
|
4562
4576
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4563
4577
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4564
4578
|
}),
|
|
4565
|
-
|
|
4566
|
-
kind:
|
|
4579
|
+
z32.object({
|
|
4580
|
+
kind: z32.literal("command.outputSnapshot"),
|
|
4567
4581
|
key: deltaItemKeySchema,
|
|
4568
|
-
text:
|
|
4582
|
+
text: z32.string(),
|
|
4569
4583
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4570
4584
|
}),
|
|
4571
|
-
|
|
4572
|
-
kind:
|
|
4585
|
+
z32.object({
|
|
4586
|
+
kind: z32.literal("usage"),
|
|
4573
4587
|
total: threadEventTokenUsageBreakdownSchema,
|
|
4574
4588
|
last: threadEventTokenUsageBreakdownSchema,
|
|
4575
|
-
modelContextWindow:
|
|
4589
|
+
modelContextWindow: z32.number().nullable(),
|
|
4576
4590
|
providerTurnId: providerTurnIdSchema.optional()
|
|
4577
4591
|
}),
|
|
4578
|
-
|
|
4579
|
-
kind:
|
|
4592
|
+
z32.object({
|
|
4593
|
+
kind: z32.literal("contextWindow"),
|
|
4580
4594
|
snapshot: contextSnapshotSchema.optional(),
|
|
4581
|
-
used:
|
|
4582
|
-
size:
|
|
4583
|
-
estimated:
|
|
4595
|
+
used: z32.number().nullable(),
|
|
4596
|
+
size: z32.number().nullable().optional(),
|
|
4597
|
+
estimated: z32.boolean(),
|
|
4584
4598
|
attach: deltaAttachSchema,
|
|
4585
4599
|
providerTurnId: providerTurnIdSchema.optional()
|
|
4586
4600
|
}),
|
|
4587
|
-
|
|
4588
|
-
kind:
|
|
4601
|
+
z32.object({
|
|
4602
|
+
kind: z32.literal("context.compacted"),
|
|
4589
4603
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4590
4604
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
4591
4605
|
}),
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
kind:
|
|
4595
|
-
diff:
|
|
4606
|
+
z32.object({ kind: z32.literal("context.cleared") }),
|
|
4607
|
+
z32.object({
|
|
4608
|
+
kind: z32.literal("turn.diff"),
|
|
4609
|
+
diff: z32.string(),
|
|
4596
4610
|
providerTurnId: providerTurnIdSchema.optional()
|
|
4597
4611
|
}),
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
kind:
|
|
4601
|
-
providerThreadId:
|
|
4612
|
+
z32.object({ kind: z32.literal("thread.started") }),
|
|
4613
|
+
z32.object({
|
|
4614
|
+
kind: z32.literal("thread.identity"),
|
|
4615
|
+
providerThreadId: z32.string().min(1)
|
|
4602
4616
|
}),
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
kind:
|
|
4617
|
+
z32.object({ kind: z32.literal("thread.name"), name: z32.string().min(1) }),
|
|
4618
|
+
z32.object({
|
|
4619
|
+
kind: z32.literal("extension.state"),
|
|
4606
4620
|
extensionKind: extensionKindSchema,
|
|
4607
4621
|
payload: jsonValueSchema
|
|
4608
4622
|
}),
|
|
4609
|
-
|
|
4610
|
-
kind:
|
|
4623
|
+
z32.object({
|
|
4624
|
+
kind: z32.literal("provider.rateLimits"),
|
|
4611
4625
|
rateLimits: providerRateLimitStateSchema
|
|
4612
4626
|
}),
|
|
4613
|
-
|
|
4614
|
-
kind:
|
|
4615
|
-
message:
|
|
4616
|
-
detail:
|
|
4617
|
-
willRetry:
|
|
4627
|
+
z32.object({
|
|
4628
|
+
kind: z32.literal("provider.error"),
|
|
4629
|
+
message: z32.string(),
|
|
4630
|
+
detail: z32.string().optional(),
|
|
4631
|
+
willRetry: z32.boolean().optional(),
|
|
4618
4632
|
category: providerErrorCategorySchema.optional(),
|
|
4619
4633
|
errorInfo: providerErrorInfoSchema.optional(),
|
|
4620
|
-
settlesTurn:
|
|
4634
|
+
settlesTurn: z32.boolean().optional(),
|
|
4621
4635
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
4622
|
-
threadScoped:
|
|
4636
|
+
threadScoped: z32.boolean().optional()
|
|
4623
4637
|
}),
|
|
4624
|
-
|
|
4625
|
-
kind:
|
|
4626
|
-
originalModel:
|
|
4627
|
-
fallbackModel:
|
|
4628
|
-
reason:
|
|
4629
|
-
message:
|
|
4638
|
+
z32.object({
|
|
4639
|
+
kind: z32.literal("provider.modelFallback"),
|
|
4640
|
+
originalModel: z32.string().min(1),
|
|
4641
|
+
fallbackModel: z32.string().min(1),
|
|
4642
|
+
reason: z32.enum(["refusal", "provider"]),
|
|
4643
|
+
message: z32.string()
|
|
4630
4644
|
}),
|
|
4631
|
-
|
|
4632
|
-
kind:
|
|
4633
|
-
summary:
|
|
4634
|
-
details:
|
|
4645
|
+
z32.object({
|
|
4646
|
+
kind: z32.literal("provider.warning"),
|
|
4647
|
+
summary: z32.string().optional(),
|
|
4648
|
+
details: z32.string().optional(),
|
|
4635
4649
|
category: threadEventWarningCategorySchema.optional(),
|
|
4636
|
-
vouchedTurn:
|
|
4650
|
+
vouchedTurn: z32.boolean().optional()
|
|
4637
4651
|
}),
|
|
4638
|
-
|
|
4639
|
-
kind:
|
|
4652
|
+
z32.object({
|
|
4653
|
+
kind: z32.literal("unhandled"),
|
|
4640
4654
|
raw: providerRawEventSchema,
|
|
4641
|
-
rawType:
|
|
4642
|
-
vouchedTurn:
|
|
4643
|
-
onlyIfNoTurn:
|
|
4655
|
+
rawType: z32.string(),
|
|
4656
|
+
vouchedTurn: z32.boolean(),
|
|
4657
|
+
onlyIfNoTurn: z32.boolean().optional(),
|
|
4644
4658
|
parentRef: deltaKeyPartSchema.optional(),
|
|
4645
4659
|
providerTurnId: providerTurnIdSchema.optional()
|
|
4646
4660
|
}),
|
|
4647
|
-
|
|
4648
|
-
|
|
4661
|
+
z32.object({ kind: z32.literal("session.ended") }),
|
|
4662
|
+
z32.object({ kind: z32.literal("session.reset") })
|
|
4649
4663
|
]);
|
|
4650
|
-
var threadDeltaNotificationParamsSchema =
|
|
4651
|
-
threadId:
|
|
4652
|
-
deltas:
|
|
4664
|
+
var threadDeltaNotificationParamsSchema = z32.object({
|
|
4665
|
+
threadId: z32.string().min(1),
|
|
4666
|
+
deltas: z32.array(threadDeltaSchema)
|
|
4653
4667
|
}).passthrough();
|
|
4654
4668
|
|
|
4655
4669
|
// ../process-utils/src/index.ts
|
|
@@ -4672,10 +4686,10 @@ function sanitizeInheritedChildProcessEnv(args) {
|
|
|
4672
4686
|
}
|
|
4673
4687
|
|
|
4674
4688
|
// ../provider-bridge-acp/src/launch-spec.ts
|
|
4675
|
-
import { z as
|
|
4676
|
-
var acpNativeSkillRootsSchema =
|
|
4677
|
-
user:
|
|
4678
|
-
project:
|
|
4689
|
+
import { z as z33 } from "zod";
|
|
4690
|
+
var acpNativeSkillRootsSchema = z33.object({
|
|
4691
|
+
user: z33.array(providerNativeRootInputSchema).default([]),
|
|
4692
|
+
project: z33.array(providerNativeRootInputSchema).default([])
|
|
4679
4693
|
}).strict().superRefine((roots, context) => {
|
|
4680
4694
|
const normalized = providerNativeRootsSchema.safeParse(
|
|
4681
4695
|
normalizeProviderNativeRoots(roots)
|
|
@@ -4691,16 +4705,16 @@ var acpNativeSkillRootsSchema = z32.object({
|
|
|
4691
4705
|
});
|
|
4692
4706
|
}
|
|
4693
4707
|
});
|
|
4694
|
-
var acpLaunchSpecSchema =
|
|
4695
|
-
displayName:
|
|
4696
|
-
command:
|
|
4697
|
-
args:
|
|
4698
|
-
env:
|
|
4699
|
-
cwd:
|
|
4700
|
-
modelCli:
|
|
4701
|
-
listArgs:
|
|
4702
|
-
selectFlag:
|
|
4703
|
-
primaryModels:
|
|
4708
|
+
var acpLaunchSpecSchema = z33.object({
|
|
4709
|
+
displayName: z33.string().min(1),
|
|
4710
|
+
command: z33.string().min(1),
|
|
4711
|
+
args: z33.array(z33.string()),
|
|
4712
|
+
env: z33.record(z33.string().min(1), z33.string()),
|
|
4713
|
+
cwd: z33.string().min(1).optional(),
|
|
4714
|
+
modelCli: z33.object({
|
|
4715
|
+
listArgs: z33.array(z33.string()),
|
|
4716
|
+
selectFlag: z33.string().min(1).optional(),
|
|
4717
|
+
primaryModels: z33.array(z33.string())
|
|
4704
4718
|
}).strict().transform(
|
|
4705
4719
|
(modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
|
|
4706
4720
|
).optional(),
|
|
@@ -4738,35 +4752,35 @@ function normalizeAcpLaunchSpec(spec) {
|
|
|
4738
4752
|
}
|
|
4739
4753
|
|
|
4740
4754
|
// src/claude-task-tools.ts
|
|
4741
|
-
import { z as
|
|
4742
|
-
var claudeTaskToolNameSchema =
|
|
4755
|
+
import { z as z34 } from "zod";
|
|
4756
|
+
var claudeTaskToolNameSchema = z34.enum([
|
|
4743
4757
|
"TaskCreate",
|
|
4744
4758
|
"TaskGet",
|
|
4745
4759
|
"TaskList",
|
|
4746
4760
|
"TaskUpdate"
|
|
4747
4761
|
]);
|
|
4748
|
-
var claudeTaskStatusSchema =
|
|
4749
|
-
var claudeTaskCreateOutputSchema =
|
|
4750
|
-
task:
|
|
4751
|
-
id:
|
|
4752
|
-
subject:
|
|
4762
|
+
var claudeTaskStatusSchema = z34.enum(["pending", "in_progress", "completed"]);
|
|
4763
|
+
var claudeTaskCreateOutputSchema = z34.object({
|
|
4764
|
+
task: z34.object({
|
|
4765
|
+
id: z34.string(),
|
|
4766
|
+
subject: z34.string()
|
|
4753
4767
|
}).passthrough()
|
|
4754
4768
|
}).passthrough();
|
|
4755
|
-
var claudeTaskGetOutputSchema =
|
|
4756
|
-
task:
|
|
4757
|
-
id:
|
|
4769
|
+
var claudeTaskGetOutputSchema = z34.object({
|
|
4770
|
+
task: z34.object({
|
|
4771
|
+
id: z34.string(),
|
|
4758
4772
|
status: claudeTaskStatusSchema,
|
|
4759
|
-
subject:
|
|
4773
|
+
subject: z34.string()
|
|
4760
4774
|
}).passthrough().nullable()
|
|
4761
4775
|
}).passthrough();
|
|
4762
|
-
var claudeTaskUpdateOutputSchema =
|
|
4763
|
-
success:
|
|
4764
|
-
taskId:
|
|
4776
|
+
var claudeTaskUpdateOutputSchema = z34.object({
|
|
4777
|
+
success: z34.boolean(),
|
|
4778
|
+
taskId: z34.string()
|
|
4765
4779
|
}).passthrough();
|
|
4766
|
-
var claudeTaskListOutputSchema =
|
|
4767
|
-
tasks:
|
|
4780
|
+
var claudeTaskListOutputSchema = z34.object({
|
|
4781
|
+
tasks: z34.array(z34.unknown())
|
|
4768
4782
|
}).passthrough();
|
|
4769
|
-
var claudeTaskToolOutputSchema =
|
|
4783
|
+
var claudeTaskToolOutputSchema = z34.union([
|
|
4770
4784
|
claudeTaskCreateOutputSchema,
|
|
4771
4785
|
claudeTaskGetOutputSchema,
|
|
4772
4786
|
claudeTaskListOutputSchema,
|