@get-bb/plugin-sdk 0.6.37 → 0.6.39

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.
@@ -13,16 +13,7 @@ interface JsonObject {
13
13
  }
14
14
  type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | JsonObject;
15
15
 
16
- declare const reasoningLevelSchema: z.ZodEnum<{
17
- high: "high";
18
- low: "low";
19
- max: "max";
20
- medium: "medium";
21
- none: "none";
22
- ultra: "ultra";
23
- ultracode: "ultracode";
24
- xhigh: "xhigh";
25
- }>;
16
+ declare const reasoningLevelSchema: z.ZodString;
26
17
  type ReasoningLevel = z.infer<typeof reasoningLevelSchema>;
27
18
  declare const serviceTierSchema: z.ZodString;
28
19
  type ServiceTier = z.infer<typeof serviceTierSchema>;
@@ -192,16 +192,7 @@ declare const projectSchema: z.ZodObject<{
192
192
  }, z.core.$strip>;
193
193
  type Project = z.infer<typeof projectSchema>;
194
194
 
195
- declare const reasoningLevelSchema: z.ZodEnum<{
196
- high: "high";
197
- low: "low";
198
- max: "max";
199
- medium: "medium";
200
- none: "none";
201
- ultra: "ultra";
202
- ultracode: "ultracode";
203
- xhigh: "xhigh";
204
- }>;
195
+ declare const reasoningLevelSchema: z.ZodString;
205
196
  type ReasoningLevel = z.infer<typeof reasoningLevelSchema>;
206
197
  declare const serviceTierSchema: z.ZodString;
207
198
  type ServiceTier = z.infer<typeof serviceTierSchema>;
@@ -448,16 +439,7 @@ declare const threadQueuedMessageSchema: z.ZodObject<{
448
439
  auto: "auto";
449
440
  full: "full";
450
441
  }>;
451
- reasoningLevel: z.ZodEnum<{
452
- high: "high";
453
- low: "low";
454
- max: "max";
455
- medium: "medium";
456
- none: "none";
457
- ultra: "ultra";
458
- ultracode: "ultracode";
459
- xhigh: "xhigh";
460
- }>;
442
+ reasoningLevel: z.ZodString;
461
443
  sendAt: z.ZodNullable<z.ZodNumber>;
462
444
  senderThreadId: z.ZodNullable<z.ZodString>;
463
445
  serviceTier: z.ZodString;
@@ -1450,13 +1432,17 @@ interface PluginProviderFallbackModel {
1450
1432
  /** Picker display name ("Opus 5 (1M)"). */
1451
1433
  displayName: string;
1452
1434
  description: string;
1453
- /** Reasoning levels this model supports, lowest to highest. Non-empty. */
1435
+ /** Reasoning levels this model supports, lowest to highest. Non-empty.
1436
+ * `reasoningEffort` is a standard ladder entry or any provider-specific id
1437
+ * the bridge accepts back as `reasoningLevel`; `label` names a
1438
+ * provider-specific id in the picker. */
1454
1439
  supportedReasoningEfforts: readonly {
1455
- reasoningEffort: PluginProviderReasoningLevel;
1440
+ reasoningEffort: PluginProviderReasoningLevel | (string & {});
1441
+ label?: string;
1456
1442
  description: string;
1457
1443
  }[];
1458
1444
  /** Must be one of `supportedReasoningEfforts`. */
1459
- defaultReasoningEffort: PluginProviderReasoningLevel;
1445
+ defaultReasoningEffort: PluginProviderReasoningLevel | (string & {});
1460
1446
  /** Exactly one entry in the list is the default. */
1461
1447
  isDefault: boolean;
1462
1448
  }
