@get-bb/plugin-sdk 0.4.40 → 0.4.45

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.
@@ -191,6 +191,15 @@ declare function backgroundTaskItemStatus(taskStatus: BackgroundTaskStatus): "co
191
191
  declare function isSettledBackgroundTaskStatus(taskStatus: BackgroundTaskStatus): boolean;
192
192
 
193
193
  declare const threadEventItemPresentationSchema: z.ZodObject<{
194
+ badge: z.ZodOptional<z.ZodObject<{
195
+ glyph: z.ZodString;
196
+ hint: z.ZodString;
197
+ label: z.ZodString;
198
+ tone: z.ZodEnum<{
199
+ destructive: "destructive";
200
+ neutral: "neutral";
201
+ }>;
202
+ }, z.core.$strip>>;
194
203
  detail: z.ZodOptional<z.ZodString>;
195
204
  icon: z.ZodObject<{
196
205
  glyph: z.ZodString;
@@ -379,6 +388,15 @@ declare const pendingInteractionApprovalSubjectSchema: z.ZodDiscriminatedUnion<[
379
388
  itemId: z.ZodString;
380
389
  kind: z.ZodLiteral<"tool_use">;
381
390
  presentation: z.ZodObject<{
391
+ badge: z.ZodOptional<z.ZodObject<{
392
+ glyph: z.ZodString;
393
+ hint: z.ZodString;
394
+ label: z.ZodString;
395
+ tone: z.ZodEnum<{
396
+ destructive: "destructive";
397
+ neutral: "neutral";
398
+ }>;
399
+ }, z.core.$strip>>;
382
400
  detail: z.ZodOptional<z.ZodString>;
383
401
  icon: z.ZodObject<{
384
402
  glyph: z.ZodString;
@@ -472,6 +490,15 @@ declare const approvalPendingInteractionPayloadSchema: z.ZodObject<{
472
490
  itemId: z.ZodString;
473
491
  kind: z.ZodLiteral<"tool_use">;
474
492
  presentation: z.ZodObject<{
493
+ badge: z.ZodOptional<z.ZodObject<{
494
+ glyph: z.ZodString;
495
+ hint: z.ZodString;
496
+ label: z.ZodString;
497
+ tone: z.ZodEnum<{
498
+ destructive: "destructive";
499
+ neutral: "neutral";
500
+ }>;
501
+ }, z.core.$strip>>;
475
502
  detail: z.ZodOptional<z.ZodString>;
476
503
  icon: z.ZodObject<{
477
504
  glyph: z.ZodString;
@@ -623,6 +650,15 @@ declare const pendingInteractionPayloadSchema: z.ZodUnion<readonly [z.ZodObject<
623
650
  itemId: z.ZodString;
624
651
  kind: z.ZodLiteral<"tool_use">;
625
652
  presentation: z.ZodObject<{
653
+ badge: z.ZodOptional<z.ZodObject<{
654
+ glyph: z.ZodString;
655
+ hint: z.ZodString;
656
+ label: z.ZodString;
657
+ tone: z.ZodEnum<{
658
+ destructive: "destructive";
659
+ neutral: "neutral";
660
+ }>;
661
+ }, z.core.$strip>>;
626
662
  detail: z.ZodOptional<z.ZodString>;
627
663
  icon: z.ZodObject<{
628
664
  glyph: z.ZodString;
@@ -812,6 +848,15 @@ declare const approvalInteractionOutcomeSchema: z.ZodObject<{
812
848
  itemId: z.ZodString;
813
849
  kind: z.ZodLiteral<"tool_use">;
814
850
  presentation: z.ZodObject<{
851
+ badge: z.ZodOptional<z.ZodObject<{
852
+ glyph: z.ZodString;
853
+ hint: z.ZodString;
854
+ label: z.ZodString;
855
+ tone: z.ZodEnum<{
856
+ destructive: "destructive";
857
+ neutral: "neutral";
858
+ }>;
859
+ }, z.core.$strip>>;
815
860
  detail: z.ZodOptional<z.ZodString>;
816
861
  icon: z.ZodObject<{
817
862
  glyph: z.ZodString;
@@ -958,6 +1003,15 @@ declare const providerInteractionOutcomeSchema: z.ZodUnion<readonly [z.ZodObject
958
1003
  itemId: z.ZodString;
959
1004
  kind: z.ZodLiteral<"tool_use">;
960
1005
  presentation: z.ZodObject<{
1006
+ badge: z.ZodOptional<z.ZodObject<{
1007
+ glyph: z.ZodString;
1008
+ hint: z.ZodString;
1009
+ label: z.ZodString;
1010
+ tone: z.ZodEnum<{
1011
+ destructive: "destructive";
1012
+ neutral: "neutral";
1013
+ }>;
1014
+ }, z.core.$strip>>;
961
1015
  detail: z.ZodOptional<z.ZodString>;
962
1016
  icon: z.ZodObject<{
963
1017
  glyph: z.ZodString;
@@ -1429,6 +1483,15 @@ declare const dynamicToolSchema: z.ZodObject<{
1429
1483
  inputSchema: z.ZodUnknown;
1430
1484
  name: z.ZodString;
1431
1485
  presentation: z.ZodOptional<z.ZodObject<{
1486
+ badge: z.ZodOptional<z.ZodObject<{
1487
+ glyph: z.ZodString;
1488
+ hint: z.ZodString;
1489
+ label: z.ZodString;
1490
+ tone: z.ZodEnum<{
1491
+ destructive: "destructive";
1492
+ neutral: "neutral";
1493
+ }>;
1494
+ }, z.core.$strip>>;
1432
1495
  detail: z.ZodOptional<z.ZodString>;
1433
1496
  icon: z.ZodObject<{
1434
1497
  glyph: z.ZodString;
@@ -1725,6 +1788,15 @@ declare function shouldAutoDenyInteractiveRequest(policy: InteractiveRequestPoli
1725
1788
 
1726
1789
  declare const THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
1727
1790
  declare const deltaPresentationSchema: z.ZodObject<{
1791
+ badge: z.ZodOptional<z.ZodObject<{
1792
+ glyph: z.ZodString;
1793
+ hint: z.ZodString;
1794
+ label: z.ZodString;
1795
+ tone: z.ZodEnum<{
1796
+ destructive: "destructive";
1797
+ neutral: "neutral";
1798
+ }>;
1799
+ }, z.core.$strip>>;
1728
1800
  detail: z.ZodOptional<z.ZodString>;
1729
1801
  icon: z.ZodObject<{
1730
1802
  glyph: z.ZodString;
@@ -2328,6 +2400,15 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2328
2400
  rawType: z.ZodString;
2329
2401
  }, z.core.$strip>>;
2330
2402
  presentation: z.ZodOptional<z.ZodObject<{
2403
+ badge: z.ZodOptional<z.ZodObject<{
2404
+ glyph: z.ZodString;
2405
+ hint: z.ZodString;
2406
+ label: z.ZodString;
2407
+ tone: z.ZodEnum<{
2408
+ destructive: "destructive";
2409
+ neutral: "neutral";
2410
+ }>;
2411
+ }, z.core.$strip>>;
2331
2412
  detail: z.ZodOptional<z.ZodString>;
2332
2413
  icon: z.ZodObject<{
2333
2414
  glyph: z.ZodString;
@@ -2519,6 +2600,15 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2519
2600
  rawType: z.ZodString;
2520
2601
  }, z.core.$strip>>;
2521
2602
  presentation: z.ZodOptional<z.ZodObject<{
2603
+ badge: z.ZodOptional<z.ZodObject<{
2604
+ glyph: z.ZodString;
2605
+ hint: z.ZodString;
2606
+ label: z.ZodString;
2607
+ tone: z.ZodEnum<{
2608
+ destructive: "destructive";
2609
+ neutral: "neutral";
2610
+ }>;
2611
+ }, z.core.$strip>>;
2522
2612
  detail: z.ZodOptional<z.ZodString>;
2523
2613
  icon: z.ZodObject<{
2524
2614
  glyph: z.ZodString;
@@ -3111,6 +3201,15 @@ declare const threadDeltaNotificationParamsSchema: z.ZodObject<{
3111
3201
  rawType: z.ZodString;
3112
3202
  }, z.core.$strip>>;
3113
3203
  presentation: z.ZodOptional<z.ZodObject<{
3204
+ badge: z.ZodOptional<z.ZodObject<{
3205
+ glyph: z.ZodString;
3206
+ hint: z.ZodString;
3207
+ label: z.ZodString;
3208
+ tone: z.ZodEnum<{
3209
+ destructive: "destructive";
3210
+ neutral: "neutral";
3211
+ }>;
3212
+ }, z.core.$strip>>;
3114
3213
  detail: z.ZodOptional<z.ZodString>;
3115
3214
  icon: z.ZodObject<{
3116
3215
  glyph: z.ZodString;
@@ -3302,6 +3401,15 @@ declare const threadDeltaNotificationParamsSchema: z.ZodObject<{
3302
3401
  rawType: z.ZodString;
3303
3402
  }, z.core.$strip>>;
3304
3403
  presentation: z.ZodOptional<z.ZodObject<{
3404
+ badge: z.ZodOptional<z.ZodObject<{
3405
+ glyph: z.ZodString;
3406
+ hint: z.ZodString;
3407
+ label: z.ZodString;
3408
+ tone: z.ZodEnum<{
3409
+ destructive: "destructive";
3410
+ neutral: "neutral";
3411
+ }>;
3412
+ }, z.core.$strip>>;
3305
3413
  detail: z.ZodOptional<z.ZodString>;
3306
3414
  icon: z.ZodObject<{
3307
3415
  glyph: z.ZodString;
@@ -4187,6 +4295,15 @@ declare const threadStartParamsSchema: z.ZodObject<{
4187
4295
  inputSchema: z.ZodUnknown;
4188
4296
  name: z.ZodString;
4189
4297
  presentation: z.ZodOptional<z.ZodObject<{
4298
+ badge: z.ZodOptional<z.ZodObject<{
4299
+ glyph: z.ZodString;
4300
+ hint: z.ZodString;
4301
+ label: z.ZodString;
4302
+ tone: z.ZodEnum<{
4303
+ destructive: "destructive";
4304
+ neutral: "neutral";
4305
+ }>;
4306
+ }, z.core.$strip>>;
4190
4307
  detail: z.ZodOptional<z.ZodString>;
4191
4308
  icon: z.ZodObject<{
4192
4309
  glyph: z.ZodString;
@@ -4340,6 +4457,15 @@ declare const threadResumeParamsSchema: z.ZodObject<{
4340
4457
  inputSchema: z.ZodUnknown;
4341
4458
  name: z.ZodString;
4342
4459
  presentation: z.ZodOptional<z.ZodObject<{
4460
+ badge: z.ZodOptional<z.ZodObject<{
4461
+ glyph: z.ZodString;
4462
+ hint: z.ZodString;
4463
+ label: z.ZodString;
4464
+ tone: z.ZodEnum<{
4465
+ destructive: "destructive";
4466
+ neutral: "neutral";
4467
+ }>;
4468
+ }, z.core.$strip>>;
4343
4469
  detail: z.ZodOptional<z.ZodString>;
4344
4470
  icon: z.ZodObject<{
4345
4471
  glyph: z.ZodString;
@@ -4413,6 +4539,15 @@ declare const threadForkParamsSchema: z.ZodObject<{
4413
4539
  inputSchema: z.ZodUnknown;
4414
4540
  name: z.ZodString;
4415
4541
  presentation: z.ZodOptional<z.ZodObject<{
4542
+ badge: z.ZodOptional<z.ZodObject<{
4543
+ glyph: z.ZodString;
4544
+ hint: z.ZodString;
4545
+ label: z.ZodString;
4546
+ tone: z.ZodEnum<{
4547
+ destructive: "destructive";
4548
+ neutral: "neutral";
4549
+ }>;
4550
+ }, z.core.$strip>>;
4416
4551
  detail: z.ZodOptional<z.ZodString>;
4417
4552
  icon: z.ZodObject<{
4418
4553
  glyph: z.ZodString;
@@ -6,7 +6,7 @@
6
6
  // and read the real source: https://github.com/get-bb/bb
7
7
 
8
8
  import { z } from 'zod';
9
- import { BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, JsonValue as JsonValue$1, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, PluginSettingDescriptors, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest } from '@get-bb/plugin-sdk';
9
+ import { BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, JsonValue as JsonValue$1, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
10
10
 
11
11
  /** Input-form entry: a path, or a path with options. */
12
12
  declare const providerNativeRootInputSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -639,6 +639,8 @@ interface FakePluginRegistrations {
639
639
  /** Live provider registrations from `bb.providers.register`
640
640
  * (normalized declarations, registration order; dispose removes). */
641
641
  providerRegistrations: NormalizedPluginProviderDeclaration[];
642
+ providerEnvResolvers: ReadonlyMap<string, (context: ExperimentalPluginProviderEnvContext) => Promise<readonly ExperimentalPluginProviderEnvEntry[]> | readonly ExperimentalPluginProviderEnvEntry[]>;
643
+ providerEnvHealthResolvers: ReadonlyMap<string, (context: ExperimentalPluginProviderEnvHealthContext) => ExperimentalPluginProviderEnvHealth | null | Promise<ExperimentalPluginProviderEnvHealth | null>>;
642
644
  /** Live AI-service registrations from `experimental_aiServices.register`
643
645
  * (normalized declarations, registration order; dispose removes). */
644
646
  aiServiceRegistrations: PluginAiServiceDeclaration[];
@@ -741,6 +743,8 @@ interface FakePluginBehaviorDrivers {
741
743
  skills: string[];
742
744
  instructions: string | null;
743
745
  }>;
746
+ resolveProviderEnv(providerId: string, context: ExperimentalPluginProviderEnvContext): Promise<ExperimentalPluginProviderEnvEntry[]>;
747
+ resolveProviderEnvHealth(providerId: string, context: ExperimentalPluginProviderEnvHealthContext): Promise<ExperimentalPluginProviderEnvHealth | null>;
744
748
  }
745
749
  /** Reload/shutdown controls, kept separate from behavior and inspection. */
746
750
  interface FakePluginLifecycleControls {
@@ -827,6 +831,26 @@ declare function createFakePluginHost(options?: CreateFakePluginHostOptions): Fa
827
831
  type ThreadResponse = PluginThreadEventPayloads["thread.created"]["thread"];
828
832
  type QueueEntry = PluginThreadEventPayloads["message.queued"]["entry"];
829
833
  type TurnFailedEvent = PluginThreadEventPayloads["turn.failed"];
834
+ type PluginAgentConfigurationContextOverrides = {
835
+ thread?: Partial<PluginAgentConfigurationContext["thread"]>;
836
+ project?: Partial<PluginAgentConfigurationContext["project"]>;
837
+ environment?: Partial<PluginAgentConfigurationContext["environment"]>;
838
+ host?: Partial<PluginAgentConfigurationContext["host"]>;
839
+ provider?: Omit<Partial<PluginAgentConfigurationContext["provider"]>, "capabilities"> & {
840
+ capabilities?: Partial<PluginAgentConfigurationContext["provider"]["capabilities"]>;
841
+ };
842
+ origin?: Partial<PluginAgentConfigurationContext["origin"]>;
843
+ };
844
+ type MessageDispatchHookContextOverrides = Omit<Partial<MessageDispatchHookContext>, "environment" | "executionSources" | "host" | "input" | "project" | "queuedMessage" | "requestedExecution" | "thread"> & {
845
+ thread?: Partial<MessageDispatchHookContext["thread"]>;
846
+ project?: Partial<MessageDispatchHookContext["project"]>;
847
+ environment?: Partial<NonNullable<MessageDispatchHookContext["environment"]>> | null;
848
+ host?: Partial<NonNullable<MessageDispatchHookContext["host"]>> | null;
849
+ input?: Partial<MessageDispatchHookContext["input"]>;
850
+ requestedExecution?: Partial<MessageDispatchHookContext["requestedExecution"]>;
851
+ executionSources?: Partial<MessageDispatchHookContext["executionSources"]>;
852
+ queuedMessage?: Partial<NonNullable<MessageDispatchHookContext["queuedMessage"]>> | null;
853
+ };
830
854
  /**
831
855
  * A complete, deterministic `ThreadResponse` for thread lifecycle event
832
856
  * payloads (`harness.emitThreadEvent`). Defaults are the minimal idle
@@ -834,6 +858,20 @@ type TurnFailedEvent = PluginThreadEventPayloads["turn.failed"];
834
858
  * required field, this builder fails typecheck — update the default here.
835
859
  */
836
860
  declare function makeThreadResponse(overrides?: Partial<ThreadResponse>): ThreadResponse;
861
+ /**
862
+ * A complete, deterministic context for conditional agent configuration.
863
+ * Defaults describe a standard project on an unmanaged local environment;
864
+ * override the fields the test cares about. If the contract grows a required
865
+ * field, this builder fails typecheck — update the default here.
866
+ */
867
+ declare function makePluginAgentConfigurationContext(overrides?: PluginAgentConfigurationContextOverrides): PluginAgentConfigurationContext;
868
+ /**
869
+ * A complete, deterministic context for the `message.dispatch` hook. Defaults
870
+ * describe a first inline dispatch before an environment or host is selected;
871
+ * override the fields the test cares about. If the contract grows a required
872
+ * field, this builder fails typecheck — update the default here.
873
+ */
874
+ declare function makeMessageDispatchHookContext(overrides?: MessageDispatchHookContextOverrides): MessageDispatchHookContext;
837
875
  /**
838
876
  * A complete, deterministic queued row for the `message.*` event payloads
839
877
  * and for faking `sdk.threads.queuedMessages.list`. Defaults are a live inline
@@ -880,5 +918,5 @@ interface PublicSdkOnlyScan {
880
918
  */
881
919
  declare function scanPublicSdkOnly(packageRoot: string, options?: PublicSdkOnlyScanOptions): PublicSdkOnlyScan;
882
920
 
883
- export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
921
+ export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeMessageDispatchHookContext, makePluginAgentConfigurationContext, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
884
922
  export type { CreateFakePluginHostOptions, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };