@get-bb/plugin-sdk 0.4.8 → 0.4.10
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 +43 -2
- package/bundled-types/bb-plugin-sdk-app.d.ts +319 -27
- package/bundled-types/bb-plugin-sdk-internal-file-navigation-validation.d.ts +42 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +45 -8
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +3 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +2791 -4936
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +35 -2
- package/bundled-types/bb-plugin-sdk.d.ts +1341 -429
- package/dist/app.js +12 -0
- package/dist/internal/file-navigation-validation.js +135 -0
- package/dist/internal/host-policy.js +104 -0
- package/dist/internal/plugin-app-collector.js +58 -1
- package/dist/provider-bridge.js +3477 -4881
- package/dist/testing/app.js +403 -1
- package/dist/testing/index.js +104 -1
- package/package.json +11 -4
|
@@ -35,6 +35,16 @@ declare const RESERVED_BB_CLI_COMMANDS: readonly string[];
|
|
|
35
35
|
declare const PROVIDER_FORK_VALUES: readonly ["none", "tip", "checkpoint"];
|
|
36
36
|
type ProviderFork = (typeof PROVIDER_FORK_VALUES)[number];
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* A value that survives a JSON round trip without coercion or data loss.
|
|
40
|
+
*
|
|
41
|
+
* Host boundaries still validate values at runtime because TypeScript cannot
|
|
42
|
+
* exclude non-finite numbers and plugin bundles can bypass static types.
|
|
43
|
+
*/
|
|
44
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
45
|
+
[key: string]: JsonValue;
|
|
46
|
+
};
|
|
47
|
+
|
|
38
48
|
/**
|
|
39
49
|
* The validator-neutral subset of Standard Schema v1 used by plugin RPC.
|
|
40
50
|
* Zod 4 schemas implement this interface directly; other validators can do
|
|
@@ -139,10 +149,23 @@ type PluginProviderComposerAction = "goal" | "plan";
|
|
|
139
149
|
* live session (picker rendering, route gating, cross-plugin tool
|
|
140
150
|
* composition — including with the host offline). Every boolean is a
|
|
141
151
|
* provider-native fact — the provider implements the feature; the flag only
|
|
142
|
-
* tells external consumers it exists.
|
|
143
|
-
*
|
|
152
|
+
* tells external consumers it exists. Session-behavior facts remain handshake
|
|
153
|
+
* capabilities reported by the running bridge. Sessionless maintenance
|
|
154
|
+
* methods are declared here so callers can decide whether to probe without
|
|
155
|
+
* starting the bridge first.
|
|
144
156
|
*/
|
|
145
157
|
interface PluginProviderCapabilities {
|
|
158
|
+
/** The provider bridge implements the sessionless `provider/health`
|
|
159
|
+
* request. This is host-local readiness, not a network health check. */
|
|
160
|
+
experimental_providerHealth: boolean;
|
|
161
|
+
/** The provider exposes subscription usage through the sessionless
|
|
162
|
+
* `provider/usage` request. False means callers skip the request and usage
|
|
163
|
+
* settings omit the provider. A shared bridge that declares true may still
|
|
164
|
+
* report usage unavailable for one provider id or return no windows. */
|
|
165
|
+
experimental_providerUsage: boolean;
|
|
166
|
+
/** The provider bridge implements `provider/installation/status` and
|
|
167
|
+
* `provider/installation/run` for host-local installation management. */
|
|
168
|
+
experimental_providerInstallation: boolean;
|
|
146
169
|
/** The provider accepts a fast/priority service-tier choice — shows the
|
|
147
170
|
* service-tier toggle in the picker. */
|
|
148
171
|
supportsServiceTier: boolean;
|
|
@@ -186,11 +209,11 @@ interface PluginProviderCapabilities {
|
|
|
186
209
|
* refused. Registrations are replaced wholesale on plugin reload, like every
|
|
187
210
|
* other plugin surface.
|
|
188
211
|
*
|
|
189
|
-
* A declaration
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* run.
|
|
212
|
+
* A declaration owns the provider's static metadata and bridge options. The
|
|
213
|
+
* executable implementation is the plugin's own provider bridge, named by
|
|
214
|
+
* `bb.providerBridge` in the manifest and built into the artifact BB ships to
|
|
215
|
+
* hosts — declaring a provider without one is refused, because the picker
|
|
216
|
+
* entry would exist and no turn on it could ever run.
|
|
194
217
|
*/
|
|
195
218
|
interface PluginProviderDeclaration {
|
|
196
219
|
/** Stable provider id: 2–64 characters of lowercase letters, digits, and
|
|
@@ -206,6 +229,19 @@ interface PluginProviderDeclaration {
|
|
|
206
229
|
* — no leading "/", no ".." segments, no backslashes.
|
|
207
230
|
*/
|
|
208
231
|
icon?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Provider-owned static options passed opaquely to this plugin's bridge on
|
|
234
|
+
* every sessionless and session request. Core validates that the value is
|
|
235
|
+
* JSON, but does not interpret its keys. This is intended for immutable
|
|
236
|
+
* launch metadata shared by every host (for example an ACP command spec),
|
|
237
|
+
* not user or machine configuration.
|
|
238
|
+
*/
|
|
239
|
+
experimental_bridgeOptions?: Readonly<Record<string, JsonValue>>;
|
|
240
|
+
/**
|
|
241
|
+
* Whether the provider is always listed or only listed on hosts where its
|
|
242
|
+
* bridge reports it installed. Defaults to `"always"`.
|
|
243
|
+
*/
|
|
244
|
+
experimental_visibility?: "always" | "installed";
|
|
209
245
|
/** Pre-session capability facts (see the declaration tests on
|
|
210
246
|
* {@link PluginProviderCapabilities}). */
|
|
211
247
|
capabilities: PluginProviderCapabilities;
|
|
@@ -237,6 +273,7 @@ declare const PLUGIN_AGENT_DYNAMIC_INSTRUCTIONS_MAX_CHARS = 4096;
|
|
|
237
273
|
declare const PLUGIN_AGENT_TOOL_PARAMETERS_MAX_BYTES: number;
|
|
238
274
|
declare const MENTION_PROVIDER_ID_PATTERN: RegExp;
|
|
239
275
|
declare const PROVIDER_ID_PATTERN: RegExp;
|
|
276
|
+
declare const PLUGIN_PROVIDER_BRIDGE_OPTIONS_MAX_BYTES: number;
|
|
240
277
|
declare const SETTING_KEY_PATTERN: RegExp;
|
|
241
278
|
/**
|
|
242
279
|
* Validate freeform descriptors from plugin code and merge them into the
|
|
@@ -290,4 +327,4 @@ declare function enforcePluginCliOutputLimit(result: Omit<PluginCliExecutionResu
|
|
|
290
327
|
*/
|
|
291
328
|
declare function adoptHttpRouteResponse(value: unknown): Response;
|
|
292
329
|
|
|
293
|
-
export { AGENT_TOOL_NAME_PATTERN, BACKGROUND_NAME_PATTERN, CLI_COMMAND_NAME_PATTERN, KV_VALUE_MAX_BYTES, MENTION_PROVIDER_ID_PATTERN, PLUGIN_AGENT_DYNAMIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_SELECTION_MAX_IDS, PLUGIN_AGENT_STATIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, PLUGIN_AGENT_TOOL_PARAMETERS_MAX_BYTES, PLUGIN_HTTP_METHODS, PLUGIN_MENTION_TRIGGER_VALUES, PLUGIN_PROVIDER_COMPOSER_ACTION_VALUES, PLUGIN_PROVIDER_DISPLAY_NAME_MAX_CHARS, PLUGIN_PROVIDER_PERMISSION_MODE_VALUES, PLUGIN_PROVIDER_REASONING_LEVEL_VALUES, PROVIDER_ID_PATTERN, RESERVED_AGENT_TOOL_NAMES, RESERVED_BB_CLI_COMMANDS, RPC_METHOD_PATTERN, SETTING_KEY_PATTERN, adoptHttpRouteResponse, assertNoRecursiveJsonSchemaReferences, enforcePluginCliOutputLimit, isPluginMentionTrigger, isStandardSchema, isZodSchemaLike, normalizeMentionProviderTriggers, readRpcMethodContract, registerSettingDescriptors, summarizeParseIssues, validatePluginProviderDeclaration, validateSettingsUpdate };
|
|
330
|
+
export { AGENT_TOOL_NAME_PATTERN, BACKGROUND_NAME_PATTERN, CLI_COMMAND_NAME_PATTERN, KV_VALUE_MAX_BYTES, MENTION_PROVIDER_ID_PATTERN, PLUGIN_AGENT_DYNAMIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_SELECTION_MAX_IDS, PLUGIN_AGENT_STATIC_INSTRUCTIONS_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, PLUGIN_AGENT_TOOL_PARAMETERS_MAX_BYTES, PLUGIN_HTTP_METHODS, PLUGIN_MENTION_TRIGGER_VALUES, PLUGIN_PROVIDER_BRIDGE_OPTIONS_MAX_BYTES, PLUGIN_PROVIDER_COMPOSER_ACTION_VALUES, PLUGIN_PROVIDER_DISPLAY_NAME_MAX_CHARS, PLUGIN_PROVIDER_PERMISSION_MODE_VALUES, PLUGIN_PROVIDER_REASONING_LEVEL_VALUES, PROVIDER_ID_PATTERN, RESERVED_AGENT_TOOL_NAMES, RESERVED_BB_CLI_COMMANDS, RPC_METHOD_PATTERN, SETTING_KEY_PATTERN, adoptHttpRouteResponse, assertNoRecursiveJsonSchemaReferences, enforcePluginCliOutputLimit, isPluginMentionTrigger, isStandardSchema, isZodSchemaLike, normalizeMentionProviderTriggers, readRpcMethodContract, registerSettingDescriptors, summarizeParseIssues, validatePluginProviderDeclaration, validateSettingsUpdate };
|
|
@@ -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 { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
8
|
+
import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
9
9
|
|
|
10
10
|
/** Validated registrations produced by one plugin app setup execution. */
|
|
11
11
|
interface CollectedPluginAppRegistrations {
|
|
@@ -20,6 +20,8 @@ interface CollectedPluginAppRegistrations {
|
|
|
20
20
|
threadLists: PluginThreadListRegistration[];
|
|
21
21
|
threadHeaderActions: PluginThreadHeaderActionRegistration[];
|
|
22
22
|
fileOpeners: PluginFileOpenerRegistration[];
|
|
23
|
+
sourceCodeRenderers: PluginSourceCodeRendererRegistration[];
|
|
24
|
+
diffRenderers: PluginDiffRendererRegistration[];
|
|
23
25
|
messageDirectives: PluginMessageDirectiveRegistration[];
|
|
24
26
|
messageActions: PluginMessageActionRegistration[];
|
|
25
27
|
providerIcons: PluginProviderIconRegistration[];
|