@get-bb/plugin-sdk 0.4.45 → 0.4.48
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 +48 -1
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +34 -3
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +18 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +20 -1
- package/bundled-types/bb-plugin-sdk.d.ts +484 -1
- package/dist/internal/host-policy.js +1 -0
- package/dist/internal/plugin-app-collector.js +142 -5
- package/dist/provider-bridge-acp.js +10 -8
- package/dist/provider-bridge-testing.js +2 -11
- package/dist/provider-bridge.js +10 -8
- package/dist/testing/app.js +136 -4
- package/dist/testing/index.js +151 -0
- package/package.json +1 -1
|
@@ -406,6 +406,11 @@ interface PluginPendingInteractionProps {
|
|
|
406
406
|
*/
|
|
407
407
|
interface PluginSidebarFooterActionProps {
|
|
408
408
|
}
|
|
409
|
+
/** Props passed to an experimental sidebar-footer disclosure component. */
|
|
410
|
+
interface ExperimentalSidebarFooterDisclosureProps {
|
|
411
|
+
/** Hide this disclosure without affecting another plugin's open disclosure. */
|
|
412
|
+
dismiss(): void;
|
|
413
|
+
}
|
|
409
414
|
/** Display and accessibility metadata for a host-owned sidebar shortcut. */
|
|
410
415
|
interface ExperimentalSidebarNavigationShortcut {
|
|
411
416
|
label: string;
|
|
@@ -942,6 +947,46 @@ interface PluginSidebarFooterActionRegistration {
|
|
|
942
947
|
*/
|
|
943
948
|
run(context: PluginSidebarFooterActionContext): void | Promise<void>;
|
|
944
949
|
}
|
|
950
|
+
/** Context handed to an experimental sidebar-footer action. */
|
|
951
|
+
interface ExperimentalSidebarFooterActionContext {
|
|
952
|
+
/** Navigate to this plugin's detail page in Tools. */
|
|
953
|
+
openPluginDetails(): void;
|
|
954
|
+
}
|
|
955
|
+
/** Fields shared by both experimental sidebar-footer item behaviors. */
|
|
956
|
+
interface ExperimentalSidebarFooterItemBase {
|
|
957
|
+
/** Unique within the plugin's unified sidebar footer; letters, digits, `-`, `_`. */
|
|
958
|
+
id: string;
|
|
959
|
+
/** Tooltip and accessible label for the host-rendered icon button. */
|
|
960
|
+
label: string;
|
|
961
|
+
/** BB icon-name hint; unknown names fall back to a generic icon. */
|
|
962
|
+
icon: string;
|
|
963
|
+
}
|
|
964
|
+
/** A sidebar-footer item that runs a callback when activated. */
|
|
965
|
+
interface ExperimentalSidebarFooterActionRegistration extends ExperimentalSidebarFooterItemBase {
|
|
966
|
+
kind: "action";
|
|
967
|
+
onActivate(context: ExperimentalSidebarFooterActionContext): void | Promise<void>;
|
|
968
|
+
}
|
|
969
|
+
/** A sidebar-footer item that reveals plugin-rendered content above the row. */
|
|
970
|
+
interface ExperimentalSidebarFooterDisclosureRegistration extends ExperimentalSidebarFooterItemBase {
|
|
971
|
+
kind: "disclosure";
|
|
972
|
+
component: ComponentType<ExperimentalSidebarFooterDisclosureProps>;
|
|
973
|
+
}
|
|
974
|
+
/** One host-rendered item in the app sidebar footer. */
|
|
975
|
+
type ExperimentalSidebarFooterItemRegistration = ExperimentalSidebarFooterActionRegistration | ExperimentalSidebarFooterDisclosureRegistration;
|
|
976
|
+
/** Live controls for an experimental sidebar-footer disclosure. */
|
|
977
|
+
interface ExperimentalSidebarFooterDisclosureController {
|
|
978
|
+
/** Request that the host open this disclosure, replacing any open sibling. */
|
|
979
|
+
open(): void;
|
|
980
|
+
/** Close this disclosure if it is currently open. */
|
|
981
|
+
close(): void;
|
|
982
|
+
/** Open this disclosure, or close it when it is currently open. */
|
|
983
|
+
toggle(): void;
|
|
984
|
+
}
|
|
985
|
+
/** Managed registration surface for items in the app sidebar footer. */
|
|
986
|
+
interface ExperimentalSidebarFooter {
|
|
987
|
+
register(registration: ExperimentalSidebarFooterActionRegistration): void;
|
|
988
|
+
register(registration: ExperimentalSidebarFooterDisclosureRegistration): ExperimentalSidebarFooterDisclosureController;
|
|
989
|
+
}
|
|
945
990
|
/**
|
|
946
991
|
* The one status bb would paint for a thread, already resolved through the
|
|
947
992
|
* host's precedence (attention before work; plan and goal before the generic
|
|
@@ -1664,6 +1709,8 @@ interface PluginAppBuilder {
|
|
|
1664
1709
|
slots: PluginAppSlots;
|
|
1665
1710
|
composer: PluginAppComposer;
|
|
1666
1711
|
contentScripts: PluginAppContentScripts;
|
|
1712
|
+
/** Experimental managed region for actions and disclosures in the sidebar footer. */
|
|
1713
|
+
experimental_sidebarFooter: ExperimentalSidebarFooter;
|
|
1667
1714
|
}
|
|
1668
1715
|
type PluginAppSetup = (app: PluginAppBuilder) => void;
|
|
1669
1716
|
/**
|
|
@@ -2470,4 +2517,4 @@ declare const experimental_useProviders: () => PluginProvidersState;
|
|
|
2470
2517
|
declare const experimental_useCodeTheme: () => PluginCodeThemeState;
|
|
2471
2518
|
|
|
2472
2519
|
export { Markdown, ThreadChat, UrlLink, definePluginApp, experimental_Diff, experimental_FileLink, experimental_NewThreadComposer, experimental_PermissionModePicker, experimental_ProviderModelPicker, experimental_SourceCode, experimental_useAppPanel, experimental_useCodeTheme, experimental_useFixedTabTarget, experimental_useProviders, experimental_useSidebarThreadActions, experimental_useSidebarThreadPullRequest, experimental_useSidebarThreadSplit, experimental_useSidebarThreads, useBbContext, useBbNavigate, useComposer, useComposerView, useRealtime, useRealtimeConnectionState, useRpc, useSettings };
|
|
2473
|
-
export type { BbContext, BbNavigate, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginFixedTabReference, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandPaletteActionContext, PluginCommandPaletteActionRegistration, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderIconRegistration, PluginProvidersState, PluginRealtimeConnectionState, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSidebarWorkspaceKind, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginTargetedPanelActionOpenOptions, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps };
|
|
2520
|
+
export type { BbContext, BbNavigate, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginFixedTabReference, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandPaletteActionContext, PluginCommandPaletteActionRegistration, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderIconRegistration, PluginProvidersState, PluginRealtimeConnectionState, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSidebarWorkspaceKind, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginTargetedPanelActionOpenOptions, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps };
|
|
@@ -5,8 +5,37 @@
|
|
|
5
5
|
// Confused by the API, or need a symbol that isn't here? Clone the BB repo
|
|
6
6
|
// and read the real source: https://github.com/get-bb/bb
|
|
7
7
|
|
|
8
|
-
import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandPaletteActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
8
|
+
import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandPaletteActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
9
9
|
|
|
10
|
+
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
11
|
+
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
12
|
+
command: {
|
|
13
|
+
sequence: number;
|
|
14
|
+
kind: ExperimentalSidebarFooterCommandKind;
|
|
15
|
+
} | null;
|
|
16
|
+
}
|
|
17
|
+
interface ExperimentalSidebarFooterItemRuntime {
|
|
18
|
+
subscribe(listener: () => void): () => void;
|
|
19
|
+
getSnapshot(): ExperimentalSidebarFooterRuntimeSnapshot;
|
|
20
|
+
acknowledgeCommand(sequence: number): void;
|
|
21
|
+
}
|
|
22
|
+
type CollectedExperimentalSidebarFooterItem = ExperimentalSidebarFooterItemRegistration & {
|
|
23
|
+
runtime: ExperimentalSidebarFooterItemRuntime;
|
|
24
|
+
};
|
|
25
|
+
type CollectedManagedSidebarFooterItem = CollectedExperimentalSidebarFooterItem & {
|
|
26
|
+
source: "experimental_sidebarFooter";
|
|
27
|
+
};
|
|
28
|
+
interface CollectedCompatibilitySidebarFooterItem {
|
|
29
|
+
source: "sidebarFooterAction";
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
icon: string;
|
|
33
|
+
kind: "action";
|
|
34
|
+
onActivate(context: ExperimentalSidebarFooterActionContext): void | Promise<void>;
|
|
35
|
+
runtime: ExperimentalSidebarFooterItemRuntime;
|
|
36
|
+
}
|
|
37
|
+
type CollectedSidebarFooterItem = CollectedCompatibilitySidebarFooterItem | CollectedManagedSidebarFooterItem;
|
|
38
|
+
declare function adaptSidebarFooterAction(registration: PluginSidebarFooterActionRegistration): CollectedCompatibilitySidebarFooterItem;
|
|
10
39
|
/** Validated registrations produced by one plugin app setup execution. */
|
|
11
40
|
interface CollectedPluginAppRegistrations {
|
|
12
41
|
homepageSections: PluginHomepageSectionRegistration[];
|
|
@@ -18,6 +47,7 @@ interface CollectedPluginAppRegistrations {
|
|
|
18
47
|
composerCustomizations: ComposerCustomization[];
|
|
19
48
|
pendingInteractions: PluginPendingInteractionRegistration[];
|
|
20
49
|
sidebarFooterActions: PluginSidebarFooterActionRegistration[];
|
|
50
|
+
experimentalSidebarFooterItems: CollectedExperimentalSidebarFooterItem[];
|
|
21
51
|
experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
|
|
22
52
|
threadLists: PluginThreadListRegistration[];
|
|
23
53
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
@@ -31,6 +61,7 @@ interface CollectedPluginAppRegistrations {
|
|
|
31
61
|
timelineRenderers: PluginTimelineRendererRegistration[];
|
|
32
62
|
contentScripts: PluginContentScriptRegistration[];
|
|
33
63
|
}
|
|
64
|
+
declare function getCollectedSidebarFooterItems(registrations: object): readonly CollectedSidebarFooterItem[] | null;
|
|
34
65
|
/**
|
|
35
66
|
* Run a plugin app definition against the canonical validating collector.
|
|
36
67
|
* Both the BB app and the public test harness use this implementation so a
|
|
@@ -39,5 +70,5 @@ interface CollectedPluginAppRegistrations {
|
|
|
39
70
|
*/
|
|
40
71
|
declare function collectPluginAppRegistrations(definition: PluginAppDefinition, onComposerCustomizationRejected?: (reason: string) => void): CollectedPluginAppRegistrations;
|
|
41
72
|
|
|
42
|
-
export { collectPluginAppRegistrations };
|
|
43
|
-
export type { CollectedPluginAppRegistrations };
|
|
73
|
+
export { adaptSidebarFooterAction, collectPluginAppRegistrations, getCollectedSidebarFooterItems };
|
|
74
|
+
export type { CollectedCompatibilitySidebarFooterItem, CollectedExperimentalSidebarFooterItem, CollectedManagedSidebarFooterItem, CollectedPluginAppRegistrations, CollectedSidebarFooterItem, ExperimentalSidebarFooterCommandKind, ExperimentalSidebarFooterItemRuntime, ExperimentalSidebarFooterRuntimeSnapshot };
|
|
@@ -7,7 +7,23 @@
|
|
|
7
7
|
|
|
8
8
|
import { ReactNode, ComponentType } from 'react';
|
|
9
9
|
import { RenderResult } from '@testing-library/react';
|
|
10
|
-
import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
10
|
+
import { ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
11
|
+
|
|
12
|
+
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
13
|
+
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
14
|
+
command: {
|
|
15
|
+
sequence: number;
|
|
16
|
+
kind: ExperimentalSidebarFooterCommandKind;
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
interface ExperimentalSidebarFooterItemRuntime {
|
|
20
|
+
subscribe(listener: () => void): () => void;
|
|
21
|
+
getSnapshot(): ExperimentalSidebarFooterRuntimeSnapshot;
|
|
22
|
+
acknowledgeCommand(sequence: number): void;
|
|
23
|
+
}
|
|
24
|
+
type CollectedExperimentalSidebarFooterItem = ExperimentalSidebarFooterItemRegistration & {
|
|
25
|
+
runtime: ExperimentalSidebarFooterItemRuntime;
|
|
26
|
+
};
|
|
11
27
|
|
|
12
28
|
/**
|
|
13
29
|
* `@get-bb/plugin-sdk/testing/app` — the frontend plugin test harness. Tests a
|
|
@@ -125,6 +141,7 @@ interface CapturedPluginApp {
|
|
|
125
141
|
composerCustomizations: ComposerCustomization[];
|
|
126
142
|
pendingInteractions: PluginPendingInteractionRegistration[];
|
|
127
143
|
sidebarFooterActions: PluginSidebarFooterActionRegistration[];
|
|
144
|
+
experimentalSidebarFooterItems: CollectedExperimentalSidebarFooterItem[];
|
|
128
145
|
experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
|
|
129
146
|
threadLists: PluginThreadListRegistration[];
|
|
130
147
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
@@ -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 { BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, JsonValue as JsonValue$1, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
9
|
+
import { BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, JsonValue as JsonValue$1, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
10
10
|
|
|
11
11
|
/** Input-form entry: a path, or a path with options. */
|
|
12
12
|
declare const providerNativeRootInputSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -555,6 +555,22 @@ interface FakeHttpRouteRecord {
|
|
|
555
555
|
auth: PluginHttpAuthMode;
|
|
556
556
|
handler: PluginHttpHandler;
|
|
557
557
|
}
|
|
558
|
+
interface ExperimentalFakeWebSocketRouteRecord {
|
|
559
|
+
path: string;
|
|
560
|
+
auth: PluginHttpAuthMode;
|
|
561
|
+
handler: ExperimentalPluginWebSocketHandler;
|
|
562
|
+
}
|
|
563
|
+
interface ExperimentalFakeWebSocketSession {
|
|
564
|
+
readonly sent: readonly (string | Uint8Array)[];
|
|
565
|
+
readonly closeCalls: readonly {
|
|
566
|
+
code: number | null;
|
|
567
|
+
reason: string | null;
|
|
568
|
+
}[];
|
|
569
|
+
readonly readyState: number;
|
|
570
|
+
receive(data: string | Uint8Array): Promise<void>;
|
|
571
|
+
close(code?: number, reason?: string): Promise<void>;
|
|
572
|
+
error(error: Error): Promise<void>;
|
|
573
|
+
}
|
|
558
574
|
interface FakeScheduleRecord {
|
|
559
575
|
name: string;
|
|
560
576
|
cron: string;
|
|
@@ -618,6 +634,7 @@ interface ExperimentalFakeHostRpcCall {
|
|
|
618
634
|
interface FakePluginRegistrations {
|
|
619
635
|
settingsDescriptors: PluginSettingDescriptors;
|
|
620
636
|
httpRoutes: FakeHttpRouteRecord[];
|
|
637
|
+
websocketRoutes: ExperimentalFakeWebSocketRouteRecord[];
|
|
621
638
|
rpcMethods: string[];
|
|
622
639
|
services: FakeServiceRecord[];
|
|
623
640
|
schedules: FakeScheduleRecord[];
|
|
@@ -707,6 +724,8 @@ interface FakePluginBehaviorDrivers {
|
|
|
707
724
|
* `{ ok: false, error: "plugin route failed: …" }` response.
|
|
708
725
|
*/
|
|
709
726
|
fetchHttp(method: string, path: string, init?: RequestInit): Promise<Response>;
|
|
727
|
+
/** Open and drive an exact-match `bb.http.experimental_websocket` route. */
|
|
728
|
+
experimental_openWebSocket(path: string, init?: RequestInit): Promise<ExperimentalFakeWebSocketSession>;
|
|
710
729
|
/**
|
|
711
730
|
* Start a registered background service once, deterministically. `done`
|
|
712
731
|
* settles when `start` returns; abort `controller` to signal shutdown.
|