@get-bb/plugin-sdk 0.6.33 → 0.6.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-types/bb-plugin-sdk-app.d.ts +815 -362
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +5 -10
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +19 -23
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +606 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +32 -90
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +23 -10
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +82 -220
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +33 -18
- package/bundled-types/bb-plugin-sdk-testing.d.ts +7 -3
- package/bundled-types/bb-plugin-sdk.d.ts +835 -367
- package/dist/app.js +33 -0
- package/dist/index.js +9 -0
- package/dist/internal/composer-handle.js +1 -0
- package/dist/internal/host-policy.js +24 -7
- package/dist/internal/plugin-app-collector.js +25 -0
- package/dist/provider-bridge-acp-next.js +24029 -0
- package/dist/provider-bridge-acp.js +964 -873
- package/dist/provider-bridge-testing.js +576 -510
- package/dist/provider-bridge.js +638 -559
- package/dist/testing/app.js +248 -2
- package/dist/testing/index.js +27 -7
- package/package.json +8 -1
|
@@ -621,7 +621,22 @@ var reasoningLevelValues = [
|
|
|
621
621
|
"max",
|
|
622
622
|
"ultra"
|
|
623
623
|
];
|
|
624
|
-
var reasoningLevelSchema = z3.
|
|
624
|
+
var reasoningLevelSchema = z3.string().min(1);
|
|
625
|
+
function isStandardReasoningLevel(level) {
|
|
626
|
+
return reasoningLevelValues.includes(level);
|
|
627
|
+
}
|
|
628
|
+
function standardReasoningLevelRank(level) {
|
|
629
|
+
const rank = reasoningLevelValues.indexOf(level);
|
|
630
|
+
return rank === -1 ? null : rank;
|
|
631
|
+
}
|
|
632
|
+
function compareReasoningLevels(a2, b) {
|
|
633
|
+
const aRank = standardReasoningLevelRank(a2);
|
|
634
|
+
const bRank = standardReasoningLevelRank(b);
|
|
635
|
+
if (aRank === null || bRank === null) {
|
|
636
|
+
return aRank === bRank ? 0 : aRank === null ? 1 : -1;
|
|
637
|
+
}
|
|
638
|
+
return aRank - bRank;
|
|
639
|
+
}
|
|
625
640
|
var serviceTierSchema = z3.string().min(1);
|
|
626
641
|
var instructionModeValues = ["append", "replace"];
|
|
627
642
|
var instructionModeSchema = z3.enum(instructionModeValues);
|
|
@@ -706,6 +721,11 @@ var canonicalPromptMentionResourceSchema = z3.discriminatedUnion("kind", [
|
|
|
706
721
|
icon: z3.string().nullable().optional(),
|
|
707
722
|
itemId: z3.string(),
|
|
708
723
|
label: z3.string()
|
|
724
|
+
}),
|
|
725
|
+
z3.object({
|
|
726
|
+
kind: z3.literal("attachment"),
|
|
727
|
+
path: z3.string(),
|
|
728
|
+
label: z3.string()
|
|
709
729
|
})
|
|
710
730
|
]);
|
|
711
731
|
function normalizeLegacyPromptMentionResource(value) {
|
|
@@ -888,11 +908,17 @@ var runtimePermissionPolicySchema = z3.discriminatedUnion(
|
|
|
888
908
|
]
|
|
889
909
|
);
|
|
890
910
|
var promptModeSchema = z3.literal("plan");
|
|
911
|
+
var sessionOptionValueSchema = z3.union([z3.string(), z3.boolean()]);
|
|
912
|
+
var sessionOptionSelectionsSchema = z3.record(
|
|
913
|
+
z3.string().min(1),
|
|
914
|
+
sessionOptionValueSchema
|
|
915
|
+
);
|
|
891
916
|
var runtimeThreadExecutionBaseOptionsSchema = z3.object({
|
|
892
917
|
model: z3.string().min(1),
|
|
893
918
|
serviceTier: serviceTierSchema,
|
|
894
919
|
reasoningLevel: reasoningLevelSchema,
|
|
895
920
|
promptMode: promptModeSchema.optional(),
|
|
921
|
+
sessionOptions: sessionOptionSelectionsSchema.optional(),
|
|
896
922
|
providerOptions: jsonObjectSchema
|
|
897
923
|
});
|
|
898
924
|
var runtimeThreadExecutionOptionsSchema = runtimeThreadExecutionBaseOptionsSchema.and(runtimePermissionPolicySchema);
|
|
@@ -921,7 +947,7 @@ var providerNativeSkillRootsSchema = z4.object({
|
|
|
921
947
|
user: uniqueProviderSkillRootPathsSchema.default([]),
|
|
922
948
|
project: uniqueProviderSkillRootPathsSchema.default([])
|
|
923
949
|
}).strict();
|
|
924
|
-
var acpReasoningCliLevelValueOverridesSchema = z4.
|
|
950
|
+
var acpReasoningCliLevelValueOverridesSchema = z4.record(
|
|
925
951
|
reasoningLevelSchema,
|
|
926
952
|
z4.string().min(1)
|
|
927
953
|
);
|
|
@@ -2313,11 +2339,16 @@ var threadEventTokenUsageBreakdownSchema = z16.object({
|
|
|
2313
2339
|
outputTokens: z16.number(),
|
|
2314
2340
|
reasoningOutputTokens: z16.number()
|
|
2315
2341
|
});
|
|
2342
|
+
var threadUsageCostSchema = z16.object({
|
|
2343
|
+
amount: z16.number().nonnegative(),
|
|
2344
|
+
currency: z16.string().min(1)
|
|
2345
|
+
});
|
|
2316
2346
|
var threadEventContextWindowUsageSchema = z16.object({
|
|
2317
2347
|
snapshot: contextSnapshotSchema.optional(),
|
|
2318
2348
|
usedTokens: z16.number().nullable(),
|
|
2319
2349
|
modelContextWindow: z16.number().nullable(),
|
|
2320
|
-
estimated: z16.boolean()
|
|
2350
|
+
estimated: z16.boolean(),
|
|
2351
|
+
cost: threadUsageCostSchema.optional()
|
|
2321
2352
|
});
|
|
2322
2353
|
var threadEventTokenUsageSchema = z16.object({
|
|
2323
2354
|
total: threadEventTokenUsageBreakdownSchema,
|
|
@@ -2500,7 +2531,8 @@ var unscopedProviderEventSchema = z16.discriminatedUnion("type", [
|
|
|
2500
2531
|
type: z16.literal("thread/name/updated"),
|
|
2501
2532
|
threadId: z16.string(),
|
|
2502
2533
|
providerThreadId: z16.string(),
|
|
2503
|
-
threadName: z16.string()
|
|
2534
|
+
threadName: z16.string(),
|
|
2535
|
+
source: z16.literal("agent").optional()
|
|
2504
2536
|
}),
|
|
2505
2537
|
z16.object({
|
|
2506
2538
|
type: z16.literal("thread/compacted"),
|
|
@@ -2766,103 +2798,154 @@ var threadEventTypeSchema = z16.string().refine(
|
|
|
2766
2798
|
"Invalid thread event type"
|
|
2767
2799
|
);
|
|
2768
2800
|
|
|
2769
|
-
// ../domain/src/provider-
|
|
2801
|
+
// ../domain/src/thread-provider-state.ts
|
|
2770
2802
|
import { z as z17 } from "zod";
|
|
2803
|
+
var THREAD_PROVIDER_COMMANDS_STATE_KIND = "bb/provider-commands";
|
|
2804
|
+
var THREAD_SESSION_OPTIONS_STATE_KIND = "bb/session-options";
|
|
2805
|
+
var threadProviderCommandSchema = z17.object({
|
|
2806
|
+
name: z17.string().min(1),
|
|
2807
|
+
description: z17.string(),
|
|
2808
|
+
inputHint: z17.string().min(1).optional()
|
|
2809
|
+
});
|
|
2810
|
+
var threadProviderCommandsStateSchema = z17.object({
|
|
2811
|
+
commands: z17.array(threadProviderCommandSchema).max(500)
|
|
2812
|
+
});
|
|
2813
|
+
var threadSessionOptionValueSchema = z17.object({
|
|
2814
|
+
id: z17.string().min(1),
|
|
2815
|
+
label: z17.string().min(1),
|
|
2816
|
+
description: z17.string().min(1).optional(),
|
|
2817
|
+
group: z17.string().min(1).optional()
|
|
2818
|
+
});
|
|
2819
|
+
var threadSessionOptionBaseShape = {
|
|
2820
|
+
id: z17.string().min(1),
|
|
2821
|
+
label: z17.string().min(1),
|
|
2822
|
+
description: z17.string().min(1).optional(),
|
|
2823
|
+
category: z17.string().min(1).optional()
|
|
2824
|
+
};
|
|
2825
|
+
var threadSessionOptionSchema = z17.discriminatedUnion("type", [
|
|
2826
|
+
z17.object({
|
|
2827
|
+
...threadSessionOptionBaseShape,
|
|
2828
|
+
type: z17.literal("select"),
|
|
2829
|
+
value: z17.string(),
|
|
2830
|
+
values: z17.array(threadSessionOptionValueSchema).max(1e3)
|
|
2831
|
+
}),
|
|
2832
|
+
z17.object({
|
|
2833
|
+
...threadSessionOptionBaseShape,
|
|
2834
|
+
type: z17.literal("boolean"),
|
|
2835
|
+
value: z17.boolean(),
|
|
2836
|
+
fixed: z17.boolean().optional()
|
|
2837
|
+
})
|
|
2838
|
+
]);
|
|
2839
|
+
var threadSessionOptionsStateSchema = z17.object({
|
|
2840
|
+
options: z17.array(threadSessionOptionSchema).max(64)
|
|
2841
|
+
});
|
|
2842
|
+
var threadSessionOptionSelectionsStateSchema = z17.object({
|
|
2843
|
+
selections: sessionOptionSelectionsSchema
|
|
2844
|
+
});
|
|
2845
|
+
var CORE_THREAD_STATE_SCHEMAS = {
|
|
2846
|
+
[THREAD_PROVIDER_COMMANDS_STATE_KIND]: threadProviderCommandsStateSchema,
|
|
2847
|
+
[THREAD_SESSION_OPTIONS_STATE_KIND]: threadSessionOptionsStateSchema
|
|
2848
|
+
};
|
|
2849
|
+
|
|
2850
|
+
// ../domain/src/provider-fork.ts
|
|
2851
|
+
import { z as z18 } from "zod";
|
|
2771
2852
|
var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
|
|
2772
|
-
var providerForkSchema =
|
|
2853
|
+
var providerForkSchema = z18.enum(PROVIDER_FORK_VALUES);
|
|
2773
2854
|
|
|
2774
2855
|
// ../domain/src/provider-types.ts
|
|
2775
|
-
import { z as
|
|
2776
|
-
var modelReasoningEffortSchema =
|
|
2856
|
+
import { z as z19 } from "zod";
|
|
2857
|
+
var modelReasoningEffortSchema = z19.object({
|
|
2777
2858
|
reasoningEffort: reasoningLevelSchema,
|
|
2778
|
-
|
|
2859
|
+
label: z19.string().min(1).optional(),
|
|
2860
|
+
description: z19.string()
|
|
2779
2861
|
});
|
|
2780
|
-
var modelServiceTierSchema =
|
|
2862
|
+
var modelServiceTierSchema = z19.object({
|
|
2781
2863
|
id: serviceTierSchema,
|
|
2782
|
-
label:
|
|
2783
|
-
description:
|
|
2864
|
+
label: z19.string().min(1).optional(),
|
|
2865
|
+
description: z19.string().min(1).optional()
|
|
2784
2866
|
});
|
|
2785
|
-
var availableModelSchema =
|
|
2786
|
-
id:
|
|
2787
|
-
model:
|
|
2788
|
-
displayName:
|
|
2789
|
-
routeProviderId:
|
|
2790
|
-
description:
|
|
2791
|
-
supportedReasoningEfforts:
|
|
2867
|
+
var availableModelSchema = z19.object({
|
|
2868
|
+
id: z19.string(),
|
|
2869
|
+
model: z19.string(),
|
|
2870
|
+
displayName: z19.string(),
|
|
2871
|
+
routeProviderId: z19.string().min(1).optional(),
|
|
2872
|
+
description: z19.string(),
|
|
2873
|
+
supportedReasoningEfforts: z19.array(modelReasoningEffortSchema),
|
|
2792
2874
|
defaultReasoningEffort: reasoningLevelSchema,
|
|
2793
|
-
supportedServiceTiers:
|
|
2794
|
-
|
|
2875
|
+
supportedServiceTiers: z19.array(modelServiceTierSchema).optional(),
|
|
2876
|
+
sessionOptions: z19.array(threadSessionOptionSchema).max(64).optional(),
|
|
2877
|
+
isDefault: z19.boolean()
|
|
2795
2878
|
});
|
|
2796
|
-
var providerModelCatalogScopeSchema =
|
|
2797
|
-
var providerCapabilitiesSchema =
|
|
2798
|
-
supportsThreadArchive:
|
|
2799
|
-
supportsThreadRename:
|
|
2800
|
-
supportsServiceTier:
|
|
2801
|
-
supportsNativeUserQuestion:
|
|
2802
|
-
supportsFork:
|
|
2803
|
-
supportsSessionRewind:
|
|
2804
|
-
permissionModes:
|
|
2879
|
+
var providerModelCatalogScopeSchema = z19.enum(["host", "workspace"]);
|
|
2880
|
+
var providerCapabilitiesSchema = z19.object({
|
|
2881
|
+
supportsThreadArchive: z19.boolean(),
|
|
2882
|
+
supportsThreadRename: z19.boolean(),
|
|
2883
|
+
supportsServiceTier: z19.boolean(),
|
|
2884
|
+
supportsNativeUserQuestion: z19.boolean(),
|
|
2885
|
+
supportsFork: z19.boolean(),
|
|
2886
|
+
supportsSessionRewind: z19.boolean(),
|
|
2887
|
+
permissionModes: z19.array(permissionModeSchema).min(1),
|
|
2805
2888
|
modelCatalogScope: providerModelCatalogScopeSchema
|
|
2806
2889
|
});
|
|
2807
|
-
var providerComposerCommandSchema =
|
|
2890
|
+
var providerComposerCommandSchema = z19.object({
|
|
2808
2891
|
trigger: promptMentionCommandTriggerSchema,
|
|
2809
|
-
name:
|
|
2810
|
-
trailingText:
|
|
2892
|
+
name: z19.string().min(1).regex(/^[^\s/$]+$/u),
|
|
2893
|
+
trailingText: z19.string().regex(/^\s*$/u)
|
|
2811
2894
|
});
|
|
2812
|
-
var providerComposerActionSchema =
|
|
2813
|
-
|
|
2814
|
-
kind:
|
|
2895
|
+
var providerComposerActionSchema = z19.discriminatedUnion("kind", [
|
|
2896
|
+
z19.object({
|
|
2897
|
+
kind: z19.literal("skills"),
|
|
2815
2898
|
trigger: promptMentionCommandTriggerSchema
|
|
2816
2899
|
}),
|
|
2817
|
-
|
|
2818
|
-
kind:
|
|
2900
|
+
z19.object({
|
|
2901
|
+
kind: z19.literal("plan"),
|
|
2819
2902
|
command: providerComposerCommandSchema
|
|
2820
2903
|
}),
|
|
2821
|
-
|
|
2822
|
-
kind:
|
|
2904
|
+
z19.object({
|
|
2905
|
+
kind: z19.literal("goal"),
|
|
2823
2906
|
command: providerComposerCommandSchema
|
|
2824
2907
|
})
|
|
2825
2908
|
]);
|
|
2826
|
-
var providerStringsSchema =
|
|
2827
|
-
signInHint:
|
|
2828
|
-
expiredHint:
|
|
2829
|
-
installUrl:
|
|
2830
|
-
brandPrefix:
|
|
2831
|
-
planModeCopy:
|
|
2832
|
-
iconTint:
|
|
2909
|
+
var providerStringsSchema = z19.object({
|
|
2910
|
+
signInHint: z19.string().min(1),
|
|
2911
|
+
expiredHint: z19.string().min(1),
|
|
2912
|
+
installUrl: z19.string().min(1),
|
|
2913
|
+
brandPrefix: z19.string().min(1).optional(),
|
|
2914
|
+
planModeCopy: z19.string().min(1).optional(),
|
|
2915
|
+
iconTint: z19.object({ light: z19.string().min(1), dark: z19.string().min(1) }).optional()
|
|
2833
2916
|
});
|
|
2834
|
-
var providerOptionDescriptorSchema =
|
|
2835
|
-
id:
|
|
2836
|
-
label:
|
|
2837
|
-
description:
|
|
2917
|
+
var providerOptionDescriptorSchema = z19.object({
|
|
2918
|
+
id: z19.string().min(1),
|
|
2919
|
+
label: z19.string().min(1),
|
|
2920
|
+
description: z19.string().min(1).optional()
|
|
2838
2921
|
});
|
|
2839
|
-
var providerExtensionKindInfoSchema =
|
|
2840
|
-
item:
|
|
2841
|
-
state:
|
|
2922
|
+
var providerExtensionKindInfoSchema = z19.object({
|
|
2923
|
+
item: z19.boolean(),
|
|
2924
|
+
state: z19.boolean()
|
|
2842
2925
|
});
|
|
2843
|
-
var providerExtensionKindsSchema =
|
|
2926
|
+
var providerExtensionKindsSchema = z19.record(
|
|
2844
2927
|
extensionKindSchema,
|
|
2845
2928
|
providerExtensionKindInfoSchema
|
|
2846
2929
|
);
|
|
2847
|
-
var providerInfoSchema =
|
|
2848
|
-
id:
|
|
2849
|
-
pluginId:
|
|
2850
|
-
displayName:
|
|
2851
|
-
family:
|
|
2852
|
-
icon:
|
|
2853
|
-
logoUrl:
|
|
2854
|
-
maintenance:
|
|
2855
|
-
health:
|
|
2856
|
-
usage:
|
|
2857
|
-
installation:
|
|
2930
|
+
var providerInfoSchema = z19.object({
|
|
2931
|
+
id: z19.string(),
|
|
2932
|
+
pluginId: z19.string().min(1),
|
|
2933
|
+
displayName: z19.string(),
|
|
2934
|
+
family: z19.string().min(1).optional(),
|
|
2935
|
+
icon: z19.object({ glyph: z19.string().min(1) }).optional(),
|
|
2936
|
+
logoUrl: z19.string().min(1).nullable(),
|
|
2937
|
+
maintenance: z19.object({
|
|
2938
|
+
health: z19.boolean(),
|
|
2939
|
+
usage: z19.boolean(),
|
|
2940
|
+
installation: z19.boolean()
|
|
2858
2941
|
}),
|
|
2859
2942
|
capabilities: providerCapabilitiesSchema,
|
|
2860
|
-
composerActions:
|
|
2943
|
+
composerActions: z19.array(providerComposerActionSchema),
|
|
2861
2944
|
completedTurnDisplay: completedTurnDisplaySchema,
|
|
2862
|
-
available:
|
|
2945
|
+
available: z19.boolean(),
|
|
2863
2946
|
strings: providerStringsSchema.optional(),
|
|
2864
|
-
serviceTiers:
|
|
2865
|
-
reasoningLevels:
|
|
2947
|
+
serviceTiers: z19.array(providerOptionDescriptorSchema).optional(),
|
|
2948
|
+
reasoningLevels: z19.array(providerOptionDescriptorSchema).optional(),
|
|
2866
2949
|
extensionKinds: providerExtensionKindsSchema.optional()
|
|
2867
2950
|
});
|
|
2868
2951
|
var providerRecoveryKindValues = [
|
|
@@ -2872,34 +2955,34 @@ var providerRecoveryKindValues = [
|
|
|
2872
2955
|
"staleTurn",
|
|
2873
2956
|
"rateLimited"
|
|
2874
2957
|
];
|
|
2875
|
-
var providerRecoveryKindSchema =
|
|
2876
|
-
var toolCallOutputItemSchema =
|
|
2877
|
-
|
|
2878
|
-
type:
|
|
2879
|
-
text:
|
|
2958
|
+
var providerRecoveryKindSchema = z19.enum(providerRecoveryKindValues);
|
|
2959
|
+
var toolCallOutputItemSchema = z19.discriminatedUnion("type", [
|
|
2960
|
+
z19.object({
|
|
2961
|
+
type: z19.literal("inputText"),
|
|
2962
|
+
text: z19.string()
|
|
2880
2963
|
}),
|
|
2881
|
-
|
|
2882
|
-
type:
|
|
2883
|
-
imageUrl:
|
|
2964
|
+
z19.object({
|
|
2965
|
+
type: z19.literal("inputImage"),
|
|
2966
|
+
imageUrl: z19.string()
|
|
2884
2967
|
})
|
|
2885
2968
|
]);
|
|
2886
|
-
var toolCallRequestSchema =
|
|
2887
|
-
requestId:
|
|
2888
|
-
threadId:
|
|
2889
|
-
providerThreadId:
|
|
2890
|
-
turnId:
|
|
2891
|
-
callId:
|
|
2892
|
-
tool:
|
|
2893
|
-
arguments:
|
|
2969
|
+
var toolCallRequestSchema = z19.object({
|
|
2970
|
+
requestId: z19.union([z19.string().min(1), z19.number()]),
|
|
2971
|
+
threadId: z19.string().min(1),
|
|
2972
|
+
providerThreadId: z19.string().min(1),
|
|
2973
|
+
turnId: z19.string().min(1),
|
|
2974
|
+
callId: z19.string().min(1),
|
|
2975
|
+
tool: z19.string().min(1),
|
|
2976
|
+
arguments: z19.unknown().optional()
|
|
2894
2977
|
});
|
|
2895
|
-
var toolCallResponseSchema =
|
|
2896
|
-
contentItems:
|
|
2897
|
-
success:
|
|
2978
|
+
var toolCallResponseSchema = z19.object({
|
|
2979
|
+
contentItems: z19.array(toolCallOutputItemSchema),
|
|
2980
|
+
success: z19.boolean()
|
|
2898
2981
|
});
|
|
2899
|
-
var dynamicToolSchema =
|
|
2900
|
-
name:
|
|
2901
|
-
description:
|
|
2902
|
-
inputSchema:
|
|
2982
|
+
var dynamicToolSchema = z19.object({
|
|
2983
|
+
name: z19.string(),
|
|
2984
|
+
description: z19.string(),
|
|
2985
|
+
inputSchema: z19.unknown(),
|
|
2903
2986
|
presentation: threadEventItemPresentationSchema.optional()
|
|
2904
2987
|
});
|
|
2905
2988
|
|
|
@@ -2947,14 +3030,16 @@ var REASONING_EFFORT_BY_LEVEL = {
|
|
|
2947
3030
|
ultra: ULTRA_REASONING_EFFORT
|
|
2948
3031
|
};
|
|
2949
3032
|
function reasoningEffortsForLevels(levels) {
|
|
2950
|
-
return levels.map(
|
|
3033
|
+
return levels.map(
|
|
3034
|
+
(level) => isStandardReasoningLevel(level) ? { ...REASONING_EFFORT_BY_LEVEL[level] } : { reasoningEffort: level, description: level }
|
|
3035
|
+
);
|
|
2951
3036
|
}
|
|
2952
3037
|
|
|
2953
3038
|
// ../provider-bridge-acp/src/launch-spec.ts
|
|
2954
|
-
import { z as
|
|
2955
|
-
var acpNativeSkillRootsSchema =
|
|
2956
|
-
user:
|
|
2957
|
-
project:
|
|
3039
|
+
import { z as z20 } from "zod";
|
|
3040
|
+
var acpNativeSkillRootsSchema = z20.object({
|
|
3041
|
+
user: z20.array(providerNativeRootInputSchema).default([]),
|
|
3042
|
+
project: z20.array(providerNativeRootInputSchema).default([])
|
|
2958
3043
|
}).strict().superRefine((roots, context) => {
|
|
2959
3044
|
const normalized = providerNativeRootsSchema.safeParse(
|
|
2960
3045
|
normalizeProviderNativeRoots(roots)
|
|
@@ -2970,16 +3055,16 @@ var acpNativeSkillRootsSchema = z19.object({
|
|
|
2970
3055
|
});
|
|
2971
3056
|
}
|
|
2972
3057
|
});
|
|
2973
|
-
var acpLaunchSpecSchema =
|
|
2974
|
-
displayName:
|
|
2975
|
-
command:
|
|
2976
|
-
args:
|
|
2977
|
-
env:
|
|
2978
|
-
cwd:
|
|
2979
|
-
modelCli:
|
|
2980
|
-
listArgs:
|
|
2981
|
-
selectFlag:
|
|
2982
|
-
primaryModels:
|
|
3058
|
+
var acpLaunchSpecSchema = z20.object({
|
|
3059
|
+
displayName: z20.string().min(1),
|
|
3060
|
+
command: z20.string().min(1),
|
|
3061
|
+
args: z20.array(z20.string()),
|
|
3062
|
+
env: z20.record(z20.string().min(1), z20.string()),
|
|
3063
|
+
cwd: z20.string().min(1).optional(),
|
|
3064
|
+
modelCli: z20.object({
|
|
3065
|
+
listArgs: z20.array(z20.string()),
|
|
3066
|
+
selectFlag: z20.string().min(1).optional(),
|
|
3067
|
+
primaryModels: z20.array(z20.string())
|
|
2983
3068
|
}).strict().transform(
|
|
2984
3069
|
(modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
|
|
2985
3070
|
).optional(),
|
|
@@ -2994,67 +3079,68 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
|
|
|
2994
3079
|
var THREAD_DELTA_GRAMMAR_V3 = 3;
|
|
2995
3080
|
|
|
2996
3081
|
// ../provider-bridge-protocol/src/handshake.ts
|
|
2997
|
-
import { z as
|
|
2998
|
-
var bridgeGrammarVersionsSchema =
|
|
3082
|
+
import { z as z21 } from "zod";
|
|
3083
|
+
var bridgeGrammarVersionsSchema = z21.tuple([z21.number().int().positive(), z21.number().int().positive()]).refine(([min, max]) => min <= max, {
|
|
2999
3084
|
message: "grammarVersions must be an ascending [min, max] range"
|
|
3000
3085
|
});
|
|
3001
|
-
var bridgeSteerModeSchema =
|
|
3002
|
-
var bridgeCapabilitiesSchema =
|
|
3003
|
-
sessionRestore:
|
|
3004
|
-
threadArchive:
|
|
3005
|
-
threadRename:
|
|
3006
|
-
threadGoalClear:
|
|
3086
|
+
var bridgeSteerModeSchema = z21.enum(["inject", "queue"]);
|
|
3087
|
+
var bridgeCapabilitiesSchema = z21.object({
|
|
3088
|
+
sessionRestore: z21.boolean().default(false),
|
|
3089
|
+
threadArchive: z21.boolean().default(false),
|
|
3090
|
+
threadRename: z21.boolean().default(false),
|
|
3091
|
+
threadGoalClear: z21.boolean().default(false),
|
|
3007
3092
|
fork: providerForkSchema.default("none"),
|
|
3008
|
-
approvalEnforcedBy:
|
|
3093
|
+
approvalEnforcedBy: z21.enum(["runtime", "provider"]).default("runtime"),
|
|
3009
3094
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
3010
3095
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
3011
3096
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
3012
3097
|
]),
|
|
3013
3098
|
steerMode: bridgeSteerModeSchema.default("queue"),
|
|
3014
|
-
skills:
|
|
3099
|
+
skills: z21.object({ configure: z21.boolean().default(false) }).default({ configure: false })
|
|
3015
3100
|
}).passthrough();
|
|
3016
|
-
var initializeParamsSchema =
|
|
3017
|
-
protocolVersion:
|
|
3018
|
-
client:
|
|
3101
|
+
var initializeParamsSchema = z21.object({
|
|
3102
|
+
protocolVersion: z21.number().int().positive(),
|
|
3103
|
+
client: z21.object({ name: z21.string().min(1), version: z21.string().min(1) }),
|
|
3019
3104
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
3020
3105
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
3021
3106
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
3022
3107
|
])
|
|
3023
3108
|
}).passthrough();
|
|
3024
|
-
var initializeResultSchema =
|
|
3025
|
-
protocolVersion:
|
|
3026
|
-
capabilities:
|
|
3109
|
+
var initializeResultSchema = z21.object({
|
|
3110
|
+
protocolVersion: z21.number().int().positive(),
|
|
3111
|
+
capabilities: z21.preprocess(
|
|
3027
3112
|
(value) => value ?? {},
|
|
3028
3113
|
bridgeCapabilitiesSchema
|
|
3029
3114
|
)
|
|
3030
3115
|
}).passthrough();
|
|
3031
3116
|
|
|
3032
3117
|
// ../provider-bridge-protocol/src/execution-options.ts
|
|
3033
|
-
import { z as
|
|
3034
|
-
var bridgeExecutionOptionsSchema =
|
|
3035
|
-
model:
|
|
3118
|
+
import { z as z22 } from "zod";
|
|
3119
|
+
var bridgeExecutionOptionsSchema = z22.object({
|
|
3120
|
+
model: z22.string().min(1).optional(),
|
|
3036
3121
|
serviceTier: serviceTierSchema.optional(),
|
|
3037
3122
|
reasoningLevel: reasoningLevelSchema.optional(),
|
|
3038
3123
|
promptMode: promptModeSchema.optional(),
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3124
|
+
sessionOptions: sessionOptionSelectionsSchema.optional(),
|
|
3125
|
+
instructions: z22.string().optional(),
|
|
3126
|
+
envVars: z22.record(z22.string(), z22.string()).optional(),
|
|
3127
|
+
providerOptions: z22.record(z22.string(), z22.unknown()).optional()
|
|
3042
3128
|
}).and(runtimePermissionPolicySchema);
|
|
3043
3129
|
|
|
3044
3130
|
// ../provider-bridge-protocol/src/provider-maintenance.ts
|
|
3045
|
-
import { z as
|
|
3046
|
-
var providerMaintenanceParamsSchema =
|
|
3047
|
-
providerId:
|
|
3048
|
-
cwd:
|
|
3049
|
-
providerOptions:
|
|
3131
|
+
import { z as z23 } from "zod";
|
|
3132
|
+
var providerMaintenanceParamsSchema = z23.object({
|
|
3133
|
+
providerId: z23.string().min(1),
|
|
3134
|
+
cwd: z23.string().min(1).optional(),
|
|
3135
|
+
providerOptions: z23.record(z23.string(), z23.unknown()).optional()
|
|
3050
3136
|
}).passthrough();
|
|
3051
|
-
var providerInstallationRequirementSchema =
|
|
3137
|
+
var providerInstallationRequirementSchema = z23.enum(["thread_rewind"]);
|
|
3052
3138
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
3053
3139
|
requirement: providerInstallationRequirementSchema.optional(),
|
|
3054
|
-
checkUpdates:
|
|
3140
|
+
checkUpdates: z23.boolean().default(true)
|
|
3055
3141
|
});
|
|
3056
|
-
var providerHealthSchema =
|
|
3057
|
-
status:
|
|
3142
|
+
var providerHealthSchema = z23.object({
|
|
3143
|
+
status: z23.enum([
|
|
3058
3144
|
"ready",
|
|
3059
3145
|
"not_installed",
|
|
3060
3146
|
"unauthenticated",
|
|
@@ -3062,115 +3148,115 @@ var providerHealthSchema = z22.object({
|
|
|
3062
3148
|
"unsupported_version",
|
|
3063
3149
|
"unknown"
|
|
3064
3150
|
]),
|
|
3065
|
-
statusMessage:
|
|
3066
|
-
accountEmail:
|
|
3067
|
-
planLabel:
|
|
3068
|
-
installedVersion:
|
|
3069
|
-
minimumSupportedVersion:
|
|
3070
|
-
canInstall:
|
|
3071
|
-
canUpdate:
|
|
3072
|
-
loginCommand:
|
|
3073
|
-
localLoginCommand:
|
|
3151
|
+
statusMessage: z23.string().min(1).nullable(),
|
|
3152
|
+
accountEmail: z23.string().nullable(),
|
|
3153
|
+
planLabel: z23.string().min(1).nullable(),
|
|
3154
|
+
installedVersion: z23.string().min(1).nullable(),
|
|
3155
|
+
minimumSupportedVersion: z23.string().min(1).nullable(),
|
|
3156
|
+
canInstall: z23.boolean(),
|
|
3157
|
+
canUpdate: z23.boolean(),
|
|
3158
|
+
loginCommand: z23.string().min(1).nullable(),
|
|
3159
|
+
localLoginCommand: z23.string().min(1).nullable().optional()
|
|
3074
3160
|
}).passthrough();
|
|
3075
|
-
var providerUsageWindowSchema =
|
|
3076
|
-
label:
|
|
3077
|
-
usedPercent:
|
|
3078
|
-
resetsAt:
|
|
3079
|
-
cost:
|
|
3080
|
-
usedUsdCents:
|
|
3081
|
-
limitUsdCents:
|
|
3161
|
+
var providerUsageWindowSchema = z23.object({
|
|
3162
|
+
label: z23.string().min(1),
|
|
3163
|
+
usedPercent: z23.number().min(0).max(100),
|
|
3164
|
+
resetsAt: z23.string().min(1).nullable(),
|
|
3165
|
+
cost: z23.object({
|
|
3166
|
+
usedUsdCents: z23.number().int().nonnegative(),
|
|
3167
|
+
limitUsdCents: z23.number().int().positive()
|
|
3082
3168
|
}).optional()
|
|
3083
3169
|
}).passthrough();
|
|
3084
|
-
var providerUsageSchema =
|
|
3085
|
-
|
|
3086
|
-
status:
|
|
3087
|
-
accountEmail:
|
|
3088
|
-
planLabel:
|
|
3089
|
-
windows:
|
|
3170
|
+
var providerUsageSchema = z23.discriminatedUnion("status", [
|
|
3171
|
+
z23.object({
|
|
3172
|
+
status: z23.literal("ok"),
|
|
3173
|
+
accountEmail: z23.string().email().nullable(),
|
|
3174
|
+
planLabel: z23.string().min(1).nullable(),
|
|
3175
|
+
windows: z23.array(providerUsageWindowSchema)
|
|
3090
3176
|
}).passthrough(),
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
status:
|
|
3096
|
-
message:
|
|
3097
|
-
planLabel:
|
|
3098
|
-
accountEmail:
|
|
3177
|
+
z23.object({ status: z23.literal("not_installed") }).passthrough(),
|
|
3178
|
+
z23.object({ status: z23.literal("unauthenticated") }).passthrough(),
|
|
3179
|
+
z23.object({ status: z23.literal("expired") }).passthrough(),
|
|
3180
|
+
z23.object({
|
|
3181
|
+
status: z23.literal("error"),
|
|
3182
|
+
message: z23.string().min(1),
|
|
3183
|
+
planLabel: z23.string().min(1).nullable().default(null),
|
|
3184
|
+
accountEmail: z23.string().nullable().default(null)
|
|
3099
3185
|
}).passthrough()
|
|
3100
3186
|
]);
|
|
3101
|
-
var providerHealthResultSchema =
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
supported:
|
|
3187
|
+
var providerHealthResultSchema = z23.discriminatedUnion("supported", [
|
|
3188
|
+
z23.object({ supported: z23.literal(false) }).passthrough(),
|
|
3189
|
+
z23.object({
|
|
3190
|
+
supported: z23.literal(true),
|
|
3105
3191
|
health: providerHealthSchema
|
|
3106
3192
|
}).passthrough()
|
|
3107
3193
|
]);
|
|
3108
|
-
var providerUsageResultSchema =
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
supported:
|
|
3194
|
+
var providerUsageResultSchema = z23.discriminatedUnion("supported", [
|
|
3195
|
+
z23.object({ supported: z23.literal(false) }).passthrough(),
|
|
3196
|
+
z23.object({
|
|
3197
|
+
supported: z23.literal(true),
|
|
3112
3198
|
usage: providerUsageSchema
|
|
3113
3199
|
}).passthrough()
|
|
3114
3200
|
]);
|
|
3115
|
-
var providerInstallationActionKindSchema =
|
|
3201
|
+
var providerInstallationActionKindSchema = z23.enum([
|
|
3116
3202
|
"install",
|
|
3117
3203
|
"update"
|
|
3118
3204
|
]);
|
|
3119
|
-
var providerInstallationActionSchema =
|
|
3205
|
+
var providerInstallationActionSchema = z23.object({
|
|
3120
3206
|
kind: providerInstallationActionKindSchema,
|
|
3121
|
-
label:
|
|
3122
|
-
command:
|
|
3207
|
+
label: z23.enum(["Install", "Update"]),
|
|
3208
|
+
command: z23.string().min(1)
|
|
3123
3209
|
}).passthrough();
|
|
3124
|
-
var providerInstallationSourceSchema =
|
|
3210
|
+
var providerInstallationSourceSchema = z23.enum([
|
|
3125
3211
|
"notInstalled",
|
|
3126
3212
|
"npmGlobal",
|
|
3127
3213
|
"external"
|
|
3128
3214
|
]);
|
|
3129
|
-
var providerInstallationStatusSchema =
|
|
3130
|
-
executableName:
|
|
3131
|
-
executablePath:
|
|
3132
|
-
installed:
|
|
3215
|
+
var providerInstallationStatusSchema = z23.object({
|
|
3216
|
+
executableName: z23.string().min(1),
|
|
3217
|
+
executablePath: z23.string().min(1).nullable(),
|
|
3218
|
+
installed: z23.boolean(),
|
|
3133
3219
|
installSource: providerInstallationSourceSchema,
|
|
3134
|
-
currentVersion:
|
|
3135
|
-
latestVersion:
|
|
3136
|
-
minimumSupportedVersion:
|
|
3137
|
-
npmPackageName:
|
|
3138
|
-
npmGlobalPackageVersion:
|
|
3220
|
+
currentVersion: z23.string().min(1).nullable(),
|
|
3221
|
+
latestVersion: z23.string().min(1).nullable(),
|
|
3222
|
+
minimumSupportedVersion: z23.string().min(1).nullable(),
|
|
3223
|
+
npmPackageName: z23.string().min(1).nullable(),
|
|
3224
|
+
npmGlobalPackageVersion: z23.string().min(1).nullable(),
|
|
3139
3225
|
installAction: providerInstallationActionSchema.nullable(),
|
|
3140
|
-
needsUpdate:
|
|
3141
|
-
versionUnsupported:
|
|
3226
|
+
needsUpdate: z23.boolean(),
|
|
3227
|
+
versionUnsupported: z23.boolean()
|
|
3142
3228
|
}).passthrough();
|
|
3143
3229
|
var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
3144
3230
|
action: providerInstallationActionKindSchema
|
|
3145
3231
|
});
|
|
3146
|
-
var providerInstallationCommandSchema =
|
|
3147
|
-
command:
|
|
3148
|
-
args:
|
|
3149
|
-
displayCommand:
|
|
3232
|
+
var providerInstallationCommandSchema = z23.object({
|
|
3233
|
+
command: z23.string().min(1),
|
|
3234
|
+
args: z23.array(z23.string()).max(64),
|
|
3235
|
+
displayCommand: z23.string().min(1)
|
|
3150
3236
|
}).passthrough();
|
|
3151
|
-
var providerInstallationVerificationSchema =
|
|
3237
|
+
var providerInstallationVerificationSchema = z23.discriminatedUnion(
|
|
3152
3238
|
"kind",
|
|
3153
3239
|
[
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
kind:
|
|
3157
|
-
previousVersion:
|
|
3240
|
+
z23.object({ kind: z23.literal("installed") }).passthrough(),
|
|
3241
|
+
z23.object({
|
|
3242
|
+
kind: z23.literal("version_changed"),
|
|
3243
|
+
previousVersion: z23.string().min(1)
|
|
3158
3244
|
}).passthrough(),
|
|
3159
|
-
|
|
3160
|
-
kind:
|
|
3161
|
-
version:
|
|
3245
|
+
z23.object({
|
|
3246
|
+
kind: z23.literal("version_at_least"),
|
|
3247
|
+
version: z23.string().min(1)
|
|
3162
3248
|
}).passthrough()
|
|
3163
3249
|
]
|
|
3164
3250
|
);
|
|
3165
|
-
var providerInstallationRunResultSchema =
|
|
3251
|
+
var providerInstallationRunResultSchema = z23.discriminatedUnion(
|
|
3166
3252
|
"available",
|
|
3167
3253
|
[
|
|
3168
|
-
|
|
3169
|
-
available:
|
|
3170
|
-
message:
|
|
3254
|
+
z23.object({
|
|
3255
|
+
available: z23.literal(false),
|
|
3256
|
+
message: z23.string().min(1)
|
|
3171
3257
|
}).passthrough(),
|
|
3172
|
-
|
|
3173
|
-
available:
|
|
3258
|
+
z23.object({
|
|
3259
|
+
available: z23.literal(true),
|
|
3174
3260
|
command: providerInstallationCommandSchema,
|
|
3175
3261
|
verification: providerInstallationVerificationSchema
|
|
3176
3262
|
}).passthrough()
|
|
@@ -3178,80 +3264,80 @@ var providerInstallationRunResultSchema = z22.discriminatedUnion(
|
|
|
3178
3264
|
);
|
|
3179
3265
|
|
|
3180
3266
|
// ../provider-bridge-protocol/src/requests.ts
|
|
3181
|
-
import { z as
|
|
3267
|
+
import { z as z24 } from "zod";
|
|
3182
3268
|
var sessionConstructionFields = {
|
|
3183
|
-
threadId:
|
|
3184
|
-
cwd:
|
|
3269
|
+
threadId: z24.string().min(1),
|
|
3270
|
+
cwd: z24.string().min(1),
|
|
3185
3271
|
options: bridgeExecutionOptionsSchema,
|
|
3186
|
-
dynamicTools:
|
|
3187
|
-
disallowedTools:
|
|
3272
|
+
dynamicTools: z24.array(dynamicToolSchema).optional(),
|
|
3273
|
+
disallowedTools: z24.array(z24.string().min(1)).optional(),
|
|
3188
3274
|
instructionMode: instructionModeSchema
|
|
3189
3275
|
};
|
|
3190
|
-
var modelListParamsSchema =
|
|
3191
|
-
var threadStartParamsSchema =
|
|
3276
|
+
var modelListParamsSchema = z24.object({ cwd: z24.string().min(1).optional() }).passthrough();
|
|
3277
|
+
var threadStartParamsSchema = z24.object({
|
|
3192
3278
|
...sessionConstructionFields,
|
|
3193
|
-
input:
|
|
3279
|
+
input: z24.array(promptInputSchema).optional()
|
|
3194
3280
|
}).passthrough();
|
|
3195
|
-
var threadResumeParamsSchema =
|
|
3281
|
+
var threadResumeParamsSchema = z24.object({
|
|
3196
3282
|
...sessionConstructionFields,
|
|
3197
|
-
providerThreadId:
|
|
3283
|
+
providerThreadId: z24.string().min(1)
|
|
3198
3284
|
}).passthrough();
|
|
3199
|
-
var threadForkParamsSchema =
|
|
3285
|
+
var threadForkParamsSchema = z24.object({
|
|
3200
3286
|
...sessionConstructionFields,
|
|
3201
|
-
sourceProviderThreadId:
|
|
3202
|
-
sourceProviderCheckpointId:
|
|
3287
|
+
sourceProviderThreadId: z24.string().min(1),
|
|
3288
|
+
sourceProviderCheckpointId: z24.string().min(1).optional()
|
|
3203
3289
|
}).passthrough();
|
|
3204
|
-
var threadStopParamsSchema =
|
|
3205
|
-
threadId:
|
|
3206
|
-
providerThreadId:
|
|
3207
|
-
intent:
|
|
3208
|
-
activeTurnId:
|
|
3290
|
+
var threadStopParamsSchema = z24.object({
|
|
3291
|
+
threadId: z24.string().min(1),
|
|
3292
|
+
providerThreadId: z24.string().min(1),
|
|
3293
|
+
intent: z24.enum(["interrupt", "release"]),
|
|
3294
|
+
activeTurnId: z24.string().min(1).nullable()
|
|
3209
3295
|
}).passthrough();
|
|
3210
|
-
var threadRefParams =
|
|
3211
|
-
threadId:
|
|
3212
|
-
providerThreadId:
|
|
3296
|
+
var threadRefParams = z24.object({
|
|
3297
|
+
threadId: z24.string().min(1),
|
|
3298
|
+
providerThreadId: z24.string().min(1)
|
|
3213
3299
|
}).passthrough();
|
|
3214
3300
|
var threadDiscardParamsSchema = threadRefParams;
|
|
3215
|
-
var threadNameSetParamsSchema =
|
|
3216
|
-
threadId:
|
|
3217
|
-
providerThreadId:
|
|
3218
|
-
title:
|
|
3301
|
+
var threadNameSetParamsSchema = z24.object({
|
|
3302
|
+
threadId: z24.string().min(1),
|
|
3303
|
+
providerThreadId: z24.string().min(1),
|
|
3304
|
+
title: z24.string().min(1)
|
|
3219
3305
|
}).passthrough();
|
|
3220
3306
|
var turnInputFields = {
|
|
3221
|
-
threadId:
|
|
3222
|
-
providerThreadId:
|
|
3223
|
-
input:
|
|
3307
|
+
threadId: z24.string().min(1),
|
|
3308
|
+
providerThreadId: z24.string().min(1),
|
|
3309
|
+
input: z24.array(promptInputSchema),
|
|
3224
3310
|
clientRequestId: clientTurnRequestIdSchema,
|
|
3225
3311
|
options: bridgeExecutionOptionsSchema
|
|
3226
3312
|
};
|
|
3227
|
-
var turnStartParamsSchema =
|
|
3228
|
-
var turnSteerParamsSchema =
|
|
3313
|
+
var turnStartParamsSchema = z24.object(turnInputFields).passthrough();
|
|
3314
|
+
var turnSteerParamsSchema = z24.object({
|
|
3229
3315
|
...turnInputFields,
|
|
3230
|
-
expectedTurnId:
|
|
3316
|
+
expectedTurnId: z24.string().min(1)
|
|
3231
3317
|
}).passthrough();
|
|
3232
|
-
var skillsConfigureRootSchema =
|
|
3233
|
-
id:
|
|
3234
|
-
path:
|
|
3235
|
-
skills:
|
|
3236
|
-
|
|
3237
|
-
name:
|
|
3238
|
-
description:
|
|
3318
|
+
var skillsConfigureRootSchema = z24.object({
|
|
3319
|
+
id: z24.string().min(1),
|
|
3320
|
+
path: z24.string().min(1),
|
|
3321
|
+
skills: z24.array(
|
|
3322
|
+
z24.object({
|
|
3323
|
+
name: z24.string().min(1),
|
|
3324
|
+
description: z24.string()
|
|
3239
3325
|
}).passthrough()
|
|
3240
3326
|
)
|
|
3241
3327
|
}).passthrough();
|
|
3242
|
-
var skillsConfigureParamsSchema =
|
|
3243
|
-
roots:
|
|
3328
|
+
var skillsConfigureParamsSchema = z24.object({
|
|
3329
|
+
roots: z24.array(skillsConfigureRootSchema)
|
|
3244
3330
|
}).passthrough();
|
|
3245
|
-
var threadIdentityResultSchema =
|
|
3246
|
-
providerThreadId:
|
|
3247
|
-
sessionRestorable:
|
|
3331
|
+
var threadIdentityResultSchema = z24.object({
|
|
3332
|
+
providerThreadId: z24.string().min(1),
|
|
3333
|
+
sessionRestorable: z24.boolean().optional()
|
|
3248
3334
|
}).passthrough();
|
|
3249
3335
|
|
|
3250
3336
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
3251
|
-
import { z as
|
|
3337
|
+
import { z as z26 } from "zod";
|
|
3252
3338
|
|
|
3253
3339
|
// ../provider-bridge-protocol/src/errors.ts
|
|
3254
|
-
import { z as
|
|
3340
|
+
import { z as z25 } from "zod";
|
|
3255
3341
|
var BRIDGE_JSON_RPC_ERRORS = {
|
|
3256
3342
|
INVALID_PARAMS: -32602,
|
|
3257
3343
|
METHOD_NOT_FOUND: -32601,
|
|
@@ -3261,12 +3347,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
|
|
|
3261
3347
|
FORK_CHECKPOINT_UNSUPPORTED: -32003,
|
|
3262
3348
|
MISSING_EXECUTABLE: -32004
|
|
3263
3349
|
};
|
|
3264
|
-
var providerRecoveryHintSchema =
|
|
3350
|
+
var providerRecoveryHintSchema = z25.object({
|
|
3265
3351
|
kind: providerRecoveryKindSchema,
|
|
3266
|
-
message:
|
|
3267
|
-
retryable:
|
|
3352
|
+
message: z25.string().min(1),
|
|
3353
|
+
retryable: z25.boolean()
|
|
3268
3354
|
});
|
|
3269
|
-
var bridgeErrorDataSchema =
|
|
3355
|
+
var bridgeErrorDataSchema = z25.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
|
|
3270
3356
|
|
|
3271
3357
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
3272
3358
|
var BRIDGE_NOTIFICATION_METHODS = {
|
|
@@ -3276,177 +3362,177 @@ var BRIDGE_NOTIFICATION_METHODS = {
|
|
|
3276
3362
|
providerRecovery: "provider/recovery",
|
|
3277
3363
|
error: "error"
|
|
3278
3364
|
};
|
|
3279
|
-
var threadIdentityNotificationSchema =
|
|
3280
|
-
threadId:
|
|
3281
|
-
providerThreadId:
|
|
3282
|
-
sessionRestorable:
|
|
3365
|
+
var threadIdentityNotificationSchema = z26.object({
|
|
3366
|
+
threadId: z26.string().min(1),
|
|
3367
|
+
providerThreadId: z26.string().min(1),
|
|
3368
|
+
sessionRestorable: z26.boolean().optional()
|
|
3283
3369
|
}).passthrough();
|
|
3284
|
-
var sessionReplacedNotificationSchema =
|
|
3285
|
-
threadId:
|
|
3286
|
-
providerThreadId:
|
|
3287
|
-
reason:
|
|
3288
|
-
contextLost:
|
|
3289
|
-
showRuntimeNote:
|
|
3370
|
+
var sessionReplacedNotificationSchema = z26.object({
|
|
3371
|
+
threadId: z26.string().min(1),
|
|
3372
|
+
providerThreadId: z26.string().min(1).nullable(),
|
|
3373
|
+
reason: z26.string().min(1),
|
|
3374
|
+
contextLost: z26.boolean().default(false),
|
|
3375
|
+
showRuntimeNote: z26.boolean().default(false)
|
|
3290
3376
|
}).passthrough();
|
|
3291
|
-
var providerRecoveryNotificationSchema =
|
|
3292
|
-
threadId:
|
|
3377
|
+
var providerRecoveryNotificationSchema = z26.object({
|
|
3378
|
+
threadId: z26.string().min(1).optional(),
|
|
3293
3379
|
...providerRecoveryHintSchema.shape
|
|
3294
3380
|
}).passthrough();
|
|
3295
|
-
var errorNotificationSchema =
|
|
3296
|
-
threadId:
|
|
3297
|
-
providerThreadId:
|
|
3298
|
-
message:
|
|
3381
|
+
var errorNotificationSchema = z26.object({
|
|
3382
|
+
threadId: z26.string().min(1).optional(),
|
|
3383
|
+
providerThreadId: z26.string().min(1).optional(),
|
|
3384
|
+
message: z26.string().min(1)
|
|
3299
3385
|
}).passthrough();
|
|
3300
3386
|
|
|
3301
3387
|
// ../provider-bridge-protocol/src/bridge-requests.ts
|
|
3302
|
-
import { z as
|
|
3388
|
+
import { z as z27 } from "zod";
|
|
3303
3389
|
var BRIDGE_INBOUND_REQUEST_METHODS = {
|
|
3304
3390
|
toolCall: "item/tool/call",
|
|
3305
3391
|
interactionRequest: "interaction/request"
|
|
3306
3392
|
};
|
|
3307
|
-
var toolCallRequestParamsSchema =
|
|
3308
|
-
providerThreadId:
|
|
3309
|
-
threadId:
|
|
3310
|
-
turnId:
|
|
3311
|
-
callId:
|
|
3312
|
-
tool:
|
|
3313
|
-
arguments:
|
|
3314
|
-
providerNativeIds:
|
|
3393
|
+
var toolCallRequestParamsSchema = z27.object({
|
|
3394
|
+
providerThreadId: z27.string().min(1),
|
|
3395
|
+
threadId: z27.string().min(1).optional(),
|
|
3396
|
+
turnId: z27.union([z27.string().min(1), z27.null()]),
|
|
3397
|
+
callId: z27.string().min(1),
|
|
3398
|
+
tool: z27.string().min(1),
|
|
3399
|
+
arguments: z27.unknown(),
|
|
3400
|
+
providerNativeIds: z27.boolean().optional()
|
|
3315
3401
|
}).passthrough();
|
|
3316
|
-
var toolCallResultSchema =
|
|
3317
|
-
success:
|
|
3318
|
-
contentItems:
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
type:
|
|
3323
|
-
imageUrl:
|
|
3402
|
+
var toolCallResultSchema = z27.object({
|
|
3403
|
+
success: z27.boolean(),
|
|
3404
|
+
contentItems: z27.array(
|
|
3405
|
+
z27.discriminatedUnion("type", [
|
|
3406
|
+
z27.object({ type: z27.literal("inputText"), text: z27.string() }),
|
|
3407
|
+
z27.object({
|
|
3408
|
+
type: z27.literal("inputImage"),
|
|
3409
|
+
imageUrl: z27.string().min(1)
|
|
3324
3410
|
})
|
|
3325
3411
|
])
|
|
3326
3412
|
)
|
|
3327
3413
|
}).passthrough();
|
|
3328
|
-
var interactionRequestParamsSchema =
|
|
3329
|
-
providerThreadId:
|
|
3330
|
-
threadId:
|
|
3331
|
-
turnId:
|
|
3414
|
+
var interactionRequestParamsSchema = z27.object({
|
|
3415
|
+
providerThreadId: z27.string().min(1),
|
|
3416
|
+
threadId: z27.string().min(1).optional(),
|
|
3417
|
+
turnId: z27.union([z27.string().min(1), z27.null()]),
|
|
3332
3418
|
payload: pendingInteractionPayloadSchema,
|
|
3333
|
-
providerNativeIds:
|
|
3419
|
+
providerNativeIds: z27.boolean().optional()
|
|
3334
3420
|
}).passthrough();
|
|
3335
3421
|
|
|
3336
3422
|
// ../provider-bridge-protocol/src/thread-delta.ts
|
|
3337
|
-
import { z as
|
|
3423
|
+
import { z as z28 } from "zod";
|
|
3338
3424
|
var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
|
|
3339
3425
|
var deltaPresentationSchema = threadEventItemPresentationSchema;
|
|
3340
3426
|
var THREAD_DELTA_KEY_SEPARATOR = "";
|
|
3341
|
-
var deltaKeyPartSchema =
|
|
3427
|
+
var deltaKeyPartSchema = z28.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
|
|
3342
3428
|
message: "provider keys must not contain the internal key separator (\\u001f)"
|
|
3343
3429
|
});
|
|
3344
|
-
var deltaItemKeySchema =
|
|
3430
|
+
var deltaItemKeySchema = z28.object({
|
|
3345
3431
|
providerItemId: deltaKeyPartSchema.optional(),
|
|
3346
3432
|
channel: deltaKeyPartSchema.optional(),
|
|
3347
3433
|
parentRef: deltaKeyPartSchema.optional()
|
|
3348
3434
|
});
|
|
3349
3435
|
var providerTurnIdSchema = deltaKeyPartSchema;
|
|
3350
|
-
var deltaFileChangeSchema =
|
|
3351
|
-
path:
|
|
3352
|
-
kind:
|
|
3353
|
-
movePath:
|
|
3354
|
-
diff:
|
|
3355
|
-
oldText:
|
|
3356
|
-
newText:
|
|
3436
|
+
var deltaFileChangeSchema = z28.object({
|
|
3437
|
+
path: z28.string(),
|
|
3438
|
+
kind: z28.enum(["add", "update", "delete"]),
|
|
3439
|
+
movePath: z28.string().optional(),
|
|
3440
|
+
diff: z28.string().optional(),
|
|
3441
|
+
oldText: z28.string().optional(),
|
|
3442
|
+
newText: z28.string().optional()
|
|
3357
3443
|
});
|
|
3358
|
-
var deltaBackgroundTaskShapeSchema =
|
|
3359
|
-
type:
|
|
3360
|
-
familyId:
|
|
3361
|
-
taskType:
|
|
3362
|
-
description:
|
|
3444
|
+
var deltaBackgroundTaskShapeSchema = z28.object({
|
|
3445
|
+
type: z28.literal("backgroundTask"),
|
|
3446
|
+
familyId: z28.string().min(1),
|
|
3447
|
+
taskType: z28.string(),
|
|
3448
|
+
description: z28.string(),
|
|
3363
3449
|
status: threadEventItemStatusSchema,
|
|
3364
3450
|
taskStatus: backgroundTaskStatusSchema,
|
|
3365
|
-
skipTranscript:
|
|
3366
|
-
workflowName:
|
|
3451
|
+
skipTranscript: z28.boolean(),
|
|
3452
|
+
workflowName: z28.string().optional(),
|
|
3367
3453
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
3368
3454
|
usage: backgroundTaskUsageSchema.optional(),
|
|
3369
|
-
summary:
|
|
3370
|
-
error:
|
|
3371
|
-
outputFile:
|
|
3455
|
+
summary: z28.string().optional(),
|
|
3456
|
+
error: z28.string().optional(),
|
|
3457
|
+
outputFile: z28.string().optional()
|
|
3372
3458
|
});
|
|
3373
|
-
var deltaFileReadShapeSchema =
|
|
3374
|
-
type:
|
|
3375
|
-
path:
|
|
3376
|
-
cmd:
|
|
3459
|
+
var deltaFileReadShapeSchema = z28.object({
|
|
3460
|
+
type: z28.literal("fileRead"),
|
|
3461
|
+
path: z28.string(),
|
|
3462
|
+
cmd: z28.string().optional()
|
|
3377
3463
|
});
|
|
3378
|
-
var deltaSearchShapeSchema =
|
|
3379
|
-
type:
|
|
3464
|
+
var deltaSearchShapeSchema = z28.object({
|
|
3465
|
+
type: z28.literal("search"),
|
|
3380
3466
|
mode: threadEventSearchModeSchema,
|
|
3381
|
-
query:
|
|
3382
|
-
path:
|
|
3383
|
-
cmd:
|
|
3467
|
+
query: z28.string(),
|
|
3468
|
+
path: z28.string().optional(),
|
|
3469
|
+
cmd: z28.string().optional()
|
|
3384
3470
|
});
|
|
3385
|
-
var deltaDelegationShapeSchema =
|
|
3386
|
-
type:
|
|
3471
|
+
var deltaDelegationShapeSchema = z28.object({
|
|
3472
|
+
type: z28.literal("delegation"),
|
|
3387
3473
|
childRef: deltaKeyPartSchema,
|
|
3388
|
-
label:
|
|
3389
|
-
background:
|
|
3390
|
-
summary:
|
|
3474
|
+
label: z28.string(),
|
|
3475
|
+
background: z28.boolean(),
|
|
3476
|
+
summary: z28.string().optional()
|
|
3391
3477
|
});
|
|
3392
|
-
var deltaPlanStepsShapeSchema =
|
|
3393
|
-
type:
|
|
3394
|
-
steps:
|
|
3395
|
-
explanation:
|
|
3478
|
+
var deltaPlanStepsShapeSchema = z28.object({
|
|
3479
|
+
type: z28.literal("planSteps"),
|
|
3480
|
+
steps: z28.array(threadEventPlanStepSchema),
|
|
3481
|
+
explanation: z28.string().optional()
|
|
3396
3482
|
});
|
|
3397
|
-
var deltaExtensionShapeSchema =
|
|
3398
|
-
type:
|
|
3483
|
+
var deltaExtensionShapeSchema = z28.object({
|
|
3484
|
+
type: z28.literal("extension"),
|
|
3399
3485
|
kind: extensionKindSchema,
|
|
3400
3486
|
payload: jsonValueSchema
|
|
3401
3487
|
});
|
|
3402
|
-
var deltaItemShapeSchema =
|
|
3403
|
-
|
|
3404
|
-
type:
|
|
3405
|
-
command:
|
|
3406
|
-
cwd:
|
|
3407
|
-
aggregatedOutput:
|
|
3408
|
-
exitCode:
|
|
3409
|
-
durationMs:
|
|
3488
|
+
var deltaItemShapeSchema = z28.discriminatedUnion("type", [
|
|
3489
|
+
z28.object({
|
|
3490
|
+
type: z28.literal("command"),
|
|
3491
|
+
command: z28.string(),
|
|
3492
|
+
cwd: z28.string(),
|
|
3493
|
+
aggregatedOutput: z28.string().optional(),
|
|
3494
|
+
exitCode: z28.number().optional(),
|
|
3495
|
+
durationMs: z28.number().optional()
|
|
3410
3496
|
}),
|
|
3411
|
-
|
|
3412
|
-
type:
|
|
3413
|
-
changes:
|
|
3497
|
+
z28.object({
|
|
3498
|
+
type: z28.literal("fileChange"),
|
|
3499
|
+
changes: z28.array(deltaFileChangeSchema)
|
|
3414
3500
|
}),
|
|
3415
|
-
|
|
3416
|
-
type:
|
|
3417
|
-
tool:
|
|
3418
|
-
server:
|
|
3419
|
-
args:
|
|
3420
|
-
result:
|
|
3421
|
-
error:
|
|
3422
|
-
durationMs:
|
|
3501
|
+
z28.object({
|
|
3502
|
+
type: z28.literal("tool"),
|
|
3503
|
+
tool: z28.string(),
|
|
3504
|
+
server: z28.string().optional(),
|
|
3505
|
+
args: z28.unknown().optional(),
|
|
3506
|
+
result: z28.unknown().optional(),
|
|
3507
|
+
error: z28.string().optional(),
|
|
3508
|
+
durationMs: z28.number().optional()
|
|
3423
3509
|
}),
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
type:
|
|
3428
|
-
summary:
|
|
3429
|
-
content:
|
|
3510
|
+
z28.object({ type: z28.literal("compaction") }),
|
|
3511
|
+
z28.object({ type: z28.literal("agentMessage"), text: z28.string() }),
|
|
3512
|
+
z28.object({
|
|
3513
|
+
type: z28.literal("reasoning"),
|
|
3514
|
+
summary: z28.array(z28.string()),
|
|
3515
|
+
content: z28.array(z28.string())
|
|
3430
3516
|
}),
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
type:
|
|
3434
|
-
queries:
|
|
3517
|
+
z28.object({ type: z28.literal("plan"), text: z28.string() }),
|
|
3518
|
+
z28.object({
|
|
3519
|
+
type: z28.literal("webSearch"),
|
|
3520
|
+
queries: z28.array(z28.string()).min(1)
|
|
3435
3521
|
}),
|
|
3436
|
-
|
|
3437
|
-
type:
|
|
3438
|
-
url:
|
|
3439
|
-
prompt:
|
|
3440
|
-
pattern:
|
|
3522
|
+
z28.object({
|
|
3523
|
+
type: z28.literal("webFetch"),
|
|
3524
|
+
url: z28.string(),
|
|
3525
|
+
prompt: z28.string().nullable().optional(),
|
|
3526
|
+
pattern: z28.string().nullable()
|
|
3441
3527
|
}),
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
type:
|
|
3445
|
-
prompt:
|
|
3446
|
-
path:
|
|
3447
|
-
result:
|
|
3448
|
-
error:
|
|
3449
|
-
transparentBackground:
|
|
3528
|
+
z28.object({ type: z28.literal("imageView"), path: z28.string() }),
|
|
3529
|
+
z28.object({
|
|
3530
|
+
type: z28.literal("imageGeneration"),
|
|
3531
|
+
prompt: z28.string().nullable(),
|
|
3532
|
+
path: z28.string().nullable(),
|
|
3533
|
+
result: z28.string().optional(),
|
|
3534
|
+
error: z28.string().nullable(),
|
|
3535
|
+
transparentBackground: z28.boolean()
|
|
3450
3536
|
}),
|
|
3451
3537
|
deltaBackgroundTaskShapeSchema,
|
|
3452
3538
|
deltaFileReadShapeSchema,
|
|
@@ -3455,22 +3541,22 @@ var deltaItemShapeSchema = z27.discriminatedUnion("type", [
|
|
|
3455
3541
|
deltaPlanStepsShapeSchema,
|
|
3456
3542
|
deltaExtensionShapeSchema
|
|
3457
3543
|
]);
|
|
3458
|
-
var deltaProgressSnapshotSchema =
|
|
3544
|
+
var deltaProgressSnapshotSchema = z28.discriminatedUnion("type", [
|
|
3459
3545
|
deltaBackgroundTaskShapeSchema,
|
|
3460
3546
|
deltaDelegationShapeSchema
|
|
3461
3547
|
]);
|
|
3462
|
-
var deltaTextChannelSchema =
|
|
3548
|
+
var deltaTextChannelSchema = z28.enum([
|
|
3463
3549
|
"agentMessage",
|
|
3464
3550
|
"reasoningSummary",
|
|
3465
3551
|
"reasoningText",
|
|
3466
3552
|
"plan"
|
|
3467
3553
|
]);
|
|
3468
|
-
var deltaOutputChannelSchema =
|
|
3469
|
-
var deltaErrorSchema =
|
|
3470
|
-
var deltaAttachSchema =
|
|
3471
|
-
var deltaNoTurnFallbackSchema =
|
|
3554
|
+
var deltaOutputChannelSchema = z28.enum(["command", "fileChange"]);
|
|
3555
|
+
var deltaErrorSchema = z28.object({ message: z28.string() });
|
|
3556
|
+
var deltaAttachSchema = z28.enum(["open", "currentOrLast"]);
|
|
3557
|
+
var deltaNoTurnFallbackSchema = z28.object({
|
|
3472
3558
|
raw: providerRawEventSchema,
|
|
3473
|
-
rawType:
|
|
3559
|
+
rawType: z28.string()
|
|
3474
3560
|
});
|
|
3475
3561
|
function requireExtensionPresentation(delta, ctx) {
|
|
3476
3562
|
if (delta.item.type === "extension" && delta.presentation === void 0) {
|
|
@@ -3481,32 +3567,32 @@ function requireExtensionPresentation(delta, ctx) {
|
|
|
3481
3567
|
});
|
|
3482
3568
|
}
|
|
3483
3569
|
}
|
|
3484
|
-
var threadDeltaSchema =
|
|
3485
|
-
|
|
3486
|
-
kind:
|
|
3570
|
+
var threadDeltaSchema = z28.discriminatedUnion("kind", [
|
|
3571
|
+
z28.object({
|
|
3572
|
+
kind: z28.literal("input.accepted"),
|
|
3487
3573
|
clientRequestId: clientTurnRequestIdSchema,
|
|
3488
3574
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3489
3575
|
}),
|
|
3490
|
-
|
|
3491
|
-
kind:
|
|
3492
|
-
text:
|
|
3576
|
+
z28.object({
|
|
3577
|
+
kind: z28.literal("input.provider"),
|
|
3578
|
+
text: z28.string().min(1),
|
|
3493
3579
|
parentRef: deltaKeyPartSchema.optional()
|
|
3494
3580
|
}),
|
|
3495
|
-
|
|
3496
|
-
kind:
|
|
3581
|
+
z28.object({
|
|
3582
|
+
kind: z28.literal("turn.open"),
|
|
3497
3583
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3498
3584
|
parentRef: deltaKeyPartSchema.optional()
|
|
3499
3585
|
}),
|
|
3500
|
-
|
|
3501
|
-
kind:
|
|
3586
|
+
z28.object({
|
|
3587
|
+
kind: z28.literal("turn.boundary"),
|
|
3502
3588
|
status: threadEventTurnStatusSchema,
|
|
3503
3589
|
error: deltaErrorSchema.optional(),
|
|
3504
|
-
providerCheckpointId:
|
|
3505
|
-
claimIfIdle:
|
|
3590
|
+
providerCheckpointId: z28.string().min(1).optional(),
|
|
3591
|
+
claimIfIdle: z28.boolean().optional(),
|
|
3506
3592
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3507
3593
|
}),
|
|
3508
|
-
|
|
3509
|
-
kind:
|
|
3594
|
+
z28.object({
|
|
3595
|
+
kind: z28.literal("item.open"),
|
|
3510
3596
|
key: deltaItemKeySchema,
|
|
3511
3597
|
item: deltaItemShapeSchema,
|
|
3512
3598
|
presentation: deltaPresentationSchema.optional(),
|
|
@@ -3514,154 +3600,159 @@ var threadDeltaSchema = z27.discriminatedUnion("kind", [
|
|
|
3514
3600
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3515
3601
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3516
3602
|
}).superRefine(requireExtensionPresentation),
|
|
3517
|
-
|
|
3518
|
-
kind:
|
|
3603
|
+
z28.object({
|
|
3604
|
+
kind: z28.literal("item.close"),
|
|
3519
3605
|
key: deltaItemKeySchema,
|
|
3520
3606
|
status: threadEventItemStatusSchema,
|
|
3521
|
-
resultText:
|
|
3522
|
-
exitCode:
|
|
3523
|
-
aggregatedOutput:
|
|
3524
|
-
approvalStatus:
|
|
3607
|
+
resultText: z28.string().optional(),
|
|
3608
|
+
exitCode: z28.number().optional(),
|
|
3609
|
+
aggregatedOutput: z28.string().optional(),
|
|
3610
|
+
approvalStatus: z28.literal("denied").optional(),
|
|
3525
3611
|
item: deltaItemShapeSchema,
|
|
3526
3612
|
presentation: deltaPresentationSchema.optional(),
|
|
3527
3613
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3528
3614
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3529
3615
|
}).superRefine(requireExtensionPresentation),
|
|
3530
|
-
|
|
3531
|
-
kind:
|
|
3616
|
+
z28.object({
|
|
3617
|
+
kind: z28.literal("item.progress"),
|
|
3532
3618
|
key: deltaItemKeySchema,
|
|
3533
|
-
message:
|
|
3619
|
+
message: z28.string().optional(),
|
|
3534
3620
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
3535
|
-
flush:
|
|
3621
|
+
flush: z28.boolean().optional(),
|
|
3536
3622
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3537
3623
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3538
3624
|
}),
|
|
3539
|
-
|
|
3540
|
-
kind:
|
|
3625
|
+
z28.object({
|
|
3626
|
+
kind: z28.literal("item.textDelta"),
|
|
3541
3627
|
key: deltaItemKeySchema,
|
|
3542
3628
|
channel: deltaTextChannelSchema,
|
|
3543
|
-
text:
|
|
3629
|
+
text: z28.string(),
|
|
3544
3630
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3545
3631
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3546
3632
|
}),
|
|
3547
|
-
|
|
3548
|
-
kind:
|
|
3633
|
+
z28.object({
|
|
3634
|
+
kind: z28.literal("item.textClose"),
|
|
3549
3635
|
key: deltaItemKeySchema,
|
|
3550
3636
|
channel: deltaTextChannelSchema,
|
|
3551
|
-
text:
|
|
3637
|
+
text: z28.string().optional(),
|
|
3552
3638
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3553
3639
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3554
3640
|
}),
|
|
3555
|
-
|
|
3556
|
-
kind:
|
|
3641
|
+
z28.object({
|
|
3642
|
+
kind: z28.literal("item.outputDelta"),
|
|
3557
3643
|
key: deltaItemKeySchema,
|
|
3558
3644
|
channel: deltaOutputChannelSchema,
|
|
3559
|
-
text:
|
|
3645
|
+
text: z28.string(),
|
|
3560
3646
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3561
3647
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3562
3648
|
}),
|
|
3563
|
-
|
|
3564
|
-
kind:
|
|
3649
|
+
z28.object({
|
|
3650
|
+
kind: z28.literal("command.outputSnapshot"),
|
|
3565
3651
|
key: deltaItemKeySchema,
|
|
3566
|
-
text:
|
|
3652
|
+
text: z28.string(),
|
|
3567
3653
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3568
3654
|
}),
|
|
3569
|
-
|
|
3570
|
-
kind:
|
|
3655
|
+
z28.object({
|
|
3656
|
+
kind: z28.literal("usage"),
|
|
3571
3657
|
total: threadEventTokenUsageBreakdownSchema,
|
|
3572
3658
|
last: threadEventTokenUsageBreakdownSchema,
|
|
3573
|
-
modelContextWindow:
|
|
3659
|
+
modelContextWindow: z28.number().nullable(),
|
|
3574
3660
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3575
3661
|
}),
|
|
3576
|
-
|
|
3577
|
-
kind:
|
|
3662
|
+
z28.object({
|
|
3663
|
+
kind: z28.literal("contextWindow"),
|
|
3578
3664
|
snapshot: contextSnapshotSchema.optional(),
|
|
3579
|
-
used:
|
|
3580
|
-
size:
|
|
3581
|
-
estimated:
|
|
3665
|
+
used: z28.number().nullable(),
|
|
3666
|
+
size: z28.number().nullable().optional(),
|
|
3667
|
+
estimated: z28.boolean(),
|
|
3668
|
+
cost: threadUsageCostSchema.optional(),
|
|
3582
3669
|
attach: deltaAttachSchema,
|
|
3583
3670
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3584
3671
|
}),
|
|
3585
|
-
|
|
3586
|
-
kind:
|
|
3672
|
+
z28.object({
|
|
3673
|
+
kind: z28.literal("context.compacted"),
|
|
3587
3674
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3588
3675
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3589
3676
|
}),
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
kind:
|
|
3593
|
-
diff:
|
|
3677
|
+
z28.object({ kind: z28.literal("context.cleared") }),
|
|
3678
|
+
z28.object({
|
|
3679
|
+
kind: z28.literal("turn.diff"),
|
|
3680
|
+
diff: z28.string(),
|
|
3594
3681
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3595
3682
|
}),
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
kind:
|
|
3599
|
-
providerThreadId:
|
|
3683
|
+
z28.object({ kind: z28.literal("thread.started") }),
|
|
3684
|
+
z28.object({
|
|
3685
|
+
kind: z28.literal("thread.identity"),
|
|
3686
|
+
providerThreadId: z28.string().min(1)
|
|
3600
3687
|
}),
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3688
|
+
z28.object({
|
|
3689
|
+
kind: z28.literal("thread.name"),
|
|
3690
|
+
name: z28.string().min(1),
|
|
3691
|
+
source: z28.literal("agent").optional()
|
|
3692
|
+
}),
|
|
3693
|
+
z28.object({
|
|
3694
|
+
kind: z28.literal("extension.state"),
|
|
3604
3695
|
extensionKind: extensionKindSchema,
|
|
3605
3696
|
payload: jsonValueSchema
|
|
3606
3697
|
}),
|
|
3607
|
-
|
|
3608
|
-
kind:
|
|
3698
|
+
z28.object({
|
|
3699
|
+
kind: z28.literal("provider.rateLimits"),
|
|
3609
3700
|
rateLimits: providerRateLimitStateSchema
|
|
3610
3701
|
}),
|
|
3611
|
-
|
|
3612
|
-
kind:
|
|
3613
|
-
message:
|
|
3614
|
-
detail:
|
|
3615
|
-
willRetry:
|
|
3702
|
+
z28.object({
|
|
3703
|
+
kind: z28.literal("provider.error"),
|
|
3704
|
+
message: z28.string(),
|
|
3705
|
+
detail: z28.string().optional(),
|
|
3706
|
+
willRetry: z28.boolean().optional(),
|
|
3616
3707
|
category: providerErrorCategorySchema.optional(),
|
|
3617
3708
|
errorInfo: providerErrorInfoSchema.optional(),
|
|
3618
|
-
settlesTurn:
|
|
3709
|
+
settlesTurn: z28.boolean().optional(),
|
|
3619
3710
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3620
|
-
threadScoped:
|
|
3711
|
+
threadScoped: z28.boolean().optional()
|
|
3621
3712
|
}),
|
|
3622
|
-
|
|
3623
|
-
kind:
|
|
3624
|
-
originalModel:
|
|
3625
|
-
fallbackModel:
|
|
3626
|
-
reason:
|
|
3627
|
-
message:
|
|
3713
|
+
z28.object({
|
|
3714
|
+
kind: z28.literal("provider.modelFallback"),
|
|
3715
|
+
originalModel: z28.string().min(1),
|
|
3716
|
+
fallbackModel: z28.string().min(1),
|
|
3717
|
+
reason: z28.enum(["refusal", "provider"]),
|
|
3718
|
+
message: z28.string()
|
|
3628
3719
|
}),
|
|
3629
|
-
|
|
3630
|
-
kind:
|
|
3631
|
-
summary:
|
|
3632
|
-
details:
|
|
3720
|
+
z28.object({
|
|
3721
|
+
kind: z28.literal("provider.warning"),
|
|
3722
|
+
summary: z28.string().optional(),
|
|
3723
|
+
details: z28.string().optional(),
|
|
3633
3724
|
category: threadEventWarningCategorySchema.optional(),
|
|
3634
|
-
vouchedTurn:
|
|
3725
|
+
vouchedTurn: z28.boolean().optional()
|
|
3635
3726
|
}),
|
|
3636
|
-
|
|
3637
|
-
kind:
|
|
3727
|
+
z28.object({
|
|
3728
|
+
kind: z28.literal("unhandled"),
|
|
3638
3729
|
raw: providerRawEventSchema,
|
|
3639
|
-
rawType:
|
|
3640
|
-
vouchedTurn:
|
|
3641
|
-
onlyIfNoTurn:
|
|
3730
|
+
rawType: z28.string(),
|
|
3731
|
+
vouchedTurn: z28.boolean(),
|
|
3732
|
+
onlyIfNoTurn: z28.boolean().optional(),
|
|
3642
3733
|
parentRef: deltaKeyPartSchema.optional(),
|
|
3643
3734
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3644
3735
|
}),
|
|
3645
|
-
|
|
3646
|
-
|
|
3736
|
+
z28.object({ kind: z28.literal("session.ended") }),
|
|
3737
|
+
z28.object({ kind: z28.literal("session.reset") })
|
|
3647
3738
|
]);
|
|
3648
|
-
var threadDeltaNotificationParamsSchema =
|
|
3649
|
-
threadId:
|
|
3650
|
-
deltas:
|
|
3739
|
+
var threadDeltaNotificationParamsSchema = z28.object({
|
|
3740
|
+
threadId: z28.string().min(1),
|
|
3741
|
+
deltas: z28.array(threadDeltaSchema)
|
|
3651
3742
|
}).passthrough();
|
|
3652
3743
|
|
|
3653
3744
|
// ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
|
|
3654
|
-
import { z as
|
|
3745
|
+
import { z as z30 } from "zod";
|
|
3655
3746
|
|
|
3656
3747
|
// ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
|
|
3657
|
-
import { z as
|
|
3658
|
-
var bashArgsSchema =
|
|
3659
|
-
command:
|
|
3660
|
-
cwd:
|
|
3748
|
+
import { z as z29 } from "zod";
|
|
3749
|
+
var bashArgsSchema = z29.object({
|
|
3750
|
+
command: z29.string().optional(),
|
|
3751
|
+
cwd: z29.string().optional()
|
|
3661
3752
|
}).passthrough();
|
|
3662
|
-
var textBlockSchema =
|
|
3663
|
-
type:
|
|
3664
|
-
text:
|
|
3753
|
+
var textBlockSchema = z29.object({
|
|
3754
|
+
type: z29.literal("text"),
|
|
3755
|
+
text: z29.string()
|
|
3665
3756
|
});
|
|
3666
3757
|
|
|
3667
3758
|
// ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
|
|
@@ -3674,10 +3765,10 @@ function getStringProperty(value, key) {
|
|
|
3674
3765
|
}
|
|
3675
3766
|
|
|
3676
3767
|
// ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
|
|
3677
|
-
var contentWrapperSchema =
|
|
3678
|
-
content:
|
|
3768
|
+
var contentWrapperSchema = z30.object({
|
|
3769
|
+
content: z30.array(z30.unknown())
|
|
3679
3770
|
}).passthrough();
|
|
3680
|
-
var shellEnvironmentVariableKeySchema =
|
|
3771
|
+
var shellEnvironmentVariableKeySchema = z30.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
|
|
3681
3772
|
function toOptionalString(value) {
|
|
3682
3773
|
return typeof value === "string" ? value : void 0;
|
|
3683
3774
|
}
|
|
@@ -4031,26 +4122,26 @@ function withoutBridgeRuntimeEnv(env) {
|
|
|
4031
4122
|
}
|
|
4032
4123
|
|
|
4033
4124
|
// ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
|
|
4034
|
-
import { z as
|
|
4035
|
-
var bridgeRequestEnvelopeSchema =
|
|
4036
|
-
jsonrpc:
|
|
4037
|
-
id:
|
|
4038
|
-
method:
|
|
4039
|
-
params:
|
|
4125
|
+
import { z as z31 } from "zod";
|
|
4126
|
+
var bridgeRequestEnvelopeSchema = z31.object({
|
|
4127
|
+
jsonrpc: z31.literal("2.0"),
|
|
4128
|
+
id: z31.union([z31.string(), z31.number()]),
|
|
4129
|
+
method: z31.string(),
|
|
4130
|
+
params: z31.record(z31.string(), z31.unknown()).optional()
|
|
4040
4131
|
});
|
|
4041
|
-
var jsonRpcErrorSchema =
|
|
4042
|
-
code:
|
|
4043
|
-
message:
|
|
4044
|
-
data:
|
|
4132
|
+
var jsonRpcErrorSchema = z31.object({
|
|
4133
|
+
code: z31.number(),
|
|
4134
|
+
message: z31.string().optional(),
|
|
4135
|
+
data: z31.unknown().optional()
|
|
4045
4136
|
});
|
|
4046
|
-
var jsonRpcSuccessResponseSchema =
|
|
4047
|
-
jsonrpc:
|
|
4048
|
-
id:
|
|
4049
|
-
result:
|
|
4137
|
+
var jsonRpcSuccessResponseSchema = z31.object({
|
|
4138
|
+
jsonrpc: z31.literal("2.0"),
|
|
4139
|
+
id: z31.union([z31.string(), z31.number()]),
|
|
4140
|
+
result: z31.unknown()
|
|
4050
4141
|
});
|
|
4051
|
-
var jsonRpcErrorResponseSchema =
|
|
4052
|
-
jsonrpc:
|
|
4053
|
-
id:
|
|
4142
|
+
var jsonRpcErrorResponseSchema = z31.object({
|
|
4143
|
+
jsonrpc: z31.literal("2.0"),
|
|
4144
|
+
id: z31.union([z31.string(), z31.number()]),
|
|
4054
4145
|
error: jsonRpcErrorSchema
|
|
4055
4146
|
});
|
|
4056
4147
|
function isJsonRpcRequest(input) {
|
|
@@ -4138,47 +4229,47 @@ function buildBridgeToolCallContent(result) {
|
|
|
4138
4229
|
}
|
|
4139
4230
|
|
|
4140
4231
|
// ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
|
|
4141
|
-
import { z as
|
|
4142
|
-
var recordSchema =
|
|
4143
|
-
var jsonRpcEnvelopeSchema =
|
|
4144
|
-
jsonrpc:
|
|
4145
|
-
method:
|
|
4232
|
+
import { z as z32 } from "zod";
|
|
4233
|
+
var recordSchema = z32.record(z32.string(), z32.unknown());
|
|
4234
|
+
var jsonRpcEnvelopeSchema = z32.object({
|
|
4235
|
+
jsonrpc: z32.literal("2.0"),
|
|
4236
|
+
method: z32.string(),
|
|
4146
4237
|
params: recordSchema.optional()
|
|
4147
4238
|
}).passthrough();
|
|
4148
|
-
var sdkMessageEnvelopeSchema =
|
|
4149
|
-
jsonrpc:
|
|
4150
|
-
method:
|
|
4151
|
-
params:
|
|
4152
|
-
message:
|
|
4153
|
-
threadId:
|
|
4154
|
-
parent_tool_use_id:
|
|
4239
|
+
var sdkMessageEnvelopeSchema = z32.object({
|
|
4240
|
+
jsonrpc: z32.literal("2.0"),
|
|
4241
|
+
method: z32.literal("sdk/message"),
|
|
4242
|
+
params: z32.object({
|
|
4243
|
+
message: z32.unknown(),
|
|
4244
|
+
threadId: z32.string().optional(),
|
|
4245
|
+
parent_tool_use_id: z32.string().optional()
|
|
4155
4246
|
}).passthrough()
|
|
4156
4247
|
}).passthrough();
|
|
4157
|
-
var threadIdentityEnvelopeSchema =
|
|
4158
|
-
jsonrpc:
|
|
4159
|
-
method:
|
|
4160
|
-
params:
|
|
4161
|
-
threadId:
|
|
4162
|
-
providerThreadId:
|
|
4248
|
+
var threadIdentityEnvelopeSchema = z32.object({
|
|
4249
|
+
jsonrpc: z32.literal("2.0"),
|
|
4250
|
+
method: z32.literal("thread/identity"),
|
|
4251
|
+
params: z32.object({
|
|
4252
|
+
threadId: z32.string().optional(),
|
|
4253
|
+
providerThreadId: z32.string().optional()
|
|
4163
4254
|
}).passthrough()
|
|
4164
4255
|
}).passthrough();
|
|
4165
|
-
var threadContextWindowUsageEnvelopeSchema =
|
|
4166
|
-
jsonrpc:
|
|
4167
|
-
method:
|
|
4168
|
-
params:
|
|
4169
|
-
threadId:
|
|
4170
|
-
contextWindowUsage:
|
|
4171
|
-
usedTokens:
|
|
4172
|
-
modelContextWindow:
|
|
4173
|
-
estimated:
|
|
4256
|
+
var threadContextWindowUsageEnvelopeSchema = z32.object({
|
|
4257
|
+
jsonrpc: z32.literal("2.0"),
|
|
4258
|
+
method: z32.literal("thread/contextWindowUsage/updated"),
|
|
4259
|
+
params: z32.object({
|
|
4260
|
+
threadId: z32.string().optional(),
|
|
4261
|
+
contextWindowUsage: z32.object({
|
|
4262
|
+
usedTokens: z32.number().nullable(),
|
|
4263
|
+
modelContextWindow: z32.number().nullable(),
|
|
4264
|
+
estimated: z32.boolean()
|
|
4174
4265
|
})
|
|
4175
4266
|
}).passthrough()
|
|
4176
4267
|
}).passthrough();
|
|
4177
|
-
var errorEnvelopeSchema =
|
|
4178
|
-
jsonrpc:
|
|
4179
|
-
method:
|
|
4180
|
-
params:
|
|
4181
|
-
message:
|
|
4268
|
+
var errorEnvelopeSchema = z32.object({
|
|
4269
|
+
jsonrpc: z32.literal("2.0"),
|
|
4270
|
+
method: z32.literal("error"),
|
|
4271
|
+
params: z32.object({
|
|
4272
|
+
message: z32.string().optional()
|
|
4182
4273
|
}).passthrough().optional()
|
|
4183
4274
|
}).passthrough();
|
|
4184
4275
|
|
|
@@ -11523,7 +11614,7 @@ import { constants as fsConstants } from "node:fs";
|
|
|
11523
11614
|
import { access } from "node:fs/promises";
|
|
11524
11615
|
import path8 from "node:path";
|
|
11525
11616
|
import { promisify as promisify4 } from "node:util";
|
|
11526
|
-
import { z as
|
|
11617
|
+
import { z as z33 } from "zod";
|
|
11527
11618
|
var execFileAsync2 = promisify4(execFile3);
|
|
11528
11619
|
var CLI_PROBE_TIMEOUT_MS = 5e3;
|
|
11529
11620
|
var DEFAULT_WINDOWS_PATHEXT = ".COM;.EXE;.BAT;.CMD";
|
|
@@ -11609,9 +11700,9 @@ function clampPercent(value) {
|
|
|
11609
11700
|
}
|
|
11610
11701
|
|
|
11611
11702
|
// ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
|
|
11612
|
-
import { z as
|
|
11613
|
-
var providerToolCallCancellationSchema =
|
|
11614
|
-
requestId:
|
|
11703
|
+
import { z as z34 } from "zod";
|
|
11704
|
+
var providerToolCallCancellationSchema = z34.object({
|
|
11705
|
+
requestId: z34.union([z34.string(), z34.number().int()])
|
|
11615
11706
|
});
|
|
11616
11707
|
var PROVIDER_TOOL_CALL_CANCELLED_METHOD = "notifications/cancelled";
|
|
11617
11708
|
|
|
@@ -11627,8 +11718,8 @@ function createProviderVisibilityMetadata(args) {
|
|
|
11627
11718
|
}
|
|
11628
11719
|
|
|
11629
11720
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
11630
|
-
import { z as
|
|
11631
|
-
var ignoredJsonRpcResultSchema =
|
|
11721
|
+
import { z as z35 } from "zod";
|
|
11722
|
+
var ignoredJsonRpcResultSchema = z35.unknown();
|
|
11632
11723
|
|
|
11633
11724
|
// ../provider-bridge-acp/src/bridge/bridge.ts
|
|
11634
11725
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
@@ -11637,21 +11728,21 @@ import { createServer } from "node:net";
|
|
|
11637
11728
|
import { dirname as dirname2, isAbsolute as isAbsolute2, basename as basename3, relative as relative2, resolve as resolve4 } from "node:path";
|
|
11638
11729
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
11639
11730
|
import { isDeepStrictEqual } from "node:util";
|
|
11640
|
-
import { z as
|
|
11731
|
+
import { z as z44 } from "zod";
|
|
11641
11732
|
|
|
11642
11733
|
// ../provider-bridge-acp/src/bridge-protocol.ts
|
|
11643
|
-
import { z as
|
|
11734
|
+
import { z as z37 } from "zod";
|
|
11644
11735
|
|
|
11645
11736
|
// ../provider-bridge-acp/src/wire.ts
|
|
11646
|
-
import { z as
|
|
11647
|
-
var acpTextContentBlockSchema =
|
|
11648
|
-
type:
|
|
11649
|
-
text:
|
|
11737
|
+
import { z as z36 } from "zod";
|
|
11738
|
+
var acpTextContentBlockSchema = z36.object({
|
|
11739
|
+
type: z36.literal("text"),
|
|
11740
|
+
text: z36.string()
|
|
11650
11741
|
}).passthrough();
|
|
11651
|
-
var acpOtherContentBlockSchema =
|
|
11652
|
-
type:
|
|
11742
|
+
var acpOtherContentBlockSchema = z36.object({
|
|
11743
|
+
type: z36.string()
|
|
11653
11744
|
}).passthrough();
|
|
11654
|
-
var acpContentBlockSchema =
|
|
11745
|
+
var acpContentBlockSchema = z36.union([
|
|
11655
11746
|
acpTextContentBlockSchema,
|
|
11656
11747
|
acpOtherContentBlockSchema
|
|
11657
11748
|
]);
|
|
@@ -11674,7 +11765,7 @@ var ACP_TOOL_KINDS = [
|
|
|
11674
11765
|
"switch_mode",
|
|
11675
11766
|
"other"
|
|
11676
11767
|
];
|
|
11677
|
-
var acpToolKindSchema =
|
|
11768
|
+
var acpToolKindSchema = z36.enum(ACP_TOOL_KINDS);
|
|
11678
11769
|
var ACP_TOOL_KIND_SET = new Set(ACP_TOOL_KINDS);
|
|
11679
11770
|
var ACP_TOOL_CALL_STATUSES = [
|
|
11680
11771
|
"pending",
|
|
@@ -11683,48 +11774,48 @@ var ACP_TOOL_CALL_STATUSES = [
|
|
|
11683
11774
|
"failed",
|
|
11684
11775
|
"cancelled"
|
|
11685
11776
|
];
|
|
11686
|
-
var acpToolCallStatusSchema =
|
|
11777
|
+
var acpToolCallStatusSchema = z36.enum(ACP_TOOL_CALL_STATUSES);
|
|
11687
11778
|
var ACP_TOOL_CALL_STATUS_SET = new Set(
|
|
11688
11779
|
ACP_TOOL_CALL_STATUSES
|
|
11689
11780
|
);
|
|
11690
|
-
var acpToolCallContentSchema =
|
|
11691
|
-
|
|
11692
|
-
type:
|
|
11781
|
+
var acpToolCallContentSchema = z36.union([
|
|
11782
|
+
z36.object({
|
|
11783
|
+
type: z36.literal("content"),
|
|
11693
11784
|
content: acpContentBlockSchema
|
|
11694
11785
|
}).passthrough(),
|
|
11695
|
-
|
|
11696
|
-
type:
|
|
11697
|
-
path:
|
|
11698
|
-
oldText:
|
|
11699
|
-
newText:
|
|
11786
|
+
z36.object({
|
|
11787
|
+
type: z36.literal("diff"),
|
|
11788
|
+
path: z36.string(),
|
|
11789
|
+
oldText: z36.string().nullable().optional(),
|
|
11790
|
+
newText: z36.string()
|
|
11700
11791
|
}).passthrough(),
|
|
11701
|
-
|
|
11702
|
-
type:
|
|
11703
|
-
terminalId:
|
|
11792
|
+
z36.object({
|
|
11793
|
+
type: z36.literal("terminal"),
|
|
11794
|
+
terminalId: z36.string()
|
|
11704
11795
|
}).passthrough()
|
|
11705
11796
|
]);
|
|
11706
|
-
var acpToolCallContentListSchema =
|
|
11797
|
+
var acpToolCallContentListSchema = z36.array(z36.unknown()).transform(
|
|
11707
11798
|
(entries) => entries.flatMap((entry) => {
|
|
11708
11799
|
const parsed = acpToolCallContentSchema.safeParse(entry);
|
|
11709
11800
|
return parsed.success ? [parsed.data] : [];
|
|
11710
11801
|
})
|
|
11711
11802
|
);
|
|
11712
|
-
var acpToolCallLocationSchema =
|
|
11713
|
-
path:
|
|
11714
|
-
line:
|
|
11803
|
+
var acpToolCallLocationSchema = z36.object({
|
|
11804
|
+
path: z36.string(),
|
|
11805
|
+
line: z36.number().optional().nullable()
|
|
11715
11806
|
}).passthrough();
|
|
11716
|
-
var acpToolCallNameSchema =
|
|
11717
|
-
var acpToolCallFieldsSchema =
|
|
11718
|
-
toolCallId:
|
|
11719
|
-
title:
|
|
11807
|
+
var acpToolCallNameSchema = z36.union([z36.string(), z36.null()]).transform((value) => value ?? void 0).optional();
|
|
11808
|
+
var acpToolCallFieldsSchema = z36.object({
|
|
11809
|
+
toolCallId: z36.string(),
|
|
11810
|
+
title: z36.string().optional(),
|
|
11720
11811
|
name: acpToolCallNameSchema,
|
|
11721
11812
|
kind: acpToolKindSchema.optional(),
|
|
11722
|
-
rawKind:
|
|
11813
|
+
rawKind: z36.string().optional(),
|
|
11723
11814
|
status: acpToolCallStatusSchema.optional(),
|
|
11724
11815
|
content: acpToolCallContentListSchema.optional(),
|
|
11725
|
-
locations:
|
|
11726
|
-
rawInput:
|
|
11727
|
-
rawOutput:
|
|
11816
|
+
locations: z36.array(acpToolCallLocationSchema).optional(),
|
|
11817
|
+
rawInput: z36.unknown().optional(),
|
|
11818
|
+
rawOutput: z36.unknown().optional()
|
|
11728
11819
|
});
|
|
11729
11820
|
function openAcpToolCallEnums(value) {
|
|
11730
11821
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -11750,43 +11841,43 @@ function openAcpToolCallEnums(value) {
|
|
|
11750
11841
|
}
|
|
11751
11842
|
return next;
|
|
11752
11843
|
}
|
|
11753
|
-
var acpAgentMessageChunkUpdateSchema =
|
|
11754
|
-
sessionUpdate:
|
|
11844
|
+
var acpAgentMessageChunkUpdateSchema = z36.object({
|
|
11845
|
+
sessionUpdate: z36.literal("agent_message_chunk"),
|
|
11755
11846
|
content: acpContentBlockSchema
|
|
11756
11847
|
}).passthrough();
|
|
11757
|
-
var acpAgentThoughtChunkUpdateSchema =
|
|
11758
|
-
sessionUpdate:
|
|
11848
|
+
var acpAgentThoughtChunkUpdateSchema = z36.object({
|
|
11849
|
+
sessionUpdate: z36.literal("agent_thought_chunk"),
|
|
11759
11850
|
content: acpContentBlockSchema
|
|
11760
11851
|
}).passthrough();
|
|
11761
|
-
var acpToolCallUpdateEventSchema =
|
|
11852
|
+
var acpToolCallUpdateEventSchema = z36.preprocess(
|
|
11762
11853
|
openAcpToolCallEnums,
|
|
11763
11854
|
acpToolCallFieldsSchema.extend({
|
|
11764
|
-
sessionUpdate:
|
|
11855
|
+
sessionUpdate: z36.enum(["tool_call", "tool_call_update"])
|
|
11765
11856
|
}).passthrough()
|
|
11766
11857
|
);
|
|
11767
|
-
var acpPlanEntryStatusSchema =
|
|
11858
|
+
var acpPlanEntryStatusSchema = z36.enum([
|
|
11768
11859
|
"pending",
|
|
11769
11860
|
"in_progress",
|
|
11770
11861
|
"completed"
|
|
11771
11862
|
]);
|
|
11772
|
-
var acpPlanUpdateSchema =
|
|
11773
|
-
sessionUpdate:
|
|
11774
|
-
entries:
|
|
11775
|
-
|
|
11776
|
-
content:
|
|
11863
|
+
var acpPlanUpdateSchema = z36.object({
|
|
11864
|
+
sessionUpdate: z36.literal("plan"),
|
|
11865
|
+
entries: z36.array(
|
|
11866
|
+
z36.object({
|
|
11867
|
+
content: z36.string(),
|
|
11777
11868
|
status: acpPlanEntryStatusSchema.optional()
|
|
11778
11869
|
}).passthrough()
|
|
11779
11870
|
)
|
|
11780
11871
|
}).passthrough();
|
|
11781
|
-
var acpUsageUpdateSchema =
|
|
11782
|
-
sessionUpdate:
|
|
11783
|
-
used:
|
|
11784
|
-
size:
|
|
11872
|
+
var acpUsageUpdateSchema = z36.object({
|
|
11873
|
+
sessionUpdate: z36.literal("usage_update"),
|
|
11874
|
+
used: z36.number().int().nonnegative(),
|
|
11875
|
+
size: z36.number().int().nonnegative()
|
|
11785
11876
|
}).passthrough();
|
|
11786
|
-
var acpOtherSessionUpdateSchema =
|
|
11787
|
-
sessionUpdate:
|
|
11877
|
+
var acpOtherSessionUpdateSchema = z36.object({
|
|
11878
|
+
sessionUpdate: z36.string()
|
|
11788
11879
|
}).passthrough();
|
|
11789
|
-
var acpSessionUpdateSchema =
|
|
11880
|
+
var acpSessionUpdateSchema = z36.union([
|
|
11790
11881
|
acpAgentMessageChunkUpdateSchema,
|
|
11791
11882
|
acpAgentThoughtChunkUpdateSchema,
|
|
11792
11883
|
acpToolCallUpdateEventSchema,
|
|
@@ -11794,57 +11885,57 @@ var acpSessionUpdateSchema = z35.union([
|
|
|
11794
11885
|
acpUsageUpdateSchema,
|
|
11795
11886
|
acpOtherSessionUpdateSchema
|
|
11796
11887
|
]);
|
|
11797
|
-
var acpSessionNotificationParamsSchema =
|
|
11798
|
-
sessionId:
|
|
11888
|
+
var acpSessionNotificationParamsSchema = z36.object({
|
|
11889
|
+
sessionId: z36.string(),
|
|
11799
11890
|
update: acpSessionUpdateSchema
|
|
11800
11891
|
}).passthrough();
|
|
11801
11892
|
var ACP_PROTOCOL_VERSION = 1;
|
|
11802
|
-
var acpInitializeResultSchema =
|
|
11803
|
-
protocolVersion:
|
|
11804
|
-
agentCapabilities:
|
|
11805
|
-
loadSession:
|
|
11806
|
-
sessionCapabilities:
|
|
11807
|
-
fork:
|
|
11893
|
+
var acpInitializeResultSchema = z36.object({
|
|
11894
|
+
protocolVersion: z36.number(),
|
|
11895
|
+
agentCapabilities: z36.object({
|
|
11896
|
+
loadSession: z36.boolean().optional(),
|
|
11897
|
+
sessionCapabilities: z36.object({
|
|
11898
|
+
fork: z36.object({}).passthrough().nullable().optional()
|
|
11808
11899
|
}).passthrough().optional(),
|
|
11809
|
-
promptCapabilities:
|
|
11810
|
-
image:
|
|
11900
|
+
promptCapabilities: z36.object({
|
|
11901
|
+
image: z36.boolean().optional()
|
|
11811
11902
|
}).passthrough().optional()
|
|
11812
11903
|
}).passthrough().optional(),
|
|
11813
|
-
authMethods:
|
|
11904
|
+
authMethods: z36.array(z36.object({ id: z36.string() }).passthrough()).optional()
|
|
11814
11905
|
}).passthrough();
|
|
11815
|
-
var acpOptionalString =
|
|
11816
|
-
var acpConfigOptionSelectOptionSchema =
|
|
11817
|
-
value:
|
|
11906
|
+
var acpOptionalString = z36.union([z36.string(), z36.null()]).transform((value) => value ?? void 0).optional();
|
|
11907
|
+
var acpConfigOptionSelectOptionSchema = z36.object({
|
|
11908
|
+
value: z36.string(),
|
|
11818
11909
|
name: acpOptionalString
|
|
11819
11910
|
}).passthrough();
|
|
11820
|
-
var acpConfigOptionSchema =
|
|
11821
|
-
id:
|
|
11911
|
+
var acpConfigOptionSchema = z36.object({
|
|
11912
|
+
id: z36.string(),
|
|
11822
11913
|
name: acpOptionalString,
|
|
11823
11914
|
category: acpOptionalString,
|
|
11824
|
-
type:
|
|
11915
|
+
type: z36.string(),
|
|
11825
11916
|
currentValue: acpOptionalString,
|
|
11826
|
-
options:
|
|
11917
|
+
options: z36.array(acpConfigOptionSelectOptionSchema).optional()
|
|
11827
11918
|
}).passthrough();
|
|
11828
|
-
var acpSessionModelSchema =
|
|
11829
|
-
modelId:
|
|
11919
|
+
var acpSessionModelSchema = z36.object({
|
|
11920
|
+
modelId: z36.string(),
|
|
11830
11921
|
name: acpOptionalString,
|
|
11831
11922
|
description: acpOptionalString
|
|
11832
11923
|
}).passthrough();
|
|
11833
|
-
var acpSessionModelsSchema =
|
|
11924
|
+
var acpSessionModelsSchema = z36.object({
|
|
11834
11925
|
currentModelId: acpOptionalString,
|
|
11835
|
-
availableModels:
|
|
11926
|
+
availableModels: z36.array(acpSessionModelSchema).optional()
|
|
11836
11927
|
}).passthrough();
|
|
11837
|
-
var acpLooseConfigOptionSchema =
|
|
11838
|
-
id:
|
|
11839
|
-
name:
|
|
11928
|
+
var acpLooseConfigOptionSchema = z36.object({
|
|
11929
|
+
id: z36.string().optional(),
|
|
11930
|
+
name: z36.unknown().optional(),
|
|
11840
11931
|
category: acpOptionalString,
|
|
11841
|
-
type:
|
|
11842
|
-
currentValue:
|
|
11843
|
-
options:
|
|
11932
|
+
type: z36.unknown().optional(),
|
|
11933
|
+
currentValue: z36.unknown().optional(),
|
|
11934
|
+
options: z36.unknown().optional()
|
|
11844
11935
|
}).passthrough();
|
|
11845
|
-
var acpConfigOptionSelectGroupSchema =
|
|
11846
|
-
group:
|
|
11847
|
-
options:
|
|
11936
|
+
var acpConfigOptionSelectGroupSchema = z36.object({
|
|
11937
|
+
group: z36.string(),
|
|
11938
|
+
options: z36.array(z36.unknown())
|
|
11848
11939
|
}).passthrough();
|
|
11849
11940
|
function flattenAcpConfigOptionGroups(option) {
|
|
11850
11941
|
if (typeof option !== "object" || option === null) {
|
|
@@ -11905,119 +11996,119 @@ function parseAcpConfigOptions(options, ctx) {
|
|
|
11905
11996
|
}
|
|
11906
11997
|
return parsedOptions;
|
|
11907
11998
|
}
|
|
11908
|
-
var acpSessionNewResultSchema =
|
|
11909
|
-
sessionId:
|
|
11999
|
+
var acpSessionNewResultSchema = z36.object({
|
|
12000
|
+
sessionId: z36.string(),
|
|
11910
12001
|
models: acpSessionModelsSchema.optional(),
|
|
11911
|
-
configOptions:
|
|
12002
|
+
configOptions: z36.array(z36.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
|
|
11912
12003
|
}).passthrough();
|
|
11913
|
-
var acpConfigStateResultSchema =
|
|
12004
|
+
var acpConfigStateResultSchema = z36.object({
|
|
11914
12005
|
models: acpSessionModelsSchema.optional(),
|
|
11915
|
-
configOptions:
|
|
12006
|
+
configOptions: z36.array(z36.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
|
|
11916
12007
|
}).passthrough();
|
|
11917
12008
|
var acpSessionForkResultSchema = acpConfigStateResultSchema.extend({
|
|
11918
|
-
sessionId:
|
|
12009
|
+
sessionId: z36.string()
|
|
11919
12010
|
});
|
|
11920
|
-
var acpStopReasonSchema =
|
|
12011
|
+
var acpStopReasonSchema = z36.enum([
|
|
11921
12012
|
"end_turn",
|
|
11922
12013
|
"max_tokens",
|
|
11923
12014
|
"max_turn_requests",
|
|
11924
12015
|
"refusal",
|
|
11925
12016
|
"cancelled"
|
|
11926
12017
|
]);
|
|
11927
|
-
var acpPromptResultSchema =
|
|
12018
|
+
var acpPromptResultSchema = z36.object({
|
|
11928
12019
|
stopReason: acpStopReasonSchema
|
|
11929
12020
|
}).passthrough();
|
|
11930
|
-
var acpPermissionOptionKindSchema =
|
|
12021
|
+
var acpPermissionOptionKindSchema = z36.enum([
|
|
11931
12022
|
"allow_once",
|
|
11932
12023
|
"allow_always",
|
|
11933
12024
|
"reject_once",
|
|
11934
12025
|
"reject_always"
|
|
11935
12026
|
]);
|
|
11936
|
-
var acpPermissionOptionSchema =
|
|
11937
|
-
optionId:
|
|
11938
|
-
name:
|
|
12027
|
+
var acpPermissionOptionSchema = z36.object({
|
|
12028
|
+
optionId: z36.string(),
|
|
12029
|
+
name: z36.string(),
|
|
11939
12030
|
kind: acpPermissionOptionKindSchema
|
|
11940
12031
|
}).passthrough();
|
|
11941
|
-
var acpRequestPermissionParamsSchema =
|
|
11942
|
-
sessionId:
|
|
11943
|
-
toolCall:
|
|
12032
|
+
var acpRequestPermissionParamsSchema = z36.object({
|
|
12033
|
+
sessionId: z36.string(),
|
|
12034
|
+
toolCall: z36.preprocess(
|
|
11944
12035
|
openAcpToolCallEnums,
|
|
11945
12036
|
acpToolCallFieldsSchema.partial().passthrough()
|
|
11946
12037
|
).optional(),
|
|
11947
|
-
options:
|
|
12038
|
+
options: z36.array(acpPermissionOptionSchema).min(1)
|
|
11948
12039
|
}).passthrough();
|
|
11949
|
-
var acpReadTextFileParamsSchema =
|
|
11950
|
-
sessionId:
|
|
11951
|
-
path:
|
|
11952
|
-
line:
|
|
11953
|
-
limit:
|
|
12040
|
+
var acpReadTextFileParamsSchema = z36.object({
|
|
12041
|
+
sessionId: z36.string(),
|
|
12042
|
+
path: z36.string(),
|
|
12043
|
+
line: z36.number().nullable().optional(),
|
|
12044
|
+
limit: z36.number().nullable().optional()
|
|
11954
12045
|
}).passthrough();
|
|
11955
|
-
var acpWriteTextFileParamsSchema =
|
|
11956
|
-
sessionId:
|
|
11957
|
-
path:
|
|
11958
|
-
content:
|
|
12046
|
+
var acpWriteTextFileParamsSchema = z36.object({
|
|
12047
|
+
sessionId: z36.string(),
|
|
12048
|
+
path: z36.string(),
|
|
12049
|
+
content: z36.string()
|
|
11959
12050
|
}).passthrough();
|
|
11960
12051
|
|
|
11961
12052
|
// ../provider-bridge-acp/src/bridge-protocol.ts
|
|
11962
12053
|
var ACP_DEFAULT_MODEL_ID = "acp-default";
|
|
11963
12054
|
var acpModelListParamsSchema = modelListParamsSchema.extend({
|
|
11964
|
-
providerOptions:
|
|
12055
|
+
providerOptions: z37.record(z37.string(), z37.unknown()).optional()
|
|
11965
12056
|
});
|
|
11966
|
-
var acpBridgeCommandSchema =
|
|
11967
|
-
|
|
11968
|
-
method:
|
|
12057
|
+
var acpBridgeCommandSchema = z37.discriminatedUnion("method", [
|
|
12058
|
+
z37.object({
|
|
12059
|
+
method: z37.literal("initialize"),
|
|
11969
12060
|
params: initializeParamsSchema
|
|
11970
12061
|
}),
|
|
11971
|
-
|
|
11972
|
-
method:
|
|
12062
|
+
z37.object({
|
|
12063
|
+
method: z37.literal("model/list"),
|
|
11973
12064
|
params: acpModelListParamsSchema
|
|
11974
12065
|
}),
|
|
11975
|
-
|
|
11976
|
-
method:
|
|
12066
|
+
z37.object({
|
|
12067
|
+
method: z37.literal("provider/health"),
|
|
11977
12068
|
params: providerMaintenanceParamsSchema
|
|
11978
12069
|
}),
|
|
11979
|
-
|
|
11980
|
-
method:
|
|
12070
|
+
z37.object({
|
|
12071
|
+
method: z37.literal("provider/usage"),
|
|
11981
12072
|
params: providerMaintenanceParamsSchema
|
|
11982
12073
|
}),
|
|
11983
|
-
|
|
11984
|
-
method:
|
|
12074
|
+
z37.object({
|
|
12075
|
+
method: z37.literal("provider/installation/status"),
|
|
11985
12076
|
params: providerInstallationStatusParamsSchema
|
|
11986
12077
|
}),
|
|
11987
|
-
|
|
11988
|
-
method:
|
|
12078
|
+
z37.object({
|
|
12079
|
+
method: z37.literal("provider/installation/run"),
|
|
11989
12080
|
params: providerInstallationRunParamsSchema
|
|
11990
12081
|
}),
|
|
11991
|
-
|
|
11992
|
-
method:
|
|
12082
|
+
z37.object({
|
|
12083
|
+
method: z37.literal("thread/start"),
|
|
11993
12084
|
params: threadStartParamsSchema
|
|
11994
12085
|
}),
|
|
11995
|
-
|
|
11996
|
-
method:
|
|
12086
|
+
z37.object({
|
|
12087
|
+
method: z37.literal("thread/resume"),
|
|
11997
12088
|
params: threadResumeParamsSchema
|
|
11998
12089
|
}),
|
|
11999
|
-
|
|
12000
|
-
method:
|
|
12090
|
+
z37.object({
|
|
12091
|
+
method: z37.literal("thread/fork"),
|
|
12001
12092
|
params: threadForkParamsSchema
|
|
12002
12093
|
}),
|
|
12003
|
-
|
|
12004
|
-
method:
|
|
12094
|
+
z37.object({
|
|
12095
|
+
method: z37.literal("turn/start"),
|
|
12005
12096
|
params: turnStartParamsSchema
|
|
12006
12097
|
}),
|
|
12007
|
-
|
|
12008
|
-
method:
|
|
12098
|
+
z37.object({
|
|
12099
|
+
method: z37.literal("turn/steer"),
|
|
12009
12100
|
params: turnSteerParamsSchema
|
|
12010
12101
|
}),
|
|
12011
|
-
|
|
12012
|
-
method:
|
|
12102
|
+
z37.object({
|
|
12103
|
+
method: z37.literal("thread/stop"),
|
|
12013
12104
|
params: threadStopParamsSchema
|
|
12014
12105
|
}),
|
|
12015
|
-
|
|
12016
|
-
method:
|
|
12106
|
+
z37.object({
|
|
12107
|
+
method: z37.literal("thread/discard"),
|
|
12017
12108
|
params: threadDiscardParamsSchema
|
|
12018
12109
|
}),
|
|
12019
|
-
|
|
12020
|
-
method:
|
|
12110
|
+
z37.object({
|
|
12111
|
+
method: z37.literal("skills/configure"),
|
|
12021
12112
|
params: skillsConfigureParamsSchema
|
|
12022
12113
|
})
|
|
12023
12114
|
]);
|
|
@@ -12031,53 +12122,53 @@ var ACP_COMPACTION_COMPLETED_METHOD = "acp/compaction/completed";
|
|
|
12031
12122
|
var ACP_UPDATE_METHOD = "acp/update";
|
|
12032
12123
|
var ACP_FS_WRITE_METHOD = "acp/fs/write";
|
|
12033
12124
|
var ACP_WARNING_METHOD = "acp/warning";
|
|
12034
|
-
var acpTurnStartedNotificationParamsSchema =
|
|
12035
|
-
threadId:
|
|
12125
|
+
var acpTurnStartedNotificationParamsSchema = z37.object({
|
|
12126
|
+
threadId: z37.string().min(1)
|
|
12036
12127
|
}).passthrough();
|
|
12037
|
-
var acpTurnCompletedNotificationParamsSchema =
|
|
12038
|
-
threadId:
|
|
12128
|
+
var acpTurnCompletedNotificationParamsSchema = z37.object({
|
|
12129
|
+
threadId: z37.string().min(1),
|
|
12039
12130
|
stopReason: acpStopReasonSchema
|
|
12040
12131
|
}).passthrough();
|
|
12041
|
-
var acpCompactionCompletedNotificationParamsSchema =
|
|
12042
|
-
|
|
12043
|
-
threadId:
|
|
12044
|
-
status:
|
|
12132
|
+
var acpCompactionCompletedNotificationParamsSchema = z37.discriminatedUnion("status", [
|
|
12133
|
+
z37.object({
|
|
12134
|
+
threadId: z37.string().min(1),
|
|
12135
|
+
status: z37.literal("completed")
|
|
12045
12136
|
}).passthrough(),
|
|
12046
|
-
|
|
12047
|
-
threadId:
|
|
12048
|
-
status:
|
|
12137
|
+
z37.object({
|
|
12138
|
+
threadId: z37.string().min(1),
|
|
12139
|
+
status: z37.literal("interrupted")
|
|
12049
12140
|
}).passthrough(),
|
|
12050
|
-
|
|
12051
|
-
threadId:
|
|
12052
|
-
status:
|
|
12053
|
-
detail:
|
|
12141
|
+
z37.object({
|
|
12142
|
+
threadId: z37.string().min(1),
|
|
12143
|
+
status: z37.literal("skipped"),
|
|
12144
|
+
detail: z37.string().min(1)
|
|
12054
12145
|
}).passthrough(),
|
|
12055
|
-
|
|
12056
|
-
threadId:
|
|
12057
|
-
status:
|
|
12058
|
-
error:
|
|
12146
|
+
z37.object({
|
|
12147
|
+
threadId: z37.string().min(1),
|
|
12148
|
+
status: z37.literal("failed"),
|
|
12149
|
+
error: z37.string().min(1)
|
|
12059
12150
|
}).passthrough()
|
|
12060
12151
|
]);
|
|
12061
|
-
var acpUpdateNotificationParamsSchema =
|
|
12062
|
-
threadId:
|
|
12152
|
+
var acpUpdateNotificationParamsSchema = z37.object({
|
|
12153
|
+
threadId: z37.string().min(1),
|
|
12063
12154
|
update: acpSessionUpdateSchema
|
|
12064
12155
|
}).passthrough();
|
|
12065
|
-
var acpFsWriteNotificationParamsSchema =
|
|
12066
|
-
threadId:
|
|
12067
|
-
path:
|
|
12068
|
-
kind:
|
|
12069
|
-
oldText:
|
|
12070
|
-
content:
|
|
12156
|
+
var acpFsWriteNotificationParamsSchema = z37.object({
|
|
12157
|
+
threadId: z37.string().min(1),
|
|
12158
|
+
path: z37.string().min(1),
|
|
12159
|
+
kind: z37.enum(["add", "update"]),
|
|
12160
|
+
oldText: z37.string().optional(),
|
|
12161
|
+
content: z37.string()
|
|
12071
12162
|
}).passthrough();
|
|
12072
|
-
var acpWarningNotificationParamsSchema =
|
|
12073
|
-
threadId:
|
|
12074
|
-
summary:
|
|
12075
|
-
details:
|
|
12163
|
+
var acpWarningNotificationParamsSchema = z37.object({
|
|
12164
|
+
threadId: z37.string().min(1),
|
|
12165
|
+
summary: z37.string().min(1),
|
|
12166
|
+
details: z37.string().optional()
|
|
12076
12167
|
}).passthrough();
|
|
12077
12168
|
|
|
12078
12169
|
// ../provider-bridge-acp/src/dialect.ts
|
|
12079
12170
|
import { basename } from "node:path";
|
|
12080
|
-
import { z as
|
|
12171
|
+
import { z as z42 } from "zod";
|
|
12081
12172
|
|
|
12082
12173
|
// ../provider-bridge-acp/src/bridge/provider-maintenance.ts
|
|
12083
12174
|
import { execFile as execFile4 } from "node:child_process";
|
|
@@ -12087,51 +12178,51 @@ import os2 from "node:os";
|
|
|
12087
12178
|
import path10 from "node:path";
|
|
12088
12179
|
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
12089
12180
|
import { promisify as promisify5 } from "node:util";
|
|
12090
|
-
import { z as
|
|
12181
|
+
import { z as z39 } from "zod";
|
|
12091
12182
|
|
|
12092
12183
|
// ../provider-bridge-acp/src/bridge/opencode-usage.ts
|
|
12093
12184
|
import fs2 from "node:fs/promises";
|
|
12094
12185
|
import os from "node:os";
|
|
12095
12186
|
import path9 from "node:path";
|
|
12096
12187
|
import { DatabaseSync } from "node:sqlite";
|
|
12097
|
-
import { z as
|
|
12098
|
-
var apiCredentialSchema =
|
|
12099
|
-
type:
|
|
12100
|
-
key:
|
|
12188
|
+
import { z as z38 } from "zod";
|
|
12189
|
+
var apiCredentialSchema = z38.object({
|
|
12190
|
+
type: z38.literal("api"),
|
|
12191
|
+
key: z38.string().trim().min(1)
|
|
12101
12192
|
});
|
|
12102
|
-
var storedKeySchema = apiCredentialSchema.extend({ type:
|
|
12103
|
-
var credentialsSchema =
|
|
12104
|
-
var accountSchema =
|
|
12105
|
-
id:
|
|
12106
|
-
email:
|
|
12107
|
-
url:
|
|
12108
|
-
access_token:
|
|
12109
|
-
token_expiry:
|
|
12110
|
-
active_org_id:
|
|
12193
|
+
var storedKeySchema = apiCredentialSchema.extend({ type: z38.literal("key") });
|
|
12194
|
+
var credentialsSchema = z38.record(z38.string(), z38.unknown());
|
|
12195
|
+
var accountSchema = z38.object({
|
|
12196
|
+
id: z38.string().min(1),
|
|
12197
|
+
email: z38.email().nullable().catch(null),
|
|
12198
|
+
url: z38.url(),
|
|
12199
|
+
access_token: z38.string().min(1),
|
|
12200
|
+
token_expiry: z38.number().nullable(),
|
|
12201
|
+
active_org_id: z38.string().min(1).nullable()
|
|
12111
12202
|
});
|
|
12112
|
-
var storedOAuthSchema =
|
|
12113
|
-
type:
|
|
12114
|
-
methodID:
|
|
12115
|
-
access:
|
|
12116
|
-
expires:
|
|
12117
|
-
metadata:
|
|
12118
|
-
server:
|
|
12119
|
-
accountID:
|
|
12120
|
-
email:
|
|
12121
|
-
orgID:
|
|
12203
|
+
var storedOAuthSchema = z38.object({
|
|
12204
|
+
type: z38.literal("oauth"),
|
|
12205
|
+
methodID: z38.literal("device"),
|
|
12206
|
+
access: z38.string().min(1),
|
|
12207
|
+
expires: z38.number().nonnegative(),
|
|
12208
|
+
metadata: z38.object({
|
|
12209
|
+
server: z38.url().default("https://opencode.ai/console"),
|
|
12210
|
+
accountID: z38.string().min(1),
|
|
12211
|
+
email: z38.email().nullable().catch(null),
|
|
12212
|
+
orgID: z38.string().min(1)
|
|
12122
12213
|
})
|
|
12123
12214
|
});
|
|
12124
12215
|
function isOfficialConsole(url) {
|
|
12125
12216
|
const issuer = new URL(url);
|
|
12126
12217
|
return issuer.origin === "https://opencode.ai" && ["/", "/console", "/console/"].includes(issuer.pathname);
|
|
12127
12218
|
}
|
|
12128
|
-
var windowSchema =
|
|
12129
|
-
status:
|
|
12130
|
-
percent:
|
|
12131
|
-
resetsAt:
|
|
12219
|
+
var windowSchema = z38.object({
|
|
12220
|
+
status: z38.enum(["ok", "rate-limited"]),
|
|
12221
|
+
percent: z38.number().nonnegative(),
|
|
12222
|
+
resetsAt: z38.iso.datetime({ offset: true })
|
|
12132
12223
|
});
|
|
12133
|
-
var usageSchema =
|
|
12134
|
-
usage:
|
|
12224
|
+
var usageSchema = z38.object({
|
|
12225
|
+
usage: z38.object({
|
|
12135
12226
|
rolling: windowSchema,
|
|
12136
12227
|
weekly: windowSchema,
|
|
12137
12228
|
monthly: windowSchema
|
|
@@ -12180,7 +12271,7 @@ function readStoredCredential(database) {
|
|
|
12180
12271
|
for (const provider of ["opencode-go", "opencode"]) {
|
|
12181
12272
|
const row = query.get(provider);
|
|
12182
12273
|
if (!row) continue;
|
|
12183
|
-
const value =
|
|
12274
|
+
const value = z38.string().parse(row.value);
|
|
12184
12275
|
const parsed = JSON.parse(value);
|
|
12185
12276
|
const credential = storedKeySchema.safeParse(parsed);
|
|
12186
12277
|
if (credential.success)
|
|
@@ -12361,8 +12452,8 @@ async function readKeychainAccessToken() {
|
|
|
12361
12452
|
return null;
|
|
12362
12453
|
}
|
|
12363
12454
|
}
|
|
12364
|
-
var cursorFileCredentialsSchema =
|
|
12365
|
-
accessToken:
|
|
12455
|
+
var cursorFileCredentialsSchema = z39.object({
|
|
12456
|
+
accessToken: z39.string().min(1).nullish()
|
|
12366
12457
|
});
|
|
12367
12458
|
async function readAccessToken() {
|
|
12368
12459
|
const keychain = await readKeychainAccessToken();
|
|
@@ -12409,7 +12500,7 @@ function readAccountEmail() {
|
|
|
12409
12500
|
database = new DatabaseSync2(databasePath);
|
|
12410
12501
|
database.exec("PRAGMA query_only = true");
|
|
12411
12502
|
const row = database.prepare("SELECT value FROM ItemTable WHERE key = ?").get("cursorAuth/cachedEmail");
|
|
12412
|
-
const parsed =
|
|
12503
|
+
const parsed = z39.object({ value: z39.string().email() }).safeParse(row);
|
|
12413
12504
|
return parsed.success ? parsed.data.value : null;
|
|
12414
12505
|
} catch {
|
|
12415
12506
|
return null;
|
|
@@ -12513,14 +12604,14 @@ function buildAcpProviderInstallationRun(status, args) {
|
|
|
12513
12604
|
verification: { kind: "installed" }
|
|
12514
12605
|
};
|
|
12515
12606
|
}
|
|
12516
|
-
var cursorNonNegativeIntegerSchema =
|
|
12517
|
-
|
|
12518
|
-
|
|
12607
|
+
var cursorNonNegativeIntegerSchema = z39.union([
|
|
12608
|
+
z39.number().int().nonnegative(),
|
|
12609
|
+
z39.string().regex(/^\d+$/u).transform(Number)
|
|
12519
12610
|
]).refine(Number.isSafeInteger);
|
|
12520
|
-
var cursorUsageResponseSchema =
|
|
12611
|
+
var cursorUsageResponseSchema = z39.object({
|
|
12521
12612
|
billingCycleEnd: cursorNonNegativeIntegerSchema.nullish(),
|
|
12522
|
-
planUsage:
|
|
12523
|
-
spendLimitUsage:
|
|
12613
|
+
planUsage: z39.object({ totalPercentUsed: z39.number().nonnegative().default(0) }).nullish(),
|
|
12614
|
+
spendLimitUsage: z39.object({
|
|
12524
12615
|
overallLimit: cursorNonNegativeIntegerSchema.nullish(),
|
|
12525
12616
|
overallUsed: cursorNonNegativeIntegerSchema.nullish(),
|
|
12526
12617
|
individualLimit: cursorNonNegativeIntegerSchema.nullish(),
|
|
@@ -12529,8 +12620,8 @@ var cursorUsageResponseSchema = z38.object({
|
|
|
12529
12620
|
pooledUsed: cursorNonNegativeIntegerSchema.nullish()
|
|
12530
12621
|
}).nullish()
|
|
12531
12622
|
}).passthrough();
|
|
12532
|
-
var cursorPlanResponseSchema =
|
|
12533
|
-
planInfo:
|
|
12623
|
+
var cursorPlanResponseSchema = z39.object({
|
|
12624
|
+
planInfo: z39.object({ planName: z39.string().min(1) }).nullish()
|
|
12534
12625
|
}).passthrough();
|
|
12535
12626
|
function normalizeUsage(rawUsage, rawPlan, accountEmail = null) {
|
|
12536
12627
|
const usage = cursorUsageResponseSchema.safeParse(rawUsage);
|
|
@@ -12743,17 +12834,17 @@ function toolKindPresentation(args) {
|
|
|
12743
12834
|
}
|
|
12744
12835
|
|
|
12745
12836
|
// ../provider-bridge-acp/src/tool-classification.ts
|
|
12746
|
-
import { z as
|
|
12837
|
+
import { z as z41 } from "zod";
|
|
12747
12838
|
|
|
12748
12839
|
// ../provider-bridge-acp/src/tool-call-operation.ts
|
|
12749
12840
|
import path11 from "node:path";
|
|
12750
|
-
import { z as
|
|
12751
|
-
var acpRawInputCommandSchema =
|
|
12752
|
-
var acpRawInputPathSchema =
|
|
12753
|
-
path:
|
|
12754
|
-
filePath:
|
|
12755
|
-
file_path:
|
|
12756
|
-
target_file:
|
|
12841
|
+
import { z as z40 } from "zod";
|
|
12842
|
+
var acpRawInputCommandSchema = z40.object({ command: z40.string() }).passthrough();
|
|
12843
|
+
var acpRawInputPathSchema = z40.object({
|
|
12844
|
+
path: z40.string().optional(),
|
|
12845
|
+
filePath: z40.string().optional(),
|
|
12846
|
+
file_path: z40.string().optional(),
|
|
12847
|
+
target_file: z40.string().optional()
|
|
12757
12848
|
}).passthrough();
|
|
12758
12849
|
function resolveAcpToolCallPath(value, options) {
|
|
12759
12850
|
const cwd = options?.cwd;
|
|
@@ -12929,14 +13020,14 @@ function extractAcpToolCallOutputText(event) {
|
|
|
12929
13020
|
).trim();
|
|
12930
13021
|
return rawOutputText.length > 0 ? rawOutputText : void 0;
|
|
12931
13022
|
}
|
|
12932
|
-
var commandRawOutputSchema =
|
|
12933
|
-
exitCode:
|
|
12934
|
-
exit_code:
|
|
12935
|
-
stdout:
|
|
12936
|
-
stderr:
|
|
12937
|
-
output_for_prompt:
|
|
12938
|
-
signal:
|
|
12939
|
-
timed_out:
|
|
13023
|
+
var commandRawOutputSchema = z41.object({
|
|
13024
|
+
exitCode: z41.number().int().nullable().optional(),
|
|
13025
|
+
exit_code: z41.number().int().nullable().optional(),
|
|
13026
|
+
stdout: z41.string().optional(),
|
|
13027
|
+
stderr: z41.string().optional(),
|
|
13028
|
+
output_for_prompt: z41.string().optional(),
|
|
13029
|
+
signal: z41.string().nullable().optional(),
|
|
13030
|
+
timed_out: z41.boolean().optional()
|
|
12940
13031
|
}).passthrough();
|
|
12941
13032
|
function emptyToUndefined(value) {
|
|
12942
13033
|
return value === void 0 || value.length === 0 ? void 0 : value;
|
|
@@ -13005,10 +13096,10 @@ function extractAcpCommandResult(event) {
|
|
|
13005
13096
|
...output === void 0 ? {} : { output: scrubInlineImageDataUrls(output) }
|
|
13006
13097
|
};
|
|
13007
13098
|
}
|
|
13008
|
-
var optionalNonBlank =
|
|
13099
|
+
var optionalNonBlank = z41.string().optional().transform(
|
|
13009
13100
|
(value) => value !== void 0 && value.trim().length > 0 ? value : void 0
|
|
13010
13101
|
);
|
|
13011
|
-
var searchRawInputSchema =
|
|
13102
|
+
var searchRawInputSchema = z41.object({
|
|
13012
13103
|
pattern: optionalNonBlank,
|
|
13013
13104
|
query: optionalNonBlank,
|
|
13014
13105
|
regex: optionalNonBlank,
|
|
@@ -13017,8 +13108,8 @@ var searchRawInputSchema = z40.object({
|
|
|
13017
13108
|
path: optionalNonBlank,
|
|
13018
13109
|
directory: optionalNonBlank
|
|
13019
13110
|
}).passthrough();
|
|
13020
|
-
var fetchRawInputSchema =
|
|
13021
|
-
var thinkRawInputSchema =
|
|
13111
|
+
var fetchRawInputSchema = z41.object({ url: optionalNonBlank, uri: optionalNonBlank }).passthrough();
|
|
13112
|
+
var thinkRawInputSchema = z41.object({ thought: optionalNonBlank, thinking: optionalNonBlank }).passthrough();
|
|
13022
13113
|
var SINGLE_TICKED_TOKEN_PATTERN = /^[^`]*`([^`\n]+)`[^`]*$/;
|
|
13023
13114
|
var URL_PATTERN = /https?:\/\/[^\s`'"<>]+/g;
|
|
13024
13115
|
function tickedTokenFromTitle(title) {
|
|
@@ -13211,10 +13302,10 @@ function classifyAcpToolCall2(event, injected, options) {
|
|
|
13211
13302
|
|
|
13212
13303
|
// ../provider-bridge-acp/src/dialect.ts
|
|
13213
13304
|
var GENERIC_ACP_DIALECT = { id: "acp" };
|
|
13214
|
-
var grokToolMetaSchema =
|
|
13215
|
-
"x.ai/tool":
|
|
13216
|
-
name:
|
|
13217
|
-
kind:
|
|
13305
|
+
var grokToolMetaSchema = z42.object({
|
|
13306
|
+
"x.ai/tool": z42.object({
|
|
13307
|
+
name: z42.string().optional(),
|
|
13308
|
+
kind: z42.string().optional()
|
|
13218
13309
|
}).passthrough()
|
|
13219
13310
|
}).passthrough();
|
|
13220
13311
|
function grokToolIdentity(event) {
|
|
@@ -13230,10 +13321,10 @@ function grokToolIdentity(event) {
|
|
|
13230
13321
|
};
|
|
13231
13322
|
}
|
|
13232
13323
|
var GROK_SPAWN_SUBAGENT_TOOL = "spawn_subagent";
|
|
13233
|
-
var grokSpawnSubagentInputSchema =
|
|
13234
|
-
description:
|
|
13235
|
-
prompt:
|
|
13236
|
-
subagent_type:
|
|
13324
|
+
var grokSpawnSubagentInputSchema = z42.object({
|
|
13325
|
+
description: z42.string().optional(),
|
|
13326
|
+
prompt: z42.string().optional(),
|
|
13327
|
+
subagent_type: z42.string().optional()
|
|
13237
13328
|
}).passthrough();
|
|
13238
13329
|
function grokClassifyToolCall(event) {
|
|
13239
13330
|
if (grokToolIdentity(event)?.name !== GROK_SPAWN_SUBAGENT_TOOL) {
|
|
@@ -13261,27 +13352,27 @@ var GROK_ACP_DIALECT = {
|
|
|
13261
13352
|
toolIdentity: grokToolIdentity,
|
|
13262
13353
|
classifyToolCall: grokClassifyToolCall
|
|
13263
13354
|
};
|
|
13264
|
-
var grokModelMetaSchema =
|
|
13265
|
-
totalContextTokens:
|
|
13355
|
+
var grokModelMetaSchema = z42.object({
|
|
13356
|
+
totalContextTokens: z42.number().int().positive()
|
|
13266
13357
|
}).passthrough();
|
|
13267
|
-
var grokPromptMetaSchema =
|
|
13268
|
-
inputTokens:
|
|
13269
|
-
totalTokens:
|
|
13270
|
-
usage:
|
|
13271
|
-
inputTokens:
|
|
13272
|
-
totalTokens:
|
|
13358
|
+
var grokPromptMetaSchema = z42.object({
|
|
13359
|
+
inputTokens: z42.number().int().nonnegative().optional(),
|
|
13360
|
+
totalTokens: z42.number().int().nonnegative().optional(),
|
|
13361
|
+
usage: z42.object({
|
|
13362
|
+
inputTokens: z42.number().int().nonnegative().optional(),
|
|
13363
|
+
totalTokens: z42.number().int().nonnegative().optional()
|
|
13273
13364
|
}).passthrough().optional()
|
|
13274
13365
|
}).passthrough();
|
|
13275
|
-
var grokPromptResultSchema =
|
|
13366
|
+
var grokPromptResultSchema = z42.object({
|
|
13276
13367
|
_meta: grokPromptMetaSchema.optional()
|
|
13277
13368
|
}).passthrough();
|
|
13278
|
-
var grokSessionModelSchema =
|
|
13279
|
-
modelId:
|
|
13369
|
+
var grokSessionModelSchema = z42.object({
|
|
13370
|
+
modelId: z42.string(),
|
|
13280
13371
|
_meta: grokModelMetaSchema.optional()
|
|
13281
13372
|
}).passthrough();
|
|
13282
|
-
var grokSessionModelsSchema =
|
|
13283
|
-
currentModelId:
|
|
13284
|
-
availableModels:
|
|
13373
|
+
var grokSessionModelsSchema = z42.object({
|
|
13374
|
+
currentModelId: z42.string().optional(),
|
|
13375
|
+
availableModels: z42.array(grokSessionModelSchema).optional()
|
|
13285
13376
|
}).passthrough();
|
|
13286
13377
|
function grokContextWindowSizeFromSessionModels(models) {
|
|
13287
13378
|
const parsed = grokSessionModelsSchema.safeParse(models);
|
|
@@ -13311,14 +13402,14 @@ function grokContextUsageFromPromptResult(result) {
|
|
|
13311
13402
|
return used === void 0 ? void 0 : { used };
|
|
13312
13403
|
}
|
|
13313
13404
|
var CURSOR_TASK_TOOL = "task";
|
|
13314
|
-
var cursorTaskRawInputSchema =
|
|
13405
|
+
var cursorTaskRawInputSchema = z42.object({ _toolName: z42.string().optional() }).passthrough();
|
|
13315
13406
|
var CURSOR_TASK_METHOD = "cursor/task";
|
|
13316
|
-
var cursorTaskParamsSchema =
|
|
13317
|
-
toolCallId:
|
|
13318
|
-
description:
|
|
13319
|
-
prompt:
|
|
13320
|
-
agentId:
|
|
13321
|
-
model:
|
|
13407
|
+
var cursorTaskParamsSchema = z42.object({
|
|
13408
|
+
toolCallId: z42.string(),
|
|
13409
|
+
description: z42.string().optional(),
|
|
13410
|
+
prompt: z42.string().optional(),
|
|
13411
|
+
agentId: z42.string().optional(),
|
|
13412
|
+
model: z42.string().optional()
|
|
13322
13413
|
}).passthrough();
|
|
13323
13414
|
function cursorClassifyToolCall(event) {
|
|
13324
13415
|
const parsed = cursorTaskRawInputSchema.safeParse(event.rawInput);
|
|
@@ -13366,23 +13457,23 @@ var CURSOR_ACP_DIALECT = {
|
|
|
13366
13457
|
handleClientRequest: cursorHandleClientRequest,
|
|
13367
13458
|
maintenance: CURSOR_ACP_MAINTENANCE
|
|
13368
13459
|
};
|
|
13369
|
-
var ompBashRawInputSchema =
|
|
13370
|
-
command:
|
|
13371
|
-
async:
|
|
13460
|
+
var ompBashRawInputSchema = z42.object({
|
|
13461
|
+
command: z42.string(),
|
|
13462
|
+
async: z42.boolean().optional()
|
|
13372
13463
|
}).passthrough();
|
|
13373
13464
|
var ompBashRawOutputSchema = commandRawOutputSchema.extend({
|
|
13374
|
-
content:
|
|
13375
|
-
|
|
13376
|
-
type:
|
|
13377
|
-
text:
|
|
13465
|
+
content: z42.array(
|
|
13466
|
+
z42.object({
|
|
13467
|
+
type: z42.literal("text"),
|
|
13468
|
+
text: z42.string()
|
|
13378
13469
|
}).passthrough()
|
|
13379
13470
|
),
|
|
13380
|
-
details:
|
|
13381
|
-
exitCode:
|
|
13382
|
-
wallTimeMs:
|
|
13383
|
-
timedOut:
|
|
13384
|
-
signal:
|
|
13385
|
-
async:
|
|
13471
|
+
details: z42.object({
|
|
13472
|
+
exitCode: z42.number().int().optional(),
|
|
13473
|
+
wallTimeMs: z42.number().nonnegative().optional(),
|
|
13474
|
+
timedOut: z42.boolean().optional(),
|
|
13475
|
+
signal: z42.unknown().optional(),
|
|
13476
|
+
async: z42.unknown().optional()
|
|
13386
13477
|
}).passthrough()
|
|
13387
13478
|
});
|
|
13388
13479
|
function stripOmpTrailingNotice(text, notice) {
|
|
@@ -13445,11 +13536,11 @@ var OMP_ACP_DIALECT = {
|
|
|
13445
13536
|
id: "omp",
|
|
13446
13537
|
commandResult: ompCommandResult
|
|
13447
13538
|
};
|
|
13448
|
-
var openCodeCommandRawOutputSchema =
|
|
13449
|
-
output:
|
|
13450
|
-
metadata:
|
|
13451
|
-
exit:
|
|
13452
|
-
output:
|
|
13539
|
+
var openCodeCommandRawOutputSchema = z42.object({
|
|
13540
|
+
output: z42.unknown().optional(),
|
|
13541
|
+
metadata: z42.object({
|
|
13542
|
+
exit: z42.number().int().nullable().optional(),
|
|
13543
|
+
output: z42.string().optional()
|
|
13453
13544
|
}).passthrough().optional()
|
|
13454
13545
|
}).passthrough();
|
|
13455
13546
|
function normalizeOpenCodeCommandEvent(event) {
|
|
@@ -14585,7 +14676,7 @@ function buildAcpNativeReasoningSupport(thoughtLevelOption) {
|
|
|
14585
14676
|
});
|
|
14586
14677
|
}
|
|
14587
14678
|
supportedReasoningEfforts.sort(
|
|
14588
|
-
(a2, b) =>
|
|
14679
|
+
(a2, b) => compareReasoningLevels(a2.reasoningEffort, b.reasoningEffort)
|
|
14589
14680
|
);
|
|
14590
14681
|
if (supportedReasoningEfforts.length === 0) {
|
|
14591
14682
|
return {
|
|
@@ -14751,7 +14842,7 @@ function buildAgentModelCatalog(rawModels) {
|
|
|
14751
14842
|
const defaultEntry = pool.find((entry) => entry.level === "medium") ?? pool.find((entry) => entry.level !== "none") ?? pool[0];
|
|
14752
14843
|
const defaultVariant = defaultEntry.member;
|
|
14753
14844
|
const levelsInLadderOrder = [...byLevel.keys()].sort(
|
|
14754
|
-
|
|
14845
|
+
compareReasoningLevels
|
|
14755
14846
|
);
|
|
14756
14847
|
const nameByLevel = /* @__PURE__ */ new Map();
|
|
14757
14848
|
for (const { member, level } of leveled) {
|
|
@@ -14872,7 +14963,7 @@ function cursorCatalogModel(model) {
|
|
|
14872
14963
|
id: selection.modelId,
|
|
14873
14964
|
model: selection.modelId,
|
|
14874
14965
|
supportedReasoningEfforts: [...efforts.values()].sort(
|
|
14875
|
-
(a2, b) =>
|
|
14966
|
+
(a2, b) => compareReasoningLevels(a2.reasoningEffort, b.reasoningEffort)
|
|
14876
14967
|
),
|
|
14877
14968
|
defaultReasoningEffort: selection.reasoningLevel ?? model.defaultReasoningEffort
|
|
14878
14969
|
},
|
|
@@ -14922,7 +15013,7 @@ function buildCursorParameterizedModelCatalog(models) {
|
|
|
14922
15013
|
model: {
|
|
14923
15014
|
...preferred.model,
|
|
14924
15015
|
supportedReasoningEfforts: [...efforts.values()].sort(
|
|
14925
|
-
(a2, b) =>
|
|
15016
|
+
(a2, b) => compareReasoningLevels(a2.reasoningEffort, b.reasoningEffort)
|
|
14926
15017
|
),
|
|
14927
15018
|
...serviceTiers === void 0 ? {} : { supportedServiceTiers: serviceTiers },
|
|
14928
15019
|
isDefault: current.model.isDefault || candidate.model.isDefault
|
|
@@ -15413,7 +15504,7 @@ import { basename as basename2, dirname, join as join2, resolve as resolve3 } fr
|
|
|
15413
15504
|
// ../provider-bridge-acp/src/bridge/tool-proxy-mcp.ts
|
|
15414
15505
|
import { createConnection } from "node:net";
|
|
15415
15506
|
import { createInterface as createInterface2 } from "node:readline";
|
|
15416
|
-
import { z as
|
|
15507
|
+
import { z as z43 } from "zod";
|
|
15417
15508
|
var ACP_BRIDGE_MCP_SERVER_NAME = "bb-bridge";
|
|
15418
15509
|
var ENV_HOST = "BB_ACP_DYNAMIC_TOOL_HOST";
|
|
15419
15510
|
var ENV_PORT = "BB_ACP_DYNAMIC_TOOL_PORT";
|
|
@@ -15421,45 +15512,45 @@ var ENV_TOKEN = "BB_ACP_DYNAMIC_TOOL_TOKEN";
|
|
|
15421
15512
|
var ENV_THREAD_ID = "BB_ACP_DYNAMIC_TOOL_THREAD_ID";
|
|
15422
15513
|
var ENV_TOOLS = "BB_ACP_DYNAMIC_TOOLS";
|
|
15423
15514
|
var ENV_PROGRESS_INTERVAL_MS = "BB_ACP_DYNAMIC_TOOL_PROGRESS_INTERVAL_MS";
|
|
15424
|
-
var dynamicToolBridgeRequestSchema =
|
|
15425
|
-
|
|
15426
|
-
kind:
|
|
15427
|
-
threadId:
|
|
15428
|
-
token:
|
|
15429
|
-
toolCount:
|
|
15515
|
+
var dynamicToolBridgeRequestSchema = z43.discriminatedUnion("kind", [
|
|
15516
|
+
z43.object({
|
|
15517
|
+
kind: z43.literal("initialized"),
|
|
15518
|
+
threadId: z43.string().min(1),
|
|
15519
|
+
token: z43.string().min(1),
|
|
15520
|
+
toolCount: z43.number().int().nonnegative()
|
|
15430
15521
|
}),
|
|
15431
|
-
|
|
15432
|
-
kind:
|
|
15433
|
-
arguments:
|
|
15434
|
-
callId:
|
|
15435
|
-
threadId:
|
|
15436
|
-
token:
|
|
15437
|
-
tool:
|
|
15522
|
+
z43.object({
|
|
15523
|
+
kind: z43.literal("toolCall"),
|
|
15524
|
+
arguments: z43.record(z43.string(), z43.unknown()).default({}),
|
|
15525
|
+
callId: z43.string().min(1),
|
|
15526
|
+
threadId: z43.string().min(1),
|
|
15527
|
+
token: z43.string().min(1),
|
|
15528
|
+
tool: z43.string().min(1)
|
|
15438
15529
|
})
|
|
15439
15530
|
]);
|
|
15440
|
-
var bridgeToolCallResponseSchema =
|
|
15441
|
-
|
|
15442
|
-
ok:
|
|
15443
|
-
content:
|
|
15444
|
-
contentBlocks:
|
|
15445
|
-
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
type:
|
|
15449
|
-
data:
|
|
15450
|
-
mimeType:
|
|
15531
|
+
var bridgeToolCallResponseSchema = z43.union([
|
|
15532
|
+
z43.object({
|
|
15533
|
+
ok: z43.literal(true),
|
|
15534
|
+
content: z43.string(),
|
|
15535
|
+
contentBlocks: z43.array(
|
|
15536
|
+
z43.discriminatedUnion("type", [
|
|
15537
|
+
z43.object({ type: z43.literal("text"), text: z43.string() }),
|
|
15538
|
+
z43.object({
|
|
15539
|
+
type: z43.literal("image"),
|
|
15540
|
+
data: z43.string(),
|
|
15541
|
+
mimeType: z43.string()
|
|
15451
15542
|
})
|
|
15452
15543
|
])
|
|
15453
15544
|
).optional(),
|
|
15454
|
-
images:
|
|
15455
|
-
isError:
|
|
15545
|
+
images: z43.array(z43.object({ data: z43.string(), mimeType: z43.string() })).default([]),
|
|
15546
|
+
isError: z43.boolean().optional()
|
|
15456
15547
|
}),
|
|
15457
|
-
|
|
15548
|
+
z43.object({ ok: z43.literal(false), error: z43.string() })
|
|
15458
15549
|
]);
|
|
15459
|
-
var jsonRpcMessageSchema =
|
|
15460
|
-
id:
|
|
15461
|
-
method:
|
|
15462
|
-
params:
|
|
15550
|
+
var jsonRpcMessageSchema = z43.object({
|
|
15551
|
+
id: z43.union([z43.string(), z43.number().int()]).optional(),
|
|
15552
|
+
method: z43.string().optional(),
|
|
15553
|
+
params: z43.unknown().optional()
|
|
15463
15554
|
});
|
|
15464
15555
|
var nextMcpToolCallId = 0;
|
|
15465
15556
|
var TOOL_CALL_PROGRESS_INTERVAL_MS = 15e3;
|
|
@@ -16257,7 +16348,7 @@ async function authenticateAcpAgent(args) {
|
|
|
16257
16348
|
await args.connection.request({
|
|
16258
16349
|
method: "authenticate",
|
|
16259
16350
|
params: { methodId, _meta: { headless: true } },
|
|
16260
|
-
resultSchema:
|
|
16351
|
+
resultSchema: z44.unknown()
|
|
16261
16352
|
});
|
|
16262
16353
|
} catch (error) {
|
|
16263
16354
|
throw new AcpAuthRequiredError(
|
|
@@ -16278,7 +16369,7 @@ async function loadAgentModelCatalog(listCommand) {
|
|
|
16278
16369
|
({ stdout: stdout2 }) => stdout2,
|
|
16279
16370
|
(error) => {
|
|
16280
16371
|
if (isMissingExecutableError(error)) throw error;
|
|
16281
|
-
const output =
|
|
16372
|
+
const output = z44.object({ stdout: z44.string(), stderr: z44.string() }).safeParse(error);
|
|
16282
16373
|
if (isAuthRequiredModelListError(
|
|
16283
16374
|
error,
|
|
16284
16375
|
output.success ? output.data.stdout : "",
|
|
@@ -16595,7 +16686,7 @@ async function selectAcpNativeModel(args) {
|
|
|
16595
16686
|
configId: modelOption.id,
|
|
16596
16687
|
value: selection.modelId
|
|
16597
16688
|
},
|
|
16598
|
-
resultSchema:
|
|
16689
|
+
resultSchema: z44.union([acpConfigStateResultSchema, z44.null()])
|
|
16599
16690
|
});
|
|
16600
16691
|
setModel = false;
|
|
16601
16692
|
} catch {
|
|
@@ -16606,7 +16697,7 @@ async function selectAcpNativeModel(args) {
|
|
|
16606
16697
|
configState = await session.connection.request({
|
|
16607
16698
|
method: "session/set_model",
|
|
16608
16699
|
params: { sessionId: args.sessionId, modelId: selection.modelId },
|
|
16609
|
-
resultSchema:
|
|
16700
|
+
resultSchema: z44.union([acpConfigStateResultSchema, z44.null()])
|
|
16610
16701
|
});
|
|
16611
16702
|
}
|
|
16612
16703
|
const current = session.nativeConfig;
|
|
@@ -16677,7 +16768,7 @@ async function selectAcpNativeReasoning(args) {
|
|
|
16677
16768
|
configId: thoughtLevelOption.id,
|
|
16678
16769
|
value
|
|
16679
16770
|
},
|
|
16680
|
-
resultSchema:
|
|
16771
|
+
resultSchema: z44.union([acpConfigStateResultSchema, z44.null()])
|
|
16681
16772
|
});
|
|
16682
16773
|
} catch {
|
|
16683
16774
|
return;
|
|
@@ -16703,7 +16794,7 @@ async function selectAcpNativeServiceTier(args) {
|
|
|
16703
16794
|
configId: fastOption.id,
|
|
16704
16795
|
value
|
|
16705
16796
|
},
|
|
16706
|
-
resultSchema:
|
|
16797
|
+
resultSchema: z44.union([acpConfigStateResultSchema, z44.null()])
|
|
16707
16798
|
});
|
|
16708
16799
|
recordAcpConfigValue(args.session, configState, fastOption.id, value);
|
|
16709
16800
|
}
|
|
@@ -17141,7 +17232,7 @@ async function startAgentSession(request) {
|
|
|
17141
17232
|
cwd: params.cwd,
|
|
17142
17233
|
mcpServers
|
|
17143
17234
|
},
|
|
17144
|
-
resultSchema:
|
|
17235
|
+
resultSchema: z44.union([acpConfigStateResultSchema, z44.null()])
|
|
17145
17236
|
});
|
|
17146
17237
|
loadedConfigOptions = configState?.configOptions;
|
|
17147
17238
|
loadedModels = configState?.models;
|
|
@@ -17742,12 +17833,12 @@ function decodeLaunchSpec(providerOptions) {
|
|
|
17742
17833
|
);
|
|
17743
17834
|
return launchSpec.success ? launchSpec.data : null;
|
|
17744
17835
|
}
|
|
17745
|
-
var acpProviderOptionsSchema =
|
|
17746
|
-
additionalWorkspaceWriteRoots:
|
|
17747
|
-
acpDialect:
|
|
17748
|
-
parameterizedModelPicker:
|
|
17749
|
-
primaryModels:
|
|
17750
|
-
reasoningProbePriorityModelIds:
|
|
17836
|
+
var acpProviderOptionsSchema = z44.object({
|
|
17837
|
+
additionalWorkspaceWriteRoots: z44.array(z44.string()).optional(),
|
|
17838
|
+
acpDialect: z44.string().min(1).optional(),
|
|
17839
|
+
parameterizedModelPicker: z44.boolean().optional(),
|
|
17840
|
+
primaryModels: z44.array(z44.string().min(1)).optional(),
|
|
17841
|
+
reasoningProbePriorityModelIds: z44.array(z44.string().min(1)).optional()
|
|
17751
17842
|
}).passthrough();
|
|
17752
17843
|
function decodeAcpModelPickerOptions(providerOptions) {
|
|
17753
17844
|
const parsed = acpProviderOptionsSchema.parse(providerOptions ?? {});
|
|
@@ -18047,7 +18138,7 @@ var experimental_providerBridge = experimental_defineProviderBridge({
|
|
|
18047
18138
|
});
|
|
18048
18139
|
|
|
18049
18140
|
// ../provider-bridge-acp/src/probe.ts
|
|
18050
|
-
import { z as
|
|
18141
|
+
import { z as z45 } from "zod";
|
|
18051
18142
|
var PROBE_TIMEOUT_MS = 1e4;
|
|
18052
18143
|
function describe(error) {
|
|
18053
18144
|
if (error instanceof AcpAgentExitedError) {
|
|
@@ -18105,9 +18196,9 @@ async function probeAcpAgent(request) {
|
|
|
18105
18196
|
connected.kill();
|
|
18106
18197
|
}
|
|
18107
18198
|
}
|
|
18108
|
-
var acpAgentProbeSchema =
|
|
18109
|
-
|
|
18110
|
-
|
|
18199
|
+
var acpAgentProbeSchema = z45.union([
|
|
18200
|
+
z45.object({ reachable: z45.literal(true), fork: z45.boolean() }),
|
|
18201
|
+
z45.object({ reachable: z45.literal(false), reason: z45.string() })
|
|
18111
18202
|
]);
|
|
18112
18203
|
export {
|
|
18113
18204
|
acpAgentProbeSchema as experimental_acpAgentProbeSchema,
|