@get-bb/plugin-sdk 0.6.31 → 0.6.37
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.
- package/bundled-types/bb-plugin-sdk-app.d.ts +648 -355
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +4 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +10 -0
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +12 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +16 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +27 -40
- package/bundled-types/bb-plugin-sdk.d.ts +650 -354
- package/dist/app.js +33 -12
- package/dist/index.js +9 -0
- package/dist/internal/composer-handle.js +1 -0
- package/dist/internal/host-policy.js +11 -0
- package/dist/internal/plugin-app-collector.js +25 -22
- package/dist/provider-bridge-acp.js +5 -0
- package/dist/provider-bridge-testing.js +5 -0
- package/dist/provider-bridge.js +5 -0
- package/dist/testing/app.js +241 -93
- package/dist/testing/index.js +12 -0
- package/package.json +1 -1
|
@@ -165,6 +165,10 @@ type ComposerMention = {
|
|
|
165
165
|
source: "command" | "skill";
|
|
166
166
|
origin: "builtin" | "project" | "user";
|
|
167
167
|
argumentHint: string | null;
|
|
168
|
+
} | {
|
|
169
|
+
kind: "attachment";
|
|
170
|
+
/** The stored path of a file attached to the same draft. */
|
|
171
|
+
path: string;
|
|
168
172
|
} | {
|
|
169
173
|
kind: "plugin";
|
|
170
174
|
/** The plugin that owns the pill. */
|
|
@@ -263,6 +263,10 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
263
263
|
kind: z.ZodLiteral<"plugin">;
|
|
264
264
|
label: z.ZodString;
|
|
265
265
|
pluginId: z.ZodString;
|
|
266
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
267
|
+
kind: z.ZodLiteral<"attachment">;
|
|
268
|
+
label: z.ZodString;
|
|
269
|
+
path: z.ZodString;
|
|
266
270
|
}, z.core.$strip>], "kind">, unknown>;
|
|
267
271
|
start: z.ZodNumber;
|
|
268
272
|
}, z.core.$strip>>>;
|
|
@@ -375,6 +379,10 @@ declare const threadQueuedMessageSchema: z.ZodObject<{
|
|
|
375
379
|
kind: z.ZodLiteral<"plugin">;
|
|
376
380
|
label: z.ZodString;
|
|
377
381
|
pluginId: z.ZodString;
|
|
382
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
383
|
+
kind: z.ZodLiteral<"attachment">;
|
|
384
|
+
label: z.ZodString;
|
|
385
|
+
path: z.ZodString;
|
|
378
386
|
}, z.core.$strip>], "kind">, unknown>;
|
|
379
387
|
start: z.ZodNumber;
|
|
380
388
|
}, z.core.$strip>>>;
|
|
@@ -846,6 +854,8 @@ type PluginSettingDescriptor = {
|
|
|
846
854
|
label: string;
|
|
847
855
|
description?: string;
|
|
848
856
|
options: string[];
|
|
857
|
+
/** Display labels keyed by option value; options without one show the value itself. */
|
|
858
|
+
experimental_optionLabels?: Record<string, string>;
|
|
849
859
|
/** Synchronously validate without transforming a proposed value. */
|
|
850
860
|
experimental_schema?: StandardSchemaV1<string, string>;
|
|
851
861
|
default?: string;
|
|
@@ -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,
|
|
9
|
+
import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginThreadActionRegistration, 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,10 +68,9 @@ 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[];
|
|
73
|
+
threadActions: PluginThreadActionRegistration<unknown>[];
|
|
75
74
|
browserToolbarActions: ExperimentalPluginBrowserToolbarActionRegistration[];
|
|
76
75
|
fileOpeners: PluginFileOpenerRegistration[];
|
|
77
76
|
sourceCodeRenderers: PluginSourceCodeRendererRegistration[];
|
|
@@ -3451,6 +3451,10 @@ declare const threadEventSchema: z.ZodUnion<readonly [z.ZodIntersection<z.ZodDis
|
|
|
3451
3451
|
kind: z.ZodLiteral<"plugin">;
|
|
3452
3452
|
label: z.ZodString;
|
|
3453
3453
|
pluginId: z.ZodString;
|
|
3454
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3455
|
+
kind: z.ZodLiteral<"attachment">;
|
|
3456
|
+
label: z.ZodString;
|
|
3457
|
+
path: z.ZodString;
|
|
3454
3458
|
}, z.core.$strip>], "kind">, unknown>;
|
|
3455
3459
|
start: z.ZodNumber;
|
|
3456
3460
|
}, z.core.$strip>>>;
|
|
@@ -3537,6 +3541,10 @@ declare const threadEventSchema: z.ZodUnion<readonly [z.ZodIntersection<z.ZodDis
|
|
|
3537
3541
|
kind: z.ZodLiteral<"plugin">;
|
|
3538
3542
|
label: z.ZodString;
|
|
3539
3543
|
pluginId: z.ZodString;
|
|
3544
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3545
|
+
kind: z.ZodLiteral<"attachment">;
|
|
3546
|
+
label: z.ZodString;
|
|
3547
|
+
path: z.ZodString;
|
|
3540
3548
|
}, z.core.$strip>], "kind">, unknown>;
|
|
3541
3549
|
start: z.ZodNumber;
|
|
3542
3550
|
}, z.core.$strip>>>;
|
|
@@ -4149,6 +4157,10 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4149
4157
|
kind: z.ZodLiteral<"plugin">;
|
|
4150
4158
|
label: z.ZodString;
|
|
4151
4159
|
pluginId: z.ZodString;
|
|
4160
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
4161
|
+
kind: z.ZodLiteral<"attachment">;
|
|
4162
|
+
label: z.ZodString;
|
|
4163
|
+
path: z.ZodString;
|
|
4152
4164
|
}, z.core.$strip>], "kind">, unknown>;
|
|
4153
4165
|
start: z.ZodNumber;
|
|
4154
4166
|
}, z.core.$strip>>>;
|
|
@@ -1458,6 +1458,10 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1458
1458
|
kind: z.ZodLiteral<"plugin">;
|
|
1459
1459
|
label: z.ZodString;
|
|
1460
1460
|
pluginId: z.ZodString;
|
|
1461
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1462
|
+
kind: z.ZodLiteral<"attachment">;
|
|
1463
|
+
label: z.ZodString;
|
|
1464
|
+
path: z.ZodString;
|
|
1461
1465
|
}, z.core.$strip>], "kind">, unknown>;
|
|
1462
1466
|
start: z.ZodNumber;
|
|
1463
1467
|
}, z.core.$strip>>>;
|
|
@@ -4595,6 +4599,10 @@ declare const threadStartParamsSchema: z.ZodObject<{
|
|
|
4595
4599
|
kind: z.ZodLiteral<"plugin">;
|
|
4596
4600
|
label: z.ZodString;
|
|
4597
4601
|
pluginId: z.ZodString;
|
|
4602
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
4603
|
+
kind: z.ZodLiteral<"attachment">;
|
|
4604
|
+
label: z.ZodString;
|
|
4605
|
+
path: z.ZodString;
|
|
4598
4606
|
}, z.core.$strip>], "kind">, unknown>;
|
|
4599
4607
|
start: z.ZodNumber;
|
|
4600
4608
|
}, z.core.$strip>>>;
|
|
@@ -4917,6 +4925,10 @@ declare const turnStartParamsSchema: z.ZodObject<{
|
|
|
4917
4925
|
kind: z.ZodLiteral<"plugin">;
|
|
4918
4926
|
label: z.ZodString;
|
|
4919
4927
|
pluginId: z.ZodString;
|
|
4928
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
4929
|
+
kind: z.ZodLiteral<"attachment">;
|
|
4930
|
+
label: z.ZodString;
|
|
4931
|
+
path: z.ZodString;
|
|
4920
4932
|
}, z.core.$strip>], "kind">, unknown>;
|
|
4921
4933
|
start: z.ZodNumber;
|
|
4922
4934
|
}, z.core.$strip>>>;
|
|
@@ -5048,6 +5060,10 @@ declare const turnSteerParamsSchema: z.ZodObject<{
|
|
|
5048
5060
|
kind: z.ZodLiteral<"plugin">;
|
|
5049
5061
|
label: z.ZodString;
|
|
5050
5062
|
pluginId: z.ZodString;
|
|
5063
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5064
|
+
kind: z.ZodLiteral<"attachment">;
|
|
5065
|
+
label: z.ZodString;
|
|
5066
|
+
path: z.ZodString;
|
|
5051
5067
|
}, z.core.$strip>], "kind">, unknown>;
|
|
5052
5068
|
start: z.ZodNumber;
|
|
5053
5069
|
}, z.core.$strip>>>;
|
|
@@ -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,
|
|
10
|
+
import { ExperimentalSidebarFooterItemRegistration, PluginProviderIconRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginThreadActionRegistration, 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, PluginThreadActionTarget, PluginThreadActionEntry, PluginThreadActionRegistrationInfo, PluginEnvironmentProvidersState } from '@get-bb/plugin-sdk';
|
|
11
11
|
|
|
12
12
|
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
13
13
|
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
@@ -74,6 +74,7 @@ type PluginSdkTestFakes = PluginSdkFakeTree<PluginBrowserBbSdk>;
|
|
|
74
74
|
type NavigateCall = {
|
|
75
75
|
method: "toThread";
|
|
76
76
|
threadId: string;
|
|
77
|
+
options?: Parameters<BbNavigate["toThread"]>[1];
|
|
77
78
|
} | {
|
|
78
79
|
method: "toProject";
|
|
79
80
|
projectId: string;
|
|
@@ -86,10 +87,7 @@ type NavigateCall = {
|
|
|
86
87
|
};
|
|
87
88
|
} | {
|
|
88
89
|
method: "toCompose";
|
|
89
|
-
options?:
|
|
90
|
-
initialPrompt?: string;
|
|
91
|
-
focusPrompt?: boolean;
|
|
92
|
-
};
|
|
90
|
+
options?: Parameters<BbNavigate["toCompose"]>[0];
|
|
93
91
|
} | {
|
|
94
92
|
method: "openThreadPanel";
|
|
95
93
|
options: Parameters<BbNavigate["openThreadPanel"]>[0];
|
|
@@ -152,27 +150,19 @@ interface ComposerLog {
|
|
|
152
150
|
*/
|
|
153
151
|
selections: ComposerSelection[];
|
|
154
152
|
}
|
|
155
|
-
/** One recorded `experimental_useSidebarThreadActions()` call. */
|
|
156
|
-
interface SidebarActionCall {
|
|
157
|
-
method: keyof PluginSidebarThreadActions;
|
|
158
|
-
threadId?: string;
|
|
159
|
-
environmentId?: string;
|
|
160
|
-
options?: Record<string, unknown>;
|
|
161
|
-
title?: string;
|
|
162
|
-
pinned?: boolean;
|
|
163
|
-
read?: boolean;
|
|
164
|
-
}
|
|
165
153
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
154
|
+
* What `experimental_useThreadActions(thread)` returns in a test, in menu
|
|
155
|
+
* order; the host's own actions are not emulated. `requestRename` is the
|
|
156
|
+
* caller's rename editor (a no-op when it passed none), for entries whose
|
|
157
|
+
* `run` renames. The fake applies `keys`. Omitted → an empty list. The fake
|
|
158
|
+
* `experimental_ThreadActionsMenu` opens on a trigger click and the fake
|
|
159
|
+
* context menu on right-click; each lists these entries and its `inline`
|
|
160
|
+
* items as `menuitem` buttons, and closes after one runs (calling
|
|
161
|
+
* `onOpenChange(false)` and `onCloseAutoFocus`).
|
|
168
162
|
*/
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
itemIds?: string[];
|
|
173
|
-
isVisible?: boolean;
|
|
174
|
-
openInSplit?: boolean;
|
|
175
|
-
}
|
|
163
|
+
type TestThreadActionsResolver = (thread: PluginThreadActionTarget, options: {
|
|
164
|
+
requestRename(threadId: string): void;
|
|
165
|
+
}) => readonly PluginThreadActionEntry[];
|
|
176
166
|
type TestClipboard = (content: ExperimentalClipboardContent) => Promise<boolean>;
|
|
177
167
|
/**
|
|
178
168
|
* Install the test runtime at `globalThis.__bbPluginRuntime.pluginSdkApp`,
|
|
@@ -193,10 +183,9 @@ interface CapturedPluginApp {
|
|
|
193
183
|
pendingInteractions: PluginPendingInteractionRegistration[];
|
|
194
184
|
sidebarFooterActions: PluginSidebarFooterActionRegistration[];
|
|
195
185
|
experimentalSidebarFooterItems: CollectedExperimentalSidebarFooterItem[];
|
|
196
|
-
experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
|
|
197
|
-
experimentalSidebarHeaders: ExperimentalSidebarHeaderRegistration[];
|
|
198
186
|
threadLists: PluginThreadListRegistration[];
|
|
199
187
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
188
|
+
threadActions: PluginThreadActionRegistration<unknown>[];
|
|
200
189
|
browserToolbarActions: ExperimentalPluginBrowserToolbarActionRegistration[];
|
|
201
190
|
fileOpeners: PluginFileOpenerRegistration[];
|
|
202
191
|
sourceCodeRenderers: PluginSourceCodeRendererRegistration[];
|
|
@@ -353,15 +342,15 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
|
|
|
353
342
|
/** The split layout `useSidebarSplitLayout()` reports. Omitted → null. */
|
|
354
343
|
sidebarSplitLayout?: PluginSidebarSplitLayout;
|
|
355
344
|
/**
|
|
356
|
-
*
|
|
357
|
-
* Omitted →
|
|
358
|
-
* `inspection.sidebarNavigationCalls` and do not change the items.
|
|
345
|
+
* What `experimental_useThreadActions()` reports for a thread, in menu
|
|
346
|
+
* order. Omitted → an empty list.
|
|
359
347
|
*/
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
348
|
+
threadActions?: TestThreadActionsResolver;
|
|
349
|
+
/**
|
|
350
|
+
* What `experimental_useThreadActionRegistrations()` reports. Omitted → an
|
|
351
|
+
* empty list.
|
|
352
|
+
*/
|
|
353
|
+
threadActionRegistrations?: readonly PluginThreadActionRegistrationInfo[];
|
|
365
354
|
/**
|
|
366
355
|
* The environment provider catalog `useEnvironmentProviders()` reports.
|
|
367
356
|
* Omitted → a ready, empty list. Pass `{ status: "loading" }` to test that
|
|
@@ -414,13 +403,11 @@ interface RenderedSlotInspectionState {
|
|
|
414
403
|
readonly navigateCalls: NavigateCall[];
|
|
415
404
|
/** Every validated `experimental_useAppPanel().openFixedTab` call. */
|
|
416
405
|
readonly experimental_fixedTabOpenCalls: ExperimentalFixedTabOpenCall[];
|
|
417
|
-
/** Every `experimental_useSidebarThreadActions()` call, in order. */
|
|
418
|
-
readonly sidebarActionCalls: SidebarActionCall[];
|
|
419
406
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
407
|
+
* The environment id of every `experimental_useArchiveEnvironmentThreads()`
|
|
408
|
+
* call, in order.
|
|
422
409
|
*/
|
|
423
|
-
readonly
|
|
410
|
+
readonly experimental_environmentArchiveCalls: string[];
|
|
424
411
|
/** Every `useSdk()` call, in order, as `"<area>.<method>"`. */
|
|
425
412
|
readonly sdkCalls: SdkCall[];
|
|
426
413
|
/** Every `experimental_copyToClipboard()` write, in order. */
|
|
@@ -447,4 +434,4 @@ declare function renderSlot<Props extends object, Contract extends PluginRpcCont
|
|
|
447
434
|
}, props: Props, options?: RenderSlotOptions<Contract>): RenderedSlot;
|
|
448
435
|
|
|
449
436
|
export { installTestPluginRuntime, loadPluginApp, mountPluginContentScripts, renderSlot };
|
|
450
|
-
export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, ExperimentalFixedTabOpenCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, PluginSdkTestFakes, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SdkCall,
|
|
437
|
+
export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, ExperimentalFixedTabOpenCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, PluginSdkTestFakes, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SdkCall, TestThreadActionsResolver };
|