@get-bb/plugin-sdk 0.4.88 → 0.4.97
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/bundled-types/bb-plugin-sdk-app.d.ts +94 -33
- package/bundled-types/bb-plugin-sdk-host.d.ts +9 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +66 -2
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +16 -3
- package/bundled-types/bb-plugin-sdk-machine-provider.d.ts +2 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +8 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +10 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +3 -4
- package/bundled-types/bb-plugin-sdk-testing.d.ts +42 -6
- package/bundled-types/bb-plugin-sdk.d.ts +222 -44
- package/dist/internal/host-policy.js +175 -91
- package/dist/internal/plugin-app-collector.js +13834 -22
- package/dist/provider-bridge-acp.js +2207 -1578
- package/dist/provider-bridge-testing.js +1232 -1224
- package/dist/provider-bridge.js +1821 -1305
- package/dist/testing/app.js +13987 -175
- package/dist/testing/index.js +182 -93
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
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, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
8
|
+
import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput, PluginMachineValidateDecision, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision, BbPluginApi, PluginSettingValue as PluginSettingValue$1, PluginSharedPortTunnelIdentity, PluginAgentToolPresentation, PluginAgentToolContext, PluginAgentToolResult, PluginCliCommandInfo, PluginCliContext, PluginCliResult, PluginHttpAuthMode, PluginHttpHandler, PluginMentionTrigger, PluginMentionSearchContext, PluginMentionItem, PluginMentionProviderRegistration, PluginCliExecutionResult, PluginThreadEventName, PluginThreadEventPayloads, PluginAgentConfigurationContext, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginProviderEnvHealth, PluginSettingDescriptors, ExperimentalPluginWebSocketHandler, PluginAgentConfiguration, PluginHookName, PluginHookHandler, PluginAiServiceDeclaration, PluginInteractionRequest, MessageDispatchHookContext } from '@get-bb/plugin-sdk';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
|
|
11
11
|
type PluginMachineProviderResource = Exclude<JsonValue$2, null>;
|
|
@@ -77,7 +77,9 @@ interface PluginMachineProviderDefinition<S extends PluginMachineProviderInputsS
|
|
|
77
77
|
report: PluginMachineProviderProgress;
|
|
78
78
|
signal: AbortSignal;
|
|
79
79
|
}): Promise<PluginMachineProviderRemoveResult>;
|
|
80
|
+
/** Idempotent: preserve saved state when compute is already stopped; save and stop any remaining compute, including during reconciliation of a suspended machine. */
|
|
80
81
|
suspend?(context: PluginMachineProviderResourceLifecycleContext): Promise<PluginMachineProviderResourceResult>;
|
|
82
|
+
/** Idempotent: reuse existing running compute instead of allocating a duplicate. */
|
|
81
83
|
resume?(context: PluginMachineProviderResourceLifecycleContext): Promise<PluginMachineProviderResourceResult>;
|
|
82
84
|
remove(context: PluginMachineProviderRemoveContext): Promise<PluginMachineProviderRemoveResult>;
|
|
83
85
|
}
|
|
@@ -468,6 +470,14 @@ interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
|
468
470
|
readonly version: 1;
|
|
469
471
|
readonly vendor: string;
|
|
470
472
|
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
473
|
+
readonly jsonSchema?: {
|
|
474
|
+
readonly input: (options: {
|
|
475
|
+
target: string;
|
|
476
|
+
}) => Record<string, unknown>;
|
|
477
|
+
readonly output: (options: {
|
|
478
|
+
target: string;
|
|
479
|
+
}) => Record<string, unknown>;
|
|
480
|
+
};
|
|
471
481
|
readonly types?: {
|
|
472
482
|
readonly input: Input;
|
|
473
483
|
readonly output: Output;
|
|
@@ -486,6 +496,11 @@ interface StandardSchemaV1Issue {
|
|
|
486
496
|
readonly key: PropertyKey;
|
|
487
497
|
})[];
|
|
488
498
|
}
|
|
499
|
+
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
500
|
+
readonly experimental_description?: string;
|
|
501
|
+
readonly input: InputSchema;
|
|
502
|
+
readonly output: OutputSchema;
|
|
503
|
+
}
|
|
489
504
|
|
|
490
505
|
type PluginSettingValue = string | number | boolean;
|
|
491
506
|
/**
|
|
@@ -688,6 +703,8 @@ interface PluginProviderOptionsContext {
|
|
|
688
703
|
}
|
|
689
704
|
/** See {@link PluginProviderDeclaration.models}. */
|
|
690
705
|
type PluginProviderModelCatalogScope = "host" | "workspace";
|
|
706
|
+
/** See {@link PluginProviderDeclaration.completedTurnDisplay}. */
|
|
707
|
+
type PluginProviderCompletedTurnDisplay = "collapse" | "flat";
|
|
691
708
|
/**
|
|
692
709
|
* One cold-cache fallback model. The provider's live `model/list` result is
|
|
693
710
|
* the only real model source; this list stands in only while no probe has
|
|
@@ -794,6 +811,16 @@ interface PluginProviderDeclaration {
|
|
|
794
811
|
/** Composer actions this provider supports. No duplicates; may be empty
|
|
795
812
|
* (the universal skills typeahead is implicit). */
|
|
796
813
|
composerActions: readonly PluginProviderComposerAction[];
|
|
814
|
+
/**
|
|
815
|
+
* How the thread timeline shows this provider's turns once they finish.
|
|
816
|
+
* `"collapse"` (the default) folds a finished turn's work into one
|
|
817
|
+
* "Worked for" row and leaves the final answer visible. `"flat"` keeps
|
|
818
|
+
* every row of a finished turn visible, as it was while the turn ran. This
|
|
819
|
+
* is only the provider's default: the user can choose either display for
|
|
820
|
+
* each provider in Settings → Providers or with
|
|
821
|
+
* `bb settings completed-turns`, and that choice wins.
|
|
822
|
+
*/
|
|
823
|
+
completedTurnDisplay?: PluginProviderCompletedTurnDisplay;
|
|
797
824
|
/** Provider copy for core surfaces ({@link PluginProviderStrings}). */
|
|
798
825
|
strings?: PluginProviderStrings;
|
|
799
826
|
/** Service tiers this provider accepts, as picker options. Non-empty when
|
|
@@ -907,6 +934,7 @@ type NormalizedPluginProviderDeclaration = Omit<PluginProviderDeclaration, "expe
|
|
|
907
934
|
readonly experimental_nativeSkillRoots?: ProviderNativeRoots;
|
|
908
935
|
readonly experimental_nativeCommandRoots?: ProviderNativeRoots;
|
|
909
936
|
readonly experimental_resolvesNativeRoots: boolean;
|
|
937
|
+
readonly completedTurnDisplay: PluginProviderCompletedTurnDisplay;
|
|
910
938
|
readonly maintenance: {
|
|
911
939
|
readonly health: boolean;
|
|
912
940
|
readonly usage: boolean;
|
|
@@ -917,6 +945,17 @@ type NormalizedPluginProviderDeclaration = Omit<PluginProviderDeclaration, "expe
|
|
|
917
945
|
readonly scope: PluginProviderModelCatalogScope;
|
|
918
946
|
};
|
|
919
947
|
};
|
|
948
|
+
declare function readRpcPublicationOptions(value: unknown): {
|
|
949
|
+
experimental_discoverable: boolean;
|
|
950
|
+
experimental_description: string | null;
|
|
951
|
+
};
|
|
952
|
+
declare function publishRpcMethod(method: string, contract: PluginRpcMethodContract, options: ReturnType<typeof readRpcPublicationOptions>): {
|
|
953
|
+
method: string;
|
|
954
|
+
registrationDescription: string | null;
|
|
955
|
+
methodDescription: string | null;
|
|
956
|
+
inputSchema: Record<string, JsonValue$1>;
|
|
957
|
+
outputSchema: Record<string, JsonValue$1>;
|
|
958
|
+
} | null;
|
|
920
959
|
declare const ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES: readonly ["projectCheckout", "gitCheckout", "gitRemote", "projectless"];
|
|
921
960
|
type NormalizedPluginEnvironmentProviderRequirements = {
|
|
922
961
|
[K in (typeof ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES)[number]]: boolean;
|
|
@@ -1107,11 +1146,7 @@ interface FakeMentionProviderRecord {
|
|
|
1107
1146
|
label: string;
|
|
1108
1147
|
triggers: readonly PluginMentionTrigger[];
|
|
1109
1148
|
search: (ctx: PluginMentionSearchContext) => PluginMentionItem[] | Promise<PluginMentionItem[]>;
|
|
1110
|
-
resolve:
|
|
1111
|
-
context: string;
|
|
1112
|
-
} | Promise<{
|
|
1113
|
-
context: string;
|
|
1114
|
-
}>;
|
|
1149
|
+
resolve: PluginMentionProviderRegistration["resolve"];
|
|
1115
1150
|
}
|
|
1116
1151
|
interface FakeRealtimeSignal {
|
|
1117
1152
|
channel: string;
|
|
@@ -1129,6 +1164,7 @@ interface FakePluginRegistrations {
|
|
|
1129
1164
|
settingsDescriptors: PluginSettingDescriptors;
|
|
1130
1165
|
httpRoutes: FakeHttpRouteRecord[];
|
|
1131
1166
|
websocketRoutes: ExperimentalFakeWebSocketRouteRecord[];
|
|
1167
|
+
experimental_publishedRpcMethods: Array<NonNullable<ReturnType<typeof publishRpcMethod>>>;
|
|
1132
1168
|
rpcMethods: string[];
|
|
1133
1169
|
services: FakeServiceRecord[];
|
|
1134
1170
|
schedules: FakeScheduleRecord[];
|