@get-bb/plugin-sdk 0.4.87 → 0.4.94
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 +81 -31
- package/bundled-types/bb-plugin-sdk-host.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +51 -2
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +16 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +8 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +10 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +3 -4
- package/bundled-types/bb-plugin-sdk-testing.d.ts +27 -6
- package/bundled-types/bb-plugin-sdk.d.ts +171 -42
- package/dist/internal/host-policy.js +63 -2
- package/dist/internal/plugin-app-collector.js +13834 -22
- package/dist/provider-bridge-acp.js +384 -306
- package/dist/provider-bridge-testing.js +2 -0
- package/dist/provider-bridge.js +393 -377
- package/dist/testing/app.js +13987 -175
- package/dist/testing/index.js +70 -4
- package/package.json +1 -1
|
@@ -52,6 +52,14 @@ interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
|
52
52
|
readonly version: 1;
|
|
53
53
|
readonly vendor: string;
|
|
54
54
|
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
55
|
+
readonly jsonSchema?: {
|
|
56
|
+
readonly input: (options: {
|
|
57
|
+
target: string;
|
|
58
|
+
}) => Record<string, unknown>;
|
|
59
|
+
readonly output: (options: {
|
|
60
|
+
target: string;
|
|
61
|
+
}) => Record<string, unknown>;
|
|
62
|
+
};
|
|
55
63
|
readonly types?: {
|
|
56
64
|
readonly input: Input;
|
|
57
65
|
readonly output: Output;
|
|
@@ -73,6 +81,7 @@ interface StandardSchemaV1Issue {
|
|
|
73
81
|
type StandardSchemaV1InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
74
82
|
type StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
75
83
|
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
84
|
+
readonly experimental_description?: string;
|
|
76
85
|
readonly input: InputSchema;
|
|
77
86
|
readonly output: OutputSchema;
|
|
78
87
|
}
|
|
@@ -566,6 +575,16 @@ interface PluginThreadHeaderActionProps {
|
|
|
566
575
|
*/
|
|
567
576
|
isCompactViewport: boolean;
|
|
568
577
|
}
|
|
578
|
+
interface ExperimentalPluginBrowserToolbarActionProps {
|
|
579
|
+
/** Thread that owns the Browser tab. */
|
|
580
|
+
threadId: string;
|
|
581
|
+
/** Browser tab currently rendering the action. */
|
|
582
|
+
tabId: string;
|
|
583
|
+
/** Current top-level URL shown in the address bar. */
|
|
584
|
+
url: string;
|
|
585
|
+
/** True when the Browser chrome needs compact controls. */
|
|
586
|
+
isCompactViewport: boolean;
|
|
587
|
+
}
|
|
569
588
|
/**
|
|
570
589
|
* Where a file being opened by a `fileOpener` lives. `path` semantics follow
|
|
571
590
|
* the source: workspace paths are relative to the environment's worktree,
|
|
@@ -1289,6 +1308,14 @@ interface PluginThreadHeaderActionRegistration {
|
|
|
1289
1308
|
title: string;
|
|
1290
1309
|
component: ComponentType<PluginThreadHeaderActionProps>;
|
|
1291
1310
|
}
|
|
1311
|
+
interface ExperimentalPluginBrowserToolbarActionRegistration {
|
|
1312
|
+
/** Unique within the plugin; letters, digits, `-`, `_`. */
|
|
1313
|
+
id: string;
|
|
1314
|
+
/** Accessible name for the host-wrapped control group. */
|
|
1315
|
+
title: string;
|
|
1316
|
+
/** Component rendered beside the Browser address bar. */
|
|
1317
|
+
component: ComponentType<ExperimentalPluginBrowserToolbarActionProps>;
|
|
1318
|
+
}
|
|
1292
1319
|
/** One pane's place in the split layout, as fractions of the split area. */
|
|
1293
1320
|
interface PluginSidebarSplitPane {
|
|
1294
1321
|
paneId: string;
|
|
@@ -1501,8 +1528,8 @@ interface PluginMessageActionRegistration {
|
|
|
1501
1528
|
*/
|
|
1502
1529
|
run(context: PluginMessageActionContext): void | Promise<void>;
|
|
1503
1530
|
}
|
|
1504
|
-
/**
|
|
1505
|
-
interface
|
|
1531
|
+
/** Current context for palette and keyboard command invocations. */
|
|
1532
|
+
interface PluginCommandContext {
|
|
1506
1533
|
/** The thread in view, or null on a surface without one. */
|
|
1507
1534
|
threadId: string | null;
|
|
1508
1535
|
projectId: string | null;
|
|
@@ -1518,27 +1545,49 @@ interface PluginCommandPaletteActionContext {
|
|
|
1518
1545
|
*/
|
|
1519
1546
|
openPanel(options: PluginTargetedPanelActionOpenOptions): boolean;
|
|
1520
1547
|
}
|
|
1548
|
+
/** A default keyboard shortcut. Omitted modifiers are false. */
|
|
1549
|
+
interface PluginCommandShortcut {
|
|
1550
|
+
key: string;
|
|
1551
|
+
/** Command on macOS, Control elsewhere. */
|
|
1552
|
+
mod?: boolean;
|
|
1553
|
+
meta?: boolean;
|
|
1554
|
+
control?: boolean;
|
|
1555
|
+
alt?: boolean;
|
|
1556
|
+
shift?: boolean;
|
|
1557
|
+
}
|
|
1521
1558
|
/**
|
|
1522
|
-
* A
|
|
1559
|
+
* A command registered with `app.commands.register`, listed in bb's quick
|
|
1560
|
+
* palette (Mod+Shift+P) under the plugin's name
|
|
1523
1561
|
* beside bb's own commands. Host-rendered: the plugin supplies a title and
|
|
1524
1562
|
* `run`, and the host owns matching, ordering, and recency.
|
|
1525
1563
|
*/
|
|
1526
|
-
interface
|
|
1564
|
+
interface PluginCommandRegistration {
|
|
1565
|
+
/** Initial keyboard binding. Users can rebind every command, including ones without a default. Conflicting defaults remain unbound. */
|
|
1566
|
+
defaultShortcut?: PluginCommandShortcut;
|
|
1527
1567
|
/** Unique within the plugin; letters, digits, `-`, `_`. */
|
|
1528
1568
|
id: string;
|
|
1529
1569
|
/** The row's label, e.g. "Linear: open issue for this thread". */
|
|
1530
1570
|
title: string;
|
|
1531
1571
|
/**
|
|
1532
1572
|
* Hide the row when it cannot do anything — typically when it needs a thread
|
|
1533
|
-
* and there is none. Called
|
|
1534
|
-
* synchronous. Omitted means always listed.
|
|
1573
|
+
* and there is none. Called before palette listing and keyboard invocation;
|
|
1574
|
+
* keep it cheap and synchronous. Omitted means always listed.
|
|
1535
1575
|
*/
|
|
1536
|
-
isAvailable?(context:
|
|
1576
|
+
isAvailable?(context: PluginCommandContext): boolean;
|
|
1537
1577
|
/**
|
|
1538
|
-
* Runs after the palette closes and focus is
|
|
1539
|
-
* async) are contained and logged; they never break the palette.
|
|
1578
|
+
* Runs on keyboard invocation, or after the palette closes and focus is
|
|
1579
|
+
* restored. Errors (sync or async) are contained and logged; they never break the palette.
|
|
1540
1580
|
*/
|
|
1541
|
-
run(context:
|
|
1581
|
+
run(context: PluginCommandContext): void | Promise<void>;
|
|
1582
|
+
}
|
|
1583
|
+
/** @deprecated Use PluginCommandContext. */
|
|
1584
|
+
type PluginCommandPaletteActionContext = PluginCommandContext;
|
|
1585
|
+
/** @deprecated Use PluginCommandRegistration. */
|
|
1586
|
+
type PluginCommandPaletteActionRegistration = PluginCommandRegistration;
|
|
1587
|
+
/** Registers commands for bb's command palette. */
|
|
1588
|
+
interface PluginAppCommands {
|
|
1589
|
+
/** Register a command. IDs are unique within this plugin, including legacy slot registrations. */
|
|
1590
|
+
register(registration: PluginCommandRegistration): void;
|
|
1542
1591
|
}
|
|
1543
1592
|
/**
|
|
1544
1593
|
* Supply an inline React mark for a provider. Agent, machine, and environment
|
|
@@ -1769,6 +1818,8 @@ interface PluginAppSlots {
|
|
|
1769
1818
|
* docs/api_to_audit.md.
|
|
1770
1819
|
*/
|
|
1771
1820
|
experimental_threadHeaderAction(registration: PluginThreadHeaderActionRegistration): void;
|
|
1821
|
+
/** Render a component beside each Browser tab's address bar. */
|
|
1822
|
+
experimental_browserToolbarAction(registration: ExperimentalPluginBrowserToolbarActionRegistration): void;
|
|
1772
1823
|
fileOpener(registration: PluginFileOpenerRegistration): void;
|
|
1773
1824
|
/**
|
|
1774
1825
|
* Replace BB's source-code renderer (see
|
|
@@ -1785,10 +1836,10 @@ interface PluginAppSlots {
|
|
|
1785
1836
|
messageDirective(registration: PluginMessageDirectiveRegistration): void;
|
|
1786
1837
|
messageAction(registration: PluginMessageActionRegistration): void;
|
|
1787
1838
|
/**
|
|
1788
|
-
*
|
|
1789
|
-
*
|
|
1839
|
+
* @deprecated Use `app.commands.register` with the same registration.
|
|
1840
|
+
* Both entry points share the same command registry and ID namespace.
|
|
1790
1841
|
*/
|
|
1791
|
-
commandPaletteAction(registration:
|
|
1842
|
+
commandPaletteAction(registration: PluginCommandRegistration): void;
|
|
1792
1843
|
/**
|
|
1793
1844
|
* Draw one agent, environment, or machine provider's icon with an inline
|
|
1794
1845
|
* React component instead of its masked logo asset (see
|
|
@@ -1920,6 +1971,7 @@ interface ExperimentalAppIcons {
|
|
|
1920
1971
|
}
|
|
1921
1972
|
interface PluginAppBuilder {
|
|
1922
1973
|
experimental_icons: ExperimentalAppIcons;
|
|
1974
|
+
commands: PluginAppCommands;
|
|
1923
1975
|
slots: PluginAppSlots;
|
|
1924
1976
|
composer: PluginAppComposer;
|
|
1925
1977
|
contentScripts: PluginAppContentScripts;
|
|
@@ -2126,7 +2178,7 @@ interface PluginComposerApi {
|
|
|
2126
2178
|
focus(): void;
|
|
2127
2179
|
/**
|
|
2128
2180
|
* Submit this composer's draft through the composer's OWN submit pipeline,
|
|
2129
|
-
*
|
|
2181
|
+
* optionally scheduling it or attaching plugin-owned dispatch data.
|
|
2130
2182
|
*
|
|
2131
2183
|
* This is a real submission, not a plugin-issued send: the host builds the
|
|
2132
2184
|
* request exactly as pressing Enter would, so the draft's attachments and
|
|
@@ -2136,12 +2188,11 @@ interface PluginComposerApi {
|
|
|
2136
2188
|
* tuple itself, which is why sending from the backend instead would silently
|
|
2137
2189
|
* run the message with different settings than the ones in front of the user.
|
|
2138
2190
|
*
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2141
|
-
*
|
|
2142
|
-
*
|
|
2143
|
-
*
|
|
2144
|
-
* plugin involvement.
|
|
2191
|
+
* `sendAt` queues the submission until that time. `experimental_data` is
|
|
2192
|
+
* opaque JSON delivered to dispatch hooks together with the calling plugin's
|
|
2193
|
+
* id on this initial attempt. Hooks run before operational core waits. If a
|
|
2194
|
+
* hook queues the message, its existing plugin wait identifies the owner on
|
|
2195
|
+
* later attempts; core does not persist or interpret the opaque data.
|
|
2145
2196
|
*
|
|
2146
2197
|
* Resolves once the host has accepted the submission and cleared the draft.
|
|
2147
2198
|
* Rejects when the composer refused to submit — a scope with no submit
|
|
@@ -2158,18 +2209,17 @@ interface PluginComposerApi {
|
|
|
2158
2209
|
/**
|
|
2159
2210
|
* What `experimental_submit` does differently from pressing Enter.
|
|
2160
2211
|
*
|
|
2161
|
-
*
|
|
2162
|
-
*
|
|
2163
|
-
*
|
|
2164
|
-
* button is a much larger surface than scheduling needs.
|
|
2212
|
+
* `experimental_data` is opaque JSON delivered to dispatch hooks. The runtime
|
|
2213
|
+
* associates it with the calling plugin automatically for the initial
|
|
2214
|
+
* dispatch attempt.
|
|
2165
2215
|
*/
|
|
2166
|
-
|
|
2167
|
-
/**
|
|
2168
|
-
* Epoch ms the submission should dispatch at. Must be in the future; the
|
|
2169
|
-
* host does not second-guess how far ahead it is.
|
|
2170
|
-
*/
|
|
2216
|
+
type ExperimentalComposerSubmitOptions = {
|
|
2171
2217
|
sendAt: number;
|
|
2172
|
-
|
|
2218
|
+
experimental_data?: JsonValue$1;
|
|
2219
|
+
} | {
|
|
2220
|
+
experimental_data: JsonValue$1;
|
|
2221
|
+
sendAt?: never;
|
|
2222
|
+
};
|
|
2173
2223
|
/**
|
|
2174
2224
|
* A consumer-supplied action on the messages of one `ThreadChat` instance,
|
|
2175
2225
|
* rendered in the embedded timeline's per-message action bar alongside the
|
|
@@ -2829,4 +2879,4 @@ declare const experimental_useProviders: () => PluginProvidersState;
|
|
|
2829
2879
|
declare const experimental_useCodeTheme: () => PluginCodeThemeState;
|
|
2830
2880
|
|
|
2831
2881
|
export { Markdown, ThreadChat, UrlLink, definePluginApp, experimental_BranchPicker, experimental_Diff, experimental_FileLink, experimental_Icon, experimental_NewThreadComposer, experimental_PermissionModePicker, experimental_ProviderIcon, experimental_ProviderModelPicker, experimental_SourceCode, experimental_useAppPanel, experimental_useBranches, experimental_useCheckoutState, experimental_useCodeTheme, experimental_useFixedTabTarget, experimental_useProviders, experimental_useSidebarThreadActions, experimental_useSidebarThreadPullRequest, experimental_useSidebarThreadSplit, experimental_useSidebarThreads, useBbContext, useBbNavigate, useComposer, useComposerView, useRealtime, useRealtimeConnectionState, useRpc, useSettings };
|
|
2832
|
-
export type { BbContext, BbNavigate, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginFixedTabReference, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue$1 as 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, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, 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, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginTargetedPanelActionOpenOptions, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, ReadonlyJsonValue, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
|
|
2882
|
+
export type { BbContext, BbNavigate, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue$1 as JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandPaletteActionContext, PluginCommandPaletteActionRegistration, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, 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, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginTargetedPanelActionOpenOptions, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, ReadonlyJsonValue, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
|
|
@@ -19,6 +19,14 @@ interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
|
19
19
|
readonly version: 1;
|
|
20
20
|
readonly vendor: string;
|
|
21
21
|
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
22
|
+
readonly jsonSchema?: {
|
|
23
|
+
readonly input: (options: {
|
|
24
|
+
target: string;
|
|
25
|
+
}) => Record<string, unknown>;
|
|
26
|
+
readonly output: (options: {
|
|
27
|
+
target: string;
|
|
28
|
+
}) => Record<string, unknown>;
|
|
29
|
+
};
|
|
22
30
|
readonly types?: {
|
|
23
31
|
readonly input: Input;
|
|
24
32
|
readonly output: Output;
|
|
@@ -40,6 +48,7 @@ interface StandardSchemaV1Issue {
|
|
|
40
48
|
type StandardSchemaV1InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
41
49
|
type StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
42
50
|
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
51
|
+
readonly experimental_description?: string;
|
|
43
52
|
readonly input: InputSchema;
|
|
44
53
|
readonly output: OutputSchema;
|
|
45
54
|
}
|
|
@@ -427,6 +427,8 @@ declare const threadQueuedMessageSchema: z.ZodObject<{
|
|
|
427
427
|
kind: z.ZodLiteral<"time">;
|
|
428
428
|
}, z.core.$strip>, z.ZodObject<{
|
|
429
429
|
kind: z.ZodLiteral<"thread-busy">;
|
|
430
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
431
|
+
kind: z.ZodLiteral<"stopping">;
|
|
430
432
|
}, z.core.$strip>, z.ZodObject<{
|
|
431
433
|
kind: z.ZodLiteral<"turn-starting">;
|
|
432
434
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -733,6 +735,14 @@ interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
|
733
735
|
readonly version: 1;
|
|
734
736
|
readonly vendor: string;
|
|
735
737
|
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
738
|
+
readonly jsonSchema?: {
|
|
739
|
+
readonly input: (options: {
|
|
740
|
+
target: string;
|
|
741
|
+
}) => Record<string, unknown>;
|
|
742
|
+
readonly output: (options: {
|
|
743
|
+
target: string;
|
|
744
|
+
}) => Record<string, unknown>;
|
|
745
|
+
};
|
|
736
746
|
readonly types?: {
|
|
737
747
|
readonly input: Input;
|
|
738
748
|
readonly output: Output;
|
|
@@ -751,6 +761,11 @@ interface StandardSchemaV1Issue {
|
|
|
751
761
|
readonly key: PropertyKey;
|
|
752
762
|
})[];
|
|
753
763
|
}
|
|
764
|
+
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
765
|
+
readonly experimental_description?: string;
|
|
766
|
+
readonly input: InputSchema;
|
|
767
|
+
readonly output: OutputSchema;
|
|
768
|
+
}
|
|
754
769
|
|
|
755
770
|
type PluginSettingDescriptor = {
|
|
756
771
|
type: "string";
|
|
@@ -1006,6 +1021,16 @@ interface MessageDispatchHookContext {
|
|
|
1006
1021
|
* double-count.
|
|
1007
1022
|
*/
|
|
1008
1023
|
queuedMessage: ThreadQueuedMessage | null;
|
|
1024
|
+
/**
|
|
1025
|
+
* Opaque JSON supplied by a plugin through the composer's
|
|
1026
|
+
* `experimental_submit`, paired with that plugin's id. Null for ordinary
|
|
1027
|
+
* submissions and queued re-attempts. Core does not persist or interpret
|
|
1028
|
+
* the data.
|
|
1029
|
+
*/
|
|
1030
|
+
experimental_submission: {
|
|
1031
|
+
pluginId: string;
|
|
1032
|
+
data: JsonValue;
|
|
1033
|
+
} | null;
|
|
1009
1034
|
/** How the dispatch was requested; null for internal/core-driven sends. */
|
|
1010
1035
|
origin: ThreadCreateOrigin | null;
|
|
1011
1036
|
originPluginId: string | null;
|
|
@@ -1509,6 +1534,16 @@ interface PluginMentionItem {
|
|
|
1509
1534
|
subtitle?: string;
|
|
1510
1535
|
icon?: string;
|
|
1511
1536
|
}
|
|
1537
|
+
/** Agent-only image context resolved with a plugin mention. */
|
|
1538
|
+
type ExperimentalPluginMentionImage = {
|
|
1539
|
+
type: "image";
|
|
1540
|
+
url: string;
|
|
1541
|
+
context?: string;
|
|
1542
|
+
} | {
|
|
1543
|
+
type: "localImage";
|
|
1544
|
+
path: string;
|
|
1545
|
+
context?: string;
|
|
1546
|
+
};
|
|
1512
1547
|
interface PluginMentionProviderRegistration {
|
|
1513
1548
|
/** Unique within this plugin: [a-zA-Z0-9_-]+ (no ":" — the host composes
|
|
1514
1549
|
* wire item ids as "<providerId>:<itemId>"). */
|
|
@@ -1535,8 +1570,10 @@ interface PluginMentionProviderRegistration {
|
|
|
1535
1570
|
*/
|
|
1536
1571
|
resolve(itemId: string): {
|
|
1537
1572
|
context: string;
|
|
1573
|
+
experimental_images?: readonly ExperimentalPluginMentionImage[];
|
|
1538
1574
|
} | Promise<{
|
|
1539
1575
|
context: string;
|
|
1576
|
+
experimental_images?: readonly ExperimentalPluginMentionImage[];
|
|
1540
1577
|
}>;
|
|
1541
1578
|
}
|
|
1542
1579
|
/**
|
|
@@ -1691,6 +1728,17 @@ declare function deriveValidatedProviderOptions(args: {
|
|
|
1691
1728
|
context: Parameters<NonNullable<PluginProviderDeclaration["deriveProviderOptions"]>>[0];
|
|
1692
1729
|
}): Readonly<Record<string, JsonValue>>;
|
|
1693
1730
|
declare function isStandardSchema(value: unknown): value is StandardSchemaV1;
|
|
1731
|
+
declare function readRpcPublicationOptions(value: unknown): {
|
|
1732
|
+
experimental_discoverable: boolean;
|
|
1733
|
+
experimental_description: string | null;
|
|
1734
|
+
};
|
|
1735
|
+
declare function publishRpcMethod(method: string, contract: PluginRpcMethodContract, options: ReturnType<typeof readRpcPublicationOptions>): {
|
|
1736
|
+
method: string;
|
|
1737
|
+
registrationDescription: string | null;
|
|
1738
|
+
methodDescription: string | null;
|
|
1739
|
+
inputSchema: Record<string, JsonValue$1>;
|
|
1740
|
+
outputSchema: Record<string, JsonValue$1>;
|
|
1741
|
+
} | null;
|
|
1694
1742
|
/**
|
|
1695
1743
|
* The declared shape of `presentation`, copied field by field so
|
|
1696
1744
|
* a plugin's object cannot smuggle prototypes or extra markup into the
|
|
@@ -1827,11 +1875,12 @@ declare function normalizeWebSocketRouteRegistration(path: string, handler: unkn
|
|
|
1827
1875
|
auth: PluginHttpAuthMode;
|
|
1828
1876
|
};
|
|
1829
1877
|
type RpcRegistrationRecord = {
|
|
1878
|
+
publication: ReturnType<typeof publishRpcMethod>;
|
|
1830
1879
|
inputSchema: StandardSchemaV1;
|
|
1831
1880
|
outputSchema: StandardSchemaV1;
|
|
1832
1881
|
handler: (input: unknown) => unknown;
|
|
1833
1882
|
};
|
|
1834
|
-
declare function normalizeRpcRegistration(contract: unknown, handlers: unknown, registered: ReadonlyMap<string, unknown
|
|
1883
|
+
declare function normalizeRpcRegistration(contract: unknown, handlers: unknown, registered: ReadonlyMap<string, unknown>, options: unknown): Array<[string, RpcRegistrationRecord]>;
|
|
1835
1884
|
declare function normalizeRealtimePayload(channel: string, payload: unknown): unknown;
|
|
1836
1885
|
declare function validateBackgroundServiceRegistration(name: string, service: {
|
|
1837
1886
|
start(signal: AbortSignal): void | Promise<void>;
|
|
@@ -1913,5 +1962,5 @@ declare function normalizePluginAgentConfiguration(args: {
|
|
|
1913
1962
|
declare function validateRpcValue(schema: StandardSchemaV1, value: unknown, phase: "input" | "output", fail: (error: PluginRpcError) => never): Promise<unknown>;
|
|
1914
1963
|
declare function normalizeRpcJsonResult(value: unknown, fail: (error: PluginRpcError) => never): JsonValue;
|
|
1915
1964
|
|
|
1916
|
-
export { ENVIRONMENT_PROVIDER_DESCRIPTION_MAX_CHARS, ENVIRONMENT_PROVIDER_DISPLAY_NAME_MAX_CHARS, ENVIRONMENT_PROVIDER_ID_PATTERN, ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES, KV_VALUE_MAX_BYTES, MACHINE_PROVIDER_DESCRIPTION_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, 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, SERVER_DIRECT_AI_SERVICE_IDS, SETTING_KEY_PATTERN, adoptHttpRouteResponse, aiServiceAlreadyRegisteredMessage, assertAiServiceRegistrable, coerceStoredPluginSettingValue, deriveValidatedProviderOptions, enforcePluginCliOutputLimit, environmentCompositionSchema, isPluginMentionTrigger, isStandardSchema, normalizeAgentToolRegistration, normalizeCliRegistration, normalizeHttpRouteRegistration, normalizeInteractionRequest, normalizeMentionProviderRegistration, normalizePluginAgentConfiguration, normalizeRealtimePayload, normalizeRpcJsonResult, normalizeRpcRegistration, normalizeWebSocketRouteRegistration, parsePluginAgentToolPresentation, pluginCliCollisionWarning, pluginHookAlreadyRegisteredMessage, providerAlreadyRegisteredMessage, providerIconRefusalMessage, providerWithoutBridgeMessage, registerSettingDescriptors, runPluginStorageMigrations, storePluginHook, summarizeStandardIssues, undeclaredIconProblem, validateBackgroundServiceRegistration, validatePluginAiServiceDeclaration, validatePluginEnvironmentProviderDeclaration, validatePluginMachineProviderDeclaration, validatePluginProviderDeclaration, validatePluginProviderEnvEntries, validateProviderEnvContribution, validateRpcValue, validateScheduleRegistration, validateServerAccessProviderDeclaration, validateSettingsUpdate };
|
|
1965
|
+
export { ENVIRONMENT_PROVIDER_DESCRIPTION_MAX_CHARS, ENVIRONMENT_PROVIDER_DISPLAY_NAME_MAX_CHARS, ENVIRONMENT_PROVIDER_ID_PATTERN, ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES, KV_VALUE_MAX_BYTES, MACHINE_PROVIDER_DESCRIPTION_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, 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, SERVER_DIRECT_AI_SERVICE_IDS, SETTING_KEY_PATTERN, adoptHttpRouteResponse, aiServiceAlreadyRegisteredMessage, assertAiServiceRegistrable, coerceStoredPluginSettingValue, deriveValidatedProviderOptions, enforcePluginCliOutputLimit, environmentCompositionSchema, isPluginMentionTrigger, isStandardSchema, normalizeAgentToolRegistration, normalizeCliRegistration, normalizeHttpRouteRegistration, normalizeInteractionRequest, normalizeMentionProviderRegistration, normalizePluginAgentConfiguration, normalizeRealtimePayload, normalizeRpcJsonResult, normalizeRpcRegistration, normalizeWebSocketRouteRegistration, parsePluginAgentToolPresentation, pluginCliCollisionWarning, pluginHookAlreadyRegisteredMessage, providerAlreadyRegisteredMessage, providerIconRefusalMessage, providerWithoutBridgeMessage, publishRpcMethod, readRpcPublicationOptions, registerSettingDescriptors, runPluginStorageMigrations, storePluginHook, summarizeStandardIssues, undeclaredIconProblem, validateBackgroundServiceRegistration, validatePluginAiServiceDeclaration, validatePluginEnvironmentProviderDeclaration, validatePluginMachineProviderDeclaration, validatePluginProviderDeclaration, validatePluginProviderEnvEntries, validateProviderEnvContribution, validateRpcValue, validateScheduleRegistration, validateServerAccessProviderDeclaration, validateSettingsUpdate };
|
|
1917
1966
|
export type { AiServiceHostBinding, NormalizedPluginEnvironmentComposition, NormalizedPluginEnvironmentProvider, NormalizedPluginEnvironmentProviderRequirements, NormalizedPluginMachineProvider, NormalizedPluginProviderDeclaration };
|
|
@@ -5,7 +5,8 @@
|
|
|
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 {
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
9
10
|
|
|
10
11
|
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
11
12
|
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
@@ -40,6 +41,17 @@ type CollectedPluginProviderIconRegistration = Omit<PluginProviderIconRegistrati
|
|
|
40
41
|
providerKind: PluginProviderIconRegistration["providerKind"] | "all";
|
|
41
42
|
};
|
|
42
43
|
/** Validated registrations produced by one plugin app setup execution. */
|
|
44
|
+
declare const commandShortcutSchema: z.ZodObject<{
|
|
45
|
+
alt: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
control: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
key: z.ZodString;
|
|
48
|
+
meta: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
mod: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
shift: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
interface CollectedPluginCommandRegistration extends Omit<PluginCommandRegistration, "defaultShortcut"> {
|
|
53
|
+
defaultShortcut: z.infer<typeof commandShortcutSchema> | null;
|
|
54
|
+
}
|
|
43
55
|
interface CollectedPluginAppRegistrations {
|
|
44
56
|
homepageSections: PluginHomepageSectionRegistration[];
|
|
45
57
|
settingsSections: PluginSettingsSectionRegistration[];
|
|
@@ -54,12 +66,13 @@ interface CollectedPluginAppRegistrations {
|
|
|
54
66
|
experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
|
|
55
67
|
threadLists: PluginThreadListRegistration[];
|
|
56
68
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
69
|
+
browserToolbarActions: ExperimentalPluginBrowserToolbarActionRegistration[];
|
|
57
70
|
fileOpeners: PluginFileOpenerRegistration[];
|
|
58
71
|
sourceCodeRenderers: PluginSourceCodeRendererRegistration[];
|
|
59
72
|
diffRenderers: PluginDiffRendererRegistration[];
|
|
60
73
|
messageDirectives: PluginMessageDirectiveRegistration[];
|
|
61
74
|
messageActions: PluginMessageActionRegistration[];
|
|
62
|
-
commandPaletteActions:
|
|
75
|
+
commandPaletteActions: CollectedPluginCommandRegistration[];
|
|
63
76
|
providerIcons: CollectedPluginProviderIconRegistration[];
|
|
64
77
|
icons: ExperimentalIconRegistration[];
|
|
65
78
|
timelineRenderers: PluginTimelineRendererRegistration[];
|
|
@@ -77,4 +90,4 @@ declare function getCollectedSidebarFooterItems(registrations: object): readonly
|
|
|
77
90
|
declare function collectPluginAppRegistrations(definition: PluginAppDefinition, onComposerCustomizationRejected?: (reason: string) => void): CollectedPluginAppRegistrations;
|
|
78
91
|
|
|
79
92
|
export { adaptSidebarFooterAction, collectPluginAppRegistrations, getCollectedSidebarFooterItems };
|
|
80
|
-
export type { CollectedCompatibilitySidebarFooterItem, CollectedExperimentalSidebarFooterItem, CollectedManagedSidebarFooterItem, CollectedPluginAppRegistrations, CollectedPluginProviderIconRegistration, CollectedSidebarFooterItem, ExperimentalSidebarFooterCommandKind, ExperimentalSidebarFooterItemRuntime, ExperimentalSidebarFooterRuntimeSnapshot };
|
|
93
|
+
export type { CollectedCompatibilitySidebarFooterItem, CollectedExperimentalSidebarFooterItem, CollectedManagedSidebarFooterItem, CollectedPluginAppRegistrations, CollectedPluginCommandRegistration, CollectedPluginProviderIconRegistration, CollectedSidebarFooterItem, ExperimentalSidebarFooterCommandKind, ExperimentalSidebarFooterItemRuntime, ExperimentalSidebarFooterRuntimeSnapshot };
|
|
@@ -3132,6 +3132,8 @@ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.
|
|
|
3132
3132
|
threadId: z.ZodString;
|
|
3133
3133
|
tokenUsage: z.ZodObject<{
|
|
3134
3134
|
last: z.ZodObject<{
|
|
3135
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3136
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3135
3137
|
cachedInputTokens: z.ZodNumber;
|
|
3136
3138
|
inputTokens: z.ZodNumber;
|
|
3137
3139
|
outputTokens: z.ZodNumber;
|
|
@@ -3140,6 +3142,8 @@ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.
|
|
|
3140
3142
|
}, z.core.$strip>;
|
|
3141
3143
|
modelContextWindow: z.ZodNullable<z.ZodNumber>;
|
|
3142
3144
|
total: z.ZodObject<{
|
|
3145
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3146
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3143
3147
|
cachedInputTokens: z.ZodNumber;
|
|
3144
3148
|
inputTokens: z.ZodNumber;
|
|
3145
3149
|
outputTokens: z.ZodNumber;
|
|
@@ -4732,6 +4736,8 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4732
4736
|
}, z.core.$strip>, z.ZodObject<{
|
|
4733
4737
|
kind: z.ZodLiteral<"usage">;
|
|
4734
4738
|
last: z.ZodObject<{
|
|
4739
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4740
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4735
4741
|
cachedInputTokens: z.ZodNumber;
|
|
4736
4742
|
inputTokens: z.ZodNumber;
|
|
4737
4743
|
outputTokens: z.ZodNumber;
|
|
@@ -4741,6 +4747,8 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4741
4747
|
modelContextWindow: z.ZodNullable<z.ZodNumber>;
|
|
4742
4748
|
providerTurnId: z.ZodOptional<z.ZodString>;
|
|
4743
4749
|
total: z.ZodObject<{
|
|
4750
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4751
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4744
4752
|
cachedInputTokens: z.ZodNumber;
|
|
4745
4753
|
inputTokens: z.ZodNumber;
|
|
4746
4754
|
outputTokens: z.ZodNumber;
|
|
@@ -414,6 +414,8 @@ declare const threadEventUserContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
414
414
|
}, z.core.$strip>], "type">;
|
|
415
415
|
type ThreadEventUserContent = z.infer<typeof threadEventUserContentSchema>;
|
|
416
416
|
declare const threadEventTokenUsageBreakdownSchema: z.ZodObject<{
|
|
417
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
417
419
|
cachedInputTokens: z.ZodNumber;
|
|
418
420
|
inputTokens: z.ZodNumber;
|
|
419
421
|
outputTokens: z.ZodNumber;
|
|
@@ -2912,6 +2914,8 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2912
2914
|
}, z.core.$strip>, z.ZodObject<{
|
|
2913
2915
|
kind: z.ZodLiteral<"usage">;
|
|
2914
2916
|
last: z.ZodObject<{
|
|
2917
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2918
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2915
2919
|
cachedInputTokens: z.ZodNumber;
|
|
2916
2920
|
inputTokens: z.ZodNumber;
|
|
2917
2921
|
outputTokens: z.ZodNumber;
|
|
@@ -2921,6 +2925,8 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2921
2925
|
modelContextWindow: z.ZodNullable<z.ZodNumber>;
|
|
2922
2926
|
providerTurnId: z.ZodOptional<z.ZodString>;
|
|
2923
2927
|
total: z.ZodObject<{
|
|
2928
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2929
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2924
2930
|
cachedInputTokens: z.ZodNumber;
|
|
2925
2931
|
inputTokens: z.ZodNumber;
|
|
2926
2932
|
outputTokens: z.ZodNumber;
|
|
@@ -3753,6 +3759,8 @@ declare const threadDeltaNotificationParamsSchema: z.ZodObject<{
|
|
|
3753
3759
|
}, z.core.$strip>, z.ZodObject<{
|
|
3754
3760
|
kind: z.ZodLiteral<"usage">;
|
|
3755
3761
|
last: z.ZodObject<{
|
|
3762
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3763
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3756
3764
|
cachedInputTokens: z.ZodNumber;
|
|
3757
3765
|
inputTokens: z.ZodNumber;
|
|
3758
3766
|
outputTokens: z.ZodNumber;
|
|
@@ -3762,6 +3770,8 @@ declare const threadDeltaNotificationParamsSchema: z.ZodObject<{
|
|
|
3762
3770
|
modelContextWindow: z.ZodNullable<z.ZodNumber>;
|
|
3763
3771
|
providerTurnId: z.ZodOptional<z.ZodString>;
|
|
3764
3772
|
total: z.ZodObject<{
|
|
3773
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3774
|
+
cacheWriteInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3765
3775
|
cachedInputTokens: z.ZodNumber;
|
|
3766
3776
|
inputTokens: z.ZodNumber;
|
|
3767
3777
|
outputTokens: z.ZodNumber;
|
|
@@ -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, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
10
|
+
import { ExperimentalSidebarFooterItemRegistration, PluginProviderIconRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, ExperimentalComposerSubmitOptions, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
11
11
|
|
|
12
12
|
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
13
13
|
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
@@ -115,9 +115,7 @@ interface ComposerLog {
|
|
|
115
115
|
* has no submit pipeline of its own, so it records the options and clears the
|
|
116
116
|
* draft — enough to assert what a picker scheduled and that it tidied up.
|
|
117
117
|
*/
|
|
118
|
-
submits:
|
|
119
|
-
sendAt: number;
|
|
120
|
-
}>;
|
|
118
|
+
submits: ExperimentalComposerSubmitOptions[];
|
|
121
119
|
}
|
|
122
120
|
/** One recorded `experimental_useSidebarThreadActions()` call. */
|
|
123
121
|
interface SidebarActionCall {
|
|
@@ -148,6 +146,7 @@ interface CapturedPluginApp {
|
|
|
148
146
|
experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
|
|
149
147
|
threadLists: PluginThreadListRegistration[];
|
|
150
148
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
149
|
+
browserToolbarActions: ExperimentalPluginBrowserToolbarActionRegistration[];
|
|
151
150
|
fileOpeners: PluginFileOpenerRegistration[];
|
|
152
151
|
sourceCodeRenderers: PluginSourceCodeRendererRegistration[];
|
|
153
152
|
diffRenderers: PluginDiffRendererRegistration[];
|
|
@@ -5,7 +5,7 @@
|
|
|
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 { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
8
|
+
import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginMentionProviderRegistration, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
|
|
11
11
|
type PluginMachineProviderResource = Exclude<JsonValue$2, null>;
|
|
@@ -468,6 +468,14 @@ interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
|
468
468
|
readonly version: 1;
|
|
469
469
|
readonly vendor: string;
|
|
470
470
|
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
471
|
+
readonly jsonSchema?: {
|
|
472
|
+
readonly input: (options: {
|
|
473
|
+
target: string;
|
|
474
|
+
}) => Record<string, unknown>;
|
|
475
|
+
readonly output: (options: {
|
|
476
|
+
target: string;
|
|
477
|
+
}) => Record<string, unknown>;
|
|
478
|
+
};
|
|
471
479
|
readonly types?: {
|
|
472
480
|
readonly input: Input;
|
|
473
481
|
readonly output: Output;
|
|
@@ -486,6 +494,11 @@ interface StandardSchemaV1Issue {
|
|
|
486
494
|
readonly key: PropertyKey;
|
|
487
495
|
})[];
|
|
488
496
|
}
|
|
497
|
+
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
498
|
+
readonly experimental_description?: string;
|
|
499
|
+
readonly input: InputSchema;
|
|
500
|
+
readonly output: OutputSchema;
|
|
501
|
+
}
|
|
489
502
|
|
|
490
503
|
type PluginSettingValue = string | number | boolean;
|
|
491
504
|
/**
|
|
@@ -917,6 +930,17 @@ type NormalizedPluginProviderDeclaration = Omit<PluginProviderDeclaration, "expe
|
|
|
917
930
|
readonly scope: PluginProviderModelCatalogScope;
|
|
918
931
|
};
|
|
919
932
|
};
|
|
933
|
+
declare function readRpcPublicationOptions(value: unknown): {
|
|
934
|
+
experimental_discoverable: boolean;
|
|
935
|
+
experimental_description: string | null;
|
|
936
|
+
};
|
|
937
|
+
declare function publishRpcMethod(method: string, contract: PluginRpcMethodContract, options: ReturnType<typeof readRpcPublicationOptions>): {
|
|
938
|
+
method: string;
|
|
939
|
+
registrationDescription: string | null;
|
|
940
|
+
methodDescription: string | null;
|
|
941
|
+
inputSchema: Record<string, JsonValue$1>;
|
|
942
|
+
outputSchema: Record<string, JsonValue$1>;
|
|
943
|
+
} | null;
|
|
920
944
|
declare const ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES: readonly ["projectCheckout", "gitCheckout", "gitRemote", "projectless"];
|
|
921
945
|
type NormalizedPluginEnvironmentProviderRequirements = {
|
|
922
946
|
[K in (typeof ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES)[number]]: boolean;
|
|
@@ -1107,11 +1131,7 @@ interface FakeMentionProviderRecord {
|
|
|
1107
1131
|
label: string;
|
|
1108
1132
|
triggers: readonly PluginMentionTrigger[];
|
|
1109
1133
|
search: (ctx: PluginMentionSearchContext) => PluginMentionItem[] | Promise<PluginMentionItem[]>;
|
|
1110
|
-
resolve:
|
|
1111
|
-
context: string;
|
|
1112
|
-
} | Promise<{
|
|
1113
|
-
context: string;
|
|
1114
|
-
}>;
|
|
1134
|
+
resolve: PluginMentionProviderRegistration["resolve"];
|
|
1115
1135
|
}
|
|
1116
1136
|
interface FakeRealtimeSignal {
|
|
1117
1137
|
channel: string;
|
|
@@ -1129,6 +1149,7 @@ interface FakePluginRegistrations {
|
|
|
1129
1149
|
settingsDescriptors: PluginSettingDescriptors;
|
|
1130
1150
|
httpRoutes: FakeHttpRouteRecord[];
|
|
1131
1151
|
websocketRoutes: ExperimentalFakeWebSocketRouteRecord[];
|
|
1152
|
+
experimental_publishedRpcMethods: Array<NonNullable<ReturnType<typeof publishRpcMethod>>>;
|
|
1132
1153
|
rpcMethods: string[];
|
|
1133
1154
|
services: FakeServiceRecord[];
|
|
1134
1155
|
schedules: FakeScheduleRecord[];
|