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