@get-bb/plugin-sdk 0.4.29 → 0.4.34

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.
@@ -398,6 +398,56 @@ interface PluginPendingInteractionProps {
398
398
  */
399
399
  interface PluginSidebarFooterActionProps {
400
400
  }
401
+ /** Display and accessibility metadata for a host-owned sidebar shortcut. */
402
+ interface ExperimentalSidebarNavigationShortcut {
403
+ label: string;
404
+ ariaKeyShortcuts: string;
405
+ }
406
+ /** Host-owned behavior represented by one sidebar navigation item. */
407
+ type ExperimentalSidebarNavigationAction = {
408
+ kind: "new-thread";
409
+ } | {
410
+ kind: "search-threads";
411
+ } | {
412
+ kind: "open-extensions";
413
+ } | {
414
+ kind: "open-plugin-panel";
415
+ pluginId: string;
416
+ panelId: string;
417
+ };
418
+ /** Semantic icon identity for one sidebar navigation item. */
419
+ type ExperimentalSidebarNavigationIcon = {
420
+ kind: "host";
421
+ name: "extensions" | "new-thread" | "search";
422
+ } | {
423
+ kind: "plugin";
424
+ pluginId: string;
425
+ icon: string | null;
426
+ };
427
+ /** One host-owned destination or action a plugin may arrange. */
428
+ interface ExperimentalSidebarNavigationItem {
429
+ id: string;
430
+ label: string;
431
+ icon: ExperimentalSidebarNavigationIcon;
432
+ action: ExperimentalSidebarNavigationAction;
433
+ isDisabled: boolean;
434
+ shortcut: ExperimentalSidebarNavigationShortcut | null;
435
+ experimental_splitProps: {
436
+ onPointerDown?: (event: react.PointerEvent<HTMLElement>) => void;
437
+ };
438
+ }
439
+ /** How the host should activate a sidebar navigation item. */
440
+ interface ExperimentalSidebarNavigationActivationOptions {
441
+ openInSplit: boolean;
442
+ }
443
+ /** Props passed to an `experimental_sidebarNavigation` component. */
444
+ interface ExperimentalSidebarNavigationProps {
445
+ items: readonly ExperimentalSidebarNavigationItem[];
446
+ activeItemId: string | null;
447
+ isCompactViewport: boolean;
448
+ experimental_activate(itemId: string, options: ExperimentalSidebarNavigationActivationOptions): void;
449
+ experimental_Original: ComponentType;
450
+ }
401
451
  /**
402
452
  * Props passed to an `experimental_threadList` component — the sidebar's
403
453
  * scrolling thread area, replaced wholesale by one plugin.
@@ -1175,6 +1225,16 @@ interface PluginThreadListRegistration {
1175
1225
  description?: string;
1176
1226
  component: ComponentType<PluginThreadListProps>;
1177
1227
  }
1228
+ /** Replace the bounded navigation controls above the sidebar thread list. */
1229
+ interface ExperimentalSidebarNavigationRegistration {
1230
+ /** Unique within the plugin; letters, digits, `-`, `_`. */
1231
+ id: string;
1232
+ /** Label shown in Settings → Appearance and capability details. */
1233
+ title: string;
1234
+ /** Optional one-line description shown with the provider choice. */
1235
+ description?: string;
1236
+ component: ComponentType<ExperimentalSidebarNavigationProps>;
1237
+ }
1178
1238
  /**
1179
1239
  * Register this plugin as a viewer/editor for file extensions. By default,
1180
1240
  * matching files render the first applicable opener in deterministic slot
@@ -1476,6 +1536,8 @@ interface PluginAppSlots {
1476
1536
  experimental_newThreadPanelAction(registration: PluginNewThreadPanelActionRegistration): void;
1477
1537
  pendingInteraction(registration: PluginPendingInteractionRegistration): void;
1478
1538
  sidebarFooterAction(registration: PluginSidebarFooterActionRegistration): void;
1539
+ /** Replace the bounded sidebar navigation controls. */
1540
+ experimental_sidebarNavigation(registration: ExperimentalSidebarNavigationRegistration): void;
1479
1541
  /**
1480
1542
  * Replace the sidebar's thread list (see
1481
1543
  * {@link PluginThreadListRegistration}). Experimental: see
@@ -1772,6 +1834,51 @@ interface PluginComposerApi {
1772
1834
  insertMention(mention: PluginComposerMention): void;
1773
1835
  /** Focus the composer caret at the end of the draft. */
1774
1836
  focus(): void;
1837
+ /**
1838
+ * Submit this composer's draft through the composer's OWN submit pipeline,
1839
+ * queued until `sendAt` instead of dispatched now.
1840
+ *
1841
+ * This is a real submission, not a plugin-issued send: the host builds the
1842
+ * request exactly as pressing Enter would, so the draft's attachments and
1843
+ * @-mentions, and — in the new-thread composer — the provider, model,
1844
+ * reasoning level, service tier, permission mode and environment the user
1845
+ * has selected on screen, all travel with it. A plugin cannot assemble that
1846
+ * tuple itself, which is why sending from the backend instead would silently
1847
+ * run the message with different settings than the ones in front of the user.
1848
+ *
1849
+ * In a thread composer the message is queued as a row instead of being
1850
+ * sent or queued for the next idle moment. In the new-thread composer the
1851
+ * thread is created `pending` and its first message becomes the queued row.
1852
+ * Either way the resulting row is core's: the queued card above the
1853
+ * composer, the countdown, Send now and Delete all work with no further
1854
+ * plugin involvement.
1855
+ *
1856
+ * Resolves once the host has accepted the submission and cleared the draft.
1857
+ * Rejects when the composer refused to submit — a scope with no submit
1858
+ * pipeline (a queued-message editor, a side chat), an empty draft, or a
1859
+ * composer that is not ready (still loading its execution defaults, missing
1860
+ * an environment). The rejection's message is safe to show to the user.
1861
+ * Failures of the underlying request are reported by bb's own submit error
1862
+ * handling and restore the draft, exactly as an interactive failure does.
1863
+ *
1864
+ * Experimental: see docs/api_to_audit.md.
1865
+ */
1866
+ experimental_submit(options: ExperimentalComposerSubmitOptions): Promise<void>;
1867
+ }
1868
+ /**
1869
+ * What `experimental_submit` does differently from pressing Enter.
1870
+ *
1871
+ * There is deliberately no zero-argument overload and no "submit now" arm: a
1872
+ * plugin that wants a draft sent immediately is asking for the affordance the
1873
+ * user already has, and handing plugins an unconditional "send this draft"
1874
+ * button is a much larger surface than scheduling needs.
1875
+ */
1876
+ interface ExperimentalComposerSubmitOptions {
1877
+ /**
1878
+ * Epoch ms the submission should dispatch at. Must be in the future; the
1879
+ * host does not second-guess how far ahead it is.
1880
+ */
1881
+ sendAt: number;
1775
1882
  }
