@get-bb/plugin-sdk 0.5.31 → 0.6.9

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.
@@ -1411,7 +1411,7 @@ type PromptMentionCommandTrigger = z.infer<typeof promptMentionCommandTriggerSch
1411
1411
  declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1412
1412
  mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1413
1413
  end: z.ZodNumber;
1414
- resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1414
+ resource: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
1415
1415
  kind: z.ZodLiteral<"thread">;
1416
1416
  label: z.ZodString;
1417
1417
  projectId: z.ZodOptional<z.ZodString>;
@@ -1460,7 +1460,7 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1460
1460
  kind: z.ZodLiteral<"plugin">;
1461
1461
  label: z.ZodString;
1462
1462
  pluginId: z.ZodString;
1463
- }, z.core.$strip>], "kind">>;
1463
+ }, z.core.$strip>], "kind">, unknown>;
1464
1464
  start: z.ZodNumber;
1465
1465
  }, z.core.$strip>>>;
1466
1466
  text: z.ZodString;
@@ -4057,6 +4057,7 @@ declare const providerInstallationRequirementSchema: z.ZodEnum<{
4057
4057
  }>;
4058
4058
  type ProviderInstallationRequirement = z.infer<typeof providerInstallationRequirementSchema>;
4059
4059
  declare const providerInstallationStatusParamsSchema: z.ZodObject<{
4060
+ checkUpdates: z.ZodDefault<z.ZodBoolean>;
4060
4061
  cwd: z.ZodOptional<z.ZodString>;
4061
4062
  providerId: z.ZodString;
4062
4063
  providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -4400,7 +4401,7 @@ declare const initializeParamsSchema: z.ZodObject<{
4400
4401
  protocolVersion: z.ZodNumber;
4401
4402
  }, z.core.$loose>;
4402
4403
  declare const initializeResultSchema: z.ZodObject<{
4403
- capabilities: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodObject<{
4404
+ capabilities: z.ZodPreprocess<z.ZodObject<{
4404
4405
  approvalEnforcedBy: z.ZodDefault<z.ZodEnum<{
4405
4406
  provider: "provider";
4406
4407
  runtime: "runtime";
@@ -4422,7 +4423,7 @@ declare const initializeResultSchema: z.ZodObject<{
4422
4423
  threadArchive: z.ZodDefault<z.ZodBoolean>;
4423
4424
  threadGoalClear: z.ZodDefault<z.ZodBoolean>;
4424
4425
  threadRename: z.ZodDefault<z.ZodBoolean>;
4425
- }, z.core.$loose>>;
4426
+ }, z.core.$loose>, unknown>;
4426
4427
  protocolVersion: z.ZodNumber;
4427
4428
  }, z.core.$loose>;
4428
4429
  type InitializeResult = z.infer<typeof initializeResultSchema>;
@@ -4530,7 +4531,7 @@ declare const threadStartParamsSchema: z.ZodObject<{
4530
4531
  input: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4531
4532
  mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
4532
4533
  end: z.ZodNumber;
4533
- resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
4534
+ resource: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
4534
4535
  kind: z.ZodLiteral<"thread">;
4535
4536
  label: z.ZodString;
4536
4537
  projectId: z.ZodOptional<z.ZodString>;
@@ -4579,7 +4580,7 @@ declare const threadStartParamsSchema: z.ZodObject<{
4579
4580
  kind: z.ZodLiteral<"plugin">;
4580
4581
  label: z.ZodString;
4581
4582
  pluginId: z.ZodString;
4582
- }, z.core.$strip>], "kind">>;
4583
+ }, z.core.$strip>], "kind">, unknown>;
4583
4584
  start: z.ZodNumber;
4584
4585
  }, z.core.$strip>>>;
4585
4586
  text: z.ZodString;
