@get-bb/plugin-sdk 0.6.49 → 0.6.54
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 +430 -12
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +5 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +5 -0
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +7 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +1 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +1 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +11 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +11 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +30 -2
- package/bundled-types/bb-plugin-sdk-testing.d.ts +5 -0
- package/bundled-types/bb-plugin-sdk.d.ts +426 -11
- package/dist/app.js +12 -0
- package/dist/internal/plugin-app-collector.js +89 -15
- package/dist/provider-bridge-acp-next.js +28 -13
- package/dist/provider-bridge-acp.js +28 -13
- package/dist/provider-bridge-testing.js +9 -2
- package/dist/provider-bridge.js +6 -1
- package/dist/testing/app.js +169 -15
- package/dist/testing/index.js +1 -0
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -131,6 +131,15 @@ var experimental_useSidebarThreadPullRequest = runtimeFunction(
|
|
|
131
131
|
var experimental_useSidebarThreadSplit = runtimeFunction(
|
|
132
132
|
"experimental_useSidebarThreadSplit"
|
|
133
133
|
);
|
|
134
|
+
var experimental_useSidebarNavigation = runtimeFunction(
|
|
135
|
+
"experimental_useSidebarNavigation"
|
|
136
|
+
);
|
|
137
|
+
var experimental_useSidebarNavigationSplit = runtimeFunction(
|
|
138
|
+
"experimental_useSidebarNavigationSplit"
|
|
139
|
+
);
|
|
140
|
+
var experimental_SidebarNavigationIcon = runtimeComponent(
|
|
141
|
+
"experimental_SidebarNavigationIcon"
|
|
142
|
+
);
|
|
134
143
|
var useSidebarThreadDraft = runtimeFunction("useSidebarThreadDraft");
|
|
135
144
|
var useSidebarThreadDraftIds = runtimeFunction(
|
|
136
145
|
"useSidebarThreadDraftIds"
|
|
@@ -177,6 +186,7 @@ export {
|
|
|
177
186
|
experimental_PermissionModePicker,
|
|
178
187
|
experimental_ProviderIcon,
|
|
179
188
|
experimental_ProviderModelPicker,
|
|
189
|
+
experimental_SidebarNavigationIcon,
|
|
180
190
|
experimental_SourceCode,
|
|
181
191
|
experimental_THREAD_ACTION_GROUPS,
|
|
182
192
|
experimental_ThreadActionsContextMenu,
|
|
@@ -194,6 +204,8 @@ export {
|
|
|
194
204
|
experimental_usePluginId,
|
|
195
205
|
experimental_useProviders,
|
|
196
206
|
experimental_useQuestionFormHost,
|
|
207
|
+
experimental_useSidebarNavigation,
|
|
208
|
+
experimental_useSidebarNavigationSplit,
|
|
197
209
|
experimental_useSidebarThreadActions,
|
|
198
210
|
experimental_useSidebarThreadPullRequest,
|
|
199
211
|
experimental_useSidebarThreadSplit,
|
|
@@ -378,21 +378,30 @@ var NAV_PANEL_REGISTRATION_KEYS = new Set(
|
|
|
378
378
|
path: true,
|
|
379
379
|
component: true,
|
|
380
380
|
fixedTabs: true,
|
|
381
|
-
|
|
381
|
+
experimental_useBadge: true,
|
|
382
382
|
headerContent: true
|
|
383
383
|
})
|
|
384
384
|
);
|
|
385
385
|
var RENAMED_NAV_PANEL_KEYS = /* @__PURE__ */ new Map([
|
|
386
|
-
["experimental_fixedTabs", "fixedTabs"]
|
|
386
|
+
["experimental_fixedTabs", 'was renamed to "fixedTabs" in SDK 0.4.16']
|
|
387
387
|
]);
|
|
388
|
-
|
|
388
|
+
var RETIRED_NAV_PANEL_KEYS = /* @__PURE__ */ new Map([
|
|
389
|
+
[
|
|
390
|
+
"experimental_sidebarAccessory",
|
|
391
|
+
'is ignored: it was replaced by "experimental_useBadge", a hook returning a badge value, in SDK 0.6.53'
|
|
392
|
+
]
|
|
393
|
+
]);
|
|
394
|
+
function checkStaleNavPanelKeys(kind, registration, onWarning) {
|
|
389
395
|
for (const key of Object.keys(registration)) {
|
|
390
396
|
if (NAV_PANEL_REGISTRATION_KEYS.has(key)) continue;
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
throw new Error(
|
|
394
|
-
|
|
395
|
-
|
|
397
|
+
const renamed = RENAMED_NAV_PANEL_KEYS.get(key);
|
|
398
|
+
if (renamed !== void 0) {
|
|
399
|
+
throw new Error(`${kind}: "${key}" ${renamed}`);
|
|
400
|
+
}
|
|
401
|
+
const retired = RETIRED_NAV_PANEL_KEYS.get(key);
|
|
402
|
+
if (retired !== void 0) {
|
|
403
|
+
onWarning(`${kind}: "${key}" ${retired}`);
|
|
404
|
+
continue;
|
|
396
405
|
}
|
|
397
406
|
if (key.startsWith("experimental_")) {
|
|
398
407
|
throw new Error(`${kind}: unknown field "${key}"`);
|
|
@@ -457,7 +466,7 @@ function collectPanelAction(kind, seen, registration) {
|
|
|
457
466
|
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
458
467
|
};
|
|
459
468
|
}
|
|
460
|
-
function collectPluginAppRegistrations(definition,
|
|
469
|
+
function collectPluginAppRegistrations(definition, onWarning = (message) => console.warn(message)) {
|
|
461
470
|
const sidebarFooterItems = [];
|
|
462
471
|
const collected = {
|
|
463
472
|
homepageSections: [],
|
|
@@ -471,6 +480,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
471
480
|
sidebarFooterActions: [],
|
|
472
481
|
experimentalSidebarFooterItems: [],
|
|
473
482
|
threadLists: [],
|
|
483
|
+
experimentalSidebarNavigations: [],
|
|
474
484
|
threadHeaderActions: [],
|
|
475
485
|
threadActions: [],
|
|
476
486
|
browserToolbarActions: [],
|
|
@@ -501,6 +511,8 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
501
511
|
pendingInteraction: /* @__PURE__ */ new Set(),
|
|
502
512
|
sidebarFooterItem: /* @__PURE__ */ new Set(),
|
|
503
513
|
threadList: /* @__PURE__ */ new Set(),
|
|
514
|
+
sidebarNavigation: /* @__PURE__ */ new Set(),
|
|
515
|
+
sidebarHeader: /* @__PURE__ */ new Set(),
|
|
504
516
|
threadHeaderAction: /* @__PURE__ */ new Set(),
|
|
505
517
|
threadAction: /* @__PURE__ */ new Set(),
|
|
506
518
|
browserToolbarAction: /* @__PURE__ */ new Set(),
|
|
@@ -550,9 +562,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
550
562
|
run: registration.run
|
|
551
563
|
});
|
|
552
564
|
}
|
|
565
|
+
const legacySidebarHeaders = [];
|
|
566
|
+
const legacySlotAliases = {
|
|
567
|
+
experimental_sidebarHeader(registration) {
|
|
568
|
+
legacySidebarHeaders.push(
|
|
569
|
+
collectTitledComponent(
|
|
570
|
+
"slots.experimental_sidebarHeader",
|
|
571
|
+
seenIds.sidebarHeader,
|
|
572
|
+
registration
|
|
573
|
+
).component
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
553
577
|
definition.setup({
|
|
554
578
|
commands: { register: registerCommand },
|
|
555
579
|
slots: {
|
|
580
|
+
...legacySlotAliases,
|
|
556
581
|
homepageSection(registration) {
|
|
557
582
|
const kind = "slots.homepageSection";
|
|
558
583
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -598,7 +623,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
598
623
|
const kind = "slots.navPanel";
|
|
599
624
|
const id = requireSlotId(kind, registration?.id);
|
|
600
625
|
requireUniqueId(kind, seenIds.navPanel, id);
|
|
601
|
-
|
|
626
|
+
checkStaleNavPanelKeys(kind, registration, onWarning);
|
|
602
627
|
const panelId = id;
|
|
603
628
|
const path = requireNonEmptyString(kind, "path", registration.path);
|
|
604
629
|
if (!PLUGIN_SLOT_ID_PATTERN.test(path)) {
|
|
@@ -611,9 +636,9 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
611
636
|
`${kind}: "headerContent" must be a React component function when set`
|
|
612
637
|
);
|
|
613
638
|
}
|
|
614
|
-
if (registration.
|
|
639
|
+
if (registration.experimental_useBadge !== void 0 && typeof registration.experimental_useBadge !== "function") {
|
|
615
640
|
throw new Error(
|
|
616
|
-
`${kind}: "
|
|
641
|
+
`${kind}: "experimental_useBadge" must be a React hook function when set`
|
|
617
642
|
);
|
|
618
643
|
}
|
|
619
644
|
const fixedTabs = (() => {
|
|
@@ -673,8 +698,8 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
673
698
|
path,
|
|
674
699
|
component: requireComponent(kind, registration.component),
|
|
675
700
|
...fixedTabs.length > 0 ? { fixedTabs } : {},
|
|
676
|
-
...registration.
|
|
677
|
-
|
|
701
|
+
...registration.experimental_useBadge !== void 0 ? {
|
|
702
|
+
experimental_useBadge: registration.experimental_useBadge
|
|
678
703
|
} : {},
|
|
679
704
|
...registration.headerContent !== void 0 ? { headerContent: registration.headerContent } : {}
|
|
680
705
|
});
|
|
@@ -731,6 +756,29 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
731
756
|
)
|
|
732
757
|
);
|
|
733
758
|
},
|
|
759
|
+
experimental_sidebarNavigation(registration) {
|
|
760
|
+
const kind = "slots.experimental_sidebarNavigation";
|
|
761
|
+
const collectedRegistration = collectTitledComponent(
|
|
762
|
+
kind,
|
|
763
|
+
seenIds.sidebarNavigation,
|
|
764
|
+
registration
|
|
765
|
+
);
|
|
766
|
+
const placement = registration.placement;
|
|
767
|
+
if (placement !== void 0 && placement !== "rail" && placement !== "list") {
|
|
768
|
+
throw new Error(`${kind}: "placement" must be "rail" or "list"`);
|
|
769
|
+
}
|
|
770
|
+
const headerComponent = registration.headerComponent;
|
|
771
|
+
if (headerComponent !== void 0 && typeof headerComponent !== "function") {
|
|
772
|
+
throw new Error(
|
|
773
|
+
`${kind}: "headerComponent" must be a React component function`
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
collected.experimentalSidebarNavigations.push({
|
|
777
|
+
...collectedRegistration,
|
|
778
|
+
placement: placement ?? "list",
|
|
779
|
+
...headerComponent !== void 0 ? { headerComponent } : {}
|
|
780
|
+
});
|
|
781
|
+
},
|
|
734
782
|
experimental_threadHeaderAction(registration) {
|
|
735
783
|
const kind = "slots.experimental_threadHeaderAction";
|
|
736
784
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -940,7 +988,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
940
988
|
const customization = collectComposerCustomization(
|
|
941
989
|
registration,
|
|
942
990
|
seenIds.composerCustomization,
|
|
943
|
-
|
|
991
|
+
(reason) => onWarning(`composer customization rejected: ${reason}`),
|
|
944
992
|
seenIds.composerPopup
|
|
945
993
|
);
|
|
946
994
|
if (customization !== null) {
|
|
@@ -980,8 +1028,34 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
980
1028
|
}
|
|
981
1029
|
}
|
|
982
1030
|
});
|
|
1031
|
+
attachLegacySidebarHeaders(
|
|
1032
|
+
collected.experimentalSidebarNavigations,
|
|
1033
|
+
legacySidebarHeaders,
|
|
1034
|
+
onWarning
|
|
1035
|
+
);
|
|
983
1036
|
return collected;
|
|
984
1037
|
}
|
|
1038
|
+
function attachLegacySidebarHeaders(navigations, headers, onWarning) {
|
|
1039
|
+
const [header, ...extraHeaders] = headers;
|
|
1040
|
+
if (header === void 0) return;
|
|
1041
|
+
const kind = "slots.experimental_sidebarHeader";
|
|
1042
|
+
if (extraHeaders.length > 0) {
|
|
1043
|
+
onWarning(
|
|
1044
|
+
`${kind}: only the first header is used; pass "headerComponent" to each experimental_sidebarNavigation instead`
|
|
1045
|
+
);
|
|
1046
|
+
}
|
|
1047
|
+
let attached = false;
|
|
1048
|
+
navigations.forEach((navigation, index) => {
|
|
1049
|
+
if (navigation.headerComponent !== void 0) return;
|
|
1050
|
+
navigations[index] = { ...navigation, headerComponent: header };
|
|
1051
|
+
attached = true;
|
|
1052
|
+
});
|
|
1053
|
+
if (!attached) {
|
|
1054
|
+
onWarning(
|
|
1055
|
+
`${kind}: ignored because the plugin registers no navigation without a "headerComponent"`
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
985
1059
|
export {
|
|
986
1060
|
adaptSidebarFooterAction,
|
|
987
1061
|
collectPluginAppRegistrations,
|
|
@@ -2350,10 +2350,12 @@ var threadEventContextWindowUsageSchema = z16.object({
|
|
|
2350
2350
|
estimated: z16.boolean(),
|
|
2351
2351
|
cost: threadUsageCostSchema.optional()
|
|
2352
2352
|
});
|
|
2353
|
+
var promptCacheTtlMsSchema = z16.number().int().positive();
|
|
2353
2354
|
var threadEventTokenUsageSchema = z16.object({
|
|
2354
2355
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2355
2356
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2356
|
-
modelContextWindow: z16.number().nullable()
|
|
2357
|
+
modelContextWindow: z16.number().nullable(),
|
|
2358
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional()
|
|
2357
2359
|
});
|
|
2358
2360
|
var threadEventWarningCategorySchema = z16.enum([
|
|
2359
2361
|
"deprecation",
|
|
@@ -2393,6 +2395,7 @@ var threadEventBackgroundTaskItemSchema = z16.object({
|
|
|
2393
2395
|
status: threadEventItemStatusSchema,
|
|
2394
2396
|
taskStatus: backgroundTaskStatusSchema,
|
|
2395
2397
|
skipTranscript: z16.boolean(),
|
|
2398
|
+
foreground: z16.boolean(),
|
|
2396
2399
|
workflowName: z16.string().optional(),
|
|
2397
2400
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2398
2401
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -3449,6 +3452,7 @@ var deltaBackgroundTaskShapeSchema = z28.object({
|
|
|
3449
3452
|
status: threadEventItemStatusSchema,
|
|
3450
3453
|
taskStatus: backgroundTaskStatusSchema,
|
|
3451
3454
|
skipTranscript: z28.boolean(),
|
|
3455
|
+
foreground: z28.boolean().optional(),
|
|
3452
3456
|
workflowName: z28.string().optional(),
|
|
3453
3457
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
3454
3458
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -3657,6 +3661,7 @@ var threadDeltaSchema = z28.discriminatedUnion("kind", [
|
|
|
3657
3661
|
total: threadEventTokenUsageBreakdownSchema,
|
|
3658
3662
|
last: threadEventTokenUsageBreakdownSchema,
|
|
3659
3663
|
modelContextWindow: z28.number().nullable(),
|
|
3664
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
|
|
3660
3665
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3661
3666
|
}),
|
|
3662
3667
|
z28.object({
|
|
@@ -15240,6 +15245,11 @@ var ACP_NATIVE_REASONING_EFFORTS = [
|
|
|
15240
15245
|
description: "Reasoning effort is managed by the connected ACP agent."
|
|
15241
15246
|
}
|
|
15242
15247
|
];
|
|
15248
|
+
function findAcpFastConfigOption(configOptions) {
|
|
15249
|
+
return (configOptions ?? []).find(
|
|
15250
|
+
(option) => option.id === "fast" && option.type === "select"
|
|
15251
|
+
);
|
|
15252
|
+
}
|
|
15243
15253
|
var MODEL_LINE_PATTERN = /^(\S+) - (.+)$/;
|
|
15244
15254
|
var BARE_PROVIDER_MODEL_LINE_PATTERN = /^\S+\/\S+$/;
|
|
15245
15255
|
var BULLETED_MODEL_LINE_PATTERN = /^[*-]\s+(\S+)(?:\s+\([^)]*\))?$/u;
|
|
@@ -15334,7 +15344,7 @@ function buildAcpNativeReasoningSupport(thoughtLevelOption) {
|
|
|
15334
15344
|
defaultReasoningEffort: currentValue !== void 0 && seen.has(currentValue) ? currentValue : supportedReasoningEfforts[0].reasoningEffort
|
|
15335
15345
|
};
|
|
15336
15346
|
}
|
|
15337
|
-
function buildModelCatalogFromConfigOptions(modelOption,
|
|
15347
|
+
function buildModelCatalogFromConfigOptions(modelOption, supportByModel) {
|
|
15338
15348
|
const options = modelOption?.options ?? [];
|
|
15339
15349
|
if (options.length === 0) {
|
|
15340
15350
|
return [];
|
|
@@ -15342,7 +15352,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
15342
15352
|
const currentValue = modelOption?.currentValue;
|
|
15343
15353
|
const models = options.map((option, index) => {
|
|
15344
15354
|
const isDefault = currentValue !== void 0 ? option.value === currentValue : index === 0;
|
|
15345
|
-
const reasoning =
|
|
15355
|
+
const reasoning = supportByModel?.get(option.value) ?? {
|
|
15346
15356
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
15347
15357
|
defaultReasoningEffort: "medium"
|
|
15348
15358
|
};
|
|
@@ -15353,6 +15363,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
15353
15363
|
description: readOptionDescription(option) ?? "",
|
|
15354
15364
|
supportedReasoningEfforts: reasoning.supportedReasoningEfforts,
|
|
15355
15365
|
defaultReasoningEffort: reasoning.defaultReasoningEffort,
|
|
15366
|
+
supportedServiceTiers: supportByModel?.get(option.value)?.supportedServiceTiers ?? [],
|
|
15356
15367
|
isDefault
|
|
15357
15368
|
};
|
|
15358
15369
|
});
|
|
@@ -15375,6 +15386,7 @@ function buildModelCatalogFromSessionModels(sessionModels) {
|
|
|
15375
15386
|
description: model.description ?? "",
|
|
15376
15387
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
15377
15388
|
defaultReasoningEffort: "medium",
|
|
15389
|
+
supportedServiceTiers: [],
|
|
15378
15390
|
isDefault
|
|
15379
15391
|
};
|
|
15380
15392
|
});
|
|
@@ -21477,6 +21489,7 @@ var ACP_DEFAULT_MODEL = {
|
|
|
21477
21489
|
description: "Model selection is managed by the connected ACP agent.",
|
|
21478
21490
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
21479
21491
|
defaultReasoningEffort: "medium",
|
|
21492
|
+
supportedServiceTiers: [],
|
|
21480
21493
|
isDefault: true
|
|
21481
21494
|
};
|
|
21482
21495
|
var MODEL_LIST_TIMEOUT_MS = 3e4;
|
|
@@ -21916,7 +21929,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
21916
21929
|
};
|
|
21917
21930
|
return sessionModels;
|
|
21918
21931
|
}
|
|
21919
|
-
const
|
|
21932
|
+
const supportByModel = await discoverAcpNativeModelSupport({
|
|
21920
21933
|
connection,
|
|
21921
21934
|
sessionId: newSession.sessionId,
|
|
21922
21935
|
modelOption,
|
|
@@ -21924,7 +21937,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
21924
21937
|
});
|
|
21925
21938
|
const models = buildModelCatalogFromConfigOptions(
|
|
21926
21939
|
modelOption,
|
|
21927
|
-
|
|
21940
|
+
supportByModel
|
|
21928
21941
|
);
|
|
21929
21942
|
cachedSessionDiscoveredModels = {
|
|
21930
21943
|
key,
|
|
@@ -21958,7 +21971,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
21958
21971
|
);
|
|
21959
21972
|
}
|
|
21960
21973
|
}
|
|
21961
|
-
async function
|
|
21974
|
+
async function discoverAcpNativeModelSupport(args) {
|
|
21962
21975
|
const modelOptions = args.modelOption?.options ?? [];
|
|
21963
21976
|
if (!args.modelOption || modelOptions.length === 0) {
|
|
21964
21977
|
return /* @__PURE__ */ new Map();
|
|
@@ -22005,12 +22018,14 @@ async function discoverAcpNativeReasoningByModel(args) {
|
|
|
22005
22018
|
},
|
|
22006
22019
|
resultSchema: acpConfigStateResultSchema
|
|
22007
22020
|
});
|
|
22008
|
-
supportByModel.set(
|
|
22009
|
-
|
|
22010
|
-
buildAcpNativeReasoningSupport(
|
|
22021
|
+
supportByModel.set(model.value, {
|
|
22022
|
+
...buildAcpNativeReasoningSupport(
|
|
22011
22023
|
findAcpThoughtLevelConfigOption(configState.configOptions)
|
|
22012
|
-
)
|
|
22013
|
-
|
|
22024
|
+
),
|
|
22025
|
+
supportedServiceTiers: findAcpFastConfigOption(
|
|
22026
|
+
configState.configOptions
|
|
22027
|
+
)?.options?.some((option) => option.value === "true") ? [{ id: "fast" }] : []
|
|
22028
|
+
});
|
|
22014
22029
|
} catch (error) {
|
|
22015
22030
|
if (timedOut) {
|
|
22016
22031
|
break;
|
|
@@ -22251,8 +22266,8 @@ async function selectAcpNativeServiceTier(args) {
|
|
|
22251
22266
|
if (serviceTier === void 0) {
|
|
22252
22267
|
return;
|
|
22253
22268
|
}
|
|
22254
|
-
const fastOption = (
|
|
22255
|
-
|
|
22269
|
+
const fastOption = findAcpFastConfigOption(
|
|
22270
|
+
args.session.nativeConfig.configOptions
|
|
22256
22271
|
);
|
|
22257
22272
|
const value = serviceTier === "fast" ? "true" : "false";
|
|
22258
22273
|
if (!fastOption?.options?.some((option) => option.value === value)) {
|
|
@@ -2350,10 +2350,12 @@ var threadEventContextWindowUsageSchema = z16.object({
|
|
|
2350
2350
|
estimated: z16.boolean(),
|
|
2351
2351
|
cost: threadUsageCostSchema.optional()
|
|
2352
2352
|
});
|
|
2353
|
+
var promptCacheTtlMsSchema = z16.number().int().positive();
|
|
2353
2354
|
var threadEventTokenUsageSchema = z16.object({
|
|
2354
2355
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2355
2356
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2356
|
-
modelContextWindow: z16.number().nullable()
|
|
2357
|
+
modelContextWindow: z16.number().nullable(),
|
|
2358
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional()
|
|
2357
2359
|
});
|
|
2358
2360
|
var threadEventWarningCategorySchema = z16.enum([
|
|
2359
2361
|
"deprecation",
|
|
@@ -2393,6 +2395,7 @@ var threadEventBackgroundTaskItemSchema = z16.object({
|
|
|
2393
2395
|
status: threadEventItemStatusSchema,
|
|
2394
2396
|
taskStatus: backgroundTaskStatusSchema,
|
|
2395
2397
|
skipTranscript: z16.boolean(),
|
|
2398
|
+
foreground: z16.boolean(),
|
|
2396
2399
|
workflowName: z16.string().optional(),
|
|
2397
2400
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2398
2401
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -3449,6 +3452,7 @@ var deltaBackgroundTaskShapeSchema = z28.object({
|
|
|
3449
3452
|
status: threadEventItemStatusSchema,
|
|
3450
3453
|
taskStatus: backgroundTaskStatusSchema,
|
|
3451
3454
|
skipTranscript: z28.boolean(),
|
|
3455
|
+
foreground: z28.boolean().optional(),
|
|
3452
3456
|
workflowName: z28.string().optional(),
|
|
3453
3457
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
3454
3458
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -3657,6 +3661,7 @@ var threadDeltaSchema = z28.discriminatedUnion("kind", [
|
|
|
3657
3661
|
total: threadEventTokenUsageBreakdownSchema,
|
|
3658
3662
|
last: threadEventTokenUsageBreakdownSchema,
|
|
3659
3663
|
modelContextWindow: z28.number().nullable(),
|
|
3664
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
|
|
3660
3665
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3661
3666
|
}),
|
|
3662
3667
|
z28.object({
|
|
@@ -14565,6 +14570,11 @@ var ACP_NATIVE_REASONING_EFFORTS = [
|
|
|
14565
14570
|
description: "Reasoning effort is managed by the connected ACP agent."
|
|
14566
14571
|
}
|
|
14567
14572
|
];
|
|
14573
|
+
function findAcpFastConfigOption(configOptions) {
|
|
14574
|
+
return (configOptions ?? []).find(
|
|
14575
|
+
(option) => option.id === "fast" && option.type === "select"
|
|
14576
|
+
);
|
|
14577
|
+
}
|
|
14568
14578
|
var MODEL_LINE_PATTERN = /^(\S+) - (.+)$/;
|
|
14569
14579
|
var BARE_PROVIDER_MODEL_LINE_PATTERN = /^\S+\/\S+$/;
|
|
14570
14580
|
var BULLETED_MODEL_LINE_PATTERN = /^[*-]\s+(\S+)(?:\s+\([^)]*\))?$/u;
|
|
@@ -14695,7 +14705,7 @@ function buildAcpNativeReasoningSupport(thoughtLevelOption) {
|
|
|
14695
14705
|
defaultReasoningEffort: currentLevel !== void 0 && supportedLevels.includes(currentLevel) ? currentLevel : supportedReasoningEfforts[0].reasoningEffort
|
|
14696
14706
|
};
|
|
14697
14707
|
}
|
|
14698
|
-
function buildModelCatalogFromConfigOptions(modelOption,
|
|
14708
|
+
function buildModelCatalogFromConfigOptions(modelOption, supportByModel) {
|
|
14699
14709
|
const options = modelOption?.options ?? [];
|
|
14700
14710
|
if (options.length === 0) {
|
|
14701
14711
|
return [];
|
|
@@ -14703,7 +14713,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
14703
14713
|
const currentValue = modelOption?.currentValue;
|
|
14704
14714
|
const models = options.map((option, index) => {
|
|
14705
14715
|
const isDefault = currentValue !== void 0 ? option.value === currentValue : index === 0;
|
|
14706
|
-
const reasoning =
|
|
14716
|
+
const reasoning = supportByModel?.get(option.value) ?? {
|
|
14707
14717
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
14708
14718
|
defaultReasoningEffort: "medium"
|
|
14709
14719
|
};
|
|
@@ -14714,6 +14724,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
14714
14724
|
description: "",
|
|
14715
14725
|
supportedReasoningEfforts: reasoning.supportedReasoningEfforts,
|
|
14716
14726
|
defaultReasoningEffort: reasoning.defaultReasoningEffort,
|
|
14727
|
+
supportedServiceTiers: supportByModel?.get(option.value)?.supportedServiceTiers ?? [],
|
|
14717
14728
|
isDefault
|
|
14718
14729
|
};
|
|
14719
14730
|
});
|
|
@@ -14736,6 +14747,7 @@ function buildModelCatalogFromSessionModels(sessionModels) {
|
|
|
14736
14747
|
description: model.description ?? "",
|
|
14737
14748
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
14738
14749
|
defaultReasoningEffort: "medium",
|
|
14750
|
+
supportedServiceTiers: [],
|
|
14739
14751
|
isDefault
|
|
14740
14752
|
};
|
|
14741
14753
|
});
|
|
@@ -16233,6 +16245,7 @@ var ACP_DEFAULT_MODEL = {
|
|
|
16233
16245
|
description: "Model selection is managed by the connected ACP agent.",
|
|
16234
16246
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
16235
16247
|
defaultReasoningEffort: "medium",
|
|
16248
|
+
supportedServiceTiers: [],
|
|
16236
16249
|
isDefault: true
|
|
16237
16250
|
};
|
|
16238
16251
|
var MODEL_LIST_TIMEOUT_MS = 3e4;
|
|
@@ -16491,7 +16504,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
16491
16504
|
};
|
|
16492
16505
|
return sessionModels;
|
|
16493
16506
|
}
|
|
16494
|
-
const
|
|
16507
|
+
const supportByModel = await discoverAcpNativeModelSupport({
|
|
16495
16508
|
connection,
|
|
16496
16509
|
sessionId: newSession.sessionId,
|
|
16497
16510
|
modelOption,
|
|
@@ -16499,7 +16512,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
16499
16512
|
});
|
|
16500
16513
|
const models = buildModelCatalogFromConfigOptions(
|
|
16501
16514
|
modelOption,
|
|
16502
|
-
|
|
16515
|
+
supportByModel
|
|
16503
16516
|
);
|
|
16504
16517
|
cachedSessionDiscoveredModels = {
|
|
16505
16518
|
key,
|
|
@@ -16520,7 +16533,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
16520
16533
|
await connection.kill();
|
|
16521
16534
|
}
|
|
16522
16535
|
}
|
|
16523
|
-
async function
|
|
16536
|
+
async function discoverAcpNativeModelSupport(args) {
|
|
16524
16537
|
const modelOptions = args.modelOption?.options ?? [];
|
|
16525
16538
|
if (!args.modelOption || modelOptions.length === 0) {
|
|
16526
16539
|
return /* @__PURE__ */ new Map();
|
|
@@ -16567,12 +16580,14 @@ async function discoverAcpNativeReasoningByModel(args) {
|
|
|
16567
16580
|
},
|
|
16568
16581
|
resultSchema: acpConfigStateResultSchema
|
|
16569
16582
|
});
|
|
16570
|
-
supportByModel.set(
|
|
16571
|
-
|
|
16572
|
-
buildAcpNativeReasoningSupport(
|
|
16583
|
+
supportByModel.set(model.value, {
|
|
16584
|
+
...buildAcpNativeReasoningSupport(
|
|
16573
16585
|
findAcpThoughtLevelConfigOption(configState.configOptions)
|
|
16574
|
-
)
|
|
16575
|
-
|
|
16586
|
+
),
|
|
16587
|
+
supportedServiceTiers: findAcpFastConfigOption(
|
|
16588
|
+
configState.configOptions
|
|
16589
|
+
)?.options?.some((option) => option.value === "true") ? [{ id: "fast" }] : []
|
|
16590
|
+
});
|
|
16576
16591
|
} catch (error) {
|
|
16577
16592
|
if (timedOut) {
|
|
16578
16593
|
break;
|
|
@@ -16796,8 +16811,8 @@ async function selectAcpNativeServiceTier(args) {
|
|
|
16796
16811
|
if (serviceTier === void 0) {
|
|
16797
16812
|
return;
|
|
16798
16813
|
}
|
|
16799
|
-
const fastOption = (
|
|
16800
|
-
|
|
16814
|
+
const fastOption = findAcpFastConfigOption(
|
|
16815
|
+
args.session.nativeConfig.configOptions
|
|
16801
16816
|
);
|
|
16802
16817
|
const value = serviceTier === "fast" ? "true" : "false";
|
|
16803
16818
|
if (!fastOption?.options?.some((option) => option.value === value)) {
|
|
@@ -1423,10 +1423,12 @@ var threadEventContextWindowUsageSchema = z14.object({
|
|
|
1423
1423
|
estimated: z14.boolean(),
|
|
1424
1424
|
cost: threadUsageCostSchema.optional()
|
|
1425
1425
|
});
|
|
1426
|
+
var promptCacheTtlMsSchema = z14.number().int().positive();
|
|
1426
1427
|
var threadEventTokenUsageSchema = z14.object({
|
|
1427
1428
|
total: threadEventTokenUsageBreakdownSchema,
|
|
1428
1429
|
last: threadEventTokenUsageBreakdownSchema,
|
|
1429
|
-
modelContextWindow: z14.number().nullable()
|
|
1430
|
+
modelContextWindow: z14.number().nullable(),
|
|
1431
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional()
|
|
1430
1432
|
});
|
|
1431
1433
|
var threadEventWarningCategorySchema = z14.enum([
|
|
1432
1434
|
"deprecation",
|
|
@@ -1466,6 +1468,7 @@ var threadEventBackgroundTaskItemSchema = z14.object({
|
|
|
1466
1468
|
status: threadEventItemStatusSchema,
|
|
1467
1469
|
taskStatus: backgroundTaskStatusSchema,
|
|
1468
1470
|
skipTranscript: z14.boolean(),
|
|
1471
|
+
foreground: z14.boolean(),
|
|
1469
1472
|
workflowName: z14.string().optional(),
|
|
1470
1473
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
1471
1474
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -2119,6 +2122,7 @@ var deltaBackgroundTaskShapeSchema = z18.object({
|
|
|
2119
2122
|
status: threadEventItemStatusSchema,
|
|
2120
2123
|
taskStatus: backgroundTaskStatusSchema,
|
|
2121
2124
|
skipTranscript: z18.boolean(),
|
|
2125
|
+
foreground: z18.boolean().optional(),
|
|
2122
2126
|
workflowName: z18.string().optional(),
|
|
2123
2127
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2124
2128
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -2327,6 +2331,7 @@ var threadDeltaSchema = z18.discriminatedUnion("kind", [
|
|
|
2327
2331
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2328
2332
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2329
2333
|
modelContextWindow: z18.number().nullable(),
|
|
2334
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
|
|
2330
2335
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2331
2336
|
}),
|
|
2332
2337
|
z18.object({
|
|
@@ -2939,6 +2944,7 @@ function createDeltaAssembler(options) {
|
|
|
2939
2944
|
status: shape.status,
|
|
2940
2945
|
taskStatus: shape.taskStatus,
|
|
2941
2946
|
skipTranscript: shape.skipTranscript,
|
|
2947
|
+
foreground: shape.foreground ?? false,
|
|
2942
2948
|
...shape.workflowName === void 0 ? {} : { workflowName: shape.workflowName },
|
|
2943
2949
|
...shape.workflow === void 0 ? {} : { workflow: shape.workflow },
|
|
2944
2950
|
...shape.usage === void 0 ? {} : { usage: shape.usage },
|
|
@@ -3976,7 +3982,8 @@ function createDeltaAssembler(options) {
|
|
|
3976
3982
|
tokenUsage: {
|
|
3977
3983
|
total: { ...delta.total },
|
|
3978
3984
|
last: { ...delta.last },
|
|
3979
|
-
modelContextWindow: delta.modelContextWindow
|
|
3985
|
+
modelContextWindow: delta.modelContextWindow,
|
|
3986
|
+
...delta.promptCacheTtlMs === void 0 ? {} : { promptCacheTtlMs: delta.promptCacheTtlMs }
|
|
3980
3987
|
}
|
|
3981
3988
|
});
|
|
3982
3989
|
return;
|
package/dist/provider-bridge.js
CHANGED
|
@@ -2865,10 +2865,12 @@ var threadEventContextWindowUsageSchema = z18.object({
|
|
|
2865
2865
|
estimated: z18.boolean(),
|
|
2866
2866
|
cost: threadUsageCostSchema.optional()
|
|
2867
2867
|
});
|
|
2868
|
+
var promptCacheTtlMsSchema = z18.number().int().positive();
|
|
2868
2869
|
var threadEventTokenUsageSchema = z18.object({
|
|
2869
2870
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2870
2871
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2871
|
-
modelContextWindow: z18.number().nullable()
|
|
2872
|
+
modelContextWindow: z18.number().nullable(),
|
|
2873
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional()
|
|
2872
2874
|
});
|
|
2873
2875
|
var threadEventWarningCategorySchema = z18.enum([
|
|
2874
2876
|
"deprecation",
|
|
@@ -2908,6 +2910,7 @@ var threadEventBackgroundTaskItemSchema = z18.object({
|
|
|
2908
2910
|
status: threadEventItemStatusSchema,
|
|
2909
2911
|
taskStatus: backgroundTaskStatusSchema,
|
|
2910
2912
|
skipTranscript: z18.boolean(),
|
|
2913
|
+
foreground: z18.boolean(),
|
|
2911
2914
|
workflowName: z18.string().optional(),
|
|
2912
2915
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2913
2916
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -11717,6 +11720,7 @@ var deltaBackgroundTaskShapeSchema = z34.object({
|
|
|
11717
11720
|
status: threadEventItemStatusSchema,
|
|
11718
11721
|
taskStatus: backgroundTaskStatusSchema,
|
|
11719
11722
|
skipTranscript: z34.boolean(),
|
|
11723
|
+
foreground: z34.boolean().optional(),
|
|
11720
11724
|
workflowName: z34.string().optional(),
|
|
11721
11725
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
11722
11726
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -11925,6 +11929,7 @@ var threadDeltaSchema = z34.discriminatedUnion("kind", [
|
|
|
11925
11929
|
total: threadEventTokenUsageBreakdownSchema,
|
|
11926
11930
|
last: threadEventTokenUsageBreakdownSchema,
|
|
11927
11931
|
modelContextWindow: z34.number().nullable(),
|
|
11932
|
+
promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
|
|
11928
11933
|
providerTurnId: providerTurnIdSchema.optional()
|
|
11929
11934
|
}),
|
|
11930
11935
|
z34.object({
|