@get-bb/plugin-sdk 0.6.14 → 0.6.15

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.
@@ -8604,6 +8604,7 @@ declare const hostDaemonCommandRegistry: {
8604
8604
  darwin: "darwin";
8605
8605
  linux: "linux";
8606
8606
  unknown: "unknown";
8607
+ win32: "win32";
8607
8608
  wsl: "wsl";
8608
8609
  }>;
8609
8610
  portAvailable: z$1.ZodBoolean;
@@ -9029,12 +9030,14 @@ type CreateMachineRequest = z$1.infer<typeof createMachineRequestSchema>;
9029
9030
  declare const hostEnrollmentCommandResponseSchema: z$1.ZodNullable<z$1.ZodObject<{
9030
9031
  command: z$1.ZodString;
9031
9032
  expiresAt: z$1.ZodNumber;
9033
+ windowsCommand: z$1.ZodString;
9032
9034
  }, z$1.core.$strip>>;
9033
9035
  type HostEnrollmentCommandResponse = z$1.infer<typeof hostEnrollmentCommandResponseSchema>;
9034
9036
  declare const hostReconnectResponseSchema: z$1.ZodObject<{
9035
9037
  command: z$1.ZodString;
9036
9038
  expiresAt: z$1.ZodNumber;
9037
9039
  hostId: z$1.ZodString;
9040
+ windowsCommand: z$1.ZodString;
9038
9041
  }, z$1.core.$strict>;
9039
9042
  type HostReconnectResponse = z$1.infer<typeof hostReconnectResponseSchema>;
9040
9043
  declare const createHostJoinCodeResponseSchema: z$1.ZodObject<{
@@ -10433,6 +10436,7 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10433
10436
  darwin: "darwin";
10434
10437
  linux: "linux";
10435
10438
  unknown: "unknown";
10439
+ win32: "win32";
10436
10440
  wsl: "wsl";
10437
10441
  }>>;
