@get-bb/plugin-sdk 0.4.55 → 0.4.84
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 +0 -12
- package/bundled-types/bb-plugin-sdk-app.d.ts +141 -20
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +35 -3
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +178 -10
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +8 -3
- package/bundled-types/bb-plugin-sdk-machine-provider.d.ts +84 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +5 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +7 -2
- package/bundled-types/bb-plugin-sdk-testing.d.ts +195 -4
- package/bundled-types/bb-plugin-sdk.d.ts +591 -45
- package/dist/app.js +4 -0
- package/dist/internal/host-policy.js +126 -15
- package/dist/internal/plugin-app-collector.js +45 -1
- package/dist/machine-provider.js +0 -0
- package/dist/provider-bridge-acp.js +2 -1
- package/dist/provider-bridge-testing.js +2 -1
- package/dist/provider-bridge.js +2 -1
- package/dist/testing/app.js +63 -1
- package/dist/testing/index.js +227 -28
- package/package.json +7 -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 { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandPaletteActionRegistration, PluginProviderIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
8
|
+
import { ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterItemRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginCommandPaletteActionRegistration, PluginProviderIconRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, PluginContentScriptRegistration, PluginAppDefinition } from '@get-bb/plugin-sdk';
|
|
9
9
|
|
|
10
10
|
type ExperimentalSidebarFooterCommandKind = "close" | "open" | "toggle";
|
|
11
11
|
interface ExperimentalSidebarFooterRuntimeSnapshot {
|
|
@@ -36,6 +36,9 @@ interface CollectedCompatibilitySidebarFooterItem {
|
|
|
36
36
|
}
|
|
37
37
|
type CollectedSidebarFooterItem = CollectedCompatibilitySidebarFooterItem | CollectedManagedSidebarFooterItem;
|
|
38
38
|
declare function adaptSidebarFooterAction(registration: PluginSidebarFooterActionRegistration): CollectedCompatibilitySidebarFooterItem;
|
|
39
|
+
type CollectedPluginProviderIconRegistration = Omit<PluginProviderIconRegistration, "providerKind"> & {
|
|
40
|
+
providerKind: PluginProviderIconRegistration["providerKind"] | "all";
|
|
41
|
+
};
|
|
39
42
|
/** Validated registrations produced by one plugin app setup execution. */
|
|
40
43
|
interface CollectedPluginAppRegistrations {
|
|
41
44
|
homepageSections: PluginHomepageSectionRegistration[];
|
|
@@ -57,9 +60,11 @@ interface CollectedPluginAppRegistrations {
|
|
|
57
60
|
messageDirectives: PluginMessageDirectiveRegistration[];
|
|
58
61
|
messageActions: PluginMessageActionRegistration[];
|
|
59
62
|
commandPaletteActions: PluginCommandPaletteActionRegistration[];
|
|
60
|
-
providerIcons:
|
|
63
|
+
providerIcons: CollectedPluginProviderIconRegistration[];
|
|
64
|
+
icons: ExperimentalIconRegistration[];
|
|
61
65
|
timelineRenderers: PluginTimelineRendererRegistration[];
|
|
62
66
|
environmentProviderInputs: PluginEnvironmentProviderInputsRegistration[];
|
|
67
|
+
machineProviderInputs: PluginMachineProviderInputsRegistration[];
|
|
63
68
|
contentScripts: PluginContentScriptRegistration[];
|
|
64
69
|
}
|
|
65
70
|
declare function getCollectedSidebarFooterItems(registrations: object): readonly CollectedSidebarFooterItem[] | null;
|
|
@@ -72,4 +77,4 @@ declare function getCollectedSidebarFooterItems(registrations: object): readonly
|
|
|
72
77
|
declare function collectPluginAppRegistrations(definition: PluginAppDefinition, onComposerCustomizationRejected?: (reason: string) => void): CollectedPluginAppRegistrations;
|
|
73
78
|
|
|
74
79
|
export { adaptSidebarFooterAction, collectPluginAppRegistrations, getCollectedSidebarFooterItems };
|
|
75
|
-
export type { CollectedCompatibilitySidebarFooterItem, CollectedExperimentalSidebarFooterItem, CollectedManagedSidebarFooterItem, CollectedPluginAppRegistrations, CollectedSidebarFooterItem, ExperimentalSidebarFooterCommandKind, ExperimentalSidebarFooterItemRuntime, ExperimentalSidebarFooterRuntimeSnapshot };
|
|
80
|
+
export type { CollectedCompatibilitySidebarFooterItem, CollectedExperimentalSidebarFooterItem, CollectedManagedSidebarFooterItem, CollectedPluginAppRegistrations, CollectedPluginProviderIconRegistration, CollectedSidebarFooterItem, ExperimentalSidebarFooterCommandKind, ExperimentalSidebarFooterItemRuntime, ExperimentalSidebarFooterRuntimeSnapshot };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Portable type declarations for `@get-bb/plugin-sdk`. Unpublished BB
|
|
2
|
+
// workspace contracts are flattened; public subpaths may reuse the
|
|
3
|
+
// package root without requiring any other @bb/* package.
|
|
4
|
+
//
|
|
5
|
+
// Confused by the API, or need a symbol that isn't here? Clone the BB repo
|
|
6
|
+
// and read the real source: https://github.com/get-bb/bb
|
|
7
|
+
|
|
8
|
+
import { StandardSchemaV1, StandardSchemaV1InferOutput, JsonValue, PluginMachineValidateDecision } from '@get-bb/plugin-sdk';
|
|
9
|
+
|
|
10
|
+
type PluginMachineProviderResource = Exclude<JsonValue, null>;
|
|
11
|
+
type PluginMachineProviderInputsSchema = StandardSchemaV1 | undefined;
|
|
12
|
+
type InputsValue<S> = S extends StandardSchemaV1 ? StandardSchemaV1InferOutput<S> : null;
|
|
13
|
+
interface PluginMachineProviderProgress {
|
|
14
|
+
step(text: string): void;
|
|
15
|
+
log(text: string): void;
|
|
16
|
+
}
|
|
17
|
+
type PluginMachineProviderAvailability = {
|
|
18
|
+
status: "available";
|
|
19
|
+
} | {
|
|
20
|
+
status: "setup-required";
|
|
21
|
+
message: string;
|
|
22
|
+
} | {
|
|
23
|
+
status: "unavailable";
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
type PluginMachineProviderValidateContext<S extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> = {
|
|
27
|
+
inputs: InputsValue<S>;
|
|
28
|
+
};
|
|
29
|
+
interface PluginMachineProviderLifecycleContext {
|
|
30
|
+
checkpoint(resource: PluginMachineProviderResource): Promise<void>;
|
|
31
|
+
report: PluginMachineProviderProgress;
|
|
32
|
+
signal: AbortSignal;
|
|
33
|
+
}
|
|
34
|
+
type PluginMachineProviderCreateContext<S extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> = PluginMachineProviderValidateContext<S> & PluginMachineProviderLifecycleContext & {
|
|
35
|
+
key: string;
|
|
36
|
+
attempt: number;
|
|
37
|
+
};
|
|
38
|
+
type PluginMachineProviderCreateResult = {
|
|
39
|
+
status: "created";
|
|
40
|
+
name: string;
|
|
41
|
+
resource: PluginMachineProviderResource;
|
|
42
|
+
} | {
|
|
43
|
+
status: "failed";
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
46
|
+
type PluginMachineProviderResourceLifecycleContext = PluginMachineProviderLifecycleContext & {
|
|
47
|
+
hostId: string;
|
|
48
|
+
resource: PluginMachineProviderResource;
|
|
49
|
+
};
|
|
50
|
+
type PluginMachineProviderRemoveContext = Omit<PluginMachineProviderResourceLifecycleContext, "checkpoint">;
|
|
51
|
+
interface PluginMachineProviderResourceResult {
|
|
52
|
+
resource: PluginMachineProviderResource;
|
|
53
|
+
}
|
|
54
|
+
type PluginMachineProviderRemoveResult = {
|
|
55
|
+
status: "removed";
|
|
56
|
+
} | {
|
|
57
|
+
status: "failed";
|
|
58
|
+
message: string;
|
|
59
|
+
};
|
|
60
|
+
interface PluginMachineProviderDefinition<S extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> {
|
|
61
|
+
id: string;
|
|
62
|
+
displayName: string;
|
|
63
|
+
/** One line telling a user what choosing this provider gets them, shown wherever a machine is added. */
|
|
64
|
+
description: string;
|
|
65
|
+
/** Provider glyph, declared icon, or plugin-relative icon path. */
|
|
66
|
+
icon: string;
|
|
67
|
+
ephemeral?: boolean;
|
|
68
|
+
/** Persisted and readable by every plugin. Store secret references, never secrets. */
|
|
69
|
+
inputs?: S;
|
|
70
|
+
availability?(): PluginMachineProviderAvailability | Promise<PluginMachineProviderAvailability>;
|
|
71
|
+
validate?(context: PluginMachineProviderValidateContext<S>): PluginMachineValidateDecision | Promise<PluginMachineValidateDecision>;
|
|
72
|
+
create(context: PluginMachineProviderCreateContext<S>): Promise<PluginMachineProviderCreateResult>;
|
|
73
|
+
/** Reconcile and remove an uncertain allocation by durable key without creating or bootstrapping. Return failed while allocation intent remains unresolved. */
|
|
74
|
+
reconcileCleanup(context: {
|
|
75
|
+
key: string;
|
|
76
|
+
report: PluginMachineProviderProgress;
|
|
77
|
+
signal: AbortSignal;
|
|
78
|
+
}): Promise<PluginMachineProviderRemoveResult>;
|
|
79
|
+
suspend?(context: PluginMachineProviderResourceLifecycleContext): Promise<PluginMachineProviderResourceResult>;
|
|
80
|
+
resume?(context: PluginMachineProviderResourceLifecycleContext): Promise<PluginMachineProviderResourceResult>;
|
|
81
|
+
remove(context: PluginMachineProviderRemoveContext): Promise<PluginMachineProviderRemoveResult>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type { PluginMachineProviderAvailability, PluginMachineProviderCreateContext, PluginMachineProviderCreateResult, PluginMachineProviderDefinition, PluginMachineProviderInputsSchema, PluginMachineProviderLifecycleContext, PluginMachineProviderProgress, PluginMachineProviderRemoveResult, PluginMachineProviderResource, PluginMachineProviderResourceResult, PluginMachineProviderValidateContext };
|
|
@@ -3252,6 +3252,11 @@ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.
|
|
|
3252
3252
|
reason: z.ZodOptional<z.ZodString>;
|
|
3253
3253
|
source: z.ZodUnion<readonly [z.ZodLiteral<"shell">, z.ZodObject<{
|
|
3254
3254
|
plugin: z.ZodString;
|
|
3255
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3256
|
+
core: z.ZodEnum<{
|
|
3257
|
+
"machine-environment": "machine-environment";
|
|
3258
|
+
"machine-git": "machine-git";
|
|
3259
|
+
}>;
|
|
3255
3260
|
}, z.core.$strict>]>;
|
|
3256
3261
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
3257
3262
|
masked: z.ZodLiteral<true>;
|
|
@@ -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,
|
|
10
|
+
import { ExperimentalSidebarFooterItemRegistration, PluginProviderIconRegistration, PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, ExperimentalAppOverlayRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, ExperimentalSidebarNavigationRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, ExperimentalIconRegistration, PluginTimelineRendererRegistration, PluginEnvironmentProviderInputsRegistration, PluginMachineProviderInputsRegistration, 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 {
|
|
@@ -24,6 +24,9 @@ interface ExperimentalSidebarFooterItemRuntime {
|
|
|
24
24
|
type CollectedExperimentalSidebarFooterItem = ExperimentalSidebarFooterItemRegistration & {
|
|
25
25
|
runtime: ExperimentalSidebarFooterItemRuntime;
|
|
26
26
|
};
|
|
27
|
+
type CollectedPluginProviderIconRegistration = Omit<PluginProviderIconRegistration, "providerKind"> & {
|
|
28
|
+
providerKind: PluginProviderIconRegistration["providerKind"] | "all";
|
|
29
|
+
};
|
|
27
30
|
|
|
28
31
|
/**
|
|
29
32
|
* `@get-bb/plugin-sdk/testing/app` — the frontend plugin test harness. Tests a
|
|
@@ -150,9 +153,11 @@ interface CapturedPluginApp {
|
|
|
150
153
|
diffRenderers: PluginDiffRendererRegistration[];
|
|
151
154
|
messageDirectives: PluginMessageDirectiveRegistration[];
|
|
152
155
|
messageActions: PluginMessageActionRegistration[];
|
|
153
|
-
providerIcons:
|
|
156
|
+
providerIcons: CollectedPluginProviderIconRegistration[];
|
|
157
|
+
icons: ExperimentalIconRegistration[];
|
|
154
158
|
timelineRenderers: PluginTimelineRendererRegistration[];
|
|
155
159
|
environmentProviderInputs: PluginEnvironmentProviderInputsRegistration[];
|
|
160
|
+
machineProviderInputs: PluginMachineProviderInputsRegistration[];
|
|
156
161
|
contentScripts: PluginContentScriptRegistration[];
|
|
157
162
|
}
|
|
158
163
|
type PluginAppModule = {
|
|
@@ -5,8 +5,82 @@
|
|
|
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
9
|
import { z } from 'zod';
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
type PluginMachineProviderResource = Exclude<JsonValue$2, null>;
|
|
12
|
+
type PluginMachineProviderInputsSchema = StandardSchemaV1$1 | undefined;
|
|
13
|
+
type InputsValue$1<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput<S> : null;
|
|
14
|
+
interface PluginMachineProviderProgress {
|
|
15
|
+
step(text: string): void;
|
|
16
|
+
log(text: string): void;
|
|
17
|
+
}
|
|
18
|
+
type PluginMachineProviderAvailability = {
|
|
19
|
+
status: "available";
|
|
20
|
+
} | {
|
|
21
|
+
status: "setup-required";
|
|
22
|
+
message: string;
|
|
23
|
+
} | {
|
|
24
|
+
status: "unavailable";
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
type PluginMachineProviderValidateContext<S extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> = {
|
|
28
|
+
inputs: InputsValue$1<S>;
|
|
29
|
+
};
|
|
30
|
+
interface PluginMachineProviderLifecycleContext {
|
|
31
|
+
checkpoint(resource: PluginMachineProviderResource): Promise<void>;
|
|
32
|
+
report: PluginMachineProviderProgress;
|
|
33
|
+
signal: AbortSignal;
|
|
34
|
+
}
|
|
35
|
+
type PluginMachineProviderCreateContext<S extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> = PluginMachineProviderValidateContext<S> & PluginMachineProviderLifecycleContext & {
|
|
36
|
+
key: string;
|
|
37
|
+
attempt: number;
|
|
38
|
+
};
|
|
39
|
+
type PluginMachineProviderCreateResult = {
|
|
40
|
+
status: "created";
|
|
41
|
+
name: string;
|
|
42
|
+
resource: PluginMachineProviderResource;
|
|
43
|
+
} | {
|
|
44
|
+
status: "failed";
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
47
|
+
type PluginMachineProviderResourceLifecycleContext = PluginMachineProviderLifecycleContext & {
|
|
48
|
+
hostId: string;
|
|
49
|
+
resource: PluginMachineProviderResource;
|
|
50
|
+
};
|
|
51
|
+
type PluginMachineProviderRemoveContext = Omit<PluginMachineProviderResourceLifecycleContext, "checkpoint">;
|
|
52
|
+
interface PluginMachineProviderResourceResult {
|
|
53
|
+
resource: PluginMachineProviderResource;
|
|
54
|
+
}
|
|
55
|
+
type PluginMachineProviderRemoveResult = {
|
|
56
|
+
status: "removed";
|
|
57
|
+
} | {
|
|
58
|
+
status: "failed";
|
|
59
|
+
message: string;
|
|
60
|
+
};
|
|
61
|
+
interface PluginMachineProviderDefinition<S extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> {
|
|
62
|
+
id: string;
|
|
63
|
+
displayName: string;
|
|
64
|
+
/** One line telling a user what choosing this provider gets them, shown wherever a machine is added. */
|
|
65
|
+
description: string;
|
|
66
|
+
/** Provider glyph, declared icon, or plugin-relative icon path. */
|
|
67
|
+
icon: string;
|
|
68
|
+
ephemeral?: boolean;
|
|
69
|
+
/** Persisted and readable by every plugin. Store secret references, never secrets. */
|
|
70
|
+
inputs?: S;
|
|
71
|
+
availability?(): PluginMachineProviderAvailability | Promise<PluginMachineProviderAvailability>;
|
|
72
|
+
validate?(context: PluginMachineProviderValidateContext<S>): PluginMachineValidateDecision | Promise<PluginMachineValidateDecision>;
|
|
73
|
+
create(context: PluginMachineProviderCreateContext<S>): Promise<PluginMachineProviderCreateResult>;
|
|
74
|
+
/** Reconcile and remove an uncertain allocation by durable key without creating or bootstrapping. Return failed while allocation intent remains unresolved. */
|
|
75
|
+
reconcileCleanup(context: {
|
|
76
|
+
key: string;
|
|
77
|
+
report: PluginMachineProviderProgress;
|
|
78
|
+
signal: AbortSignal;
|
|
79
|
+
}): Promise<PluginMachineProviderRemoveResult>;
|
|
80
|
+
suspend?(context: PluginMachineProviderResourceLifecycleContext): Promise<PluginMachineProviderResourceResult>;
|
|
81
|
+
resume?(context: PluginMachineProviderResourceLifecycleContext): Promise<PluginMachineProviderResourceResult>;
|
|
82
|
+
remove(context: PluginMachineProviderRemoveContext): Promise<PluginMachineProviderRemoveResult>;
|
|
83
|
+
}
|
|
10
84
|
|
|
11
85
|
/** Input-form entry: a path, or a path with options. */
|
|
12
86
|
declare const providerNativeRootInputSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -74,10 +148,14 @@ declare const environmentSchema: z.ZodObject<{
|
|
|
74
148
|
environmentProviderInstanceKey: z.ZodNullable<z.ZodString>;
|
|
75
149
|
environmentProviderSelection: z.ZodNullable<z.ZodObject<{
|
|
76
150
|
inputs: z.ZodNullable<z.ZodType<JsonValue$1, unknown, z.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
|
|
77
|
-
machine: z.ZodObject<{
|
|
151
|
+
machine: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
152
|
hostId: z.ZodString;
|
|
79
153
|
type: z.ZodLiteral<"existing">;
|
|
80
|
-
}, z.core.$strip
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
inputs: z.ZodNullable<z.ZodType<JsonValue$1, unknown, z.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
|
|
156
|
+
machineProviderId: z.ZodString;
|
|
157
|
+
type: z.ZodLiteral<"new">;
|
|
158
|
+
}, z.core.$strip>], "type">;
|
|
81
159
|
}, z.core.$strip>>;
|
|
82
160
|
hostId: z.ZodString;
|
|
83
161
|
id: z.ZodString;
|
|
@@ -127,6 +205,29 @@ declare const hostSchema: z.ZodObject<{
|
|
|
127
205
|
id: z.ZodString;
|
|
128
206
|
lastRejectedProtocolVersion: z.ZodNullable<z.ZodNumber>;
|
|
129
207
|
lastSeenAt: z.ZodNullable<z.ZodNumber>;
|
|
208
|
+
lifecycle: z.ZodObject<{
|
|
209
|
+
message: z.ZodNullable<z.ZodString>;
|
|
210
|
+
pendingLog: z.ZodString;
|
|
211
|
+
phase: z.ZodEnum<{
|
|
212
|
+
active: "active";
|
|
213
|
+
creating: "creating";
|
|
214
|
+
destroyed: "destroyed";
|
|
215
|
+
removing: "removing";
|
|
216
|
+
resuming: "resuming";
|
|
217
|
+
suspended: "suspended";
|
|
218
|
+
suspending: "suspending";
|
|
219
|
+
}>;
|
|
220
|
+
suspendedAt: z.ZodNullable<z.ZodNumber>;
|
|
221
|
+
teardown: z.ZodNullable<z.ZodObject<{
|
|
222
|
+
attempt: z.ZodNumber;
|
|
223
|
+
status: z.ZodEnum<{
|
|
224
|
+
failed: "failed";
|
|
225
|
+
removed: "removed";
|
|
226
|
+
running: "running";
|
|
227
|
+
}>;
|
|
228
|
+
}, z.core.$strip>>;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
machineProviderId: z.ZodNullable<z.ZodString>;
|
|
130
231
|
maxPermissionMode: z.ZodEnum<{
|
|
131
232
|
"accept-edits": "accept-edits";
|
|
132
233
|
auto: "auto";
|
|
@@ -138,6 +239,7 @@ declare const hostSchema: z.ZodObject<{
|
|
|
138
239
|
disconnected: "disconnected";
|
|
139
240
|
}>;
|
|
140
241
|
type: z.ZodEnum<{
|
|
242
|
+
ephemeral: "ephemeral";
|
|
141
243
|
persistent: "persistent";
|
|
142
244
|
}>;
|
|
143
245
|
updatedAt: z.ZodNumber;
|
|
@@ -221,8 +323,10 @@ type Checkout<R> = R extends {
|
|
|
221
323
|
gitCheckout: true;
|
|
222
324
|
} ? {
|
|
223
325
|
path: string;
|
|
326
|
+
experimental_ownsPath: boolean;
|
|
224
327
|
} : {
|
|
225
328
|
path: string;
|
|
329
|
+
experimental_ownsPath: boolean;
|
|
226
330
|
} | null;
|
|
227
331
|
type InputsValue<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput<S> : null;
|
|
228
332
|
/** Attempt-scoped updates; core persists each update before this call returns. */
|
|
@@ -306,8 +410,10 @@ interface PluginEnvironmentProviderPolicy {
|
|
|
306
410
|
interface PluginEnvironmentProviderDefinition<R extends PluginEnvironmentProviderRequirements$1 = PluginEnvironmentProviderRequirements$1, S extends PluginEnvironmentProviderInputsSchema = PluginEnvironmentProviderInputsSchema> {
|
|
307
411
|
id: string;
|
|
308
412
|
displayName: string;
|
|
413
|
+
/** Short explanation shown in environment choices. */
|
|
414
|
+
description: string;
|
|
309
415
|
/** Host glyph, plugin-relative icon path, or this plugin’s declared namespaced icon. */
|
|
310
|
-
icon
|
|
416
|
+
icon: string;
|
|
311
417
|
requires?: R;
|
|
312
418
|
inputs?: S;
|
|
313
419
|
policy?: Partial<PluginEnvironmentProviderPolicy>;
|
|
@@ -318,6 +424,30 @@ interface PluginEnvironmentProviderDefinition<R extends PluginEnvironmentProvide
|
|
|
318
424
|
remove(context: PluginEnvironmentProviderRemoveContext): Promise<PluginEnvironmentProviderRemoveResult>;
|
|
319
425
|
}
|
|
320
426
|
|
|
427
|
+
interface MachineExecutorRequest {
|
|
428
|
+
command: string[];
|
|
429
|
+
timeoutMs: number;
|
|
430
|
+
signal: AbortSignal;
|
|
431
|
+
stdin: string;
|
|
432
|
+
onOutput: (chunk: string) => void;
|
|
433
|
+
}
|
|
434
|
+
interface MachineExecutor {
|
|
435
|
+
exec(request: MachineExecutorRequest): Promise<{
|
|
436
|
+
exitCode: number;
|
|
437
|
+
}>;
|
|
438
|
+
}
|
|
439
|
+
interface MachineBootstrapRequest {
|
|
440
|
+
key: string;
|
|
441
|
+
executor: MachineExecutor;
|
|
442
|
+
report: PluginMachineProviderProgress;
|
|
443
|
+
signal: AbortSignal;
|
|
444
|
+
}
|
|
445
|
+
interface MachineBootstrapApi {
|
|
446
|
+
bootstrap(request: MachineBootstrapRequest): Promise<{
|
|
447
|
+
hostId: string;
|
|
448
|
+
}>;
|
|
449
|
+
}
|
|
450
|
+
|
|
321
451
|
/**
|
|
322
452
|
* A value that survives a JSON round trip without coercion or data loss.
|
|
323
453
|
*
|
|
@@ -389,6 +519,36 @@ interface PluginEnvironmentProviderRequirements {
|
|
|
389
519
|
* supplied pathKey. Provider ids are unique across running plugins.
|
|
390
520
|
*/
|
|
391
521
|
type PluginEnvironmentProviderDeclaration<Requires extends PluginEnvironmentProviderRequirements = PluginEnvironmentProviderRequirements, Inputs extends PluginEnvironmentProviderInputsSchema = PluginEnvironmentProviderInputsSchema> = PluginEnvironmentProviderDefinition<Requires, Inputs>;
|
|
522
|
+
type PluginMachineProviderDeclaration<Inputs extends PluginMachineProviderInputsSchema = PluginMachineProviderInputsSchema> = PluginMachineProviderDefinition<Inputs>;
|
|
523
|
+
interface ServerAccessGrant {
|
|
524
|
+
id: string;
|
|
525
|
+
serverUrl: string;
|
|
526
|
+
headers?: Record<string, string>;
|
|
527
|
+
}
|
|
528
|
+
interface ServerAccessProviderDeclaration {
|
|
529
|
+
id: string;
|
|
530
|
+
displayName: string;
|
|
531
|
+
description: string;
|
|
532
|
+
availability(): (PluginMachineProviderAvailability & {
|
|
533
|
+
serverUrl?: string;
|
|
534
|
+
}) | Promise<PluginMachineProviderAvailability & {
|
|
535
|
+
serverUrl?: string;
|
|
536
|
+
}>;
|
|
537
|
+
acquire(context: {
|
|
538
|
+
key: string;
|
|
539
|
+
hostId: string;
|
|
540
|
+
signal: AbortSignal;
|
|
541
|
+
}): Promise<ServerAccessGrant | {
|
|
542
|
+
status: "failed";
|
|
543
|
+
message: string;
|
|
544
|
+
}>;
|
|
545
|
+
release(context: {
|
|
546
|
+
key: string;
|
|
547
|
+
hostId: string;
|
|
548
|
+
/** Null when acquisition was interrupted before a grant was returned. Reconcile using key and hostId. */
|
|
549
|
+
grantId: string | null;
|
|
550
|
+
}): Promise<void>;
|
|
551
|
+
}
|
|
392
552
|
/**
|
|
393
553
|
* Permission modes a provider can run a session in — BB's own permission
|
|
394
554
|
* vocabulary, ordered least ("accept-edits") to most ("full") privileged.
|
|
@@ -761,9 +921,19 @@ declare const ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES: readonly ["projectCheckout
|
|
|
761
921
|
type NormalizedPluginEnvironmentProviderRequirements = {
|
|
762
922
|
[K in (typeof ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES)[number]]: boolean;
|
|
763
923
|
};
|
|
924
|
+
declare const environmentCompositionSchema: z.ZodObject<{
|
|
925
|
+
description: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | null, string | undefined>>;
|
|
926
|
+
displayName: z.ZodString;
|
|
927
|
+
environmentProviderId: z.ZodString;
|
|
928
|
+
icon: z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>, z.ZodTransform<string | null, string | undefined>>;
|
|
929
|
+
id: z.ZodString;
|
|
930
|
+
machineProviderId: z.ZodString;
|
|
931
|
+
}, z.core.$strict>;
|
|
932
|
+
type NormalizedPluginEnvironmentComposition = z.infer<typeof environmentCompositionSchema>;
|
|
764
933
|
interface NormalizedPluginEnvironmentProvider {
|
|
765
934
|
id: string;
|
|
766
935
|
displayName: string;
|
|
936
|
+
description: string | null;
|
|
767
937
|
icon: string | null;
|
|
768
938
|
requires: NormalizedPluginEnvironmentProviderRequirements;
|
|
769
939
|
inputs: StandardSchemaV1 | null;
|
|
@@ -774,6 +944,22 @@ interface NormalizedPluginEnvironmentProvider {
|
|
|
774
944
|
remove: PluginEnvironmentProviderDeclaration["remove"];
|
|
775
945
|
policy: PluginEnvironmentProviderPolicy;
|
|
776
946
|
}
|
|
947
|
+
interface NormalizedPluginMachineProvider {
|
|
948
|
+
id: string;
|
|
949
|
+
displayName: string;
|
|
950
|
+
description: string;
|
|
951
|
+
icon: string;
|
|
952
|
+
ephemeral: boolean;
|
|
953
|
+
inputs: StandardSchemaV1 | null;
|
|
954
|
+
inputsJsonSchema: JsonValue | null;
|
|
955
|
+
availability: NonNullable<PluginMachineProviderDeclaration["availability"]> | null;
|
|
956
|
+
validate: NonNullable<PluginMachineProviderDeclaration["validate"]> | null;
|
|
957
|
+
reconcileCleanup: PluginMachineProviderDeclaration["reconcileCleanup"];
|
|
958
|
+
create: PluginMachineProviderDeclaration["create"];
|
|
959
|
+
suspend: NonNullable<PluginMachineProviderDeclaration["suspend"]> | null;
|
|
960
|
+
resume: NonNullable<PluginMachineProviderDeclaration["resume"]> | null;
|
|
961
|
+
remove: PluginMachineProviderDeclaration["remove"];
|
|
962
|
+
}
|
|
777
963
|
|
|
778
964
|
type BbSdk = BbPluginApi["sdk"];
|
|
779
965
|
/**
|
|
@@ -955,7 +1141,10 @@ interface FakePluginRegistrations {
|
|
|
955
1141
|
hooks: {
|
|
956
1142
|
[K in PluginHookName]: PluginHookHandler<K> | null;
|
|
957
1143
|
};
|
|
1144
|
+
environmentCompositions: ReadonlyMap<string, NormalizedPluginEnvironmentComposition>;
|
|
958
1145
|
environmentProviders: ReadonlyMap<string, NormalizedPluginEnvironmentProvider>;
|
|
1146
|
+
machineProviders: ReadonlyMap<string, NormalizedPluginMachineProvider>;
|
|
1147
|
+
serverAccessProviders: ReadonlyMap<string, ServerAccessProviderDeclaration>;
|
|
959
1148
|
mentionProviders: FakeMentionProviderRecord[];
|
|
960
1149
|
/** Live provider registrations from `bb.providers.register`
|
|
961
1150
|
* (normalized declarations, registration order; dispose removes). */
|
|
@@ -1095,6 +1284,8 @@ interface FakePluginHarness extends FakePluginInspectionState, FakePluginBehavio
|
|
|
1095
1284
|
readonly lifecycle: FakePluginLifecycleControls;
|
|
1096
1285
|
}
|
|
1097
1286
|
interface CreateFakePluginHostOptions {
|
|
1287
|
+
machineBootstrap?: MachineBootstrapApi;
|
|
1288
|
+
machineResource?: (hostId: string) => Promise<JsonValue$2 | null>;
|
|
1098
1289
|
/** Defaults to "test-plugin". */
|
|
1099
1290
|
pluginId?: string;
|
|
1100
1291
|
/**
|