@get-bb/plugin-sdk 0.6.164 → 0.6.178
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 -2
- package/bundled-types/bb-plugin-sdk-app.d.ts +292 -127
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +75 -84
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +314 -191
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +5 -2
- package/bundled-types/bb-plugin-sdk-internal-thread-event-gate.d.ts +1 -1
- package/bundled-types/bb-plugin-sdk-internal-thread-status.d.ts +2 -2
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +1 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +1 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +25 -7
- package/bundled-types/bb-plugin-sdk-testing.d.ts +226 -93
- package/bundled-types/bb-plugin-sdk.d.ts +437 -190
- package/dist/app.js +12 -0
- package/dist/index.js +20 -0
- package/dist/internal/host-policy.js +56 -16
- package/dist/internal/plugin-app-collector.js +15 -3
- package/dist/internal/rpc-query-host.js +12 -0
- package/dist/provider-bridge-acp-next.js +28 -10
- package/dist/provider-bridge-acp.js +28 -10
- package/dist/provider-bridge-testing.js +9 -0
- package/dist/provider-bridge.js +9 -0
- package/dist/testing/app.js +74 -6
- package/dist/testing/index.js +111 -21
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -340,6 +340,9 @@ var experimental_useTabVisible = runtimeFunction(
|
|
|
340
340
|
var experimental_useServers = runtimeFunction(
|
|
341
341
|
"experimental_useServers"
|
|
342
342
|
);
|
|
343
|
+
var experimental_hasServers = runtimeFunction(
|
|
344
|
+
"experimental_hasServers"
|
|
345
|
+
);
|
|
343
346
|
var experimental_useAppPanel = runtimeFunction(
|
|
344
347
|
"experimental_useAppPanel"
|
|
345
348
|
);
|
|
@@ -348,6 +351,9 @@ var experimental_useFixedTabTarget = runtimeFunction(
|
|
|
348
351
|
);
|
|
349
352
|
var useComposer = runtimeFunction("useComposer");
|
|
350
353
|
var useComposers = runtimeFunction("useComposers");
|
|
354
|
+
var experimental_useActiveComposer = runtimeFunction(
|
|
355
|
+
"experimental_useActiveComposer"
|
|
356
|
+
);
|
|
351
357
|
var experimental_useComposerRenderer = runtimeFunction(
|
|
352
358
|
"experimental_useComposerRenderer"
|
|
353
359
|
);
|
|
@@ -415,6 +421,9 @@ var experimental_useSidebarThreadActions = runtimeFunction(
|
|
|
415
421
|
var experimental_useThreadActions = runtimeFunction(
|
|
416
422
|
"experimental_useThreadActions"
|
|
417
423
|
);
|
|
424
|
+
var experimental_useThreadRequests = runtimeFunction(
|
|
425
|
+
"experimental_useThreadRequests"
|
|
426
|
+
);
|
|
418
427
|
var experimental_useArchiveEnvironmentThreads = runtimeFunction(
|
|
419
428
|
"experimental_useArchiveEnvironmentThreads"
|
|
420
429
|
);
|
|
@@ -538,6 +547,7 @@ export {
|
|
|
538
547
|
experimental_copyToClipboard,
|
|
539
548
|
experimental_describePromptMention,
|
|
540
549
|
experimental_getApplicationLinkApprovals,
|
|
550
|
+
experimental_hasServers,
|
|
541
551
|
experimental_matchesShortcutKey,
|
|
542
552
|
experimental_promptMentionClipboardAttributes,
|
|
543
553
|
experimental_readPromptMentionClipboard,
|
|
@@ -545,6 +555,7 @@ export {
|
|
|
545
555
|
experimental_revokeApplicationLinkApproval,
|
|
546
556
|
experimental_saveFile,
|
|
547
557
|
experimental_sliceUtf16Head,
|
|
558
|
+
experimental_useActiveComposer,
|
|
548
559
|
experimental_useAppPanel,
|
|
549
560
|
experimental_useArchiveEnvironmentThreads,
|
|
550
561
|
experimental_useBranches,
|
|
@@ -576,6 +587,7 @@ export {
|
|
|
576
587
|
experimental_useThreadActions,
|
|
577
588
|
experimental_useThreadContextKind,
|
|
578
589
|
experimental_useThreadExtensionState,
|
|
590
|
+
experimental_useThreadRequests,
|
|
579
591
|
experimental_useThreadTitleDisplayText,
|
|
580
592
|
useBbContext,
|
|
581
593
|
useBbNavigate,
|
package/dist/index.js
CHANGED
|
@@ -919,6 +919,25 @@ var experimental_THREAD_INFO_SECTION_GROUPS = {
|
|
|
919
919
|
storage: "3_storage"
|
|
920
920
|
};
|
|
921
921
|
|
|
922
|
+
// ../sdk/src/http-error.ts
|
|
923
|
+
var httpErrorBrand = /* @__PURE__ */ Symbol.for("@bb/sdk/http-error");
|
|
924
|
+
var BbHttpError = class extends Error {
|
|
925
|
+
static [Symbol.hasInstance](value) {
|
|
926
|
+
return typeof value === "object" && value !== null && Reflect.get(value, httpErrorBrand) === true;
|
|
927
|
+
}
|
|
928
|
+
body;
|
|
929
|
+
code;
|
|
930
|
+
status;
|
|
931
|
+
constructor(args) {
|
|
932
|
+
super(`HTTP ${args.status}: ${args.message}`);
|
|
933
|
+
Object.defineProperty(this, httpErrorBrand, { value: true });
|
|
934
|
+
this.name = "BbHttpError";
|
|
935
|
+
this.body = args.body;
|
|
936
|
+
this.code = args.code;
|
|
937
|
+
this.status = args.status;
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
|
|
922
941
|
// ../text-utils/src/utf16.ts
|
|
923
942
|
function isHighSurrogateAt(value, index) {
|
|
924
943
|
const code = value.charCodeAt(index);
|
|
@@ -1093,6 +1112,7 @@ export {
|
|
|
1093
1112
|
cliCommand,
|
|
1094
1113
|
defineCli,
|
|
1095
1114
|
defineRpcContract,
|
|
1115
|
+
BbHttpError as experimental_BbHttpError,
|
|
1096
1116
|
experimental_PluginRpcCallError,
|
|
1097
1117
|
experimental_PluginRpcRefusal,
|
|
1098
1118
|
experimental_THREAD_ACTION_GROUPS,
|
|
@@ -1819,11 +1819,22 @@ function enforcePluginCliOutputLimit(result, jsonOutput) {
|
|
|
1819
1819
|
};
|
|
1820
1820
|
return jsonOutput ? {
|
|
1821
1821
|
exitCode: 1,
|
|
1822
|
-
stdout: JSON.stringify({ error }),
|
|
1822
|
+
stdout: JSON.stringify({ ok: false, error }),
|
|
1823
1823
|
stderr: "",
|
|
1824
1824
|
error
|
|
1825
1825
|
} : { exitCode: 1, stdout: "", stderr: error.message, error };
|
|
1826
1826
|
}
|
|
1827
|
+
function pluginCliFailureResult(failure, jsonOutput) {
|
|
1828
|
+
return enforcePluginCliOutputLimit(
|
|
1829
|
+
{
|
|
1830
|
+
exitCode: 1,
|
|
1831
|
+
stdout: jsonOutput ? `${JSON.stringify({ ok: false, error: failure }, null, 2)}
|
|
1832
|
+
` : "",
|
|
1833
|
+
stderr: failure.message
|
|
1834
|
+
},
|
|
1835
|
+
jsonOutput
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1827
1838
|
function adoptHttpRouteResponse(value) {
|
|
1828
1839
|
if (value instanceof Response) return value;
|
|
1829
1840
|
if (!isResponseLike(value)) {
|
|
@@ -2027,19 +2038,22 @@ function validatePluginEnvironmentProviderDeclaration(declaration) {
|
|
|
2027
2038
|
declaration.availability,
|
|
2028
2039
|
"availability"
|
|
2029
2040
|
);
|
|
2041
|
+
const existingPath = declaration.apiVersion === 2 ? void 0 : declaration.experimental_existingPath;
|
|
2042
|
+
const locate = declaration.locate;
|
|
2030
2043
|
assertOptionalFunction(
|
|
2031
2044
|
"environment provider",
|
|
2032
2045
|
id,
|
|
2033
|
-
|
|
2046
|
+
existingPath,
|
|
2034
2047
|
"experimental_existingPath"
|
|
2035
2048
|
);
|
|
2049
|
+
assertOptionalFunction("environment provider", id, locate, "a locate");
|
|
2036
2050
|
assertOptionalFunction(
|
|
2037
2051
|
"environment provider",
|
|
2038
2052
|
id,
|
|
2039
2053
|
declaration.restore,
|
|
2040
2054
|
"a restore"
|
|
2041
2055
|
);
|
|
2042
|
-
|
|
2056
|
+
const common = {
|
|
2043
2057
|
id,
|
|
2044
2058
|
displayName,
|
|
2045
2059
|
description,
|
|
@@ -2048,11 +2062,33 @@ function validatePluginEnvironmentProviderDeclaration(declaration) {
|
|
|
2048
2062
|
inputs: inputs === null ? null : inputs.schema,
|
|
2049
2063
|
inputsJsonSchema: inputs === null ? null : inputs.jsonSchema,
|
|
2050
2064
|
availability: declaration.availability ?? null,
|
|
2065
|
+
locate: locate ?? (existingPath === void 0 ? null : ({ inputs: inputs2 }) => {
|
|
2066
|
+
const path = existingPath(inputs2);
|
|
2067
|
+
return path === null ? null : { path, reuse: true };
|
|
2068
|
+
}),
|
|
2069
|
+
remove: declaration.remove
|
|
2070
|
+
};
|
|
2071
|
+
if (declaration.apiVersion === 2) {
|
|
2072
|
+
return {
|
|
2073
|
+
...common,
|
|
2074
|
+
apiVersion: 2,
|
|
2075
|
+
validate: declaration.validate ?? null,
|
|
2076
|
+
create: declaration.create,
|
|
2077
|
+
restore: declaration.restore ?? null,
|
|
2078
|
+
policy: environmentProviderV2PolicySchema.parse(declaration.policy ?? {})
|
|
2079
|
+
};
|
|
2080
|
+
}
|
|
2081
|
+
if (declaration.apiVersion !== void 0 && declaration.apiVersion !== 1) {
|
|
2082
|
+
throw new Error(
|
|
2083
|
+
`environment provider "${id}" declares apiVersion ${JSON.stringify(declaration.apiVersion)}; this bb supports 1 and 2`
|
|
2084
|
+
);
|
|
2085
|
+
}
|
|
2086
|
+
return {
|
|
2087
|
+
...common,
|
|
2088
|
+
apiVersion: 1,
|
|
2051
2089
|
validate: declaration.validate ?? null,
|
|
2052
|
-
experimental_existingPath: declaration.experimental_existingPath ?? null,
|
|
2053
2090
|
create: declaration.create,
|
|
2054
2091
|
restore: declaration.restore ?? null,
|
|
2055
|
-
remove: declaration.remove,
|
|
2056
2092
|
policy: environmentProviderPolicySchema.parse(declaration.policy ?? {})
|
|
2057
2093
|
};
|
|
2058
2094
|
}
|
|
@@ -2087,6 +2123,10 @@ var environmentProviderPolicySchema = z5.object({
|
|
|
2087
2123
|
retireGraceMs: z5.number().int().nonnegative().nullable().default(3e5),
|
|
2088
2124
|
pathKeys: z5.enum(["per-thread", "per-attempt"]).default("per-thread")
|
|
2089
2125
|
}).strict();
|
|
2126
|
+
var environmentProviderV2PolicySchema = z5.object({
|
|
2127
|
+
retireGraceMs: z5.number().int().nonnegative().nullable().default(3e5),
|
|
2128
|
+
pathKeys: z5.enum(["per-environment", "per-attempt"]).default("per-environment")
|
|
2129
|
+
}).strict();
|
|
2090
2130
|
var MACHINE_PROVIDER_DESCRIPTION_MAX_CHARS = 200;
|
|
2091
2131
|
function validatePluginMachineProviderDeclaration(declaration) {
|
|
2092
2132
|
const { id, displayName } = requireProviderIdAndDisplayName(
|
|
@@ -2529,20 +2569,19 @@ function normalizeInteractionRequest(request) {
|
|
|
2529
2569
|
`ui.requestInput title must be 1-${PLUGIN_INTERACTION_MAX_TITLE_LENGTH} characters`
|
|
2530
2570
|
);
|
|
2531
2571
|
}
|
|
2532
|
-
let
|
|
2572
|
+
let json;
|
|
2533
2573
|
try {
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
payload = JSON.parse(json);
|
|
2540
|
-
} catch (error) {
|
|
2541
|
-
if (error instanceof Error && error.message.includes("64 KiB")) {
|
|
2542
|
-
throw error;
|
|
2543
|
-
}
|
|
2574
|
+
json = JSON.stringify(request.payload);
|
|
2575
|
+
} catch {
|
|
2576
|
+
throw new Error("ui.requestInput payload must be JSON-serializable");
|
|
2577
|
+
}
|
|
2578
|
+
if (json === void 0) {
|
|
2544
2579
|
throw new Error("ui.requestInput payload must be JSON-serializable");
|
|
2545
2580
|
}
|
|
2581
|
+
if (Buffer.byteLength(json, "utf8") > PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES) {
|
|
2582
|
+
throw new Error("ui.requestInput payload exceeds 64 KiB");
|
|
2583
|
+
}
|
|
2584
|
+
const payload = JSON.parse(json);
|
|
2546
2585
|
const timeoutMs = request.timeoutMs ?? 10 * 60 * 1e3;
|
|
2547
2586
|
if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > PLUGIN_INTERACTION_MAX_TIMEOUT_MS) {
|
|
2548
2587
|
throw new Error(
|
|
@@ -2893,6 +2932,7 @@ export {
|
|
|
2893
2932
|
normalizeWebSocketRouteRegistration,
|
|
2894
2933
|
parsePluginRowPresentation,
|
|
2895
2934
|
pluginCliCollisionWarning,
|
|
2935
|
+
pluginCliFailureResult,
|
|
2896
2936
|
pluginHookAlreadyRegisteredMessage,
|
|
2897
2937
|
providerAlreadyRegisteredMessage,
|
|
2898
2938
|
providerDeclarationIconRefusal,
|
|
@@ -41,7 +41,7 @@ function adaptSidebarFooterAction(registration) {
|
|
|
41
41
|
label: registration.title,
|
|
42
42
|
icon: registration.icon,
|
|
43
43
|
kind: "action",
|
|
44
|
-
onActivate: ({ openPluginDetails }) => registration.run({ openSettings: openPluginDetails }),
|
|
44
|
+
onActivate: ({ openPluginDetails, ...context }) => registration.run({ ...context, openSettings: openPluginDetails }),
|
|
45
45
|
runtime: new SidebarFooterItemRuntime()
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -416,6 +416,14 @@ function checkStaleNavPanelKeys(kind, registration, onWarning) {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
+
function readLegacyCardSectionTitle(kind, registration, onWarning) {
|
|
420
|
+
const title = "title" in registration ? registration.title : void 0;
|
|
421
|
+
if (typeof title !== "string" || title === "") return null;
|
|
422
|
+
onWarning(
|
|
423
|
+
`${kind}: "title" is retired; render experimental_InfoSection from the component instead.`
|
|
424
|
+
);
|
|
425
|
+
return title;
|
|
426
|
+
}
|
|
419
427
|
function createCommandShortcutSchema() {
|
|
420
428
|
return z.object({
|
|
421
429
|
key: z.string().min(1).max(32).refine(
|
|
@@ -1031,10 +1039,14 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
1031
1039
|
requireUniqueId(kind, seenIds.threadContextCardSection, id);
|
|
1032
1040
|
collected.threadContextCardSections.push({
|
|
1033
1041
|
id,
|
|
1034
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
1035
1042
|
group: requireNonEmptyString(kind, "group", registration.group),
|
|
1036
1043
|
...requireOptionalOrder(kind, registration.order),
|
|
1037
|
-
component: requireComponent(kind, registration.component)
|
|
1044
|
+
component: requireComponent(kind, registration.component),
|
|
1045
|
+
legacyTitle: readLegacyCardSectionTitle(
|
|
1046
|
+
kind,
|
|
1047
|
+
registration,
|
|
1048
|
+
onWarning
|
|
1049
|
+
)
|
|
1038
1050
|
});
|
|
1039
1051
|
},
|
|
1040
1052
|
experimental_threadAction(registration) {
|
|
@@ -1531,6 +1531,15 @@ var projectExecutionDefaultsSchema = z2.object({
|
|
|
1531
1531
|
// ../domain/src/plugin-id.ts
|
|
1532
1532
|
import { z as z3 } from "zod";
|
|
1533
1533
|
var pluginIdSchema = z3.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1534
|
+
var CORE_PLUGIN_DIRECTORIES = {
|
|
1535
|
+
npmPackages: "npm",
|
|
1536
|
+
cache: "cache",
|
|
1537
|
+
runtime: "runtime",
|
|
1538
|
+
stateSnapshots: "snapshots"
|
|
1539
|
+
};
|
|
1540
|
+
var coreOwnedPluginDirectoryNames = new Set(
|
|
1541
|
+
Object.values(CORE_PLUGIN_DIRECTORIES)
|
|
1542
|
+
);
|
|
1534
1543
|
|
|
1535
1544
|
// ../domain/src/change-kinds.ts
|
|
1536
1545
|
import { z as z17 } from "zod";
|
|
@@ -1610,6 +1619,7 @@ var threadCreateOriginSchema = z5.enum(threadCreateOriginValues);
|
|
|
1610
1619
|
|
|
1611
1620
|
// ../domain/src/environment.ts
|
|
1612
1621
|
import { z as z6 } from "zod";
|
|
1622
|
+
var environmentHolderSchema = z6.literal("user");
|
|
1613
1623
|
var environmentMachineSelectionSchema = z6.discriminatedUnion("type", [
|
|
1614
1624
|
z6.object({ type: z6.literal("existing"), hostId: z6.string().min(1) }),
|
|
1615
1625
|
z6.object({
|
|
@@ -1683,12 +1693,14 @@ var environmentSchema = z6.object({
|
|
|
1683
1693
|
defaultBranch: z6.string().nullable(),
|
|
1684
1694
|
mergeBaseBranch: z6.string().nullable(),
|
|
1685
1695
|
status: environmentStatusSchema,
|
|
1696
|
+
statusMessage: z6.string().nullable(),
|
|
1686
1697
|
environmentProviderId: z6.string().nullable(),
|
|
1687
1698
|
lifecycle: environmentLifecycleSchema,
|
|
1688
1699
|
hostLifecycle: environmentHostLifecycleSchema,
|
|
1689
1700
|
environmentProviderSelection: environmentProviderSelectionSchema.nullable(),
|
|
1690
1701
|
environmentProviderInstanceKey: z6.string().nullable(),
|
|
1691
1702
|
managed: z6.boolean(),
|
|
1703
|
+
heldBy: environmentHolderSchema.nullable(),
|
|
1692
1704
|
workspaceProvisionType: workspaceProvisionTypeSchema.nullable(),
|
|
1693
1705
|
createdAt: z6.number(),
|
|
1694
1706
|
updatedAt: z6.number()
|
|
@@ -1232,6 +1232,15 @@ var completedTurnDisplaySchema = z6.enum(COMPLETED_TURN_DISPLAY_VALUES);
|
|
|
1232
1232
|
// ../domain/src/plugin-id.ts
|
|
1233
1233
|
import { z as z7 } from "zod";
|
|
1234
1234
|
var pluginIdSchema = z7.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1235
|
+
var CORE_PLUGIN_DIRECTORIES = {
|
|
1236
|
+
npmPackages: "npm",
|
|
1237
|
+
cache: "cache",
|
|
1238
|
+
runtime: "runtime",
|
|
1239
|
+
stateSnapshots: "snapshots"
|
|
1240
|
+
};
|
|
1241
|
+
var coreOwnedPluginDirectoryNames = new Set(
|
|
1242
|
+
Object.values(CORE_PLUGIN_DIRECTORIES)
|
|
1243
|
+
);
|
|
1235
1244
|
|
|
1236
1245
|
// ../domain/src/background-task.ts
|
|
1237
1246
|
import { z as z8 } from "zod";
|
|
@@ -14443,7 +14452,8 @@ function presentProviderPrefixedModel(model) {
|
|
|
14443
14452
|
var OMP_ACP_DIALECT = {
|
|
14444
14453
|
id: "omp",
|
|
14445
14454
|
commandResult: ompCommandResult,
|
|
14446
|
-
presentModel: presentProviderPrefixedModel
|
|
14455
|
+
presentModel: presentProviderPrefixedModel,
|
|
14456
|
+
elicitationDescriptionIsHeading: true
|
|
14447
14457
|
};
|
|
14448
14458
|
var openCodeCommandRawOutputSchema = z45.object({
|
|
14449
14459
|
output: z45.unknown().optional(),
|
|
@@ -16033,9 +16043,11 @@ function readChoices(schema) {
|
|
|
16033
16043
|
if (!isJsonObject(entry) || typeof entry["const"] !== "string") {
|
|
16034
16044
|
return null;
|
|
16035
16045
|
}
|
|
16046
|
+
const description = readString(entry, "description")?.trim();
|
|
16036
16047
|
choices2.push({
|
|
16037
16048
|
value: entry["const"],
|
|
16038
|
-
label: readString(entry, "title") ?? entry["const"]
|
|
16049
|
+
label: readString(entry, "title") ?? entry["const"],
|
|
16050
|
+
...description ? { description } : {}
|
|
16039
16051
|
});
|
|
16040
16052
|
}
|
|
16041
16053
|
return choices2.length > 0 ? choices2 : null;
|
|
@@ -16118,20 +16130,23 @@ function shownField(field, other) {
|
|
|
16118
16130
|
}
|
|
16119
16131
|
return field.kind === "choice" ? { kind: "typedChoice", choices } : null;
|
|
16120
16132
|
}
|
|
16121
|
-
function questionFor(name, schema, field, required, other, message) {
|
|
16133
|
+
function questionFor(name, schema, field, required, other, message, presentation) {
|
|
16122
16134
|
const label = readString(schema, "title")?.trim() || name;
|
|
16123
|
-
const description = readString(schema, "description")?.trim();
|
|
16135
|
+
const description = readString(schema, "description")?.trim() || void 0;
|
|
16136
|
+
const heading = presentation.descriptionIsHeading ? description : void 0;
|
|
16137
|
+
const detail = presentation.descriptionIsHeading ? void 0 : description;
|
|
16138
|
+
const lead = message !== void 0 && message !== label ? message : void 0;
|
|
16124
16139
|
const lines = [
|
|
16125
|
-
...
|
|
16140
|
+
...lead ? [lead, ""] : [],
|
|
16126
16141
|
label,
|
|
16127
|
-
...
|
|
16142
|
+
...detail ? [detail] : [],
|
|
16128
16143
|
...field.kind === "typedChoice" ? [`One of: ${field.choices.map((choice) => choice.label).join(", ")}`] : [],
|
|
16129
16144
|
...field.kind === "number" ? [field.integer ? "Enter a whole number." : "Enter a number."] : []
|
|
16130
16145
|
];
|
|
16131
16146
|
const base = {
|
|
16132
16147
|
id: name,
|
|
16133
16148
|
prompt: lines.join("\n"),
|
|
16134
|
-
shortLabel: label,
|
|
16149
|
+
shortLabel: heading ?? label,
|
|
16135
16150
|
required
|
|
16136
16151
|
};
|
|
16137
16152
|
switch (field.kind) {
|
|
@@ -16270,7 +16285,7 @@ function planConfirmation(message) {
|
|
|
16270
16285
|
}
|
|
16271
16286
|
};
|
|
16272
16287
|
}
|
|
16273
|
-
function planAcpElicitation(params) {
|
|
16288
|
+
function planAcpElicitation(params, presentation) {
|
|
16274
16289
|
if (!isJsonObject(params)) {
|
|
16275
16290
|
return { kind: "unsupported", reason: "the request was malformed" };
|
|
16276
16291
|
}
|
|
@@ -16346,7 +16361,8 @@ function planAcpElicitation(params) {
|
|
|
16346
16361
|
field,
|
|
16347
16362
|
entry.required,
|
|
16348
16363
|
other,
|
|
16349
|
-
planned.length === 0 ? message : void 0
|
|
16364
|
+
planned.length === 0 ? message : void 0,
|
|
16365
|
+
presentation
|
|
16350
16366
|
)
|
|
16351
16367
|
});
|
|
16352
16368
|
}
|
|
@@ -23516,7 +23532,9 @@ function handleElicitationRequest(session, params, responder) {
|
|
|
23516
23532
|
answerWithoutUser(session, responder, COMPACTION_QUESTION_CAUSE);
|
|
23517
23533
|
return;
|
|
23518
23534
|
}
|
|
23519
|
-
const plan = planAcpElicitation(params
|
|
23535
|
+
const plan = planAcpElicitation(params, {
|
|
23536
|
+
descriptionIsHeading: session.dialect.elicitationDescriptionIsHeading === true
|
|
23537
|
+
});
|
|
23520
23538
|
if (plan.kind === "unsupported") {
|
|
23521
23539
|
answerWithoutUser(session, responder, {
|
|
23522
23540
|
kind: "unshowable-request",
|
|
@@ -1232,6 +1232,15 @@ var completedTurnDisplaySchema = z6.enum(COMPLETED_TURN_DISPLAY_VALUES);
|
|
|
1232
1232
|
// ../domain/src/plugin-id.ts
|
|
1233
1233
|
import { z as z7 } from "zod";
|
|
1234
1234
|
var pluginIdSchema = z7.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1235
|
+
var CORE_PLUGIN_DIRECTORIES = {
|
|
1236
|
+
npmPackages: "npm",
|
|
1237
|
+
cache: "cache",
|
|
1238
|
+
runtime: "runtime",
|
|
1239
|
+
stateSnapshots: "snapshots"
|
|
1240
|
+
};
|
|
1241
|
+
var coreOwnedPluginDirectoryNames = new Set(
|
|
1242
|
+
Object.values(CORE_PLUGIN_DIRECTORIES)
|
|
1243
|
+
);
|
|
1235
1244
|
|
|
1236
1245
|
// ../domain/src/background-task.ts
|
|
1237
1246
|
import { z as z8 } from "zod";
|
|
@@ -14443,7 +14452,8 @@ function presentProviderPrefixedModel(model) {
|
|
|
14443
14452
|
var OMP_ACP_DIALECT = {
|
|
14444
14453
|
id: "omp",
|
|
14445
14454
|
commandResult: ompCommandResult,
|
|
14446
|
-
presentModel: presentProviderPrefixedModel
|
|
14455
|
+
presentModel: presentProviderPrefixedModel,
|
|
14456
|
+
elicitationDescriptionIsHeading: true
|
|
14447
14457
|
};
|
|
14448
14458
|
var openCodeCommandRawOutputSchema = z45.object({
|
|
14449
14459
|
output: z45.unknown().optional(),
|
|
@@ -16033,9 +16043,11 @@ function readChoices(schema) {
|
|
|
16033
16043
|
if (!isJsonObject(entry) || typeof entry["const"] !== "string") {
|
|
16034
16044
|
return null;
|
|
16035
16045
|
}
|
|
16046
|
+
const description = readString(entry, "description")?.trim();
|
|
16036
16047
|
choices2.push({
|
|
16037
16048
|
value: entry["const"],
|
|
16038
|
-
label: readString(entry, "title") ?? entry["const"]
|
|
16049
|
+
label: readString(entry, "title") ?? entry["const"],
|
|
16050
|
+
...description ? { description } : {}
|
|
16039
16051
|
});
|
|
16040
16052
|
}
|
|
16041
16053
|
return choices2.length > 0 ? choices2 : null;
|
|
@@ -16118,20 +16130,23 @@ function shownField(field, other) {
|
|
|
16118
16130
|
}
|
|
16119
16131
|
return field.kind === "choice" ? { kind: "typedChoice", choices } : null;
|
|
16120
16132
|
}
|
|
16121
|
-
function questionFor(name, schema, field, required, other, message) {
|
|
16133
|
+
function questionFor(name, schema, field, required, other, message, presentation) {
|
|
16122
16134
|
const label = readString(schema, "title")?.trim() || name;
|
|
16123
|
-
const description = readString(schema, "description")?.trim();
|
|
16135
|
+
const description = readString(schema, "description")?.trim() || void 0;
|
|
16136
|
+
const heading = presentation.descriptionIsHeading ? description : void 0;
|
|
16137
|
+
const detail = presentation.descriptionIsHeading ? void 0 : description;
|
|
16138
|
+
const lead = message !== void 0 && message !== label ? message : void 0;
|
|
16124
16139
|
const lines = [
|
|
16125
|
-
...
|
|
16140
|
+
...lead ? [lead, ""] : [],
|
|
16126
16141
|
label,
|
|
16127
|
-
...
|
|
16142
|
+
...detail ? [detail] : [],
|
|
16128
16143
|
...field.kind === "typedChoice" ? [`One of: ${field.choices.map((choice) => choice.label).join(", ")}`] : [],
|
|
16129
16144
|
...field.kind === "number" ? [field.integer ? "Enter a whole number." : "Enter a number."] : []
|
|
16130
16145
|
];
|
|
16131
16146
|
const base = {
|
|
16132
16147
|
id: name,
|
|
16133
16148
|
prompt: lines.join("\n"),
|
|
16134
|
-
shortLabel: label,
|
|
16149
|
+
shortLabel: heading ?? label,
|
|
16135
16150
|
required
|
|
16136
16151
|
};
|
|
16137
16152
|
switch (field.kind) {
|
|
@@ -16270,7 +16285,7 @@ function planConfirmation(message) {
|
|
|
16270
16285
|
}
|
|
16271
16286
|
};
|
|
16272
16287
|
}
|
|
16273
|
-
function planAcpElicitation(params) {
|
|
16288
|
+
function planAcpElicitation(params, presentation) {
|
|
16274
16289
|
if (!isJsonObject(params)) {
|
|
16275
16290
|
return { kind: "unsupported", reason: "the request was malformed" };
|
|
16276
16291
|
}
|
|
@@ -16346,7 +16361,8 @@ function planAcpElicitation(params) {
|
|
|
16346
16361
|
field,
|
|
16347
16362
|
entry.required,
|
|
16348
16363
|
other,
|
|
16349
|
-
planned.length === 0 ? message : void 0
|
|
16364
|
+
planned.length === 0 ? message : void 0,
|
|
16365
|
+
presentation
|
|
16350
16366
|
)
|
|
16351
16367
|
});
|
|
16352
16368
|
}
|
|
@@ -23516,7 +23532,9 @@ function handleElicitationRequest(session, params, responder) {
|
|
|
23516
23532
|
answerWithoutUser(session, responder, COMPACTION_QUESTION_CAUSE);
|
|
23517
23533
|
return;
|
|
23518
23534
|
}
|
|
23519
|
-
const plan = planAcpElicitation(params
|
|
23535
|
+
const plan = planAcpElicitation(params, {
|
|
23536
|
+
descriptionIsHeading: session.dialect.elicitationDescriptionIsHeading === true
|
|
23537
|
+
});
|
|
23520
23538
|
if (plan.kind === "unsupported") {
|
|
23521
23539
|
answerWithoutUser(session, responder, {
|
|
23522
23540
|
kind: "unshowable-request",
|
|
@@ -274,6 +274,15 @@ var completedTurnDisplaySchema = z4.enum(COMPLETED_TURN_DISPLAY_VALUES);
|
|
|
274
274
|
// ../domain/src/plugin-id.ts
|
|
275
275
|
import { z as z5 } from "zod";
|
|
276
276
|
var pluginIdSchema = z5.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
277
|
+
var CORE_PLUGIN_DIRECTORIES = {
|
|
278
|
+
npmPackages: "npm",
|
|
279
|
+
cache: "cache",
|
|
280
|
+
runtime: "runtime",
|
|
281
|
+
stateSnapshots: "snapshots"
|
|
282
|
+
};
|
|
283
|
+
var coreOwnedPluginDirectoryNames = new Set(
|
|
284
|
+
Object.values(CORE_PLUGIN_DIRECTORIES)
|
|
285
|
+
);
|
|
277
286
|
|
|
278
287
|
// ../domain/src/background-task.ts
|
|
279
288
|
import { z as z6 } from "zod";
|
package/dist/provider-bridge.js
CHANGED
|
@@ -1732,6 +1732,15 @@ var completedTurnDisplaySchema = z8.enum(COMPLETED_TURN_DISPLAY_VALUES);
|
|
|
1732
1732
|
// ../domain/src/plugin-id.ts
|
|
1733
1733
|
import { z as z9 } from "zod";
|
|
1734
1734
|
var pluginIdSchema = z9.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1735
|
+
var CORE_PLUGIN_DIRECTORIES = {
|
|
1736
|
+
npmPackages: "npm",
|
|
1737
|
+
cache: "cache",
|
|
1738
|
+
runtime: "runtime",
|
|
1739
|
+
stateSnapshots: "snapshots"
|
|
1740
|
+
};
|
|
1741
|
+
var coreOwnedPluginDirectoryNames = new Set(
|
|
1742
|
+
Object.values(CORE_PLUGIN_DIRECTORIES)
|
|
1743
|
+
);
|
|
1735
1744
|
|
|
1736
1745
|
// ../domain/src/background-task.ts
|
|
1737
1746
|
import { z as z10 } from "zod";
|