@get-bb/plugin-sdk 0.4.30 → 0.4.34

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.
@@ -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, 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, PluginSettingDescriptors, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest } 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<{
@@ -631,6 +631,10 @@ interface FakePluginRegistrations {
631
631
  projectId: string;
632
632
  }) => string | null) | null;
633
633
  threadEventHandlers: Record<PluginThreadEventName, number>;
634
+ /** The handler registered per hook by `bb.experimental_hooks.on`. */
635
+ hooks: {
636
+ [K in PluginHookName]: PluginHookHandler<K> | null;
637
+ };
634
638
  mentionProviders: FakeMentionProviderRecord[];
635
639
  /** Live provider registrations from `bb.providers.register`
636
640
  * (normalized declarations, registration order; dispose removes). */
@@ -648,6 +652,12 @@ interface FakePluginInspectionState {
648
652
  readonly realtimeSignals: FakeRealtimeSignal[];
649
653
  /** Every `bb.status.needsConfiguration` message, in order. */
650
654
  readonly needsConfigurationMessages: string[];
655
+ /**
656
+ * How many times the plugin called
657
+ * `bb.experimental_hooks.recheck()` — the wake it asks core for when a
658
+ * condition its own waits depend on has changed.
659
+ */
660
+ readonly recheckCount: number;
651
661
  /** Recorded `bb.sdk` calls + stub control. */
652
662
  readonly sdk: FakeSdkHarness;
653
663
  readonly registrations: FakePluginRegistrations;
@@ -811,6 +821,8 @@ interface FakePluginHost {
811
821
  declare function createFakePluginHost(options?: CreateFakePluginHostOptions): FakePluginHost;
812
822
 
813
823
  type ThreadResponse = PluginThreadEventPayloads["thread.created"]["thread"];
824
+ type QueueEntry = PluginThreadEventPayloads["message.queued"]["entry"];
825
+ type TurnFailedEvent = PluginThreadEventPayloads["turn.failed"];
814
826
  /**
815
827
  * A complete, deterministic `ThreadResponse` for thread lifecycle event
816
828
  * payloads (`harness.emitThreadEvent`). Defaults are the minimal idle
@@ -818,6 +830,22 @@ type ThreadResponse = PluginThreadEventPayloads["thread.created"]["thread"];
818
830
  * required field, this builder fails typecheck — update the default here.
819
831
  */
820
832
  declare function makeThreadResponse(overrides?: Partial<ThreadResponse>): ThreadResponse;
833
+ /**
834
+ * A complete, deterministic queued row for the `message.*` event payloads
835
+ * and for faking `sdk.threads.queuedMessages.list`. Defaults are a live inline
836
+ * row on this plugin's wait; override what the test is about. If the
837
+ * contract grows a required field, this builder fails typecheck — update the
838
+ * default here.
839
+ */
840
+ declare function makeQueueEntry(overrides?: Partial<QueueEntry>): QueueEntry;
841
+ /**
842
+ * A complete, deterministic `turn.failed` payload. Defaults are a first attempt
843
+ * that failed inside a provider turn with neither structured error info nor
844
+ * rate limits — the shape a retry policy must handle before it handles the
845
+ * interesting ones. If the contract grows a required field, this builder fails
846
+ * typecheck — update the default here.
847
+ */
848
+ declare function makeTurnFailedEvent(overrides?: Partial<TurnFailedEvent>): TurnFailedEvent;
821
849
 
822
850
  interface PublicSdkOnlyScanOptions {
823
851
  /**
@@ -848,5 +876,5 @@ interface PublicSdkOnlyScan {
848
876
  */
849
877
  declare function scanPublicSdkOnly(packageRoot: string, options?: PublicSdkOnlyScanOptions): PublicSdkOnlyScan;
850
878
 
851
- export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeThreadResponse };
879
+ export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
852
880
  export type { CreateFakePluginHostOptions, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };