@get-bb/plugin-sdk 0.6.150 → 0.6.164
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 +4 -1
- package/bundled-types/bb-plugin-sdk-app.d.ts +707 -86
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +3 -0
- package/bundled-types/bb-plugin-sdk-host.d.ts +4 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +3 -0
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +6 -3
- package/bundled-types/bb-plugin-sdk-internal-thread-event-gate.d.ts +1001 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +56 -6
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +56 -6
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +45 -8
- package/bundled-types/bb-plugin-sdk-testing.d.ts +104 -20
- package/bundled-types/bb-plugin-sdk.d.ts +869 -300
- package/dist/app.js +8 -0
- package/dist/host.js +27 -3
- package/dist/index.js +19 -1
- package/dist/internal/host-policy.js +24 -2
- package/dist/internal/plugin-app-collector.js +20 -0
- package/dist/internal/rpc-query-host.js +1 -0
- package/dist/internal/thread-event-gate.js +95 -0
- package/dist/process.js +7 -1
- package/dist/provider-bridge-acp-next.js +503 -144
- package/dist/provider-bridge-acp.js +503 -144
- package/dist/provider-bridge-testing.js +21 -7
- package/dist/provider-bridge-worker-entry.mjs +9 -3
- package/dist/provider-bridge.js +124 -37
- package/dist/replay-provider-child.mjs +158 -31
- package/dist/testing/app.js +627 -347
- package/dist/testing/index.js +432 -77
- package/package.json +9 -1
|
@@ -359,7 +359,7 @@ declare const acpToolCallContentSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
359
359
|
}, z.core.$loose>]>;
|
|
360
360
|
type AcpToolCallContent = z.infer<typeof acpToolCallContentSchema>;
|
|
361
361
|
declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
362
|
-
content: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
|
|
362
|
+
content: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
|
|
363
363
|
[x: string]: unknown;
|
|
364
364
|
type: "content";
|
|
365
365
|
content: {
|
|
@@ -380,7 +380,49 @@ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
380
380
|
[x: string]: unknown;
|
|
381
381
|
type: "terminal";
|
|
382
382
|
terminalId: string;
|
|
383
|
-
})[], unknown[]
|
|
383
|
+
})[], unknown[]>>>, z.ZodTransform<({
|
|
384
|
+
[x: string]: unknown;
|
|
385
|
+
type: "content";
|
|
386
|
+
content: {
|
|
387
|
+
[x: string]: unknown;
|
|
388
|
+
type: "text";
|
|
389
|
+
text: string;
|
|
390
|
+
} | {
|
|
391
|
+
[x: string]: unknown;
|
|
392
|
+
type: string;
|
|
393
|
+
};
|
|
394
|
+
} | {
|
|
395
|
+
[x: string]: unknown;
|
|
396
|
+
type: "diff";
|
|
397
|
+
path: string;
|
|
398
|
+
newText: string;
|
|
399
|
+
oldText?: string | null | undefined;
|
|
400
|
+
} | {
|
|
401
|
+
[x: string]: unknown;
|
|
402
|
+
type: "terminal";
|
|
403
|
+
terminalId: string;
|
|
404
|
+
})[] | undefined, ({
|
|
405
|
+
[x: string]: unknown;
|
|
406
|
+
type: "content";
|
|
407
|
+
content: {
|
|
408
|
+
[x: string]: unknown;
|
|
409
|
+
type: "text";
|
|
410
|
+
text: string;
|
|
411
|
+
} | {
|
|
412
|
+
[x: string]: unknown;
|
|
413
|
+
type: string;
|
|
414
|
+
};
|
|
415
|
+
} | {
|
|
416
|
+
[x: string]: unknown;
|
|
417
|
+
type: "diff";
|
|
418
|
+
path: string;
|
|
419
|
+
newText: string;
|
|
420
|
+
oldText?: string | null | undefined;
|
|
421
|
+
} | {
|
|
422
|
+
[x: string]: unknown;
|
|
423
|
+
type: "terminal";
|
|
424
|
+
terminalId: string;
|
|
425
|
+
})[] | null>>>;
|
|
384
426
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
385
427
|
delete: "delete";
|
|
386
428
|
edit: "edit";
|
|
@@ -393,11 +435,19 @@ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
393
435
|
switch_mode: "switch_mode";
|
|
394
436
|
think: "think";
|
|
395
437
|
}>>;
|
|
396
|
-
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
438
|
+
locations: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
397
439
|
line: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
398
440
|
path: z.ZodString;
|
|
399
|
-
}, z.core.$loose
|
|
400
|
-
|
|
441
|
+
}, z.core.$loose>>>, z.ZodTransform<{
|
|
442
|
+
[x: string]: unknown;
|
|
443
|
+
path: string;
|
|
444
|
+
line?: number | null | undefined;
|
|
445
|
+
}[] | undefined, {
|
|
446
|
+
[x: string]: unknown;
|
|
447
|
+
path: string;
|
|
448
|
+
line?: number | null | undefined;
|
|
449
|
+
}[] | null>>>;
|
|
450
|
+
name: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
401
451
|
rawInput: z.ZodOptional<z.ZodUnknown>;
|
|
402
452
|
rawKind: z.ZodOptional<z.ZodString>;
|
|
403
453
|
rawOutput: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -412,7 +462,7 @@ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
412
462
|
in_progress: "in_progress";
|
|
413
463
|
pending: "pending";
|
|
414
464
|
}>>;
|
|
415
|
-
title: z.ZodOptional<z.ZodString
|
|
465
|
+
title: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
416
466
|
toolCallId: z.ZodString;
|
|
417
467
|
}, z.core.$loose>, unknown>;
|
|
418
468
|
type AcpToolCallUpdateEvent = z.infer<typeof acpToolCallUpdateEventSchema>;
|
|
@@ -359,7 +359,7 @@ declare const acpToolCallContentSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
359
359
|
}, z.core.$loose>]>;
|
|
360
360
|
type AcpToolCallContent = z.infer<typeof acpToolCallContentSchema>;
|
|
361
361
|
declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
362
|
-
content: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
|
|
362
|
+
content: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
|
|
363
363
|
[x: string]: unknown;
|
|
364
364
|
type: "content";
|
|
365
365
|
content: {
|
|
@@ -380,7 +380,49 @@ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
380
380
|
[x: string]: unknown;
|
|
381
381
|
type: "terminal";
|
|
382
382
|
terminalId: string;
|
|
383
|
-
})[], unknown[]
|
|
383
|
+
})[], unknown[]>>>, z.ZodTransform<({
|
|
384
|
+
[x: string]: unknown;
|
|
385
|
+
type: "content";
|
|
386
|
+
content: {
|
|
387
|
+
[x: string]: unknown;
|
|
388
|
+
type: "text";
|
|
389
|
+
text: string;
|
|
390
|
+
} | {
|
|
391
|
+
[x: string]: unknown;
|
|
392
|
+
type: string;
|
|
393
|
+
};
|
|
394
|
+
} | {
|
|
395
|
+
[x: string]: unknown;
|
|
396
|
+
type: "diff";
|
|
397
|
+
path: string;
|
|
398
|
+
newText: string;
|
|
399
|
+
oldText?: string | null | undefined;
|
|
400
|
+
} | {
|
|
401
|
+
[x: string]: unknown;
|
|
402
|
+
type: "terminal";
|
|
403
|
+
terminalId: string;
|
|
404
|
+
})[] | undefined, ({
|
|
405
|
+
[x: string]: unknown;
|
|
406
|
+
type: "content";
|
|
407
|
+
content: {
|
|
408
|
+
[x: string]: unknown;
|
|
409
|
+
type: "text";
|
|
410
|
+
text: string;
|
|
411
|
+
} | {
|
|
412
|
+
[x: string]: unknown;
|
|
413
|
+
type: string;
|
|
414
|
+
};
|
|
415
|
+
} | {
|
|
416
|
+
[x: string]: unknown;
|
|
417
|
+
type: "diff";
|
|
418
|
+
path: string;
|
|
419
|
+
newText: string;
|
|
420
|
+
oldText?: string | null | undefined;
|
|
421
|
+
} | {
|
|
422
|
+
[x: string]: unknown;
|
|
423
|
+
type: "terminal";
|
|
424
|
+
terminalId: string;
|
|
425
|
+
})[] | null>>>;
|
|
384
426
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
385
427
|
delete: "delete";
|
|
386
428
|
edit: "edit";
|
|
@@ -393,11 +435,19 @@ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
393
435
|
switch_mode: "switch_mode";
|
|
394
436
|
think: "think";
|
|
395
437
|
}>>;
|
|
396
|
-
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
438
|
+
locations: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
397
439
|
line: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
398
440
|
path: z.ZodString;
|
|
399
|
-
}, z.core.$loose
|
|
400
|
-
|
|
441
|
+
}, z.core.$loose>>>, z.ZodTransform<{
|
|
442
|
+
[x: string]: unknown;
|
|
443
|
+
path: string;
|
|
444
|
+
line?: number | null | undefined;
|
|
445
|
+
}[] | undefined, {
|
|
446
|
+
[x: string]: unknown;
|
|
447
|
+
path: string;
|
|
448
|
+
line?: number | null | undefined;
|
|
449
|
+
}[] | null>>>;
|
|
450
|
+
name: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
401
451
|
rawInput: z.ZodOptional<z.ZodUnknown>;
|
|
402
452
|
rawKind: z.ZodOptional<z.ZodString>;
|
|
403
453
|
rawOutput: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -412,7 +462,7 @@ declare const acpToolCallUpdateEventSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
412
462
|
in_progress: "in_progress";
|
|
413
463
|
pending: "pending";
|
|
414
464
|
}>>;
|
|
415
|
-
title: z.ZodOptional<z.ZodString
|
|
465
|
+
title: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
416
466
|
toolCallId: z.ZodString;
|
|
417
467
|
}, z.core.$loose>, unknown>;
|
|
418
468
|
type AcpToolCallUpdateEvent = z.infer<typeof acpToolCallUpdateEventSchema>;
|
|
@@ -1598,7 +1598,7 @@ declare function reasoningEffortsForLevels(levels: readonly ReasoningLevel[]): M
|
|
|
1598
1598
|
|
|
1599
1599
|
declare function toOptionalString(value: unknown): string | undefined;
|
|
1600
1600
|
declare function toOptionalRecord(value: unknown): Record<string, unknown> | undefined;
|
|
1601
|
-
declare function buildShellEnvOverrides(envVars?: Record<string, string
|
|
1601
|
+
declare function buildShellEnvOverrides(envVars?: Readonly<Record<string, string>>): Record<string, string>;
|
|
1602
1602
|
declare function toNonNegativeNumber(value: unknown): number;
|
|
1603
1603
|
declare function normalizeProviderCommandOutput(args: {
|
|
1604
1604
|
emptyPlaceholders: readonly string[];
|
|
@@ -1707,6 +1707,7 @@ declare function experimental_recordProviderChildIo(child: BridgeRecorderChildSt
|
|
|
1707
1707
|
}): void;
|
|
1708
1708
|
|
|
1709
1709
|
declare function withoutBridgeRuntimeEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
1710
|
+
declare function buildProviderCliEnv(envVars: Readonly<Record<string, string>> | undefined): NodeJS.ProcessEnv;
|
|
1710
1711
|
|
|
1711
1712
|
interface BridgeToolCallRequest {
|
|
1712
1713
|
jsonrpc: "2.0";
|
|
@@ -4053,6 +4054,7 @@ declare function experimental_defineProviderBridge(definition: ProviderBridgeDef
|
|
|
4053
4054
|
|
|
4054
4055
|
declare const providerMaintenanceParamsSchema: z.ZodObject<{
|
|
4055
4056
|
cwd: z.ZodOptional<z.ZodString>;
|
|
4057
|
+
envVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
4056
4058
|
providerId: z.ZodString;
|
|
4057
4059
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4058
4060
|
}, z.core.$loose>;
|
|
@@ -4064,6 +4066,7 @@ type ProviderInstallationRequirement = z.infer<typeof providerInstallationRequir
|
|
|
4064
4066
|
declare const providerInstallationStatusParamsSchema: z.ZodObject<{
|
|
4065
4067
|
checkUpdates: z.ZodDefault<z.ZodBoolean>;
|
|
4066
4068
|
cwd: z.ZodOptional<z.ZodString>;
|
|
4069
|
+
envVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
4067
4070
|
providerId: z.ZodString;
|
|
4068
4071
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4069
4072
|
requirement: z.ZodOptional<z.ZodEnum<{
|
|
@@ -4243,6 +4246,7 @@ declare const providerInstallationRunParamsSchema: z.ZodObject<{
|
|
|
4243
4246
|
update: "update";
|
|
4244
4247
|
}>;
|
|
4245
4248
|
cwd: z.ZodOptional<z.ZodString>;
|
|
4249
|
+
envVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
4246
4250
|
providerId: z.ZodString;
|
|
4247
4251
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4248
4252
|
}, z.core.$loose>;
|
|
@@ -4285,20 +4289,20 @@ declare const providerInstallationRunResultSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
4285
4289
|
}, z.core.$loose>], "available">;
|
|
4286
4290
|
type ProviderInstallationRunResult = z.infer<typeof providerInstallationRunResultSchema>;
|
|
4287
4291
|
|
|
4288
|
-
declare function resolveExecutablePath(command: string): Promise<string | null>;
|
|
4289
|
-
declare function commandOutput(command: string, args: readonly string[]): Promise<string | null>;
|
|
4292
|
+
declare function resolveExecutablePath(command: string, env?: NodeJS.ProcessEnv): Promise<string | null>;
|
|
4293
|
+
declare function commandOutput(command: string, args: readonly string[], env?: NodeJS.ProcessEnv): Promise<string | null>;
|
|
4290
4294
|
declare function versionFrom(value: string | null): string | null;
|
|
4291
|
-
declare function readCliVersion(command: string): Promise<string | null>;
|
|
4295
|
+
declare function readCliVersion(command: string, env?: NodeJS.ProcessEnv): Promise<string | null>;
|
|
4292
4296
|
declare function compareVersions(left: string, right: string): number;
|
|
4293
4297
|
declare function npmCommand(): string;
|
|
4294
4298
|
declare function formatCommand(command: string, args: readonly string[]): string;
|
|
4295
4299
|
declare function npmGlobalInstallCommand(npmPackage: string): ProviderInstallationCommand;
|
|
4296
|
-
declare function npmLatestVersion(npmPackage: string): Promise<string | null>;
|
|
4300
|
+
declare function npmLatestVersion(npmPackage: string, env?: NodeJS.ProcessEnv): Promise<string | null>;
|
|
4297
4301
|
interface NpmGlobalPackageProbe {
|
|
4298
4302
|
npmBin: string | null;
|
|
4299
4303
|
npmGlobalPackageVersion: string | null;
|
|
4300
4304
|
}
|
|
4301
|
-
declare function probeNpmGlobalPackage(npmPackage: string): Promise<NpmGlobalPackageProbe>;
|
|
4305
|
+
declare function probeNpmGlobalPackage(npmPackage: string, env?: NodeJS.ProcessEnv): Promise<NpmGlobalPackageProbe>;
|
|
4302
4306
|
declare function npmGlobalInstallSource(args: {
|
|
4303
4307
|
installed: boolean;
|
|
4304
4308
|
executablePath: string | null;
|
|
@@ -4332,6 +4336,7 @@ declare class ProviderResponseEncodeError extends Error {
|
|
|
4332
4336
|
readonly code = -32602;
|
|
4333
4337
|
constructor(message: string);
|
|
4334
4338
|
}
|
|
4339
|
+
declare function serializeJsonRpcLine(message: object): string;
|
|
4335
4340
|
|
|
4336
4341
|
type ProviderRawEventCoverage = "noise" | "normalized" | "unknown";
|
|
4337
4342
|
interface ProviderRawEventDescription {
|
|
@@ -4369,6 +4374,36 @@ declare const textBlockSchema: z.ZodObject<{
|
|
|
4369
4374
|
type: z.ZodLiteral<"text">;
|
|
4370
4375
|
}, z.core.$strip>;
|
|
4371
4376
|
|
|
4377
|
+
type UnansweredInteractionCause = {
|
|
4378
|
+
kind: "unshowable-request";
|
|
4379
|
+
detail: string;
|
|
4380
|
+
} | {
|
|
4381
|
+
kind: "runtime-error";
|
|
4382
|
+
message: string;
|
|
4383
|
+
} | {
|
|
4384
|
+
kind: "unreadable-resolution";
|
|
4385
|
+
} | {
|
|
4386
|
+
kind: "unmappable-answer";
|
|
4387
|
+
detail: string;
|
|
4388
|
+
} | {
|
|
4389
|
+
kind: "withdrawn";
|
|
4390
|
+
detail: string;
|
|
4391
|
+
};
|
|
4392
|
+
type UnansweredInteractionAnswer = {
|
|
4393
|
+
kind: "error";
|
|
4394
|
+
} | {
|
|
4395
|
+
kind: "value";
|
|
4396
|
+
value: string;
|
|
4397
|
+
};
|
|
4398
|
+
interface UnansweredInteractionWarningArgs {
|
|
4399
|
+
cause: UnansweredInteractionCause;
|
|
4400
|
+
answer: UnansweredInteractionAnswer;
|
|
4401
|
+
}
|
|
4402
|
+
declare function unansweredInteractionErrorMessage(cause: UnansweredInteractionCause): string;
|
|
4403
|
+
declare function unansweredInteractionWarning(args: UnansweredInteractionWarningArgs): Extract<ThreadDelta, {
|
|
4404
|
+
kind: "provider.warning";
|
|
4405
|
+
}>;
|
|
4406
|
+
|
|
4372
4407
|
declare const PROVIDER_BRIDGE_PROTOCOL_VERSION: 2;
|
|
4373
4408
|
declare const THREAD_DELTA_GRAMMAR_V2: 2;
|
|
4374
4409
|
declare const THREAD_DELTA_GRAMMAR_V3: 3;
|
|
@@ -4507,6 +4542,7 @@ declare const modelListParamsSchema: z.ZodObject<{
|
|
|
4507
4542
|
}, z.core.$loose>;
|
|
4508
4543
|
declare const commandListParamsSchema: z.ZodObject<{
|
|
4509
4544
|
cwd: z.ZodString;
|
|
4545
|
+
envVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
4510
4546
|
}, z.core.$loose>;
|
|
4511
4547
|
declare const commandListResultSchema: z.ZodObject<{
|
|
4512
4548
|
commands: z.ZodArray<z.ZodObject<{
|
|
@@ -5118,6 +5154,7 @@ declare const BRIDGE_NOTIFICATION_METHODS: {
|
|
|
5118
5154
|
readonly providerRaw: "provider/raw";
|
|
5119
5155
|
readonly providerRecovery: "provider/recovery";
|
|
5120
5156
|
readonly error: "error";
|
|
5157
|
+
readonly requestCancelled: "notifications/cancelled";
|
|
5121
5158
|
};
|
|
5122
5159
|
declare const providerRecoveryNotificationSchema: z.ZodObject<{
|
|
5123
5160
|
kind: z.ZodEnum<{
|
|
@@ -5294,5 +5331,5 @@ declare function selectedSkillMentions(input: {
|
|
|
5294
5331
|
mentions: readonly SkillMentionCandidate[];
|
|
5295
5332
|
}): SelectedSkillMention[];
|
|
5296
5333
|
|
|
5297
|
-
export { BRIDGE_INBOUND_REQUEST_METHODS, BRIDGE_JSON_RPC_ERRORS, BRIDGE_NOTIFICATION_METHODS, BRIDGE_REQUEST_METHODS, HIGH_REASONING_EFFORT, LOCAL_BASH_TASK_TYPE, LOCAL_WORKFLOW_TASK_TYPE, LOW_REASONING_EFFORT, MAX_REASONING_EFFORT, MEDIUM_REASONING_EFFORT, PLUGIN_INTERACTION_MAX_TITLE_LENGTH, PROVIDER_BRIDGE_EXPORT_NAME, PROVIDER_BRIDGE_PROTOCOL_VERSION, ProviderRequestDecodeError, ProviderResponseEncodeError, THREAD_DELTA_GRAMMAR_V2, THREAD_DELTA_GRAMMAR_V3, THREAD_DELTA_NOTIFICATION_METHOD, ULTRACODE_REASONING_EFFORT, USER_QUESTION_MAX_OPTIONS, USER_QUESTION_MAX_QUESTIONS, XHIGH_REASONING_EFFORT, ZERO_TOKEN_USAGE, acpNativeReasoningSchema, acpPermissionCliSchema, acpReasoningCliSchema, addTokenUsage, approvalInteractionOutcomeSchema, backgroundTaskItemStatus, bashArgsSchema, bridgeCapabilitiesSchema, bridgeErrorDataSchema, bridgeGrammarVersionsSchema, bridgeRequestEnvelopeSchema, bridgeSteerModeSchema, buildShellEnvOverrides, claudeTaskToolNameSchema, claudeTaskToolOutputSchema, commandListParamsSchema, commandListResultSchema, contextSnapshotSchema, createBridgeIo, createBridgeLineHandler, createPendingToolCallTracker, createProviderVisibilityMetadata, decodeBridgeJsonRpcResponse, decodeToolCallResponsePayload, deltaBackgroundTaskShapeSchema, deltaDelegationShapeSchema, deltaExtensionShapeSchema, deltaFileChangeSchema, deltaFileReadShapeSchema, deltaItemKeySchema, deltaItemShapeSchema, deltaNoTurnFallbackSchema, deltaOutputChannelSchema, deltaPlanStepsShapeSchema, deltaPresentationSchema, deltaProgressSnapshotSchema, deltaSearchShapeSchema, deltaTextChannelSchema, dynamicToolSchema, errorEnvelopeSchema, BridgeRecoveryError as experimental_BridgeRecoveryError, COMPACTION_PRESENTATION as experimental_COMPACTION_PRESENTATION, REASONING_PRESENTATION as experimental_REASONING_PRESENTATION, buildBridgeToolCallContent as experimental_buildBridgeToolCallContent, clampPercent as experimental_clampPercent, commandOutput as experimental_commandOutput, compareVersions as experimental_compareVersions, experimental_defineProviderBridge, downloadedInstallerCommand as experimental_downloadedInstallerCommand, fileReadPresentation as experimental_fileReadPresentation, formatCommand as experimental_formatCommand, installationVerification as experimental_installationVerification, experimental_isProviderBridgeRecording, killPortableProcess as experimental_killPortableProcess, npmCommand as experimental_npmCommand, npmGlobalInstallCommand as experimental_npmGlobalInstallCommand, npmGlobalInstallSource as experimental_npmGlobalInstallSource, npmLatestVersion as experimental_npmLatestVersion, planStepsPresentation as experimental_planStepsPresentation, presentationDetail as experimental_presentationDetail, presentationFileName as experimental_presentationFileName, presentationTitle as experimental_presentationTitle, probeNpmGlobalPackage as experimental_probeNpmGlobalPackage, readBoundedLines as experimental_readBoundedLines, readCliVersion as experimental_readCliVersion, experimental_recordProviderChildIo, resolveExecutablePath as experimental_resolveExecutablePath, scanSkillFiles as experimental_scanSkillFiles, searchPresentation as experimental_searchPresentation, selectedSkillMentions as experimental_selectedSkillMentions, spawnPortableProcess as experimental_spawnPortableProcess, toolPresentation as experimental_toolPresentation, versionFrom as experimental_versionFrom, webFetchPresentation as experimental_webFetchPresentation, webSearchPresentation as experimental_webSearchPresentation, withTitle as experimental_withTitle, extensionKindSchema, extractResultText, getRawSdkMessage, getRecordProperty, getStringProperty, acpLaunchSpecSchema as hostDaemonAcpLaunchSpecSchema, initializeParamsSchema, instructionModeValues, interactionRequestPayloadSchema, isApprovalInteractionOutcome, isApprovalPendingInteractionPayload, isApprovalPendingInteractionResolution, isBackgroundAgentTaskType, isExtensionKind, isRecord, isSettledBackgroundTaskStatus, isStandaloneBuiltinCompactCommand, isUserQuestionPendingInteractionPayload, isUserQuestionPendingInteractionResolution, jsonRpcEnvelopeSchema, jsonValueSchema, mimeTypeFromExtension, modelListParamsSchema, normalizeAcpLaunchSpec as normalizeHostDaemonAcpLaunchSpec, normalizeProviderCommandOutput, pendingInteractionCommandActionSchema, pendingInteractionFileSystemPermissionsSchema, pendingInteractionMacOsPermissionsSchema, pendingInteractionNetworkPermissionsSchema, pendingInteractionRequestedPermissionProfileSchema, pendingInteractionResolutionSchema, permissionEscalationValues, providerHealthResultSchema, providerHealthSchema, providerInstallationActionKindSchema, providerInstallationActionSchema, providerInstallationCommandSchema, providerInstallationRequirementSchema, providerInstallationRunParamsSchema, providerInstallationRunResultSchema, providerInstallationSourceSchema, providerInstallationStatusParamsSchema, providerInstallationStatusSchema, providerInstallationVerificationSchema, providerInteractionOutcomeSchema, providerMaintenanceParamsSchema, providerRawEventSchema, providerRecoveryHintSchema, providerRecoveryKindSchema, providerRecoveryKindValues, providerRecoveryNotificationSchema, providerUsageResultSchema, providerUsageSchema, providerUsageWindowSchema, reasoningEffortsForLevels, reasoningLevelSchema, reasoningLevelValues, removeCommandMentionsFromPromptInput, runBridgeRequest, runtimePermissionScopeValues, sanitizeInheritedChildProcessEnv, sdkMessageEnvelopeSchema, shouldAutoDenyInteractiveRequest, skillsConfigureParamsSchema, textBlockSchema, threadArchiveParamsSchema, threadContextWindowUsageEnvelopeSchema, threadDeltaNotificationParamsSchema, threadDeltaSchema, threadDiscardParamsSchema, threadEventItemPresentationSchema, threadEventSearchModeSchema, threadForkParamsSchema, threadGoalClearParamsSchema, threadIdentityEnvelopeSchema, threadNameSetParamsSchema, threadResumeParamsSchema, threadStartParamsSchema, threadStopParamsSchema, threadUnarchiveParamsSchema, toNonNegativeNumber, toOptionalRecord, toOptionalString, toPositiveNumber, turnStartParamsSchema, turnSteerParamsSchema, userQuestionInteractionOutcomeSchema, withoutBridgeRuntimeEnv };
|
|
5298
|
-
export type { ApprovalInteractionOutcome, ApprovalPendingInteractionPayload, AvailableModel, BackgroundTaskStatus, BackgroundTaskUsage, BoundedLineReaderArgs, BridgeCapabilities, BridgeErrorData, BridgeExecutionOptions, BridgeGrammarVersions, BridgeJsonRpcResponse, BridgeSendError, BridgeSteerMode, BridgeToolCallRequest, BuildInteractiveResponseArgs, ClaudeTaskToolOutput, ClientTurnRequestId, ContextCategory, ContextEntry, ContextSnapshot, DecodedInteractiveRequest, DeltaBackgroundTaskShape, DeltaDelegationShape, DeltaExtensionShape, DeltaFileChange, DeltaFileReadShape, DeltaItemKey, DeltaItemShape, DeltaItemShapeType, DeltaNoTurnFallback, DeltaOutputChannel, DeltaPlanStepsShape, DeltaPresentation, DeltaProgressSnapshot, DeltaSearchShape, DeltaTextChannel, DynamicTool, IndexedSkillFile as ExperimentalIndexedSkillFile, SkillScanRoot as ExperimentalSkillScanRoot, ExtensionKind, AcpLaunchSpec as HostDaemonAcpLaunchSpec, InitializeResult, InstructionMode, InteractionRequestPayload, JsonObject, JsonRpcMessage, JsonValue, ModelReasoningEffort, ModelServiceTier, NpmGlobalPackageProbe, PendingInteractionApprovalDecision, PendingInteractionApprovalSubject, PendingInteractionCommandAction, PendingInteractionGrantablePermissionProfile, PendingInteractionGrantedPermissionProfile, PendingInteractionPayload, PendingInteractionRequestedPermissionProfile, PendingInteractionResolution, PendingInteractionUserQuestionQuestion, PermissionEscalation, PermissionMode, PreparedProviderCommandDispatch, PromptInput, ProviderBridgeContext, ProviderBridgeDefinition, ProviderBridgeEntry, ProviderErrorCategory, ProviderErrorInfo, ProviderHealth, ProviderHealthResult, ProviderInboundRequest, ProviderInstallationAction, ProviderInstallationActionKind, ProviderInstallationCommand, ProviderInstallationRequirement, ProviderInstallationRunParams, ProviderInstallationRunResult, ProviderInstallationSource, ProviderInstallationStatus, ProviderInstallationStatusParams, ProviderInstallationVerification, ProviderInteractionOutcome, ProviderMaintenanceParams, ProviderPostInitializeRequest, ProviderRateLimitState, ProviderRateLimitStatus, ProviderRateLimitWindow, ProviderRawEvent, ProviderRawEventCoverage, ProviderRawEventDescription, ProviderRecoveryHint, ProviderRecoveryKind, ProviderRecoveryNotification, ProviderRuntimeEvent, ProviderUsage, ProviderUsageResult, ProviderUsageWindow, ProviderVisibilityMetadata, ReasoningLevel, RuntimePermissionPolicy, RuntimePermissionScope, ServiceTier, ThreadDelta, ThreadDeltaKind, ThreadDeltaNotificationParams, ThreadEventContextWindowUsage, ThreadEventItemPresentation, ThreadEventItemStatus, ThreadEventPlanStep, ThreadEventSearchMode, ThreadEventTokenUsageBreakdown, ThreadEventTurnStatus, ThreadEventUserContent, UserQuestionInteractionOutcome, UserQuestionPendingInteractionPayload, UserQuestionPendingInteractionResolution, WorkflowAgentSnapshot, WorkflowAgentState, WorkflowPhaseSnapshot, WorkflowProgressSnapshot };
|
|
5334
|
+
export { BRIDGE_INBOUND_REQUEST_METHODS, BRIDGE_JSON_RPC_ERRORS, BRIDGE_NOTIFICATION_METHODS, BRIDGE_REQUEST_METHODS, HIGH_REASONING_EFFORT, LOCAL_BASH_TASK_TYPE, LOCAL_WORKFLOW_TASK_TYPE, LOW_REASONING_EFFORT, MAX_REASONING_EFFORT, MEDIUM_REASONING_EFFORT, PLUGIN_INTERACTION_MAX_TITLE_LENGTH, PROVIDER_BRIDGE_EXPORT_NAME, PROVIDER_BRIDGE_PROTOCOL_VERSION, ProviderRequestDecodeError, ProviderResponseEncodeError, THREAD_DELTA_GRAMMAR_V2, THREAD_DELTA_GRAMMAR_V3, THREAD_DELTA_NOTIFICATION_METHOD, ULTRACODE_REASONING_EFFORT, USER_QUESTION_MAX_OPTIONS, USER_QUESTION_MAX_QUESTIONS, XHIGH_REASONING_EFFORT, ZERO_TOKEN_USAGE, acpNativeReasoningSchema, acpPermissionCliSchema, acpReasoningCliSchema, addTokenUsage, approvalInteractionOutcomeSchema, backgroundTaskItemStatus, bashArgsSchema, bridgeCapabilitiesSchema, bridgeErrorDataSchema, bridgeGrammarVersionsSchema, bridgeRequestEnvelopeSchema, bridgeSteerModeSchema, buildShellEnvOverrides, claudeTaskToolNameSchema, claudeTaskToolOutputSchema, commandListParamsSchema, commandListResultSchema, contextSnapshotSchema, createBridgeIo, createBridgeLineHandler, createPendingToolCallTracker, createProviderVisibilityMetadata, decodeBridgeJsonRpcResponse, decodeToolCallResponsePayload, deltaBackgroundTaskShapeSchema, deltaDelegationShapeSchema, deltaExtensionShapeSchema, deltaFileChangeSchema, deltaFileReadShapeSchema, deltaItemKeySchema, deltaItemShapeSchema, deltaNoTurnFallbackSchema, deltaOutputChannelSchema, deltaPlanStepsShapeSchema, deltaPresentationSchema, deltaProgressSnapshotSchema, deltaSearchShapeSchema, deltaTextChannelSchema, dynamicToolSchema, errorEnvelopeSchema, BridgeRecoveryError as experimental_BridgeRecoveryError, COMPACTION_PRESENTATION as experimental_COMPACTION_PRESENTATION, REASONING_PRESENTATION as experimental_REASONING_PRESENTATION, buildBridgeToolCallContent as experimental_buildBridgeToolCallContent, buildProviderCliEnv as experimental_buildProviderCliEnv, clampPercent as experimental_clampPercent, commandOutput as experimental_commandOutput, compareVersions as experimental_compareVersions, experimental_defineProviderBridge, downloadedInstallerCommand as experimental_downloadedInstallerCommand, fileReadPresentation as experimental_fileReadPresentation, formatCommand as experimental_formatCommand, installationVerification as experimental_installationVerification, experimental_isProviderBridgeRecording, killPortableProcess as experimental_killPortableProcess, npmCommand as experimental_npmCommand, npmGlobalInstallCommand as experimental_npmGlobalInstallCommand, npmGlobalInstallSource as experimental_npmGlobalInstallSource, npmLatestVersion as experimental_npmLatestVersion, planStepsPresentation as experimental_planStepsPresentation, presentationDetail as experimental_presentationDetail, presentationFileName as experimental_presentationFileName, presentationTitle as experimental_presentationTitle, probeNpmGlobalPackage as experimental_probeNpmGlobalPackage, readBoundedLines as experimental_readBoundedLines, readCliVersion as experimental_readCliVersion, experimental_recordProviderChildIo, resolveExecutablePath as experimental_resolveExecutablePath, scanSkillFiles as experimental_scanSkillFiles, searchPresentation as experimental_searchPresentation, selectedSkillMentions as experimental_selectedSkillMentions, serializeJsonRpcLine as experimental_serializeJsonRpcLine, spawnPortableProcess as experimental_spawnPortableProcess, toolPresentation as experimental_toolPresentation, unansweredInteractionErrorMessage as experimental_unansweredInteractionErrorMessage, unansweredInteractionWarning as experimental_unansweredInteractionWarning, versionFrom as experimental_versionFrom, webFetchPresentation as experimental_webFetchPresentation, webSearchPresentation as experimental_webSearchPresentation, withTitle as experimental_withTitle, extensionKindSchema, extractResultText, getRawSdkMessage, getRecordProperty, getStringProperty, acpLaunchSpecSchema as hostDaemonAcpLaunchSpecSchema, initializeParamsSchema, instructionModeValues, interactionRequestPayloadSchema, isApprovalInteractionOutcome, isApprovalPendingInteractionPayload, isApprovalPendingInteractionResolution, isBackgroundAgentTaskType, isExtensionKind, isRecord, isSettledBackgroundTaskStatus, isStandaloneBuiltinCompactCommand, isUserQuestionPendingInteractionPayload, isUserQuestionPendingInteractionResolution, jsonRpcEnvelopeSchema, jsonValueSchema, mimeTypeFromExtension, modelListParamsSchema, normalizeAcpLaunchSpec as normalizeHostDaemonAcpLaunchSpec, normalizeProviderCommandOutput, pendingInteractionCommandActionSchema, pendingInteractionFileSystemPermissionsSchema, pendingInteractionMacOsPermissionsSchema, pendingInteractionNetworkPermissionsSchema, pendingInteractionRequestedPermissionProfileSchema, pendingInteractionResolutionSchema, permissionEscalationValues, providerHealthResultSchema, providerHealthSchema, providerInstallationActionKindSchema, providerInstallationActionSchema, providerInstallationCommandSchema, providerInstallationRequirementSchema, providerInstallationRunParamsSchema, providerInstallationRunResultSchema, providerInstallationSourceSchema, providerInstallationStatusParamsSchema, providerInstallationStatusSchema, providerInstallationVerificationSchema, providerInteractionOutcomeSchema, providerMaintenanceParamsSchema, providerRawEventSchema, providerRecoveryHintSchema, providerRecoveryKindSchema, providerRecoveryKindValues, providerRecoveryNotificationSchema, providerUsageResultSchema, providerUsageSchema, providerUsageWindowSchema, reasoningEffortsForLevels, reasoningLevelSchema, reasoningLevelValues, removeCommandMentionsFromPromptInput, runBridgeRequest, runtimePermissionScopeValues, sanitizeInheritedChildProcessEnv, sdkMessageEnvelopeSchema, shouldAutoDenyInteractiveRequest, skillsConfigureParamsSchema, textBlockSchema, threadArchiveParamsSchema, threadContextWindowUsageEnvelopeSchema, threadDeltaNotificationParamsSchema, threadDeltaSchema, threadDiscardParamsSchema, threadEventItemPresentationSchema, threadEventSearchModeSchema, threadForkParamsSchema, threadGoalClearParamsSchema, threadIdentityEnvelopeSchema, threadNameSetParamsSchema, threadResumeParamsSchema, threadStartParamsSchema, threadStopParamsSchema, threadUnarchiveParamsSchema, toNonNegativeNumber, toOptionalRecord, toOptionalString, toPositiveNumber, turnStartParamsSchema, turnSteerParamsSchema, userQuestionInteractionOutcomeSchema, withoutBridgeRuntimeEnv };
|
|
5335
|
+
export type { ApprovalInteractionOutcome, ApprovalPendingInteractionPayload, AvailableModel, BackgroundTaskStatus, BackgroundTaskUsage, BoundedLineReaderArgs, BridgeCapabilities, BridgeErrorData, BridgeExecutionOptions, BridgeGrammarVersions, BridgeJsonRpcResponse, BridgeSendError, BridgeSteerMode, BridgeToolCallRequest, BuildInteractiveResponseArgs, ClaudeTaskToolOutput, ClientTurnRequestId, ContextCategory, ContextEntry, ContextSnapshot, DecodedInteractiveRequest, DeltaBackgroundTaskShape, DeltaDelegationShape, DeltaExtensionShape, DeltaFileChange, DeltaFileReadShape, DeltaItemKey, DeltaItemShape, DeltaItemShapeType, DeltaNoTurnFallback, DeltaOutputChannel, DeltaPlanStepsShape, DeltaPresentation, DeltaProgressSnapshot, DeltaSearchShape, DeltaTextChannel, DynamicTool, IndexedSkillFile as ExperimentalIndexedSkillFile, SkillScanRoot as ExperimentalSkillScanRoot, ExtensionKind, AcpLaunchSpec as HostDaemonAcpLaunchSpec, InitializeResult, InstructionMode, InteractionRequestPayload, JsonObject, JsonRpcMessage, JsonValue, ModelReasoningEffort, ModelServiceTier, NpmGlobalPackageProbe, PendingInteractionApprovalDecision, PendingInteractionApprovalSubject, PendingInteractionCommandAction, PendingInteractionGrantablePermissionProfile, PendingInteractionGrantedPermissionProfile, PendingInteractionPayload, PendingInteractionRequestedPermissionProfile, PendingInteractionResolution, PendingInteractionUserQuestionQuestion, PermissionEscalation, PermissionMode, PreparedProviderCommandDispatch, PromptInput, ProviderBridgeContext, ProviderBridgeDefinition, ProviderBridgeEntry, ProviderErrorCategory, ProviderErrorInfo, ProviderHealth, ProviderHealthResult, ProviderInboundRequest, ProviderInstallationAction, ProviderInstallationActionKind, ProviderInstallationCommand, ProviderInstallationRequirement, ProviderInstallationRunParams, ProviderInstallationRunResult, ProviderInstallationSource, ProviderInstallationStatus, ProviderInstallationStatusParams, ProviderInstallationVerification, ProviderInteractionOutcome, ProviderMaintenanceParams, ProviderPostInitializeRequest, ProviderRateLimitState, ProviderRateLimitStatus, ProviderRateLimitWindow, ProviderRawEvent, ProviderRawEventCoverage, ProviderRawEventDescription, ProviderRecoveryHint, ProviderRecoveryKind, ProviderRecoveryNotification, ProviderRuntimeEvent, ProviderUsage, ProviderUsageResult, ProviderUsageWindow, ProviderVisibilityMetadata, ReasoningLevel, RuntimePermissionPolicy, RuntimePermissionScope, ServiceTier, ThreadDelta, ThreadDeltaKind, ThreadDeltaNotificationParams, ThreadEventContextWindowUsage, ThreadEventItemPresentation, ThreadEventItemStatus, ThreadEventPlanStep, ThreadEventSearchMode, ThreadEventTokenUsageBreakdown, ThreadEventTurnStatus, ThreadEventUserContent, UnansweredInteractionAnswer, UnansweredInteractionCause, UnansweredInteractionWarningArgs, UserQuestionInteractionOutcome, UserQuestionPendingInteractionPayload, UserQuestionPendingInteractionResolution, WorkflowAgentSnapshot, WorkflowAgentState, WorkflowPhaseSnapshot, WorkflowProgressSnapshot };
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
// Confused by the API, or need a symbol that isn't here? Clone the BB repo
|
|
6
6
|
// and read the real source: https://github.com/get-bb/bb
|
|
7
7
|
|
|
8
|
-
import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput as StandardSchemaV1InferOutput$1, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginRowPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginMentionProviderRegistration, ExperimentalPluginRpcCaller, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration,
|
|
8
|
+
import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput as StandardSchemaV1InferOutput$1, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginRowPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginMentionProviderRegistration, ExperimentalPluginRpcCaller, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, ExperimentalPanelController, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
+
import { ChildProcess } from 'node:child_process';
|
|
10
11
|
|
|
11
12
|
type PluginMachineProviderResource = Exclude<JsonValue$2, null>;
|
|
12
13
|
type PluginMachineProviderInputsSchema = StandardSchemaV1$1 | undefined;
|
|
@@ -180,6 +181,7 @@ declare const environmentSchema: z.ZodObject<{
|
|
|
180
181
|
teardown: z.ZodNullable<z.ZodObject<{
|
|
181
182
|
attempt: z.ZodNumber;
|
|
182
183
|
message: z.ZodOptional<z.ZodString>;
|
|
184
|
+
needsRecovery: z.ZodBoolean;
|
|
183
185
|
status: z.ZodEnum<{
|
|
184
186
|
failed: "failed";
|
|
185
187
|
removed: "removed";
|
|
@@ -228,6 +230,8 @@ declare const hostSchema: z.ZodObject<{
|
|
|
228
230
|
suspendedAt: z.ZodNullable<z.ZodNumber>;
|
|
229
231
|
teardown: z.ZodNullable<z.ZodObject<{
|
|
230
232
|
attempt: z.ZodNumber;
|
|
233
|
+
blockedByEnvironmentId: z.ZodNullable<z.ZodString>;
|
|
234
|
+
needsRecovery: z.ZodBoolean;
|
|
231
235
|
status: z.ZodEnum<{
|
|
232
236
|
failed: "failed";
|
|
233
237
|
removed: "removed";
|
|
@@ -1104,6 +1108,7 @@ interface FakeSdkHarness {
|
|
|
1104
1108
|
declare function createFakeSdk(options: {
|
|
1105
1109
|
pluginId: string;
|
|
1106
1110
|
overrides?: FakeSdkOverrides;
|
|
1111
|
+
trackThreadCreation?: <T>(call: () => Promise<T>) => Promise<T>;
|
|
1107
1112
|
}): {
|
|
1108
1113
|
sdk: BbSdk;
|
|
1109
1114
|
harness: FakeSdkHarness;
|
|
@@ -1259,13 +1264,6 @@ interface FakePluginRegistrations {
|
|
|
1259
1264
|
* (normalized declarations, registration order; dispose removes). */
|
|
1260
1265
|
aiServiceRegistrations: PluginAiServiceDeclaration[];
|
|
1261
1266
|
}
|
|
1262
|
-
/** One handle opened through `bb.server.internal_DO_NOT_USE_openTunnelIngress`. */
|
|
1263
|
-
interface InternalDoNotUseFakeTunnelIngress {
|
|
1264
|
-
readonly audience: string;
|
|
1265
|
-
readonly baseUrl: string;
|
|
1266
|
-
/** True once the plugin closed the handle or the host disposed it. */
|
|
1267
|
-
readonly closed: boolean;
|
|
1268
|
-
}
|
|
1269
1267
|
/** Read-only state for assertions after a plugin registers or handles work. */
|
|
1270
1268
|
interface FakePluginInspectionState {
|
|
1271
1269
|
readonly pluginId: string;
|
|
@@ -1294,19 +1292,10 @@ interface FakePluginInspectionState {
|
|
|
1294
1292
|
/** Recorded `bb.sdk` calls + stub control. */
|
|
1295
1293
|
readonly sdk: FakeSdkHarness;
|
|
1296
1294
|
readonly registrations: FakePluginRegistrations;
|
|
1297
|
-
/** Every `bb.server.internal_DO_NOT_USE_openTunnelIngress` handle, in order. */
|
|
1298
|
-
readonly internal_DO_NOT_USE_tunnelIngresses: readonly InternalDoNotUseFakeTunnelIngress[];
|
|
1299
1295
|
readonly sharedPortDeclarations: Array<{
|
|
1300
1296
|
hostId: string;
|
|
1301
1297
|
ports: number[];
|
|
1302
1298
|
}>;
|
|
1303
|
-
/** The last `bb.hosts.internal_DO_NOT_USE_setNextTunnels` config, or null. */
|
|
1304
|
-
readonly internal_DO_NOT_USE_nextTunnelConfig: InternalDoNotUsePluginNextTunnelConfig | null;
|
|
1305
|
-
/**
|
|
1306
|
-
* Replace what `bb.hosts.internal_DO_NOT_USE_nextTunnelStatuses` returns and call
|
|
1307
|
-
* every `internal_DO_NOT_USE_onNextTunnelStatusChange` listener.
|
|
1308
|
-
*/
|
|
1309
|
-
internal_DO_NOT_USE_setNextTunnelStatuses(statuses: readonly InternalDoNotUsePluginHostNextTunnelStatus[]): void;
|
|
1310
1299
|
/** Calls made through bb.hosts.experimental_client, after input validation. */
|
|
1311
1300
|
readonly experimental_hostRpcCalls: readonly ExperimentalFakeHostRpcCall[];
|
|
1312
1301
|
readonly pendingInteractions: readonly (PluginInteractionRequest & {
|
|
@@ -1384,7 +1373,14 @@ interface FakePluginBehaviorDrivers {
|
|
|
1384
1373
|
/**
|
|
1385
1374
|
* Deliver a thread lifecycle event to every `bb.events.on` handler. Handlers run
|
|
1386
1375
|
* sequentially; errors are caught and logged like the host's
|
|
1387
|
-
* fire-and-forget dispatch, and returned for assertions.
|
|
1376
|
+
* fire-and-forget dispatch, and returned for assertions. As on the server,
|
|
1377
|
+
* an event for a thread whose `createdAt` is at or after the start of a
|
|
1378
|
+
* pending `bb.sdk.threads.spawn` or `bb.sdk.threads.fork` waits until that
|
|
1379
|
+
* call has returned to the plugin, and the promise resolves once the
|
|
1380
|
+
* handlers have run. `thread.idle`, `thread.failed`, `thread.archived` and
|
|
1381
|
+
* `thread.deleted` are followed by their `experimental_thread.settled`
|
|
1382
|
+
* event as on the server; `message.cancelled` is not, because the fake has
|
|
1383
|
+
* no thread to attach, so emit the `cancelled` outcome directly.
|
|
1388
1384
|
*/
|
|
1389
1385
|
emitThreadEvent<E extends PluginThreadEventName>(event: E, payload: PluginThreadEventPayloads[E]): Promise<{
|
|
1390
1386
|
errors: unknown[];
|
|
@@ -1603,5 +1599,93 @@ interface PublicSdkOnlyScan {
|
|
|
1603
1599
|
*/
|
|
1604
1600
|
declare function scanPublicSdkOnly(packageRoot: string, options?: PublicSdkOnlyScanOptions): PublicSdkOnlyScan;
|
|
1605
1601
|
|
|
1606
|
-
|
|
1607
|
-
|
|
1602
|
+
interface ChildProcessTracker {
|
|
1603
|
+
readonly children: readonly ChildProcess[];
|
|
1604
|
+
running(): ChildProcess[];
|
|
1605
|
+
waitForExit(): Promise<void>;
|
|
1606
|
+
waitForClose(): Promise<void>;
|
|
1607
|
+
killRunning(signal?: NodeJS.Signals): void;
|
|
1608
|
+
dispose(): void;
|
|
1609
|
+
[Symbol.dispose](): void;
|
|
1610
|
+
}
|
|
1611
|
+
interface LifelineHolder {
|
|
1612
|
+
readonly label: string;
|
|
1613
|
+
readonly pid: number;
|
|
1614
|
+
readonly exited: Promise<void>;
|
|
1615
|
+
alive(): boolean;
|
|
1616
|
+
kill(signal?: NodeJS.Signals): boolean;
|
|
1617
|
+
}
|
|
1618
|
+
interface ProcessLifeline {
|
|
1619
|
+
readonly path: string;
|
|
1620
|
+
readonly holders: readonly LifelineHolder[];
|
|
1621
|
+
holdSource(label: string, onHeld?: string): string;
|
|
1622
|
+
waitForHolders(count: number): Promise<readonly LifelineHolder[]>;
|
|
1623
|
+
close(): Promise<void>;
|
|
1624
|
+
}
|
|
1625
|
+
interface DescendantPipe {
|
|
1626
|
+
readonly path: string;
|
|
1627
|
+
readonly opened: Promise<void>;
|
|
1628
|
+
readonly closed: Promise<void>;
|
|
1629
|
+
dispose(): Promise<void>;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Every `ChildProcess` spawned anywhere in this process (Node's
|
|
1634
|
+
* `child_process` diagnostics channel) after tracking starts. `children` lists
|
|
1635
|
+
* them in spawn order; `running()` excludes those with an exit code or signal;
|
|
1636
|
+
* `waitForExit()` resolves once all have exited, including any spawned while
|
|
1637
|
+
* waiting; `waitForClose()` also waits for each child's stdio to close, which
|
|
1638
|
+
* an unread piped stream can delay indefinitely; `killRunning()` signals the ones still running (SIGKILL by default);
|
|
1639
|
+
* `dispose()` stops recording.
|
|
1640
|
+
*/
|
|
1641
|
+
type ExperimentalChildProcessTracker = ChildProcessTracker;
|
|
1642
|
+
/**
|
|
1643
|
+
* A process connected to a lifeline. `pid` is the PID it reported, `label` the
|
|
1644
|
+
* label passed to `holdSource`. `exited` resolves and `alive()` turns false when
|
|
1645
|
+
* its connection closes, which the operating system does when it exits.
|
|
1646
|
+
* `kill(signal)` sends a signal (SIGKILL by default) only while the connection
|
|
1647
|
+
* is open, so a recycled PID is never signalled; it returns whether it sent.
|
|
1648
|
+
*/
|
|
1649
|
+
type ExperimentalLifelineHolder = LifelineHolder;
|
|
1650
|
+
/**
|
|
1651
|
+
* A local socket (a named pipe on Windows), at `path`, that processes the test
|
|
1652
|
+
* did not spawn itself connect to. `holdSource(label, onHeld?)` is a JavaScript
|
|
1653
|
+
* statement, with the path embedded, that connects the Node process running it;
|
|
1654
|
+
* embed it in a descendant's script. The optional `onHeld` statement runs once
|
|
1655
|
+
* the lifeline has registered the holder, for a script that blocks next.
|
|
1656
|
+
* `holders` lists connected processes in connection order, and
|
|
1657
|
+
* `waitForHolders(count)` resolves once that many have connected. `close()`
|
|
1658
|
+
* kills holders still connected, waits for them to exit, and removes the
|
|
1659
|
+
* socket.
|
|
1660
|
+
*/
|
|
1661
|
+
type ExperimentalProcessLifeline = ProcessLifeline;
|
|
1662
|
+
/**
|
|
1663
|
+
* Starts recording the child processes this process spawns, so a test can
|
|
1664
|
+
* assert that a process exited from its `ChildProcess` state instead of probing
|
|
1665
|
+
* a PID the operating system may have reused. Experimental: see
|
|
1666
|
+
* docs/api_to_audit.md.
|
|
1667
|
+
*/
|
|
1668
|
+
declare function experimental_trackChildProcesses(): ExperimentalChildProcessTracker;
|
|
1669
|
+
/**
|
|
1670
|
+
* Creates a lifeline for observing descendants and other processes the test
|
|
1671
|
+
* did not spawn, by the lifetime of a connection they hold rather than by PID.
|
|
1672
|
+
* Experimental: see docs/api_to_audit.md.
|
|
1673
|
+
*/
|
|
1674
|
+
declare function experimental_createProcessLifeline(): Promise<ExperimentalProcessLifeline>;
|
|
1675
|
+
/**
|
|
1676
|
+
* A POSIX named pipe at `path` for shell descendants that cannot run Node:
|
|
1677
|
+
* redirect one into it (`sleep 60 > "$pipe" &`). `opened` resolves once a
|
|
1678
|
+
* descendant has opened it for writing, and `closed` once every process holding
|
|
1679
|
+
* it has exited. `dispose()` releases a reader no descendant opened and removes
|
|
1680
|
+
* the pipe.
|
|
1681
|
+
*/
|
|
1682
|
+
type ExperimentalDescendantPipe = DescendantPipe;
|
|
1683
|
+
/**
|
|
1684
|
+
* Creates a named pipe that observes shell descendants by the lifetime of the
|
|
1685
|
+
* write end they inherit, with no startup cost of its own. POSIX only; it
|
|
1686
|
+
* throws on Windows. Experimental: see docs/api_to_audit.md.
|
|
1687
|
+
*/
|
|
1688
|
+
declare function experimental_createDescendantPipe(): Promise<ExperimentalDescendantPipe>;
|
|
1689
|
+
|
|
1690
|
+
export { PluginContextStaleError, createFakePluginHost, createFakeSdk, experimental_createDescendantPipe, experimental_createProcessLifeline, makePanelController as experimental_makePanelController, scanPublicSdkOnly as experimental_scanPublicSdkOnly, experimental_trackChildProcesses, makeHostResponse, makeMessageDispatchHookContext, makePluginAgentConfigurationContext, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
|
|
1691
|
+
export type { CreateFakePluginHostOptions, ExperimentalChildProcessTracker, ExperimentalDescendantPipe, ExperimentalFakeHostRpcCall, ExperimentalLifelineHolder, ExperimentalProcessLifeline, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };
|