@get-bb/plugin-sdk 0.4.99 → 0.4.104

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.
@@ -98,7 +98,7 @@ declare const appSettingsUpdateSchema: z$1.ZodUnion<readonly [z$1.ZodObject<{
98
98
  }, z$1.core.$strict>]>;
99
99
  type AppSettingsUpdate = z$1.infer<typeof appSettingsUpdateSchema>;
100
100
 
101
- declare const UI_PREFERENCE_KEYS: readonly ["sidebar.organizationMode", "sidebar.chronologicalSort", "sidebar.sortDirection", "sidebar.sectionOrder", "sidebar.manualSectionOrder", "sidebar.machineSectionOrder", "sidebar.collapsedSections", "sidebar.collapsedProjects", "sidebar.collapsedThreads", "sidebar.collapsedEnvironments", "sidebar.collapsedThreadSections", "sidebar.collapsedMachines", "sidebar.footerOrder", "sidebar.hiddenFooterItems", "sidebar.pluginPanelOrder", "sidebar.visiblePluginPanels", "sidebar.navigationProvider", "sidebar.threadListProvider"];
101
+ declare const UI_PREFERENCE_KEYS: readonly ["sidebar.organizationMode", "sidebar.threadGrouping.environment", "sidebar.chronologicalSort", "sidebar.sortDirection", "sidebar.sectionOrder", "sidebar.manualSectionOrder", "sidebar.machineSectionOrder", "sidebar.collapsedSections", "sidebar.collapsedProjects", "sidebar.collapsedThreads", "sidebar.collapsedEnvironments", "sidebar.collapsedThreadSections", "sidebar.collapsedMachines", "sidebar.footerOrder", "sidebar.hiddenFooterItems", "sidebar.pluginPanelOrder", "sidebar.visiblePluginPanels", "sidebar.navigationProvider", "sidebar.threadListProvider"];
102
102
  type UiPreferenceKey = (typeof UI_PREFERENCE_KEYS)[number];
103
103
  interface UiPreferenceDefinition<Schema extends z$1.ZodTypeAny = z$1.ZodTypeAny> {
104
104
  schema: Schema;
@@ -111,6 +111,7 @@ declare const uiPreferenceDefinitions: {
111
111
  machine: "machine";
112
112
  project: "project";
113
113
  }>>;
114
+ readonly "sidebar.threadGrouping.environment": UiPreferenceDefinition<z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>>;
114
115
  readonly "sidebar.chronologicalSort": UiPreferenceDefinition<z$1.ZodEnum<{
115
116
  alpha: "alpha";
116
117
  created: "created";
@@ -3024,6 +3025,7 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
3024
3025
  "child-outcome-batch": "child-outcome-batch";
3025
3026
  "ownership-assigned": "ownership-assigned";
3026
3027
  "ownership-removed": "ownership-removed";
3028
+ "tool-result-delivered": "tool-result-delivered";
3027
3029
  unlabeled: "unlabeled";
3028
3030
  }>>;
3029
3031
  systemMessageSubject: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
@@ -3033,6 +3035,10 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
3033
3035
  }, z$1.core.$strip>, z$1.ZodObject<{
3034
3036
  count: z$1.ZodNumber;
3035
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;
3036
3042
  }, z$1.core.$strip>], "kind">>>;
3037
3043
  target: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3038
3044
  kind: z$1.ZodLiteral<"thread-start">;
@@ -3286,9 +3292,39 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
3286
3292
  }, z$1.core.$strip>;
3287
3293
  payload: z$1.ZodObject<{
3288
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>>;
3289
3320
  title: z$1.ZodString;
3290
3321
  }, z$1.core.$strip>;
3291
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>>;
3292
3328
  kind: z$1.ZodLiteral<"plugin_submitted">;
3293
3329
  }, z$1.core.$strip>>;