10438
10442
  serverAccess: z$1.ZodObject<{
@@ -18649,6 +18653,29 @@ interface PluginCommandRegistration {
18649
18653
  */
18650
18654
  run(context: PluginCommandContext): void | Promise<void>;
18651
18655
  }
18656
+ /**
18657
+ * A command handled by a composer through the same path as bb's own "Focus
18658
+ * composer" command. Listed, rebindable and namespaced like any other plugin
18659
+ * command. The composer holding the caret runs it; with the caret outside every
18660
+ * composer, the focused pane's primary composer does. Like bb's composer
18661
+ * commands, its shortcut is inactive while a terminal, browser tab or modal has
18662
+ * focus, and the palette lists it only when some composer would run it.
18663
+ */
18664
+ interface ExperimentalComposerCommandRegistration {
18665
+ /** Initial keyboard binding. Users can rebind every command, including ones without a default. Conflicting defaults remain unbound. */
18666
+ defaultShortcut?: PluginCommandShortcut;
18667
+ /** Unique within the plugin across every command; letters, digits, `-`, `_`. */
18668
+ id: string;
18669
+ /** The palette row's and keyboard settings' label. */
18670
+ title: string;
18671
+ /**
18672
+ * Runs with the handling composer, bound to this plugin like `useComposer()`.
18673
+ * Errors (sync or async) are contained and logged.
18674
+ */
18675
+ run(context: {
18676
+ composer: PluginComposerApi;
18677
+ }): void | Promise<void>;
18678
+ }
18652
18679
  /** Registers commands for bb's command palette. */
18653
18680
  interface PluginAppCommands {
18654
18681
  /** Register a command. IDs are unique within this plugin, including legacy slot registrations. */
@@ -18941,6 +18968,8 @@ interface PluginAppSlots {
18941
18968
  }
18942
18969
  interface PluginAppComposer {
18943
18970
  customize(registration: ComposerCustomization): void;
18971
+ /** Register a command that the composer holding the caret runs. IDs share the `app.commands` namespace. */
18972
+ experimental_registerCommand(registration: ExperimentalComposerCommandRegistration): void;
18944
18973
  }
18945
18974
  /** Stable lifecycle values for one content-script instance in one bb client. */
18946
18975
  interface PluginContentScriptContext {
@@ -20293,4 +20322,4 @@ declare const experimental_useProviders: () => PluginProvidersState;
20293
20322
  declare const experimental_useCodeTheme: () => PluginCodeThemeState;
20294
20323
 
20295
20324
  export { Markdown, ThreadChat, ThreadTitle, UrlLink, definePluginApp, experimental_BranchPicker, experimental_Diff, experimental_FileLink, experimental_Icon, experimental_NewThreadComposer, experimental_PermissionModePicker, experimental_ProviderIcon, experimental_ProviderModelPicker, experimental_SidebarNavigationIcon, experimental_SourceCode, experimental_useAppPanel, experimental_useBranches, experimental_useCheckoutState, experimental_useCodeTheme, experimental_useFixedTabTarget, experimental_usePluginId, experimental_useProviders, experimental_useQuestionFormHost, experimental_useSidebarNavigation, experimental_useSidebarNavigationSplit, experimental_useSidebarThreadActions, experimental_useSidebarThreadPullRequest, experimental_useSidebarThreadSplit, experimental_useSidebarThreads, useBbContext, useBbNavigate, useComposer, useComposers, useEnvironmentProviders, useRealtime, useRealtimeConnectionState, useRpc, useSdk, useSettings, useSidebarSplitLayout, useSidebarThreadDraft, useSidebarThreadDraftIds, useSidebarThreadRowStatus, useSidebarThreadRowStatuses, useSidebarThreadShortcut };
20296
- export type { BbContext, BbNavigate, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerAttachment, ComposerCustomization, ComposerDraft, ComposerDraftReplacement, ComposerDraftSnapshot, ComposerInsertOptions, ComposerInsertPart, ComposerMention, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerSelection, ComposerSendMenuItem, ComposerSubmitOptions, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerPopupRegistration, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalQuestionFormHost, ExperimentalQuestionShortcut, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarHeaderRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, JsonValue$1 as JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBoundThreadsArea, PluginBrowserBbSdk, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginEnvironmentProvider, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProvidersState, 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, PluginSidebarSection, PluginSidebarSplitLayout, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginTargetedPanelActionOpenOptions, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, ReadonlyJsonValue, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
20325
+ export type { BbContext, BbNavigate, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerAttachment, ComposerCustomization, ComposerDraft, ComposerDraftReplacement, ComposerDraftSnapshot, ComposerInsertOptions, ComposerInsertPart, ComposerMention, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerSelection, ComposerSendMenuItem, ComposerSubmitOptions, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerCommandRegistration, ExperimentalComposerPopupRegistration, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalQuestionFormHost, ExperimentalQuestionShortcut, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarHeaderRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, JsonValue$1 as JsonValue, MarkdownProps, NewThreadComposerProps, NewThreadRequest, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBoundThreadsArea, PluginBrowserBbSdk, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginEnvironmentProvider, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProvidersState, 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, PluginSidebarSection, PluginSidebarSplitLayout, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginTargetedPanelActionOpenOptions, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, ReadonlyJsonValue, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
@@ -6,7 +6,7 @@
6
6
  // and read the real source: https://github.com/get-bb/bb
7
7
 
8
8
  import { z } from 'zod';
9
- import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarHeaderRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
9
+ import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarHeaderRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandRegistration, ExperimentalComposerCommandRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
10
10
 
11
11
  type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
12
12
  interface ExperimentalSidebarFooterRuntimeSnapshot {
@@ -49,9 +49,14 @@ declare const commandShortcutSchema: z.ZodObject<{
49
49
  mod: z.ZodDefault<z.ZodBoolean>;
50
50
  shift: z.ZodDefault<z.ZodBoolean>;
51
51
  }, z.core.$strict>;
52
- interface CollectedPluginCommandRegistration extends Omit<PluginCommandRegistration, "defaultShortcut"> {
53
- defaultShortcut: z.infer<typeof commandShortcutSchema> | null;
54
- }
52
+ type CollectedCommandShortcut = z.infer<typeof commandShortcutSchema> | null;
53
+ type CollectedPluginCommandRegistration = (Omit<PluginCommandRegistration, "defaultShortcut"> & {
54
+ target: "app";
55
+ defaultShortcut: CollectedCommandShortcut;
56
+ }) | (Omit<ExperimentalComposerCommandRegistration, "defaultShortcut"> & {
57
+ target: "composer";
58
+ defaultShortcut: CollectedCommandShortcut;
59
+ });
55
60
  interface CollectedPluginAppRegistrations {
56
61
  homepageSections: PluginHomepageSectionRegistration[];
57
62
  settingsSections: PluginSettingsSectionRegistration[];
@@ -8655,6 +8655,7 @@ declare const hostDaemonCommandRegistry: {
8655
8655
  darwin: "darwin";
8656
8656
  linux: "linux";
8657
8657
  unknown: "unknown";
8658
+ win32: "win32";
8658
8659
  wsl: "wsl";
8659
8660
  }>;
8660
8661
  portAvailable: z$1.ZodBoolean;
@@ -9080,12 +9081,14 @@ type CreateMachineRequest = z$1.infer<typeof createMachineRequestSchema>;
9080
9081
  declare const hostEnrollmentCommandResponseSchema: z$1.ZodNullable<z$1.ZodObject<{
9081
9082
  command: z$1.ZodString;
9082
9083
  expiresAt: z$1.ZodNumber;
9084
+ windowsCommand: z$1.ZodString;
9083
9085
  }, z$1.core.$strip>>;
9084
9086
  type HostEnrollmentCommandResponse = z$1.infer<typeof hostEnrollmentCommandResponseSchema>;
9085
9087
  declare const hostReconnectResponseSchema: z$1.ZodObject<{
9086
9088
  command: z$1.ZodString;
9087
9089
  expiresAt: z$1.ZodNumber;
9088
9090
  hostId: z$1.ZodString;
9091
+ windowsCommand: z$1.ZodString;
9089
9092
  }, z$1.core.$strict>;
9090
9093
  type HostReconnectResponse = z$1.infer<typeof hostReconnectResponseSchema>;
9091
9094
  declare const createHostJoinCodeResponseSchema: z$1.ZodObject<{
@@ -10484,6 +10487,7 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10484
10487
  darwin: "darwin";
10485
10488
  linux: "linux";
10486
10489
  unknown: "unknown";
10490
+ win32: "win32";
10487
10491
  wsl: "wsl";
10488
10492
  }>>;
10489
10493
  serverAccess: z$1.ZodObject<{
@@ -18825,6 +18829,29 @@ interface PluginCommandRegistration {
18825
18829
  */
18826
18830
  run(context: PluginCommandContext): void | Promise<void>;
18827
18831
  }
18832
+ /**
18833
+ * A command handled by a composer through the same path as bb's own "Focus
18834
+ * composer" command. Listed, rebindable and namespaced like any other plugin
18835
+ * command. The composer holding the caret runs it; with the caret outside every
18836
+ * composer, the focused pane's primary composer does. Like bb's composer
18837
+ * commands, its shortcut is inactive while a terminal, browser tab or modal has
18838
+ * focus, and the palette lists it only when some composer would run it.
18839
+ */
18840
+ interface ExperimentalComposerCommandRegistration {
18841
+ /** Initial keyboard binding. Users can rebind every command, including ones without a default. Conflicting defaults remain unbound. */
18842
+ defaultShortcut?: PluginCommandShortcut;
18843
+ /** Unique within the plugin across every command; letters, digits, `-`, `_`. */
18844
+ id: string;
18845
+ /** The palette row's and keyboard settings' label. */
18846
+ title: string;
18847
+ /**
18848
+ * Runs with the handling composer, bound to this plugin like `useComposer()`.
18849
+ * Errors (sync or async) are contained and logged.
18850
+ */
18851
+ run(context: {
18852
+ composer: PluginComposerApi;
18853
+ }): void | Promise<void>;
18854
+ }
18828
18855
  /** Registers commands for bb's command palette. */
18829
18856
  interface PluginAppCommands {
18830
18857
  /** Register a command. IDs are unique within this plugin, including legacy slot registrations. */
@@ -19117,6 +19144,8 @@ interface PluginAppSlots {
19117
19144
  }
19118
19145
  interface PluginAppComposer {
19119
19146
  customize(registration: ComposerCustomization): void;
19147
+ /** Register a command that the composer holding the caret runs. IDs share the `app.commands` namespace. */
19148
+ experimental_registerCommand(registration: ExperimentalComposerCommandRegistration): void;
19120
19149
  }
19121
19150
  /** Stable lifecycle values for one content-script instance in one bb client. */
19122
19151
  interface PluginContentScriptContext {
@@ -22834,4 +22863,4 @@ declare function cliCommand<const TOptions extends CliOptions = Record<string, n
22834
22863
  declare function defineCli(spec: PluginCliSpec): PluginCliRegistration;
22835
22864
 
22836
22865
  export { PLUGIN_CLI_OUTPUT_MAX_BYTES, PluginCliError, cliCommand, defineCli, defineRpcContract, experimental_defineHostEntry };
22837
- export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerAttachment, ComposerCustomization, ComposerDraft, ComposerDraftReplacement, ComposerDraftSnapshot, ComposerInsertOptions, ComposerInsertPart, ComposerMention, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerSelection, ComposerSendMenuItem, ComposerSubmitOptions, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerPopupRegistration, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalPluginMentionImage, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginRpcCaller, ExperimentalPluginRpcHandlerContext, ExperimentalPluginRpcHandlersWithContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalQuestionFormHost, ExperimentalQuestionShortcut, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarHeaderRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiCompleteOptions, PluginAiServiceDeclaration, PluginAiServiceStatus, PluginAiServices, PluginAiTranscribeOptions, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, PluginBoundThreadsArea, PluginBrowserBbSdk, PluginCli, PluginCliBooleanOption, PluginCliCommand, PluginCliCommandInfo, PluginCliConstraint, PluginCliContext, PluginCliDurationOption, PluginCliDurationUnit, PluginCliEnumOption, PluginCliErrorCode, PluginCliExecutionResult, PluginCliIntegerOption, PluginCliOption, PluginCliOptionValues, PluginCliOutputLimitError, PluginCliPositional, PluginCliPositionalValues, PluginCliRegistration, PluginCliResult, PluginCliRunInput, PluginCliSpec, PluginCliStringOption, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProvider, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentProvidersState, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionDescription, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMachineProviderDeclaration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, PluginMachineValidateDecision, PluginMachines, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderCapabilities, PluginProviderCompletedTurnDisplay, PluginProviderComposerAction, PluginProviderDeclaration, PluginProviderExtensionKindDeclaration, PluginProviderFallbackModel, PluginProviderIconRegistration, PluginProviderMaintenance, PluginProviderModelCatalogScope, PluginProviderNativeRootEntry, PluginProviderNativeRoots, PluginProviderOptionDescriptor, PluginProviderOptionsContext, PluginProviderPermissionMode, PluginProviderReasoningLevel, PluginProviderStrings, PluginProviders, PluginProvidersState, PluginRealtime, PluginRealtimeConnectionState, PluginRowLabels, PluginRowPresentation, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerAccess, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSection, PluginSidebarSplitLayout, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
22866
+ export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerAttachment, ComposerCustomization, ComposerDraft, ComposerDraftReplacement, ComposerDraftSnapshot, ComposerInsertOptions, ComposerInsertPart, ComposerMention, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerSelection, ComposerSendMenuItem, ComposerSubmitOptions, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerCommandRegistration, ExperimentalComposerPopupRegistration, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalPluginMentionImage, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginRpcCaller, ExperimentalPluginRpcHandlerContext, ExperimentalPluginRpcHandlersWithContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalQuestionFormHost, ExperimentalQuestionShortcut, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarHeaderRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiCompleteOptions, PluginAiServiceDeclaration, PluginAiServiceStatus, PluginAiServices, PluginAiTranscribeOptions, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, PluginBoundThreadsArea, PluginBrowserBbSdk, PluginCli, PluginCliBooleanOption, PluginCliCommand, PluginCliCommandInfo, PluginCliConstraint, PluginCliContext, PluginCliDurationOption, PluginCliDurationUnit, PluginCliEnumOption, PluginCliErrorCode, PluginCliExecutionResult, PluginCliIntegerOption, PluginCliOption, PluginCliOptionValues, PluginCliOutputLimitError, PluginCliPositional, PluginCliPositionalValues, PluginCliRegistration, PluginCliResult, PluginCliRunInput, PluginCliSpec, PluginCliStringOption, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProvider, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentProvidersState, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionDescription, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMachineProviderDeclaration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, PluginMachineValidateDecision, PluginMachines, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderCapabilities, PluginProviderCompletedTurnDisplay, PluginProviderComposerAction, PluginProviderDeclaration, PluginProviderExtensionKindDeclaration, PluginProviderFallbackModel, PluginProviderIconRegistration, PluginProviderMaintenance, PluginProviderModelCatalogScope, PluginProviderNativeRootEntry, PluginProviderNativeRoots, PluginProviderOptionDescriptor, PluginProviderOptionsContext, PluginProviderPermissionMode, PluginProviderReasoningLevel, PluginProviderStrings, PluginProviders, PluginProvidersState, PluginRealtime, PluginRealtimeConnectionState, PluginRowLabels, PluginRowPresentation, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerAccess, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSection, PluginSidebarSplitLayout, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
@@ -516,24 +516,38 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
516
516
  machineProviderInputs: /* @__PURE__ */ new Set(),
517
517
  contentScript: /* @__PURE__ */ new Set()
518
518
  };
519
- function registerCommand(registration) {
520
- const kind = "commands.register";
519
+ function collectCommand(kind, registration) {
521
520
  const id = requireSlotId(kind, registration?.id);
522
521
  requireUniqueId(kind, seenIds.command, id);
523
522
  if (typeof registration.run !== "function") {
524
523
  throw new Error(`${kind}: "run" must be a function`);
525
524
  }
525
+ return {
526
+ id,
527
+ defaultShortcut: registration.defaultShortcut === void 0 ? null : commandShortcutSchema.parse(registration.defaultShortcut),
528
+ title: requireNonEmptyString(kind, "title", registration.title)
529
+ };
530
+ }
531
+ function registerCommand(registration) {
532
+ const kind = "commands.register";
533
+ const command = collectCommand(kind, registration);
526
534
  if (registration.isAvailable !== void 0 && typeof registration.isAvailable !== "function") {
527
535
  throw new Error(`${kind}: "isAvailable" must be a function`);
528
536
  }
529
537
  collected.commandPaletteActions.push({
530
- id,
531
- defaultShortcut: registration.defaultShortcut === void 0 ? null : commandShortcutSchema.parse(registration.defaultShortcut),
532
- title: requireNonEmptyString(kind, "title", registration.title),
538
+ target: "app",
539
+ ...command,
533
540
  ...registration.isAvailable !== void 0 ? { isAvailable: registration.isAvailable } : {},
534
541
  run: registration.run
535
542
  });
536
543
  }
544
+ function registerComposerCommand(registration) {
545
+ collected.commandPaletteActions.push({
546
+ target: "composer",
547
+ ...collectCommand("composer.experimental_registerCommand", registration),
548
+ run: registration.run
549
+ });
550
+ }
537
551
  definition.setup({
538
552
  commands: { register: registerCommand },
539
553
  slots: {
@@ -897,7 +911,8 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
897
911
  if (customization !== null) {
898
912
  collected.composerCustomizations.push(customization);
899
913
  }
900
- }
914
+ },
915
+ experimental_registerCommand: registerComposerCommand
901
916
  },
902
917
  experimental_icons: {
903
918
  register(registration) {
@@ -6397,6 +6397,8 @@ function listRecordedCells(root) {
6397
6397
  }
6398
6398
 
6399
6399
  // ../provider-bridge-protocol/src/testing/parity.ts
6400
+ var REPLAY_CLEANUP_RETRIES = 20;
6401
+ var REPLAY_CLEANUP_RETRY_DELAY_MS = 100;
6400
6402
  var SOURCE_BOOTSTRAP = fileURLToPath2(
6401
6403
  new URL("../bridge-worker-entry.ts", import.meta.url)
6402
6404
  );
@@ -6591,7 +6593,8 @@ async function replayRecording(options) {
6591
6593
  stdio: ["pipe", "pipe", "pipe"]
6592
6594
  });
6593
6595
  const recordedCwd = recordedWorkspaceDir(recording);
6594
- const restoreRecordedWorkspace = (line) => recordedCwd === null || recordedCwd === workspaceDir ? line : line.split(workspaceDir).join(recordedCwd);
6596
+ const jsonText = (value) => JSON.stringify(value).slice(1, -1);
6597
+ const restoreRecordedWorkspace = (line) => recordedCwd === null || recordedCwd === workspaceDir ? line : line.split(jsonText(workspaceDir)).join(jsonText(recordedCwd));
6595
6598
  const initializeId = PARITY_INITIALIZE_ID;
6596
6599
  const startedAt = Date.now();
6597
6600
  const lines = [];
@@ -6829,8 +6832,14 @@ async function replayRecording(options) {
6829
6832
  return null;
6830
6833
  })
6831
6834
  ]);
6832
- rmSync(stateDir, { recursive: true, force: true });
6833
- rmSync(workspaceDir, { recursive: true, force: true });
6835
+ for (const directory of [stateDir, workspaceDir]) {
6836
+ rmSync(directory, {
6837
+ force: true,
6838
+ maxRetries: REPLAY_CLEANUP_RETRIES,
6839
+ recursive: true,
6840
+ retryDelay: REPLAY_CLEANUP_RETRY_DELAY_MS
6841
+ });
6842
+ }
6834
6843
  return {
6835
6844
  providerId,
6836
6845
  recordingDir: options.recordingDir,
@@ -354,6 +354,70 @@ function readNewlineDelimitedLines(input, onLine) {
354
354
  // Player
355
355
  // ---------------------------------------------------------------------------
356
356
 
357
+ function servePiCatalog(entries) {
358
+ const models = new Map();
359
+ let state = {};
360
+ for (const entry of entries) {
361
+ if (entry.dir !== "provider→bridge") continue;
362
+ const message = parseLine(entry.line);
363
+ if (message?.type !== "response" || message.success !== true) continue;
364
+ const candidates = [];
365
+ if (message.command === "get_state" && message.data?.model) {
366
+ candidates.push(message.data.model);
367
+ if (!state.model) state = message.data;
368
+ }
369
+ if (
370
+ message.command === "get_available_models" &&
371
+ Array.isArray(message.data?.models)
372
+ ) {
373
+ candidates.push(...message.data.models);
374
+ }
375
+ for (const model of candidates) {
376
+ if (typeof model?.provider === "string" && typeof model.id === "string") {
377
+ models.set(`${model.provider}/${model.id}`, model);
378
+ }
379
+ }
380
+ }
381
+ const channelOut = createWriteStream(null, { fd: 3 });
382
+ const channelIn = new Socket({ fd: 4, readable: true, writable: false });
383
+ channelIn.on("error", () => {});
384
+ channelIn.unref();
385
+ readNewlineDelimitedLines(channelIn, (line) => {
386
+ const message = parseLine(line);
387
+ if (message?.kind !== "request" || message.method !== "model-scope") return;
388
+ channelOut.write(
389
+ `${JSON.stringify({
390
+ kind: "reply",
391
+ id: message.id,
392
+ result: {
393
+ scopedModelIds: [...models.keys()],
394
+ ...(state.model
395
+ ? { defaultModelId: `${state.model.provider}/${state.model.id}` }
396
+ : {}),
397
+ },
398
+ })}\n`,
399
+ );
400
+ });
401
+ readNewlineDelimitedLines(process.stdin, (line) => {
402
+ const message = parseLine(line);
403
+ if (typeof message?.id !== "string") return;
404
+ process.stdout.write(
405
+ `${JSON.stringify({
406
+ id: message.id,
407
+ type: "response",
408
+ command: message.type,
409
+ success: true,
410
+ data:
411
+ message.type === "get_available_models"
412
+ ? { models: [...models.values()] }
413
+ : state,
414
+ })}\n`,
415
+ );
416
+ });
417
+ process.stdin.on("end", () => process.exit(0));
418
+ process.on("SIGTERM", () => process.exit(0));
419
+ }
420
+
357
421
  function main() {
358
422
  // A bridge's install gate may probe `<cli> --version` through the replay
359
423
  // command; answer like a CLI instead of claiming a segment and waiting.
@@ -369,6 +433,14 @@ function main() {
369
433
  ...readLane(args.recording, "provider→bridge"),
370
434
  ...readLane(args.recording, "bridge→provider"),
371
435
  ].sort((left, right) => left.run - right.run || left.seq - right.seq);
436
+ if (
437
+ args.dialect === "pi-rpc" &&
438
+ process.argv.includes("--no-session") &&
439
+ !process.argv.includes("--session-dir")
440
+ ) {
441
+ servePiCatalog(entries);
442
+ return;
443
+ }
372
444
  const segments = buildSegments(entries, dialect);
373
445
  const segmentIndex = claimSegmentIndex(args.state);
374
446
  let script = segments[segmentIndex] ?? [];
@@ -1209,24 +1209,38 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
1209
1209
  machineProviderInputs: /* @__PURE__ */ new Set(),
1210
1210
  contentScript: /* @__PURE__ */ new Set()
1211
1211
  };
1212
- function registerCommand(registration) {
1213
- const kind = "commands.register";
1212
+ function collectCommand(kind, registration) {
1214
1213
  const id = requireSlotId(kind, registration?.id);
1215
1214
  requireUniqueId(kind, seenIds.command, id);
1216
1215
  if (typeof registration.run !== "function") {
1217
1216
  throw new Error(`${kind}: "run" must be a function`);
1218
1217
  }
1218
+ return {
1219
+ id,
1220
+ defaultShortcut: registration.defaultShortcut === void 0 ? null : commandShortcutSchema.parse(registration.defaultShortcut),
1221
+ title: requireNonEmptyString(kind, "title", registration.title)
1222
+ };
1223
+ }
1224
+ function registerCommand(registration) {
1225
+ const kind = "commands.register";
1226
+ const command = collectCommand(kind, registration);
1219
1227
  if (registration.isAvailable !== void 0 && typeof registration.isAvailable !== "function") {
1220
1228
  throw new Error(`${kind}: "isAvailable" must be a function`);
1221
1229
  }
1222
1230
  collected.commandPaletteActions.push({
1223
- id,
1224
- defaultShortcut: registration.defaultShortcut === void 0 ? null : commandShortcutSchema.parse(registration.defaultShortcut),
1225
- title: requireNonEmptyString(kind, "title", registration.title),
1231
+ target: "app",
1232
+ ...command,
1226
1233
  ...registration.isAvailable !== void 0 ? { isAvailable: registration.isAvailable } : {},
1227
1234
  run: registration.run
1228
1235
  });
1229
1236
  }
1237
+ function registerComposerCommand(registration) {
1238
+ collected.commandPaletteActions.push({
1239
+ target: "composer",
1240
+ ...collectCommand("composer.experimental_registerCommand", registration),
1241
+ run: registration.run
1242
+ });
1243
+ }
1230
1244
  definition.setup({
1231
1245
  commands: { register: registerCommand },
1232
1246
  slots: {
@@ -1590,7 +1604,8 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
1590
1604
  if (customization !== null) {
1591
1605
  collected.composerCustomizations.push(customization);
1592
1606
  }
1593
- }
1607
+ },
1608
+ experimental_registerCommand: registerComposerCommand
1594
1609
  },
1595
1610
  experimental_icons: {
1596
1611
  register(registration) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"