@get-bb/plugin-sdk 0.6.9 → 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 +189 -89
- 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 +8 -12
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +6 -4
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +1 -4
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +38 -31
- package/bundled-types/bb-plugin-sdk-testing.d.ts +4 -2
- package/bundled-types/bb-plugin-sdk.d.ts +193 -91
- 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 -0
- package/dist/internal/plugin-app-collector.js +23 -7
- package/dist/provider-bridge-acp.js +7662 -314
- package/dist/provider-bridge-testing.js +9 -3
- package/dist/provider-bridge-worker-entry.mjs +7 -2
- package/dist/provider-bridge.js +7401 -169
- package/dist/testing/app.js +26 -8
- package/dist/testing/index.js +1 -0
- package/package.json +1 -1
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(),
|
|
@@ -1567,7 +1584,8 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
1567
1584
|
const customization = collectComposerCustomization(
|
|
1568
1585
|
registration,
|
|
1569
1586
|
seenIds.composerCustomization,
|
|
1570
|
-
onComposerCustomizationRejected
|
|
1587
|
+
onComposerCustomizationRejected,
|
|
1588
|
+
seenIds.composerPopup
|
|
1571
1589
|
);
|
|
1572
1590
|
if (customization !== null) {
|
|
1573
1591
|
collected.composerCustomizations.push(customization);
|
|
@@ -1970,7 +1988,7 @@ function TestProviderModelPicker({
|
|
|
1970
1988
|
value: draft.serviceTier ?? "",
|
|
1971
1989
|
onChange: (event) => setDraft((current) => {
|
|
1972
1990
|
const serviceTier2 = event.target.value;
|
|
1973
|
-
if (serviceTier2
|
|
1991
|
+
if (serviceTier2 === "") {
|
|
1974
1992
|
const next = { ...current };
|
|
1975
1993
|
delete next.serviceTier;
|
|
1976
1994
|
return next;
|
package/dist/testing/index.js
CHANGED