@get-bb/plugin-sdk 0.6.33 → 0.6.39

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
@@ -1,3 +1,11 @@
1
+ // src/thread-action-groups.ts
2
+ var experimental_THREAD_ACTION_GROUPS = {
3
+ open: "1_open",
4
+ organize: "2_organize",
5
+ settings: "3_settings",
6
+ lifecycle: "4_lifecycle"
7
+ };
8
+
1
9
  // src/app.ts
2
10
  function runtimeHost() {
3
11
  return globalThis.__bbPluginRuntime;
@@ -101,6 +109,21 @@ var experimental_useSidebarThreads = runtimeFunction(
101
109
  var experimental_useSidebarThreadActions = runtimeFunction(
102
110
  "experimental_useSidebarThreadActions"
103
111
  );
112
+ var experimental_useThreadActions = runtimeFunction(
113
+ "experimental_useThreadActions"
114
+ );
115
+ var experimental_useArchiveEnvironmentThreads = runtimeFunction(
116
+ "experimental_useArchiveEnvironmentThreads"
117
+ );
118
+ var experimental_useThreadActionRegistrations = runtimeFunction(
119
+ "experimental_useThreadActionRegistrations"
120
+ );
121
+ var experimental_ThreadActionsMenu = runtimeComponent(
122
+ "experimental_ThreadActionsMenu"
123
+ );
124
+ var experimental_ThreadActionsContextMenu = runtimeComponent(
125
+ "experimental_ThreadActionsContextMenu"
126
+ );
104
127
  var experimental_useSidebarThreadPullRequest = runtimeFunction(
105
128
  "experimental_useSidebarThreadPullRequest"
106
129
  );
@@ -122,6 +145,9 @@ var useSidebarThreadShortcut = runtimeFunction(
122
145
  "useSidebarThreadShortcut"
123
146
  );
124
147
  var ThreadTitle = runtimeComponent("ThreadTitle");
148
+ var experimental_ThreadStatusGlyph = runtimeComponent(
149
+ "experimental_ThreadStatusGlyph"
150
+ );
125
151
  var useEnvironmentProviders = runtimeFunction(
126
152
  "useEnvironmentProviders"
127
153
  );
@@ -150,9 +176,14 @@ export {
150
176
  experimental_ProviderIcon,
151
177
  experimental_ProviderModelPicker,
152
178
  experimental_SourceCode,
179
+ experimental_THREAD_ACTION_GROUPS,
180
+ experimental_ThreadActionsContextMenu,
181
+ experimental_ThreadActionsMenu,
182
+ experimental_ThreadStatusGlyph,
153
183
  experimental_VoiceInputTextarea,
154
184
  experimental_copyToClipboard,
155
185
  experimental_useAppPanel,
186
+ experimental_useArchiveEnvironmentThreads,
156
187
  experimental_useBranches,
157
188
  experimental_useCheckoutState,
158
189
  experimental_useCodeTheme,
@@ -164,6 +195,8 @@ export {
164
195
  experimental_useSidebarThreadPullRequest,
165
196
  experimental_useSidebarThreadSplit,
166
197
  experimental_useSidebarThreads,
198
+ experimental_useThreadActionRegistrations,
199
+ experimental_useThreadActions,
167
200
  useBbContext,
168
201
  useBbNavigate,
169
202
  useComposer,
package/dist/index.js CHANGED
@@ -812,11 +812,20 @@ function experimental_defineHostEntry(args) {
812
812
  function defineRpcContract(contract) {
813
813
  return contract;
814
814
  }
815
+
816
+ // src/thread-action-groups.ts
817
+ var experimental_THREAD_ACTION_GROUPS = {
818
+ open: "1_open",
819
+ organize: "2_organize",
820
+ settings: "3_settings",
821
+ lifecycle: "4_lifecycle"
822
+ };
815
823
  export {
816
824
  PLUGIN_CLI_OUTPUT_MAX_BYTES,
817
825
  PluginCliError,
818
826
  cliCommand,
819
827
  defineCli,
820
828
  defineRpcContract,
829
+ experimental_THREAD_ACTION_GROUPS,
821
830
  experimental_defineHostEntry
822
831
  };
@@ -86,6 +86,7 @@ var mentionSchema = z.discriminatedUnion("kind", [
86
86
  origin: z.enum(["builtin", "project", "user"]),
87
87
  argumentHint: z.string().nullable()
88
88
  }),
89
+ z.object({ ...range, kind: z.literal("attachment"), path: z.string() }),
89
90
  z.object({
90
91
  ...range,
91
92
  kind: z.literal("plugin"),
@@ -400,6 +400,7 @@ var settingDescriptorSchema = z5.discriminatedUnion("type", [
400
400
  type: z5.literal("select"),
401
401
  ...settingsBaseFields,
402
402
  options: z5.array(z5.string().min(1)).min(1),
403
+ experimental_optionLabels: z5.record(z5.string().min(1), z5.string().min(1)).optional(),
403
404
  experimental_schema: stringSettingSchemaSchema.optional(),
404
405
  default: z5.string().optional()
405
406
  }).strict(),
@@ -435,6 +436,16 @@ function registerSettingDescriptors(target, added) {
435
436
  `default for setting "${key}" must be one of its options`
436
437
  );
437
438
  }
439
+ if (descriptor.type === "select") {
440
+ const unknownLabel = Object.keys(
441
+ descriptor.experimental_optionLabels ?? {}
442
+ ).find((option) => !descriptor.options.includes(option));
443
+ if (unknownLabel !== void 0) {
444
+ throw new Error(
445
+ `label for setting "${key}" names "${unknownLabel}", which is not one of its options`
446
+ );
447
+ }
448
+ }
438
449
  if (descriptor.default !== void 0) {
439
450
  const errors = validateSettingsUpdate(
440
451
  { [key]: descriptor },
@@ -1031,13 +1042,12 @@ function validateProviderFallbackModels(providerId, value) {
1031
1042
  `provider "${providerId}" ${field}.supportedReasoningEfforts[${effortIndex}] must be { reasoningEffort, description }`
1032
1043
  );
1033
1044
  }
1034
- const reasoningEffort = Reflect.get(effort, "reasoningEffort");
1035
- if (typeof reasoningEffort !== "string" || !PLUGIN_PROVIDER_REASONING_LEVEL_VALUES.includes(reasoningEffort)) {
1036
- throw new Error(
1037
- `provider "${providerId}" ${field}.supportedReasoningEfforts[${effortIndex}].reasoningEffort must be one of ${PLUGIN_PROVIDER_REASONING_LEVEL_VALUES.join(", ")}`
1038
- );
1039
- }
1040
- const level = reasoningEffort;
1045
+ const level = requireNonBlankString({
1046
+ providerId,
1047
+ field: `${field}.supportedReasoningEfforts[${effortIndex}].reasoningEffort`,
1048
+ value: Reflect.get(effort, "reasoningEffort")
1049
+ });
1050
+ const label = Reflect.get(effort, "label");
1041
1051
  if (levels.has(level)) {
1042
1052
  throw new Error(
1043
1053
  `provider "${providerId}" ${field}.supportedReasoningEfforts repeats ${JSON.stringify(level)}`
@@ -1046,6 +1056,13 @@ function validateProviderFallbackModels(providerId, value) {
1046
1056
  levels.add(level);
1047
1057
  return Object.freeze({
1048
1058
  reasoningEffort: level,
1059
+ ...label === void 0 ? {} : {
1060
+ label: requireNonBlankString({
1061
+ providerId,
1062
+ field: `${field}.supportedReasoningEfforts[${effortIndex}].label`,
1063
+ value: label
1064
+ })
1065
+ },
1049
1066
  description: requireNonBlankString({
1050
1067
  providerId,
1051
1068
  field: `${field}.supportedReasoningEfforts[${effortIndex}].description`,
@@ -471,6 +471,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
471
471
  experimentalSidebarFooterItems: [],
472
472
  threadLists: [],
473
473
  threadHeaderActions: [],
474
+ threadActions: [],
474
475
  browserToolbarActions: [],
475
476
  fileOpeners: [],
476
477
  sourceCodeRenderers: [],
@@ -499,6 +500,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
499
500
  sidebarFooterItem: /* @__PURE__ */ new Set(),
500
501
  threadList: /* @__PURE__ */ new Set(),
501
502
  threadHeaderAction: /* @__PURE__ */ new Set(),
503
+ threadAction: /* @__PURE__ */ new Set(),
502
504
  browserToolbarAction: /* @__PURE__ */ new Set(),
503
505
  fileOpener: /* @__PURE__ */ new Set(),
504
506
  sourceCodeRenderer: /* @__PURE__ */ new Set(),
@@ -735,6 +737,29 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
735
737
  component: requireComponent(kind, registration.component)
736
738
  });
737
739
  },
740
+ experimental_threadAction(registration) {
741
+ const kind = "slots.experimental_threadAction";
742
+ const id = requireSlotId(kind, registration?.id);
743
+ requireUniqueId(kind, seenIds.threadAction, id);
744
+ if (typeof registration.item !== "function") {
745
+ throw new Error(`${kind}: "item" must be a function`);
746
+ }
747
+ if (registration.useData !== void 0 && typeof registration.useData !== "function") {
748
+ throw new Error(`${kind}: "useData" must be a function`);
749
+ }
750
+ if (registration.order !== void 0 && !Number.isFinite(registration.order)) {
751
+ throw new Error(`${kind}: "order" must be a finite number`);
752
+ }
753
+ collected.threadActions.push({
754
+ id,
755
+ title: requireNonEmptyString(kind, "title", registration.title),
756
+ icon: requireNonEmptyString(kind, "icon", registration.icon),
757
+ group: requireNonEmptyString(kind, "group", registration.group),
758
+ ...registration.order !== void 0 ? { order: registration.order } : {},
759
+ ...registration.useData !== void 0 ? { useData: registration.useData } : {},
760
+ item: registration.item
761
+ });
762
+ },
738
763
  experimental_browserToolbarAction(registration) {
739
764
  const kind = "slots.experimental_browserToolbarAction";
740
765
  const id = requireSlotId(kind, registration?.id);