@get-bb/plugin-sdk 0.4.34 → 0.4.40
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 +10 -0
- package/bundled-types/bb-plugin-sdk-app.d.ts +32 -3
- package/bundled-types/bb-plugin-sdk-host.d.ts +1 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +23 -9
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +3 -2
- package/bundled-types/bb-plugin-sdk-testing.d.ts +6 -2
- package/bundled-types/bb-plugin-sdk.d.ts +289 -92
- package/dist/internal/host-policy.js +89 -2
- package/dist/internal/plugin-app-collector.js +11 -0
- package/dist/provider-bridge-acp.js +135 -26
- package/dist/testing/app.js +11 -0
- package/dist/testing/index.js +147 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,16 @@ action id, or a surface with no side panel). A decline is a return value, never
|
|
|
65
65
|
a thrown error, so a plugin registering several kinds of action can share one
|
|
66
66
|
open routine and branch on the result.
|
|
67
67
|
|
|
68
|
+
Use `app.slots.experimental_appOverlay({ id, component })` for additive,
|
|
69
|
+
app-wide floating React UI. BB mounts the component once per app window through
|
|
70
|
+
the normal plugin slot boundary, so SDK hooks and plugin CSS work and React
|
|
71
|
+
context survives portals. This app-level boundary includes the sidebar thread
|
|
72
|
+
data and action hooks. Hooks whose contract requires a particular surface,
|
|
73
|
+
including `useComposer` and `useComposerView`, remain limited to that surface.
|
|
74
|
+
The plugin owns the overlay's chrome, positioning, visibility, focus, and
|
|
75
|
+
responsive behavior; a crashing overlay is hidden without affecting siblings.
|
|
76
|
+
Use a content script for app-wide DOM behavior that does not need React context.
|
|
77
|
+
|
|
68
78
|
See the
|
|
69
79
|
[`composer-customization` reference plugin](../../examples/plugins/composer-customization/README.md)
|
|
70
80
|
for every region in one small app. The deprecated pre-1.0
|
|
@@ -35,7 +35,7 @@ interface PluginRpcError {
|
|
|
35
35
|
issues?: PluginRpcValidationIssue[];
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* The validator-neutral subset of Standard Schema v1 used by plugin
|
|
38
|
+
* The validator-neutral subset of Standard Schema v1 used by plugin contracts.
|
|
39
39
|
* Zod 4 schemas implement this interface directly; other validators can do
|
|
40
40
|
* the same without becoming part of BB's public protocol.
|
|
41
41
|
*/
|
|
@@ -341,6 +341,14 @@ interface PluginHomepageSectionProps {
|
|
|
341
341
|
*/
|
|
342
342
|
interface PluginSettingsSectionProps {
|
|
343
343
|
}
|
|
344
|
+
/**
|
|
345
|
+
* Props passed to an `experimental_appOverlay` component.
|
|
346
|
+
*
|
|
347
|
+
* Deliberately empty while the component reads live app state through SDK
|
|
348
|
+
* hooks; versioned additive like the other slot props.
|
|
349
|
+
*/
|
|
350
|
+
interface ExperimentalAppOverlayProps {
|
|
351
|
+
}
|
|
344
352
|
/** Props passed to a `navPanel` component (it owns its whole route). */
|
|
345
353
|
interface PluginNavPanelProps {
|
|
346
354
|
/**
|
|
@@ -705,6 +713,21 @@ interface PluginSettingsSectionRegistration {
|
|
|
705
713
|
description?: string;
|
|
706
714
|
component: ComponentType<PluginSettingsSectionProps>;
|
|
707
715
|
}
|
|
716
|
+
/**
|
|
717
|
+
* Render app-wide plugin UI outside BB's layout regions.
|
|
718
|
+
*
|
|
719
|
+
* The host mounts each registration once per app window through the ordinary
|
|
720
|
+
* plugin React boundary. The component therefore keeps PluginContext, router,
|
|
721
|
+
* query, realtime, and other app-level SDK contexts when it renders fixed UI
|
|
722
|
+
* or creates a React portal. BB supplies no chrome, positioning, visibility,
|
|
723
|
+
* or interaction policy; the plugin owns those details and responsive
|
|
724
|
+
* behavior. Registrations are additive and a crash hides only that overlay.
|
|
725
|
+
*/
|
|
726
|
+
interface ExperimentalAppOverlayRegistration {
|
|
727
|
+
/** Unique within the plugin; letters, digits, `-`, `_`. */
|
|
728
|
+
id: string;
|
|
729
|
+
component: ComponentType<ExperimentalAppOverlayProps>;
|
|
730
|
+
}
|
|
708
731
|
/**
|
|
709
732
|
* Owner-defined validator for a fixed tab's transient target. The host first
|
|
710
733
|
* verifies that the value is JSON-safe, then calls this validator before
|
|
@@ -1522,6 +1545,12 @@ interface PluginTimelineRendererRegistration {
|
|
|
1522
1545
|
interface PluginAppSlots {
|
|
1523
1546
|
homepageSection(registration: PluginHomepageSectionRegistration): void;
|
|
1524
1547
|
settingsSection(registration: PluginSettingsSectionRegistration): void;
|
|
1548
|
+
/**
|
|
1549
|
+
* Render one app-wide overlay component (see
|
|
1550
|
+
* {@link ExperimentalAppOverlayRegistration}). Experimental: see
|
|
1551
|
+
* docs/api_to_audit.md.
|
|
1552
|
+
*/
|
|
1553
|
+
experimental_appOverlay(registration: ExperimentalAppOverlayRegistration): void;
|
|
1525
1554
|
navPanel(registration: PluginNavPanelRegistration): void;
|
|
1526
1555
|
/**
|
|
1527
1556
|
* Add an action to an existing thread's panel launcher. This slot is
|
|
@@ -1661,7 +1690,7 @@ interface PluginSettingsState {
|
|
|
1661
1690
|
* Effective non-secret setting values (secret settings are excluded —
|
|
1662
1691
|
* read them server-side). Undefined while loading or unavailable.
|
|
1663
1692
|
*/
|
|
1664
|
-
values: Record<string, string | boolean> | undefined;
|
|
1693
|
+
values: Record<string, string | number | boolean> | undefined;
|
|
1665
1694
|
isLoading: boolean;
|
|
1666
1695
|
}
|
|
1667
1696
|
/** State of the app's shared realtime connection to the bb server. */
|
|
@@ -2441,4 +2470,4 @@ declare const experimental_useProviders: () => PluginProvidersState;
|
|
|
2441
2470
|
declare const experimental_useCodeTheme: () => PluginCodeThemeState;
|
|
2442
2471
|
|
|
2443
2472
|
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 };
|
|
2444
|
-
export type { BbContext, BbNavigate, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, 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 };
|
|
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 };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The validator-neutral subset of Standard Schema v1 used by plugin
|
|
11
|
+
* The validator-neutral subset of Standard Schema v1 used by plugin contracts.
|
|
12
12
|
* Zod 4 schemas implement this interface directly; other validators can do
|
|
13
13
|
* the same without becoming part of BB's public protocol.
|
|
14
14
|
*/
|
|
@@ -459,7 +459,7 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
|
459
459
|
};
|
|
460
460
|
|
|
461
461
|
/**
|
|
462
|
-
* The validator-neutral subset of Standard Schema v1 used by plugin
|
|
462
|
+
* The validator-neutral subset of Standard Schema v1 used by plugin contracts.
|
|
463
463
|
* Zod 4 schemas implement this interface directly; other validators can do
|
|
464
464
|
* the same without becoming part of BB's public protocol.
|
|
465
465
|
*/
|
|
@@ -491,11 +491,6 @@ interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = Standar
|
|
|
491
491
|
readonly output: OutputSchema;
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
/**
|
|
495
|
-
* Declarative settings descriptors (`bb.settings.define`). Deliberately plain
|
|
496
|
-
* data — not zod — so the host can render settings forms and the CLI can
|
|
497
|
-
* parse values without executing plugin code.
|
|
498
|
-
*/
|
|
499
494
|
type PluginSettingDescriptor = {
|
|
500
495
|
type: "string";
|
|
501
496
|
label: string;
|
|
@@ -507,26 +502,40 @@ type PluginSettingDescriptor = {
|
|
|
507
502
|
* be multi-line.
|
|
508
503
|
*/
|
|
509
504
|
experimental_multiline?: boolean;
|
|
505
|
+
/** Synchronously validate without transforming a proposed value. */
|
|
506
|
+
experimental_schema?: StandardSchemaV1<string, string>;
|
|
510
507
|
default?: string;
|
|
511
508
|
} | {
|
|
512
509
|
type: "boolean";
|
|
513
510
|
label: string;
|
|
514
511
|
description?: string;
|
|
512
|
+
/** Synchronously validate without transforming a proposed value. */
|
|
513
|
+
experimental_schema?: StandardSchemaV1<boolean, boolean>;
|
|
515
514
|
default?: boolean;
|
|
515
|
+
} | {
|
|
516
|
+
type: "number";
|
|
517
|
+
label: string;
|
|
518
|
+
description?: string;
|
|
519
|
+
experimental_schema?: StandardSchemaV1<number, number>;
|
|
520
|
+
default?: number;
|
|
516
521
|
} | {
|
|
517
522
|
type: "select";
|
|
518
523
|
label: string;
|
|
519
524
|
description?: string;
|
|
520
525
|
options: string[];
|
|
526
|
+
/** Synchronously validate without transforming a proposed value. */
|
|
527
|
+
experimental_schema?: StandardSchemaV1<string, string>;
|
|
521
528
|
default?: string;
|
|
522
529
|
} | {
|
|
523
530
|
type: "project";
|
|
524
531
|
label: string;
|
|
525
532
|
description?: string;
|
|
533
|
+
/** Synchronously validate without transforming a proposed value. */
|
|
534
|
+
experimental_schema?: StandardSchemaV1<string, string>;
|
|
526
535
|
default?: string;
|
|
527
536
|
};
|
|
528
537
|
type PluginSettingDescriptors = Record<string, PluginSettingDescriptor>;
|
|
529
|
-
type PluginSettingValue = string | boolean;
|
|
538
|
+
type PluginSettingValue = string | number | boolean;
|
|
530
539
|
/**
|
|
531
540
|
* What a `message.dispatch` hook answers.
|
|
532
541
|
*
|
|
@@ -1227,7 +1236,12 @@ declare function isStandardSchema(value: unknown): value is StandardSchemaV1;
|
|
|
1227
1236
|
declare function readRpcMethodContract(method: string, value: unknown): PluginRpcMethodContract;
|
|
1228
1237
|
/** Duck-typed zod detection: plugin sources may carry their own zod copy,
|
|
1229
1238
|
* so instanceof is useless — anything with safeParse is treated as zod. */
|
|
1230
|
-
|
|
1239
|
+
type ZodSchemaLike = {
|
|
1240
|
+
safeParse: z.ZodType["safeParse"];
|
|
1241
|
+
toJSONSchema?: z.ZodType["toJSONSchema"];
|
|
1242
|
+
};
|
|
1243
|
+
declare function isZodSchemaLike(value: unknown): value is ZodSchemaLike;
|
|
1244
|
+
declare function zodSchemaToJsonSchema(schema: ZodSchemaLike): unknown;
|
|
1231
1245
|
/**
|
|
1232
1246
|
* Reject recursive local references before a tool schema reaches a provider.
|
|
1233
1247
|
* Some providers reject the complete tool list when any one schema contains a
|
|
@@ -1312,5 +1326,5 @@ declare function storePluginHook<K extends PluginHookName>(records: {
|
|
|
1312
1326
|
/** The refusal a second handler for one hook from one plugin gets. */
|
|
1313
1327
|
declare function pluginHookAlreadyRegisteredMessage(hook: PluginHookName): string;
|
|
1314
1328
|
|
|
1315
|
-
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 };
|
|
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 };
|
|
1316
1330
|
export type { AiServiceHostBinding, NormalizedPluginProviderDeclaration };
|
|
@@ -5,12 +5,13 @@
|
|
|
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, 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 { 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
10
|
/** Validated registrations produced by one plugin app setup execution. */
|
|
11
11
|
interface CollectedPluginAppRegistrations {
|
|
12
12
|
homepageSections: PluginHomepageSectionRegistration[];
|
|
13
13
|
settingsSections: PluginSettingsSectionRegistration[];
|
|
14
|
+
appOverlays: ExperimentalAppOverlayRegistration[];
|
|
14
15
|
navPanels: PluginNavPanelRegistration[];
|
|
15
16
|
threadPanelActions: PluginThreadPanelActionRegistration[];
|
|
16
17
|
newThreadPanelActions: PluginNewThreadPanelActionRegistration[];
|
|
@@ -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, 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 { 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
11
|
|
|
12
12
|
/**
|
|
13
13
|
* `@get-bb/plugin-sdk/testing/app` — the frontend plugin test harness. Tests a
|
|
@@ -118,6 +118,7 @@ declare function installTestPluginRuntime(): void;
|
|
|
118
118
|
interface CapturedPluginApp {
|
|
119
119
|
homepageSections: PluginHomepageSectionRegistration[];
|
|
120
120
|
settingsSections: PluginSettingsSectionRegistration[];
|
|
121
|
+
appOverlays: ExperimentalAppOverlayRegistration[];
|
|
121
122
|
navPanels: PluginNavPanelRegistration[];
|
|
122
123
|
threadPanelActions: PluginThreadPanelActionRegistration[];
|
|
123
124
|
newThreadPanelActions: PluginNewThreadPanelActionRegistration[];
|
|
@@ -192,7 +193,7 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
|
|
|
192
193
|
*/
|
|
193
194
|
rpc?: PluginRpcTestHandlers<Contract>;
|
|
194
195
|
/** `useSettings()` values; omitted → `{ values: undefined, isLoading: false }`. */
|
|
195
|
-
settings?: Record<string, string | boolean>;
|
|
196
|
+
settings?: Record<string, string | number | boolean>;
|
|
196
197
|
/** `useBbContext()` selection; both default to null. */
|
|
197
198
|
context?: {
|
|
198
199
|
projectId?: string | null;
|
|
@@ -74,7 +74,7 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
* The validator-neutral subset of Standard Schema v1 used by plugin
|
|
77
|
+
* The validator-neutral subset of Standard Schema v1 used by plugin contracts.
|
|
78
78
|
* Zod 4 schemas implement this interface directly; other validators can do
|
|
79
79
|
* the same without becoming part of BB's public protocol.
|
|
80
80
|
*/
|
|
@@ -102,7 +102,7 @@ interface StandardSchemaV1Issue {
|
|
|
102
102
|
})[];
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
type PluginSettingValue = string | boolean;
|
|
105
|
+
type PluginSettingValue = string | number | boolean;
|
|
106
106
|
/**
|
|
107
107
|
* Permission modes a provider can run a session in — BB's own permission
|
|
108
108
|
* vocabulary, ordered least ("accept-edits") to most ("full") privileged.
|
|
@@ -770,6 +770,10 @@ interface FakePluginHarness extends FakePluginInspectionState, FakePluginBehavio
|
|
|
770
770
|
interface CreateFakePluginHostOptions {
|
|
771
771
|
/** Defaults to "test-plugin". */
|
|
772
772
|
pluginId?: string;
|
|
773
|
+
/**
|
|
774
|
+
* Value served by `bb.server.experimental_appUrl`. Defaults to `null`.
|
|
775
|
+
*/
|
|
776
|
+
appUrl?: string | null;
|
|
773
777
|
/**
|
|
774
778
|
* Value served by `bb.server.loopbackBaseUrl` (always bound here, like
|
|
775
779
|
* `bb.sdk`). Defaults to "http://127.0.0.1:38886".
|