@get-bb/plugin-sdk 0.4.9 → 0.4.11

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.
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { ReactNode, ComponentType } from 'react';
9
9
  import { RenderResult } from '@testing-library/react';
10
- import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, BbNavigate, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
10
+ import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
11
11
 
12
12
  /**
13
13
  * `@get-bb/plugin-sdk/testing/app` — the frontend plugin test harness. Tests a
@@ -59,7 +59,22 @@ type NavigateCall = {
59
59
  } | {
60
60
  method: "openThreadPanel";
61
61
  options: Parameters<BbNavigate["openThreadPanel"]>[0];
62
+ } | {
63
+ method: "experimental_openUrl";
64
+ url: string;
65
+ } | {
66
+ method: "experimental_openFilePreview";
67
+ options: ExperimentalFileOpenOptions;
68
+ } | {
69
+ method: "experimental_openFileExternally";
70
+ options: ExperimentalFileOpenOptions;
62
71
  };
72
+ interface ExperimentalFixedTabOpenCall {
73
+ surface: ExperimentalOpenFixedTabOptions<JsonValue>["surface"];
74
+ panelId: string;
75
+ tabId: string;
76
+ target?: JsonValue;
77
+ }
63
78
  interface ComposerLog {
64
79
  /** Latest plain text in this isolated composer scope. */
65
80
  readonly text: string;
@@ -186,6 +201,11 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
186
201
  * a ready, empty list. Pass `{ status: "loading" }` to test that branch.
187
202
  */
188
203
  sidebarThreads?: Partial<PluginSidebarThreadsState>;
204
+ /**
205
+ * The provider directory `experimental_useProviders()` reports. Omitted →
206
+ * a ready, empty list. Pass `{ status: "loading" }` to test that branch.
207
+ */
208
+ providers?: Partial<PluginProvidersState>;
189
209
  /**
190
210
  * Pull requests `experimental_useSidebarThreadPullRequest()` reports, keyed
191
211
  * by thread id. Omitted → every thread reports none.
@@ -193,6 +213,20 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
193
213
  sidebarPullRequests?: Record<string, PluginSidebarPullRequest>;
194
214
  /** Host acceptance for `useBbNavigate().openThreadPanel`. */
195
215
  openThreadPanel?: (options: Parameters<BbNavigate["openThreadPanel"]>[0]) => boolean;
216
+ /** Host acceptance for URL intents from the hook or `experimental_UrlLink`. */
217
+ openUrl?: (url: string) => boolean;
218
+ /** Host acceptance for preview intents from the hook or file link. */
219
+ openFilePreview?: (options: ExperimentalFileOpenOptions) => boolean;
220
+ /** Host acceptance for preferred-external file intents. */
221
+ openFileExternally?: (options: ExperimentalFileOpenOptions) => boolean;
222
+ /** Host acceptance for an owner-scoped fixed-tab selection. */
223
+ experimental_openFixedTab?: (call: ExperimentalFixedTabOpenCall) => boolean;
224
+ /** Initial session target visible to `experimental_useFixedTabTarget`. */
225
+ experimental_fixedTabTarget?: {
226
+ panelId: string;
227
+ tabId: string;
228
+ target: JsonValue;
229
+ };
196
230
  }
197
231
  /** Host-originated inputs a slot test can drive deterministically. */
198
232
  interface RenderedSlotBehaviorDrivers {
@@ -214,6 +248,8 @@ interface RenderedSlotInspectionState {
214
248
  readonly rpcCalls: RpcCall[];
215
249
  /** Every `useBbNavigate()` call, in order. */
216
250
  readonly navigateCalls: NavigateCall[];
251
+ /** Every validated `experimental_useAppPanel().openFixedTab` call. */
252
+ readonly experimental_fixedTabOpenCalls: ExperimentalFixedTabOpenCall[];
217
253
  /** Every `experimental_useSidebarThreadActions()` call, in order. */
218
254
  readonly sidebarActionCalls: SidebarActionCall[];
219
255
  /** Everything written through `useComposer()`. */
@@ -238,4 +274,4 @@ declare function renderSlot<Props extends object, Contract extends PluginRpcCont
238
274
  }, props: Props, options?: RenderSlotOptions<Contract>): RenderedSlot;
239
275
 
240
276
  export { installTestPluginRuntime, loadPluginApp, mountPluginContentScripts, renderSlot };
241
- export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SidebarActionCall };
277
+ export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, ExperimentalFixedTabOpenCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SidebarActionCall };