@@ -0,0 +1,606 @@
1
+ // Portable type declarations for `@get-bb/plugin-sdk`. Unpublished BB
2
+ // workspace contracts are flattened; public subpaths may reuse the
3
+ // package root without requiring any other @bb/* package.
4
+ //
5
+ // Confused by the API, or need a symbol that isn't here? Clone the BB repo
6
+ // and read the real source: https://github.com/get-bb/bb
7
+
8
+ import { z } from 'zod';
9
+
10
+ interface JsonObject {
11
+ [key: string]: JsonValue;
12
+ }
13
+ type JsonValue = string | number | boolean | null | JsonValue[] | JsonObject;
14
+
15
+ declare const reasoningLevelSchema: z.ZodString;
16
+ type ReasoningLevel = z.infer<typeof reasoningLevelSchema>;
17
+ declare const serviceTierSchema: z.ZodString;
18
+ type ServiceTier = z.infer<typeof serviceTierSchema>;
19
+
20
+ declare const availableModelSchema: z.ZodObject<{
21
+ defaultReasoningEffort: z.ZodString;
22
+ description: z.ZodString;
23
+ displayName: z.ZodString;
24
+ id: z.ZodString;
25
+ isDefault: z.ZodBoolean;
26
+ model: z.ZodString;
27
+ routeProviderId: z.ZodOptional<z.ZodString>;
28
+ sessionOptions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ category: z.ZodOptional<z.ZodString>;
30
+ description: z.ZodOptional<z.ZodString>;
31
+ id: z.ZodString;
32
+ label: z.ZodString;
33
+ type: z.ZodLiteral<"select">;
34
+ value: z.ZodString;
35
+ values: z.ZodArray<z.ZodObject<{
36
+ description: z.ZodOptional<z.ZodString>;
37
+ group: z.ZodOptional<z.ZodString>;
38
+ id: z.ZodString;
39
+ label: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ category: z.ZodOptional<z.ZodString>;
43
+ description: z.ZodOptional<z.ZodString>;
44
+ fixed: z.ZodOptional<z.ZodBoolean>;
45
+ id: z.ZodString;
46
+ label: z.ZodString;
47
+ type: z.ZodLiteral<"boolean">;
48
+ value: z.ZodBoolean;
49
+ }, z.core.$strip>], "type">>>;
50
+ supportedReasoningEfforts: z.ZodArray<z.ZodObject<{
51
+ description: z.ZodString;
52
+ label: z.ZodOptional<z.ZodString>;
53
+ reasoningEffort: z.ZodString;
54
+ }, z.core.$strip>>;
55
+ supportedServiceTiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
+ description: z.ZodOptional<z.ZodString>;
57
+ id: z.ZodString;
58
+ label: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>>>;
60
+ }, z.core.$strip>;
61
+ type AvailableModel = z.infer<typeof availableModelSchema>;
62
+
63
+ declare const deltaPresentationSchema: z.ZodObject<{
64
+ badge: z.ZodOptional<z.ZodObject<{
65
+ glyph: z.ZodString;
66
+ hint: z.ZodString;
67
+ label: z.ZodString;
68
+ tone: z.ZodEnum<{
69
+ destructive: "destructive";
70
+ neutral: "neutral";
71
+ }>;
72
+ }, z.core.$strip>>;
73
+ detail: z.ZodOptional<z.ZodString>;
74
+ icon: z.ZodObject<{
75
+ glyph: z.ZodString;
76
+ }, z.core.$strip>;
77
+ label: z.ZodObject<{
78
+ completed: z.ZodString;
79
+ pending: z.ZodString;
80
+ }, z.core.$strip>;
81
+ suppress: z.ZodOptional<z.ZodBoolean>;
82
+ tint: z.ZodOptional<z.ZodObject<{
83
+ dark: z.ZodString;
84
+ light: z.ZodString;
85
+ }, z.core.$strip>>;
86
+ title: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>;
88
+ type DeltaPresentation = z.infer<typeof deltaPresentationSchema>;
89
+ declare const deltaItemShapeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ aggregatedOutput: z.ZodOptional<z.ZodString>;
91
+ command: z.ZodString;
92
+ cwd: z.ZodString;
93
+ durationMs: z.ZodOptional<z.ZodNumber>;
94
+ exitCode: z.ZodOptional<z.ZodNumber>;
95
+ type: z.ZodLiteral<"command">;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ changes: z.ZodArray<z.ZodObject<{
98
+ diff: z.ZodOptional<z.ZodString>;
99
+ kind: z.ZodEnum<{
100
+ add: "add";
101
+ delete: "delete";
102
+ update: "update";
103
+ }>;
104
+ movePath: z.ZodOptional<z.ZodString>;
105
+ newText: z.ZodOptional<z.ZodString>;
106
+ oldText: z.ZodOptional<z.ZodString>;
107
+ path: z.ZodString;
108
+ }, z.core.$strip>>;
109
+ type: z.ZodLiteral<"fileChange">;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ args: z.ZodOptional<z.ZodUnknown>;
112
+ durationMs: z.ZodOptional<z.ZodNumber>;
113
+ error: z.ZodOptional<z.ZodString>;
114
+ result: z.ZodOptional<z.ZodUnknown>;
115
+ server: z.ZodOptional<z.ZodString>;
116
+ tool: z.ZodString;
117
+ type: z.ZodLiteral<"tool">;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ type: z.ZodLiteral<"compaction">;
120
+ }, z.core.$strip>, z.ZodObject<{
121
+ text: z.ZodString;
122
+ type: z.ZodLiteral<"agentMessage">;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ content: z.ZodArray<z.ZodString>;
125
+ summary: z.ZodArray<z.ZodString>;
126
+ type: z.ZodLiteral<"reasoning">;
127
+ }, z.core.$strip>, z.ZodObject<{
128
+ text: z.ZodString;
129
+ type: z.ZodLiteral<"plan">;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ queries: z.ZodArray<z.ZodString>;
132
+ type: z.ZodLiteral<"webSearch">;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ pattern: z.ZodNullable<z.ZodString>;
135
+ prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
+ type: z.ZodLiteral<"webFetch">;
137
+ url: z.ZodString;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ path: z.ZodString;
140
+ type: z.ZodLiteral<"imageView">;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ error: z.ZodNullable<z.ZodString>;
143
+ path: z.ZodNullable<z.ZodString>;
144
+ prompt: z.ZodNullable<z.ZodString>;
145
+ result: z.ZodOptional<z.ZodString>;
146
+ transparentBackground: z.ZodBoolean;
147
+ type: z.ZodLiteral<"imageGeneration">;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ description: z.ZodString;
150
+ error: z.ZodOptional<z.ZodString>;
151
+ familyId: z.ZodString;
152
+ outputFile: z.ZodOptional<z.ZodString>;
153
+ skipTranscript: z.ZodBoolean;
154
+ status: z.ZodEnum<{
155
+ completed: "completed";
156
+ failed: "failed";
157
+ interrupted: "interrupted";
158
+ pending: "pending";
159
+ }>;
160
+ summary: z.ZodOptional<z.ZodString>;
161
+ taskStatus: z.ZodEnum<{
162
+ completed: "completed";
163
+ failed: "failed";
164
+ killed: "killed";
165
+ paused: "paused";
166
+ pending: "pending";
167
+ running: "running";
168
+ stopped: "stopped";
169
+ }>;
170
+ taskType: z.ZodString;
171
+ type: z.ZodLiteral<"backgroundTask">;
172
+ usage: z.ZodOptional<z.ZodObject<{
173
+ durationMs: z.ZodNumber;
174
+ toolUses: z.ZodNumber;
175
+ totalTokens: z.ZodNumber;
176
+ }, z.core.$strip>>;
177
+ workflow: z.ZodOptional<z.ZodObject<{
178
+ agents: z.ZodArray<z.ZodObject<{
179
+ agentType: z.ZodOptional<z.ZodString>;
180
+ attempt: z.ZodNumber;
181
+ cached: z.ZodBoolean;
182
+ durationMs: z.ZodOptional<z.ZodNumber>;
183
+ error: z.ZodOptional<z.ZodString>;
184
+ index: z.ZodNumber;
185
+ isolation: z.ZodOptional<z.ZodString>;
186
+ label: z.ZodString;
187
+ lastProgressAt: z.ZodNumber;
188
+ lastToolName: z.ZodOptional<z.ZodString>;
189
+ lastToolSummary: z.ZodOptional<z.ZodString>;
190
+ model: z.ZodString;
191
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
192
+ phaseTitle: z.ZodOptional<z.ZodString>;
193
+ promptPreview: z.ZodOptional<z.ZodString>;
194
+ queuedAt: z.ZodOptional<z.ZodNumber>;
195
+ resultPreview: z.ZodOptional<z.ZodString>;
196
+ startedAt: z.ZodOptional<z.ZodNumber>;
197
+ state: z.ZodEnum<{
198
+ done: "done";
199
+ failed: "failed";
200
+ queued: "queued";
201
+ running: "running";
202
+ skipped: "skipped";
203
+ }>;
204
+ tokens: z.ZodOptional<z.ZodNumber>;
205
+ toolCalls: z.ZodOptional<z.ZodNumber>;
206
+ }, z.core.$strip>>;
207
+ phases: z.ZodArray<z.ZodObject<{
208
+ index: z.ZodNumber;
209
+ kind: z.ZodOptional<z.ZodString>;
210
+ title: z.ZodString;
211
+ }, z.core.$strip>>;
212
+ }, z.core.$strip>>;
213
+ workflowName: z.ZodOptional<z.ZodString>;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ cmd: z.ZodOptional<z.ZodString>;
216
+ path: z.ZodString;
217
+ type: z.ZodLiteral<"fileRead">;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ cmd: z.ZodOptional<z.ZodString>;
220
+ mode: z.ZodEnum<{
221
+ content: "content";
222
+ list: "list";
223
+ path: "path";
224
+ }>;
225
+ path: z.ZodOptional<z.ZodString>;
226
+ query: z.ZodString;
227
+ type: z.ZodLiteral<"search">;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ background: z.ZodBoolean;
230
+ childRef: z.ZodString;
231
+ label: z.ZodString;
232
+ summary: z.ZodOptional<z.ZodString>;
233
+ type: z.ZodLiteral<"delegation">;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ explanation: z.ZodOptional<z.ZodString>;
236
+ steps: z.ZodArray<z.ZodObject<{
237
+ status: z.ZodOptional<z.ZodEnum<{
238
+ active: "active";
239
+ completed: "completed";
240
+ failed: "failed";
241
+ pending: "pending";
242
+ }>>;
243
+ step: z.ZodString;
244
+ }, z.core.$strip>>;
245
+ type: z.ZodLiteral<"planSteps">;
246
+ }, z.core.$strip>, z.ZodObject<{
247
+ kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
248
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
249
+ type: z.ZodLiteral<"extension">;
250
+ }, z.core.$strip>], "type">;
251
+ type DeltaItemShape = z.infer<typeof deltaItemShapeSchema>;
252
+
253
+ interface ProviderBridgeContext {
254
+ pluginId: string;
255
+ dataDir: string;
256
+ tempDir: string;
257
+ }
258
+ interface ProviderBridgeDefinition {
259
+ handleLine: (line: string) => void;
260
+ start?: (context: ProviderBridgeContext) => void;
261
+ onClose?: () => void;
262
+ onSigterm?: () => void;
263
+ onSigint?: () => void;
264
+ }
265
+ interface ProviderBridgeEntry extends ProviderBridgeDefinition {
266
+ experimental_apiVersion: 1;
267
+ }
268
+
269
+ declare const providerUsageResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
270
+ supported: z.ZodLiteral<false>;
271
+ }, z.core.$loose>, z.ZodObject<{
272
+ supported: z.ZodLiteral<true>;
273
+ usage: z.ZodDiscriminatedUnion<[z.ZodObject<{
274
+ accountEmail: z.ZodNullable<z.ZodString>;
275
+ planLabel: z.ZodNullable<z.ZodString>;
276
+ status: z.ZodLiteral<"ok">;
277
+ windows: z.ZodArray<z.ZodObject<{
278
+ cost: z.ZodOptional<z.ZodObject<{
279
+ limitUsdCents: z.ZodNumber;
280
+ usedUsdCents: z.ZodNumber;
281
+ }, z.core.$strip>>;
282
+ label: z.ZodString;
283
+ resetsAt: z.ZodNullable<z.ZodString>;
284
+ usedPercent: z.ZodNumber;
285
+ }, z.core.$loose>>;
286
+ }, z.core.$loose>, z.ZodObject<{
287
+ status: z.ZodLiteral<"not_installed">;
288
+ }, z.core.$loose>, z.ZodObject<{
289
+ status: z.ZodLiteral<"unauthenticated">;
290
+ }, z.core.$loose>, z.ZodObject<{
291
+ status: z.ZodLiteral<"expired">;
292
+ }, z.core.$loose>, z.ZodObject<{
293
+ accountEmail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
294
+ message: z.ZodString;
295
+ planLabel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
296
+ status: z.ZodLiteral<"error">;
297
+ }, z.core.$loose>], "status">;
298
+ }, z.core.$loose>], "supported">;
299
+ type ProviderUsageResult = z.infer<typeof providerUsageResultSchema>;
300
+
301
+ declare const experimental_providerBridge: ProviderBridgeEntry;
302
+
303
+ interface AcpMaintenanceDialect {
304
+ loginCommand: string;
305
+ installer(): {
306
+ command: string;
307
+ args: string[];
308
+ displayCommand: string;
309
+ };
310
+ readAccount(): Promise<{
311
+ email: string | null;
312
+ } | null>;
313
+ readUsage(): Promise<ProviderUsageResult>;
314
+ }
315
+
316
+ declare const acpToolKindSchema: z.ZodEnum<{
317
+ delete: "delete";
318
+ edit: "edit";
319
+ execute: "execute";
320
+ fetch: "fetch";
321
+ move: "move";
322
+ other: "other";
323
+ read: "read";
324
+ search: "search";
325
+ switch_mode: "switch_mode";
326
+ think: "think";
327
+ }>;
328
+ type AcpToolKind = z.infer<typeof acpToolKindSchema>;
329
+ declare const acpToolCallStatusSchema: z.ZodEnum<{
330
+ cancelled: "cancelled";
331
+ completed: "completed";
332
+ failed: "failed";
333
+ in_progress: "in_progress";
334
+ pending: "pending";
335
+ }>;
336
+ type AcpToolCallStatus = z.infer<typeof acpToolCallStatusSchema>;
337
+ declare const acpToolCallContentSchema: z.ZodUnion<readonly [z.ZodObject<{
338
+ content: z.ZodUnion<readonly [z.ZodObject<{
339
+ text: z.ZodString;
340
+ type: z.ZodLiteral<"text">;
341
+ }, z.core.$loose>, z.ZodObject<{
342
+ type: z.ZodString;
343
+ }, z.core.$loose>]>;
344
+ type: z.ZodLiteral<"content">;
345
+ }, z.core.$loose>, z.ZodObject<{
346
+ newText: z.ZodString;
347
+ oldText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
+ path: z.ZodString;
349
+ type: z.ZodLiteral<"diff">;
350
+ }, z.core.$loose>, z.ZodObject<{
351
+ terminalId: z.ZodString;
352
+ type: z.ZodLiteral<"terminal">;
353
+ }, z.core.$loose>]>;
354
+ type AcpToolCallContent = z.infer<typeof acpToolCallContentSchema>;
355
+ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
356
+ content: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
357
+ [x: string]: unknown;
358
+ type: "content";
359
+ content: {
360
+ [x: string]: unknown;
361
+ type: "text";
362
+ text: string;
363
+ } | {
364
+ [x: string]: unknown;
365
+ type: string;
366
+ };
367
+ } | {
368
+ [x: string]: unknown;
369
+ type: "diff";
370
+ path: string;
371
+ newText: string;
372
+ oldText?: string | null | undefined;
373
+ } | {
374
+ [x: string]: unknown;
375
+ type: "terminal";
376
+ terminalId: string;
377
+ })[], unknown[]>>>;
378
+ kind: z.ZodOptional<z.ZodEnum<{
379
+ delete: "delete";
380
+ edit: "edit";
381
+ execute: "execute";
382
+ fetch: "fetch";
383
+ move: "move";
384
+ other: "other";
385
+ read: "read";
386
+ search: "search";
387
+ switch_mode: "switch_mode";
388
+ think: "think";
389
+ }>>;
390
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
391
+ line: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
392
+ path: z.ZodString;
393
+ }, z.core.$loose>>>;
394
+ name: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>, z.ZodTransform<string | undefined, string | null>>>;
395
+ rawInput: z.ZodOptional<z.ZodUnknown>;
396
+ rawKind: z.ZodOptional<z.ZodString>;
397
+ rawOutput: z.ZodOptional<z.ZodUnknown>;
398
+ sessionUpdate: z.ZodEnum<{
399
+ tool_call: "tool_call";
400
+ tool_call_update: "tool_call_update";
401
+ }>;
402
+ status: z.ZodOptional<z.ZodEnum<{
403
+ cancelled: "cancelled";
404
+ completed: "completed";
405
+ failed: "failed";
406
+ in_progress: "in_progress";
407
+ pending: "pending";
408
+ }>>;
409
+ title: z.ZodOptional<z.ZodString>;
410
+ toolCallId: z.ZodString;
411
+ }, z.core.$loose>, unknown>;
412
+ type AcpToolCallUpdateEvent = z.infer<typeof acpToolCallUpdateEventSchema>;
413
+
414
+ interface AcpClassifiedToolCall {
415
+ item: DeltaItemShape;
416
+ presentation: DeltaPresentation;
417
+ }
418
+ interface AcpCommandResult {
419
+ exitCode?: number;
420
+ output?: string;
421
+ }
422
+
423
+ interface AcpToolIdentity {
424
+ name?: string;
425
+ kind?: AcpToolKind;
426
+ }
427
+ interface AcpDelegationReport {
428
+ toolCallId: string;
429
+ childRef: string;
430
+ label: string;
431
+ detail?: string;
432
+ }
433
+ interface AcpDialect {
434
+ readonly id: string;
435
+ toolIdentity?(event: AcpToolCallUpdateEvent): AcpToolIdentity | undefined;
436
+ classifyToolCall?(event: AcpToolCallUpdateEvent): AcpClassifiedToolCall | undefined;
437
+ commandResult?(event: AcpToolCallUpdateEvent): AcpCommandResult | undefined;
438
+ normalizeCommandEvent?(event: AcpToolCallUpdateEvent): AcpToolCallUpdateEvent;
439
+ readonly clientRequestMethods?: readonly string[];
440
+ handleClientRequest?(method: string, params: unknown): AcpClientRequestOutcome | undefined;
441
+ maintenance?: AcpMaintenanceDialect;
442
+ }
443
+ interface AcpClientRequestOutcome {
444
+ result: Record<string, unknown>;
445
+ delegation?: AcpDelegationReport;
446
+ }
447
+ declare function registerAcpDialect(dialect: AcpDialect): void;
448
+
449
+ interface AcpAgentProbeRequest {
450
+ command: string;
451
+ args: readonly string[];
452
+ env?: Record<string, string>;
453
+ cwd: string;
454
+ timeoutMs?: number;
455
+ }
456
+ type AcpAgentProbe = {
457
+ reachable: true;
458
+ fork: boolean;
459
+ } | {
460
+ reachable: false;
461
+ reason: string;
462
+ };
463
+ declare function probeAcpAgent(request: AcpAgentProbeRequest): Promise<AcpAgentProbe>;
464
+ declare const acpAgentProbeSchema: z.ZodType<AcpAgentProbe>;
465
+
466
+ declare const acpLaunchSpecSchema: z.ZodObject<{
467
+ args: z.ZodArray<z.ZodString>;
468
+ command: z.ZodString;
469
+ cwd: z.ZodOptional<z.ZodString>;
470
+ displayName: z.ZodString;
471
+ env: z.ZodRecord<z.ZodString, z.ZodString>;
472
+ modelCli: z.ZodOptional<z.ZodPipe<z.ZodObject<{
473
+ listArgs: z.ZodArray<z.ZodString>;
474
+ primaryModels: z.ZodArray<z.ZodString>;
475
+ selectFlag: z.ZodOptional<z.ZodString>;
476
+ }, z.core.$strict>, z.ZodTransform<{
477
+ listArgs: string[];
478
+ primaryModels: string[];
479
+ selectFlag?: string | undefined;
480
+ } | undefined, {
481
+ listArgs: string[];
482
+ primaryModels: string[];
483
+ selectFlag?: string | undefined;
484
+ }>>>;
485
+ nativeReasoning: z.ZodOptional<z.ZodObject<{
486
+ configId: z.ZodString;
487
+ defaultLevel: z.ZodOptional<z.ZodString>;
488
+ levelValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
489
+ supportedLevels: z.ZodArray<z.ZodString>;
490
+ }, z.core.$strict>>;
491
+ nativeSkillRoots: z.ZodOptional<z.ZodObject<{
492
+ project: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
493
+ ancestors: z.ZodOptional<z.ZodBoolean>;
494
+ namePrefix: z.ZodOptional<z.ZodString>;
495
+ path: z.ZodString;
496
+ recursive: z.ZodOptional<z.ZodBoolean>;
497
+ skipIfManifest: z.ZodOptional<z.ZodString>;
498
+ }, z.core.$strict>]>>>;
499
+ user: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
500
+ ancestors: z.ZodOptional<z.ZodBoolean>;
501
+ namePrefix: z.ZodOptional<z.ZodString>;
502
+ path: z.ZodString;
503
+ recursive: z.ZodOptional<z.ZodBoolean>;
504
+ skipIfManifest: z.ZodOptional<z.ZodString>;
505
+ }, z.core.$strict>]>>>;
506
+ }, z.core.$strict>>;
507
+ permissionCli: z.ZodOptional<z.ZodObject<{
508
+ full: z.ZodOptional<z.ZodArray<z.ZodString>>;
509
+ insertAfterArgs: z.ZodOptional<z.ZodNumber>;
510
+ readonly: z.ZodOptional<z.ZodArray<z.ZodString>>;
511
+ workspaceWrite: z.ZodOptional<z.ZodArray<z.ZodString>>;
512
+ }, z.core.$strict>>;
513
+ reasoningCli: z.ZodOptional<z.ZodObject<{
514
+ defaultLevel: z.ZodOptional<z.ZodString>;
515
+ flag: z.ZodString;
516
+ levelValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
517
+ supportedLevels: z.ZodArray<z.ZodString>;
518
+ }, z.core.$strict>>;
519
+ }, z.core.$strict>;
520
+ type AcpLaunchSpec = z.infer<typeof acpLaunchSpecSchema>;
521
+
522
+ interface AgentModelCatalog {
523
+ models: AvailableModel[];
524
+ resolveVariant(args: {
525
+ model: string;
526
+ reasoningLevel?: ReasoningLevel;
527
+ serviceTier?: ServiceTier;
528
+ }): string | undefined;
529
+ }
530
+
531
+ /**
532
+ * `@get-bb/plugin-sdk/provider-bridge/acp-next` — a preview of the rebuilt
533
+ * ACP bridge kit, published beside `provider-bridge/acp` until it replaces it
534
+ * (docs/api_to_audit.md). The exports match the original kit, plus
535
+ * `experimental_registerAcpDialect`.
536
+ *
537
+ * The Agent Client Protocol (https://agentclientprotocol.com) is one wire
538
+ * protocol spoken by many agents, so bb runs all of them through one generic
539
+ * bridge: the agent to launch arrives per command in the provider options,
540
+ * and nothing in the bridge is bb-first-party. A plugin that wants to add an
541
+ * ACP agent re-exports the bridge from its `bb.host` artifact and registers
542
+ * its providers as any other plugin does:
543
+ *
544
+ * ```ts
545
+ * // host.ts (the plugin's `bb.host` entry)
546
+ * export { experimental_acpProviderBridge as experimental_providerBridge }
547
+ * from "@get-bb/plugin-sdk/provider-bridge/acp-next";
548
+ *
549
+ * // server.ts
550
+ * bb.providers.register({
551
+ * id: "amp",
552
+ * displayName: "Amp",
553
+ * experimental_bridgeOptions: {
554
+ * acpLaunchSpec: { displayName: "Amp", command: "amp", args: ["acp"], env: {} },
555
+ * acpDialect: "generic",
556
+ * },
557
+ * // …the rest of the declaration
558
+ * })
559
+ * ```
560
+ *
561
+ * **Dialects.** Version 1 of the protocol has no sub-agent concept and
562
+ * standardizes nothing about `rawInput`, so what most distinguishes one
563
+ * agent from another lives beside the protocol: grok stamps
564
+ * `_meta["x.ai/tool"]` on every tool event, Cursor reports sub-agents
565
+ * through a vendor `cursor/task` request. A dialect is a small module that
566
+ * reads those channels; the bridge ships `acp` (the generic one), `cursor`,
567
+ * `grok`, `omp` and `opencode`, named by id in the registration's bridge
568
+ * options (`acpDialect`). A plugin supplies its own with
569
+ * `experimental_registerAcpDialect`, called at module load in the same
570
+ * `bb.host` artifact that re-exports the bridge:
571
+ *
572
+ * ```ts
573
+ * // host.ts
574
+ * import {
575
+ * experimental_registerAcpDialect,
576
+ * } from "@get-bb/plugin-sdk/provider-bridge/acp-next";
577
+ *
578
+ * experimental_registerAcpDialect({
579
+ * id: "amp",
580
+ * toolIdentity: (event) => readAmpToolName(event),
581
+ * });
582
+ * ```
583
+ *
584
+ * The registration then names it: `acpDialect: "amp"`. A built-in id cannot
585
+ * be replaced, and an id nothing registered falls back to the generic
586
+ * dialect. The registry is one per host artifact, and a dialect's hooks are
587
+ * unversioned — see docs/api_to_audit.md.
588
+ *
589
+ * Curated by hand — named exports only, never `export *`. Value exports
590
+ * carry the `experimental_` prefix every new plugin API member ships with
591
+ * (see docs/api_to_audit.md); types are unprefixed. Exports no plugin
592
+ * consumes are not published: the surface grows with a consumer, not ahead
593
+ * of one.
594
+ */
595
+
596
+ /**
597
+ * @deprecated The bridge reads the parsed `AcpLaunchSpec` directly; the
598
+ * profile it used to derive from the spec carried the same fields under
599
+ * other names, and nothing outside the bridge produced or consumed it. Kept
600
+ * as an alias because 0.4.x published the name; scheduled for removal at the
601
+ * next major (docs/api_to_audit.md).
602
+ */
603
+ type AcpAgentProfile = AcpLaunchSpec;
604
+
605
+ export { acpAgentProbeSchema as experimental_acpAgentProbeSchema, acpLaunchSpecSchema as experimental_acpLaunchSpecSchema, experimental_providerBridge as experimental_acpProviderBridge, probeAcpAgent as experimental_probeAcpAgent, registerAcpDialect as experimental_registerAcpDialect };
606
+ export type { AgentModelCatalog as AcpAgentModelCatalog, AcpAgentProbe, AcpAgentProbeRequest, AcpAgentProfile, AcpClassifiedToolCall, AcpClientRequestOutcome, AcpDelegationReport, AcpDialect, AcpLaunchSpec, AcpToolCallContent, AcpToolCallStatus, AcpToolCallUpdateEvent, AcpToolIdentity, AcpToolKind };