@get-bb/plugin-sdk 0.6.52 → 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 +350 -12
- 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 +9 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +30 -2
- package/bundled-types/bb-plugin-sdk.d.ts +346 -11
- package/dist/app.js +12 -0
- package/dist/internal/plugin-app-collector.js +89 -15
- package/dist/provider-bridge-acp-next.js +24 -12
- package/dist/provider-bridge-acp.js +24 -12
- package/dist/provider-bridge-testing.js +3 -0
- package/dist/provider-bridge.js +2 -0
- package/dist/testing/app.js +169 -15
- package/package.json +1 -1
|
@@ -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,
|
|
@@ -2395,6 +2395,7 @@ var threadEventBackgroundTaskItemSchema = z16.object({
|
|
|
2395
2395
|
status: threadEventItemStatusSchema,
|
|
2396
2396
|
taskStatus: backgroundTaskStatusSchema,
|
|
2397
2397
|
skipTranscript: z16.boolean(),
|
|
2398
|
+
foreground: z16.boolean(),
|
|
2398
2399
|
workflowName: z16.string().optional(),
|
|
2399
2400
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2400
2401
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -3451,6 +3452,7 @@ var deltaBackgroundTaskShapeSchema = z28.object({
|
|
|
3451
3452
|
status: threadEventItemStatusSchema,
|
|
3452
3453
|
taskStatus: backgroundTaskStatusSchema,
|
|
3453
3454
|
skipTranscript: z28.boolean(),
|
|
3455
|
+
foreground: z28.boolean().optional(),
|
|
3454
3456
|
workflowName: z28.string().optional(),
|
|
3455
3457
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
3456
3458
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -15243,6 +15245,11 @@ var ACP_NATIVE_REASONING_EFFORTS = [
|
|
|
15243
15245
|
description: "Reasoning effort is managed by the connected ACP agent."
|
|
15244
15246
|
}
|
|
15245
15247
|
];
|
|
15248
|
+
function findAcpFastConfigOption(configOptions) {
|
|
15249
|
+
return (configOptions ?? []).find(
|
|
15250
|
+
(option) => option.id === "fast" && option.type === "select"
|
|
15251
|
+
);
|
|
15252
|
+
}
|
|
15246
15253
|
var MODEL_LINE_PATTERN = /^(\S+) - (.+)$/;
|
|
15247
15254
|
var BARE_PROVIDER_MODEL_LINE_PATTERN = /^\S+\/\S+$/;
|
|
15248
15255
|
var BULLETED_MODEL_LINE_PATTERN = /^[*-]\s+(\S+)(?:\s+\([^)]*\))?$/u;
|
|
@@ -15337,7 +15344,7 @@ function buildAcpNativeReasoningSupport(thoughtLevelOption) {
|
|
|
15337
15344
|
defaultReasoningEffort: currentValue !== void 0 && seen.has(currentValue) ? currentValue : supportedReasoningEfforts[0].reasoningEffort
|
|
15338
15345
|
};
|
|
15339
15346
|
}
|
|
15340
|
-
function buildModelCatalogFromConfigOptions(modelOption,
|
|
15347
|
+
function buildModelCatalogFromConfigOptions(modelOption, supportByModel) {
|
|
15341
15348
|
const options = modelOption?.options ?? [];
|
|
15342
15349
|
if (options.length === 0) {
|
|
15343
15350
|
return [];
|
|
@@ -15345,7 +15352,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
15345
15352
|
const currentValue = modelOption?.currentValue;
|
|
15346
15353
|
const models = options.map((option, index) => {
|
|
15347
15354
|
const isDefault = currentValue !== void 0 ? option.value === currentValue : index === 0;
|
|
15348
|
-
const reasoning =
|
|
15355
|
+
const reasoning = supportByModel?.get(option.value) ?? {
|
|
15349
15356
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
15350
15357
|
defaultReasoningEffort: "medium"
|
|
15351
15358
|
};
|
|
@@ -15356,6 +15363,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
15356
15363
|
description: readOptionDescription(option) ?? "",
|
|
15357
15364
|
supportedReasoningEfforts: reasoning.supportedReasoningEfforts,
|
|
15358
15365
|
defaultReasoningEffort: reasoning.defaultReasoningEffort,
|
|
15366
|
+
supportedServiceTiers: supportByModel?.get(option.value)?.supportedServiceTiers ?? [],
|
|
15359
15367
|
isDefault
|
|
15360
15368
|
};
|
|
15361
15369
|
});
|
|
@@ -15378,6 +15386,7 @@ function buildModelCatalogFromSessionModels(sessionModels) {
|
|
|
15378
15386
|
description: model.description ?? "",
|
|
15379
15387
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
15380
15388
|
defaultReasoningEffort: "medium",
|
|
15389
|
+
supportedServiceTiers: [],
|
|
15381
15390
|
isDefault
|
|
15382
15391
|
};
|
|
15383
15392
|
});
|
|
@@ -21480,6 +21489,7 @@ var ACP_DEFAULT_MODEL = {
|
|
|
21480
21489
|
description: "Model selection is managed by the connected ACP agent.",
|
|
21481
21490
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
21482
21491
|
defaultReasoningEffort: "medium",
|
|
21492
|
+
supportedServiceTiers: [],
|
|
21483
21493
|
isDefault: true
|
|
21484
21494
|
};
|
|
21485
21495
|
var MODEL_LIST_TIMEOUT_MS = 3e4;
|
|
@@ -21919,7 +21929,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
21919
21929
|
};
|
|
21920
21930
|
return sessionModels;
|
|
21921
21931
|
}
|
|
21922
|
-
const
|
|
21932
|
+
const supportByModel = await discoverAcpNativeModelSupport({
|
|
21923
21933
|
connection,
|
|
21924
21934
|
sessionId: newSession.sessionId,
|
|
21925
21935
|
modelOption,
|
|
@@ -21927,7 +21937,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
21927
21937
|
});
|
|
21928
21938
|
const models = buildModelCatalogFromConfigOptions(
|
|
21929
21939
|
modelOption,
|
|
21930
|
-
|
|
21940
|
+
supportByModel
|
|
21931
21941
|
);
|
|
21932
21942
|
cachedSessionDiscoveredModels = {
|
|
21933
21943
|
key,
|
|
@@ -21961,7 +21971,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
21961
21971
|
);
|
|
21962
21972
|
}
|
|
21963
21973
|
}
|
|
21964
|
-
async function
|
|
21974
|
+
async function discoverAcpNativeModelSupport(args) {
|
|
21965
21975
|
const modelOptions = args.modelOption?.options ?? [];
|
|
21966
21976
|
if (!args.modelOption || modelOptions.length === 0) {
|
|
21967
21977
|
return /* @__PURE__ */ new Map();
|
|
@@ -22008,12 +22018,14 @@ async function discoverAcpNativeReasoningByModel(args) {
|
|
|
22008
22018
|
},
|
|
22009
22019
|
resultSchema: acpConfigStateResultSchema
|
|
22010
22020
|
});
|
|
22011
|
-
supportByModel.set(
|
|
22012
|
-
|
|
22013
|
-
buildAcpNativeReasoningSupport(
|
|
22021
|
+
supportByModel.set(model.value, {
|
|
22022
|
+
...buildAcpNativeReasoningSupport(
|
|
22014
22023
|
findAcpThoughtLevelConfigOption(configState.configOptions)
|
|
22015
|
-
)
|
|
22016
|
-
|
|
22024
|
+
),
|
|
22025
|
+
supportedServiceTiers: findAcpFastConfigOption(
|
|
22026
|
+
configState.configOptions
|
|
22027
|
+
)?.options?.some((option) => option.value === "true") ? [{ id: "fast" }] : []
|
|
22028
|
+
});
|
|
22017
22029
|
} catch (error) {
|
|
22018
22030
|
if (timedOut) {
|
|
22019
22031
|
break;
|
|
@@ -22254,8 +22266,8 @@ async function selectAcpNativeServiceTier(args) {
|
|
|
22254
22266
|
if (serviceTier === void 0) {
|
|
22255
22267
|
return;
|
|
22256
22268
|
}
|
|
22257
|
-
const fastOption = (
|
|
22258
|
-
|
|
22269
|
+
const fastOption = findAcpFastConfigOption(
|
|
22270
|
+
args.session.nativeConfig.configOptions
|
|
22259
22271
|
);
|
|
22260
22272
|
const value = serviceTier === "fast" ? "true" : "false";
|
|
22261
22273
|
if (!fastOption?.options?.some((option) => option.value === value)) {
|
|
@@ -2395,6 +2395,7 @@ var threadEventBackgroundTaskItemSchema = z16.object({
|
|
|
2395
2395
|
status: threadEventItemStatusSchema,
|
|
2396
2396
|
taskStatus: backgroundTaskStatusSchema,
|
|
2397
2397
|
skipTranscript: z16.boolean(),
|
|
2398
|
+
foreground: z16.boolean(),
|
|
2398
2399
|
workflowName: z16.string().optional(),
|
|
2399
2400
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2400
2401
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -3451,6 +3452,7 @@ var deltaBackgroundTaskShapeSchema = z28.object({
|
|
|
3451
3452
|
status: threadEventItemStatusSchema,
|
|
3452
3453
|
taskStatus: backgroundTaskStatusSchema,
|
|
3453
3454
|
skipTranscript: z28.boolean(),
|
|
3455
|
+
foreground: z28.boolean().optional(),
|
|
3454
3456
|
workflowName: z28.string().optional(),
|
|
3455
3457
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
3456
3458
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -14568,6 +14570,11 @@ var ACP_NATIVE_REASONING_EFFORTS = [
|
|
|
14568
14570
|
description: "Reasoning effort is managed by the connected ACP agent."
|
|
14569
14571
|
}
|
|
14570
14572
|
];
|
|
14573
|
+
function findAcpFastConfigOption(configOptions) {
|
|
14574
|
+
return (configOptions ?? []).find(
|
|
14575
|
+
(option) => option.id === "fast" && option.type === "select"
|
|
14576
|
+
);
|
|
14577
|
+
}
|
|
14571
14578
|
var MODEL_LINE_PATTERN = /^(\S+) - (.+)$/;
|
|
14572
14579
|
var BARE_PROVIDER_MODEL_LINE_PATTERN = /^\S+\/\S+$/;
|
|
14573
14580
|
var BULLETED_MODEL_LINE_PATTERN = /^[*-]\s+(\S+)(?:\s+\([^)]*\))?$/u;
|
|
@@ -14698,7 +14705,7 @@ function buildAcpNativeReasoningSupport(thoughtLevelOption) {
|
|
|
14698
14705
|
defaultReasoningEffort: currentLevel !== void 0 && supportedLevels.includes(currentLevel) ? currentLevel : supportedReasoningEfforts[0].reasoningEffort
|
|
14699
14706
|
};
|
|
14700
14707
|
}
|
|
14701
|
-
function buildModelCatalogFromConfigOptions(modelOption,
|
|
14708
|
+
function buildModelCatalogFromConfigOptions(modelOption, supportByModel) {
|
|
14702
14709
|
const options = modelOption?.options ?? [];
|
|
14703
14710
|
if (options.length === 0) {
|
|
14704
14711
|
return [];
|
|
@@ -14706,7 +14713,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
14706
14713
|
const currentValue = modelOption?.currentValue;
|
|
14707
14714
|
const models = options.map((option, index) => {
|
|
14708
14715
|
const isDefault = currentValue !== void 0 ? option.value === currentValue : index === 0;
|
|
14709
|
-
const reasoning =
|
|
14716
|
+
const reasoning = supportByModel?.get(option.value) ?? {
|
|
14710
14717
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
14711
14718
|
defaultReasoningEffort: "medium"
|
|
14712
14719
|
};
|
|
@@ -14717,6 +14724,7 @@ function buildModelCatalogFromConfigOptions(modelOption, reasoningByModel) {
|
|
|
14717
14724
|
description: "",
|
|
14718
14725
|
supportedReasoningEfforts: reasoning.supportedReasoningEfforts,
|
|
14719
14726
|
defaultReasoningEffort: reasoning.defaultReasoningEffort,
|
|
14727
|
+
supportedServiceTiers: supportByModel?.get(option.value)?.supportedServiceTiers ?? [],
|
|
14720
14728
|
isDefault
|
|
14721
14729
|
};
|
|
14722
14730
|
});
|
|
@@ -14739,6 +14747,7 @@ function buildModelCatalogFromSessionModels(sessionModels) {
|
|
|
14739
14747
|
description: model.description ?? "",
|
|
14740
14748
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
14741
14749
|
defaultReasoningEffort: "medium",
|
|
14750
|
+
supportedServiceTiers: [],
|
|
14742
14751
|
isDefault
|
|
14743
14752
|
};
|
|
14744
14753
|
});
|
|
@@ -16236,6 +16245,7 @@ var ACP_DEFAULT_MODEL = {
|
|
|
16236
16245
|
description: "Model selection is managed by the connected ACP agent.",
|
|
16237
16246
|
supportedReasoningEfforts: ACP_NATIVE_REASONING_EFFORTS,
|
|
16238
16247
|
defaultReasoningEffort: "medium",
|
|
16248
|
+
supportedServiceTiers: [],
|
|
16239
16249
|
isDefault: true
|
|
16240
16250
|
};
|
|
16241
16251
|
var MODEL_LIST_TIMEOUT_MS = 3e4;
|
|
@@ -16494,7 +16504,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
16494
16504
|
};
|
|
16495
16505
|
return sessionModels;
|
|
16496
16506
|
}
|
|
16497
|
-
const
|
|
16507
|
+
const supportByModel = await discoverAcpNativeModelSupport({
|
|
16498
16508
|
connection,
|
|
16499
16509
|
sessionId: newSession.sessionId,
|
|
16500
16510
|
modelOption,
|
|
@@ -16502,7 +16512,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
16502
16512
|
});
|
|
16503
16513
|
const models = buildModelCatalogFromConfigOptions(
|
|
16504
16514
|
modelOption,
|
|
16505
|
-
|
|
16515
|
+
supportByModel
|
|
16506
16516
|
);
|
|
16507
16517
|
cachedSessionDiscoveredModels = {
|
|
16508
16518
|
key,
|
|
@@ -16523,7 +16533,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
|
|
|
16523
16533
|
await connection.kill();
|
|
16524
16534
|
}
|
|
16525
16535
|
}
|
|
16526
|
-
async function
|
|
16536
|
+
async function discoverAcpNativeModelSupport(args) {
|
|
16527
16537
|
const modelOptions = args.modelOption?.options ?? [];
|
|
16528
16538
|
if (!args.modelOption || modelOptions.length === 0) {
|
|
16529
16539
|
return /* @__PURE__ */ new Map();
|
|
@@ -16570,12 +16580,14 @@ async function discoverAcpNativeReasoningByModel(args) {
|
|
|
16570
16580
|
},
|
|
16571
16581
|
resultSchema: acpConfigStateResultSchema
|
|
16572
16582
|
});
|
|
16573
|
-
supportByModel.set(
|
|
16574
|
-
|
|
16575
|
-
buildAcpNativeReasoningSupport(
|
|
16583
|
+
supportByModel.set(model.value, {
|
|
16584
|
+
...buildAcpNativeReasoningSupport(
|
|
16576
16585
|
findAcpThoughtLevelConfigOption(configState.configOptions)
|
|
16577
|
-
)
|
|
16578
|
-
|
|
16586
|
+
),
|
|
16587
|
+
supportedServiceTiers: findAcpFastConfigOption(
|
|
16588
|
+
configState.configOptions
|
|
16589
|
+
)?.options?.some((option) => option.value === "true") ? [{ id: "fast" }] : []
|
|
16590
|
+
});
|
|
16579
16591
|
} catch (error) {
|
|
16580
16592
|
if (timedOut) {
|
|
16581
16593
|
break;
|
|
@@ -16799,8 +16811,8 @@ async function selectAcpNativeServiceTier(args) {
|
|
|
16799
16811
|
if (serviceTier === void 0) {
|
|
16800
16812
|
return;
|
|
16801
16813
|
}
|
|
16802
|
-
const fastOption = (
|
|
16803
|
-
|
|
16814
|
+
const fastOption = findAcpFastConfigOption(
|
|
16815
|
+
args.session.nativeConfig.configOptions
|
|
16804
16816
|
);
|
|
16805
16817
|
const value = serviceTier === "fast" ? "true" : "false";
|
|
16806
16818
|
if (!fastOption?.options?.some((option) => option.value === value)) {
|
|
@@ -1468,6 +1468,7 @@ var threadEventBackgroundTaskItemSchema = z14.object({
|
|
|
1468
1468
|
status: threadEventItemStatusSchema,
|
|
1469
1469
|
taskStatus: backgroundTaskStatusSchema,
|
|
1470
1470
|
skipTranscript: z14.boolean(),
|
|
1471
|
+
foreground: z14.boolean(),
|
|
1471
1472
|
workflowName: z14.string().optional(),
|
|
1472
1473
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
1473
1474
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -2121,6 +2122,7 @@ var deltaBackgroundTaskShapeSchema = z18.object({
|
|
|
2121
2122
|
status: threadEventItemStatusSchema,
|
|
2122
2123
|
taskStatus: backgroundTaskStatusSchema,
|
|
2123
2124
|
skipTranscript: z18.boolean(),
|
|
2125
|
+
foreground: z18.boolean().optional(),
|
|
2124
2126
|
workflowName: z18.string().optional(),
|
|
2125
2127
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2126
2128
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -2942,6 +2944,7 @@ function createDeltaAssembler(options) {
|
|
|
2942
2944
|
status: shape.status,
|
|
2943
2945
|
taskStatus: shape.taskStatus,
|
|
2944
2946
|
skipTranscript: shape.skipTranscript,
|
|
2947
|
+
foreground: shape.foreground ?? false,
|
|
2945
2948
|
...shape.workflowName === void 0 ? {} : { workflowName: shape.workflowName },
|
|
2946
2949
|
...shape.workflow === void 0 ? {} : { workflow: shape.workflow },
|
|
2947
2950
|
...shape.usage === void 0 ? {} : { usage: shape.usage },
|
package/dist/provider-bridge.js
CHANGED
|
@@ -2910,6 +2910,7 @@ var threadEventBackgroundTaskItemSchema = z18.object({
|
|
|
2910
2910
|
status: threadEventItemStatusSchema,
|
|
2911
2911
|
taskStatus: backgroundTaskStatusSchema,
|
|
2912
2912
|
skipTranscript: z18.boolean(),
|
|
2913
|
+
foreground: z18.boolean(),
|
|
2913
2914
|
workflowName: z18.string().optional(),
|
|
2914
2915
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2915
2916
|
usage: backgroundTaskUsageSchema.optional(),
|
|
@@ -11719,6 +11720,7 @@ var deltaBackgroundTaskShapeSchema = z34.object({
|
|
|
11719
11720
|
status: threadEventItemStatusSchema,
|
|
11720
11721
|
taskStatus: backgroundTaskStatusSchema,
|
|
11721
11722
|
skipTranscript: z34.boolean(),
|
|
11723
|
+
foreground: z34.boolean().optional(),
|
|
11722
11724
|
workflowName: z34.string().optional(),
|
|
11723
11725
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
11724
11726
|
usage: backgroundTaskUsageSchema.optional(),
|