@get-bb/plugin-sdk 0.6.89 → 0.6.94

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.
@@ -1085,11 +1085,16 @@ function createTaggedKeyedQueryOwner(options) {
1085
1085
  registerKeyedView(client, queryKey, keyedRowsView(collection));
1086
1086
  const keys = /* @__PURE__ */ new Map();
1087
1087
  let readingKeys = /* @__PURE__ */ new Set();
1088
+ let collecting = false;
1088
1089
  let missingOnly = false;
1089
1090
  let refreshAll = false;
1090
1091
  const dirtyKeys = /* @__PURE__ */ new Set();
1091
- const collectSubscribedKeys = () => new Promise((resolve) => {
1092
- queueMicrotask(() => resolve([...keys.keys()]));
1092
+ const takeSubscribedKeys = (take) => new Promise((resolve) => {
1093
+ queueMicrotask(() => {
1094
+ readingKeys = new Set(take([...keys.keys()]));
1095
+ collecting = false;
1096
+ resolve([...readingKeys]);
1097
+ });
1093
1098
  });
1094
1099
  const observer = new QueryObserver(client, {
1095
1100
  queryKey,
@@ -1116,23 +1121,26 @@ function createTaggedKeyedQueryOwner(options) {
1116
1121
  const refreshedKeys = /* @__PURE__ */ new Set();
1117
1122
  let refreshedAll = false;
1118
1123
  return runTaggedRead(client, queryKey, async () => {
1119
- const subscribed = await collectSubscribedKeys();
1120
- const all = refreshAll || refresh;
1121
- refresh = false;
1122
- const dirty = new Set(dirtyKeys);
1123
- refreshedAll ||= all;
1124
- if (all)
1125
- for (const key of Object.keys(previous?.result ?? {}))
1126
- dirtyKeys.add(key);
1127
- refreshAll = false;
1128
- const requested = subscribed.filter(
1129
- (key) => all || dirty.has(key) || !Object.hasOwn(previous?.result ?? {}, key)
1130
- );
1131
- for (const key of requested) {
1132
- refreshedKeys.add(key);
1133
- dirtyKeys.delete(key);
1134
- }
1135
- readingKeys = new Set(requested);
1124
+ collecting = true;
1125
+ let all = false;
1126
+ const requested = await takeSubscribedKeys((subscribed) => {
1127
+ all = refreshAll || refresh;
1128
+ refresh = false;
1129
+ const dirty = new Set(dirtyKeys);
1130
+ refreshedAll ||= all;
1131
+ if (all)
1132
+ for (const key of Object.keys(previous?.result ?? {}))
1133
+ dirtyKeys.add(key);
1134
+ refreshAll = false;
1135
+ const taken = subscribed.filter(
1136
+ (key) => all || dirty.has(key) || !Object.hasOwn(previous?.result ?? {}, key)
1137
+ );
1138
+ for (const key of taken) {
1139
+ refreshedKeys.add(key);
1140
+ dirtyKeys.delete(key);
1141
+ }
1142
+ return taken;
1143
+ });
1136
1144
  const started = tick();
1137
1145
  try {
1138
1146
  const results = await Promise.all(
@@ -1188,6 +1196,17 @@ function createTaggedKeyedQueryOwner(options) {
1188
1196
  let stop;
1189
1197
  return {
1190
1198
  observer,
1199
+ async refresh(requested) {
1200
+ const subscribed = requested.filter((key) => keys.has(key));
1201
+ if (subscribed.length === 0) return;
1202
+ const fetching = observer.getCurrentQuery().state.fetchStatus === "fetching";
1203
+ const unread = fetching && !collecting ? subscribed.filter((key) => !readingKeys.has(key)) : subscribed;
1204
+ if (unread.length === 0) return;
1205
+ for (const key of unread) dirtyKeys.add(key);
1206
+ if (fetching && !collecting)
1207
+ restartTaggedRead(observer.getCurrentQuery());
1208
+ await observer.refetch({ cancelRefetch: false });
1209
+ },
1191
1210
  subscribe(requested, listener) {
1192
1211
  let added = false;
1193
1212
  for (const key of requested) {
@@ -1207,7 +1226,7 @@ function createTaggedKeyedQueryOwner(options) {
1207
1226
  }
1208
1227
  if (added && pending.length > 0) {
1209
1228
  if (observer.getCurrentResult().isFetching) {
1210
- if (readingKeys.size > 0 && pending.some((key) => !readingKeys.has(key)))
1229
+ if (!collecting && pending.some((key) => !readingKeys.has(key)))
1211
1230
  restartTaggedRead(observer.getCurrentQuery());
1212
1231
  } else {
1213
1232
  missingOnly = true;
@@ -1259,7 +1278,7 @@ function useQuerySelection(subscribe, getSnapshot, select) {
1259
1278
  import { QueryClient } from "@tanstack/react-query";
1260
1279
 
1261
1280
  // src/internal/rpc-query-host.ts
1262
- import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo2 } from "react";
1281
+ import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2 } from "react";
1263
1282
  import { useIsFetching } from "@tanstack/react-query";
1264
1283
 
1265
1284
  // ../domain/src/shared-types.ts
@@ -1503,11 +1522,15 @@ var projectExecutionDefaultsSchema = z2.object({
1503
1522
  permissionMode: permissionModeSchema
1504
1523
  });
1505
1524
 
1525
+ // ../domain/src/plugin-id.ts
1526
+ import { z as z3 } from "zod";
1527
+ var pluginIdSchema = z3.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
1528
+
1506
1529
  // ../domain/src/change-kinds.ts
1507
1530
  import { z as z17 } from "zod";
1508
1531
 
1509
1532
  // ../domain/src/thread-event-types.ts
1510
- import { z as z3 } from "zod";
1533
+ import { z as z4 } from "zod";
1511
1534
  var systemEventTypeValues = [
1512
1535
  "client/thread/start",
1513
1536
  "client/turn/requested",
@@ -1566,7 +1589,7 @@ var threadEventTypeValues = [
1566
1589
  ...systemEventTypeValues
1567
1590
  ];
1568
1591
  var threadEventTypeSet = new Set(threadEventTypeValues);
1569
- var threadEventTypeSchema = z3.string().refine(
1592
+ var threadEventTypeSchema = z4.string().refine(
1570
1593
  (value) => threadEventTypeSet.has(value),
1571
1594
  "Invalid thread event type"
1572
1595
  );
@@ -1575,21 +1598,21 @@ var threadEventTypeSchema = z3.string().refine(
1575
1598
  import { z as z16 } from "zod";
1576
1599
 
1577
1600
  // ../domain/src/thread-create-origin.ts
1578
- import { z as z4 } from "zod";
1601
+ import { z as z5 } from "zod";
1579
1602
  var threadCreateOriginValues = ["app", "cli", "sdk", "plugin"];
1580
- var threadCreateOriginSchema = z4.enum(threadCreateOriginValues);
1603
+ var threadCreateOriginSchema = z5.enum(threadCreateOriginValues);
1581
1604
 
1582
1605
  // ../domain/src/environment.ts
1583
- import { z as z5 } from "zod";
1584
- var environmentMachineSelectionSchema = z5.discriminatedUnion("type", [
1585
- z5.object({ type: z5.literal("existing"), hostId: z5.string().min(1) }),
1586
- z5.object({
1587
- type: z5.literal("new"),
1588
- machineProviderId: z5.string().min(1),
1606
+ import { z as z6 } from "zod";
1607
+ var environmentMachineSelectionSchema = z6.discriminatedUnion("type", [
1608
+ z6.object({ type: z6.literal("existing"), hostId: z6.string().min(1) }),
1609
+ z6.object({
1610
+ type: z6.literal("new"),
1611
+ machineProviderId: z6.string().min(1),
1589
1612
  inputs: jsonValueSchema.nullable()
1590
1613
  })
1591
1614
  ]);
1592
- var environmentProviderSelectionSchema = z5.object({
1615
+ var environmentProviderSelectionSchema = z6.object({
1593
1616
  machine: environmentMachineSelectionSchema,
1594
1617
  inputs: jsonValueSchema.nullable()
1595
1618
  });
@@ -1600,14 +1623,14 @@ var environmentStatusValues = [
1600
1623
  "error",
1601
1624
  "destroyed"
1602
1625
  ];
1603
- var environmentStatusSchema = z5.enum(environmentStatusValues);
1626
+ var environmentStatusSchema = z6.enum(environmentStatusValues);
1604
1627
  var environmentHostLifecycleValues = [
1605
1628
  "active",
1606
1629
  "removing",
1607
1630
  "cleanup-failed",
1608
1631
  "removed"
1609
1632
  ];
1610
- var environmentHostLifecycleSchema = z5.enum(
1633
+ var environmentHostLifecycleSchema = z6.enum(
1611
1634
  environmentHostLifecycleValues
1612
1635
  );
1613
1636
  var WORKSPACE_PROVISION_TYPES = [
@@ -1615,62 +1638,58 @@ var WORKSPACE_PROVISION_TYPES = [
1615
1638
  "managed-worktree",
1616
1639
  "personal"
1617
1640
  ];
1618
- var workspaceProvisionTypeSchema = z5.enum(WORKSPACE_PROVISION_TYPES);
1641
+ var workspaceProvisionTypeSchema = z6.enum(WORKSPACE_PROVISION_TYPES);
1619
1642
  var environmentWorkspaceDisplayKindValues = [
1620
1643
  "managed-worktree",
1621
1644
  "unmanaged-worktree",
1622
1645
  "other"
1623
1646
  ];
1624
- var environmentWorkspaceDisplayKindSchema = z5.enum(
1647
+ var environmentWorkspaceDisplayKindSchema = z6.enum(
1625
1648
  environmentWorkspaceDisplayKindValues
1626
1649
  );
1627
- var discoveredWorkspacePropertiesSchema = z5.object({
1628
- path: z5.string().min(1),
1629
- isGitRepo: z5.boolean(),
1630
- isWorktree: z5.boolean(),
1631
- branchName: z5.string().nullable(),
1632
- defaultBranch: z5.string().nullable()
1650
+ var discoveredWorkspacePropertiesSchema = z6.object({
1651
+ path: z6.string().min(1),
1652
+ isGitRepo: z6.boolean(),
1653
+ isWorktree: z6.boolean(),
1654
+ branchName: z6.string().nullable(),
1655
+ defaultBranch: z6.string().nullable()
1633
1656
  });
1634
- var environmentLifecycleSchema = z5.object({
1635
- phase: z5.enum(["active", "retiring", "teardown", "destroyed"]),
1636
- retireAt: z5.number().nullable(),
1637
- teardown: z5.object({
1638
- status: z5.enum(["running", "failed", "removed"]),
1639
- attempt: z5.number().int().nonnegative(),
1640
- message: z5.string().optional()
1657
+ var environmentLifecycleSchema = z6.object({
1658
+ phase: z6.enum(["active", "retiring", "teardown", "destroyed"]),
1659
+ retireAt: z6.number().nullable(),
1660
+ teardown: z6.object({
1661
+ status: z6.enum(["running", "failed", "removed"]),
1662
+ attempt: z6.number().int().nonnegative(),
1663
+ message: z6.string().optional()
1641
1664
  }).nullable()
1642
1665
  });
1643
- var environmentSchema = z5.object({
1644
- id: z5.string(),
1645
- name: z5.string().nullable(),
1646
- projectId: z5.string(),
1647
- hostId: z5.string(),
1648
- path: z5.string().nullable(),
1649
- isGitRepo: z5.boolean(),
1650
- isWorktree: z5.boolean(),
1651
- branchName: z5.string().nullable(),
1652
- baseBranch: z5.string().nullable(),
1653
- defaultBranch: z5.string().nullable(),
1654
- mergeBaseBranch: z5.string().nullable(),
1666
+ var environmentSchema = z6.object({
1667
+ id: z6.string(),
1668
+ name: z6.string().nullable(),
1669
+ projectId: z6.string(),
1670
+ hostId: z6.string(),
1671
+ path: z6.string().nullable(),
1672
+ isGitRepo: z6.boolean(),
1673
+ isWorktree: z6.boolean(),
1674
+ branchName: z6.string().nullable(),
1675
+ baseBranch: z6.string().nullable(),
1676
+ defaultBranch: z6.string().nullable(),
1677
+ mergeBaseBranch: z6.string().nullable(),
1655
1678
  status: environmentStatusSchema,
1656
- environmentProviderId: z5.string().nullable(),
1679
+ environmentProviderId: z6.string().nullable(),
1657
1680
  lifecycle: environmentLifecycleSchema,
1658
1681
  hostLifecycle: environmentHostLifecycleSchema,
1659
1682
  environmentProviderSelection: environmentProviderSelectionSchema.nullable(),
1660
- environmentProviderInstanceKey: z5.string().nullable(),
1661
- managed: z5.boolean(),
1683
+ environmentProviderInstanceKey: z6.string().nullable(),
1684
+ managed: z6.boolean(),
1662
1685
  workspaceProvisionType: workspaceProvisionTypeSchema.nullable(),
1663
- createdAt: z5.number(),
1664
- updatedAt: z5.number()
1686
+ createdAt: z6.number(),
1687
+ updatedAt: z6.number()
1665
1688
  });
1666
1689
 
1667
1690
  // ../domain/src/queued-message.ts
1668
1691
  import { z as z9 } from "zod";
1669
1692
 
1670
- // ../domain/src/plugin-id.ts
1671
- import { z as z6 } from "zod";
1672
- var pluginIdSchema = z6.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
1673
-
1674
1693
  // ../domain/src/protocol-ids.ts
1675
1694
  import { z as z7 } from "zod";
1676
1695
  var clientTurnRequestIdSchema = z7.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
@@ -2277,6 +2296,8 @@ var rpcQueryKey = (pluginId, method, input) => [
2277
2296
  input
2278
2297
  ];
2279
2298
  var keyedQueryKey = (pluginId, method) => rpcQueryKey(pluginId, method, { keyed: true });
2299
+ var keyListSchema = z19.array(z19.string());
2300
+ var jsonRecordSchema = z19.record(z19.string(), jsonValueSchema);
2280
2301
  var keyedCollections = /* @__PURE__ */ new Map();
2281
2302
  function keyedCollection(pluginId, method) {
2282
2303
  const name = JSON.stringify([pluginId, method]);
@@ -2411,7 +2432,7 @@ function createRpcQueryHooks(useHost) {
2411
2432
  const enabled = options.enabled ?? true;
2412
2433
  const identity = JSON.stringify([...new Set(options.keys)].sort());
2413
2434
  const keys = useMemo2(
2414
- () => z19.array(z19.string()).parse(JSON.parse(identity)),
2435
+ () => keyListSchema.parse(JSON.parse(identity)),
2415
2436
  [identity]
2416
2437
  );
2417
2438
  let cache = owners.get(host.queryClient);
@@ -2437,7 +2458,7 @@ function createRpcQueryHooks(useHost) {
2437
2458
  );
2438
2459
  return {
2439
2460
  ...response,
2440
- result: z19.record(z19.string(), jsonValueSchema).parse(response.result)
2461
+ result: jsonRecordSchema.parse(response.result)
2441
2462
  };
2442
2463
  }
2443
2464
  });
@@ -2446,8 +2467,7 @@ function createRpcQueryHooks(useHost) {
2446
2467
  const current = owner;
2447
2468
  useSubscription(host, pluginId, enabled && keys.length > 0);
2448
2469
  const subscribe = useCallback2(
2449
- (listener) => enabled && keys.length > 0 ? current.subscribe(keys, listener) : () => {
2450
- },
2470
+ (listener) => current.subscribe(enabled ? keys : [], listener),
2451
2471
  [current, keys, enabled]
2452
2472
  );
2453
2473
  const getSnapshot = useCallback2(
@@ -2474,21 +2494,46 @@ function createRpcQueryHooks(useHost) {
2474
2494
  [keys, enabled, selectRows]
2475
2495
  );
2476
2496
  const query = useQuerySelection(subscribe, getSnapshot, select);
2497
+ const watches = useMemo2(
2498
+ () => /* @__PURE__ */ new Map(),
2499
+ [host, pluginId, options.method]
2500
+ );
2501
+ useEffect2(
2502
+ () => () => {
2503
+ for (const release of watches.values()) release?.();
2504
+ watches.clear();
2505
+ },
2506
+ [watches]
2507
+ );
2477
2508
  useEffect2(() => {
2478
- if (!enabled) return;
2479
- const releases = keys.map(
2480
- (key) => host.watch?.(pluginId, options.method, { key })
2481
- );
2482
- return () => {
2483
- releases.forEach((release) => release?.());
2484
- };
2485
- }, [host, pluginId, options.method, keys, enabled]);
2509
+ const wanted = new Set(enabled ? keys : []);
2510
+ for (const [key, release] of watches) {
2511
+ if (wanted.has(key)) continue;
2512
+ release?.();
2513
+ watches.delete(key);
2514
+ }
2515
+ for (const key of wanted) {
2516
+ if (!watches.has(key))
2517
+ watches.set(key, host.watch?.(pluginId, options.method, { key }));
2518
+ }
2519
+ }, [host, pluginId, options.method, keys, enabled, watches]);
2520
+ const heldKeys = useRef2(keys);
2521
+ useEffect2(() => {
2522
+ heldKeys.current = keys;
2523
+ }, [keys]);
2486
2524
  const refetch = useCallback2(async () => {
2487
- await current.observer.refetch();
2525
+ await current.refresh(heldKeys.current);
2488
2526
  }, [current]);
2527
+ const refetchKeys = useCallback2(
2528
+ async (requested) => {
2529
+ await current.refresh(requested.filter((key) => keys.includes(key)));
2530
+ },
2531
+ [current, keys]
2532
+ );
2489
2533
  return {
2490
2534
  ...query,
2491
- refetch
2535
+ refetch,
2536
+ refetchKeys
2492
2537
  };
2493
2538
  }
2494
2539
  function experimental_useRpcMutation(options) {
@@ -2496,6 +2541,7 @@ function createRpcQueryHooks(useHost) {
2496
2541
  const pluginId = resolvePluginId(host, options.pluginId);
2497
2542
  const mutation = useTaggedMutation({
2498
2543
  client: host.queryClient,
2544
+ meta: { showErrorToast: false },
2499
2545
  invalidate: (tags) => invalidateTags(host.queryClient, pluginTagScope(pluginId), tags),
2500
2546
  call: async (input) => {
2501
2547
  const response = await callRpc(
@@ -2569,7 +2615,7 @@ import {
2569
2615
  useLayoutEffect,
2570
2616
  useEffect as useEffect3,
2571
2617
  useMemo as useMemo3,
2572
- useRef as useRef2,
2618
+ useRef as useRef3,
2573
2619
  useState as useState2,
2574
2620
  useSyncExternalStore as useSyncExternalStore2
2575
2621
  } from "react";
@@ -3808,6 +3854,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
3808
3854
  threadHeaderActions: [],
3809
3855
  threadContextSegments: [],
3810
3856
  threadInfoRows: [],
3857
+ threadRowMetadata: [],
3811
3858
  threadInfoSections: [],
3812
3859
  threadActions: [],
3813
3860
  browserToolbarActions: [],
@@ -3844,6 +3891,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
3844
3891
  threadHeaderAction: /* @__PURE__ */ new Set(),
3845
3892
  threadContextSegment: /* @__PURE__ */ new Set(),
3846
3893
  threadInfoRow: /* @__PURE__ */ new Set(),
3894
+ threadRowMetadata: /* @__PURE__ */ new Set(),
3847
3895
  threadInfoSection: /* @__PURE__ */ new Set(),
3848
3896
  threadAction: /* @__PURE__ */ new Set(),
3849
3897
  browserToolbarAction: /* @__PURE__ */ new Set(),
@@ -3964,6 +4012,16 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
3964
4012
  onWarning(`Legacy threadPanelAction ignored: ${String(error)}`);
3965
4013
  }
3966
4014
  },
4015
+ experimental_threadHeaderAction(registration) {
4016
+ const kind = "slots.experimental_threadHeaderAction";
4017
+ const id = requireSlotId(kind, registration?.id);
4018
+ requireUniqueId(kind, seenIds.threadHeaderAction, id);
4019
+ collected.threadHeaderActions.push({
4020
+ id,
4021
+ title: requireNonEmptyString(kind, "title", registration.title),
4022
+ component: requireComponent(kind, registration.component)
4023
+ });
4024
+ },
3967
4025
  experimental_sidebarHeader(registration) {
3968
4026
  legacySidebarHeaders.push(
3969
4027
  collectTitledComponent(
@@ -4169,16 +4227,6 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
4169
4227
  ...headerComponent !== void 0 ? { headerComponent } : {}
4170
4228
  });
4171
4229
  },
4172
- experimental_threadHeaderAction(registration) {
4173
- const kind = "slots.experimental_threadHeaderAction";
4174
- const id = requireSlotId(kind, registration?.id);
4175
- requireUniqueId(kind, seenIds.threadHeaderAction, id);
4176
- collected.threadHeaderActions.push({
4177
- id,
4178
- title: requireNonEmptyString(kind, "title", registration.title),
4179
- component: requireComponent(kind, registration.component)
4180
- });
4181
- },
4182
4230
  experimental_threadContextSegment(registration) {
4183
4231
  const kind = "slots.experimental_threadContextSegment";
4184
4232
  const id = requireSlotId(kind, registration?.id);
@@ -4212,6 +4260,19 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
4212
4260
  ...registration.useVisible !== void 0 ? { useVisible: registration.useVisible } : {}
4213
4261
  });
4214
4262
  },
4263
+ experimental_threadRowMetadata(registration) {
4264
+ const kind = "slots.experimental_threadRowMetadata";
4265
+ const id = requireSlotId(kind, registration?.id);
4266
+ requireUniqueId(kind, seenIds.threadRowMetadata, id);
4267
+ if (registration.useData !== void 0 && typeof registration.useData !== "function")
4268
+ throw new Error(`${kind}: "useData" must be a function`);
4269
+ collected.threadRowMetadata.push({
4270
+ id,
4271
+ ...requireOptionalOrder(kind, registration.order),
4272
+ ...registration.useData !== void 0 ? { useData: registration.useData } : {},
4273
+ component: requireComponent(kind, registration.component)
4274
+ });
4275
+ },
4215
4276
  experimental_threadInfoRow(registration) {
4216
4277
  const kind = "slots.experimental_threadInfoRow";
4217
4278
  const id = requireSlotId(kind, registration?.id);
@@ -4249,12 +4310,16 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
4249
4310
  `${kind}: "experimental_bulkItem" must be a function`
4250
4311
  );
4251
4312
  }
4313
+ if (registration.placement !== void 0 && registration.placement !== "menu" && registration.placement !== "header") {
4314
+ throw new Error(`${kind}: "placement" must be "menu" or "header"`);
4315
+ }
4252
4316
  collected.threadActions.push({
4253
4317
  id,
4254
4318
  title: requireNonEmptyString(kind, "title", registration.title),
4255
4319
  icon: requireNonEmptyString(kind, "icon", registration.icon),
4256
4320
  group: requireNonEmptyString(kind, "group", registration.group),
4257
4321
  ...requireOptionalOrder(kind, registration.order),
4322
+ ...registration.placement !== void 0 ? { placement: registration.placement } : {},
4258
4323
  ...registration.useData !== void 0 ? { useData: registration.useData } : {},
4259
4324
  item: registration.item,
4260
4325
  ...registration.experimental_bulkItem !== void 0 ? {
@@ -4612,6 +4677,9 @@ function TestThreadStatusGlyph({
4612
4677
  }
4613
4678
  );
4614
4679
  }
4680
+ function TestThreadRowMetadata({ thread }) {
4681
+ return /* @__PURE__ */ jsx("span", { "data-thread-row-metadata": thread.id });
4682
+ }
4615
4683
  function SlotLifecycleGuard({
4616
4684
  children,
4617
4685
  onUnmount
@@ -4720,7 +4788,7 @@ function TestThreadActionsMenu({
4720
4788
  onCloseAutoFocus
4721
4789
  }) {
4722
4790
  const menu = useTestMenuOpenState({ onOpenChange, onCloseAutoFocus });
4723
- const triggerElement = useRef2(null);
4791
+ const triggerElement = useRef3(null);
4724
4792
  useLayoutEffect(() => {
4725
4793
  const element = triggerElement.current;
4726
4794
  if (element?.getAttribute("aria-haspopup") !== "menu") {
@@ -5399,6 +5467,8 @@ function captureClipboardWrites(result) {
5399
5467
  return writes;
5400
5468
  }
5401
5469
  var testPluginSdkApp = {
5470
+ experimental_getApplicationLinkApprovals: async () => [],
5471
+ experimental_revokeApplicationLinkApproval: async (_scheme) => [],
5402
5472
  definePluginApp,
5403
5473
  ...createRpcQueryHooks(() => useSlotEnv("rpc query").rpcQueryHost),
5404
5474
  useRpc() {
@@ -5406,7 +5476,7 @@ var testPluginSdkApp = {
5406
5476
  },
5407
5477
  useRealtime(channel, handler) {
5408
5478
  const env = useSlotEnv("useRealtime");
5409
- const handlerRef = useRef2(handler);
5479
+ const handlerRef = useRef3(handler);
5410
5480
  useEffect3(() => {
5411
5481
  handlerRef.current = handler;
5412
5482
  });
@@ -5567,6 +5637,9 @@ var testPluginSdkApp = {
5567
5637
  "experimental_useCanOpenFileExternally"
5568
5638
  ).canOpenFileExternally(target);
5569
5639
  },
5640
+ experimental_useTabVisible() {
5641
+ return useSlotEnv("experimental_useTabVisible").tabVisible;
5642
+ },
5570
5643
  experimental_copyToClipboard(content) {
5571
5644
  return activeClipboard?.(content) ?? Promise.resolve(true);
5572
5645
  },
@@ -5669,6 +5742,7 @@ var testPluginSdkApp = {
5669
5742
  },
5670
5743
  ThreadTitle: TestThreadTitle,
5671
5744
  experimental_ThreadStatusGlyph: TestThreadStatusGlyph,
5745
+ experimental_ThreadRowMetadata: TestThreadRowMetadata,
5672
5746
  useEnvironmentProviders() {
5673
5747
  return useSlotEnv("useEnvironmentProviders").environmentProviders;
5674
5748
  },
@@ -6537,6 +6611,7 @@ ${block}
6537
6611
  providers,
6538
6612
  codeTheme,
6539
6613
  canOpenFileExternally: options.canOpenFileExternally ?? (() => false),
6614
+ tabVisible: options.tabVisible ?? true,
6540
6615
  branchesState: {
6541
6616
  branches: options.branchesState?.branches ?? [],
6542
6617
  remoteBranches: options.branchesState?.remoteBranches ?? [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.89",
3
+ "version": "0.6.94",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"
@@ -151,9 +151,9 @@
151
151
  "scripts": {
152
152
  "build": "node scripts/build-runtime.mjs",
153
153
  "build:runtime": "node scripts/build-runtime.mjs",
154
- "build:types": "node scripts/build-bundled-dts.mjs",
154
+ "build:types": "node --max-semi-space-size=128 --max-old-space-size=4096 scripts/build-bundled-dts.mjs",
155
155
  "clean": "rimraf bundled-types dist tsconfig.tsbuildinfo",
156
- "prepack": "node scripts/build-bundled-dts.mjs && node scripts/build-runtime.mjs",
156
+ "prepack": "node --max-semi-space-size=128 --max-old-space-size=4096 scripts/build-bundled-dts.mjs && node scripts/build-runtime.mjs",
157
157
  "test": "vitest run --config vitest.config.ts",
158
158
  "typecheck": "tsrs --noEmit"
159
159
  },