@get-bb/plugin-sdk 0.4.101 → 0.4.106

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.
@@ -3025,6 +3025,7 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
3025
3025
  "child-outcome-batch": "child-outcome-batch";
3026
3026
  "ownership-assigned": "ownership-assigned";
3027
3027
  "ownership-removed": "ownership-removed";
3028
+ "tool-result-delivered": "tool-result-delivered";
3028
3029
  unlabeled: "unlabeled";
3029
3030
  }>>;
3030
3031
  systemMessageSubject: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
@@ -3034,6 +3035,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
3034
3035
  }, z$1.core.$strip>, z$1.ZodObject<{
3035
3036
  count: z$1.ZodNumber;
3036
3037
  kind: z$1.ZodLiteral<"thread-batch">;
3038
+ }, z$1.core.$strip>, z$1.ZodObject<{
3039
+ kind: z$1.ZodLiteral<"tool-call">;
3040
+ suppress: z$1.ZodBoolean;
3041
+ toolName: z$1.ZodString;
3037
3042
  }, z$1.core.$strip>], "kind">>>;
3038
3043
  target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3039
3044
  kind: z$1.ZodLiteral<"thread-start">;
@@ -3287,9 +3292,39 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
3287
3292
  }, z$1.core.$strip>;
3288
3293
  payload: z$1.ZodObject<{
3289
3294
  kind: z$1.ZodLiteral<"plugin">;
3295
+ presentation: z$1.ZodOptional<z$1.ZodObject<{
3296
+ badge: z$1.ZodOptional<z$1.ZodObject<{
3297
+ glyph: z$1.ZodString;
3298
+ hint: z$1.ZodString;
3299
+ label: z$1.ZodString;
3300
+ tone: z$1.ZodEnum<{
3301
+ destructive: "destructive";
3302
+ neutral: "neutral";
3303
+ }>;
3304
+ }, z$1.core.$strip>>;
3305
+ detail: z$1.ZodOptional<z$1.ZodString>;
3306
+ icon: z$1.ZodObject<{
3307
+ glyph: z$1.ZodString;
3308
+ }, z$1.core.$strip>;
3309
+ label: z$1.ZodObject<{
3310
+ completed: z$1.ZodString;
3311
+ pending: z$1.ZodString;
3312
+ }, z$1.core.$strip>;
3313
+ suppress: z$1.ZodOptional<z$1.ZodBoolean>;
3314
+ tint: z$1.ZodOptional<z$1.ZodObject<{
3315
+ dark: z$1.ZodString;
3316
+ light: z$1.ZodString;
3317
+ }, z$1.core.$strip>>;
3318
+ title: z$1.ZodOptional<z$1.ZodString>;
3319
+ }, z$1.core.$strip>>;
3290
3320
  title: z$1.ZodString;
3291
3321
  }, z$1.core.$strip>;
3292
3322
  resolution: z$1.ZodNullable<z$1.ZodObject<{
3323
+ description: z$1.ZodOptional<z$1.ZodObject<{
3324
+ detail: z$1.ZodOptional<z$1.ZodString>;
3325
+ payload: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
3326
+ title: z$1.ZodOptional<z$1.ZodString>;
3327
+ }, z$1.core.$strip>>;
3293
3328
  kind: z$1.ZodLiteral<"plugin_submitted">;
3294
3329
  }, z$1.core.$strip>>;