1776
1883
  /**
1777
1884
  * A consumer-supplied action on the messages of one `ThreadChat` instance,
@@ -1839,7 +1946,13 @@ interface ThreadChatProps {
1839
1946
  */
1840
1947
  messageActions?: readonly ThreadChatMessageAction[];
1841
1948
  }
1842
- /** The controlled execution selection resolved by the picker. */
1949
+ /**
1950
+ * The controlled execution selection resolved by the picker.
1951
+ *
1952
+ * Deliberately a single concrete shape, not a union: this value exists to be
1953
+ * forwarded verbatim to `bb.sdk.threads.spawn`, so it must name a real
1954
+ * provider and model.
1955
+ */
1843
1956
  interface ExperimentalProviderModelPickerValue {
1844
1957
  providerId: string;
1845
1958
  model: string;
@@ -1926,6 +2039,14 @@ interface NewThreadRequest {
1926
2039
  executionInputSources: CreateExecutionInputSources;
1927
2040
  environment: CreateThreadEnvironmentArgs;
1928
2041
  input: PromptInput[];
2042
+ /**
2043
+ * Epoch ms the first turn should dispatch at. Present only when the
2044
+ * submission came from `useComposer().experimental_submit` — a scheduled
2045
+ * create — and absent otherwise, which is what makes an ordinary submission
2046
+ * start work at once. Forward it to `threads.spawn` unchanged: the thread is
2047
+ * created `pending` and its first message is queued as a row until then.
2048
+ */
2049
+ sendAt?: number;
1929
2050
  }
1930
2051
  /**
1931
2052
  * Props of the host-owned `experimental_NewThreadComposer` component — bb's
@@ -2320,4 +2441,4 @@ declare const experimental_useProviders: () => PluginProvidersState;
2320
2441
  declare const experimental_useCodeTheme: () => PluginCodeThemeState;
2321
2442
 
2322
2443
  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 };
2323
- export type { BbContext, BbNavigate, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginFixedTabReference, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, 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 };
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 };