@@ -4857,7 +4858,7 @@ declare const turnStartParamsSchema: z.ZodObject<{
4857
4858
  input: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4858
4859
  mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
4859
4860
  end: z.ZodNumber;
4860
- resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
4861
+ resource: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
4861
4862
  kind: z.ZodLiteral<"thread">;
4862
4863
  label: z.ZodString;
4863
4864
  projectId: z.ZodOptional<z.ZodString>;
@@ -4906,7 +4907,7 @@ declare const turnStartParamsSchema: z.ZodObject<{
4906
4907
  kind: z.ZodLiteral<"plugin">;
4907
4908
  label: z.ZodString;
4908
4909
  pluginId: z.ZodString;
4909
- }, z.core.$strip>], "kind">>;
4910
+ }, z.core.$strip>], "kind">, unknown>;
4910
4911
  start: z.ZodNumber;
4911
4912
  }, z.core.$strip>>>;
4912
4913
  text: z.ZodString;
@@ -4987,7 +4988,7 @@ declare const turnSteerParamsSchema: z.ZodObject<{
4987
4988
  input: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4988
4989
  mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
4989
4990
  end: z.ZodNumber;
4990
- resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
4991
+ resource: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
4991
4992
  kind: z.ZodLiteral<"thread">;
4992
4993
  label: z.ZodString;
4993
4994
  projectId: z.ZodOptional<z.ZodString>;
@@ -5036,7 +5037,7 @@ declare const turnSteerParamsSchema: z.ZodObject<{
5036
5037
  kind: z.ZodLiteral<"plugin">;
5037
5038
  label: z.ZodString;
5038
5039
  pluginId: z.ZodString;
5039
- }, z.core.$strip>], "kind">>;
5040
+ }, z.core.$strip>], "kind">, unknown>;
5040
5041
  start: z.ZodNumber;
5041
5042
  }, z.core.$strip>>>;
5042
5043
  text: z.ZodString;
@@ -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, ExperimentalSidebarHeaderRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, ExperimentalComposerSubmitOptions, ExperimentalComposerSelection, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginBrowserBbSdk, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarSplitLayout, ExperimentalSidebarNavigationItem, PluginEnvironmentProvidersState, PluginSidebarThreadActions, ExperimentalSidebarNavigationActions } from '@get-bb/plugin-sdk';
10
+ import { ExperimentalSidebarFooterItemRegistration, PluginProviderIconRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarHeaderRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, ComposerDraftSnapshot, PluginComposerScope, ComposerSelection, PluginComposerTextEffect, PluginComposerMention, ComposerSubmitOptions, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginBrowserBbSdk, PluginRealtimeConnectionState, ComposerMention, ComposerAttachment, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarSplitLayout, ExperimentalSidebarNavigationItem, PluginEnvironmentProvidersState, PluginSidebarThreadActions, ExperimentalSidebarNavigationActions } from '@get-bb/plugin-sdk';
11
11
 
12
12
  type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