3295
3330
  status: z$1.ZodEnum<{
@@ -3492,6 +3527,11 @@ declare const pendingInteractionResolutionSchema: z$1.ZodUnion<readonly [z$1.Zod
3492
3527
  }, z$1.core.$strip>>;
3493
3528
  kind: z$1.ZodLiteral<"user_answer">;
3494
3529
  }, z$1.core.$strip>, z$1.ZodObject<{
3530
+ description: z$1.ZodOptional<z$1.ZodObject<{
3531
+ detail: z$1.ZodOptional<z$1.ZodString>;
3532
+ payload: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
3533
+ title: z$1.ZodOptional<z$1.ZodString>;
3534
+ }, z$1.core.$strip>>;
3495
3535
  kind: z$1.ZodLiteral<"plugin_submitted">;
3496
3536
  }, z$1.core.$strip>, z$1.ZodObject<{
3497
3537
  kind: z$1.ZodLiteral<"request_answer">;
@@ -3739,9 +3779,39 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{
3739
3779
  payload: z$1.ZodObject<{
3740
3780
  data: z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;
3741
3781
  kind: z$1.ZodLiteral<"plugin">;
3782
+ presentation: z$1.ZodOptional<z$1.ZodObject<{
3783
+ badge: z$1.ZodOptional<z$1.ZodObject<{
3784
+ glyph: z$1.ZodString;
3785
+ hint: z$1.ZodString;
3786
+ label: z$1.ZodString;
3787
+ tone: z$1.ZodEnum<{
3788
+ destructive: "destructive";
3789
+ neutral: "neutral";
3790
+ }>;
3791
+ }, z$1.core.$strip>>;
3792
+ detail: z$1.ZodOptional<z$1.ZodString>;
3793
+ icon: z$1.ZodObject<{
3794
+ glyph: z$1.ZodString;
3795
+ }, z$1.core.$strip>;
3796
+ label: z$1.ZodObject<{
3797
+ completed: z$1.ZodString;
3798
+ pending: z$1.ZodString;
3799
+ }, z$1.core.$strip>;
3800
+ suppress: z$1.ZodOptional<z$1.ZodBoolean>;
3801
+ tint: z$1.ZodOptional<z$1.ZodObject<{
3802
+ dark: z$1.ZodString;
3803
+ light: z$1.ZodString;
3804
+ }, z$1.core.$strip>>;
3805
+ title: z$1.ZodOptional<z$1.ZodString>;
3806
+ }, z$1.core.$strip>>;
3742
3807
  title: z$1.ZodString;
3743
3808
  }, z$1.core.$strip>;
3744
3809
  resolution: z$1.ZodNullable<z$1.ZodObject<{
3810
+ description: z$1.ZodOptional<z$1.ZodObject<{
3811
+ detail: z$1.ZodOptional<z$1.ZodString>;
3812
+ payload: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
3813
+ title: z$1.ZodOptional<z$1.ZodString>;
3814
+ }, z$1.core.$strip>>;
3745
3815
  kind: z$1.ZodLiteral<"plugin_submitted">;
3746
3816
  }, z$1.core.$strip>>;
3747
3817
  resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;
@@ -5828,6 +5898,7 @@ declare const hostDaemonCommandRegistry: {
5828
5898
  chromium: "chromium";
5829
5899
  edge: "edge";
5830
5900
  firefox: "firefox";
5901
+ helium: "helium";
5831
5902
  opera: "opera";
5832
5903
  safari: "safari";
5833
5904
  vivaldi: "vivaldi";
@@ -5864,6 +5935,7 @@ declare const hostDaemonCommandRegistry: {
5864
5935
  chromium: "chromium";
5865
5936
  edge: "edge";
5866
5937
  firefox: "firefox";
5938
+ helium: "helium";
5867
5939
  opera: "opera";
5868
5940
  safari: "safari";
5869
5941
  vivaldi: "vivaldi";
@@ -7076,6 +7148,11 @@ declare const hostDaemonCommandRegistry: {
7076
7148
  }, z$1.core.$strip>>;
7077
7149
  kind: z$1.ZodLiteral<"user_answer">;
7078
7150
  }, z$1.core.$strip>, z$1.ZodObject<{
7151
+ description: z$1.ZodOptional<z$1.ZodObject<{
7152
+ detail: z$1.ZodOptional<z$1.ZodString>;
7153
+ payload: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
7154
+ title: z$1.ZodOptional<z$1.ZodString>;
7155
+ }, z$1.core.$strip>>;
7079
7156
  kind: z$1.ZodLiteral<"plugin_submitted">;
7080
7157
  }, z$1.core.$strip>, z$1.ZodObject<{
7081
7158
  kind: z$1.ZodLiteral<"request_answer">;
@@ -8706,6 +8783,7 @@ declare const desktopBrowserCommandSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObj
8706
8783
  chromium: "chromium";
8707
8784
  edge: "edge";
8708
8785
  firefox: "firefox";
8786
+ helium: "helium";
8709
8787
  opera: "opera";
8710
8788
  safari: "safari";
8711
8789
  vivaldi: "vivaldi";
@@ -8803,6 +8881,7 @@ declare const desktopBrowserResultSchemas: {
8803
8881
  chromium: "chromium";
8804
8882
  edge: "edge";
8805
8883
  firefox: "firefox";
8884
+ helium: "helium";
8806
8885
  opera: "opera";
8807
8886
  safari: "safari";
8808
8887
  vivaldi: "vivaldi";
@@ -10438,7 +10517,23 @@ declare const terminalOutputResponseSchema: z$1.ZodObject<{
10438
10517
  dataBase64: z$1.ZodString;
10439
10518
  seq: z$1.ZodNumber;
10440
10519
  }, z$1.core.$strict>>;
10520
+ closeReason: z$1.ZodNullable<z$1.ZodEnum<{
10521
+ "daemon-disconnect": "daemon-disconnect";
10522
+ "environment-destroyed": "environment-destroyed";
10523
+ "open-timeout": "open-timeout";
10524
+ "process-exit": "process-exit";
10525
+ "thread-archived": "thread-archived";
10526
+ "thread-deleted": "thread-deleted";
10527
+ user: "user";
10528
+ }>>;
10529
+ exitCode: z$1.ZodNullable<z$1.ZodNumber>;
10441
10530
  nextSeq: z$1.ZodNumber;
10531
+ status: z$1.ZodEnum<{
10532
+ disconnected: "disconnected";
10533
+ exited: "exited";
10534
+ running: "running";
10535
+ starting: "starting";
10536
+ }>;
10442
10537
  truncated: z$1.ZodBoolean;
10443
10538
  }, z$1.core.$strict>;
10444
10539
  type TerminalOutputResponse = z$1.infer<typeof terminalOutputResponseSchema>;
@@ -10544,6 +10639,7 @@ declare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodO
10544
10639
  "child-outcome-batch": "child-outcome-batch";
10545
10640
  "ownership-assigned": "ownership-assigned";
10546
10641
  "ownership-removed": "ownership-removed";
10642
+ "tool-result-delivered": "tool-result-delivered";
10547
10643
  unlabeled: "unlabeled";
10548
10644
  }>;
10549
10645
  systemMessageSubject: z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
@@ -10553,6 +10649,10 @@ declare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodO
10553
10649
  }, z$1.core.$strip>, z$1.ZodObject<{
10554
10650
  count: z$1.ZodNumber;
10555
10651
  kind: z$1.ZodLiteral<"thread-batch">;
10652
+ }, z$1.core.$strip>, z$1.ZodObject<{
10653
+ kind: z$1.ZodLiteral<"tool-call">;
10654
+ suppress: z$1.ZodBoolean;
10655
+ toolName: z$1.ZodString;
10556
10656
  }, z$1.core.$strip>], "kind">>;
10557
10657
  text: z$1.ZodString;
10558
10658
  threadId: z$1.ZodString;
@@ -11335,6 +11435,60 @@ declare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodO
11335
11435
  workKind: z$1.ZodLiteral<"approval">;
11336
11436
  }, z$1.core.$strip>], "approvalKind">;
11337
11437
  type TimelineApprovalWorkRow = z$1.infer<typeof timelineApprovalWorkRowSchema>;
