@get-bb/plugin-sdk 0.6.65 → 0.6.68

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.
@@ -4201,6 +4201,17 @@ declare const threadRuntimeDisplayStatusSchema: z$1.ZodEnum<{
4201
4201
  starting: "starting";
4202
4202
  stopping: "stopping";
4203
4203
  }>;
4204
+
4205
+ /**
4206
+ * The three additions to {@link threadStatusValues} are display-only: they
4207
+ * refine `active`/`idle` with host and workspace facts the durable status does
4208
+ * not record.
4209
+ *
4210
+ * A never-started thread needs no such refinement — `pending` is a real thread
4211
+ * status now, so it travels to the client as itself. It used to arrive as a
4212
+ * separate `held` display status, derived from an `idle` thread holding a live
4213
+ * dispatch hold; that derivation and the holds behind it are both gone.
4214
+ */
4204
4215
  type ThreadRuntimeDisplayStatus = z$1.infer<typeof threadRuntimeDisplayStatusSchema>;
4205
4216
  declare const threadQueuedMessageSchema: z$1.ZodObject<{
4206
4217
  content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
@@ -5999,6 +6010,12 @@ interface HostDaemonCommandDescriptor<Type extends string, Schema extends z$1.Zo
5999
6010
  envLane: HostDaemonCommandEnvironmentLane | null;
6000
6011
  }
