@get-bb/plugin-sdk 0.4.48 → 0.4.50

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.
@@ -946,7 +946,7 @@ var systemThreadProvisioningStatusSchema = z9.enum(
946
946
  var systemThreadProvisioningEventDataSchema = z9.object({
947
947
  provisioningId: z9.string(),
948
948
  status: systemThreadProvisioningStatusSchema,
949
- environmentId: z9.string(),
949
+ environmentId: z9.string().nullable(),
950
950
  entries: z9.array(provisioningTranscriptEntrySchema)
951
951
  });
952
952
  var systemLegacyUserMessageEventDataSchema = z9.object({
@@ -1356,6 +1356,19 @@ var threadEventItemTruncationSchema = z12.object({
1356
1356
  result: threadEventTextTruncationSchema.optional(),
1357
1357
  resultText: threadEventTextTruncationSchema.optional()
1358
1358
  });
1359
+ var threadEventImageGenerationItemSchema = z12.object({
1360
+ type: z12.literal("imageGeneration"),
1361
+ id: z12.string(),
1362
+ status: threadEventItemStatusSchema,
1363
+ prompt: z12.string().nullable(),
1364
+ path: z12.string().nullable(),
1365
+ result: z12.string().optional(),
1366
+ error: z12.string().nullable(),
1367
+ transparentBackground: z12.boolean(),
1368
+ truncation: threadEventItemTruncationSchema.optional(),
1369
+ ...itemPresentationField,
1370
+ parentToolCallId: z12.string().optional()
1371
+ });
1359
1372
  var threadEventUserContentSchema = z12.discriminatedUnion("type", [
1360
1373
  z12.object({ type: z12.literal("text"), text: z12.string() }),
1361
1374
  z12.object({ type: z12.literal("image"), url: z12.string() }),
@@ -1467,6 +1480,7 @@ var threadEventItemSchema = z12.discriminatedUnion("type", [
1467
1480
  threadEventWebSearchItemSchema,
1468
1481
  threadEventWebFetchItemSchema,
1469
1482
  threadEventImageViewItemSchema,
1483
+ threadEventImageGenerationItemSchema,
1470
1484
  threadEventFileReadItemSchema,
1471
1485
  threadEventSearchItemSchema,
1472
1486
  z12.object({
@@ -2131,6 +2145,14 @@ var deltaItemShapeSchema = z15.discriminatedUnion("type", [
2131
2145
  pattern: z15.string().nullable()
2132
2146
  }),
2133
2147
  z15.object({ type: z15.literal("imageView"), path: z15.string() }),
2148
+ z15.object({
2149
+ type: z15.literal("imageGeneration"),
2150
+ prompt: z15.string().nullable(),
2151
+ path: z15.string().nullable(),
2152
+ result: z15.string().optional(),
2153
+ error: z15.string().nullable(),
2154
+ transparentBackground: z15.boolean()
2155
+ }),
2134
2156
  deltaBackgroundTaskShapeSchema,
2135
2157
  deltaFileReadShapeSchema,
2136
2158
  deltaSearchShapeSchema,
@@ -2829,6 +2851,7 @@ function createDeltaAssembler(options) {
2829
2851
  case "webSearch":
2830
2852
  case "webFetch":
2831
2853
  case "imageView":
2854
+ case "imageGeneration":
2832
2855
  case "backgroundTask":
2833
2856
  case "fileRead":
2834
2857
  case "search":
@@ -2947,6 +2970,7 @@ function createDeltaAssembler(options) {
2947
2970
  case "webSearch":
2948
2971
  case "webFetch":
2949
2972
  case "imageView":
2973
+ case "imageGeneration":
2950
2974
  case "fileRead":
2951
2975
  case "search":
2952
2976
  case "planSteps":
@@ -3057,6 +3081,20 @@ function createDeltaAssembler(options) {
3057
3081
  { type: "imageView", id: bbItemId, path: shape.path },
3058
3082
  parentToolCallId
3059
3083
  );
3084
+ case "imageGeneration":
3085
+ return withParentToolCallId(
3086
+ {
3087
+ type: "imageGeneration",
3088
+ id: bbItemId,
3089
+ status: "pending",
3090
+ prompt: shape.prompt,
3091
+ path: shape.path,
3092
+ ...shape.result === void 0 ? {} : { result: shape.result },
3093
+ error: shape.error,
3094
+ transparentBackground: shape.transparentBackground
3095
+ },
3096
+ parentToolCallId
3097
+ );
3060
3098
  case "backgroundTask":
3061
3099
  return buildBackgroundTaskItem(bbItemId, shape, parentToolCallId);
3062
3100
  case "fileRead":
@@ -3127,6 +3165,14 @@ function createDeltaAssembler(options) {
3127
3165
  { type: "contextCompaction", id: started.id },
3128
3166
  parent
3129
3167
  );
3168
+ case "imageGeneration":
3169
+ return withParentToolCallId(
3170
+ {
3171
+ ...started,
3172
+ status: close.status
3173
+ },
3174
+ parent
3175
+ );
3130
3176
  case "fileRead":
3131
3177
  return buildFileReadItem(started.id, started, close.status, parent);
3132
3178
  case "search":
@@ -3235,6 +3281,20 @@ function createDeltaAssembler(options) {
3235
3281
  },
3236
3282
  parentToolCallId
3237
3283
  );
3284
+ case "imageGeneration":
3285
+ return withParentToolCallId(
3286
+ {
3287
+ type: "imageGeneration",
3288
+ id: bbItemId,
3289
+ status: close.status,
3290
+ prompt: shape.prompt,
3291
+ path: shape.path,
3292
+ ...shape.result === void 0 ? {} : { result: shape.result },
3293
+ error: shape.error,
3294
+ transparentBackground: shape.transparentBackground
3295
+ },
3296
+ parentToolCallId
3297
+ );
3238
3298
  case "backgroundTask":
3239
3299
  return buildBackgroundTaskItem(bbItemId, shape, parentToolCallId);
3240
3300
  case "fileRead":
@@ -6831,6 +6891,7 @@ var ROW_ID_FIELDS = [
6831
6891
  "requestId",
6832
6892
  "messageId",
6833
6893
  "rowId",
6894
+ "reasoningId",
6834
6895
  "agentId",
6835
6896
  "taskId",
6836
6897
  "backgroundTaskId",
@@ -2621,7 +2621,7 @@ var systemThreadProvisioningStatusSchema = z15.enum(
2621
2621
  var systemThreadProvisioningEventDataSchema = z15.object({
2622
2622
  provisioningId: z15.string(),
2623
2623
  status: systemThreadProvisioningStatusSchema,
2624
- environmentId: z15.string(),
2624
+ environmentId: z15.string().nullable(),
2625
2625
  entries: z15.array(provisioningTranscriptEntrySchema)
2626
2626
  });
2627
2627
  var systemLegacyUserMessageEventDataSchema = z15.object({
@@ -3022,6 +3022,19 @@ var threadEventItemTruncationSchema = z18.object({
3022
3022
  result: threadEventTextTruncationSchema.optional(),
3023
3023
  resultText: threadEventTextTruncationSchema.optional()
3024
3024
  });
3025
+ var threadEventImageGenerationItemSchema = z18.object({
3026
+ type: z18.literal("imageGeneration"),
3027
+ id: z18.string(),
3028
+ status: threadEventItemStatusSchema,
3029
+ prompt: z18.string().nullable(),
3030
+ path: z18.string().nullable(),
3031
+ result: z18.string().optional(),
3032
+ error: z18.string().nullable(),
3033
+ transparentBackground: z18.boolean(),
3034
+ truncation: threadEventItemTruncationSchema.optional(),
3035
+ ...itemPresentationField,
3036
+ parentToolCallId: z18.string().optional()
3037
+ });
3025
3038
  var threadEventUserContentSchema = z18.discriminatedUnion("type", [
3026
3039
  z18.object({ type: z18.literal("text"), text: z18.string() }),
3027
3040
  z18.object({ type: z18.literal("image"), url: z18.string() }),
@@ -3133,6 +3146,7 @@ var threadEventItemSchema = z18.discriminatedUnion("type", [
3133
3146
  threadEventWebSearchItemSchema,
3134
3147
  threadEventWebFetchItemSchema,
3135
3148
  threadEventImageViewItemSchema,
3149
+ threadEventImageGenerationItemSchema,
3136
3150
  threadEventFileReadItemSchema,
3137
3151
  threadEventSearchItemSchema,
3138
3152
  z18.object({
@@ -4471,6 +4485,14 @@ var deltaItemShapeSchema = z31.discriminatedUnion("type", [
4471
4485
  pattern: z31.string().nullable()
4472
4486
  }),
4473
4487
  z31.object({ type: z31.literal("imageView"), path: z31.string() }),
4488
+ z31.object({
4489
+ type: z31.literal("imageGeneration"),
4490
+ prompt: z31.string().nullable(),
4491
+ path: z31.string().nullable(),
4492
+ result: z31.string().optional(),
4493
+ error: z31.string().nullable(),
4494
+ transparentBackground: z31.boolean()
4495
+ }),
4474
4496
  deltaBackgroundTaskShapeSchema,
4475
4497
  deltaFileReadShapeSchema,
4476
4498
  deltaSearchShapeSchema,
@@ -57,6 +57,14 @@ function requireSlotId(kind, value) {
57
57
  }
58
58
  return value;
59
59
  }
60
+ function requireEnvironmentProviderId(kind, value) {
61
+ if (typeof value !== "string" || !PLUGIN_SLOT_ID_PATTERN.test(value)) {
62
+ throw new Error(
63
+ `${kind}: "environmentProviderId" must match ${String(PLUGIN_SLOT_ID_PATTERN)}, got ${JSON.stringify(value)}`
64
+ );
65
+ }
66
+ return value;
67
+ }
60
68
  function requireProviderId(kind, value) {
61
69
  if (typeof value !== "string" || !PLUGIN_SLOT_ID_PATTERN.test(value)) {
62
70
  throw new Error(
@@ -567,6 +575,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
567
575
  commandPaletteActions: [],
568
576
  providerIcons: [],
569
577
  timelineRenderers: [],
578
+ environmentProviderInputs: [],
570
579
  contentScripts: []
571
580
  };
572
581
  sidebarFooterItemsByRegistrationSet.set(collected, sidebarFooterItems);
@@ -591,6 +600,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
591
600
  commandPaletteAction: /* @__PURE__ */ new Set(),
592
601
  providerIcon: /* @__PURE__ */ new Set(),
593
602
  timelineRenderer: /* @__PURE__ */ new Set(),
603
+ environmentProviderInputs: /* @__PURE__ */ new Set(),
594
604
  contentScript: /* @__PURE__ */ new Set()
595
605
  };
596
606
  definition.setup({
@@ -941,6 +951,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
941
951
  kind: itemKind,
942
952
  component: requireComponent(kind, registration.component)
943
953
  });
954
+ },
955
+ experimental_environmentProviderInputs(registration) {
956
+ const kind = "slots.experimental_environmentProviderInputs";
957
+ const environmentProviderId = requireEnvironmentProviderId(
958
+ kind,
959
+ registration?.environmentProviderId
960
+ );
961
+ requireUniqueId(
962
+ kind,
963
+ seenIds.environmentProviderInputs,
964
+ environmentProviderId
965
+ );
966
+ collected.environmentProviderInputs.push({
967
+ environmentProviderId,
968
+ component: requireComponent(kind, registration.component)
969
+ });
944
970
  }
945
971
  },
946
972
  experimental_sidebarFooter: new SidebarFooterCollector(
@@ -1273,6 +1299,43 @@ function TestProviderModelPicker({
1273
1299
  }
1274
1300
  );
1275
1301
  }
1302
+ function TestBranchPicker({
1303
+ hostId,
1304
+ projectId,
1305
+ value,
1306
+ onChange,
1307
+ label,
1308
+ placeholder,
1309
+ disabled
1310
+ }) {
1311
+ const inert = hostId === null || projectId === null || disabled === true;
1312
+ return /* @__PURE__ */ jsx(
1313
+ "div",
1314
+ {
1315
+ "data-testid": "bb-branch-picker",
1316
+ "data-host-id": hostId ?? "",
1317
+ "data-project-id": projectId ?? "",
1318
+ "data-disabled": inert ? "true" : "false",
1319
+ children: /* @__PURE__ */ jsx(
1320
+ "input",
1321
+ {
1322
+ "aria-label": label ?? "Branch",
1323
+ placeholder: placeholder ?? "",
1324
+ disabled: inert,
1325
+ value: value ?? "",
1326
+ onChange: (event) => {
1327
+ const next = event.target.value;
1328
+ if (next.length === 0) {
1329
+ onChange(null);
1330
+ } else {
1331
+ onChange(next);
1332
+ }
1333
+ }
1334
+ }
1335
+ )
1336
+ }
1337
+ );
1338
+ }
1276
1339
  function TestPermissionModePicker({
1277
1340
  providerId,
1278
1341
  value,
@@ -1440,6 +1503,13 @@ var testPluginSdkApp = {
1440
1503
  experimental_NewThreadComposer: TestNewThreadComposer,
1441
1504
  experimental_ProviderModelPicker: TestProviderModelPicker,
1442
1505
  experimental_PermissionModePicker: TestPermissionModePicker,
1506
+ experimental_BranchPicker: TestBranchPicker,
1507
+ experimental_useBranches() {
1508
+ return useSlotEnv("experimental_useBranches").branchesState;
1509
+ },
1510
+ experimental_useCheckoutState() {
1511
+ return useSlotEnv("experimental_useCheckoutState").checkoutState;
1512
+ },
1443
1513
  experimental_SourceCode: TestSourceCode,
1444
1514
  experimental_Diff: TestDiff,
1445
1515
  experimental_useSidebarThreads() {
@@ -1965,7 +2035,22 @@ ${block}
1965
2035
  sidebarActionCalls,
1966
2036
  sidebarPullRequests,
1967
2037
  providers,
1968
- codeTheme
2038
+ codeTheme,
2039
+ branchesState: {
2040
+ branches: options.branchesState?.branches ?? [],
2041
+ remoteBranches: options.branchesState?.remoteBranches ?? [],
2042
+ isLoading: options.branchesState?.isLoading ?? false,
2043
+ refresh: options.branchesState?.refresh ?? (() => Promise.resolve())
2044
+ },
2045
+ checkoutState: {
2046
+ isGit: true,
2047
+ unborn: false,
2048
+ detached: false,
2049
+ dirty: false,
2050
+ currentBranch: "main",
2051
+ operation: { kind: "none" },
2052
+ ...options.checkoutState
2053
+ }
1969
2054
  };
1970
2055
  const releaseComposerOwnership = () => {
1971
2056
  if (!composerOwnership.active) return;