@get-bb/plugin-sdk 0.6.68 → 0.6.73

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/dist/app.js CHANGED
@@ -88,6 +88,20 @@ var experimental_THREAD_ACTION_GROUPS = {
88
88
  lifecycle: "4_lifecycle"
89
89
  };
90
90
 
91
+ // src/thread-info-groups.ts
92
+ var experimental_THREAD_INFO_ROW_GROUPS = {
93
+ thread: "1_thread",
94
+ environment: "2_environment",
95
+ git: "3_git",
96
+ pullRequest: "4_pullRequest",
97
+ lifecycle: "5_lifecycle"
98
+ };
99
+ var experimental_THREAD_INFO_SECTION_GROUPS = {
100
+ related: "1_related",
101
+ changes: "2_changes",
102
+ storage: "3_storage"
103
+ };
104
+
91
105
  // src/app.ts
92
106
  function runtimeHost() {
93
107
  return globalThis.__bbPluginRuntime;
@@ -162,6 +176,16 @@ var experimental_SourceCode = runtimeComponent(
162
176
  "experimental_SourceCode"
163
177
  );
164
178
  var experimental_Diff = runtimeComponent("experimental_Diff");
179
+ var experimental_InfoSection = runtimeComponent(
180
+ "experimental_InfoSection"
181
+ );
182
+ var experimental_DetailRow = runtimeComponent(
183
+ "experimental_DetailRow"
184
+ );
185
+ var experimental_InfoList = runtimeComponent("experimental_InfoList");
186
+ var experimental_InfoListRow = runtimeComponent(
187
+ "experimental_InfoListRow"
188
+ );
165
189
  var experimental_useRpcQuery = runtimeFunction(
166
190
  "experimental_useRpcQuery"
167
191
  );
@@ -196,6 +220,57 @@ var experimental_useFixedTabTarget = runtimeFunction(
196
220
  );
197
221
  var useComposer = runtimeFunction("useComposer");
198
222
  var useComposers = runtimeFunction("useComposers");
223
+ var experimental_useComposerRenderer = runtimeFunction(
224
+ "experimental_useComposerRenderer"
225
+ );
226
+ var experimental_useThreadTitleDisplayText = runtimeFunction(
227
+ "experimental_useThreadTitleDisplayText"
228
+ );
229
+ var experimental_useComposerContributions = runtimeFunction(
230
+ "experimental_useComposerContributions"
231
+ );
232
+ var experimental_useComposerMentionSearch = runtimeFunction(
233
+ "experimental_useComposerMentionSearch"
234
+ );
235
+ var experimental_useComposerCommandSearch = runtimeFunction(
236
+ "experimental_useComposerCommandSearch"
237
+ );
238
+ var experimental_ComposerRoot = runtimeComponent(
239
+ "experimental_ComposerRoot"
240
+ );
241
+ var experimental_VoiceInputButton = runtimeComponent(
242
+ "experimental_VoiceInputButton"
243
+ );
244
+ var experimental_VoiceRecordingBar = runtimeComponent(
245
+ "experimental_VoiceRecordingBar"
246
+ );
247
+ var experimental_FailedVoiceRecordings = runtimeComponent(
248
+ "experimental_FailedVoiceRecordings"
249
+ );
250
+ var experimental_ShortcutHint = runtimeComponent(
251
+ "experimental_ShortcutHint"
252
+ );
253
+ var experimental_ImageLightbox = runtimeComponent(
254
+ "experimental_ImageLightbox"
255
+ );
256
+ var experimental_PromptMentionIcon = runtimeComponent(
257
+ "experimental_PromptMentionIcon"
258
+ );
259
+ var experimental_describePromptMention = runtimeFunction(
260
+ "experimental_describePromptMention"
261
+ );
262
+ var experimental_promptMentionClipboardAttributes = runtimeFunction(
263
+ "experimental_promptMentionClipboardAttributes"
264
+ );
265
+ var experimental_readPromptMentionClipboard = runtimeFunction(
266
+ "experimental_readPromptMentionClipboard"
267
+ );
268
+ var experimental_PluginIcon = runtimeComponent(
269
+ "experimental_PluginIcon"
270
+ );
271
+ var experimental_ThreadTitleText = runtimeComponent(
272
+ "experimental_ThreadTitleText"
273
+ );
199
274
  var useComposerView = runtimeFunction("useComposerView");
200
275
  var experimental_useSidebarThreads = runtimeFunction(
201
276
  "experimental_useSidebarThreads"
@@ -218,9 +293,6 @@ var experimental_ThreadActionsMenu = runtimeComponent(
218
293
  var experimental_ThreadActionsContextMenu = runtimeComponent(
219
294
  "experimental_ThreadActionsContextMenu"
220
295
  );
221
- var experimental_useSidebarThreadPullRequest = runtimeFunction(
222
- "experimental_useSidebarThreadPullRequest"
223
- );
224
296
  var experimental_useSidebarThreadSplit = runtimeFunction(
225
297
  "experimental_useSidebarThreadSplit"
226
298
  );
@@ -272,28 +344,50 @@ export {
272
344
  UrlLink,
273
345
  definePluginApp,
274
346
  experimental_BranchPicker,
347
+ experimental_ComposerRoot,
348
+ experimental_DetailRow,
275
349
  experimental_Diff,
350
+ experimental_FailedVoiceRecordings,
276
351
  experimental_FileLink,
277
352
  experimental_Icon,
353
+ experimental_ImageLightbox,
354
+ experimental_InfoList,
355
+ experimental_InfoListRow,
356
+ experimental_InfoSection,
278
357
  experimental_NewThreadComposer,
279
358
  experimental_PermissionModePicker,
359
+ experimental_PluginIcon,
280
360
  experimental_PluginRpcCallError,
361
+ experimental_PromptMentionIcon,
281
362
  experimental_ProviderIcon,
282
363
  experimental_ProviderModelPicker,
364
+ experimental_ShortcutHint,
283
365
  experimental_SidebarNavigationIcon,
284
366
  experimental_SourceCode,
285
367
  experimental_THREAD_ACTION_GROUPS,
368
+ experimental_THREAD_INFO_ROW_GROUPS,
369
+ experimental_THREAD_INFO_SECTION_GROUPS,
286
370
  experimental_ThreadActionsContextMenu,
287
371
  experimental_ThreadActionsMenu,
288
372
  experimental_ThreadStatusGlyph,
373
+ experimental_ThreadTitleText,
374
+ experimental_VoiceInputButton,
289
375
  experimental_VoiceInputTextarea,
376
+ experimental_VoiceRecordingBar,
290
377
  experimental_copyToClipboard,
378
+ experimental_describePromptMention,
379
+ experimental_promptMentionClipboardAttributes,
380
+ experimental_readPromptMentionClipboard,
291
381
  experimental_saveFile,
292
382
  experimental_useAppPanel,
293
383
  experimental_useArchiveEnvironmentThreads,
294
384
  experimental_useBranches,
295
385
  experimental_useCheckoutState,
296
386
  experimental_useCodeTheme,
387
+ experimental_useComposerCommandSearch,
388
+ experimental_useComposerContributions,
389
+ experimental_useComposerMentionSearch,
390
+ experimental_useComposerRenderer,
297
391
  experimental_useFixedTabTarget,
298
392
  experimental_usePluginId,
299
393
  experimental_useProviders,
@@ -305,11 +399,11 @@ export {
305
399
  experimental_useSidebarNavigation,
306
400
  experimental_useSidebarNavigationSplit,
307
401
  experimental_useSidebarThreadActions,
308
- experimental_useSidebarThreadPullRequest,
309
402
  experimental_useSidebarThreadSplit,
310
403
  experimental_useSidebarThreads,
311
404
  experimental_useThreadActionRegistrations,
312
405
  experimental_useThreadActions,
406
+ experimental_useThreadTitleDisplayText,
313
407
  useBbContext,
314
408
  useBbNavigate,
315
409
  useComposer,
package/dist/index.js CHANGED
@@ -900,6 +900,20 @@ var experimental_THREAD_ACTION_GROUPS = {
900
900
  settings: "3_settings",
901
901
  lifecycle: "4_lifecycle"
902
902
  };
903
+
904
+ // src/thread-info-groups.ts
905
+ var experimental_THREAD_INFO_ROW_GROUPS = {
906
+ thread: "1_thread",
907
+ environment: "2_environment",
908
+ git: "3_git",
909
+ pullRequest: "4_pullRequest",
910
+ lifecycle: "5_lifecycle"
911
+ };
912
+ var experimental_THREAD_INFO_SECTION_GROUPS = {
913
+ related: "1_related",
914
+ changes: "2_changes",
915
+ storage: "3_storage"
916
+ };
903
917
  export {
904
918
  PLUGIN_CLI_OUTPUT_MAX_BYTES,
905
919
  PluginCliError,
@@ -909,5 +923,7 @@ export {
909
923
  experimental_PluginRpcCallError,
910
924
  experimental_PluginRpcRefusal,
911
925
  experimental_THREAD_ACTION_GROUPS,
926
+ experimental_THREAD_INFO_ROW_GROUPS,
927
+ experimental_THREAD_INFO_SECTION_GROUPS,
912
928
  experimental_defineHostEntry
913
929
  };
@@ -371,7 +371,7 @@ function createComposerHandleBinding(key, initial) {
371
371
  throw new Error("Pick a time in the future.");
372
372
  }
373
373
  const errorBefore = editorState().attachmentError;
374
- await waitForUploads(target());
374
+ if (editorState().isAttaching) await waitForUploads(target());
375
375
  const state = editorState();
376
376
  if (state.attachmentError !== null && state.attachmentError !== errorBefore) {
377
377
  throw new Error(state.attachmentError);
@@ -437,6 +437,13 @@ function createCommandShortcutSchema() {
437
437
  "Use Command, Control, or Alt with a key, or a function key"
438
438
  );
439
439
  }
440
+ function requireOptionalOrder(kind, order) {
441
+ if (order === void 0) return {};
442
+ if (!Number.isFinite(order)) {
443
+ throw new Error(`${kind}: "order" must be a finite number`);
444
+ }
445
+ return { order };
446
+ }
440
447
  function collectTitledComponent(kind, seen, registration) {
441
448
  const id = requireSlotId(kind, registration?.id);
442
449
  requireUniqueId(kind, seen, id);
@@ -478,7 +485,12 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
478
485
  settingsSections: [],
479
486
  appOverlays: [],
480
487
  navPanels: [],
481
- threadPanelActions: [],
488
+ tabs: [],
489
+ get threadPanelActions() {
490
+ return this.tabs.filter(
491
+ (tab) => tab.context.kind === "thread" && tab.availability === "action"
492
+ );
493
+ },
482
494
  newThreadPanelActions: [],
483
495
  composerCustomizations: [],
484
496
  pendingInteractions: [],
@@ -487,11 +499,14 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
487
499
  threadLists: [],
488
500
  experimentalSidebarNavigations: [],
489
501
  threadHeaderActions: [],
502
+ threadInfoRows: [],
503
+ threadInfoSections: [],
490
504
  threadActions: [],
491
505
  browserToolbarActions: [],
492
506
  fileOpeners: [],
493
507
  sourceCodeRenderers: [],
494
508
  diffRenderers: [],
509
+ composers: [],
495
510
  messageDirectives: [],
496
511
  codeFenceRenderers: [],
497
512
  messageActions: [],
@@ -509,7 +524,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
509
524
  settingsSection: /* @__PURE__ */ new Set(),
510
525
  appOverlay: /* @__PURE__ */ new Set(),
511
526
  navPanel: /* @__PURE__ */ new Set(),
512
- threadPanelAction: /* @__PURE__ */ new Set(),
527
+ tab: /* @__PURE__ */ new Set(),
513
528
  newThreadPanelAction: /* @__PURE__ */ new Set(),
514
529
  composerCustomization: /* @__PURE__ */ new Set(),
515
530
  composerPopup: /* @__PURE__ */ new Set(),
@@ -519,11 +534,14 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
519
534
  sidebarNavigation: /* @__PURE__ */ new Set(),
520
535
  sidebarHeader: /* @__PURE__ */ new Set(),
521
536
  threadHeaderAction: /* @__PURE__ */ new Set(),
537
+ threadInfoRow: /* @__PURE__ */ new Set(),
538
+ threadInfoSection: /* @__PURE__ */ new Set(),
522
539
  threadAction: /* @__PURE__ */ new Set(),
523
540
  browserToolbarAction: /* @__PURE__ */ new Set(),
524
541
  fileOpener: /* @__PURE__ */ new Set(),
525
542
  sourceCodeRenderer: /* @__PURE__ */ new Set(),
526
543
  diffRenderer: /* @__PURE__ */ new Set(),
544
+ composer: /* @__PURE__ */ new Set(),
527
545
  messageDirective: /* @__PURE__ */ new Set(),
528
546
  codeFenceRenderer: /* @__PURE__ */ new Set(),
529
547
  codeFenceLanguage: /* @__PURE__ */ new Set(),
@@ -535,6 +553,54 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
535
553
  machineProviderInputs: /* @__PURE__ */ new Set(),
536
554
  contentScript: /* @__PURE__ */ new Set()
537
555
  };
556
+ function collectTab(value, legacy = false) {
557
+ const registration = value;
558
+ const kind = "slots.experimental_tab";
559
+ const id = requireSlotId(kind, registration?.id);
560
+ const context = registration.context;
561
+ if (context?.kind !== "thread" && context?.kind !== "nav-panel") {
562
+ throw new Error(`${kind}: context must be thread or nav-panel`);
563
+ }
564
+ if (context.kind === "nav-panel") requireSlotId(kind, context.panelId);
565
+ const availability = registration.availability;
566
+ if (availability !== "fixed" && availability !== "action") {
567
+ throw new Error(`${kind}: availability must be fixed or action`);
568
+ }
569
+ requireUniqueId(
570
+ kind,
571
+ seenIds.tab,
572
+ `${context.kind}/${context.kind === "nav-panel" ? context.panelId : ""}/${id}`
573
+ );
574
+ if (registration.useVisible !== void 0 && typeof registration.useVisible !== "function") {
575
+ throw new Error(`${kind}: useVisible must be a function`);
576
+ }
577
+ if (availability === "fixed" && (registration.run !== void 0 || registration.params !== void 0)) {
578
+ throw new Error(`${kind}: run and params require action availability`);
579
+ }
580
+ const target = registration.experimental_target;
581
+ if (target !== void 0 && (context.kind !== "nav-panel" || availability !== "fixed" || typeof target?.validate !== "function")) {
582
+ throw new Error(
583
+ `${kind}: experimental_target requires a nav-panel fixed tab and a validate function`
584
+ );
585
+ }
586
+ const validated = {
587
+ ...registration,
588
+ ...collectPanelAction(kind, /* @__PURE__ */ new Set(), {
589
+ ...registration,
590
+ icon: legacy && registration.icon === "" ? void 0 : registration.icon
591
+ }),
592
+ icon: legacy && registration.icon === "" ? "" : requireNonEmptyString(kind, "icon", registration.icon),
593
+ ...registration.tooltip === void 0 ? {} : {
594
+ tooltip: requireNonEmptyString(
595
+ kind,
596
+ "tooltip",
597
+ registration.tooltip
598
+ )
599
+ },
600
+ ...availability === "action" && registration.params !== void 0 ? { params: z.json().parse(registration.params) } : {}
601
+ };
602
+ collected.tabs.push(validated);
603
+ }
538
604
  function collectCommand(kind, registration) {
539
605
  const id = requireSlotId(kind, registration?.id);
540
606
  requireUniqueId(kind, seenIds.command, id);
@@ -569,6 +635,26 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
569
635
  }
570
636
  const legacySidebarHeaders = [];
571
637
  const legacySlotAliases = {
638
+ threadPanelAction(registration) {
639
+ try {
640
+ const action = collectPanelAction(
641
+ "slots.threadPanelAction",
642
+ /* @__PURE__ */ new Set(),
643
+ registration
644
+ );
645
+ collectTab(
646
+ {
647
+ ...action,
648
+ icon: action.icon ?? "",
649
+ context: { kind: "thread" },
650
+ availability: "action"
651
+ },
652
+ true
653
+ );
654
+ } catch (error) {
655
+ onWarning(`Legacy threadPanelAction ignored: ${String(error)}`);
656
+ }
657
+ },
572
658
  experimental_sidebarHeader(registration) {
573
659
  legacySidebarHeaders.push(
574
660
  collectTitledComponent(
@@ -656,63 +742,45 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
656
742
  `${kind}: "experimental_usePageTitle" must be a React hook function when set`
657
743
  );
658
744
  }
659
- const fixedTabs = (() => {
660
- if (registration.fixedTabs === void 0) return [];
661
- if (!Array.isArray(registration.fixedTabs)) {
662
- throw new Error(`${kind}: "fixedTabs" must be an array when set`);
663
- }
664
- const seenFixedTabIds = /* @__PURE__ */ new Set();
665
- return registration.fixedTabs.map((value, index) => {
666
- const fixedTabKind = `${kind}.fixedTabs[${index}]`;
667
- const fixedTab = value;
668
- const id2 = requireSlotId(fixedTabKind, fixedTab?.id);
669
- requireUniqueId(fixedTabKind, seenFixedTabIds, id2);
670
- const layout = fixedTab?.layout;
671
- if (layout !== void 0 && layout !== "padded" && layout !== "flush") {
672
- throw new Error(
673
- `${fixedTabKind}: "layout" must be "padded" or "flush" when set`
674
- );
675
- }
676
- const fixedTabPanelId = requireNonEmptyString(
677
- fixedTabKind,
678
- "panelId",
679
- fixedTab?.panelId
680
- );
681
- if (fixedTabPanelId !== panelId) {
682
- throw new Error(
683
- `${fixedTabKind}: "panelId" must match its containing navPanel id ${JSON.stringify(panelId)}`
684
- );
685
- }
686
- const experimentalTarget = fixedTab?.experimental_target;
687
- if (experimentalTarget !== void 0 && (typeof experimentalTarget !== "object" || experimentalTarget === null || typeof Reflect.get(experimentalTarget, "validate") !== "function")) {
688
- throw new Error(
689
- `${fixedTabKind}: "experimental_target.validate" must be a function when set`
690
- );
691
- }
692
- return {
745
+ const legacy = registration;
746
+ const fixedTabs = [];
747
+ if (legacy.fixedTabs !== void 0 && !Array.isArray(legacy.fixedTabs)) {
748
+ onWarning("Legacy navPanel.fixedTabs ignored: expected an array");
749
+ }
750
+ for (const value of Array.isArray(legacy.fixedTabs) ? legacy.fixedTabs : []) {
751
+ try {
752
+ const id2 = requireSlotId(kind, value?.id);
753
+ const tab = {
693
754
  id: id2,
694
- panelId: fixedTabPanelId,
695
- title: requireNonEmptyString(
696
- fixedTabKind,
697
- "title",
698
- fixedTab?.title
699
- ),
700
- icon: requireNonEmptyString(fixedTabKind, "icon", fixedTab?.icon),
701
- component: requireComponent(fixedTabKind, fixedTab?.component),
702
- ...layout === void 0 ? {} : { layout },
703
- ...experimentalTarget === void 0 ? {} : {
704
- experimental_target: experimentalTarget
705
- }
755
+ panelId,
756
+ title: requireNonEmptyString(kind, "title", value.title ?? id2),
757
+ icon: typeof value.icon === "string" ? value.icon : "",
758
+ component: requireComponent(kind, value.component),
759
+ ...value.layout === "flush" ? { layout: "flush" } : {},
760
+ ...typeof value.experimental_target?.validate === "function" ? { experimental_target: value.experimental_target } : {}
706
761
  };
707
- });
708
- })();
762
+ collectTab(
763
+ {
764
+ ...tab,
765
+ context: { kind: "nav-panel", panelId },
766
+ availability: "fixed"
767
+ },
768
+ true
769
+ );
770
+ fixedTabs.push(tab);
771
+ } catch (error) {
772
+ onWarning(
773
+ `Legacy navPanel.fixedTabs entry ignored: ${String(error)}`
774
+ );
775
+ }
776
+ }
709
777
  collected.navPanels.push({
710
778
  id,
711
779
  title: requireNonEmptyString(kind, "title", registration.title),
712
780
  icon: requireNonEmptyString(kind, "icon", registration.icon),
713
781
  path,
782
+ ...fixedTabs.length === 0 ? {} : { fixedTabs },
714
783
  component: requireComponent(kind, registration.component),
715
- ...fixedTabs.length > 0 ? { fixedTabs } : {},
716
784
  ...registration.experimental_useBadge !== void 0 ? {
717
785
  experimental_useBadge: registration.experimental_useBadge
718
786
  } : {},
@@ -723,14 +791,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
723
791
  ...registration.headerContent !== void 0 ? { headerContent: registration.headerContent } : {}
724
792
  });
725
793
  },
726
- threadPanelAction(registration) {
727
- collected.threadPanelActions.push(
728
- collectPanelAction(
729
- "slots.threadPanelAction",
730
- seenIds.threadPanelAction,
731
- registration
732
- )
733
- );
794
+ experimental_tab(registration) {
795
+ collectTab(registration);
734
796
  },
735
797
  experimental_newThreadPanelAction(registration) {
736
798
  collected.newThreadPanelActions.push(
@@ -808,6 +870,28 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
808
870
  component: requireComponent(kind, registration.component)
809
871
  });
810
872
  },
873
+ experimental_threadInfoRow(registration) {
874
+ const kind = "slots.experimental_threadInfoRow";
875
+ const id = requireSlotId(kind, registration?.id);
876
+ requireUniqueId(kind, seenIds.threadInfoRow, id);
877
+ collected.threadInfoRows.push({
878
+ id,
879
+ group: requireNonEmptyString(kind, "group", registration.group),
880
+ ...requireOptionalOrder(kind, registration.order),
881
+ component: requireComponent(kind, registration.component)
882
+ });
883
+ },
884
+ experimental_threadInfoSection(registration) {
885
+ const kind = "slots.experimental_threadInfoSection";
886
+ const id = requireSlotId(kind, registration?.id);
887
+ requireUniqueId(kind, seenIds.threadInfoSection, id);
888
+ collected.threadInfoSections.push({
889
+ id,
890
+ group: requireNonEmptyString(kind, "group", registration.group),
891
+ ...requireOptionalOrder(kind, registration.order),
892
+ component: requireComponent(kind, registration.component)
893
+ });
894
+ },
811
895
  experimental_threadAction(registration) {
812
896
  const kind = "slots.experimental_threadAction";
813
897
  const id = requireSlotId(kind, registration?.id);
@@ -818,15 +902,12 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
818
902
  if (registration.useData !== void 0 && typeof registration.useData !== "function") {
819
903
  throw new Error(`${kind}: "useData" must be a function`);
820
904
  }
821
- if (registration.order !== void 0 && !Number.isFinite(registration.order)) {
822
- throw new Error(`${kind}: "order" must be a finite number`);
823
- }
824
905
  collected.threadActions.push({
825
906
  id,
826
907
  title: requireNonEmptyString(kind, "title", registration.title),
827
908
  icon: requireNonEmptyString(kind, "icon", registration.icon),
828
909
  group: requireNonEmptyString(kind, "group", registration.group),
829
- ...registration.order !== void 0 ? { order: registration.order } : {},
910
+ ...requireOptionalOrder(kind, registration.order),
830
911
  ...registration.useData !== void 0 ? { useData: registration.useData } : {},
831
912
  item: registration.item
832
913
  });
@@ -884,6 +965,15 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
884
965
  )
885
966
  );
886
967
  },
968
+ experimental_composer(registration) {
969
+ collected.composers.push(
970
+ collectTitledComponent(
971
+ "slots.experimental_composer",
972
+ seenIds.composer,
973
+ registration
974
+ )
975
+ );
976
+ },
887
977
  messageDirective(registration) {
888
978
  const kind = "slots.messageDirective";
889
979
  const id = requireMessageDirectiveId(kind, registration?.id);