6001
6012
  declare const hostDaemonCommandRegistry: {
6013
+ "desktop.broker.prove": HostDaemonCommandDescriptor<"desktop.broker.prove", z$1.ZodObject<{
6014
+ challenge: z$1.ZodString;
6015
+ type: z$1.ZodLiteral<"desktop.broker.prove">;
6016
+ }, z$1.core.$strict>, z$1.ZodObject<{
6017
+ proof: z$1.ZodString;
6018
+ }, z$1.core.$strict>, "onlineRpc", false>;
6002
6019
  "desktop.browser.list_instances": HostDaemonCommandDescriptor<"desktop.browser.list_instances", z$1.ZodObject<{
6003
6020
  type: z$1.ZodLiteral<"desktop.browser.list_instances">;
6004
6021
  }, z$1.core.$strict>, z$1.ZodObject<{
@@ -7624,6 +7641,16 @@ declare const hostDaemonCommandRegistry: {
7624
7641
  timeoutMs: z$1.ZodNumber;
7625
7642
  type: z$1.ZodLiteral<"environment.hook.run">;
7626
7643
  }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, "onlineRpc", false>;
7644
+ "environment.inspect_cleanup": HostDaemonCommandDescriptor<"environment.inspect_cleanup", z$1.ZodObject<{
7645
+ environmentId: z$1.ZodString;
7646
+ path: z$1.ZodString;
7647
+ type: z$1.ZodLiteral<"environment.inspect_cleanup">;
7648
+ }, z$1.core.$strict>, z$1.ZodObject<{
7649
+ active: z$1.ZodBoolean;
7650
+ pids: z$1.ZodArray<z$1.ZodNumber>;
7651
+ supported: z$1.ZodBoolean;
7652
+ unreadablePids: z$1.ZodArray<z$1.ZodNumber>;
7653
+ }, z$1.core.$strict>, "onlineRpc", true>;
7627
7654
  "environment.hook.cancel": HostDaemonCommandDescriptor<"environment.hook.cancel", z$1.ZodObject<{
7628
7655
  operationId: z$1.ZodString;
7629
7656
  type: z$1.ZodLiteral<"environment.hook.cancel">;
@@ -10358,6 +10385,50 @@ declare const publishedPluginRpcMethodSchema: z$1.ZodObject<{
10358
10385
  }, z$1.core.$strip>;
10359
10386
  type PublishedPluginRpcMethod = z$1.infer<typeof publishedPluginRpcMethodSchema>;
10360
10387
 
10388
+ declare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{
10389
+ text: z$1.ZodString;
10390
+ }, z$1.core.$strip>;
10391
+
10392
+ declare const systemEnvironmentProviderSchema: z$1.ZodObject<{
10393
+ acceptsEmptyInputs: z$1.ZodBoolean;
10394
+ availability: z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
10395
+ status: z$1.ZodLiteral<"available">;
10396
+ }, z$1.core.$strip>, z$1.ZodObject<{
10397
+ message: z$1.ZodString;
10398
+ status: z$1.ZodLiteral<"setup-required">;
10399
+ }, z$1.core.$strip>, z$1.ZodObject<{
10400
+ message: z$1.ZodString;
10401
+ status: z$1.ZodLiteral<"unavailable">;
10402
+ }, z$1.core.$strip>], "status">>;
10403
+ description: z$1.ZodNullable<z$1.ZodString>;
10404
+ displayName: z$1.ZodString;
10405
+ environmentProviderId: z$1.ZodOptional<z$1.ZodString>;
10406
+ icon: z$1.ZodNullable<z$1.ZodString>;
10407
+ id: z$1.ZodString;
10408
+ inputs: z$1.ZodNullable<z$1.ZodType<JsonValue, unknown, z$1.core.$ZodTypeInternals<JsonValue, unknown>>>;
10409
+ logoUrl: z$1.ZodNullable<z$1.ZodString>;
10410
+ machineAcceptsEmptyInputs: z$1.ZodOptional<z$1.ZodBoolean>;
10411
+ machineAvailability: z$1.ZodRecord<z$1.ZodString, z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
10412
+ status: z$1.ZodLiteral<"available">;
10413
+ }, z$1.core.$strip>, z$1.ZodObject<{
10414
+ message: z$1.ZodString;
10415
+ status: z$1.ZodLiteral<"setup-required">;
10416
+ }, z$1.core.$strip>, z$1.ZodObject<{
10417
+ message: z$1.ZodString;
10418
+ status: z$1.ZodLiteral<"unavailable">;
10419
+ }, z$1.core.$strip>], "status">>>;
10420
+ machineInputs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<JsonValue, unknown, z$1.core.$ZodTypeInternals<JsonValue, unknown>>>>;
10421
+ machineProviderId: z$1.ZodNullable<z$1.ZodString>;
10422
+ machineProviderPluginId: z$1.ZodOptional<z$1.ZodString>;
10423
+ pluginId: z$1.ZodString;
10424
+ requires: z$1.ZodObject<{
10425
+ gitCheckout: z$1.ZodBoolean;
10426
+ gitRemote: z$1.ZodBoolean;
10427
+ projectCheckout: z$1.ZodBoolean;
10428
+ projectless: z$1.ZodBoolean;
10429
+ }, z$1.core.$strip>;
10430
+ }, z$1.core.$strip>;
10431
+
10361
10432
  declare const machineEnvironmentReplaceSchema: z$1.ZodObject<{
10362
10433
  variables: z$1.ZodArray<z$1.ZodObject<{
10363
10434
  name: z$1.ZodString;
@@ -10580,9 +10651,6 @@ declare const systemUsageLimitsQuerySchema: z$1.ZodObject<{
10580
10651
  }>>;
10581
10652
  }, z$1.core.$strip>;
10582
10653
  type SystemUsageLimitsQuery = z$1.infer<typeof systemUsageLimitsQuerySchema>;
10583
- declare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{
10584
- text: z$1.ZodString;
10585
- }, z$1.core.$strip>;
10586
10654
  type SystemVoiceTranscriptionResponse = z$1.infer<typeof systemVoiceTranscriptionResponseSchema>;
10587
10655
  declare const systemProviderStatesResponseSchema: z$1.ZodObject<{
10588
10656
  providers: z$1.ZodArray<z$1.ZodObject<{
@@ -11442,45 +11510,6 @@ declare const systemInstallCliSkillsResponseSchema: z$1.ZodObject<{
11442
11510
  }, z$1.core.$strip>;
11443
11511
  type SystemInstallCliSkillsResponse = z$1.infer<typeof systemInstallCliSkillsResponseSchema>;
11444
11512
  type SystemConfigReloadResponse = z$1.infer<typeof systemConfigReloadResponseSchema>;
11445
- declare const systemEnvironmentProviderSchema: z$1.ZodObject<{
11446
- acceptsEmptyInputs: z$1.ZodBoolean;
11447
- availability: z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
11448
- status: z$1.ZodLiteral<"available">;
11449
- }, z$1.core.$strip>, z$1.ZodObject<{
11450
- message: z$1.ZodString;
11451
- status: z$1.ZodLiteral<"setup-required">;
11452
- }, z$1.core.$strip>, z$1.ZodObject<{
11453
- message: z$1.ZodString;
11454
- status: z$1.ZodLiteral<"unavailable">;
11455
- }, z$1.core.$strip>], "status">>;
11456
- description: z$1.ZodNullable<z$1.ZodString>;
11457
- displayName: z$1.ZodString;
11458
- environmentProviderId: z$1.ZodOptional<z$1.ZodString>;
11459
- icon: z$1.ZodNullable<z$1.ZodString>;
11460
- id: z$1.ZodString;
11461
- inputs: z$1.ZodNullable<z$1.ZodType<JsonValue, unknown, z$1.core.$ZodTypeInternals<JsonValue, unknown>>>;
11462
- logoUrl: z$1.ZodNullable<z$1.ZodString>;
11463
- machineAcceptsEmptyInputs: z$1.ZodOptional<z$1.ZodBoolean>;
11464
- machineAvailability: z$1.ZodRecord<z$1.ZodString, z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
11465
- status: z$1.ZodLiteral<"available">;
11466
- }, z$1.core.$strip>, z$1.ZodObject<{
11467
- message: z$1.ZodString;
11468
- status: z$1.ZodLiteral<"setup-required">;
11469
- }, z$1.core.$strip>, z$1.ZodObject<{
11470
- message: z$1.ZodString;
11471
- status: z$1.ZodLiteral<"unavailable">;
11472
- }, z$1.core.$strip>], "status">>>;
11473
- machineInputs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<JsonValue, unknown, z$1.core.$ZodTypeInternals<JsonValue, unknown>>>>;
11474
- machineProviderId: z$1.ZodNullable<z$1.ZodString>;
11475
- machineProviderPluginId: z$1.ZodOptional<z$1.ZodString>;
11476
- pluginId: z$1.ZodString;
11477
- requires: z$1.ZodObject<{
11478
- gitCheckout: z$1.ZodBoolean;
11479
- gitRemote: z$1.ZodBoolean;
11480
- projectCheckout: z$1.ZodBoolean;
11481
- projectless: z$1.ZodBoolean;
11482
- }, z$1.core.$strip>;
11483
- }, z$1.core.$strip>;
11484
11513
  type SystemEnvironmentProvider = z$1.infer<typeof systemEnvironmentProviderSchema>;