3294
3330
  status: z$1.ZodEnum<{
@@ -3491,6 +3527,11 @@ declare const pendingInteractionResolutionSchema: z$1.ZodUnion<readonly [z$1.Zod
3491
3527
  }, z$1.core.$strip>>;
3492
3528
  kind: z$1.ZodLiteral<"user_answer">;
3493
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>>;
3494
3535
  kind: z$1.ZodLiteral<"plugin_submitted">;
3495
3536
  }, z$1.core.$strip>, z$1.ZodObject<{
3496
3537
  kind: z$1.ZodLiteral<"request_answer">;
@@ -3738,9 +3779,39 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{
3738
3779
  payload: z$1.ZodObject<{
3739
3780
  data: z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;
3740
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>>;
3741
3807
  title: z$1.ZodString;
3742
3808
  }, z$1.core.$strip>;
3743
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>>;
3744
3815
  kind: z$1.ZodLiteral<"plugin_submitted">;
3745
3816
  }, z$1.core.$strip>>;
3746
3817
  resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;
@@ -4084,6 +4155,21 @@ type ThreadEventRow = {
4084
4155
  [TType in ThreadEventType]: ThreadEventRowOfType<TType>;
4085
4156
  }[ThreadEventType];
4086
4157
 
4158
+ declare const threadTurnInitiatorSchema: z$1.ZodEnum<{
4159
+ agent: "agent";
4160
+ system: "system";
4161
+ user: "user";
4162
+ }>;
4163
+ type ThreadTurnInitiator = z$1.infer<typeof threadTurnInitiatorSchema>;
4164
+
4165
+ declare const threadCreateOriginSchema: z$1.ZodEnum<{
4166
+ app: "app";
4167
+ cli: "cli";
4168
+ plugin: "plugin";
4169
+ sdk: "sdk";
4170
+ }>;
4171
+ type ThreadCreateOrigin = z$1.infer<typeof threadCreateOriginSchema>;
4172
+
4087
4173
  declare const threadStatusSchema: z$1.ZodEnum<{
4088
4174
  active: "active";
4089
4175
  error: "error";
@@ -4203,6 +4289,13 @@ declare const threadQueuedMessageSchema: z$1.ZodObject<{
4203
4289
  user: "user";
4204
4290
  }>;
4205
4291
  model: z$1.ZodString;
4292
+ origin: z$1.ZodNullable<z$1.ZodEnum<{
4293
+ app: "app";
4294
+ cli: "cli";
4295
+ plugin: "plugin";
4296
+ sdk: "sdk";
4297
+ }>>;
4298
+ originPluginId: z$1.ZodNullable<z$1.ZodString>;
4206
4299
  payload: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4207
4300
  kind: z$1.ZodLiteral<"inline">;
4208
4301
  }, z$1.core.$strip>, z$1.ZodObject<{
@@ -5805,6 +5898,7 @@ declare const hostDaemonCommandRegistry: {
5805
5898
  chromium: "chromium";
5806
5899
  edge: "edge";
5807
5900
  firefox: "firefox";
5901
+ helium: "helium";
5808
5902
  opera: "opera";
5809
5903
  safari: "safari";
5810
5904
  vivaldi: "vivaldi";
@@ -5841,6 +5935,7 @@ declare const hostDaemonCommandRegistry: {
5841
5935
  chromium: "chromium";
5842
5936
  edge: "edge";
5843
5937
  firefox: "firefox";
5938
+ helium: "helium";
5844
5939
  opera: "opera";
5845
5940
  safari: "safari";
5846
5941
  vivaldi: "vivaldi";
@@ -7053,6 +7148,11 @@ declare const hostDaemonCommandRegistry: {
7053
7148
  }, z$1.core.$strip>>;
7054
7149
  kind: z$1.ZodLiteral<"user_answer">;
7055
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>>;
7056
7156
  kind: z$1.ZodLiteral<"plugin_submitted">;
7057
7157
  }, z$1.core.$strip>, z$1.ZodObject<{
7058
7158
  kind: z$1.ZodLiteral<"request_answer">;
@@ -8683,6 +8783,7 @@ declare const desktopBrowserCommandSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObj
8683
8783
  chromium: "chromium";
8684
8784
  edge: "edge";
8685
8785
  firefox: "firefox";
8786
+ helium: "helium";
8686
8787
  opera: "opera";
8687
8788
  safari: "safari";
8688
8789
  vivaldi: "vivaldi";
@@ -8780,6 +8881,7 @@ declare const desktopBrowserResultSchemas: {
8780
8881
  chromium: "chromium";
8781
8882
  edge: "edge";
8782
8883
  firefox: "firefox";
8884
+ helium: "helium";
8783
8885
  opera: "opera";
8784
8886
  safari: "safari";
8785
8887
  vivaldi: "vivaldi";
@@ -10415,7 +10517,23 @@ declare const terminalOutputResponseSchema: z$1.ZodObject<{
10415
10517
  dataBase64: z$1.ZodString;
10416
10518
  seq: z$1.ZodNumber;
10417
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>;
10418
10530
  nextSeq: z$1.ZodNumber;
10531
+ status: z$1.ZodEnum<{
10532
+ disconnected: "disconnected";
10533
+ exited: "exited";
10534
+ running: "running";
10535
+ starting: "starting";
10536
+ }>;
10419
10537
  truncated: z$1.ZodBoolean;
10420
10538
  }, z$1.core.$strict>;
10421
10539
  type TerminalOutputResponse = z$1.infer<typeof terminalOutputResponseSchema>;
@@ -10521,6 +10639,7 @@ declare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodO
10521
10639
  "child-outcome-batch": "child-outcome-batch";
10522
10640
  "ownership-assigned": "ownership-assigned";
10523
10641
  "ownership-removed": "ownership-removed";
10642
+ "tool-result-delivered": "tool-result-delivered";
10524
10643
  unlabeled: "unlabeled";
10525
10644
  }>;
10526
10645
  systemMessageSubject: z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
@@ -10530,6 +10649,10 @@ declare const timelineConversationRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodO
10530
10649
  }, z$1.core.$strip>, z$1.ZodObject<{
10531
10650
  count: z$1.ZodNumber;
10532
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;
10533
10656
  }, z$1.core.$strip>], "kind">>;
10534
10657
  text: z$1.ZodString;
10535
10658
  threadId: z$1.ZodString;
@@ -11312,6 +11435,60 @@ declare const timelineApprovalWorkRowSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodO
11312
11435
  workKind: z$1.ZodLiteral<"approval">;
11313
11436
  }, z$1.core.$strip>], "approvalKind">;
