@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.
@@ -4318,6 +4318,17 @@ declare const threadRuntimeDisplayStatusSchema: z$1.ZodEnum<{
4318
4318
  starting: "starting";
4319
4319
  stopping: "stopping";
4320
4320
  }>;
4321
+
4322
+ /**
4323
+ * The three additions to {@link threadStatusValues} are display-only: they
4324
+ * refine `active`/`idle` with host and workspace facts the durable status does
4325
+ * not record.
4326
+ *
4327
+ * A never-started thread needs no such refinement — `pending` is a real thread
4328
+ * status now, so it travels to the client as itself. It used to arrive as a
4329
+ * separate `held` display status, derived from an `idle` thread holding a live
4330
+ * dispatch hold; that derivation and the holds behind it are both gone.
4331
+ */
4321
4332
  type ThreadRuntimeDisplayStatus = z$1.infer<typeof threadRuntimeDisplayStatusSchema>;
4322
4333
  declare const threadQueuedMessageSchema: z$1.ZodObject<{
4323
4334
  content: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
@@ -6185,6 +6196,12 @@ interface HostDaemonCommandDescriptor<Type extends string, Schema extends z$1.Zo
6185
6196
  envLane: HostDaemonCommandEnvironmentLane | null;
6186
6197
  }
6187
6198
  declare const hostDaemonCommandRegistry: {
6199
+ "desktop.broker.prove": HostDaemonCommandDescriptor<"desktop.broker.prove", z$1.ZodObject<{
6200
+ challenge: z$1.ZodString;
6201
+ type: z$1.ZodLiteral<"desktop.broker.prove">;
6202
+ }, z$1.core.$strict>, z$1.ZodObject<{
6203
+ proof: z$1.ZodString;
6204
+ }, z$1.core.$strict>, "onlineRpc", false>;
6188
6205
  "desktop.browser.list_instances": HostDaemonCommandDescriptor<"desktop.browser.list_instances", z$1.ZodObject<{
6189
6206
  type: z$1.ZodLiteral<"desktop.browser.list_instances">;
6190
6207
  }, z$1.core.$strict>, z$1.ZodObject<{
@@ -7810,6 +7827,16 @@ declare const hostDaemonCommandRegistry: {
7810
7827
  timeoutMs: z$1.ZodNumber;
7811
7828
  type: z$1.ZodLiteral<"environment.hook.run">;
7812
7829
  }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, "onlineRpc", false>;
7830
+ "environment.inspect_cleanup": HostDaemonCommandDescriptor<"environment.inspect_cleanup", z$1.ZodObject<{
7831
+ environmentId: z$1.ZodString;
7832
+ path: z$1.ZodString;
7833
+ type: z$1.ZodLiteral<"environment.inspect_cleanup">;
7834
+ }, z$1.core.$strict>, z$1.ZodObject<{
7835
+ active: z$1.ZodBoolean;
7836
+ pids: z$1.ZodArray<z$1.ZodNumber>;
7837
+ supported: z$1.ZodBoolean;
7838
+ unreadablePids: z$1.ZodArray<z$1.ZodNumber>;
7839
+ }, z$1.core.$strict>, "onlineRpc", true>;
7813
7840
  "environment.hook.cancel": HostDaemonCommandDescriptor<"environment.hook.cancel", z$1.ZodObject<{
7814
7841
  operationId: z$1.ZodString;
7815
7842
  type: z$1.ZodLiteral<"environment.hook.cancel">;
@@ -10544,6 +10571,50 @@ declare const publishedPluginRpcMethodSchema: z$1.ZodObject<{
10544
10571
  }, z$1.core.$strip>;
10545
10572
  type PublishedPluginRpcMethod = z$1.infer<typeof publishedPluginRpcMethodSchema>;
10546
10573
 
10574
+ declare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{
10575
+ text: z$1.ZodString;
10576
+ }, z$1.core.$strip>;
10577
+
10578
+ declare const systemEnvironmentProviderSchema: z$1.ZodObject<{
10579
+ acceptsEmptyInputs: z$1.ZodBoolean;
10580
+ availability: z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
10581
+ status: z$1.ZodLiteral<"available">;
10582
+ }, z$1.core.$strip>, z$1.ZodObject<{
10583
+ message: z$1.ZodString;
10584
+ status: z$1.ZodLiteral<"setup-required">;
10585
+ }, z$1.core.$strip>, z$1.ZodObject<{
10586
+ message: z$1.ZodString;
10587
+ status: z$1.ZodLiteral<"unavailable">;
10588
+ }, z$1.core.$strip>], "status">>;
10589
+ description: z$1.ZodNullable<z$1.ZodString>;
10590
+ displayName: z$1.ZodString;
10591
+ environmentProviderId: z$1.ZodOptional<z$1.ZodString>;
10592
+ icon: z$1.ZodNullable<z$1.ZodString>;
10593
+ id: z$1.ZodString;
10594
+ inputs: z$1.ZodNullable<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
10595
+ logoUrl: z$1.ZodNullable<z$1.ZodString>;
10596
+ machineAcceptsEmptyInputs: z$1.ZodOptional<z$1.ZodBoolean>;
10597
+ machineAvailability: z$1.ZodRecord<z$1.ZodString, z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
10598
+ status: z$1.ZodLiteral<"available">;
10599
+ }, z$1.core.$strip>, z$1.ZodObject<{
10600
+ message: z$1.ZodString;
10601
+ status: z$1.ZodLiteral<"setup-required">;
10602
+ }, z$1.core.$strip>, z$1.ZodObject<{
10603
+ message: z$1.ZodString;
10604
+ status: z$1.ZodLiteral<"unavailable">;
10605
+ }, z$1.core.$strip>], "status">>>;
10606
+ machineInputs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>>;
10607
+ machineProviderId: z$1.ZodNullable<z$1.ZodString>;
10608
+ machineProviderPluginId: z$1.ZodOptional<z$1.ZodString>;
10609
+ pluginId: z$1.ZodString;
10610
+ requires: z$1.ZodObject<{
10611
+ gitCheckout: z$1.ZodBoolean;
10612
+ gitRemote: z$1.ZodBoolean;
10613
+ projectCheckout: z$1.ZodBoolean;
10614
+ projectless: z$1.ZodBoolean;
10615
+ }, z$1.core.$strip>;
10616
+ }, z$1.core.$strip>;
10617
+
10547
10618
  declare const machineEnvironmentReplaceSchema: z$1.ZodObject<{
10548
10619
  variables: z$1.ZodArray<z$1.ZodObject<{
10549
10620
  name: z$1.ZodString;
@@ -10766,9 +10837,6 @@ declare const systemUsageLimitsQuerySchema: z$1.ZodObject<{
10766
10837
  }>>;
10767
10838
  }, z$1.core.$strip>;
10768
10839
  type SystemUsageLimitsQuery = z$1.infer<typeof systemUsageLimitsQuerySchema>;
10769
- declare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{
10770
- text: z$1.ZodString;
10771
- }, z$1.core.$strip>;
10772
10840
  type SystemVoiceTranscriptionResponse = z$1.infer<typeof systemVoiceTranscriptionResponseSchema>;
10773
10841
  declare const systemProviderStatesResponseSchema: z$1.ZodObject<{
10774
10842
  providers: z$1.ZodArray<z$1.ZodObject<{
@@ -11628,45 +11696,6 @@ declare const systemInstallCliSkillsResponseSchema: z$1.ZodObject<{
11628
11696
  }, z$1.core.$strip>;
11629
11697
  type SystemInstallCliSkillsResponse = z$1.infer<typeof systemInstallCliSkillsResponseSchema>;
11630
11698
  type SystemConfigReloadResponse = z$1.infer<typeof systemConfigReloadResponseSchema>;
11631
- declare const systemEnvironmentProviderSchema: z$1.ZodObject<{
11632
- acceptsEmptyInputs: z$1.ZodBoolean;
11633
- availability: z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
11634
- status: z$1.ZodLiteral<"available">;
11635
- }, z$1.core.$strip>, z$1.ZodObject<{
11636
- message: z$1.ZodString;
11637
- status: z$1.ZodLiteral<"setup-required">;
11638
- }, z$1.core.$strip>, z$1.ZodObject<{
11639
- message: z$1.ZodString;
11640
- status: z$1.ZodLiteral<"unavailable">;
11641
- }, z$1.core.$strip>], "status">>;
11642
- description: z$1.ZodNullable<z$1.ZodString>;
11643
- displayName: z$1.ZodString;
11644
- environmentProviderId: z$1.ZodOptional<z$1.ZodString>;
11645
- icon: z$1.ZodNullable<z$1.ZodString>;
11646
- id: z$1.ZodString;
11647
- inputs: z$1.ZodNullable<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
11648
- logoUrl: z$1.ZodNullable<z$1.ZodString>;
11649
- machineAcceptsEmptyInputs: z$1.ZodOptional<z$1.ZodBoolean>;
11650
- machineAvailability: z$1.ZodRecord<z$1.ZodString, z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
11651
- status: z$1.ZodLiteral<"available">;
11652
- }, z$1.core.$strip>, z$1.ZodObject<{
11653
- message: z$1.ZodString;
11654
- status: z$1.ZodLiteral<"setup-required">;
11655
- }, z$1.core.$strip>, z$1.ZodObject<{
11656
- message: z$1.ZodString;
11657
- status: z$1.ZodLiteral<"unavailable">;
11658
- }, z$1.core.$strip>], "status">>>;
11659
- machineInputs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>>;
11660
- machineProviderId: z$1.ZodNullable<z$1.ZodString>;
11661
- machineProviderPluginId: z$1.ZodOptional<z$1.ZodString>;
11662
- pluginId: z$1.ZodString;
11663
- requires: z$1.ZodObject<{
11664
- gitCheckout: z$1.ZodBoolean;
11665
- gitRemote: z$1.ZodBoolean;
11666
- projectCheckout: z$1.ZodBoolean;
11667
- projectless: z$1.ZodBoolean;
11668
- }, z$1.core.$strip>;
11669
- }, z$1.core.$strip>;
11670
11699
  type SystemEnvironmentProvider = z$1.infer<typeof systemEnvironmentProviderSchema>;
