@get-bb/plugin-sdk 0.4.40 → 0.4.47
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.
- package/README.md +16 -1
- package/bundled-types/bb-plugin-sdk-app.d.ts +48 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +12 -1
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +34 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +590 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +135 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +18 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +59 -2
- package/bundled-types/bb-plugin-sdk.d.ts +711 -9
- package/dist/internal/host-policy.js +39 -0
- package/dist/internal/plugin-app-collector.js +142 -5
- package/dist/provider-bridge-acp.js +44 -10
- package/dist/provider-bridge-testing.js +36 -13
- package/dist/provider-bridge.js +44 -10
- package/dist/testing/app.js +136 -4
- package/dist/testing/index.js +415 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -7,7 +7,23 @@
|
|
|
7
7
|
|
|
8
8
|
import { ReactNode, ComponentType } from 'react';
|
|
9
9
|
import { RenderResult } from '@testing-library/react';
|
|
10
|
-
import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
10
|
+
import { ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
11
|
+
|
|
12
|
+
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
13
|
+
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
14
|
+
command: {
|
|
15
|
+
sequence: number;
|
|
16
|
+
kind: ExperimentalSidebarFooterCommandKind;
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
interface ExperimentalSidebarFooterItemRuntime {
|
|
20
|
+
subscribe(listener: () => void): () => void;
|
|
21
|
+
getSnapshot(): ExperimentalSidebarFooterRuntimeSnapshot;
|
|
22
|
+
acknowledgeCommand(sequence: number): void;
|
|
23
|
+
}
|
|
24
|
+
type CollectedExperimentalSidebarFooterItem = ExperimentalSidebarFooterItemRegistration & {
|
|
25
|
+
runtime: ExperimentalSidebarFooterItemRuntime;
|
|
26
|
+
};
|
|
11
27
|
|
|
12
28
|
/**
|
|
13
29
|
* `@get-bb/plugin-sdk/testing/app` — the frontend plugin test harness. Tests a
|
|
@@ -125,6 +141,7 @@ interface CapturedPluginApp {
|
|
|
125
141
|
composerCustomizations: ComposerCustomization[];
|
|
126
142
|
pendingInteractions: PluginPendingInteractionRegistration[];
|
|
127
143
|
sidebarFooterActions: PluginSidebarFooterActionRegistration[];
|
|
144
|
+
experimentalSidebarFooterItems: CollectedExperimentalSidebarFooterItem[];
|
|
128
145
|
experimentalSidebarNavigations: ExperimentalSidebarNavigationRegistration[];
|
|
129
146
|
threadLists: PluginThreadListRegistration[];
|
|
130
147
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
@@ -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, ExperimentalPluginWebSocketHandler, 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<{
|
|
@@ -555,6 +555,22 @@ interface FakeHttpRouteRecord {
|
|
|
555
555
|
auth: PluginHttpAuthMode;
|
|
556
556
|
handler: PluginHttpHandler;
|
|
557
557
|
}
|
|
558
|
+
interface ExperimentalFakeWebSocketRouteRecord {
|
|
559
|
+
path: string;
|
|
560
|
+
auth: PluginHttpAuthMode;
|
|
561
|
+
handler: ExperimentalPluginWebSocketHandler;
|
|
562
|
+
}
|
|
563
|
+
interface ExperimentalFakeWebSocketSession {
|
|
564
|
+
readonly sent: readonly (string | Uint8Array)[];
|
|
565
|
+
readonly closeCalls: readonly {
|
|
566
|
+
code: number | null;
|
|
567
|
+
reason: string | null;
|
|
568
|
+
}[];
|
|
569
|
+
readonly readyState: number;
|
|
570
|
+
receive(data: string | Uint8Array): Promise<void>;
|
|
571
|
+
close(code?: number, reason?: string): Promise<void>;
|
|
572
|
+
error(error: Error): Promise<void>;
|
|
573
|
+
}
|
|
558
574
|
interface FakeScheduleRecord {
|
|
559
575
|
name: string;
|
|
560
576
|
cron: string;
|
|
@@ -618,6 +634,7 @@ interface ExperimentalFakeHostRpcCall {
|
|
|
618
634
|
interface FakePluginRegistrations {
|
|
619
635
|
settingsDescriptors: PluginSettingDescriptors;
|
|
620
636
|
httpRoutes: FakeHttpRouteRecord[];
|
|
637
|
+
websocketRoutes: ExperimentalFakeWebSocketRouteRecord[];
|
|
621
638
|
rpcMethods: string[];
|
|
622
639
|
services: FakeServiceRecord[];
|
|
623
640
|
schedules: FakeScheduleRecord[];
|
|
@@ -639,6 +656,8 @@ interface FakePluginRegistrations {
|
|
|
639
656
|
/** Live provider registrations from `bb.providers.register`
|
|
640
657
|
* (normalized declarations, registration order; dispose removes). */
|
|
641
658
|
providerRegistrations: NormalizedPluginProviderDeclaration[];
|
|
659
|
+
providerEnvResolvers: ReadonlyMap<string, (context: ExperimentalPluginProviderEnvContext) => Promise<readonly ExperimentalPluginProviderEnvEntry[]> | readonly ExperimentalPluginProviderEnvEntry[]>;
|
|
660
|
+
providerEnvHealthResolvers: ReadonlyMap<string, (context: ExperimentalPluginProviderEnvHealthContext) => ExperimentalPluginProviderEnvHealth | null | Promise<ExperimentalPluginProviderEnvHealth | null>>;
|
|
642
661
|
/** Live AI-service registrations from `experimental_aiServices.register`
|
|
643
662
|
* (normalized declarations, registration order; dispose removes). */
|
|
644
663
|
aiServiceRegistrations: PluginAiServiceDeclaration[];
|
|
@@ -705,6 +724,8 @@ interface FakePluginBehaviorDrivers {
|
|
|
705
724
|
* `{ ok: false, error: "plugin route failed: …" }` response.
|
|
706
725
|
*/
|
|
707
726
|
fetchHttp(method: string, path: string, init?: RequestInit): Promise<Response>;
|
|
727
|
+
/** Open and drive an exact-match `bb.http.experimental_websocket` route. */
|
|
728
|
+
experimental_openWebSocket(path: string, init?: RequestInit): Promise<ExperimentalFakeWebSocketSession>;
|
|
708
729
|
/**
|
|
709
730
|
* Start a registered background service once, deterministically. `done`
|
|
710
731
|
* settles when `start` returns; abort `controller` to signal shutdown.
|
|
@@ -741,6 +762,8 @@ interface FakePluginBehaviorDrivers {
|
|
|
741
762
|
skills: string[];
|
|
742
763
|
instructions: string | null;
|
|
743
764
|
}>;
|
|
765
|
+
resolveProviderEnv(providerId: string, context: ExperimentalPluginProviderEnvContext): Promise<ExperimentalPluginProviderEnvEntry[]>;
|
|
766
|
+
resolveProviderEnvHealth(providerId: string, context: ExperimentalPluginProviderEnvHealthContext): Promise<ExperimentalPluginProviderEnvHealth | null>;
|
|
744
767
|
}
|
|
745
768
|
/** Reload/shutdown controls, kept separate from behavior and inspection. */
|
|
746
769
|
interface FakePluginLifecycleControls {
|
|
@@ -827,6 +850,26 @@ declare function createFakePluginHost(options?: CreateFakePluginHostOptions): Fa
|
|
|
827
850
|
type ThreadResponse = PluginThreadEventPayloads["thread.created"]["thread"];
|
|
828
851
|
type QueueEntry = PluginThreadEventPayloads["message.queued"]["entry"];
|
|
829
852
|
type TurnFailedEvent = PluginThreadEventPayloads["turn.failed"];
|
|
853
|
+
type PluginAgentConfigurationContextOverrides = {
|
|
854
|
+
thread?: Partial<PluginAgentConfigurationContext["thread"]>;
|
|
855
|
+
project?: Partial<PluginAgentConfigurationContext["project"]>;
|
|
856
|
+
environment?: Partial<PluginAgentConfigurationContext["environment"]>;
|
|
857
|
+
host?: Partial<PluginAgentConfigurationContext["host"]>;
|
|
858
|
+
provider?: Omit<Partial<PluginAgentConfigurationContext["provider"]>, "capabilities"> & {
|
|
859
|
+
capabilities?: Partial<PluginAgentConfigurationContext["provider"]["capabilities"]>;
|
|
860
|
+
};
|
|
861
|
+
origin?: Partial<PluginAgentConfigurationContext["origin"]>;
|
|
862
|
+
};
|
|
863
|
+
type MessageDispatchHookContextOverrides = Omit<Partial<MessageDispatchHookContext>, "environment" | "executionSources" | "host" | "input" | "project" | "queuedMessage" | "requestedExecution" | "thread"> & {
|
|
864
|
+
thread?: Partial<MessageDispatchHookContext["thread"]>;
|
|
865
|
+
project?: Partial<MessageDispatchHookContext["project"]>;
|
|
866
|
+
environment?: Partial<NonNullable<MessageDispatchHookContext["environment"]>> | null;
|
|
867
|
+
host?: Partial<NonNullable<MessageDispatchHookContext["host"]>> | null;
|
|
868
|
+
input?: Partial<MessageDispatchHookContext["input"]>;
|
|
869
|
+
requestedExecution?: Partial<MessageDispatchHookContext["requestedExecution"]>;
|
|
870
|
+
executionSources?: Partial<MessageDispatchHookContext["executionSources"]>;
|
|
871
|
+
queuedMessage?: Partial<NonNullable<MessageDispatchHookContext["queuedMessage"]>> | null;
|
|
872
|
+
};
|
|
830
873
|
/**
|
|
831
874
|
* A complete, deterministic `ThreadResponse` for thread lifecycle event
|
|
832
875
|
* payloads (`harness.emitThreadEvent`). Defaults are the minimal idle
|
|
@@ -834,6 +877,20 @@ type TurnFailedEvent = PluginThreadEventPayloads["turn.failed"];
|
|
|
834
877
|
* required field, this builder fails typecheck — update the default here.
|
|
835
878
|
*/
|
|
836
879
|
declare function makeThreadResponse(overrides?: Partial<ThreadResponse>): ThreadResponse;
|
|
880
|
+
/**
|
|
881
|
+
* A complete, deterministic context for conditional agent configuration.
|
|
882
|
+
* Defaults describe a standard project on an unmanaged local environment;
|
|
883
|
+
* override the fields the test cares about. If the contract grows a required
|
|
884
|
+
* field, this builder fails typecheck — update the default here.
|
|
885
|
+
*/
|
|
886
|
+
declare function makePluginAgentConfigurationContext(overrides?: PluginAgentConfigurationContextOverrides): PluginAgentConfigurationContext;
|
|
887
|
+
/**
|
|
888
|
+
* A complete, deterministic context for the `message.dispatch` hook. Defaults
|
|
889
|
+
* describe a first inline dispatch before an environment or host is selected;
|
|
890
|
+
* override the fields the test cares about. If the contract grows a required
|
|
891
|
+
* field, this builder fails typecheck — update the default here.
|
|
892
|
+
*/
|
|
893
|
+
declare function makeMessageDispatchHookContext(overrides?: MessageDispatchHookContextOverrides): MessageDispatchHookContext;
|
|
837
894
|
/**
|
|
838
895
|
* A complete, deterministic queued row for the `message.*` event payloads
|
|
839
896
|
* and for faking `sdk.threads.queuedMessages.list`. Defaults are a live inline
|
|
@@ -880,5 +937,5 @@ interface PublicSdkOnlyScan {
|
|
|
880
937
|
*/
|
|
881
938
|
declare function scanPublicSdkOnly(packageRoot: string, options?: PublicSdkOnlyScanOptions): PublicSdkOnlyScan;
|
|
882
939
|
|
|
883
|
-
export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
|
|
940
|
+
export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeMessageDispatchHookContext, makePluginAgentConfigurationContext, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
|
|
884
941
|
export type { CreateFakePluginHostOptions, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };
|