13
13
  interface ExperimentalSidebarFooterRuntimeSnapshot {
@@ -112,8 +112,17 @@ interface ExperimentalFixedTabOpenCall {
112
112
  interface ComposerLog {
113
113
  /** Latest plain text in this isolated composer scope. */
114
114
  readonly text: string;
115
+ /**
116
+ * Latest text and mention pills, as `useComposer().draft` reports them.
117
+ * The harness composer has no caret, so cursor inserts land at the end.
118
+ */
119
+ readonly draft: ComposerDraftSnapshot;
120
+ /** The key `useComposer().key` reports for the current scope. */
121
+ readonly key: string;
115
122
  /** Latest host-provided composer scope. */
116
123
  readonly scope: PluginComposerScope;
124
+ /** Current picker snapshot, or null for a composer without pickers. */
125
+ readonly selection: ComposerSelection | null;
117
126
  /** Latest host-provided attachment count exposed through `useComposerView()`. */
118
127
  readonly attachmentCount: number;
119
128
  /** Latest host-rendered text effect requested by the plugin. */
@@ -126,19 +135,19 @@ interface ComposerLog {
126
135
  mentions: PluginComposerMention[];
127
136
  focusCount: number;
128
137
  /**
129
- * Every `experimental_submit` the plugin ran, in order. The harness composer
130
- * has no submit pipeline of its own, so it records the options and clears the
138
+ * Every `submit` the plugin ran, in order. The harness composer has no
139
+ * submit pipeline of its own, so it records the options and clears the
131
140
  * draft — enough to assert what a picker scheduled and that it tidied up.
132
141
  */
133
- submits: ExperimentalComposerSubmitOptions[];
142
+ submits: ComposerSubmitOptions[];
134
143
  /**
135
- * Every `experimental_setSelection` the harness composer accepted, in
136
- * order. The harness has no pickers of its own, so it records the request
137
- * and echoes it back as the settled selection, minus the fields the
138
- * composer's scope has no picker for (a thread has no project or
139
- * environment). Queued-message and side-chat scopes reject, as the app does.
144
+ * Every `setSelection` the harness composer accepted, in order. The
145
+ * harness has no pickers of its own, so it merges accepted fields into
146
+ * its current selection and returns that snapshot. A thread drops
147
+ * project and environment because it has no pickers for them. The
148
+ * queued-message scope rejects, as the app does.
140
149
  */
141
- selections: ExperimentalComposerSelection[];
150
+ selections: ComposerSelection[];
142
151
  }
143
152
  /** One recorded `experimental_useSidebarThreadActions()` call. */
144
153
  interface SidebarActionCall {
@@ -264,8 +273,21 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
264
273
  /** Initial state for this render's isolated composer scope and view. */
265
274
  composer?: {
266
275
  text?: string;
276
+ /** Mention pills already in `text`, with ranges into it. */
277
+ mentions?: readonly ComposerMention[];
267
278
  scope?: PluginComposerScope;
268
279
  attachmentCount?: number;
280
+ attachments?: readonly ComposerAttachment[];
281
+ layout?: "compact" | "expanded";
282
+ isRunning?: boolean;
283
+ isSubmitting?: boolean;
284
+ selection?: ComposerSelection;
285
+ /**
286
+ * What `submittingBlockedReason` reports, and what `submit` rejects
287
+ * with. Omitted → "Type a message first." while the draft is empty,
288
+ * "Submitting..." while `isSubmitting`, otherwise null.
289
+ */
290
+ submittingBlockedReason?: string | null;
269
291
  };
270
292
  /**
271
293
  * Threads and projects `experimental_useSidebarThreads()` reports. Omitted →
@@ -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, PluginRowPresentation, 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';
8
+ import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginRowPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginMentionProviderRegistration, ExperimentalPluginRpcCaller, 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>;
@@ -649,7 +649,7 @@ interface PluginProviderCapabilities {
649
649
  * Provider copy core surfaces render from per-provider tables today (usage
650
650
  * banners, sign-in hints, the mobile picker, the agent guide). Declared once
651
651
  * here so no core surface keys copy on a provider id. Mirrors
652
- * `ProviderStrings` in `@bb/domain`, which is the client projection.
652
+ * `providerStringsSchema` in `@bb/domain`, which is the client projection.
653
653
  */
654
654
  interface PluginProviderStrings {
655
655
  /** How to sign in on the host ("Run `claude` on the machine to sign in."). */
@@ -1262,9 +1262,14 @@ interface FakePluginBehaviorDrivers {
1262
1262
  /**
1263
1263
  * Invoke a registered rpc method with host semantics: input/output schemas,
1264
1264
  * strict JSON result normalization, and structured failure codes. Rejects
1265
- * with the same message/code/issues the frontend client surfaces.
1265
+ * with the same message/code/issues the frontend client surfaces. The
1266
+ * handler sees `options.experimental_caller` as its caller, `{ kind:
1267
+ * "client" }` by default; pass `{ kind: "plugin", pluginId }` to act as
1268
+ * another plugin calling through `bb.sdk.plugins.callRpc`.
1266
1269
  */
1267
- callRpc(method: string, input?: unknown): Promise<unknown>;
1270
+ callRpc(method: string, input?: unknown, options?: {
1271
+ experimental_caller?: ExperimentalPluginRpcCaller;
1272
+ }): Promise<unknown>;
1268
1273
  /**
1269
1274
  * Invoke the plugin's CLI command with host semantics: the result's
1270
1275
  * exitCode must be a number, stdout/stderr default to "", and a throwing