@get-bb/plugin-sdk 0.6.5 → 0.6.14
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 +380 -258
- package/bundled-types/bb-plugin-sdk-host.d.ts +4 -2
- package/bundled-types/bb-plugin-sdk-internal-composer-customization-validation.d.ts +1 -1
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +17 -10
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +13 -17
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +8 -6
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +10 -16
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +49 -41
- package/bundled-types/bb-plugin-sdk-testing.d.ts +5 -3
- package/bundled-types/bb-plugin-sdk.d.ts +385 -261
- package/dist/host.js +17 -14
- package/dist/internal/composer-customization-validation.js +20 -6
- package/dist/internal/composer-handle.js +2 -0
- package/dist/internal/host-policy.js +1 -1
- package/dist/internal/plugin-app-collector.js +28 -7
- package/dist/provider-bridge-acp.js +7676 -374
- package/dist/provider-bridge-testing.js +21 -64
- package/dist/provider-bridge-worker-entry.mjs +7 -2
- package/dist/provider-bridge.js +7490 -301
- package/dist/testing/app.js +46 -14
- package/dist/testing/index.js +1 -1
- package/package.json +2 -2
package/dist/testing/app.js
CHANGED
|
@@ -491,6 +491,8 @@ function createComposerHandleBinding(key, initial) {
|
|
|
491
491
|
removeMention,
|
|
492
492
|
onSubmitted,
|
|
493
493
|
focus: () => target().focus(),
|
|
494
|
+
experimental_openPopup: (id) => target().openPopup?.(controller.pluginId, id) ?? false,
|
|
495
|
+
experimental_closePopup: () => target().closePopup?.(controller.pluginId) ?? false,
|
|
494
496
|
submit,
|
|
495
497
|
setSelection,
|
|
496
498
|
experimental_removeMention: (mention) => {
|
|
@@ -637,13 +639,12 @@ function requireUniqueId(kind, seen, id) {
|
|
|
637
639
|
}
|
|
638
640
|
seen.add(id);
|
|
639
641
|
}
|
|
640
|
-
function parseContributionArray(kind, value, onRejected, parse) {
|
|
642
|
+
function parseContributionArray(kind, value, onRejected, parse, seenIds = /* @__PURE__ */ new Set()) {
|
|
641
643
|
if (value === void 0) return void 0;
|
|
642
644
|
if (!Array.isArray(value)) {
|
|
643
645
|
onRejected(`${kind}: must be an array when set`);
|
|
644
646
|
return void 0;
|
|
645
647
|
}
|
|
646
|
-
const seenIds = /* @__PURE__ */ new Set();
|
|
647
648
|
const parsed = [];
|
|
648
649
|
for (const [index, entry] of value.entries()) {
|
|
649
650
|
const entryKind = `${kind}[${index}]`;
|
|
@@ -681,7 +682,7 @@ function parseMenuItem(entryKind, value) {
|
|
|
681
682
|
run: requireFunction(entryKind, "run", entry?.run)
|
|
682
683
|
};
|
|
683
684
|
}
|
|
684
|
-
function parseRegions(kind, registration, onRejected) {
|
|
685
|
+
function parseRegions(kind, registration, onRejected, seenPopupIds) {
|
|
685
686
|
const actions = parseContributionArray(`${kind}.actions`, registration.actions, onRejected, (entryKind, value) => {
|
|
686
687
|
const entry = value;
|
|
687
688
|
return {
|
|
@@ -716,6 +717,20 @@ function parseRegions(kind, registration, onRejected) {
|
|
|
716
717
|
onRejected,
|
|
717
718
|
parseMenuItem
|
|
718
719
|
);
|
|
720
|
+
const popups = parseContributionArray(
|
|
721
|
+
`${kind}.experimental_popups`,
|
|
722
|
+
registration.experimental_popups,
|
|
723
|
+
onRejected,
|
|
724
|
+
(entryKind, value) => {
|
|
725
|
+
const entry = value;
|
|
726
|
+
return {
|
|
727
|
+
id: requireSlotId(entryKind, entry?.id),
|
|
728
|
+
label: requireNonEmptyString(entryKind, "label", entry?.label),
|
|
729
|
+
component: requireComponent(entryKind, entry?.component)
|
|
730
|
+
};
|
|
731
|
+
},
|
|
732
|
+
seenPopupIds
|
|
733
|
+
);
|
|
719
734
|
let richText;
|
|
720
735
|
if (registration.richText !== void 0) {
|
|
721
736
|
const raw = registration.richText;
|
|
@@ -758,10 +773,11 @@ function parseRegions(kind, registration, onRejected) {
|
|
|
758
773
|
...banners !== void 0 ? { banners } : {},
|
|
759
774
|
...plusMenu !== void 0 ? { plusMenu } : {},
|
|
760
775
|
...sendMenu !== void 0 ? { sendMenu } : {},
|
|
761
|
-
...richText !== void 0 ? { richText } : {}
|
|
776
|
+
...richText !== void 0 ? { richText } : {},
|
|
777
|
+
...popups !== void 0 ? { experimental_popups: popups } : {}
|
|
762
778
|
};
|
|
763
779
|
}
|
|
764
|
-
function collectComposerCustomization(registration, seenIds, onRejected) {
|
|
780
|
+
function collectComposerCustomization(registration, seenIds, onRejected, seenPopupIds = /* @__PURE__ */ new Set()) {
|
|
765
781
|
const kind = "composer.customize";
|
|
766
782
|
try {
|
|
767
783
|
const raw = registration;
|
|
@@ -787,7 +803,7 @@ function collectComposerCustomization(registration, seenIds, onRejected) {
|
|
|
787
803
|
(scope) => scope !== "side-chat"
|
|
788
804
|
)
|
|
789
805
|
} : {},
|
|
790
|
-
...parseRegions(`${kind}(${id})`, raw ?? {}, onRejected)
|
|
806
|
+
...parseRegions(`${kind}(${id})`, raw ?? {}, onRejected, seenPopupIds)
|
|
791
807
|
};
|
|
792
808
|
} catch (error) {
|
|
793
809
|
onRejected(error instanceof Error ? error.message : String(error));
|
|
@@ -1173,6 +1189,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
1173
1189
|
threadPanelAction: /* @__PURE__ */ new Set(),
|
|
1174
1190
|
newThreadPanelAction: /* @__PURE__ */ new Set(),
|
|
1175
1191
|
composerCustomization: /* @__PURE__ */ new Set(),
|
|
1192
|
+
composerPopup: /* @__PURE__ */ new Set(),
|
|
1176
1193
|
pendingInteraction: /* @__PURE__ */ new Set(),
|
|
1177
1194
|
sidebarFooterItem: /* @__PURE__ */ new Set(),
|
|
1178
1195
|
sidebarNavigation: /* @__PURE__ */ new Set(),
|
|
@@ -1233,7 +1250,12 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
1233
1250
|
"description",
|
|
1234
1251
|
registration.description
|
|
1235
1252
|
);
|
|
1253
|
+
const page = registration.experimental_page;
|
|
1254
|
+
if (page !== void 0 && page !== "mobile") {
|
|
1255
|
+
throw new Error(`${kind}: experimental_page must be "mobile"`);
|
|
1256
|
+
}
|
|
1236
1257
|
collected.settingsSections.push({
|
|
1258
|
+
...page !== void 0 ? { experimental_page: page } : {},
|
|
1237
1259
|
id,
|
|
1238
1260
|
...title !== void 0 ? { title } : {},
|
|
1239
1261
|
...description !== void 0 ? { description } : {},
|
|
@@ -1562,7 +1584,8 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
1562
1584
|
const customization = collectComposerCustomization(
|
|
1563
1585
|
registration,
|
|
1564
1586
|
seenIds.composerCustomization,
|
|
1565
|
-
onComposerCustomizationRejected
|
|
1587
|
+
onComposerCustomizationRejected,
|
|
1588
|
+
seenIds.composerPopup
|
|
1566
1589
|
);
|
|
1567
1590
|
if (customization !== null) {
|
|
1568
1591
|
collected.composerCustomizations.push(customization);
|
|
@@ -1893,7 +1916,16 @@ function TestProviderModelPicker({
|
|
|
1893
1916
|
className
|
|
1894
1917
|
}) {
|
|
1895
1918
|
const [draft, setDraft] = useState(value);
|
|
1896
|
-
|
|
1919
|
+
const { providerId, model, reasoningLevel, serviceTier } = value;
|
|
1920
|
+
useEffect(
|
|
1921
|
+
() => setDraft({
|
|
1922
|
+
providerId,
|
|
1923
|
+
model,
|
|
1924
|
+
reasoningLevel,
|
|
1925
|
+
...serviceTier === void 0 ? {} : { serviceTier }
|
|
1926
|
+
}),
|
|
1927
|
+
[providerId, model, reasoningLevel, serviceTier]
|
|
1928
|
+
);
|
|
1897
1929
|
const reasoningLevels = [
|
|
1898
1930
|
"none",
|
|
1899
1931
|
"low",
|
|
@@ -1941,11 +1973,11 @@ function TestProviderModelPicker({
|
|
|
1941
1973
|
"aria-label": "Reasoning level",
|
|
1942
1974
|
value: draft.reasoningLevel,
|
|
1943
1975
|
onChange: (event) => {
|
|
1944
|
-
const
|
|
1976
|
+
const reasoningLevel2 = reasoningLevels.find(
|
|
1945
1977
|
(candidate) => candidate === event.target.value
|
|
1946
1978
|
);
|
|
1947
|
-
if (
|
|
1948
|
-
setDraft((current) => ({ ...current, reasoningLevel }));
|
|
1979
|
+
if (reasoningLevel2 === void 0) return;
|
|
1980
|
+
setDraft((current) => ({ ...current, reasoningLevel: reasoningLevel2 }));
|
|
1949
1981
|
}
|
|
1950
1982
|
}
|
|
1951
1983
|
),
|
|
@@ -1955,13 +1987,13 @@ function TestProviderModelPicker({
|
|
|
1955
1987
|
"aria-label": "Service tier",
|
|
1956
1988
|
value: draft.serviceTier ?? "",
|
|
1957
1989
|
onChange: (event) => setDraft((current) => {
|
|
1958
|
-
const
|
|
1959
|
-
if (
|
|
1990
|
+
const serviceTier2 = event.target.value;
|
|
1991
|
+
if (serviceTier2 === "") {
|
|
1960
1992
|
const next = { ...current };
|
|
1961
1993
|
delete next.serviceTier;
|
|
1962
1994
|
return next;
|
|
1963
1995
|
}
|
|
1964
|
-
return { ...current, serviceTier };
|
|
1996
|
+
return { ...current, serviceTier: serviceTier2 };
|
|
1965
1997
|
}),
|
|
1966
1998
|
children: [
|
|
1967
1999
|
/* @__PURE__ */ jsx("option", { value: "", children: "Unsupported" }),
|
package/dist/testing/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@get-bb/plugin-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14",
|
|
4
4
|
"homepage": "https://github.com/get-bb/bb#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/get-bb/bb/issues"
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
},
|
|
136
136
|
"dependencies": {
|
|
137
137
|
"cross-spawn": "^7.0.6",
|
|
138
|
-
"zod": "^4.
|
|
138
|
+
"zod": "^4.6.5"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@bb/domain": "workspace:*",
|