@get-bb/plugin-sdk 0.4.47 → 0.4.50
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 +12 -0
- package/bundled-types/bb-plugin-sdk-app.d.ts +203 -28
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +266 -0
- package/bundled-types/bb-plugin-sdk-host.d.ts +33 -2
- package/bundled-types/bb-plugin-sdk-internal-composer-customization-validation.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +231 -8
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +7 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +195 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +202 -167
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +5 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +308 -3
- package/bundled-types/bb-plugin-sdk.d.ts +1639 -572
- package/dist/app.js +6 -0
- package/dist/environment-provider.js +0 -0
- package/dist/host.js +734 -30
- package/dist/internal/composer-customization-validation.js +9 -0
- package/dist/internal/host-policy.js +233 -64
- package/dist/internal/plugin-app-collector.js +26 -0
- package/dist/provider-bridge-acp.js +46 -2
- package/dist/provider-bridge-testing.js +62 -1
- package/dist/provider-bridge.js +23 -1
- package/dist/testing/app.js +86 -1
- package/dist/testing/index.js +254 -72
- package/package.json +7 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { ReactNode, ComponentType } from 'react';
|
|
9
9
|
import { RenderResult } from '@testing-library/react';
|
|
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';
|
|
10
|
+
import { ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginProvidersState, PluginCodeThemeState, BranchesState, CheckoutState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
|
|
11
11
|
|
|
12
12
|
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
13
13
|
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
@@ -152,6 +152,7 @@ interface CapturedPluginApp {
|
|
|
152
152
|
messageActions: PluginMessageActionRegistration[];
|
|
153
153
|
providerIcons: PluginProviderIconRegistration[];
|
|
154
154
|
timelineRenderers: PluginTimelineRendererRegistration[];
|
|
155
|
+
environmentProviderInputs: PluginEnvironmentProviderInputsRegistration[];
|
|
155
156
|
contentScripts: PluginContentScriptRegistration[];
|
|
156
157
|
}
|
|
157
158
|
type PluginAppModule = {
|
|
@@ -239,6 +240,9 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
|
|
|
239
240
|
* mode with no resolved document, the state a plugin sees on first paint.
|
|
240
241
|
*/
|
|
241
242
|
codeTheme?: Partial<PluginCodeThemeState>;
|
|
243
|
+
branchesState?: Partial<BranchesState>;
|
|
244
|
+
/** Checkout facts `experimental_useCheckoutState()` reports. */
|
|
245
|
+
checkoutState?: Partial<CheckoutState>;
|
|
242
246
|
/**
|
|
243
247
|
* Pull requests `experimental_useSidebarThreadPullRequest()` reports, keyed
|
|
244
248
|
* by thread id. Omitted → every thread reports none.
|
|
@@ -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,
|
|
9
|
+
import { StandardSchemaV1 as StandardSchemaV1$1, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, StandardSchemaV1InferOutput, PluginEnvironmentValidateDecision, JsonValue as JsonValue$2, 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';
|
|
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<{
|
|
@@ -60,9 +60,264 @@ interface ProviderNativeRootsInputLike {
|
|
|
60
60
|
readonly project?: readonly ProviderNativeRootInput[];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
interface JsonObject {
|
|
64
|
+
[key: string]: JsonValue$1;
|
|
65
|
+
}
|
|
66
|
+
type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | JsonObject;
|
|
67
|
+
|
|
68
|
+
declare const environmentSchema: z.ZodObject<{
|
|
69
|
+
baseBranch: z.ZodNullable<z.ZodString>;
|
|
70
|
+
branchName: z.ZodNullable<z.ZodString>;
|
|
71
|
+
createdAt: z.ZodNumber;
|
|
72
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
73
|
+
environmentProviderId: z.ZodNullable<z.ZodString>;
|
|
74
|
+
environmentProviderInstanceKey: z.ZodNullable<z.ZodString>;
|
|
75
|
+
environmentProviderSelection: z.ZodNullable<z.ZodObject<{
|
|
76
|
+
inputs: z.ZodNullable<z.ZodType<JsonValue$1, unknown, z.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
|
|
77
|
+
machine: z.ZodObject<{
|
|
78
|
+
hostId: z.ZodString;
|
|
79
|
+
type: z.ZodLiteral<"existing">;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
hostId: z.ZodString;
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
isGitRepo: z.ZodBoolean;
|
|
85
|
+
isWorktree: z.ZodBoolean;
|
|
86
|
+
lifecycle: z.ZodObject<{
|
|
87
|
+
phase: z.ZodEnum<{
|
|
88
|
+
active: "active";
|
|
89
|
+
destroyed: "destroyed";
|
|
90
|
+
retiring: "retiring";
|
|
91
|
+
teardown: "teardown";
|
|
92
|
+
}>;
|
|
93
|
+
retireAt: z.ZodNullable<z.ZodNumber>;
|
|
94
|
+
teardown: z.ZodNullable<z.ZodObject<{
|
|
95
|
+
attempt: z.ZodNumber;
|
|
96
|
+
message: z.ZodOptional<z.ZodString>;
|
|
97
|
+
status: z.ZodEnum<{
|
|
98
|
+
failed: "failed";
|
|
99
|
+
removed: "removed";
|
|
100
|
+
running: "running";
|
|
101
|
+
}>;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
managed: z.ZodBoolean;
|
|
105
|
+
mergeBaseBranch: z.ZodNullable<z.ZodString>;
|
|
106
|
+
name: z.ZodNullable<z.ZodString>;
|
|
107
|
+
path: z.ZodNullable<z.ZodString>;
|
|
108
|
+
projectId: z.ZodString;
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
destroyed: "destroyed";
|
|
111
|
+
error: "error";
|
|
112
|
+
provisioning: "provisioning";
|
|
113
|
+
ready: "ready";
|
|
114
|
+
}>;
|
|
115
|
+
updatedAt: z.ZodNumber;
|
|
116
|
+
workspaceProvisionType: z.ZodNullable<z.ZodEnum<{
|
|
117
|
+
"managed-worktree": "managed-worktree";
|
|
118
|
+
personal: "personal";
|
|
119
|
+
unmanaged: "unmanaged";
|
|
120
|
+
}>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
type Environment = z.infer<typeof environmentSchema>;
|
|
123
|
+
|
|
124
|
+
declare const hostSchema: z.ZodObject<{
|
|
125
|
+
createdAt: z.ZodNumber;
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
lastRejectedProtocolVersion: z.ZodNullable<z.ZodNumber>;
|
|
128
|
+
lastSeenAt: z.ZodNullable<z.ZodNumber>;
|
|
129
|
+
maxPermissionMode: z.ZodEnum<{
|
|
130
|
+
"accept-edits": "accept-edits";
|
|
131
|
+
auto: "auto";
|
|
132
|
+
full: "full";
|
|
133
|
+
}>;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
status: z.ZodEnum<{
|
|
136
|
+
connected: "connected";
|
|
137
|
+
disconnected: "disconnected";
|
|
138
|
+
}>;
|
|
139
|
+
type: z.ZodEnum<{
|
|
140
|
+
persistent: "persistent";
|
|
141
|
+
}>;
|
|
142
|
+
updatedAt: z.ZodNumber;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
type Host = z.infer<typeof hostSchema>;
|
|
145
|
+
|
|
146
|
+
declare const projectSchema: z.ZodObject<{
|
|
147
|
+
createdAt: z.ZodNumber;
|
|
148
|
+
gitRemoteUrl: z.ZodNullable<z.ZodString>;
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
kind: z.ZodEnum<{
|
|
151
|
+
personal: "personal";
|
|
152
|
+
standard: "standard";
|
|
153
|
+
}>;
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
updatedAt: z.ZodNumber;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
type Project = z.infer<typeof projectSchema>;
|
|
158
|
+
|
|
63
159
|
declare const PROVIDER_FORK_VALUES: readonly ["none", "tip", "checkpoint"];
|
|
64
160
|
type ProviderFork = (typeof PROVIDER_FORK_VALUES)[number];
|
|
65
161
|
|
|
162
|
+
declare const threadResponseSchema: z.ZodObject<{
|
|
163
|
+
activeBackgroundAgentCount: z.ZodNumber;
|
|
164
|
+
archivedAt: z.ZodNullable<z.ZodNumber>;
|
|
165
|
+
canSpawnChild: z.ZodBoolean;
|
|
166
|
+
createdAt: z.ZodNumber;
|
|
167
|
+
deletedAt: z.ZodNullable<z.ZodNumber>;
|
|
168
|
+
environmentId: z.ZodNullable<z.ZodString>;
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
lastReadAt: z.ZodNullable<z.ZodNumber>;
|
|
171
|
+
latestAttentionAt: z.ZodNumber;
|
|
172
|
+
originKind: z.ZodNullable<z.ZodEnum<{
|
|
173
|
+
fork: "fork";
|
|
174
|
+
}>>;
|
|
175
|
+
originPluginId: z.ZodNullable<z.ZodString>;
|
|
176
|
+
parentThreadId: z.ZodNullable<z.ZodString>;
|
|
177
|
+
pinnedAt: z.ZodNullable<z.ZodNumber>;
|
|
178
|
+
projectId: z.ZodString;
|
|
179
|
+
providerId: z.ZodString;
|
|
180
|
+
queuedMessageCount: z.ZodNumber;
|
|
181
|
+
runtime: z.ZodObject<{
|
|
182
|
+
displayStatus: z.ZodEnum<{
|
|
183
|
+
"host-reconnecting": "host-reconnecting";
|
|
184
|
+
"waiting-for-host": "waiting-for-host";
|
|
185
|
+
active: "active";
|
|
186
|
+
error: "error";
|
|
187
|
+
idle: "idle";
|
|
188
|
+
pending: "pending";
|
|
189
|
+
provisioning: "provisioning";
|
|
190
|
+
starting: "starting";
|
|
191
|
+
stopping: "stopping";
|
|
192
|
+
}>;
|
|
193
|
+
hostReconnectGraceExpiresAt: z.ZodNullable<z.ZodNumber>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
sectionId: z.ZodNullable<z.ZodString>;
|
|
196
|
+
sourceThreadId: z.ZodNullable<z.ZodString>;
|
|
197
|
+
status: z.ZodEnum<{
|
|
198
|
+
active: "active";
|
|
199
|
+
error: "error";
|
|
200
|
+
idle: "idle";
|
|
201
|
+
pending: "pending";
|
|
202
|
+
starting: "starting";
|
|
203
|
+
stopping: "stopping";
|
|
204
|
+
}>;
|
|
205
|
+
title: z.ZodNullable<z.ZodString>;
|
|
206
|
+
titleFallback: z.ZodNullable<z.ZodString>;
|
|
207
|
+
updatedAt: z.ZodNumber;
|
|
208
|
+
visibility: z.ZodEnum<{
|
|
209
|
+
hidden: "hidden";
|
|
210
|
+
visible: "visible";
|
|
211
|
+
}>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
type ThreadResponse$1 = z.infer<typeof threadResponseSchema>;
|
|
214
|
+
|
|
215
|
+
type PluginEnvironmentProviderInputsSchema = StandardSchemaV1$1 | undefined;
|
|
216
|
+
type Fact<R, K extends PropertyKey, T> = R extends Record<K, true> ? T : T | null;
|
|
217
|
+
type Checkout<R> = R extends {
|
|
218
|
+
projectCheckout: true;
|
|
219
|
+
} | {
|
|
220
|
+
gitCheckout: true;
|
|
221
|
+
} ? {
|
|
222
|
+
path: string;
|
|
223
|
+
} : {
|
|
224
|
+
path: string;
|
|
225
|
+
} | null;
|
|
226
|
+
type InputsValue<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput<S> : null;
|
|
227
|
+
/** Attempt-scoped updates; core persists each update before this call returns. */
|
|
228
|
+
interface PluginEnvironmentProviderProgress {
|
|
229
|
+
step(text: string): void;
|
|
230
|
+
log(text: string): void;
|
|
231
|
+
}
|
|
232
|
+
interface PluginEnvironmentProviderValidateContext<R extends PluginEnvironmentProviderRequirements$1 = PluginEnvironmentProviderRequirements$1, S extends PluginEnvironmentProviderInputsSchema = PluginEnvironmentProviderInputsSchema> {
|
|
233
|
+
project: Project;
|
|
234
|
+
host: Host;
|
|
235
|
+
projectCheckout: Checkout<R>;
|
|
236
|
+
gitRemote: Fact<R, "gitRemote", string>;
|
|
237
|
+
inputs: InputsValue<S>;
|
|
238
|
+
}
|
|
239
|
+
interface PluginEnvironmentProviderAvailabilityContext {
|
|
240
|
+
project: Project;
|
|
241
|
+
host: Host | null;
|
|
242
|
+
projectCheckout: {
|
|
243
|
+
path: string;
|
|
244
|
+
} | null;
|
|
245
|
+
gitRemote: string | null;
|
|
246
|
+
}
|
|
247
|
+
type PluginEnvironmentProviderAvailability = {
|
|
248
|
+
status: "available";
|
|
249
|
+
} | {
|
|
250
|
+
status: "setup-required";
|
|
251
|
+
message: string;
|
|
252
|
+
} | {
|
|
253
|
+
status: "unavailable";
|
|
254
|
+
message: string;
|
|
255
|
+
};
|
|
256
|
+
interface PluginEnvironmentProviderCreateContext<R extends PluginEnvironmentProviderRequirements$1 = PluginEnvironmentProviderRequirements$1, S extends PluginEnvironmentProviderInputsSchema = PluginEnvironmentProviderInputsSchema> extends PluginEnvironmentProviderValidateContext<R, S> {
|
|
257
|
+
thread: ThreadResponse$1;
|
|
258
|
+
suggestedBranchName: string;
|
|
259
|
+
attempt: number;
|
|
260
|
+
pathKey: string;
|
|
261
|
+
rebuild: boolean;
|
|
262
|
+
experimental_claimPath(path: string): Promise<boolean>;
|
|
263
|
+
/** Resource is private to this provider; null after completed removal. */
|
|
264
|
+
previous: {
|
|
265
|
+
environment: Environment;
|
|
266
|
+
resource: JsonValue$2 | null;
|
|
267
|
+
} | null;
|
|
268
|
+
report: PluginEnvironmentProviderProgress;
|
|
269
|
+
signal: AbortSignal;
|
|
270
|
+
}
|
|
271
|
+
type PluginEnvironmentProviderCreateResult = {
|
|
272
|
+
status: "created";
|
|
273
|
+
path: string;
|
|
274
|
+
ownsPath: boolean;
|
|
275
|
+
mergeBaseBranch?: string;
|
|
276
|
+
resource?: JsonValue$2;
|
|
277
|
+
} | {
|
|
278
|
+
status: "failed";
|
|
279
|
+
failure: "terminal" | "transient";
|
|
280
|
+
message: string;
|
|
281
|
+
};
|
|
282
|
+
interface PluginEnvironmentProviderRemoveContext {
|
|
283
|
+
environment: Environment | null;
|
|
284
|
+
hostId: string | null;
|
|
285
|
+
path: string | null;
|
|
286
|
+
pathKey: string;
|
|
287
|
+
resource: JsonValue$2 | null;
|
|
288
|
+
attempt: number;
|
|
289
|
+
report: PluginEnvironmentProviderProgress;
|
|
290
|
+
signal: AbortSignal;
|
|
291
|
+
}
|
|
292
|
+
type PluginEnvironmentProviderRemoveResult = {
|
|
293
|
+
status: "removed";
|
|
294
|
+
} | {
|
|
295
|
+
status: "failed";
|
|
296
|
+
message: string;
|
|
297
|
+
};
|
|
298
|
+
/** Core normalizes omitted policy members once at registration. */
|
|
299
|
+
interface PluginEnvironmentProviderPolicy {
|
|
300
|
+
/** Default five minutes; null keeps the environment indefinitely. */
|
|
301
|
+
retireGraceMs: number | null;
|
|
302
|
+
/** Default per-thread; rebuilds use a fresh key to avoid dead paths. */
|
|
303
|
+
pathKeys: "per-attempt" | "per-thread";
|
|
304
|
+
}
|
|
305
|
+
/** Resource operations only. Core owns durable launches, retries and retirement. */
|
|
306
|
+
interface PluginEnvironmentProviderDefinition<R extends PluginEnvironmentProviderRequirements$1 = PluginEnvironmentProviderRequirements$1, S extends PluginEnvironmentProviderInputsSchema = PluginEnvironmentProviderInputsSchema> {
|
|
307
|
+
id: string;
|
|
308
|
+
displayName: string;
|
|
309
|
+
/** Host glyph, plugin-relative icon path, or this plugin’s declared namespaced icon. */
|
|
310
|
+
icon?: string;
|
|
311
|
+
requires?: R;
|
|
312
|
+
inputs?: S;
|
|
313
|
+
policy?: Partial<PluginEnvironmentProviderPolicy>;
|
|
314
|
+
/** Experimental: see docs/api_to_audit.md. */
|
|
315
|
+
availability?(context: PluginEnvironmentProviderAvailabilityContext): PluginEnvironmentProviderAvailability | Promise<PluginEnvironmentProviderAvailability>;
|
|
316
|
+
validate?(context: PluginEnvironmentProviderValidateContext<R, S>): PluginEnvironmentValidateDecision | Promise<PluginEnvironmentValidateDecision>;
|
|
317
|
+
create(context: PluginEnvironmentProviderCreateContext<R, S>): Promise<PluginEnvironmentProviderCreateResult>;
|
|
318
|
+
remove(context: PluginEnvironmentProviderRemoveContext): Promise<PluginEnvironmentProviderRemoveResult>;
|
|
319
|
+
}
|
|
320
|
+
|
|
66
321
|
/**
|
|
67
322
|
* A value that survives a JSON round trip without coercion or data loss.
|
|
68
323
|
*
|
|
@@ -103,6 +358,38 @@ interface StandardSchemaV1Issue {
|
|
|
103
358
|
}
|
|
104
359
|
|
|
105
360
|
type PluginSettingValue = string | number | boolean;
|
|
361
|
+
/**
|
|
362
|
+
* The facts this provider consumes, in one declaration. Every member is
|
|
363
|
+
* something core can evaluate before the thread exists and supply to
|
|
364
|
+
* `create`, so it is also the whole of what decides where the provider is
|
|
365
|
+
* offered, and the picker needs to know no provider by name. Every member
|
|
366
|
+
* defaults to false.
|
|
367
|
+
*
|
|
368
|
+
* - `projectCheckout` — the provider works from this project's directory on
|
|
369
|
+
* that machine, git or not, so core refuses a machine with no checkout of
|
|
370
|
+
* the project at create time and `context.projectCheckout` is non-null.
|
|
371
|
+
* - `gitCheckout` — that directory must also be a git repository with at
|
|
372
|
+
* least one commit. The picker greys the row out where it is not, and core
|
|
373
|
+
* rejects an explicit selection using the same machine inspection before
|
|
374
|
+
* creating the thread. Implies `projectCheckout`.
|
|
375
|
+
* - `gitRemote` — the provider clones the project itself, so it is greyed out
|
|
376
|
+
* in a project with no git remote and an explicit selection is rejected.
|
|
377
|
+
* - `projectless` — this provider serves only threads that have no project,
|
|
378
|
+
* so it is offered for those and nowhere else. It cannot be combined with
|
|
379
|
+
* `projectCheckout`, `gitCheckout` or `gitRemote`, which need a project.
|
|
380
|
+
*/
|
|
381
|
+
interface PluginEnvironmentProviderRequirements {
|
|
382
|
+
projectCheckout?: boolean;
|
|
383
|
+
gitCheckout?: boolean;
|
|
384
|
+
gitRemote?: boolean;
|
|
385
|
+
projectless?: boolean;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Resource operations for one place a thread can run. Core persists progress,
|
|
389
|
+
* retries, cancellation and retirement. Operations must be idempotent for the
|
|
390
|
+
* supplied pathKey. Provider ids are unique across running plugins.
|
|
391
|
+
*/
|
|
392
|
+
type PluginEnvironmentProviderDeclaration<Requires extends PluginEnvironmentProviderRequirements = PluginEnvironmentProviderRequirements, Inputs extends PluginEnvironmentProviderInputsSchema = PluginEnvironmentProviderInputsSchema> = PluginEnvironmentProviderDefinition<Requires, Inputs>;
|
|
106
393
|
/**
|
|
107
394
|
* Permission modes a provider can run a session in — BB's own permission
|
|
108
395
|
* vocabulary, ordered least ("accept-edits") to most ("full") privileged.
|
|
@@ -471,6 +758,23 @@ type NormalizedPluginProviderDeclaration = Omit<PluginProviderDeclaration, "expe
|
|
|
471
758
|
readonly scope: PluginProviderModelCatalogScope;
|
|
472
759
|
};
|
|
473
760
|
};
|
|
761
|
+
declare const ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES: readonly ["projectCheckout", "gitCheckout", "gitRemote", "projectless"];
|
|
762
|
+
type NormalizedPluginEnvironmentProviderRequirements = {
|
|
763
|
+
[K in (typeof ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES)[number]]: boolean;
|
|
764
|
+
};
|
|
765
|
+
interface NormalizedPluginEnvironmentProvider {
|
|
766
|
+
id: string;
|
|
767
|
+
displayName: string;
|
|
768
|
+
icon: string | null;
|
|
769
|
+
requires: NormalizedPluginEnvironmentProviderRequirements;
|
|
770
|
+
inputs: StandardSchemaV1 | null;
|
|
771
|
+
inputsJsonSchema: JsonValue | null;
|
|
772
|
+
availability: NonNullable<PluginEnvironmentProviderDeclaration["availability"]> | null;
|
|
773
|
+
validate: NonNullable<PluginEnvironmentProviderDeclaration["validate"]> | null;
|
|
774
|
+
create: PluginEnvironmentProviderDeclaration["create"];
|
|
775
|
+
remove: PluginEnvironmentProviderDeclaration["remove"];
|
|
776
|
+
policy: PluginEnvironmentProviderPolicy;
|
|
777
|
+
}
|
|
474
778
|
|
|
475
779
|
type BbSdk = BbPluginApi["sdk"];
|
|
476
780
|
/**
|
|
@@ -652,6 +956,7 @@ interface FakePluginRegistrations {
|
|
|
652
956
|
hooks: {
|
|
653
957
|
[K in PluginHookName]: PluginHookHandler<K> | null;
|
|
654
958
|
};
|
|
959
|
+
environmentProviders: ReadonlyMap<string, NormalizedPluginEnvironmentProvider>;
|
|
655
960
|
mentionProviders: FakeMentionProviderRecord[];
|
|
656
961
|
/** Live provider registrations from `bb.providers.register`
|
|
657
962
|
* (normalized declarations, registration order; dispose removes). */
|
|
@@ -696,7 +1001,7 @@ interface FakePluginBehaviorDrivers {
|
|
|
696
1001
|
experimental_emitHostWorkerExit(hostId: string): Promise<void>;
|
|
697
1002
|
/** Deliver a host signal through its registered payload schema. */
|
|
698
1003
|
experimental_emitHostSignal(hostId: string, signal: string, payload: unknown): Promise<void>;
|
|
699
|
-
submitInteraction(id: string, value: JsonValue$
|
|
1004
|
+
submitInteraction(id: string, value: JsonValue$2): void;
|
|
700
1005
|
cancelInteraction(id: string): void;
|
|
701
1006
|
/**
|
|
702
1007
|
* Apply a settings update the way the host's settings save does:
|
|
@@ -938,4 +1243,4 @@ interface PublicSdkOnlyScan {
|
|
|
938
1243
|
declare function scanPublicSdkOnly(packageRoot: string, options?: PublicSdkOnlyScanOptions): PublicSdkOnlyScan;
|
|
939
1244
|
|
|
940
1245
|
export { PluginContextStaleError, createFakePluginHost, createFakeSdk, scanPublicSdkOnly as experimental_scanPublicSdkOnly, makeMessageDispatchHookContext, makePluginAgentConfigurationContext, makeQueueEntry, makeThreadResponse, makeTurnFailedEvent };
|
|
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 };
|
|
1246
|
+
export type { CreateFakePluginHostOptions, ExperimentalFakeHostRpcCall, FakeAgentToolRecord, FakeCliRecord, FakeHttpRouteRecord, FakeLogEntry, FakeLogLevel, FakeMentionProviderRecord, FakePluginBehaviorDrivers, FakePluginHarness, FakePluginHost, FakePluginInspectionState, FakePluginLifecycleControls, FakePluginRegistrations, FakeRealtimeSignal, FakeScheduleRecord, FakeSdkCall, FakeSdkHarness, FakeSdkOverrides, FakeServiceRecord, PublicSdkOnlyScan, PublicSdkOnlyScanOptions, PublicSdkOnlyViolation };
|