11485
11514
  declare const systemMachineProviderSchema: z$1.ZodObject<{
11486
11515
  acceptsEmptyInputs: z$1.ZodBoolean;
@@ -12927,6 +12956,21 @@ interface TimelineTurnRow extends TimelineRowBase {
12927
12956
  type TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;
12928
12957
  type TimelineRow = TimelineSourceRow | TimelineTurnRow;
12929
12958
 
12959
+ declare const threadOpenSplitSchema: z$1.ZodEnum<{
12960
+ down: "down";
12961
+ left: "left";
12962
+ replace: "replace";
12963
+ right: "right";
12964
+ top: "top";
12965
+ }>;
12966
+ declare const threadPaneActionSchema: z$1.ZodEnum<{
12967
+ "clear-spotlight": "clear-spotlight";
12968
+ maximize: "maximize";
12969
+ restore: "restore";
12970
+ spotlight: "spotlight";
12971
+ toggle: "toggle";
12972
+ }>;
12973
+
12930
12974
  declare const createExecutionInputSourcesSchema: z$1.ZodObject<{
12931
12975
  model: z$1.ZodOptional<z$1.ZodEnum<{
12932
12976
  "client-preference": "client-preference";
@@ -15294,13 +15338,6 @@ declare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{
15294
15338
  previousThreadId: z$1.ZodNullable<z$1.ZodString>;
15295
15339
  }, z$1.core.$strip>;
15296
15340
  type ReorderPinnedThreadRequest = z$1.infer<typeof reorderPinnedThreadRequestSchema>;
15297
- declare const threadOpenSplitSchema: z$1.ZodEnum<{
15298
- down: "down";
15299
- left: "left";
15300
- replace: "replace";
15301
- right: "right";
15302
- top: "top";
15303
- }>;
15304
15341
  type ThreadOpenSplit = z$1.infer<typeof threadOpenSplitSchema>;
15305
15342
  declare const threadOpenFileSchema: z$1.ZodObject<{
15306
15343
  lineNumber: z$1.ZodNullable<z$1.ZodNumber>;
@@ -15315,13 +15352,6 @@ declare const threadOpenResponseSchema: z$1.ZodObject<{
15315
15352
  delivered: z$1.ZodNumber;
15316
15353
  }, z$1.core.$strip>;
15317
15354
  type ThreadOpenResponse = z$1.infer<typeof threadOpenResponseSchema>;
15318
- declare const threadPaneActionSchema: z$1.ZodEnum<{
15319
- "clear-spotlight": "clear-spotlight";
15320
- maximize: "maximize";
15321
- restore: "restore";
15322
- spotlight: "spotlight";
15323
- toggle: "toggle";
15324
- }>;
15325
15355
  type ThreadPaneAction = z$1.infer<typeof threadPaneActionSchema>;
15326
15356
  declare const threadPaneActionResponseSchema: z$1.ZodObject<{
15327
15357
  delivered: z$1.ZodNumber;
@@ -15332,6 +15362,10 @@ declare const threadArchiveAllResponseSchema: z$1.ZodObject<{
15332
15362
  ok: z$1.ZodLiteral<true>;
15333
15363
  }, z$1.core.$strip>;
15334
15364
  type ThreadArchiveAllResponse = z$1.infer<typeof threadArchiveAllResponseSchema>;
15365
+ /**
15366
+ * Reads the `threadIds` list filter. The empty string is the empty set, so a
15367
+ * caller with no IDs gets no threads instead of every thread.
15368
+ */
15335
15369
  declare const threadListQuerySchema: z$1.ZodObject<{
15336
15370
  archived: z$1.ZodOptional<z$1.ZodEnum<{
15337
15371
  false: "false";
@@ -17152,7 +17186,9 @@ interface EnvironmentListProvidersArgs {
17152
17186
  }
17153
17187
  type EnvironmentListProvidersResult = SystemEnvironmentProvider[];
17154
17188
  interface EnvironmentsArea {
17155
- experimental_cleanup(args: EnvironmentActionArgs): Promise<{
17189
+ experimental_cleanup(args: EnvironmentActionArgs & {
17190
+ recover?: boolean;
17191
+ }): Promise<{
17156
17192
  ok: true;
17157
17193
  }>;
17158
17194
  archiveThreads(args: EnvironmentActionArgs): Promise<EnvironmentArchiveThreadsResult>;
@@ -21579,29 +21615,41 @@ interface PluginComposerApi {
21579
21615
  /** Focus the composer caret at the end of the draft. */
21580
21616
  focus(): void;
21581
21617
  /**
21582
- * Submit this composer's draft exactly as pressing Enter would: the same
21583
- * checks and the same action (send, or queue while the thread is busy; a
21584
- * provider handoff creates a new thread). The draft's attachments and
21618
+ * Submit this composer's draft through the composer's own send and steer
21619
+ * handlers, the ones Enter and modifier+Enter run, including a
21620
+ * provider handoff that creates a new thread. The draft's attachments and
21585
21621
  * @-mentions, and — in the new-thread composer — the provider, model,
21586
21622
  * reasoning level, service tier, permission mode and environment the user
21587
21623
  * has selected on screen, all travel with it.
21588
21624
  *
21589
- * While attachments are uploading it waits for them, then checks again; it
21590
- * rejects if an upload fails. Otherwise, when submitting is blocked it
21591
- * rejects with `submittingBlockedReason`, a message safe to show to the
21592
- * user. The queued-message and sent-message editors save edits and reject.
21625
+ * It submits only the draft, so it rejects an empty one, even where the
21626
+ * shortcut would steer the next queued message instead. Otherwise it runs
21627
+ * only when the matching shortcut would. While attachments are uploading it
21628
+ * waits for them, then checks again; it rejects if an upload fails. When
21629
+ * the shortcut could not submit, it rejects with the reason, a message safe
21630
+ * to show to the user. The composer must be on screen. The queued-message
21631
+ * and sent-message editors reject.
21593
21632
  *
21594
- * `sendAt` queues the submission until that time. `experimental_data` is
21595
- * opaque JSON delivered to dispatch hooks together with the calling plugin's
21596
- * id on this initial attempt. Hooks run before operational core waits. If a
21597
- * hook queues the message, its existing plugin wait identifies the owner on
21598
- * later attempts; core does not persist or interpret the opaque data.
21633
+ * Every option combines with the others. `experimental_mode` uses the
21634
+ * names `bb.sdk.threads.send` uses. Without it, submit does what Enter
21635
+ * does for this user, which may be to queue or to steer.
21636
+ * `"queue-if-active"` queues behind the running turn, or starts a turn.
21637
+ * `"steer-if-active"` adds the message to the running turn. Where nothing
21638
+ * can be steered, such as on an idle thread, it starts a turn.
21639
+ * `sendAt` makes the chosen action wait until the given time; a scheduled
21640
+ * steer steers whatever turn is running then. `experimental_data` is
21641
+ * opaque JSON delivered to dispatch hooks together with the calling
21642
+ * plugin's id on this initial attempt. Hooks run before operational core
21643
+ * waits. If a hook queues the message, its existing plugin wait identifies
21644
+ * the owner on later attempts; core does not persist or interpret the
21645
+ * opaque data.
21599
21646
  *
21600
- * Resolves once the host has accepted the submission and cleared the draft.
21601
- * Failures of the underlying request are reported by bb's own submit error
21602
- * handling and restore the draft, exactly as an interactive failure does.
21647
+ * Resolves once the composer has accepted the submission and cleared the
21648
+ * draft. Failures of the underlying request show bb's usual error toast
21649
+ * and restore the draft, exactly as an interactive failure does, and then
21650
+ * reject with the toast's message.
21603
21651
  */
21604
- submit(options: ComposerSubmitOptions): Promise<void>;
21652
+ submit(options?: ComposerSubmitOptions): Promise<void>;
21605
21653
  /**
21606
21654
  * Set this composer's pickers as if each value had been picked by hand.
21607
21655
  *
@@ -21680,20 +21728,22 @@ interface ComposerSelection {
21680
21728
  serviceTier?: ServiceTier;
21681
21729
  permissionMode?: PermissionMode;
21682
21730
  }
21683
- /**
21684
- * What `submit` does differently from pressing Enter.
21685
- *
21686
- * `experimental_data` is opaque JSON delivered to dispatch hooks. The runtime
21687
- * associates it with the calling plugin automatically for the initial
21688
- * dispatch attempt.
21689
- */
21690
- type ComposerSubmitOptions = {
21691
- sendAt: number;
21731
+ /** What `submit` adds to pressing Enter. Every field combines with the others. */
21732
+ interface ComposerSubmitOptions {
21733
+ /**
21734
+ * `"queue-if-active"` queues behind the running turn and
21735
+ * `"steer-if-active"` adds to it; both start a turn when none is running.
21736
+ * Omitted, it does what Enter does for this user.
21737
+ */
21738
+ experimental_mode?: "queue-if-active" | "steer-if-active";
21739
+ /** Epoch ms in the future; the action waits until then. */
21740
+ sendAt?: number;
21741
+ /**
21742
+ * Opaque JSON delivered to dispatch hooks with the calling plugin's id on
21743
+ * the initial dispatch attempt.
21744
+ */
21692
21745
  experimental_data?: JsonValue$1;
21693
- } | {
21694
- experimental_data: JsonValue$1;
21695
- sendAt?: never;
21696
- };
21746
+ }
21697
21747
  /**
21698
21748
  * A consumer-supplied action on the messages of one `ThreadChat` instance,
21699
21749
  * rendered in the embedded timeline's per-message action bar alongside the
@@ -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 { PluginComposerApi as PluginComposerApi$1, PluginComposerScope as PluginComposerScope$1, ComposerDraftSnapshot as ComposerDraftSnapshot$1, ComposerSelection as ComposerSelection$1, ComposerDraftReplacement as ComposerDraftReplacement$1, ComposerDraft as ComposerDraft$1, ComposerSubmitOptions as ComposerSubmitOptions$1, JsonValue as JsonValue$2, ComposerMention as ComposerMention$1, PluginComposerTextEffect as PluginComposerTextEffect$1 } from '@get-bb/plugin-sdk';
9
+ import { JsonValue as JsonValue$2, PluginComposerApi as PluginComposerApi$1, PluginComposerScope as PluginComposerScope$1, ComposerDraftSnapshot as ComposerDraftSnapshot$1, ComposerSelection as ComposerSelection$1, ComposerDraftReplacement as ComposerDraftReplacement$1, ComposerDraft as ComposerDraft$1, ComposerMention as ComposerMention$1, PluginComposerTextEffect as PluginComposerTextEffect$1 } from '@get-bb/plugin-sdk';
10
10
 
11
11
  interface JsonObject {
12
12
  [key: string]: JsonValue$1;
@@ -295,29 +295,41 @@ interface PluginComposerApi {
295
295
  /** Focus the composer caret at the end of the draft. */
296
296
  focus(): void;
297
297
  /**
298
- * Submit this composer's draft exactly as pressing Enter would: the same
299
- * checks and the same action (send, or queue while the thread is busy; a
300
- * provider handoff creates a new thread). The draft's attachments and
298
+ * Submit this composer's draft through the composer's own send and steer
299
+ * handlers, the ones Enter and modifier+Enter run, including a
300
+ * provider handoff that creates a new thread. The draft's attachments and
301
301
  * @-mentions, and — in the new-thread composer — the provider, model,
302
302
  * reasoning level, service tier, permission mode and environment the user
303
303
  * has selected on screen, all travel with it.
304
304
  *
305
- * While attachments are uploading it waits for them, then checks again; it
306
- * rejects if an upload fails. Otherwise, when submitting is blocked it
307
- * rejects with `submittingBlockedReason`, a message safe to show to the
308
- * user. The queued-message and sent-message editors save edits and reject.
305
+ * It submits only the draft, so it rejects an empty one, even where the
306
+ * shortcut would steer the next queued message instead. Otherwise it runs
307
+ * only when the matching shortcut would. While attachments are uploading it
308
+ * waits for them, then checks again; it rejects if an upload fails. When
309
+ * the shortcut could not submit, it rejects with the reason, a message safe
310
+ * to show to the user. The composer must be on screen. The queued-message
311
+ * and sent-message editors reject.
309
312
  *
310
- * `sendAt` queues the submission until that time. `experimental_data` is
311
- * opaque JSON delivered to dispatch hooks together with the calling plugin's
312
- * id on this initial attempt. Hooks run before operational core waits. If a
313
- * hook queues the message, its existing plugin wait identifies the owner on
314
- * later attempts; core does not persist or interpret the opaque data.
313
+ * Every option combines with the others. `experimental_mode` uses the
314
+ * names `bb.sdk.threads.send` uses. Without it, submit does what Enter
315
+ * does for this user, which may be to queue or to steer.
316
+ * `"queue-if-active"` queues behind the running turn, or starts a turn.
317
+ * `"steer-if-active"` adds the message to the running turn. Where nothing
318
+ * can be steered, such as on an idle thread, it starts a turn.
319
+ * `sendAt` makes the chosen action wait until the given time; a scheduled
320
+ * steer steers whatever turn is running then. `experimental_data` is
321
+ * opaque JSON delivered to dispatch hooks together with the calling
322
+ * plugin's id on this initial attempt. Hooks run before operational core
323
+ * waits. If a hook queues the message, its existing plugin wait identifies
324
+ * the owner on later attempts; core does not persist or interpret the
325
+ * opaque data.
315
326
  *
316
- * Resolves once the host has accepted the submission and cleared the draft.
317
- * Failures of the underlying request are reported by bb's own submit error
318
- * handling and restore the draft, exactly as an interactive failure does.
327
+ * Resolves once the composer has accepted the submission and cleared the
328
+ * draft. Failures of the underlying request show bb's usual error toast
329
+ * and restore the draft, exactly as an interactive failure does, and then
330
+ * reject with the toast's message.
319
331
  */
320
- submit(options: ComposerSubmitOptions): Promise<void>;
332
+ submit(options?: ComposerSubmitOptions): Promise<void>;
321
333
  /**
322
334
  * Set this composer's pickers as if each value had been picked by hand.
323
335
  *
@@ -396,20 +408,22 @@ interface ComposerSelection {
396
408
  serviceTier?: ServiceTier;
397
409
  permissionMode?: PermissionMode;
398
410
  }
399
- /**
400
- * What `submit` does differently from pressing Enter.
401
- *
402
- * `experimental_data` is opaque JSON delivered to dispatch hooks. The runtime
403
- * associates it with the calling plugin automatically for the initial
404
- * dispatch attempt.
405
- */
406
- type ComposerSubmitOptions = {
407
- sendAt: number;
411
+ /** What `submit` adds to pressing Enter. Every field combines with the others. */
412
+ interface ComposerSubmitOptions {
413
+ /**
414
+ * `"queue-if-active"` queues behind the running turn and
415
+ * `"steer-if-active"` adds to it; both start a turn when none is running.
416
+ * Omitted, it does what Enter does for this user.
417
+ */
418
+ experimental_mode?: "queue-if-active" | "steer-if-active";
419
+ /** Epoch ms in the future; the action waits until then. */
420
+ sendAt?: number;
421
+ /**
422
+ * Opaque JSON delivered to dispatch hooks with the calling plugin's id on
423
+ * the initial dispatch attempt.
424
+ */
408
425
  experimental_data?: JsonValue;
409
- } | {
410
- experimental_data: JsonValue;
411
- sendAt?: never;
412
- };
426
+ }
413
427
 
414
428
  declare function reconcileComposerMentions(currentText: string, nextText: string, mentions: readonly ComposerMention[]): ComposerMention[];
415
429
 
@@ -425,6 +439,16 @@ interface ComposerEditorState {
425
439
  isAttaching: boolean;
426
440
  attachmentError: string | null;
427
441
  }
442
+ interface ComposerSubmitExtras {
443
+ sendAt?: number;
444
+ pluginSubmission?: {
445
+ pluginId: string;
446
+ data: JsonValue$2;
447
+ };
448
+ }
449
+ interface ComposerEditorSubmission extends ComposerSubmitExtras {
450
+ mode: "enter" | "queue-if-active" | "steer-if-active";
451
+ }
428
452
  interface ComposerHandleTarget {
429
453
  key: string;
430
454
  scope: PluginComposerScope$1;
@@ -440,10 +464,11 @@ interface ComposerHandleTarget {
440
464
  focus(): void;
441
465
  openPopup?(pluginId: string, popupId: string): boolean;
442
466
  closePopup?(pluginId: string): boolean;
443
- submit?(options: ComposerSubmitOptions$1, pluginSubmission: {
444
- pluginId: string;
445
- data: JsonValue$2;
446
- } | undefined): Promise<void>;
467
+ /**
468
+ * Runs the on-screen composer's own Enter, queue or steer handler with the
469
+ * submission's extras, or returns null when no composer box is mounted.
470
+ */
471
+ editorSubmit(submission: ComposerEditorSubmission): Promise<void> | null;
447
472
  setSelection?(selection: ComposerSelection$1): Promise<ComposerSelection$1>;
448
473
  }
449
474
  interface ComposerHandleController {
@@ -464,4 +489,4 @@ declare function appendComposerDraft(current: ComposerDraft$1, value: ComposerDr
464
489
  declare function createComposerHandleBinding(key: string, initial: ComposerHandleController): ComposerHandleBinding;
465
490
 
466
491
  export { OFF_SCREEN_EDITOR_STATE, appendComposerDraft, createComposerDraftActions, createComposerHandleBinding, reconcileComposerMentions };
467
- export type { ComposerEditorState, ComposerHandleBinding, ComposerHandleController, ComposerHandleTarget };
492
+ export type { ComposerEditorState, ComposerEditorSubmission, ComposerHandleBinding, ComposerHandleController, ComposerHandleTarget, ComposerSubmitExtras };
@@ -5,8 +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 { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginSidebarFooterActionRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginThreadListRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationPlacement, PluginThreadHeaderActionRegistration, PluginThreadActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, ExperimentalCodeFenceRendererRegistration, PluginMessageActionRegistration, PluginCommandRegistration, ExperimentalComposerCommandRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
8
9
  import { z } from 'zod';
9
- import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationPlacement, PluginThreadHeaderActionRegistration, PluginThreadActionRegistration, ExperimentalPluginBrowserToolbarActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, ExperimentalCodeFenceRendererRegistration, 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 {
@@ -37,11 +37,12 @@ interface CollectedCompatibilitySidebarFooterItem {
37
37
  }
38
38
  type CollectedSidebarFooterItem = CollectedCompatibilitySidebarFooterItem | CollectedManagedSidebarFooterItem;
39
39
  declare function adaptSidebarFooterAction(registration: PluginSidebarFooterActionRegistration): CollectedCompatibilitySidebarFooterItem;
40
+ declare function getCollectedSidebarFooterItems(registrations: object): readonly CollectedSidebarFooterItem[] | null;
41
+
40
42
  type CollectedPluginProviderIconRegistration = Omit<PluginProviderIconRegistration, "providerKind"> & {
41
43
  providerKind: PluginProviderIconRegistration["providerKind"] | "all";
42
44
  };
43
- /** Validated registrations produced by one plugin app setup execution. */
44
- declare const commandShortcutSchema: z.ZodObject<{
45
+ declare function createCommandShortcutSchema(): z.ZodObject<{
45
46
  alt: z.ZodDefault<z.ZodBoolean>;
46
47
  control: z.ZodDefault<z.ZodBoolean>;
47
48
  key: z.ZodString;
@@ -49,7 +50,7 @@ declare const commandShortcutSchema: z.ZodObject<{
49
50
  mod: z.ZodDefault<z.ZodBoolean>;
50
51
  shift: z.ZodDefault<z.ZodBoolean>;
51
52
  }, z.core.$strict>;
52
- type CollectedCommandShortcut = z.infer<typeof commandShortcutSchema> | null;
53
+ type CollectedCommandShortcut = z.infer<ReturnType<typeof createCommandShortcutSchema>> | null;
53
54
  type CollectedPluginCommandRegistration = (Omit<PluginCommandRegistration, "defaultShortcut"> & {
54
55
  target: "app";
55
56
  defaultShortcut: CollectedCommandShortcut;
@@ -90,13 +91,6 @@ interface CollectedPluginAppRegistrations {
90
91
  interface CollectedSidebarNavigationRegistration extends ExperimentalSidebarNavigationRegistration {
91
92
  placement: ExperimentalSidebarNavigationPlacement;
92
93
  }
93
- declare function getCollectedSidebarFooterItems(registrations: object): readonly CollectedSidebarFooterItem[] | null;
94
- /**
95
- * Run a plugin app definition against the canonical validating collector.
96
- * Both the BB app and the public test harness use this implementation so a
97
- * registration accepted by one cannot be rejected or normalized differently
98
- * by the other.
99
- */
100
94
  declare function collectPluginAppRegistrations(definition: PluginAppDefinition, onWarning?: (message: string) => void): CollectedPluginAppRegistrations;
101
95
 
102
96
  export { adaptSidebarFooterAction, collectPluginAppRegistrations, getCollectedSidebarFooterItems };
@@ -24,6 +24,7 @@ interface ExperimentalSidebarFooterItemRuntime {
24
24
  type CollectedExperimentalSidebarFooterItem = ExperimentalSidebarFooterItemRegistration & {
25
25
  runtime: ExperimentalSidebarFooterItemRuntime;
26
26
  };
27
+
27
28
  type CollectedPluginProviderIconRegistration = Omit<PluginProviderIconRegistration, "providerKind"> & {
28
29
  providerKind: PluginProviderIconRegistration["providerKind"] | "all";
29
30
  };
@@ -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 as StandardSchemaV1InferOutput$1, 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';
8
+ import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput as StandardSchemaV1InferOutput$1, 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, InternalDoNotUsePluginNextTunnelConfig, InternalDoNotUsePluginHostNextTunnelStatus, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
9
9
  import { z } from 'zod';
10
10
 
11
11
  type PluginMachineProviderResource = Exclude<JsonValue$2, null>;
@@ -1236,6 +1236,13 @@ interface FakePluginRegistrations {
1236
1236
  * (normalized declarations, registration order; dispose removes). */
1237
1237
  aiServiceRegistrations: PluginAiServiceDeclaration[];
1238
1238
  }
1239
+ /** One handle opened through `bb.server.internal_DO_NOT_USE_openTunnelIngress`. */
1240
+ interface InternalDoNotUseFakeTunnelIngress {
1241
+ readonly audience: string;
1242
+ readonly baseUrl: string;
1243
+ /** True once the plugin closed the handle or the host disposed it. */
1244
+ readonly closed: boolean;
1245
+ }
1239
1246
  /** Read-only state for assertions after a plugin registers or handles work. */
1240
1247
  interface FakePluginInspectionState {
1241
1248
  readonly pluginId: string;
@@ -1255,10 +1262,19 @@ interface FakePluginInspectionState {
1255
1262
  /** Recorded `bb.sdk` calls + stub control. */
1256
1263
  readonly sdk: FakeSdkHarness;
1257
1264
  readonly registrations: FakePluginRegistrations;
1265
+ /** Every `bb.server.internal_DO_NOT_USE_openTunnelIngress` handle, in order. */
1266
+ readonly internal_DO_NOT_USE_tunnelIngresses: readonly InternalDoNotUseFakeTunnelIngress[];
1258
1267
  readonly sharedPortDeclarations: Array<{
1259
1268
  hostId: string;
1260
1269
  ports: number[];
1261
1270
  }>;
1271
+ /** The last `bb.hosts.internal_DO_NOT_USE_setNextTunnels` config, or null. */
1272
+ readonly internal_DO_NOT_USE_nextTunnelConfig: InternalDoNotUsePluginNextTunnelConfig | null;
1273
+ /**
1274
+ * Replace what `bb.hosts.internal_DO_NOT_USE_nextTunnelStatuses` returns and call
1275
+ * every `internal_DO_NOT_USE_onNextTunnelStatusChange` listener.
1276
+ */
1277
+ internal_DO_NOT_USE_setNextTunnelStatuses(statuses: readonly InternalDoNotUsePluginHostNextTunnelStatus[]): void;
1262
1278
  /** Calls made through bb.hosts.experimental_client, after input validation. */
1263
1279
  readonly experimental_hostRpcCalls: readonly ExperimentalFakeHostRpcCall[];
1264
1280
  readonly pendingInteractions: readonly (PluginInteractionRequest & {
@@ -1536,4 +1552,4 @@ interface PublicSdkOnlyScan {
1536
1552
  declare function scanPublicSdkOnly(packageRoot: string, options?: PublicSdkOnlyScanOptions): PublicSdkOnlyScan;
1537
1553
 
1538
1554
  export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeHostResponse, makeMessageDispatchHookContext, makePluginAgentConfigurationContext, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
1539
- export type { CreateFakePluginHostOptions, ExperimentalFakeHostRpcCall, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };
1555
+ export type { CreateFakePluginHostOptions, ExperimentalFakeHostRpcCall, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, InternalDoNotUseFakeTunnelIngress, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };