@get-bb/plugin-sdk 0.6.23 → 0.6.31

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,
@@ -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, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarHeaderRegistration, 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, ExperimentalSidebarNavigationItem, PluginEnvironmentProvidersState, PluginSidebarThreadActions, ExperimentalSidebarNavigationActions } 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"];
@@ -153,6 +156,7 @@ interface ComposerLog {
153
156
  interface SidebarActionCall {
154
157
  method: keyof PluginSidebarThreadActions;
155
158
  threadId?: string;
159
+ environmentId?: string;
156
160
  options?: Record<string, unknown>;
157
161
  title?: string;
158
162
  pinned?: boolean;
@@ -169,6 +173,7 @@ interface SidebarNavigationCall {
169
173
  isVisible?: boolean;
170
174
  openInSplit?: boolean;
171
175
  }
176
+ type TestClipboard = (content: ExperimentalClipboardContent) => Promise<boolean>;
172
177
  /**
173
178
  * Install the test runtime at `globalThis.__bbPluginRuntime.pluginSdkApp`,
174
179
  * plus the React the `@get-bb/plugin-sdk/app` components render through.
@@ -224,6 +229,13 @@ interface ContentScriptTestMountOptions {
224
229
  * thread-row status API. Current-host behavior is enabled by default.
225
230
  */
226
231
  omitExperimentalThreadRowStatus?: boolean;
232
+ /**
233
+ * Host result for `experimental_copyToClipboard()` writes, which are
234
+ * recorded in `inspection.experimental_clipboardWrites` until another
235
+ * mount or `renderSlot` takes the clipboard. Omitted → every write
236
+ * succeeds.
237
+ */
238
+ experimental_copyToClipboard?: TestClipboard;
227
239
  }
228
240
  interface ContentScriptThreadRowStatusCall {
229
241
  threadId: string;
@@ -236,6 +248,8 @@ interface MountedPluginContentScripts {
236
248
  readonly disposed: boolean;
237
249
  readonly threadRowStatusCalls: readonly ContentScriptThreadRowStatusCall[];
238
250
  getThreadRowStatus(threadId: string): PluginComposerThreadRowStatus | null;
251
+ /** Every `experimental_copyToClipboard()` write, in order. */
252
+ readonly experimental_clipboardWrites: readonly ExperimentalClipboardContent[];
239
253
  };
240
254
  lifecycle: {
241
255
  /** Abort, then run returned cleanup functions once in reverse order. */
@@ -304,6 +318,14 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
304
318
  * mode with no resolved document, the state a plugin sees on first paint.
305
319
  */
306
320
  codeTheme?: Partial<PluginCodeThemeState>;
321
+ /**
322
+ * Host result for `experimental_copyToClipboard()` writes, which are
323
+ * recorded in `inspection.experimental_clipboardWrites` either way. The
324
+ * clipboard is not slot-scoped: writes from anywhere (components, command
325
+ * callbacks) go to the most recently rendered slot or mounted content
326
+ * scripts. Omitted → every write succeeds.
327
+ */
328
+ experimental_copyToClipboard?: TestClipboard;
307
329
  branchesState?: Partial<BranchesState>;
308
330
  /** Checkout facts `experimental_useCheckoutState()` reports. */
309
331
  checkoutState?: Partial<CheckoutState>;
@@ -359,6 +381,8 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
359
381
  openFilePreview?: (options: ExperimentalFileOpenOptions) => boolean;
360
382
  /** Host acceptance for preferred-external file intents. */
361
383
  openFileExternally?: (options: ExperimentalFileOpenOptions) => boolean;
384
+ /** Host acceptance for `useBbNavigate().experimental_openTerminal`. */
385
+ openTerminal?: (options: Parameters<BbNavigate["experimental_openTerminal"]>[0]) => boolean;
362
386
  /** Host acceptance for an owner-scoped fixed-tab selection. */
363
387
  experimental_openFixedTab?: (call: ExperimentalFixedTabOpenCall) => boolean;
364
388
  /** Initial session target visible to `experimental_useFixedTabTarget`. */
@@ -399,6 +423,8 @@ interface RenderedSlotInspectionState {
399
423
  readonly sidebarNavigationCalls: SidebarNavigationCall[];
400
424
  /** Every `useSdk()` call, in order, as `"<area>.<method>"`. */
401
425
  readonly sdkCalls: SdkCall[];
426
+ /** Every `experimental_copyToClipboard()` write, in order. */
427
+ readonly experimental_clipboardWrites: ExperimentalClipboardContent[];
402
428
  /** Everything written through `useComposer()`. */
403
429
  readonly composer: ComposerLog;
404
430
  }