@get-bb/plugin-sdk 0.6.26 → 0.6.33

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.
@@ -628,7 +628,7 @@ interface ProcessWithCwd {
628
628
  cwd: string;
629
629
  }
630
630
  interface KillProcessesWithCwdUnderArgs {
631
- directory: string;
631
+ directories: readonly string[];
632
632
  graceMs?: number;
633
633
  }
634
634
  declare function killProcessesWithCwdUnder(args: KillProcessesWithCwdUnderArgs): Promise<ProcessWithCwd[]>;
@@ -639,5 +639,32 @@ interface SanitizeInheritedChildProcessEnvArgs {
639
639
  }
640
640
  declare function sanitizeInheritedChildProcessEnv(args: SanitizeInheritedChildProcessEnvArgs): NodeJS.ProcessEnv;
641
641
 
642
- export { experimental_defineHostEntry, experimental_filterResolvedNativeRoots, killProcessesWithCwdUnder as experimental_killProcessesWithCwdUnder, experimental_nativeRootsHostContract, experimental_nativeRootsResolveInputSchema, experimental_nativeRootsResolveOutputSchema, experimental_resolveClaudePluginRoots, experimental_resolveVendorPluginRoots, sanitizeInheritedChildProcessEnv as experimental_sanitizeInheritedChildProcessEnv, spawnPortableOutputProcess as experimental_spawnPortableOutputProcess };
643
- export type { ExperimentalClaudePluginRoots, ExperimentalClaudePluginRootsArgs, ExperimentalDroppedNativeRoot, ExperimentalFilteredNativeRoots, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalNativeRootsHostContract, ExperimentalNativeRootsResolveAnswer, ExperimentalNativeRootsResolveInput, ExperimentalNativeRootsResolveOutput, SanitizeInheritedChildProcessEnvArgs as ExperimentalSanitizeInheritedChildProcessEnvArgs, ExperimentalVendorPlugin, ExperimentalVendorPluginRoots, ExperimentalVendorPluginRootsArgs };
642
+ /**
643
+ * Kills every process whose working directory is at or under any of `directories`,
644
+ * SIGTERM first and SIGKILL after the grace, for a provider tearing down a
645
+ * workspace it made. Plugins built against SDK 0.6.26 or earlier that still pass
646
+ * `{ directory }` keep working at runtime. Experimental: see docs/api_to_audit.md.
647
+ */
648
+ declare function experimental_killProcessesWithCwdUnder(args: Parameters<typeof killProcessesWithCwdUnder>[0]): ReturnType<typeof killProcessesWithCwdUnder>;
649
+
650
+ /**
651
+ * What the operating system reports about a running process. `command` is its
652
+ * full command line, or null when the OS does not expose it. `startedAt` is its
653
+ * start time in epoch milliseconds, accurate to about a second on POSIX, or null
654
+ * when it cannot be read.
655
+ */
656
+ interface ExperimentalProcessIdentity {
657
+ command: string | null;
658
+ startedAt: number | null;
659
+ }
660
+ /**
661
+ * Reads a running process's command line and approximate start time, or null
662
+ * when the process is gone or cannot be inspected, so a host entry can confirm
663
+ * a recorded PID still belongs to the process it launched before signalling
664
+ * it. Uses `ps` on POSIX and PowerShell CIM on Windows. Experimental: see
665
+ * docs/api_to_audit.md.
666
+ */
667
+ declare function experimental_readProcessIdentity(pid: number): Promise<ExperimentalProcessIdentity | null>;
668
+
669
+ export { experimental_defineHostEntry, experimental_filterResolvedNativeRoots, experimental_killProcessesWithCwdUnder, experimental_nativeRootsHostContract, experimental_nativeRootsResolveInputSchema, experimental_nativeRootsResolveOutputSchema, experimental_readProcessIdentity, experimental_resolveClaudePluginRoots, experimental_resolveVendorPluginRoots, sanitizeInheritedChildProcessEnv as experimental_sanitizeInheritedChildProcessEnv, spawnPortableOutputProcess as experimental_spawnPortableOutputProcess };
670
+ export type { ExperimentalClaudePluginRoots, ExperimentalClaudePluginRootsArgs, ExperimentalDroppedNativeRoot, ExperimentalFilteredNativeRoots, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalNativeRootsHostContract, ExperimentalNativeRootsResolveAnswer, ExperimentalNativeRootsResolveInput, ExperimentalNativeRootsResolveOutput, ExperimentalProcessIdentity, SanitizeInheritedChildProcessEnvArgs as ExperimentalSanitizeInheritedChildProcessEnvArgs, ExperimentalVendorPlugin, ExperimentalVendorPluginRoots, ExperimentalVendorPluginRootsArgs };
@@ -1164,7 +1164,7 @@ interface PluginInteractionRequest {
1164
1164
  rendererId: string;
1165
1165
  title: string;
1166
1166
  payload: JsonValue;
1167
- /** Defaults to ten minutes; capped at one hour. */
1167
+ /** Defaults to ten minutes; capped at seven days. */
1168
1168
  timeoutMs?: number;
1169
1169
  /**
1170
1170
  * How the form reads as a timeline row while it waits and once it settles,
@@ -6,7 +6,7 @@
6
6
  // and read the real source: https://github.com/get-bb/bb
7
7
 
8
8
  import { z } from 'zod';
9
- import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarHeaderRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandRegistration, ExperimentalComposerCommandRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
9
+ import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandRegistration, ExperimentalComposerCommandRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
10
10
 
11
11
  type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
12
12
  interface ExperimentalSidebarFooterRuntimeSnapshot {
@@ -68,8 +68,6 @@ interface CollectedPluginAppRegistrations {
68
68
  pendingInteractions: PluginPendingInteractionRegistration[];
69
69
  sidebarFooterActions: PluginSidebarFooterActionRegistration[];
70
70
  experimentalSidebarFooterItems: CollectedExperimentalSidebarFooterItem[];
71
- experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
72
- experimentalSidebarHeaders: ExperimentalSidebarHeaderRegistration[];
73
71
  threadLists: PluginThreadListRegistration[];
74
72
  threadHeaderActions: PluginThreadHeaderActionRegistration[];
75
73
  browserToolbarActions: ExperimentalPluginBrowserToolbarActionRegistration[];
@@ -4084,6 +4084,7 @@ declare const providerHealthSchema: z.ZodObject<{
4084
4084
  canInstall: z.ZodBoolean;
4085
4085
  canUpdate: z.ZodBoolean;
4086
4086
  installedVersion: z.ZodNullable<z.ZodString>;
4087
+ localLoginCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4087
4088
  loginCommand: z.ZodNullable<z.ZodString>;
4088
4089
  minimumSupportedVersion: z.ZodNullable<z.ZodString>;
4089
4090
  planLabel: z.ZodNullable<z.ZodString>;
@@ -4142,6 +4143,7 @@ declare const providerHealthResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4142
4143
  canInstall: z.ZodBoolean;
4143
4144
  canUpdate: z.ZodBoolean;
4144
4145
  installedVersion: z.ZodNullable<z.ZodString>;
4146
+ localLoginCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4145
4147
  loginCommand: z.ZodNullable<z.ZodString>;
4146
4148
  minimumSupportedVersion: z.ZodNullable<z.ZodString>;
4147
4149
  planLabel: z.ZodNullable<z.ZodString>;
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { ReactNode, ComponentType } from 'react';
9
9
  import { RenderResult } from '@testing-library/react';
10
- import { ExperimentalSidebarFooterItemRegistration, PluginProviderIconRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarHeaderRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, ComposerDraftSnapshot, PluginComposerScope, ComposerSelection, PluginComposerTextEffect, PluginComposerMention, ComposerSubmitOptions, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginBrowserBbSdk, PluginRealtimeConnectionState, ComposerMention, ComposerAttachment, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarSplitLayout, ExperimentalSidebarNavigationItem, PluginEnvironmentProvidersState, PluginSidebarThreadActions, ExperimentalSidebarNavigationActions } from '@get-bb/plugin-sdk';
10
+ import { ExperimentalSidebarFooterItemRegistration, PluginProviderIconRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, ComposerDraftSnapshot, PluginComposerScope, ComposerSelection, PluginComposerTextEffect, PluginComposerMention, ComposerSubmitOptions, ExperimentalClipboardContent, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginBrowserBbSdk, PluginRealtimeConnectionState, ComposerMention, ComposerAttachment, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarSplitLayout, PluginEnvironmentProvidersState, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
11
11
 
12
12
  type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
13
13
  interface ExperimentalSidebarFooterRuntimeSnapshot {
@@ -102,6 +102,9 @@ type NavigateCall = {
102
102
  } | {
103
103
  method: "experimental_openFileExternally";
104
104
  options: ExperimentalFileOpenOptions;
105
+ } | {
106
+ method: "experimental_openTerminal";
107
+ options: Parameters<BbNavigate["experimental_openTerminal"]>[0];
105
108
  };
106
109
  interface ExperimentalFixedTabOpenCall {
107
110
  surface: ExperimentalOpenFixedTabOptions<JsonValue>["surface"];
@@ -159,17 +162,7 @@ interface SidebarActionCall {
159
162
  pinned?: boolean;
160
163
  read?: boolean;
161
164
  }
162
- /**
163
- * One recorded `experimental_useSidebarNavigation()` action, or a split drag
164
- * started from `experimental_useSidebarNavigationSplit()` (`beginSplitDrag`).
165
- */
166
- interface SidebarNavigationCall {
167
- method: keyof ExperimentalSidebarNavigationActions | "beginSplitDrag";
168
- itemId?: string;
169
- itemIds?: string[];
170
- isVisible?: boolean;
171
- openInSplit?: boolean;
172
- }
165
+ type TestClipboard = (content: ExperimentalClipboardContent) => Promise<boolean>;
173
166
  /**
174
167
  * Install the test runtime at `globalThis.__bbPluginRuntime.pluginSdkApp`,
175
168
  * plus the React the `@get-bb/plugin-sdk/app` components render through.
@@ -189,8 +182,6 @@ interface CapturedPluginApp {
189
182
  pendingInteractions: PluginPendingInteractionRegistration[];
190
183
  sidebarFooterActions: PluginSidebarFooterActionRegistration[];
191
184
  experimentalSidebarFooterItems: CollectedExperimentalSidebarFooterItem[];
192
- experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
193
- experimentalSidebarHeaders: ExperimentalSidebarHeaderRegistration[];
194
185
  threadLists: PluginThreadListRegistration[];
195
186
  threadHeaderActions: PluginThreadHeaderActionRegistration[];
196
187
  browserToolbarActions: ExperimentalPluginBrowserToolbarActionRegistration[];
@@ -225,6 +216,13 @@ interface ContentScriptTestMountOptions {
225
216
  * thread-row status API. Current-host behavior is enabled by default.
226
217
  */
227
218
  omitExperimentalThreadRowStatus?: boolean;
219
+ /**
220
+ * Host result for `experimental_copyToClipboard()` writes, which are
221
+ * recorded in `inspection.experimental_clipboardWrites` until another
222
+ * mount or `renderSlot` takes the clipboard. Omitted → every write
223
+ * succeeds.
224
+ */
225
+ experimental_copyToClipboard?: TestClipboard;
228
226
  }
