@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.
@@ -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 !== "fast" && serviceTier2 !== "default") {
1991
+ if (serviceTier2 === "") {
1974
1992
  const next = { ...current };
1975
1993
  delete next.serviceTier;
1976
1994
  return next;
@@ -34,6 +34,7 @@ var RESERVED_BB_CLI_COMMANDS = [
34
34
  "marketplace",
35
35
  "plugin",
36
36
  "project",
37
+ "prompt-history",
37
38
  "provider",
38
39
  "server",
39
40
  "settings",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.9",
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"