11314
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>;
11315
11492
  declare const timelineQuestionWorkRowSchema: z$1.ZodObject<{
11316
11493
  answers: z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
11317
11494
  freeText: z$1.ZodOptional<z$1.ZodString>;
@@ -11468,7 +11645,7 @@ declare const timelineWorkflowWorkRowSchema: z$1.ZodObject<{
11468
11645
  workflowName: z$1.ZodNullable<z$1.ZodString>;
11469
11646
  }, z$1.core.$strip>;
11470
11647
  type TimelineWorkflowWorkRow = z$1.infer<typeof timelineWorkflowWorkRowSchema>;
11471
- 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;
11472
11649
  interface TimelineTurnRow extends TimelineRowBase {
11473
11650
  kind: "turn";
11474
11651
  turnId: string;
@@ -11480,13 +11657,6 @@ interface TimelineTurnRow extends TimelineRowBase {
11480
11657
  type TimelineSourceRow = TimelineConversationRow | TimelineWorkRow | TimelineSystemRow;
11481
11658
  type TimelineRow = TimelineSourceRow | TimelineTurnRow;
11482
11659
 
11483
- declare const threadCreateOriginSchema: z$1.ZodEnum<{
11484
- app: "app";
11485
- cli: "cli";
11486
- plugin: "plugin";
11487
- sdk: "sdk";
11488
- }>;
11489
- type ThreadCreateOrigin = z$1.infer<typeof threadCreateOriginSchema>;
11490
11660
  type ExecutionInputFieldSource = CallerExecutionInputSource;
11491
11661
  declare const createExecutionInputSourcesSchema: z$1.ZodObject<{
11492
11662
  model: z$1.ZodOptional<z$1.ZodEnum<{
@@ -11511,14 +11681,6 @@ declare const createExecutionInputSourcesSchema: z$1.ZodObject<{
11511
11681
  }>>;
11512
11682
  }, z$1.core.$strict>;
11513
11683
  type CreateExecutionInputSources = z$1.infer<typeof createExecutionInputSourcesSchema>;
11514
- declare const startedOnBehalfOfSchema: z$1.ZodObject<{
11515
- initiator: z$1.ZodEnum<{
11516
- agent: "agent";
11517
- system: "system";
11518
- }>;
11519
- senderThreadId: z$1.ZodString;
11520
- }, z$1.core.$strip>;
11521
- type StartedOnBehalfOf = z$1.infer<typeof startedOnBehalfOfSchema>;
11522
11684
  declare const createThreadRequestSchema: z$1.ZodObject<{
11523
11685
  environment: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
11524
11686
  environmentId: z$1.ZodString;
@@ -12196,6 +12358,13 @@ declare const sendMessageResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObjec
12196
12358
  user: "user";
12197
12359
  }>;
12198
12360
  model: z$1.ZodString;
12361
+ origin: z$1.ZodNullable<z$1.ZodEnum<{
12362
+ app: "app";
12363
+ cli: "cli";
12364
+ plugin: "plugin";
12365
+ sdk: "sdk";
12366
+ }>>;
12367
+ originPluginId: z$1.ZodNullable<z$1.ZodString>;
12199
12368
  payload: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
12200
12369
  kind: z$1.ZodLiteral<"inline">;
12201
12370
  }, z$1.core.$strip>, z$1.ZodObject<{
@@ -12751,6 +12920,13 @@ declare const sendQueuedMessageResponseSchema: z$1.ZodDiscriminatedUnion<[z$1.Zo
12751
12920
  user: "user";
12752
12921
  }>;
12753
12922
  model: z$1.ZodString;
12923
+ origin: z$1.ZodNullable<z$1.ZodEnum<{
12924
+ app: "app";
12925
+ cli: "cli";
12926
+ plugin: "plugin";
12927
+ sdk: "sdk";
12928
+ }>>;
12929
+ originPluginId: z$1.ZodNullable<z$1.ZodString>;
12754
12930
  payload: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
12755
12931
  kind: z$1.ZodLiteral<"inline">;
12756
12932
  }, z$1.core.$strip>, z$1.ZodObject<{
@@ -13534,9 +13710,39 @@ declare const threadPendingInteractionsResponseSchema: z$1.ZodArray<z$1.ZodUnion
13534
13710
  payload: z$1.ZodObject<{
13535
13711
  data: z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>;
13536
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>>;
13537
13738
  title: z$1.ZodString;
13538
13739
  }, z$1.core.$strip>;
13539
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>>;
13540
13746
  kind: z$1.ZodLiteral<"plugin_submitted">;
13541
13747
  }, z$1.core.$strip>>;
13542
13748
  resolvedAt: z$1.ZodNullable<z$1.ZodNumber>;
@@ -13645,6 +13851,13 @@ declare const threadQueuedMessageListResponseSchema: z$1.ZodArray<z$1.ZodObject<
13645
13851
  user: "user";
13646
13852
  }>;
13647
13853
  model: z$1.ZodString;
13854
+ origin: z$1.ZodNullable<z$1.ZodEnum<{
13855
+ app: "app";
13856
+ cli: "cli";
13857
+ plugin: "plugin";
13858
+ sdk: "sdk";
13859
+ }>>;
13860
+ originPluginId: z$1.ZodNullable<z$1.ZodString>;
13648
13861
  payload: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
13649
13862
  kind: z$1.ZodLiteral<"inline">;
13650
13863
  }, z$1.core.$strip>, z$1.ZodObject<{
@@ -14307,6 +14520,7 @@ declare const desktopBrowserImportCookiesRequestSchema: z$1.ZodObject<{
14307
14520
  chromium: "chromium";
14308
14521
  edge: "edge";
14309
14522
  firefox: "firefox";
14523
+ helium: "helium";
14310
14524
  opera: "opera";
14311
14525
  safari: "safari";
14312
14526
  vivaldi: "vivaldi";
@@ -15386,6 +15600,23 @@ interface ExperimentalAppOverlayRegistration {
15386
15600
  id: string;
15387
15601
  component: ComponentType<ExperimentalAppOverlayProps>;
15388
15602
  }
15603
+ /**
15604
+ * A name the host resolves to a glyph, in this order: a name any plugin
15605
+ * registered with `app.experimental_icons.register()`, then a built-in BB icon
15606
+ * name (`"Zap"`), then a namespaced `"<pluginId>/<name>"` glyph naming an
15607
+ * entry of that plugin's manifest `bb.branding.experimental_icons` map. A
15608
+ * registration therefore shadows a built-in, and either shadows a declared
15609
+ * icon of the same name. Names that resolve to none of the three fall back to
15610
+ * the surface's generic icon.
15611
+ *
15612
+ * Declared icons and registrations are one vocabulary here: the same name
15613
+ * works in `experimental_Icon`, in every field below, and — for a declared
15614
+ * icon — in the tool, provider and bridge-row declarations that accept one.
15615
+ * Declared icons need no frontend bundle and survive the plugin being stopped;
15616
+ * registrations can be any React component but live only while the plugin's
15617
+ * app bundle is loaded.
15618
+ */
15619
+ type BbIconName = string;
15389
15620
  /**
15390
15621
  * Owner-defined validator for a fixed tab's transient target. The host first
15391
15622
  * verifies that the value is JSON-safe, then calls this validator before
@@ -15410,8 +15641,7 @@ type ExperimentalPluginFixedTabReference<Target extends JsonValue = never> = {
15410
15641
  /** A fixed tab declared by a plugin nav panel. */
15411
15642
  type PluginFixedTabRegistration<Target extends JsonValue = never> = ExperimentalPluginFixedTabReference<Target> & {
15412
15643
  title: string;
15413
- /** Icon hint (BB icon name); unknown names fall back to a generic icon. */
15414
- icon: string;
15644
+ icon: BbIconName;
15415
15645
  component: ComponentType<PluginNavPanelProps>;
15416
15646
  /** `flush` lets the component own padding and scrolling. */
15417
15647
  layout?: "flush" | "padded";
@@ -15422,8 +15652,7 @@ interface PluginNavPanelRegistration {
15422
15652
  /** Unique within the plugin; letters, digits, `-`, `_`. */
15423
15653
  id: string;
15424
15654
  title: string;
15425
- /** Icon hint (BB icon name); unknown names fall back to a generic icon. */
15426
- icon: string;
15655
+ icon: BbIconName;
15427
15656
  /** URL segment under `/plugins/<pluginId>/`; letters, digits, `-`, `_`. */
15428
15657
  path: string;
15429
15658
  component: ComponentType<PluginNavPanelProps>;
@@ -15506,10 +15735,10 @@ interface PluginThreadPanelActionRegistration {
15506
15735
  /** Label of the action row in the panel's new-tab launcher. */
15507
15736
  title: string;
15508
15737
  /**
15509
- * Icon hint (BB icon name) used when the plugin ships no logo; the
15510
- * launcher row and opened tabs prefer the plugin's logo.
15738
+ * Drawn only when the manifest declares no `bb.branding.icon`; the launcher
15739
+ * row and opened tabs prefer that over this hint.
15511
15740
  */
15512
- icon?: string;
15741
+ icon?: BbIconName;
15513
15742
  /** Rendered inside every panel tab this action opens. */
15514
15743
  component: ComponentType<PluginThreadPanelProps>;
15515
15744
  /**
@@ -15546,8 +15775,8 @@ interface PluginNewThreadPanelActionRegistration {
15546
15775
  id: string;
15547
15776
  /** Label of the action row in the panel's new-tab launcher. */
15548
15777
  title: string;
15549
- /** Icon hint (BB icon name) used when the plugin ships no logo. */
15550
- icon?: string;
15778
+ /** Drawn only when the manifest declares no `bb.branding.icon`. */
15779
+ icon?: BbIconName;
15551
15780
  /** Rendered inside every panel tab this action opens. */
15552
15781
  component: ComponentType<PluginNewThreadPanelProps>;
15553
15782
  /** Host framing; matches `threadPanelAction`. */
@@ -15591,8 +15820,8 @@ interface PluginSidebarFooterActionRegistration {
15591
15820
  id: string;
15592
15821
  /** Tooltip and accessible label for the icon button. */
15593
15822
  title: string;
15594
- /** Icon hint (BB icon name); unknown names fall back to a generic icon. */
15595
- icon: string;
15823
+ /** Drawn only when the manifest declares no `bb.branding.icon`. */
15824
+ icon: BbIconName;
15596
15825
  /**
15597
15826
  * Runs when the user activates the action (e.g. call `openSettings()`,
15598
15827
  * open a panel via other surfaces, toast). Errors (sync or async) are
@@ -15611,8 +15840,7 @@ interface ExperimentalSidebarFooterItemBase {
15611
15840
  id: string;
15612
15841
  /** Tooltip and accessible label for the host-rendered icon button. */
15613
15842
  label: string;
15614
- /** BB icon-name hint; unknown names fall back to a generic icon. */
15615
- icon: string;
15843
+ icon: BbIconName;
15616
15844
  }
15617
15845
  /** A sidebar-footer item that runs a callback when activated. */
15618
15846
  interface ExperimentalSidebarFooterActionRegistration extends ExperimentalSidebarFooterItemBase {
@@ -16089,8 +16317,7 @@ interface PluginMessageActionRegistration {
16089
16317
  id: string;
16090
16318
  /** Tooltip / menu label for the action. */
16091
16319
  title: string;
16092
- /** Icon hint (BB icon name); unknown names fall back to a generic icon. */
16093
- icon?: string;
16320
+ icon?: BbIconName;
16094
16321
  /**
16095
16322
  * Runs when the user activates the action. Errors (sync or async) are
16096
16323
  * contained and logged; they never break the timeline.
@@ -16149,10 +16376,6 @@ interface PluginCommandRegistration {
16149
16376
  */
16150
16377
  run(context: PluginCommandContext): void | Promise<void>;
16151
16378
  }
16152
- /** @deprecated Use PluginCommandContext. */
16153
- type PluginCommandPaletteActionContext = PluginCommandContext;
16154
- /** @deprecated Use PluginCommandRegistration. */
16155
- type PluginCommandPaletteActionRegistration = PluginCommandRegistration;
16156
16379
  /** Registers commands for bb's command palette. */
16157
16380
  interface PluginAppCommands {
16158
16381
  /** Register a command. IDs are unique within this plugin, including legacy slot registrations. */
@@ -16521,6 +16744,11 @@ interface ExperimentalProviderIconProps {
16521
16744
  "aria-hidden"?: boolean | "false" | "true";
16522
16745
  "aria-label"?: string;
16523
16746
  }
16747
+ /**
16748
+ * An app icon registered by a plugin. The registry is app-wide: a registered
16749
+ * name is usable wherever a `BbIconName` is — `experimental_Icon`, and every
16750
+ * host-rendered surface that takes one — by this plugin or any other.
16751
+ */
16524
16752
  interface ExperimentalIconRegistration {
16525
16753
  /** Shared app name. Namespacing is recommended, but not required. */
16526
16754
  name: string;
@@ -16531,10 +16759,11 @@ interface ExperimentalIconRegistration {
16531
16759
  }
16532
16760
  interface ExperimentalAppIcons {
16533
16761
  /**
16534
- * Add or override an app icon during setup. Returns nothing; the host
16535
- * replaces registrations on reload and removes them on unload. Duplicate
16536
- * names within a plugin reject setup. Between plugins, the first plugin id
16537
- * in lexical order wins, independent of bundle load order.
16762
+ * Add or override an app icon during setup. A registered name shadows a
16763
+ * built-in of the same name. Returns nothing; the host replaces
16764
+ * registrations on reload and removes them on unload. Duplicate names within
16765
+ * a plugin reject setup. Between plugins, the first plugin id in lexical
16766
+ * order wins, independent of bundle load order.
16538
16767
  */
16539
16768
  register(registration: ExperimentalIconRegistration): void;
16540
16769
  }
@@ -16619,8 +16848,8 @@ interface ComposerCustomization {
16619
16848
  interface ComposerPlusMenuItem {
16620
16849
  id: string;
16621
16850
  label: string;
16622
- /** BB icon name; unknown names fall back to the generic plugin icon. */
16623
- icon?: string;
16851
+ /** Drawn only when the manifest declares no `bb.branding.icon`. */
16852
+ icon?: BbIconName;
16624
16853
  /** Accessible description for the host-rendered row. */
16625
16854
  description?: string;
16626
16855
  disabled?: boolean | ((view: ComposerView) => boolean);
@@ -16673,8 +16902,11 @@ interface PluginComposerTextEffect {
16673
16902
  }
16674
16903
  /** Host-rendered status that temporarily replaces a thread's draft glyph. */
16675
16904
  interface PluginComposerThreadRowStatus {
16676
- /** BB icon-name hint; unknown names fall back to the generic plugin icon. */
16677
- icon: string;
16905
+ /**
16906
+ * Always drawn as given: unlike the plugin-badged surfaces, this one has no
16907
+ * preference for the plugin's own `bb.branding.icon`.
16908
+ */
16909
+ icon: BbIconName;
16678
16910
  /** Accessible label for the status glyph. */
16679
16911
  label: string;
16680
16912
  /**
@@ -16781,6 +17013,82 @@ interface PluginComposerApi {
16781
17013
  * Experimental: see docs/api_to_audit.md.
16782
17014
  */
16783
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;
16784
17092
  }
16785
17093
  /**
16786
17094
  * What `experimental_submit` does differently from pressing Enter.
@@ -16807,8 +17115,7 @@ interface ThreadChatMessageAction {
16807
17115
  id: string;
16808
17116
  /** Tooltip / menu label for the action. */
16809
17117
  title: string;
16810
- /** Icon hint (BB icon name); unknown names fall back to a generic icon. */
16811
- icon?: string;
17118
+ icon?: BbIconName;
16812
17119
  /**
16813
17120
  * Message roles the action applies to. Omitted = both user and assistant
16814
17121
  * messages.
@@ -19751,8 +20058,26 @@ interface MessageDispatchHookContext {
19751
20058
  /** Whether this attempt starts a turn or joins a running one. */
19752
20059
  attempt: PluginDispatchAttemptKind;
19753
20060
  /**
19754
- * The queued row this attempt is re-trying, or null when the attempt is
19755
- * inline and no row has ever existed for it.
20061
+ * The author category shared by this dispatch's messages: `user`, `agent`,
20062
+ * or `system`. `mixed` means the queued messages have different categories.
20063
+ * Different agents still share the `agent` category; read `queuedMessages`
20064
+ * for each message's author. `mixed` is a hook summary, not a turn initiator.
20065
+ */
20066
+ initiator: ThreadTurnInitiator | "mixed";
20067
+ /**
20068
+ * The thread that sent every message in this dispatch: a thread id, null
20069
+ * when none of them has a sender, or the literal `"mixed"` when the rows
20070
+ * disagree. A thread-start names its requesting thread; a message a human
20071
+ * typed and a core-driven retry have no sender. Null therefore still means
20072
+ * "nobody sent this" rather than "bb could not tell", so a handler may key
20073
+ * a human-versus-agent policy on it; `queuedMessages` names each row's own
20074
+ * sender. Thread ids are prefixed, so no id collides with `"mixed"`.
20075
+ */
20076
+ senderThreadId: string | "mixed" | null;
20077
+ /**
20078
+ * All queued rows this attempt is re-trying, in dispatch order. Empty for
20079
+ * an inline attempt. Each row retains its own content, author, and origin; `input`
20080
+ * contains their combined input, and the hook decides for the whole group.
19756
20081
  *
19757
20082
  * This is how a hook tells a fresh send from a re-attempt of something it
19758
20083
  * already decided about — the replacement for the old
@@ -19760,7 +20085,7 @@ interface MessageDispatchHookContext {
19760
20085
  * should treat the two identically; a hook that logs should not
19761
20086
  * double-count.
19762
20087
  */
19763
- queuedMessage: ThreadQueuedMessage | null;
20088
+ queuedMessages: ThreadQueuedMessage[];
19764
20089
  /**
19765
20090
  * Opaque JSON supplied by a plugin through the composer's
19766
20091
  * `experimental_submit`, paired with that plugin's id. Null for ordinary
@@ -19771,10 +20096,15 @@ interface MessageDispatchHookContext {
19771
20096
  pluginId: string;
19772
20097
  data: JsonValue;
19773
20098
  } | null;
19774
- /** How the dispatch was requested; null for internal/core-driven sends. */
19775
- origin: ThreadCreateOrigin | null;
19776
- originPluginId: string | null;
19777
- startedOnBehalfOf: StartedOnBehalfOf | null;
20099
+ /**
20100
+ * How the dispatch was requested; null for internal/core-driven sends, which
20101
+ * includes every follow-up, steer and retry. Persisted with the queued row,
20102
+ * so a drained re-attempt reads what its first attempt read. For a grouped
20103
+ * dispatch, each field is its shared value or `"mixed"` when rows differ,
20104
+ * including a value versus null. Each queued row exposes its own origin.
20105
+ */
20106
+ origin: ThreadCreateOrigin | "mixed" | null;
20107
+ originPluginId: string | "mixed" | null;
19778
20108
  parentThreadId: string | null;
19779
20109
  }
19780
20110
  /**
@@ -19973,6 +20303,23 @@ type PluginInteractionResult = {
19973
20303
  outcome: "cancelled";
19974
20304
  reason: PluginInteractionCancelReason;
19975
20305
  };
20306
+ /**
20307
+ * What a submitted form leaves in the thread timeline, chosen by the plugin.
20308
+ * bb never stores the form's payload or the submitted value; it stores only
20309
+ * this description, so a plugin decides what the transcript keeps.
20310
+ */
20311
+ interface PluginInteractionDescription {
20312
+ /** Row title once submitted; defaults to the presentation's completed label. */
20313
+ title?: string;
20314
+ /** Short Markdown for the expanded row. */
20315
+ detail?: string;
20316
+ /**
20317
+ * Persisted with the row and handed to this plugin's
20318
+ * `experimental_timelineRenderer` registered for `"<pluginId>/<rendererId>"`.
20319
+ * Omit anything the transcript must not keep.
20320
+ */
20321
+ payload?: JsonValue;
20322
+ }
19976
20323
  interface PluginInteractionRequest {
19977
20324
  threadId: string;
19978
20325
  rendererId: string;
@@ -19980,6 +20327,19 @@ interface PluginInteractionRequest {
19980
20327
  payload: JsonValue;
19981
20328
  /** Defaults to ten minutes; capped at one hour. */
19982
20329
  timeoutMs?: number;
20330
+ /**
20331
+ * How the form reads as a timeline row while it waits and once it settles,
20332
+ * in the same shape as a native tool's presentation. bb fills what is left
20333
+ * out: "Waiting for <title>" / "Submitted <title>" and the plugin's glyph.
20334
+ */
20335
+ presentation?: PluginRowPresentation;
20336
+ /**
20337
+ * Called once with the submitted value, before the waiting `requestInput`
20338
+ * promise resolves; never for a cancellation, which bb titles itself. Its
20339
+ * return is persisted on the row. A throw or a slow return leaves the row
20340
+ * with its completed label and nothing more.
20341
+ */
20342
+ describeSubmission?(value: JsonValue): PluginInteractionDescription | Promise<PluginInteractionDescription>;
19983
20343
  }
19984
20344
  interface PluginCliResult {
19985
20345
  exitCode: number;
@@ -20015,6 +20375,15 @@ interface PluginCliRegistration {
20015
20375
  /** Subcommand metadata rendered in help and the plugin-commands skill
20016
20376
  * without executing plugin code. Parsing argv is plugin-owned. */
20017
20377
  commands?: PluginCliCommandInfo[];
20378
+ /**
20379
+ * Set when `run` answers `--help` / `-h` itself, at every level, without
20380
+ * executing a command. The `bb` CLI then forwards help requests to the
20381
+ * plugin instead of printing the one-line `usage` from `commands`.
20382
+ * `defineCli` sets it. Leave it unset for a hand-written `run`:
20383
+ * the host cannot know that such a parser will not act on the other
20384
+ * arguments.
20385
+ */
20386
+ rendersHelp?: boolean;
20018
20387
  run(argv: string[], ctx: PluginCliContext): PluginCliResult | Promise<PluginCliResult>;
20019
20388
  }
20020
20389
  interface PluginCli {
@@ -20043,30 +20412,37 @@ type PluginAgentToolResult = string | {
20043
20412
  interface PluginAgentToolContext {
20044
20413
  threadId: string;
20045
20414
  projectId: string;
20046
- /** The tool-call request's abort signal (aborts if the daemon round-trip
20047
- * is torn down mid-call). */
20415
+ /**
20416
+ * Aborts when the tool-call request is cancelled, the thread is stopped or
20417
+ * deleted, or this plugin is disposed. Opening a form with `bb.ui.requestInput`
20418
+ * detaches the call from its request: the agent receives a waiting notice,
20419
+ * and request cancellation no longer aborts this signal. The tool's eventual
20420
+ * result is delivered as a system message (success steers a running turn or
20421
+ * starts a new one; an `isError` result only steers). Thread stop/delete and
20422
+ * plugin disposal still abort the signal after detachment.
20423
+ */
20048
20424
  signal: AbortSignal;
20049
20425
  }
20050
20426
  /**
20051
- * The row title of a plugin tool call while it is pending and once it
20427
+ * The title of a plugin-owned timeline row while it is pending and once it
20052
20428
  * settled. Each label is capped at 80 characters and rendered as plain text.
20053
20429
  */
20054
- interface PluginAgentToolLabels {
20055
- /** Label shown while the tool call is pending. */
20430
+ interface PluginRowLabels {
20431
+ /** Label shown while the row is pending. */
20056
20432
  pending: string;
20057
- /** Label shown after the tool call completes successfully. */
20433
+ /** Label shown after the row completes successfully. */
20058
20434
  completed: string;
20059
20435
  }
20060
20436
  /**
20061
- * How calls to a native plugin tool read as a timeline row (grammar v3). Every
20062
- * field is optional at registration: the server fills what the plugin leaves
20063
- * out (a generic `Running <name>` / `Ran <name>` label; the plugin's branding
20064
- * glyph, then `Toolbox`) and hands one complete presentation to the provider
20065
- * bridge with the tool definition.
20437
+ * How something a plugin owns reads as a timeline row (grammar v3): a native
20438
+ * tool's calls, or the row a `bb.ui.requestInput` form leaves behind. Every
20439
+ * field is optional: the server fills what the plugin leaves out (a generic
20440
+ * label; the plugin's branding glyph, then `Toolbox`) and hands one complete
20441
+ * presentation to whatever renders the row.
20066
20442
  */
20067
- interface PluginAgentToolPresentation {
20068
- /** Row title while the call is pending and once it settled. */
20069
- label?: PluginAgentToolLabels;
20443
+ interface PluginRowPresentation {
20444
+ /** Row title while the row is pending and once it settled. */
20445
+ label?: PluginRowLabels;
20070
20446
  /**
20071
20447
  * A named host glyph (`{ glyph: "Workflow" }`), or one of this plugin's
20072
20448
  * own declared icons by its namespaced glyph (`{ glyph: "<pluginId>/<name>" }`,
@@ -20104,7 +20480,7 @@ interface PluginAgentToolRegistrationBase {
20104
20480
  * plugin's branding glyph. Approval, error, and interruption states keep
20105
20481
  * BB's standard rendering. See docs/api_to_audit.md.
20106
20482
  */
20107
- presentation?: PluginAgentToolPresentation;
20483
+ presentation?: PluginRowPresentation;
20108
20484
  }
20109
20485
  /** Stable, plain-data context resolved by the server for one agent session. */
20110
20486
  interface PluginAgentConfigurationContext {
@@ -20661,6 +21037,12 @@ interface PluginMentionItem {
20661
21037
  id: string;
20662
21038
  title: string;
20663
21039
  subtitle?: string;
21040
+ /**
21041
+ * BB icon name: a built-in name, or a name the plugin's app bundle
21042
+ * registered with `app.experimental_icons.register()`. The row prefers the
21043
+ * plugin's own branding icon when it ships one; unknown names fall back to
21044
+ * the generic plugin icon.
21045
+ */
20664
21046
  icon?: string;
20665
21047
  }
20666
21048
  /** Agent-only image context resolved with a plugin mention. */
@@ -20706,7 +21088,14 @@ interface PluginMentionProviderRegistration {
20706
21088
  }>;
20707
21089
  }
20708
21090
  interface PluginUi {
20709
- /** Block until the app submits or cancels a plugin-owned composer form. */
21091
+ /**
21092
+ * Block until the user submits or cancels this plugin's form in the
21093
+ * thread composer. Inside a native tool's `execute`, calling this answers
21094
+ * the tool call at once with a waiting notice and the eventual return value
21095
+ * reaches the agent as a message; see {@link PluginAgentToolContext.signal}.
21096
+ * The form leaves a timeline row described by `presentation` and
21097
+ * `describeSubmission`.
21098
+ */
20710
21099
  requestInput(request: PluginInteractionRequest, options?: {
20711
21100
  signal?: AbortSignal;
20712
21101
  }): Promise<PluginInteractionResult>;
@@ -20926,5 +21315,237 @@ interface BbPluginApi {
20926
21315
  onDispose(hook: () => void | Promise<void>): void;
20927
21316
  }
20928
21317
 
20929
- export { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract, experimental_defineHostEntry };
20930
- 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 };
21318
+ /** Duration suffixes, shared with the core `bb` CLI grammar. */
21319
+ type PluginCliDurationUnit = "d" | "h" | "m" | "ms" | "s";
21320
+ /**
21321
+ * Failure codes the parser itself emits in the `--json` error envelope.
21322
+ * A command raising `PluginCliError` may use any snake_case code.
21323
+ */
21324
+ type PluginCliErrorCode = "invalid_value" | "missing_command" | "missing_required" | "unexpected_argument" | "unknown_command" | "unknown_option";
21325
+ interface PluginCliOptionBase {
21326
+ /** One line shown in `--help`; state the limits agents keep hitting. */
21327
+ description: string;
21328
+ /** Extra spellings accepted silently and mapped onto this option. */
21329
+ aliases?: readonly string[];
21330
+ /** Single-character form: `"f"` (or `"-f"`) accepts `-f`. */
21331
+ short?: string;
21332
+ /** Kept out of `--help` and the generated usage line. */
21333
+ hidden?: boolean;
21334
+ /** Value placeholder in help and usage; defaults to the value type. */
21335
+ placeholder?: string;
21336
+ /**
21337
+ * Recognize `--<name>-stdin`. The `bb` CLI reads that value from stdin and
21338
+ * rewrites it to `--<name> <value>` before the plugin runs, so a command
21339
+ * that still sees it reports that instead of "unknown option".
21340
+ */
21341
+ stdin?: boolean;
21342
+ }
21343
+ /** A valueless flag; absent means `false`. */
21344
+ interface PluginCliBooleanOption extends PluginCliOptionBase {
21345
+ type: "boolean";
21346
+ }
21347
+ interface PluginCliStringOption extends PluginCliOptionBase {
21348
+ type: "string";
21349
+ required?: boolean;
21350
+ repeatable?: boolean;
21351
+ /**
21352
+ * Split each value on this separator, so `--tag a,b` is two tags. Only valid
21353
+ * with `repeatable: true`; `defineCli` rejects it otherwise, because a
21354
+ * single-valued option would silently drop every value after the first.
21355
+ */
21356
+ split?: string;
21357
+ default?: string;
21358
+ }
21359
+ interface PluginCliIntegerOption extends PluginCliOptionBase {
21360
+ type: "integer";
21361
+ min: number;
21362
+ max: number;
21363
+ required?: boolean;
21364
+ default?: number;
21365
+ }
21366
+ interface PluginCliEnumOption extends PluginCliOptionBase {
21367
+ type: "enum";
21368
+ values: readonly string[];
21369
+ required?: boolean;
21370
+ repeatable?: boolean;
21371
+ /** Split each value on this separator, so `--kind a,b` is two values. */
21372
+ split?: string;
21373
+ default?: string;
21374
+ }
21375
+ /** A duration parsed to milliseconds with the core CLI's grammar. */
21376
+ interface PluginCliDurationOption extends PluginCliOptionBase {
21377
+ type: "duration";
21378
+ /** Unit assumed for a bare number when `bareUnits` is absent. */
21379
+ defaultUnit: PluginCliDurationUnit;
21380
+ /**
21381
+ * Units tried in order for a bare number, taking the first whose
21382
+ * milliseconds fall inside `min`/`max`. Declare it when two units are
21383
+ * plausible and their valid ranges do not overlap (`90` seconds versus
21384
+ * `1500` milliseconds); a number matching neither is rejected with both
21385
+ * forms named.
21386
+ */
21387
+ bareUnits?: readonly PluginCliDurationUnit[];
21388
+ /** Inclusive bounds in milliseconds. */
21389
+ min?: number;
21390
+ max?: number;
21391
+ required?: boolean;
21392
+ /** Default in milliseconds. */
21393
+ default?: number;
21394
+ }
21395
+ type PluginCliOption = PluginCliBooleanOption | PluginCliStringOption | PluginCliIntegerOption | PluginCliEnumOption | PluginCliDurationOption;
21396
+ interface PluginCliPositional {
21397
+ name: string;
21398
+ description: string;
21399
+ required?: boolean;
21400
+ /** Collects every remaining bare token into a string array. */
21401
+ variadic?: boolean;
21402
+ }
21403
+ /**
21404
+ * Relationships between options that the parser enforces before `run`.
21405
+ * Rules that depend on a value (which options a `--backend` choice allows)
21406
+ * belong in `run`, raised as `PluginCliError`.
21407
+ */
21408
+ type PluginCliConstraint = {
21409
+ kind: "exactly-one";
21410
+ options: readonly string[];
21411
+ } | {
21412
+ kind: "at-most-one";
21413
+ options: readonly string[];
21414
+ } | {
21415
+ kind: "at-least-one";
21416
+ options: readonly string[];
21417
+ } | {
21418
+ kind: "requires";
21419
+ option: string;
21420
+ needs: readonly string[];
21421
+ };
21422
+ type CliOptions = Record<string, PluginCliOption>;
21423
+ type CliPositionals = readonly PluginCliPositional[];
21424
+ type OptionValue<TOption> = TOption extends {
21425
+ type: "boolean";
21426
+ } ? boolean : TOption extends {
21427
+ type: "enum";
21428
+ values: readonly (infer TValue)[];
21429
+ } ? TValue : TOption extends {
21430
+ type: "string";
21431
+ } ? string : number;
21432
+ type OptionResolved<TOption> = TOption extends {
21433
+ type: "boolean";
21434
+ } ? boolean : TOption extends {
21435
+ repeatable: true;
21436
+ } ? OptionValue<TOption>[] : TOption extends {
21437
+ required: true;
21438
+ } ? OptionValue<TOption> : TOption extends {
21439
+ default: unknown;
21440
+ } ? OptionValue<TOption> : OptionValue<TOption> | undefined;
21441
+ /** Validated option values, keyed by the spec's option names. */
21442
+ type PluginCliOptionValues<TOptions extends CliOptions> = {
21443
+ [TName in keyof TOptions]: OptionResolved<TOptions[TName]>;
21444
+ };
21445
+ /** Validated positional values, keyed by the spec's positional names. */
21446
+ type PluginCliPositionalValues<TPositionals extends CliPositionals> = {
21447
+ [TEntry in TPositionals[number] as TEntry["name"]]: TEntry extends {
21448
+ variadic: true;
21449
+ } ? string[] : TEntry extends {
21450
+ required: true;
21451
+ } ? string : string | undefined;
21452
+ };
21453
+ /** What a command's `run` receives once every value has been validated. */
21454
+ interface PluginCliRunInput<TOptions extends CliOptions = CliOptions, TPositionals extends CliPositionals = CliPositionals> {
21455
+ options: PluginCliOptionValues<TOptions>;
21456
+ positionals: PluginCliPositionalValues<TPositionals>;
21457
+ /** Tokens after `--` when the command declares `passthrough`. */
21458
+ passthrough: string[];
21459
+ /** This command's rendered `--help` text. */
21460
+ help: string;
21461
+ }
21462
+ type ErasedOptionValue = string | number | boolean | string[] | undefined;
21463
+ interface ErasedRunInput {
21464
+ options: Record<string, ErasedOptionValue>;
21465
+ positionals: Record<string, string | string[] | undefined>;
21466
+ passthrough: string[];
21467
+ help: string;
21468
+ }
21469
+ /**
21470
+ * One command as `defineCli` consumes it. Build it with
21471
+ * `cliCommand` so `run` receives typed values. The declaration
21472
+ * is inert data: help and usage render from it without running the command.
21473
+ */
21474
+ interface PluginCliCommand {
21475
+ summary: string;
21476
+ description?: string;
21477
+ /** Extra invocation paths that run this command, hidden from help. */
21478
+ aliases?: readonly string[];
21479
+ /** Mistyped command names that should suggest this command. */
21480
+ suggestFor?: readonly string[];
21481
+ hidden?: boolean;
21482
+ options?: CliOptions;
21483
+ positionals?: CliPositionals;
21484
+ constraints?: readonly PluginCliConstraint[];
21485
+ /** Put tokens after `--` in `input.passthrough` instead of positionals. */
21486
+ passthrough?: boolean;
21487
+ /** Hint added when an unexpected bare token is passed. */
21488
+ unexpectedPositionalHint?: string;
21489
+ run(input: ErasedRunInput, ctx: PluginCliContext): PluginCliResult | Promise<PluginCliResult>;
21490
+ }
21491
+ /** The declarative CLI a plugin hands to `bb.cli.register`. */
21492
+ interface PluginCliSpec {
21493
+ /** Top-level command name (`bb <name> …`): lowercase `[a-z0-9-]+`. */
21494
+ name: string;
21495
+ summary: string;
21496
+ /** Prose printed under the summary in top-level help. */
21497
+ description?: string;
21498
+ /** Runs when the invocation names no command (`bb connect --code …`). */
21499
+ root?: PluginCliCommand;
21500
+ /** Commands keyed by invocation path (`"add"`, `"account add"`). */
21501
+ commands: Record<string, PluginCliCommand>;
21502
+ /** Exit code for usage errors; defaults to 1. */
21503
+ usageErrorExitCode?: number;
21504
+ }
21505
+ /**
21506
+ * A failure a command raises itself, reported exactly like a parse error:
21507
+ * human text on stderr, plus the `{ ok: false, error }` envelope on stdout
21508
+ * when the invocation carries `--json`.
21509
+ */
21510
+ declare class PluginCliError extends Error {
21511
+ readonly code: string;
21512
+ readonly hint: string | undefined;
21513
+ readonly exitCode: number;
21514
+ constructor(message: string, options?: {
21515
+ code?: string;
21516
+ hint?: string;
21517
+ exitCode?: number;
21518
+ });
21519
+ }
21520
+ /**
21521
+ * Declares one command. Inference flows from `options` and `positionals`
21522
+ * into `run`, so `input.options.scope` is the declared enum union and a
21523
+ * required option is never `undefined`.
21524
+ */
21525
+ declare function cliCommand<const TOptions extends CliOptions = Record<string, never>, const TPositionals extends CliPositionals = readonly []>(command: {
21526
+ summary: string;
21527
+ description?: string;
21528
+ aliases?: readonly string[];
21529
+ suggestFor?: readonly string[];
21530
+ hidden?: boolean;
21531
+ options?: TOptions;
21532
+ positionals?: TPositionals;
21533
+ constraints?: readonly PluginCliConstraint[];
21534
+ passthrough?: boolean;
21535
+ unexpectedPositionalHint?: string;
21536
+ run(input: PluginCliRunInput<TOptions, TPositionals>, ctx: PluginCliContext): PluginCliResult | Promise<PluginCliResult>;
21537
+ }): PluginCliCommand;
21538
+ /**
21539
+ * Turns a declarative spec into a `PluginCliRegistration`, so every plugin
21540
+ * CLI parses argv, renders `--help`, and fails the same way.
21541
+ *
21542
+ * `--help`, `-h` and a leading `help` word exit 0 at any level and never run
21543
+ * a command. Unknown commands and options suggest the nearest declared name,
21544
+ * every missing required value is reported in one error, and an invocation
21545
+ * carrying `--json` adds the `{ ok: false, error: { code, message, hint? } }`
21546
+ * envelope on stdout while stderr keeps the human-readable text.
21547
+ */
21548
+ declare function defineCli(spec: PluginCliSpec): PluginCliRegistration;
21549
+
21550
+ export { PLUGIN_CLI_OUTPUT_MAX_BYTES, PluginCliError, cliCommand, defineCli, defineRpcContract, experimental_defineHostEntry };
21551
+ 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 };