@get-bb/plugin-sdk 0.4.40 → 0.4.47
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/README.md +16 -1
- package/bundled-types/bb-plugin-sdk-app.d.ts +48 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +12 -1
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +34 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +590 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +135 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +18 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +59 -2
- package/bundled-types/bb-plugin-sdk.d.ts +711 -9
- package/dist/internal/host-policy.js +39 -0
- package/dist/internal/plugin-app-collector.js +142 -5
- package/dist/provider-bridge-acp.js +44 -10
- package/dist/provider-bridge-testing.js +36 -13
- package/dist/provider-bridge.js +44 -10
- package/dist/testing/app.js +136 -4
- package/dist/testing/index.js +415 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,17 +117,32 @@ npm install --save-dev react react-dom @testing-library/react jsdom # frontend t
|
|
|
117
117
|
Backend example:
|
|
118
118
|
|
|
119
119
|
```ts
|
|
120
|
-
import {
|
|
120
|
+
import {
|
|
121
|
+
createFakePluginHost,
|
|
122
|
+
makePluginAgentConfigurationContext,
|
|
123
|
+
} from "@get-bb/plugin-sdk/testing";
|
|
121
124
|
import plugin from "./server.js";
|
|
122
125
|
|
|
123
126
|
const host = createFakePluginHost({ pluginId: "notes" });
|
|
124
127
|
await plugin(host.bb);
|
|
125
128
|
|
|
129
|
+
await host.harness.behavior.resolveAgentConfiguration(
|
|
130
|
+
makePluginAgentConfigurationContext({
|
|
131
|
+
provider: { id: "codex" },
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
126
134
|
await host.harness.behavior.callRpc("list", { query: "today" });
|
|
127
135
|
expect(host.harness.inspection.registrations.rpcMethods).toContain("list");
|
|
128
136
|
await host.harness.lifecycle.dispose();
|
|
129
137
|
```
|
|
130
138
|
|
|
139
|
+
`makePluginAgentConfigurationContext`, `makeMessageDispatchHookContext`,
|
|
140
|
+
`makeThreadResponse`, `makeQueueEntry`, and `makeTurnFailedEvent` return
|
|
141
|
+
complete deterministic SDK objects. Pass partial overrides so a behavioral
|
|
142
|
+
test shows only the values relevant to its scenario. Nested context
|
|
143
|
+
members merge partial overrides against complete defaults, so required contract
|
|
144
|
+
additions remain localized to the shared fixtures.
|
|
145
|
+
|
|
131
146
|
`harness.behavior` contains deterministic host inputs (RPC/HTTP/CLI calls,
|
|
132
147
|
events, settings, tools, interactions, and schedules), `harness.inspection`
|
|
133
148
|
contains registrations and recorded state, and `harness.lifecycle` owns atomic
|
|
@@ -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 };
|
|
@@ -1073,6 +1073,14 @@ interface PluginProviderDeclaration {
|
|
|
1073
1073
|
*/
|
|
1074
1074
|
deriveProviderOptions?: (context: PluginProviderOptionsContext) => Readonly<Record<string, JsonValue>>;
|
|
1075
1075
|
}
|
|
1076
|
+
interface ExperimentalPluginProviderEnvEntry {
|
|
1077
|
+
name: string;
|
|
1078
|
+
value: string | {
|
|
1079
|
+
serverPath: string;
|
|
1080
|
+
};
|
|
1081
|
+
reason: string;
|
|
1082
|
+
secret: boolean;
|
|
1083
|
+
}
|
|
1076
1084
|
type PluginMentionTrigger = "!" | "#" | "$" | "@" | "~";
|
|
1077
1085
|
/**
|
|
1078
1086
|
* What a plugin's AI service does. `inference` answers bb's server-side helper
|
|
@@ -1111,6 +1119,9 @@ declare const RPC_METHOD_PATTERN: RegExp;
|
|
|
1111
1119
|
declare const BACKGROUND_NAME_PATTERN: RegExp;
|
|
1112
1120
|
declare const CLI_COMMAND_NAME_PATTERN: RegExp;
|
|
1113
1121
|
declare const AGENT_TOOL_NAME_PATTERN: RegExp;
|
|
1122
|
+
declare const PLUGIN_PROVIDER_ENV_NAME_PATTERN: RegExp;
|
|
1123
|
+
declare const PLUGIN_PROVIDER_ENV_MAX_ENTRIES = 32;
|
|
1124
|
+
declare function validatePluginProviderEnvEntries(value: unknown): ExperimentalPluginProviderEnvEntry[];
|
|
1114
1125
|
declare const PLUGIN_AGENT_STATIC_INSTRUCTIONS_MAX_CHARS = 4096;
|
|
1115
1126
|
/** Status labels ride on every tool-call event and share one timeline row. */
|
|
1116
1127
|
declare const PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS = 80;
|
|
@@ -1326,5 +1337,5 @@ declare function storePluginHook<K extends PluginHookName>(records: {
|
|
|
1326
1337
|
/** The refusal a second handler for one hook from one plugin gets. */
|
|
1327
1338
|
declare function pluginHookAlreadyRegisteredMessage(hook: PluginHookName): string;
|
|
1328
1339
|
|
|
1329
|
-
export { AGENT_TOOL_NAME_PATTERN, BACKGROUND_NAME_PATTERN, CLI_COMMAND_NAME_PATTERN, KV_VALUE_MAX_BYTES, MENTION_PROVIDER_ID_PATTERN, PLUGIN_AGENT_DYNAMIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_SELECTION_MAX_IDS, PLUGIN_AGENT_STATIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, PLUGIN_AGENT_TOOL_PARAMETERS_MAX_BYTES, PLUGIN_HTTP_METHODS, PLUGIN_MENTION_TRIGGER_VALUES, PLUGIN_PROVIDER_BRIDGE_OPTIONS_MAX_BYTES, PLUGIN_PROVIDER_COMPOSER_ACTION_VALUES, PLUGIN_PROVIDER_DISPLAY_NAME_MAX_CHARS, PLUGIN_PROVIDER_PERMISSION_MODE_VALUES, PLUGIN_PROVIDER_REASONING_LEVEL_VALUES, PROVIDER_ID_PATTERN, RESERVED_AGENT_TOOL_NAMES, RESERVED_BB_CLI_COMMANDS, RPC_METHOD_PATTERN, SERVER_DIRECT_AI_SERVICE_IDS, SETTING_KEY_PATTERN, adoptHttpRouteResponse, agentToolIconRefusalMessage, aiServiceAlreadyRegisteredMessage, assertAiServiceRegistrable, assertNoRecursiveJsonSchemaReferences, deriveValidatedProviderOptions, enforcePluginCliOutputLimit, isPluginMentionTrigger, isStandardSchema, isZodSchemaLike, normalizeMentionProviderTriggers, parsePluginAgentToolPresentation, pluginCliCollisionWarning, pluginHookAlreadyRegisteredMessage, providerAlreadyRegisteredMessage, providerIconRefusalMessage, providerWithoutBridgeMessage, readRpcMethodContract, registerSettingDescriptors, rejectStaleAgentToolFields, storePluginHook, summarizeParseIssues, undeclaredIconProblem, validatePluginAiServiceDeclaration, validatePluginProviderDeclaration, validateSettingsUpdate, zodSchemaToJsonSchema };
|
|
1340
|
+
export { AGENT_TOOL_NAME_PATTERN, BACKGROUND_NAME_PATTERN, CLI_COMMAND_NAME_PATTERN, KV_VALUE_MAX_BYTES, MENTION_PROVIDER_ID_PATTERN, PLUGIN_AGENT_DYNAMIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_SELECTION_MAX_IDS, PLUGIN_AGENT_STATIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, PLUGIN_AGENT_TOOL_PARAMETERS_MAX_BYTES, PLUGIN_HTTP_METHODS, PLUGIN_MENTION_TRIGGER_VALUES, PLUGIN_PROVIDER_BRIDGE_OPTIONS_MAX_BYTES, PLUGIN_PROVIDER_COMPOSER_ACTION_VALUES, PLUGIN_PROVIDER_DISPLAY_NAME_MAX_CHARS, PLUGIN_PROVIDER_ENV_MAX_ENTRIES, PLUGIN_PROVIDER_ENV_NAME_PATTERN, PLUGIN_PROVIDER_PERMISSION_MODE_VALUES, PLUGIN_PROVIDER_REASONING_LEVEL_VALUES, PROVIDER_ID_PATTERN, RESERVED_AGENT_TOOL_NAMES, RESERVED_BB_CLI_COMMANDS, RPC_METHOD_PATTERN, SERVER_DIRECT_AI_SERVICE_IDS, SETTING_KEY_PATTERN, adoptHttpRouteResponse, agentToolIconRefusalMessage, aiServiceAlreadyRegisteredMessage, assertAiServiceRegistrable, assertNoRecursiveJsonSchemaReferences, deriveValidatedProviderOptions, enforcePluginCliOutputLimit, isPluginMentionTrigger, isStandardSchema, isZodSchemaLike, normalizeMentionProviderTriggers, parsePluginAgentToolPresentation, pluginCliCollisionWarning, pluginHookAlreadyRegisteredMessage, providerAlreadyRegisteredMessage, providerIconRefusalMessage, providerWithoutBridgeMessage, readRpcMethodContract, registerSettingDescriptors, rejectStaleAgentToolFields, storePluginHook, summarizeParseIssues, undeclaredIconProblem, validatePluginAiServiceDeclaration, validatePluginProviderDeclaration, validatePluginProviderEnvEntries, validateSettingsUpdate, zodSchemaToJsonSchema };
|
|
1330
1341
|
export type { AiServiceHostBinding, NormalizedPluginProviderDeclaration };
|
|
@@ -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 };
|
|
@@ -63,6 +63,15 @@ declare const availableModelSchema: z.ZodObject<{
|
|
|
63
63
|
type AvailableModel = z.infer<typeof availableModelSchema>;
|
|
64
64
|
|
|
65
65
|
declare const deltaPresentationSchema: z.ZodObject<{
|
|
66
|
+
badge: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
glyph: z.ZodString;
|
|
68
|
+
hint: z.ZodString;
|
|
69
|
+
label: z.ZodString;
|
|
70
|
+
tone: z.ZodEnum<{
|
|
71
|
+
destructive: "destructive";
|
|
72
|
+
neutral: "neutral";
|
|
73
|
+
}>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
66
75
|
detail: z.ZodOptional<z.ZodString>;
|
|
67
76
|
icon: z.ZodObject<{
|
|
68
77
|
glyph: z.ZodString;
|