11671
11700
  declare const systemMachineProviderSchema: z$1.ZodObject<{
11672
11701
  acceptsEmptyInputs: z$1.ZodBoolean;
@@ -13113,6 +13142,21 @@ interface TimelineTurnRow extends TimelineRowBase {
13113
13142
  type TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;
13114
13143
  type TimelineRow = TimelineSourceRow | TimelineTurnRow;
13115
13144
 
13145
+ declare const threadOpenSplitSchema: z$1.ZodEnum<{
13146
+ down: "down";
13147
+ left: "left";
13148
+ replace: "replace";
13149
+ right: "right";
13150
+ top: "top";
13151
+ }>;
13152
+ declare const threadPaneActionSchema: z$1.ZodEnum<{
13153
+ "clear-spotlight": "clear-spotlight";
13154
+ maximize: "maximize";
13155
+ restore: "restore";
13156
+ spotlight: "spotlight";
13157
+ toggle: "toggle";
13158
+ }>;
13159
+
13116
13160
  type ExecutionInputFieldSource = CallerExecutionInputSource;
13117
13161
  declare const createExecutionInputSourcesSchema: z$1.ZodObject<{
13118
13162
  model: z$1.ZodOptional<z$1.ZodEnum<{
@@ -15481,13 +15525,6 @@ declare const reorderPinnedThreadRequestSchema: z$1.ZodObject<{
15481
15525
  previousThreadId: z$1.ZodNullable<z$1.ZodString>;
15482
15526
  }, z$1.core.$strip>;
15483
15527
  type ReorderPinnedThreadRequest = z$1.infer<typeof reorderPinnedThreadRequestSchema>;
15484
- declare const threadOpenSplitSchema: z$1.ZodEnum<{
15485
- down: "down";
15486
- left: "left";
15487
- replace: "replace";
15488
- right: "right";
15489
- top: "top";
15490
- }>;
15491
15528
  type ThreadOpenSplit = z$1.infer<typeof threadOpenSplitSchema>;
15492
15529
  declare const threadOpenFileSchema: z$1.ZodObject<{
15493
15530
  lineNumber: z$1.ZodNullable<z$1.ZodNumber>;
@@ -15502,13 +15539,6 @@ declare const threadOpenResponseSchema: z$1.ZodObject<{
15502
15539
  delivered: z$1.ZodNumber;
15503
15540
  }, z$1.core.$strip>;
15504
15541
  type ThreadOpenResponse = z$1.infer<typeof threadOpenResponseSchema>;
15505
- declare const threadPaneActionSchema: z$1.ZodEnum<{
15506
- "clear-spotlight": "clear-spotlight";
15507
- maximize: "maximize";
15508
- restore: "restore";
15509
- spotlight: "spotlight";
15510
- toggle: "toggle";
15511
- }>;
15512
15542
  type ThreadPaneAction = z$1.infer<typeof threadPaneActionSchema>;
15513
15543
  declare const threadPaneActionResponseSchema: z$1.ZodObject<{
15514
15544
  delivered: z$1.ZodNumber;
@@ -15519,6 +15549,10 @@ declare const threadArchiveAllResponseSchema: z$1.ZodObject<{
15519
15549
  ok: z$1.ZodLiteral<true>;
15520
15550
  }, z$1.core.$strip>;
15521
15551
  type ThreadArchiveAllResponse = z$1.infer<typeof threadArchiveAllResponseSchema>;
15552
+ /**
15553
+ * Reads the `threadIds` list filter. The empty string is the empty set, so a
15554
+ * caller with no IDs gets no threads instead of every thread.
15555
+ */
15522
15556
  declare const threadListQuerySchema: z$1.ZodObject<{
15523
15557
  archived: z$1.ZodOptional<z$1.ZodEnum<{
15524
15558
  false: "false";
@@ -17339,7 +17373,9 @@ interface EnvironmentListProvidersArgs {
17339
17373
  }
17340
17374
  type EnvironmentListProvidersResult = SystemEnvironmentProvider[];
17341
17375
  interface EnvironmentsArea {
17342
- experimental_cleanup(args: EnvironmentActionArgs): Promise<{
17376
+ experimental_cleanup(args: EnvironmentActionArgs & {
17377
+ recover?: boolean;
17378
+ }): Promise<{
17343
17379
  ok: true;
17344
17380
  }>;
17345
17381
  archiveThreads(args: EnvironmentActionArgs): Promise<EnvironmentArchiveThreadsResult>;
@@ -21798,29 +21834,41 @@ interface PluginComposerApi {
21798
21834
  /** Focus the composer caret at the end of the draft. */
21799
21835
  focus(): void;
21800
21836
  /**
21801
- * Submit this composer's draft exactly as pressing Enter would: the same
21802
- * checks and the same action (send, or queue while the thread is busy; a
21803
- * provider handoff creates a new thread). The draft's attachments and
21837
+ * Submit this composer's draft through the composer's own send and steer
21838
+ * handlers, the ones Enter and modifier+Enter run, including a
21839
+ * provider handoff that creates a new thread. The draft's attachments and
21804
21840
  * @-mentions, and — in the new-thread composer — the provider, model,
21805
21841
  * reasoning level, service tier, permission mode and environment the user
21806
21842
  * has selected on screen, all travel with it.
21807
21843
  *
21808
- * While attachments are uploading it waits for them, then checks again; it
21809
- * rejects if an upload fails. Otherwise, when submitting is blocked it
21810
- * rejects with `submittingBlockedReason`, a message safe to show to the
21811
- * user. The queued-message and sent-message editors save edits and reject.
21844
+ * It submits only the draft, so it rejects an empty one, even where the
21845
+ * shortcut would steer the next queued message instead. Otherwise it runs
21846
+ * only when the matching shortcut would. While attachments are uploading it
21847
+ * waits for them, then checks again; it rejects if an upload fails. When
21848
+ * the shortcut could not submit, it rejects with the reason, a message safe
21849
+ * to show to the user. The composer must be on screen. The queued-message
21850
+ * and sent-message editors reject.
21812
21851
  *
21813
- * `sendAt` queues the submission until that time. `experimental_data` is
21814
- * opaque JSON delivered to dispatch hooks together with the calling plugin's
21815
- * id on this initial attempt. Hooks run before operational core waits. If a
21816
- * hook queues the message, its existing plugin wait identifies the owner on
21817
- * later attempts; core does not persist or interpret the opaque data.
21852
+ * Every option combines with the others. `experimental_mode` uses the
21853
+ * names `bb.sdk.threads.send` uses. Without it, submit does what Enter
21854
+ * does for this user, which may be to queue or to steer.
21855
+ * `"queue-if-active"` queues behind the running turn, or starts a turn.
21856
+ * `"steer-if-active"` adds the message to the running turn. Where nothing
21857
+ * can be steered, such as on an idle thread, it starts a turn.
21858
+ * `sendAt` makes the chosen action wait until the given time; a scheduled
21859
+ * steer steers whatever turn is running then. `experimental_data` is
21860
+ * opaque JSON delivered to dispatch hooks together with the calling
21861
+ * plugin's id on this initial attempt. Hooks run before operational core
21862
+ * waits. If a hook queues the message, its existing plugin wait identifies
21863
+ * the owner on later attempts; core does not persist or interpret the
21864
+ * opaque data.
21818
21865
  *
21819
- * Resolves once the host has accepted the submission and cleared the draft.
21820
- * Failures of the underlying request are reported by bb's own submit error
21821
- * handling and restore the draft, exactly as an interactive failure does.
21866
+ * Resolves once the composer has accepted the submission and cleared the
21867
+ * draft. Failures of the underlying request show bb's usual error toast
21868
+ * and restore the draft, exactly as an interactive failure does, and then
21869
+ * reject with the toast's message.
21822
21870
  */
21823
- submit(options: ComposerSubmitOptions): Promise<void>;
21871
+ submit(options?: ComposerSubmitOptions): Promise<void>;
21824
21872
  /**
21825
21873
  * Set this composer's pickers as if each value had been picked by hand.
21826
21874
  *
@@ -21899,20 +21947,22 @@ interface ComposerSelection {
21899
21947
  serviceTier?: ServiceTier;
21900
21948
  permissionMode?: PermissionMode;
21901
21949
  }
21902
- /**
21903
- * What `submit` does differently from pressing Enter.
21904
- *
21905
- * `experimental_data` is opaque JSON delivered to dispatch hooks. The runtime
21906
- * associates it with the calling plugin automatically for the initial
21907
- * dispatch attempt.
21908
- */
21909
- type ComposerSubmitOptions = {
21910
- sendAt: number;
21950
+ /** What `submit` adds to pressing Enter. Every field combines with the others. */
21951
+ interface ComposerSubmitOptions {
21952
+ /**
21953
+ * `"queue-if-active"` queues behind the running turn and
21954
+ * `"steer-if-active"` adds to it; both start a turn when none is running.
21955
+ * Omitted, it does what Enter does for this user.
21956
+ */
21957
+ experimental_mode?: "queue-if-active" | "steer-if-active";
21958
+ /** Epoch ms in the future; the action waits until then. */
21959
+ sendAt?: number;
21960
+ /**
21961
+ * Opaque JSON delivered to dispatch hooks with the calling plugin's id on
21962
+ * the initial dispatch attempt.
21963
+ */
21911
21964
  experimental_data?: JsonValue;
21912
- } | {
21913
- experimental_data: JsonValue;
21914
- sendAt?: never;
21915
- };
21965
+ }
21916
21966
  /**
21917
21967
  * A consumer-supplied action on the messages of one `ThreadChat` instance,
21918
21968
  * rendered in the embedded timeline's per-message action bar alongside the
@@ -24868,6 +24918,36 @@ interface PluginServerApi {
24868
24918
  * not a place to write.
24869
24919
  */
24870
24920
  readonly experimental_dataDir: string;
24921
+ /**
24922
+ * Internal to bb's own connect plugins. Do not use: it is not part of the
24923
+ * plugin API and may change or disappear in any release.
24924
+ *
24925
+ * Open (or share) this server's tunnel ingress for `audience`, a private
24926
+ * listener on 127.0.0.1 with an ephemeral port. For a plugin that runs a
24927
+ * tunnel client for bb connect next: point the client at `baseUrl`.
24928
+ *
24929
+ * Every HTTP request and WebSocket upgrade must carry an
24930
+ * `x-bb-gate-assertion` signed by the bb connect gate for `audience`
24931
+ * (`server:<serverId>`), the request method and the exact path and query;
24932
+ * anything else is answered 401. A verified request reaches the same app
24933
+ * as `loopbackBaseUrl`, authenticated only by the gate's claims.
24934
+ *
24935
+ * Opening the same audience again shares the listener; it stops when every
24936
+ * handle is closed. Handles close when the plugin is disabled or unloaded.
24937
+ */
24938
+ internal_DO_NOT_USE_openTunnelIngress(options: InternalDoNotUsePluginTunnelIngressOptions): Promise<InternalDoNotUsePluginTunnelIngress>;
24939
+ }
24940
+ /** Options for `bb.server.internal_DO_NOT_USE_openTunnelIngress`. */
24941
+ interface InternalDoNotUsePluginTunnelIngressOptions {
24942
+ /** The gate assertion audience this ingress accepts, e.g. `server:<id>`. */
24943
+ audience: string;
24944
+ }
24945
+ /** A handle on an open tunnel ingress. */
24946
+ interface InternalDoNotUsePluginTunnelIngress {
24947
+ /** Base URL of the ingress listener, e.g. "http://127.0.0.1:41234". */
24948
+ readonly baseUrl: string;
24949
+ /** Release this handle; idempotent. */
24950
+ close(): Promise<void>;
24871
24951
  }
24872
24952
  /** Options for one `complete` call. */
24873
24953
  interface PluginAiCompleteOptions {
@@ -24951,6 +25031,45 @@ interface PluginSharedPortTunnelIdentity {
24951
25031
  /** Gate apex without a scheme, e.g. "getbb.app". */
24952
25032
  baseDomain: string;
24953
25033
  }
25034
+ /** The frp server a machine's next tunnel dials. */
25035
+ interface InternalDoNotUsePluginNextTunnelServer {
25036
+ /** `wss` for TLS, `websocket` for plain `ws://` (local runs only). */
25037
+ protocol: "websocket" | "wss";
25038
+ /** Host name without a port, e.g. "tunnel.next.getbb.app". */
25039
+ host: string;
25040
+ port: number;
25041
+ }
25042
+ /** Where every eligible machine serves its port shares through bb connect next. */
25043
+ interface InternalDoNotUsePluginNextTunnelConfig {
25044
+ /**
25045
+ * Next domain without a scheme, with a port only for local runs, e.g.
25046
+ * "next.getbb.app". A share answers at `<machine-label>--<port>.<domain>`.
25047
+ */
25048
+ domain: string;
25049
+ server: InternalDoNotUsePluginNextTunnelServer;
25050
+ }
25051
+ /** One machine's next tunnel, as its daemon last reported it. */
25052
+ interface InternalDoNotUsePluginHostNextTunnelStatus {
25053
+ hostId: string;
25054
+ hostName: string;
25055
+ /**
25056
+ * `idle` while the machine shares no port or next is off, `refused` when
25057
+ * the gate refused the machine credential (retried after five minutes),
25058
+ * `offline` when the gate cannot be reached (retried with backoff),
25059
+ * `error` when the daemon could not start frpc or refused the configuration.
25060
+ */
25061
+ state: "connected" | "connecting" | "error" | "idle" | "offline" | "refused";
25062
+ /** The machine's gate label, or null before the daemon learned it. */
25063
+ label: string | null;
25064
+ lastError: string | null;
25065
+ nextRetryAt: number | null;
25066
+ since: number;
25067
+ shares: Array<{
25068
+ port: number;
25069
+ state: "active" | "pending" | "refused";
25070
+ error: string | null;
25071
+ }>;
25072
+ }
24954
25073
  interface PluginHosts {
24955
25074
  /** Create the owning plugin's typed client for its singular `bb.host` entry. */
24956
25075
  experimental_client<Contract extends PluginRpcContract, Signals extends ExperimentalHostSignals = {}>(args: {
@@ -24973,6 +25092,31 @@ interface PluginHosts {
24973
25092
  * here: it is owned by the daemon's trusted enrollment.
24974
25093
  */
24975
25094
  declareSharedPorts(hostId: string, ports: readonly number[]): void;
25095
+ /**
25096
+ * Internal to bb's own connect plugins. Do not use: it is not part of the
25097
+ * plugin API and may change or disappear in any release.
25098
+ *
25099
+ * Turn bb connect next machine tunnels on (a config) or off (`null`). The
25100
+ * server sends the config to every connected daemon that holds a bb connect
25101
+ * machine credential and speaks a protocol that knows next tunnels; each
25102
+ * such daemon runs frpc with one proxy per port declared with
25103
+ * `declareSharedPorts`, at `<machine-label>--<port>.<domain>`. The daemon
25104
+ * refuses a domain or tunnel server outside its trusted enrollment's
25105
+ * domain. One plugin owns the setting at a time; another plugin's call
25106
+ * throws while it is set. Cleared when the owning plugin is disabled.
25107
+ */
25108
+ internal_DO_NOT_USE_setNextTunnels(config: InternalDoNotUsePluginNextTunnelConfig | null): void;
25109
+ /** Internal to bb's own connect plugins; do not use. The last next-tunnel status of every connected daemon that reported one. */
25110
+ internal_DO_NOT_USE_nextTunnelStatuses(): InternalDoNotUsePluginHostNextTunnelStatus[];
25111
+ /**
25112
+ * Internal to bb's own connect plugins. Do not use: it is not part of the
25113
+ * plugin API and may change or disappear in any release.
25114
+ *
25115
+ * Call `listener` whenever a daemon reports a changed next-tunnel status or
25116
+ * its session ends. Returns an unsubscribe function; plugin disposal also
25117
+ * unsubscribes.
25118
+ */
25119
+ internal_DO_NOT_USE_onNextTunnelStatusChange(listener: () => void): () => void;
24976
25120
  }
24977
25121
  interface PluginStatusApi {
24978
25122
  /**
@@ -25339,4 +25483,4 @@ declare const experimental_THREAD_ACTION_GROUPS: {
25339
25483
  };
25340
25484
 
25341
25485
  export { PLUGIN_CLI_OUTPUT_MAX_BYTES, PluginCliError, cliCommand, defineCli, defineRpcContract, experimental_PluginRpcCallError, experimental_PluginRpcRefusal, experimental_THREAD_ACTION_GROUPS, experimental_defineHostEntry };
25342
- 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, ExperimentalBadge, ExperimentalBadgeTone, ExperimentalClipboardContent, ExperimentalCodeFenceRendererProps, ExperimentalCodeFenceRendererRegistration, ExperimentalCodeFenceStatus, 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, ExperimentalPageBreadcrumb, ExperimentalPageTitle, 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, ExperimentalRpcKeyedMethod, ExperimentalRpcKeyedQueryState, ExperimentalRpcKeyedValue, ExperimentalRpcMutationOptions, ExperimentalRpcMutationState, ExperimentalRpcOptimisticCache, ExperimentalRpcQueryOptions, ExperimentalRpcQueryState, ExperimentalSaveFileOutcome, ExperimentalSaveFileRequest, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationPlacement, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, ExperimentalSidebarNavigationTarget, ExperimentalVoiceInputTextareaProps, 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, PluginBoundThreadAction, 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, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadAction, PluginThreadActionChoice, PluginThreadActionChoices, PluginThreadActionDataInput, PluginThreadActionEntry, PluginThreadActionItemInput, PluginThreadActionRegistration, PluginThreadActionRegistrationInfo, PluginThreadActionRunInput, PluginThreadActionTarget, PluginThreadActionsContextMenuProps, PluginThreadActionsInlineItem, PluginThreadActionsMenuProps, PluginThreadActionsOptions, PluginThreadActionsTriggerProps, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadStatusGlyphProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
25486
+ 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, ExperimentalBadge, ExperimentalBadgeTone, ExperimentalClipboardContent, ExperimentalCodeFenceRendererProps, ExperimentalCodeFenceRendererRegistration, ExperimentalCodeFenceStatus, 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, ExperimentalPageBreadcrumb, ExperimentalPageTitle, 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, ExperimentalRpcKeyedMethod, ExperimentalRpcKeyedQueryState, ExperimentalRpcKeyedValue, ExperimentalRpcMutationOptions, ExperimentalRpcMutationState, ExperimentalRpcOptimisticCache, ExperimentalRpcQueryOptions, ExperimentalRpcQueryState, ExperimentalSaveFileOutcome, ExperimentalSaveFileRequest, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationPlacement, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, ExperimentalSidebarNavigationTarget, ExperimentalVoiceInputTextareaProps, InternalDoNotUsePluginHostNextTunnelStatus, InternalDoNotUsePluginNextTunnelConfig, InternalDoNotUsePluginNextTunnelServer, InternalDoNotUsePluginTunnelIngress, InternalDoNotUsePluginTunnelIngressOptions, 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, PluginBoundThreadAction, 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, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadAction, PluginThreadActionChoice, PluginThreadActionChoices, PluginThreadActionDataInput, PluginThreadActionEntry, PluginThreadActionItemInput, PluginThreadActionRegistration, PluginThreadActionRegistrationInfo, PluginThreadActionRunInput, PluginThreadActionTarget, PluginThreadActionsContextMenuProps, PluginThreadActionsInlineItem, PluginThreadActionsMenuProps, PluginThreadActionsOptions, PluginThreadActionsTriggerProps, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadStatusGlyphProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
@@ -365,12 +365,8 @@ function createComposerHandleBinding(key, initial) {
365
365
  }
366
366
  target().setDraft(appendComposerDraft(target().getDraft(), value, block));
367
367
  };
368
- const submit = async (options) => {
368
+ const submit = async (options = {}) => {
369
369
  requireAvailable();
370
- const hostSubmit = target().submit;
371
- if (hostSubmit === void 0) {
372
- throw new Error("This composer cannot submit programmatically.");
373
- }
374
370
  if (options.sendAt !== void 0 && (!Number.isFinite(options.sendAt) || options.sendAt <= Date.now())) {
375
371
  throw new Error("Pick a time in the future.");
376
372
  }
@@ -380,15 +376,18 @@ function createComposerHandleBinding(key, initial) {
380
376
  if (state.attachmentError !== null && state.attachmentError !== errorBefore) {
381
377
  throw new Error(state.attachmentError);
382
378
  }
383
- if (state.isSubmittingBlocked) {
384
- throw new Error(
385
- state.submittingBlockedReason ?? "This composer can't submit right now."
386
- );
387
- }
388
- await hostSubmit(
389
- options,
390
- options.experimental_data === void 0 ? void 0 : { pluginId: controller.pluginId, data: options.experimental_data }
391
- );
379
+ const submission = target().editorSubmit({
380
+ mode: options.experimental_mode ?? "enter",
381
+ ...options.sendAt === void 0 ? {} : { sendAt: options.sendAt },
382
+ ...options.experimental_data === void 0 ? {} : {
383
+ pluginSubmission: {
384
+ pluginId: controller.pluginId,
385
+ data: options.experimental_data
386
+ }
387
+ }
388
+ });
389
+ if (submission === null) throw new Error(OFF_SCREEN_MESSAGE);
390
+ await submission;
392
391
  };
393
392
  const setSelection = async (selection) => {
394
393
  requireAvailable();