229
227
  interface ContentScriptThreadRowStatusCall {
230
228
  threadId: string;
@@ -237,6 +235,8 @@ interface MountedPluginContentScripts {
237
235
  readonly disposed: boolean;
238
236
  readonly threadRowStatusCalls: readonly ContentScriptThreadRowStatusCall[];
239
237
  getThreadRowStatus(threadId: string): PluginComposerThreadRowStatus | null;
238
+ /** Every `experimental_copyToClipboard()` write, in order. */
239
+ readonly experimental_clipboardWrites: readonly ExperimentalClipboardContent[];
240
240
  };
241
241
  lifecycle: {
242
242
  /** Abort, then run returned cleanup functions once in reverse order. */
@@ -305,6 +305,14 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
305
305
  * mode with no resolved document, the state a plugin sees on first paint.
306
306
  */
307
307
  codeTheme?: Partial<PluginCodeThemeState>;
308
+ /**
309
+ * Host result for `experimental_copyToClipboard()` writes, which are
310
+ * recorded in `inspection.experimental_clipboardWrites` either way. The
311
+ * clipboard is not slot-scoped: writes from anywhere (components, command
312
+ * callbacks) go to the most recently rendered slot or mounted content
313
+ * scripts. Omitted → every write succeeds.
314
+ */
315
+ experimental_copyToClipboard?: TestClipboard;
308
316
  branchesState?: Partial<BranchesState>;
309
317
  /** Checkout facts `experimental_useCheckoutState()` reports. */
310
318
  checkoutState?: Partial<CheckoutState>;
@@ -331,16 +339,6 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
331
339
  sidebarShortcuts?: Record<string, PluginSidebarThreadShortcut>;
332
340
  /** The split layout `useSidebarSplitLayout()` reports. Omitted → null. */
333
341
  sidebarSplitLayout?: PluginSidebarSplitLayout;
334
- /**
335
- * Items and the active item `experimental_useSidebarNavigation()` reports.
336
- * Omitted → no items. Actions are recorded in
337
- * `inspection.sidebarNavigationCalls` and do not change the items.
338
- */
339
- sidebarNavigation?: {
340
- items?: readonly ExperimentalSidebarNavigationItem[];
341
- activeItemId?: string | null;
342
- isShortcutModifierHeld?: boolean;
343
- };
344
342
  /**
345
343
  * The environment provider catalog `useEnvironmentProviders()` reports.
346
344
  * Omitted → a ready, empty list. Pass `{ status: "loading" }` to test that
@@ -360,6 +358,8 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
360
358
  openFilePreview?: (options: ExperimentalFileOpenOptions) => boolean;
361
359
  /** Host acceptance for preferred-external file intents. */
362
360
  openFileExternally?: (options: ExperimentalFileOpenOptions) => boolean;
361
+ /** Host acceptance for `useBbNavigate().experimental_openTerminal`. */
362
+ openTerminal?: (options: Parameters<BbNavigate["experimental_openTerminal"]>[0]) => boolean;
363
363
  /** Host acceptance for an owner-scoped fixed-tab selection. */
364
364
  experimental_openFixedTab?: (call: ExperimentalFixedTabOpenCall) => boolean;
365
365
  /** Initial session target visible to `experimental_useFixedTabTarget`. */
@@ -393,13 +393,10 @@ interface RenderedSlotInspectionState {
393
393
  readonly experimental_fixedTabOpenCalls: ExperimentalFixedTabOpenCall[];
394
394
  /** Every `experimental_useSidebarThreadActions()` call, in order. */
395
395
  readonly sidebarActionCalls: SidebarActionCall[];
396
- /**
397
- * Every `experimental_useSidebarNavigation()` action and navigation split
398
- * drag, in order.
399
- */
400
- readonly sidebarNavigationCalls: SidebarNavigationCall[];
401
396
  /** Every `useSdk()` call, in order, as `"<area>.<method>"`. */
402
397
  readonly sdkCalls: SdkCall[];
398
+ /** Every `experimental_copyToClipboard()` write, in order. */
399
+ readonly experimental_clipboardWrites: ExperimentalClipboardContent[];
403
400
  /** Everything written through `useComposer()`. */
404
401
  readonly composer: ComposerLog;
405
402
  }
@@ -422,4 +419,4 @@ declare function renderSlot<Props extends object, Contract extends PluginRpcCont
422
419
  }, props: Props, options?: RenderSlotOptions<Contract>): RenderedSlot;
423
420
 
424
421
  export { installTestPluginRuntime, loadPluginApp, mountPluginContentScripts, renderSlot };
425
- export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, ExperimentalFixedTabOpenCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, PluginSdkTestFakes, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SdkCall, SidebarActionCall, SidebarNavigationCall };
422
+ export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, ExperimentalFixedTabOpenCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, PluginSdkTestFakes, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SdkCall, SidebarActionCall };