11438
+ declare const timelineFormWorkRowSchema: z$1.ZodObject<{
11439
+ createdAt: z$1.ZodNumber;
11440
+ id: z$1.ZodString;
11441
+ interactionId: z$1.ZodString;
11442
+ kind: z$1.ZodLiteral<"work">;
11443
+ lifecycle: z$1.ZodEnum<{
11444
+ cancelled: "cancelled";
11445
+ pending: "pending";
11446
+ submitted: "submitted";
11447
+ }>;
11448
+ payload: z$1.ZodNullable<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
11449
+ pluginId: z$1.ZodString;
11450
+ presentation: z$1.ZodObject<{
11451
+ badge: z$1.ZodOptional<z$1.ZodObject<{
11452
+ glyph: z$1.ZodString;
11453
+ hint: z$1.ZodString;
11454
+ label: z$1.ZodString;
11455
+ tone: z$1.ZodEnum<{
11456
+ destructive: "destructive";
11457
+ neutral: "neutral";
11458
+ }>;
11459
+ }, z$1.core.$strip>>;
11460
+ detail: z$1.ZodOptional<z$1.ZodString>;
11461
+ icon: z$1.ZodObject<{
11462
+ glyph: z$1.ZodString;
11463
+ }, z$1.core.$strip>;
11464
+ label: z$1.ZodObject<{
11465
+ completed: z$1.ZodString;
11466
+ pending: z$1.ZodString;
11467
+ }, z$1.core.$strip>;
11468
+ suppress: z$1.ZodOptional<z$1.ZodBoolean>;
11469
+ tint: z$1.ZodOptional<z$1.ZodObject<{
11470
+ dark: z$1.ZodString;
11471
+ light: z$1.ZodString;
11472
+ }, z$1.core.$strip>>;
11473
+ title: z$1.ZodOptional<z$1.ZodString>;
11474
+ }, z$1.core.$strip>;
11475
+ rendererId: z$1.ZodString;
11476
+ sourceSeqEnd: z$1.ZodNumber;
11477
+ sourceSeqStart: z$1.ZodNumber;
11478
+ startedAt: z$1.ZodNumber;
11479
+ status: z$1.ZodEnum<{
11480
+ completed: "completed";
11481
+ error: "error";
11482
+ interrupted: "interrupted";
11483
+ pending: "pending";
11484
+ }>;
11485
+ statusReason: z$1.ZodNullable<z$1.ZodString>;
11486
+ threadId: z$1.ZodString;
11487
+ title: z$1.ZodString;
11488
+ turnId: z$1.ZodNullable<z$1.ZodString>;
11489
+ workKind: z$1.ZodLiteral<"form">;
11490
+ }, z$1.core.$strip>;
11491
+ type TimelineFormWorkRow = z$1.infer<typeof timelineFormWorkRowSchema>;
11338
11492
  declare const timelineQuestionWorkRowSchema: z$1.ZodObject<{
11339
11493
  answers: z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
11340
11494
  freeText: z$1.ZodOptional<z$1.ZodString>;
@@ -11491,7 +11645,7 @@ declare const timelineWorkflowWorkRowSchema: z$1.ZodObject<{
11491
11645
  workflowName: z$1.ZodNullable<z$1.ZodString>;
11492
11646
  }, z$1.core.$strip>;
11493
11647
  type TimelineWorkflowWorkRow = z$1.infer<typeof timelineWorkflowWorkRowSchema>;
11494
- type TimelineWorkRow = TimelineCommandWorkRow | TimelineToolWorkRow | TimelineFileChangeWorkRow | TimelineWebSearchWorkRow | TimelineWebFetchWorkRow | TimelineImageGenerationWorkRow | TimelineImageViewWorkRow | TimelineFileReadWorkRow | TimelineSearchWorkRow | TimelinePlanStepsWorkRow | TimelineExtensionWorkRow | TimelineApprovalWorkRow | TimelineQuestionWorkRow | TimelineDelegationWorkRow | TimelineWorkflowWorkRow;
11648
+ type TimelineWorkRow = TimelineCommandWorkRow | TimelineToolWorkRow | TimelineFileChangeWorkRow | TimelineWebSearchWorkRow | TimelineWebFetchWorkRow | TimelineImageGenerationWorkRow | TimelineImageViewWorkRow | TimelineFileReadWorkRow | TimelineSearchWorkRow | TimelinePlanStepsWorkRow | TimelineExtensionWorkRow | TimelineApprovalWorkRow | TimelineQuestionWorkRow | TimelineFormWorkRow | TimelineDelegationWorkRow | TimelineWorkflowWorkRow;
11495
11649
  interface TimelineTurnRow extends TimelineRowBase {
11496
11650
  kind: "turn";
11497
11651
  turnId: string;
@@ -13556,9 +13710,39 @@ declare const threadPendingInteractionsResponseSchema: z$1.ZodArray<z$1.ZodUnion
13556
13710
  payload: z$1.ZodObject<{
13557
13711
  data: z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;
13558
13712
  kind: z$1.ZodLiteral<"plugin">;
13713
+ presentation: z$1.ZodOptional<z$1.ZodObject<{
13714
+ badge: z$1.ZodOptional<z$1.ZodObject<{
13715
+ glyph: z$1.ZodString;
13716
+ hint: z$1.ZodString;
13717
+ label: z$1.ZodString;
13718
+ tone: z$1.ZodEnum<{
13719
+ destructive: "destructive";
13720
+ neutral: "neutral";
13721
+ }>;
13722
+ }, z$1.core.$strip>>;
13723
+ detail: z$1.ZodOptional<z$1.ZodString>;
13724
+ icon: z$1.ZodObject<{
13725
+ glyph: z$1.ZodString;
13726
+ }, z$1.core.$strip>;
13727
+ label: z$1.ZodObject<{
13728
+ completed: z$1.ZodString;
13729
+ pending: z$1.ZodString;
13730
+ }, z$1.core.$strip>;
13731
+ suppress: z$1.ZodOptional<z$1.ZodBoolean>;
13732
+ tint: z$1.ZodOptional<z$1.ZodObject<{
13733
+ dark: z$1.ZodString;
13734
+ light: z$1.ZodString;
13735
+ }, z$1.core.$strip>>;
13736
+ title: z$1.ZodOptional<z$1.ZodString>;
13737
+ }, z$1.core.$strip>>;
13559
13738
  title: z$1.ZodString;
13560
13739
  }, z$1.core.$strip>;
13561
13740
  resolution: z$1.ZodNullable<z$1.ZodObject<{
13741
+ description: z$1.ZodOptional<z$1.ZodObject<{
13742
+ detail: z$1.ZodOptional<z$1.ZodString>;
13743
+ payload: z$1.ZodOptional<z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
13744
+ title: z$1.ZodOptional<z$1.ZodString>;
13745
+ }, z$1.core.$strip>>;
13562
13746
  kind: z$1.ZodLiteral<"plugin_submitted">;
13563
13747
  }, z$1.core.$strip>>;
13564
13748
  resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;
@@ -14336,6 +14520,7 @@ declare const desktopBrowserImportCookiesRequestSchema: z$1.ZodObject<{
14336
14520
  chromium: "chromium";
14337
14521
  edge: "edge";
14338
14522
  firefox: "firefox";
14523
+ helium: "helium";
14339
14524
  opera: "opera";
14340
14525
  safari: "safari";
14341
14526
  vivaldi: "vivaldi";
@@ -16191,10 +16376,6 @@ interface PluginCommandRegistration {
16191
16376
  */
16192
16377
  run(context: PluginCommandContext): void | Promise<void>;
16193
16378
  }
16194
- /** @deprecated Use PluginCommandContext. */
16195
- type PluginCommandPaletteActionContext = PluginCommandContext;
16196
- /** @deprecated Use PluginCommandRegistration. */
16197
- type PluginCommandPaletteActionRegistration = PluginCommandRegistration;
16198
16379
  /** Registers commands for bb's command palette. */
16199
16380
  interface PluginAppCommands {
16200
16381
  /** Register a command. IDs are unique within this plugin, including legacy slot registrations. */
@@ -16832,6 +17013,82 @@ interface PluginComposerApi {
16832
17013
  * Experimental: see docs/api_to_audit.md.
16833
17014
  */
16834
17015
  experimental_submit(options: ExperimentalComposerSubmitOptions): Promise<void>;
17016
+ /**
17017
+ * Set this composer's pickers as if each value had been picked by hand.
17018
+ *
17019
+ * Every field is optional. An omitted field is left alone. A field this
17020
+ * composer has no picker for is ignored rather than rejected: a thread
17021
+ * composer has no project or environment; a provider without service tiers
17022
+ * has no tier; a fork draft locks its project, provider and environment.
17023
+ * Values travel through the same paths the pickers use, so in the
17024
+ * new-thread composer they become the remembered defaults for the next
17025
+ * thread and are reported as the user's explicit choices, and in a thread
17026
+ * composer a provider change starts the same handoff the picker starts:
17027
+ * the handoff block is prepended to the draft and the next send creates a
17028
+ * new thread. A same-provider model change in a thread does not start a
17029
+ * handoff, exactly like the picker.
17030
+ *
17031
+ * In the new-thread composer the project is switched first and awaited
17032
+ * (attachments are copied to the new project), then the environment and
17033
+ * machine are applied to the new project, then provider, model, reasoning
17034
+ * level, service tier and permission mode. A provider change reloads the
17035
+ * model catalog before the model and reasoning level are applied to it.
17036
+ * Because the project switch remounts plugin surfaces, the returned
17037
+ * promise is owned by the composer and still resolves after the calling
17038
+ * component has unmounted.
17039
+ *
17040
+ * Resolves with the composer's own selection once it has settled: the
17041
+ * applied values have committed and the model catalog for the selected
17042
+ * provider and machine has finished loading, so model, reasoning level and
17043
+ * permission mode have reconciled against it. The catalog wait is bounded;
17044
+ * if it has not finished after 15 seconds the promise resolves with the
17045
+ * selection as it stands. The result carries only the fields this composer
17046
+ * has, so a missing key means "no such picker here" and a value that
17047
+ * differs from the one passed was reconciled (a reasoning level the model
17048
+ * does not support, a permission mode above the machine's ceiling, a model
17049
+ * the provider does not list). A provider the composer does not list is
17050
+ * ignored together with the model and reasoning level meant for it, so the
17051
+ * stored provider preference never names something the picker could not
17052
+ * have chosen. `environment` is absent while the composer
17053
+ * has no submittable environment; `providerId` and `model` are absent
17054
+ * while nothing is selected; `serviceTier` is present only when the
17055
+ * selected provider has tiers and one is chosen.
17056
+ *
17057
+ * Rejects, with a message safe to show to the user, in a composer with no
17058
+ * pickers at all (a queued-message editor, a side chat, a plugin surface
17059
+ * mounted outside any composer), when the calling surface is no longer
17060
+ * active, and when a value is not a known reasoning level, service tier or
17061
+ * permission mode.
17062
+ *
17063
+ * Experimental: see docs/api_to_audit.md.
17064
+ */
17065
+ experimental_setSelection(selection: ExperimentalComposerSelection): Promise<ExperimentalComposerSelection>;
17066
+ }
17067
+ /**
17068
+ * Picker values for `experimental_setSelection`, and the shape it resolves
17069
+ * with. Field names match `NewThreadRequest` and the `default*` props of
17070
+ * `experimental_NewThreadComposer`, so one routed decision can feed the
17071
+ * composer, the embedded composer and `bb.sdk.threads.spawn` alike.
17072
+ */
17073
+ interface ExperimentalComposerSelection {
17074
+ /** New-thread composers only. BB's personal-project id means "Don't work in a project". */
17075
+ projectId?: string;
17076
+ /**
17077
+ * New-thread composers only. `{ type: "project-default" }` and a `host`
17078
+ * environment without a `hostId` seed nothing and are ignored. Provider
17079
+ * `inputs` are not applied; the provider's own inputs control keeps its
17080
+ * value, and the result reports what the composer would submit.
17081
+ */
17082
+ environment?: CreateThreadEnvironmentArgs;
17083
+ /** A provider the composer does not list is ignored, and `model` and `reasoningLevel` with it. */
17084
+ providerId?: string;
17085
+ /** Applied only when the composer ends up on the requested provider (or none was requested). */
17086
+ model?: string;
17087
+ /** Applied only when the composer ends up on the requested provider (or none was requested). */
17088
+ reasoningLevel?: ReasoningLevel;
17089
+ /** Ignored by a provider with no service tiers. */
17090
+ serviceTier?: ServiceTier;
17091
+ permissionMode?: PermissionMode;
16835
17092
  }
16836
17093
  /**
16837
17094
  * What `experimental_submit` does differently from pressing Enter.
@@ -16958,9 +17215,8 @@ interface ExperimentalProviderModelPickerProps {
16958
17215
  /**
16959
17216
  * Props of the host-owned `experimental_BranchPicker` component — bb's branch
16960
17217
  * picker bundled with its branch-options loading for the given host and
16961
- * project, the control bb's own New Thread composer renders as "Branch from".
16962
- * The host owns fetching, searching, and refreshing the branch list; the
16963
- * caller owns only the selection.
17218
+ * project. The host owns fetching, searching, and refreshing the branch list;
17219
+ * the caller owns the selection and its meaning.
16964
17220
  */
16965
17221
  interface BranchPickerProps {
16966
17222
  /**
@@ -16971,21 +17227,21 @@ interface BranchPickerProps {
16971
17227
  /** The project whose source on `hostId` is listed; null disables loading. */
16972
17228
  projectId: string | null;
16973
17229
  /**
16974
- * The selected branch name, or null when no branch is chosen (the host
16975
- * shows its placeholder and the consumer falls back to its own default).
17230
+ * The selected branch name, or null when no branch is chosen. A null value
17231
+ * shows the placeholder without selecting or implying a default branch.
16976
17232
  */
16977
17233
  value: string | null;
16978
17234
  /** Called with the picked branch name, or null when the pick is cleared. */
16979
17235
  onChange(next: string | null): void;
16980
17236
  /**
16981
- * Text placed before the branch on the trigger, e.g. "Base:". Omitted, the
16982
- * trigger is the branch alone.
17237
+ * Text placed before the branch on the trigger and used as the menu heading,
17238
+ * e.g. "Compare with:". Omitted, the trigger is the branch alone and the menu
17239
+ * uses the neutral "Branches" heading.
16983
17240
  */
16984
17241
  label?: string;
16985
17242
  /**
16986
- * The trigger while nothing is picked. Omitted, the host shows the resolved
16987
- * default worktree base branch muted, or a neutral `default` placeholder
16988
- * when the base cannot be resolved.
17243
+ * The complete trigger text while nothing is picked, without the label
17244
+ * prefix. Defaults to "Select branch".
16989
17245
  */
16990
17246
  placeholder?: string;
16991
17247
  /** Render the current selection without allowing changes. */
@@ -17660,6 +17916,8 @@ interface PluginEnvironmentProviderDefinition<R extends PluginEnvironmentProvide
17660
17916
  /** Experimental per-machine availability, probed in the background for pickers and again at thread creation: see docs/api_to_audit.md. */
17661
17917
  availability?(context: PluginEnvironmentProviderAvailabilityContext): PluginEnvironmentProviderAvailability | Promise<PluginEnvironmentProviderAvailability>;
17662
17918
  validate?(context: PluginEnvironmentProviderValidateContext<R, S>): PluginEnvironmentValidateDecision$1 | Promise<PluginEnvironmentValidateDecision$1>;
17919
+ /** Pure path selection from parsed inputs. Core reuses a recorded environment on the selected host before calling create; null requests normal creation. */
17920
+ experimental_existingPath?(inputs: InputsValue<S>): string | null;
17663
17921
  create(context: PluginEnvironmentProviderCreateContext<R, S>): Promise<PluginEnvironmentProviderCreateResult>;
17664
17922
  remove(context: PluginEnvironmentProviderRemoveContext): Promise<PluginEnvironmentProviderRemoveResult>;
17665
17923
  }
@@ -20046,6 +20304,23 @@ type PluginInteractionResult = {
20046
20304
  outcome: "cancelled";
20047
20305
  reason: PluginInteractionCancelReason;
20048
20306
  };
20307
+ /**
20308
+ * What a submitted form leaves in the thread timeline, chosen by the plugin.
20309
+ * bb never stores the form's payload or the submitted value; it stores only
20310
+ * this description, so a plugin decides what the transcript keeps.
20311
+ */
20312
+ interface PluginInteractionDescription {
20313
+ /** Row title once submitted; defaults to the presentation's completed label. */
20314
+ title?: string;
20315
+ /** Short Markdown for the expanded row. */
20316
+ detail?: string;
20317
+ /**
20318
+ * Persisted with the row and handed to this plugin's
20319
+ * `experimental_timelineRenderer` registered for `"<pluginId>/<rendererId>"`.
20320
+ * Omit anything the transcript must not keep.
20321
+ */
20322
+ payload?: JsonValue;
20323
+ }
20049
20324
  interface PluginInteractionRequest {
20050
20325
  threadId: string;
20051
20326
  rendererId: string;
@@ -20053,6 +20328,19 @@ interface PluginInteractionRequest {
20053
20328
  payload: JsonValue;
20054
20329
  /** Defaults to ten minutes; capped at one hour. */
20055
20330
  timeoutMs?: number;
20331
+ /**
20332
+ * How the form reads as a timeline row while it waits and once it settles,
20333
+ * in the same shape as a native tool's presentation. bb fills what is left
20334
+ * out: "Waiting for <title>" / "Submitted <title>" and the plugin's glyph.
20335
+ */
20336
+ presentation?: PluginRowPresentation;
20337
+ /**
20338
+ * Called once with the submitted value, before the waiting `requestInput`
20339
+ * promise resolves; never for a cancellation, which bb titles itself. Its
20340
+ * return is persisted on the row. A throw or a slow return leaves the row
20341
+ * with its completed label and nothing more.
20342
+ */
20343
+ describeSubmission?(value: JsonValue): PluginInteractionDescription | Promise<PluginInteractionDescription>;
20056
20344
  }
20057
20345
  interface PluginCliResult {
20058
20346
  exitCode: number;
@@ -20088,6 +20376,15 @@ interface PluginCliRegistration {
20088
20376
  /** Subcommand metadata rendered in help and the plugin-commands skill
20089
20377
  * without executing plugin code. Parsing argv is plugin-owned. */
20090
20378
  commands?: PluginCliCommandInfo[];
20379
+ /**
20380
+ * Set when `run` answers `--help` / `-h` itself, at every level, without
20381
+ * executing a command. The `bb` CLI then forwards help requests to the
20382
+ * plugin instead of printing the one-line `usage` from `commands`.
20383
+ * `defineCli` sets it. Leave it unset for a hand-written `run`:
20384
+ * the host cannot know that such a parser will not act on the other
20385
+ * arguments.
20386
+ */
20387
+ rendersHelp?: boolean;
20091
20388
  run(argv: string[], ctx: PluginCliContext): PluginCliResult | Promise<PluginCliResult>;
20092
20389
  }
20093
20390
  interface PluginCli {
@@ -20116,30 +20413,37 @@ type PluginAgentToolResult = string | {
20116
20413
  interface PluginAgentToolContext {
20117
20414
  threadId: string;
20118
20415
  projectId: string;
20119
- /** The tool-call request's abort signal (aborts if the daemon round-trip
20120
- * is torn down mid-call). */
20416
+ /**
20417
+ * Aborts when the tool-call request is cancelled, the thread is stopped or
20418
+ * deleted, or this plugin is disposed. Opening a form with `bb.ui.requestInput`
20419
+ * detaches the call from its request: the agent receives a waiting notice,
20420
+ * and request cancellation no longer aborts this signal. The tool's eventual
20421
+ * result is delivered as a system message (success steers a running turn or
20422
+ * starts a new one; an `isError` result only steers). Thread stop/delete and
20423
+ * plugin disposal still abort the signal after detachment.
20424
+ */
20121
20425
  signal: AbortSignal;
20122
20426
  }
20123
20427
  /**
20124
- * The row title of a plugin tool call while it is pending and once it
20428
+ * The title of a plugin-owned timeline row while it is pending and once it
20125
20429
  * settled. Each label is capped at 80 characters and rendered as plain text.
20126
20430
  */
20127
- interface PluginAgentToolLabels {
20128
- /** Label shown while the tool call is pending. */
20431
+ interface PluginRowLabels {
20432
+ /** Label shown while the row is pending. */
20129
20433
  pending: string;
20130
- /** Label shown after the tool call completes successfully. */
20434
+ /** Label shown after the row completes successfully. */
20131
20435
  completed: string;
20132
20436
  }
20133
20437
  /**
20134
- * How calls to a native plugin tool read as a timeline row (grammar v3). Every
20135
- * field is optional at registration: the server fills what the plugin leaves
20136
- * out (a generic `Running <name>` / `Ran <name>` label; the plugin's branding
20137
- * glyph, then `Toolbox`) and hands one complete presentation to the provider
20138
- * bridge with the tool definition.
20438
+ * How something a plugin owns reads as a timeline row (grammar v3): a native
20439
+ * tool's calls, or the row a `bb.ui.requestInput` form leaves behind. Every
20440
+ * field is optional: the server fills what the plugin leaves out (a generic
20441
+ * label; the plugin's branding glyph, then `Toolbox`) and hands one complete
20442
+ * presentation to whatever renders the row.
20139
20443
  */
20140
- interface PluginAgentToolPresentation {
20141
- /** Row title while the call is pending and once it settled. */
20142
- label?: PluginAgentToolLabels;
20444
+ interface PluginRowPresentation {
20445
+ /** Row title while the row is pending and once it settled. */
20446
+ label?: PluginRowLabels;
20143
20447
  /**
20144
20448
  * A named host glyph (`{ glyph: "Workflow" }`), or one of this plugin's
20145
20449
  * own declared icons by its namespaced glyph (`{ glyph: "<pluginId>/<name>" }`,
@@ -20177,7 +20481,7 @@ interface PluginAgentToolRegistrationBase {
20177
20481
  * plugin's branding glyph. Approval, error, and interruption states keep
20178
20482
  * BB's standard rendering. See docs/api_to_audit.md.
20179
20483
  */
20180
- presentation?: PluginAgentToolPresentation;
20484
+ presentation?: PluginRowPresentation;
20181
20485
  }
20182
20486
  /** Stable, plain-data context resolved by the server for one agent session. */
20183
20487
  interface PluginAgentConfigurationContext {
@@ -20785,7 +21089,14 @@ interface PluginMentionProviderRegistration {
20785
21089
  }>;
20786
21090
  }
20787
21091
  interface PluginUi {
20788
- /** Block until the app submits or cancels a plugin-owned composer form. */
21092
+ /**
21093
+ * Block until the user submits or cancels this plugin's form in the
21094
+ * thread composer. Inside a native tool's `execute`, calling this answers
21095
+ * the tool call at once with a waiting notice and the eventual return value
21096
+ * reaches the agent as a message; see {@link PluginAgentToolContext.signal}.
21097
+ * The form leaves a timeline row described by `presentation` and
21098
+ * `describeSubmission`.
21099
+ */
20789
21100
  requestInput(request: PluginInteractionRequest, options?: {
20790
21101
  signal?: AbortSignal;
20791
21102
  }): Promise<PluginInteractionResult>;
@@ -21005,5 +21316,237 @@ interface BbPluginApi {
21005
21316
  onDispose(hook: () => void | Promise<void>): void;
21006
21317
  }
21007
21318
 
21008
- export { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract, experimental_defineHostEntry };
21009
- export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalPluginMentionImage, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolLabels, PluginAgentToolPresentation, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiServiceDeclaration, PluginAiServiceKind, PluginAiServices, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandPaletteActionContext, PluginCommandPaletteActionRegistration, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, 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, 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, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
21319
+ /** Duration suffixes, shared with the core `bb` CLI grammar. */
21320
+ type PluginCliDurationUnit = "d" | "h" | "m" | "ms" | "s";
21321
+ /**
21322
+ * Failure codes the parser itself emits in the `--json` error envelope.
21323
+ * A command raising `PluginCliError` may use any snake_case code.
21324
+ */
21325
+ type PluginCliErrorCode = "invalid_value" | "missing_command" | "missing_required" | "unexpected_argument" | "unknown_command" | "unknown_option";
21326
+ interface PluginCliOptionBase {
21327
+ /** One line shown in `--help`; state the limits agents keep hitting. */
21328
+ description: string;
21329
+ /** Extra spellings accepted silently and mapped onto this option. */
21330
+ aliases?: readonly string[];
21331
+ /** Single-character form: `"f"` (or `"-f"`) accepts `-f`. */
21332
+ short?: string;
21333
+ /** Kept out of `--help` and the generated usage line. */
21334
+ hidden?: boolean;
21335
+ /** Value placeholder in help and usage; defaults to the value type. */
21336
+ placeholder?: string;
21337
+ /**
21338
+ * Recognize `--<name>-stdin`. The `bb` CLI reads that value from stdin and
21339
+ * rewrites it to `--<name> <value>` before the plugin runs, so a command
21340
+ * that still sees it reports that instead of "unknown option".
21341
+ */
21342
+ stdin?: boolean;
21343
+ }
21344
+ /** A valueless flag; absent means `false`. */
21345
+ interface PluginCliBooleanOption extends PluginCliOptionBase {
21346
+ type: "boolean";
21347
+ }
21348
+ interface PluginCliStringOption extends PluginCliOptionBase {
21349
+ type: "string";
21350
+ required?: boolean;
21351
+ repeatable?: boolean;
21352
+ /**
21353
+ * Split each value on this separator, so `--tag a,b` is two tags. Only valid
21354
+ * with `repeatable: true`; `defineCli` rejects it otherwise, because a
21355
+ * single-valued option would silently drop every value after the first.
21356
+ */
21357
+ split?: string;
21358
+ default?: string;
21359
+ }
21360
+ interface PluginCliIntegerOption extends PluginCliOptionBase {
21361
+ type: "integer";
21362
+ min: number;
21363
+ max: number;
21364
+ required?: boolean;
21365
+ default?: number;
21366
+ }
21367
+ interface PluginCliEnumOption extends PluginCliOptionBase {
21368
+ type: "enum";
21369
+ values: readonly string[];
21370
+ required?: boolean;
21371
+ repeatable?: boolean;
21372
+ /** Split each value on this separator, so `--kind a,b` is two values. */
21373
+ split?: string;
21374
+ default?: string;
21375
+ }
21376
+ /** A duration parsed to milliseconds with the core CLI's grammar. */
21377
+ interface PluginCliDurationOption extends PluginCliOptionBase {
21378
+ type: "duration";
21379
+ /** Unit assumed for a bare number when `bareUnits` is absent. */
21380
+ defaultUnit: PluginCliDurationUnit;
21381
+ /**
21382
+ * Units tried in order for a bare number, taking the first whose
21383
+ * milliseconds fall inside `min`/`max`. Declare it when two units are
21384
+ * plausible and their valid ranges do not overlap (`90` seconds versus
21385
+ * `1500` milliseconds); a number matching neither is rejected with both
21386
+ * forms named.
21387
+ */
21388
+ bareUnits?: readonly PluginCliDurationUnit[];
21389
+ /** Inclusive bounds in milliseconds. */
21390
+ min?: number;
21391
+ max?: number;
21392
+ required?: boolean;
21393
+ /** Default in milliseconds. */
21394
+ default?: number;
21395
+ }
21396
+ type PluginCliOption = PluginCliBooleanOption | PluginCliStringOption | PluginCliIntegerOption | PluginCliEnumOption | PluginCliDurationOption;
21397
+ interface PluginCliPositional {
21398
+ name: string;
21399
+ description: string;
21400
+ required?: boolean;
21401
+ /** Collects every remaining bare token into a string array. */
21402
+ variadic?: boolean;
21403
+ }
21404
+ /**
21405
+ * Relationships between options that the parser enforces before `run`.
21406
+ * Rules that depend on a value (which options a `--backend` choice allows)
21407
+ * belong in `run`, raised as `PluginCliError`.
21408
+ */
21409
+ type PluginCliConstraint = {
21410
+ kind: "exactly-one";
21411
+ options: readonly string[];
21412
+ } | {
21413
+ kind: "at-most-one";
21414
+ options: readonly string[];
21415
+ } | {
21416
+ kind: "at-least-one";
21417
+ options: readonly string[];
21418
+ } | {
21419
+ kind: "requires";
21420
+ option: string;
21421
+ needs: readonly string[];
21422
+ };
21423
+ type CliOptions = Record<string, PluginCliOption>;
21424
+ type CliPositionals = readonly PluginCliPositional[];
21425
+ type OptionValue<TOption> = TOption extends {
21426
+ type: "boolean";
21427
+ } ? boolean : TOption extends {
21428
+ type: "enum";
21429
+ values: readonly (infer TValue)[];
21430
+ } ? TValue : TOption extends {
21431
+ type: "string";
21432
+ } ? string : number;
21433
+ type OptionResolved<TOption> = TOption extends {
21434
+ type: "boolean";
21435
+ } ? boolean : TOption extends {
21436
+ repeatable: true;
21437
+ } ? OptionValue<TOption>[] : TOption extends {
21438
+ required: true;
21439
+ } ? OptionValue<TOption> : TOption extends {
21440
+ default: unknown;
21441
+ } ? OptionValue<TOption> : OptionValue<TOption> | undefined;
21442
+ /** Validated option values, keyed by the spec's option names. */
21443
+ type PluginCliOptionValues<TOptions extends CliOptions> = {
21444
+ [TName in keyof TOptions]: OptionResolved<TOptions[TName]>;
21445
+ };
21446
+ /** Validated positional values, keyed by the spec's positional names. */
21447
+ type PluginCliPositionalValues<TPositionals extends CliPositionals> = {
21448
+ [TEntry in TPositionals[number] as TEntry["name"]]: TEntry extends {
21449
+ variadic: true;
21450
+ } ? string[] : TEntry extends {
21451
+ required: true;
21452
+ } ? string : string | undefined;
21453
+ };
21454
+ /** What a command's `run` receives once every value has been validated. */
21455
+ interface PluginCliRunInput<TOptions extends CliOptions = CliOptions, TPositionals extends CliPositionals = CliPositionals> {
21456
+ options: PluginCliOptionValues<TOptions>;
21457
+ positionals: PluginCliPositionalValues<TPositionals>;
21458
+ /** Tokens after `--` when the command declares `passthrough`. */
21459
+ passthrough: string[];
21460
+ /** This command's rendered `--help` text. */
21461
+ help: string;
21462
+ }
21463
+ type ErasedOptionValue = string | number | boolean | string[] | undefined;
21464
+ interface ErasedRunInput {
21465
+ options: Record<string, ErasedOptionValue>;
21466
+ positionals: Record<string, string | string[] | undefined>;
21467
+ passthrough: string[];
21468
+ help: string;
21469
+ }
21470
+ /**
21471
+ * One command as `defineCli` consumes it. Build it with
21472
+ * `cliCommand` so `run` receives typed values. The declaration
21473
+ * is inert data: help and usage render from it without running the command.
21474
+ */
21475
+ interface PluginCliCommand {
21476
+ summary: string;
21477
+ description?: string;
21478
+ /** Extra invocation paths that run this command, hidden from help. */
21479
+ aliases?: readonly string[];
21480
+ /** Mistyped command names that should suggest this command. */
21481
+ suggestFor?: readonly string[];
21482
+ hidden?: boolean;
21483
+ options?: CliOptions;
21484
+ positionals?: CliPositionals;
21485
+ constraints?: readonly PluginCliConstraint[];
21486
+ /** Put tokens after `--` in `input.passthrough` instead of positionals. */
21487
+ passthrough?: boolean;
21488
+ /** Hint added when an unexpected bare token is passed. */
21489
+ unexpectedPositionalHint?: string;
21490
+ run(input: ErasedRunInput, ctx: PluginCliContext): PluginCliResult | Promise<PluginCliResult>;
21491
+ }
21492
+ /** The declarative CLI a plugin hands to `bb.cli.register`. */
21493
+ interface PluginCliSpec {
21494
+ /** Top-level command name (`bb <name> …`): lowercase `[a-z0-9-]+`. */
21495
+ name: string;
21496
+ summary: string;
21497
+ /** Prose printed under the summary in top-level help. */
21498
+ description?: string;
21499
+ /** Runs when the invocation names no command (`bb connect --code …`). */
21500
+ root?: PluginCliCommand;
21501
+ /** Commands keyed by invocation path (`"add"`, `"account add"`). */
21502
+ commands: Record<string, PluginCliCommand>;
21503
+ /** Exit code for usage errors; defaults to 1. */
21504
+ usageErrorExitCode?: number;
21505
+ }
21506
+ /**
21507
+ * A failure a command raises itself, reported exactly like a parse error:
21508
+ * human text on stderr, plus the `{ ok: false, error }` envelope on stdout
21509
+ * when the invocation carries `--json`.
21510
+ */
21511
+ declare class PluginCliError extends Error {
21512
+ readonly code: string;
21513
+ readonly hint: string | undefined;
21514
+ readonly exitCode: number;
21515
+ constructor(message: string, options?: {
21516
+ code?: string;
21517
+ hint?: string;
21518
+ exitCode?: number;
21519
+ });
21520
+ }
21521
+ /**
21522
+ * Declares one command. Inference flows from `options` and `positionals`
21523
+ * into `run`, so `input.options.scope` is the declared enum union and a
21524
+ * required option is never `undefined`.
21525
+ */
21526
+ declare function cliCommand<const TOptions extends CliOptions = Record<string, never>, const TPositionals extends CliPositionals = readonly []>(command: {
21527
+ summary: string;
21528
+ description?: string;
21529
+ aliases?: readonly string[];
21530
+ suggestFor?: readonly string[];
21531
+ hidden?: boolean;
21532
+ options?: TOptions;
21533
+ positionals?: TPositionals;
21534
+ constraints?: readonly PluginCliConstraint[];
21535
+ passthrough?: boolean;
21536
+ unexpectedPositionalHint?: string;
21537
+ run(input: PluginCliRunInput<TOptions, TPositionals>, ctx: PluginCliContext): PluginCliResult | Promise<PluginCliResult>;
21538
+ }): PluginCliCommand;
21539
+ /**
21540
+ * Turns a declarative spec into a `PluginCliRegistration`, so every plugin
21541
+ * CLI parses argv, renders `--help`, and fails the same way.
21542
+ *
21543
+ * `--help`, `-h` and a leading `help` word exit 0 at any level and never run
21544
+ * a command. Unknown commands and options suggest the nearest declared name,
21545
+ * every missing required value is reported in one error, and an invocation
21546
+ * carrying `--json` adds the `{ ok: false, error: { code, message, hint? } }`
21547
+ * envelope on stdout while stderr keeps the human-readable text.
21548
+ */
21549
+ declare function defineCli(spec: PluginCliSpec): PluginCliRegistration;
21550
+
21551
+ export { PLUGIN_CLI_OUTPUT_MAX_BYTES, PluginCliError, cliCommand, defineCli, defineRpcContract, experimental_defineHostEntry };
21552
+ export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSelection, ExperimentalComposerSubmitOptions, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalPluginMentionImage, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiServiceDeclaration, PluginAiServiceKind, PluginAiServices, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, 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, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, 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, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };