@get-bb/plugin-sdk 0.6.73 → 0.6.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-types/bb-plugin-sdk-app.d.ts +137 -8
- package/bundled-types/bb-plugin-sdk-host.d.ts +7 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +20 -1
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-internal-rpc-query-host.d.ts +7 -0
- 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-provider-bridge.d.ts +43 -2
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +4 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +13 -0
- package/bundled-types/bb-plugin-sdk.d.ts +141 -7
- package/dist/app.js +9 -0
- package/dist/index.js +5 -0
- package/dist/internal/host-policy.js +30 -1
- package/dist/internal/plugin-app-collector.js +35 -0
- package/dist/provider-bridge-acp-next.js +29 -9
- package/dist/provider-bridge-acp.js +29 -9
- package/dist/provider-bridge-testing.js +2 -1
- package/dist/provider-bridge.js +139 -13
- package/dist/testing/app.js +44 -0
- package/dist/testing/index.js +36 -4
- package/package.json +2 -1
|
@@ -2905,7 +2905,8 @@ var providerStringsSchema = z20.object({
|
|
|
2905
2905
|
var providerOptionDescriptorSchema = z20.object({
|
|
2906
2906
|
id: z20.string().min(1),
|
|
2907
2907
|
label: z20.string().min(1),
|
|
2908
|
-
description: z20.string().min(1).optional()
|
|
2908
|
+
description: z20.string().min(1).optional(),
|
|
2909
|
+
icon: z20.string().min(1).optional()
|
|
2909
2910
|
});
|
|
2910
2911
|
var providerExtensionKindInfoSchema = z20.object({
|
|
2911
2912
|
item: z20.boolean(),
|
|
@@ -13696,9 +13697,23 @@ function compactionOutcomeForEndTurn(dialect, agentMessage) {
|
|
|
13696
13697
|
}
|
|
13697
13698
|
return OMP_COMPACTION_NOOP_PATTERN.test(text) ? { status: "skipped", detail: text } : { status: "failed", error: text };
|
|
13698
13699
|
}
|
|
13700
|
+
function presentProviderPrefixedModel(model) {
|
|
13701
|
+
const separator = model.id.indexOf("/");
|
|
13702
|
+
if (separator <= 0) {
|
|
13703
|
+
return model;
|
|
13704
|
+
}
|
|
13705
|
+
const routeProviderId = model.id.slice(0, separator);
|
|
13706
|
+
const prefix = `${routeProviderId}/`;
|
|
13707
|
+
return {
|
|
13708
|
+
...model,
|
|
13709
|
+
displayName: model.displayName.startsWith(prefix) ? model.displayName.slice(prefix.length) : model.displayName,
|
|
13710
|
+
routeProviderId
|
|
13711
|
+
};
|
|
13712
|
+
}
|
|
13699
13713
|
var OMP_ACP_DIALECT = {
|
|
13700
13714
|
id: "omp",
|
|
13701
|
-
commandResult: ompCommandResult
|
|
13715
|
+
commandResult: ompCommandResult,
|
|
13716
|
+
presentModel: presentProviderPrefixedModel
|
|
13702
13717
|
};
|
|
13703
13718
|
var openCodeCommandRawOutputSchema = z43.object({
|
|
13704
13719
|
output: z43.unknown().optional(),
|
|
@@ -13731,7 +13746,8 @@ function normalizeOpenCodeCommandEvent(event) {
|
|
|
13731
13746
|
}
|
|
13732
13747
|
var OPENCODE_ACP_DIALECT = {
|
|
13733
13748
|
id: "opencode",
|
|
13734
|
-
normalizeCommandEvent: normalizeOpenCodeCommandEvent
|
|
13749
|
+
normalizeCommandEvent: normalizeOpenCodeCommandEvent,
|
|
13750
|
+
presentModel: presentProviderPrefixedModel
|
|
13735
13751
|
};
|
|
13736
13752
|
var BUILT_IN_DIALECTS = [
|
|
13737
13753
|
GENERIC_ACP_DIALECT,
|
|
@@ -23962,10 +23978,11 @@ function decodeAcpBridgeJsonRpcRequest(raw) {
|
|
|
23962
23978
|
};
|
|
23963
23979
|
}
|
|
23964
23980
|
async function handleModelList(id, params, dialectId) {
|
|
23965
|
-
const
|
|
23981
|
+
const dialect = resolveAcpDialect({
|
|
23966
23982
|
dialectId,
|
|
23967
23983
|
command: params.optionsAgent?.command ?? params.agent?.command ?? ""
|
|
23968
|
-
})
|
|
23984
|
+
});
|
|
23985
|
+
const resolvedDialectId = dialect.id;
|
|
23969
23986
|
const declaredOptions = () => params.optionsAgent ? loadDeclaredSessionOptions(
|
|
23970
23987
|
params.optionsAgent,
|
|
23971
23988
|
params.parameterizedModelPicker,
|
|
@@ -23979,10 +23996,13 @@ async function handleModelList(id, params, dialectId) {
|
|
|
23979
23996
|
id,
|
|
23980
23997
|
splitPrimaryModels(
|
|
23981
23998
|
withDeclaredOptions(
|
|
23982
|
-
applyConfiguredReasoningToModels(
|
|
23983
|
-
|
|
23984
|
-
|
|
23985
|
-
|
|
23999
|
+
applyConfiguredReasoningToModels(
|
|
24000
|
+
models.map((model) => dialect.presentModel?.(model) ?? model),
|
|
24001
|
+
{
|
|
24002
|
+
reasoningCli: params.reasoningCli,
|
|
24003
|
+
nativeReasoning: params.nativeReasoning
|
|
24004
|
+
}
|
|
24005
|
+
),
|
|
23986
24006
|
await declaredOptions()
|
|
23987
24007
|
),
|
|
23988
24008
|
params.primaryModels
|
|
@@ -2008,7 +2008,8 @@ var providerStringsSchema = z18.object({
|
|
|
2008
2008
|
var providerOptionDescriptorSchema = z18.object({
|
|
2009
2009
|
id: z18.string().min(1),
|
|
2010
2010
|
label: z18.string().min(1),
|
|
2011
|
-
description: z18.string().min(1).optional()
|
|
2011
|
+
description: z18.string().min(1).optional(),
|
|
2012
|
+
icon: z18.string().min(1).optional()
|
|
2012
2013
|
});
|
|
2013
2014
|
var providerExtensionKindInfoSchema = z18.object({
|
|
2014
2015
|
item: z18.boolean(),
|
package/dist/provider-bridge.js
CHANGED
|
@@ -661,11 +661,11 @@ function describeResultContentBlock(block) {
|
|
|
661
661
|
if (!type) {
|
|
662
662
|
return null;
|
|
663
663
|
}
|
|
664
|
-
const
|
|
664
|
+
const path10 = getStringProperty(block, "path");
|
|
665
665
|
const toolName = getStringProperty(block, "tool_name");
|
|
666
666
|
const url = getStringProperty(block, "url") ?? getStringProperty(block, "imageUrl");
|
|
667
|
-
if (
|
|
668
|
-
return `[${type}: ${
|
|
667
|
+
if (path10) {
|
|
668
|
+
return `[${type}: ${path10}]`;
|
|
669
669
|
}
|
|
670
670
|
if (toolName) {
|
|
671
671
|
return `[${type}: ${toolName}]`;
|
|
@@ -3425,7 +3425,8 @@ var providerStringsSchema = z22.object({
|
|
|
3425
3425
|
var providerOptionDescriptorSchema = z22.object({
|
|
3426
3426
|
id: z22.string().min(1),
|
|
3427
3427
|
label: z22.string().min(1),
|
|
3428
|
-
description: z22.string().min(1).optional()
|
|
3428
|
+
description: z22.string().min(1).optional(),
|
|
3429
|
+
icon: z22.string().min(1).optional()
|
|
3429
3430
|
});
|
|
3430
3431
|
var providerExtensionKindInfoSchema = z22.object({
|
|
3431
3432
|
item: z22.boolean(),
|
|
@@ -3847,9 +3848,9 @@ function presentationDetail(text) {
|
|
|
3847
3848
|
function withTitle(presentation, title) {
|
|
3848
3849
|
return title === void 0 ? presentation : { ...presentation, title };
|
|
3849
3850
|
}
|
|
3850
|
-
function presentationFileName(
|
|
3851
|
-
const segments =
|
|
3852
|
-
return segments[segments.length - 1] ??
|
|
3851
|
+
function presentationFileName(path10) {
|
|
3852
|
+
const segments = path10.split("/").filter((segment) => segment.length > 0);
|
|
3853
|
+
return segments[segments.length - 1] ?? path10;
|
|
3853
3854
|
}
|
|
3854
3855
|
var COMPACTION_PRESENTATION = {
|
|
3855
3856
|
label: { pending: "Compacting context", completed: "Compacted context" },
|
|
@@ -3859,13 +3860,13 @@ var REASONING_PRESENTATION = {
|
|
|
3859
3860
|
label: { pending: "Thinking", completed: "Thought" },
|
|
3860
3861
|
icon: { glyph: "Brain" }
|
|
3861
3862
|
};
|
|
3862
|
-
function fileReadPresentation(
|
|
3863
|
+
function fileReadPresentation(path10) {
|
|
3863
3864
|
return withTitle(
|
|
3864
3865
|
{
|
|
3865
3866
|
label: { pending: "Reading file", completed: "Read file" },
|
|
3866
3867
|
icon: { glyph: "FileText" }
|
|
3867
3868
|
},
|
|
3868
|
-
presentationTitle(presentationFileName(
|
|
3869
|
+
presentationTitle(presentationFileName(path10))
|
|
3869
3870
|
);
|
|
3870
3871
|
}
|
|
3871
3872
|
function searchPresentation(args) {
|
|
@@ -8520,13 +8521,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
|
|
|
8520
8521
|
}
|
|
8521
8522
|
};
|
|
8522
8523
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
8523
|
-
for (const { path:
|
|
8524
|
-
const pathString = typeof
|
|
8524
|
+
for (const { path: path10, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
8525
|
+
const pathString = typeof path10 === "string" ? path10 : path10.toString();
|
|
8525
8526
|
if (append || outputFiles.has(pathString)) {
|
|
8526
|
-
appendFileSync(
|
|
8527
|
+
appendFileSync(path10, serializedResult);
|
|
8527
8528
|
} else {
|
|
8528
8529
|
outputFiles.add(pathString);
|
|
8529
|
-
writeFileSync(
|
|
8530
|
+
writeFileSync(path10, serializedResult);
|
|
8530
8531
|
}
|
|
8531
8532
|
}
|
|
8532
8533
|
};
|
|
@@ -12271,6 +12272,129 @@ var claudeTaskToolOutputSchema = z37.union([
|
|
|
12271
12272
|
claudeTaskListOutputSchema,
|
|
12272
12273
|
claudeTaskUpdateOutputSchema
|
|
12273
12274
|
]);
|
|
12275
|
+
|
|
12276
|
+
// ../skill-index/src/index.ts
|
|
12277
|
+
import { createHash } from "node:crypto";
|
|
12278
|
+
import fs2 from "node:fs/promises";
|
|
12279
|
+
import path9 from "node:path";
|
|
12280
|
+
var SKILL_FILE_NAME = "SKILL.md";
|
|
12281
|
+
var MAX_SCAN_DEPTH = 24;
|
|
12282
|
+
var MAX_SCAN_ENTRY_COUNT = 1e3;
|
|
12283
|
+
var MAX_SKILL_FILE_BYTES = 25 * 1024 * 1024;
|
|
12284
|
+
function isWithinSkillBoundary(boundary, candidate) {
|
|
12285
|
+
const relative = path9.relative(boundary, candidate);
|
|
12286
|
+
return relative === "" || !relative.startsWith(`..${path9.sep}`) && relative !== ".." && !path9.isAbsolute(relative);
|
|
12287
|
+
}
|
|
12288
|
+
async function resolveSkillPath(filePath, boundaryPath) {
|
|
12289
|
+
const realPath = await fs2.realpath(filePath).catch(() => null);
|
|
12290
|
+
if (realPath === null || boundaryPath === null) return realPath;
|
|
12291
|
+
const boundary = await fs2.realpath(boundaryPath).catch(() => null);
|
|
12292
|
+
return boundary !== null && isWithinSkillBoundary(boundary, realPath) ? realPath : null;
|
|
12293
|
+
}
|
|
12294
|
+
async function isSymbolicLinkPath(filePath) {
|
|
12295
|
+
return (await fs2.lstat(filePath).catch(() => null))?.isSymbolicLink() ?? false;
|
|
12296
|
+
}
|
|
12297
|
+
async function findSkillFiles(root) {
|
|
12298
|
+
const files = [];
|
|
12299
|
+
const visited = /* @__PURE__ */ new Set();
|
|
12300
|
+
let remainingEntries = MAX_SCAN_ENTRY_COUNT;
|
|
12301
|
+
const charged = (entry) => root.shape === "command" || root.shape === "skill-recursive" && (entry.isDirectory() || entry.isSymbolicLink());
|
|
12302
|
+
if (await resolveSkillPath(root.path, root.boundaryPath) === null) {
|
|
12303
|
+
return files;
|
|
12304
|
+
}
|
|
12305
|
+
const rootLinked = await isSymbolicLinkPath(root.path);
|
|
12306
|
+
async function add(filePath, name, linked) {
|
|
12307
|
+
const realPath = await resolveSkillPath(filePath, root.boundaryPath);
|
|
12308
|
+
if (realPath === null) return;
|
|
12309
|
+
const stat = await fs2.stat(realPath).catch(() => null);
|
|
12310
|
+
if (!stat?.isFile()) return;
|
|
12311
|
+
files.push({
|
|
12312
|
+
filePath,
|
|
12313
|
+
realPath,
|
|
12314
|
+
name,
|
|
12315
|
+
linked: linked || await isSymbolicLinkPath(filePath)
|
|
12316
|
+
});
|
|
12317
|
+
}
|
|
12318
|
+
async function walk(directory, depth, linked) {
|
|
12319
|
+
if (depth > MAX_SCAN_DEPTH) return;
|
|
12320
|
+
const leaf = root.shape === "skill-directory" || root.shape === "skill" && depth === 1;
|
|
12321
|
+
const realPath = await resolveSkillPath(directory, root.boundaryPath);
|
|
12322
|
+
if (realPath === null || !leaf && visited.has(realPath)) return;
|
|
12323
|
+
const stat = await fs2.stat(realPath).catch(() => null);
|
|
12324
|
+
if (!stat?.isDirectory()) return;
|
|
12325
|
+
if (!leaf) visited.add(realPath);
|
|
12326
|
+
if (depth > 0 && root.skipIfManifest !== void 0 && (await fs2.stat(path9.join(directory, root.skipIfManifest)).catch(() => null))?.isFile()) {
|
|
12327
|
+
return;
|
|
12328
|
+
}
|
|
12329
|
+
const handle = await fs2.opendir(directory).catch(() => null);
|
|
12330
|
+
if (handle === null) return;
|
|
12331
|
+
const entries = [];
|
|
12332
|
+
for await (const entry of handle) {
|
|
12333
|
+
if (entry.name === ".git" || entry.name === "node_modules") continue;
|
|
12334
|
+
if (charged(entry)) {
|
|
12335
|
+
if (remainingEntries === 0) continue;
|
|
12336
|
+
remainingEntries -= 1;
|
|
12337
|
+
}
|
|
12338
|
+
entries.push(entry);
|
|
12339
|
+
}
|
|
12340
|
+
entries.sort((a2, b) => a2.name.localeCompare(b.name));
|
|
12341
|
+
if ((leaf || root.shape === "skill-recursive") && entries.some((entry) => entry.name === SKILL_FILE_NAME)) {
|
|
12342
|
+
await add(
|
|
12343
|
+
path9.join(directory, SKILL_FILE_NAME),
|
|
12344
|
+
path9.basename(directory),
|
|
12345
|
+
linked
|
|
12346
|
+
);
|
|
12347
|
+
}
|
|
12348
|
+
if (leaf) return;
|
|
12349
|
+
for (const entry of entries) {
|
|
12350
|
+
const entryPath = path9.join(directory, entry.name);
|
|
12351
|
+
const target = await resolveSkillPath(entryPath, root.boundaryPath);
|
|
12352
|
+
if (target === null) continue;
|
|
12353
|
+
const entryStat = await fs2.stat(target).catch(() => null);
|
|
12354
|
+
const entryLinked = linked || entry.isSymbolicLink();
|
|
12355
|
+
if (entryStat?.isDirectory()) {
|
|
12356
|
+
await walk(entryPath, depth + 1, entryLinked);
|
|
12357
|
+
} else if (root.shape === "command" && entry.name.endsWith(".md")) {
|
|
12358
|
+
await add(
|
|
12359
|
+
entryPath,
|
|
12360
|
+
path9.relative(root.path, entryPath).slice(0, -3).split(path9.sep).join(":"),
|
|
12361
|
+
entryLinked
|
|
12362
|
+
);
|
|
12363
|
+
}
|
|
12364
|
+
}
|
|
12365
|
+
}
|
|
12366
|
+
if (root.shape === "skill-file" || root.shape === "command-file") {
|
|
12367
|
+
await add(
|
|
12368
|
+
root.path,
|
|
12369
|
+
root.fallbackName ?? path9.basename(root.path, ".md"),
|
|
12370
|
+
rootLinked
|
|
12371
|
+
);
|
|
12372
|
+
} else {
|
|
12373
|
+
await walk(root.path, 0, rootLinked);
|
|
12374
|
+
}
|
|
12375
|
+
return files;
|
|
12376
|
+
}
|
|
12377
|
+
async function scanSkillFiles(root) {
|
|
12378
|
+
const indexed = [];
|
|
12379
|
+
for (const file of await findSkillFiles(root)) {
|
|
12380
|
+
const stat = await fs2.stat(file.realPath).catch(() => null);
|
|
12381
|
+
if (stat === null || stat.size > MAX_SKILL_FILE_BYTES) continue;
|
|
12382
|
+
const bytes = await fs2.readFile(file.realPath).catch(() => null);
|
|
12383
|
+
if (bytes === null || bytes.length > MAX_SKILL_FILE_BYTES) continue;
|
|
12384
|
+
indexed.push({
|
|
12385
|
+
...file,
|
|
12386
|
+
content: bytes.toString("utf8"),
|
|
12387
|
+
contentSha256: createHash("sha256").update(bytes).digest("hex")
|
|
12388
|
+
});
|
|
12389
|
+
}
|
|
12390
|
+
return indexed;
|
|
12391
|
+
}
|
|
12392
|
+
function selectedSkillMentions(input) {
|
|
12393
|
+
return input.mentions.filter((mention) => {
|
|
12394
|
+
const { start, end, resource } = mention;
|
|
12395
|
+
return resource.kind === "command" && resource.source === "skill" && typeof resource.name === "string" && (resource.trigger === "/" || resource.trigger === "$") && Number.isInteger(start) && Number.isInteger(end) && start >= 0 && start < end && end <= input.text.length && input.text.slice(start, end) === `${resource.trigger}${resource.name}`;
|
|
12396
|
+
});
|
|
12397
|
+
}
|
|
12274
12398
|
export {
|
|
12275
12399
|
BRIDGE_INBOUND_REQUEST_METHODS,
|
|
12276
12400
|
BRIDGE_JSON_RPC_ERRORS,
|
|
@@ -12362,7 +12486,9 @@ export {
|
|
|
12362
12486
|
readCliVersion as experimental_readCliVersion,
|
|
12363
12487
|
experimental_recordProviderChildIo,
|
|
12364
12488
|
resolveExecutablePath as experimental_resolveExecutablePath,
|
|
12489
|
+
scanSkillFiles as experimental_scanSkillFiles,
|
|
12365
12490
|
searchPresentation as experimental_searchPresentation,
|
|
12491
|
+
selectedSkillMentions as experimental_selectedSkillMentions,
|
|
12366
12492
|
spawnPortableProcess as experimental_spawnPortableProcess,
|
|
12367
12493
|
toolPresentation as experimental_toolPresentation,
|
|
12368
12494
|
versionFrom as experimental_versionFrom,
|
package/dist/testing/app.js
CHANGED
|
@@ -3684,6 +3684,10 @@ var experimental_THREAD_ACTION_GROUPS = {
|
|
|
3684
3684
|
};
|
|
3685
3685
|
|
|
3686
3686
|
// src/thread-info-groups.ts
|
|
3687
|
+
var experimental_THREAD_CONTEXT_SEGMENT_GROUPS = {
|
|
3688
|
+
thread: "1_thread",
|
|
3689
|
+
git: "3_git"
|
|
3690
|
+
};
|
|
3687
3691
|
var experimental_THREAD_INFO_ROW_GROUPS = {
|
|
3688
3692
|
thread: "1_thread",
|
|
3689
3693
|
environment: "2_environment",
|
|
@@ -3947,6 +3951,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
3947
3951
|
threadLists: [],
|
|
3948
3952
|
experimentalSidebarNavigations: [],
|
|
3949
3953
|
threadHeaderActions: [],
|
|
3954
|
+
threadContextSegments: [],
|
|
3950
3955
|
threadInfoRows: [],
|
|
3951
3956
|
threadInfoSections: [],
|
|
3952
3957
|
threadActions: [],
|
|
@@ -3982,6 +3987,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
3982
3987
|
sidebarNavigation: /* @__PURE__ */ new Set(),
|
|
3983
3988
|
sidebarHeader: /* @__PURE__ */ new Set(),
|
|
3984
3989
|
threadHeaderAction: /* @__PURE__ */ new Set(),
|
|
3990
|
+
threadContextSegment: /* @__PURE__ */ new Set(),
|
|
3985
3991
|
threadInfoRow: /* @__PURE__ */ new Set(),
|
|
3986
3992
|
threadInfoSection: /* @__PURE__ */ new Set(),
|
|
3987
3993
|
threadAction: /* @__PURE__ */ new Set(),
|
|
@@ -4318,6 +4324,39 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
4318
4324
|
component: requireComponent(kind, registration.component)
|
|
4319
4325
|
});
|
|
4320
4326
|
},
|
|
4327
|
+
experimental_threadContextSegment(registration) {
|
|
4328
|
+
const kind = "slots.experimental_threadContextSegment";
|
|
4329
|
+
const id = requireSlotId(kind, registration?.id);
|
|
4330
|
+
requireUniqueId(kind, seenIds.threadContextSegment, id);
|
|
4331
|
+
const optionalComponent = (field) => {
|
|
4332
|
+
const value = registration[field];
|
|
4333
|
+
if (value === void 0) return {};
|
|
4334
|
+
if (typeof value !== "function") {
|
|
4335
|
+
throw new Error(
|
|
4336
|
+
`${kind}: "${field}" must be a React component function`
|
|
4337
|
+
);
|
|
4338
|
+
}
|
|
4339
|
+
return { [field]: value };
|
|
4340
|
+
};
|
|
4341
|
+
if (typeof registration.summary !== "function") {
|
|
4342
|
+
throw new Error(
|
|
4343
|
+
`${kind}: "summary" must be a React component function`
|
|
4344
|
+
);
|
|
4345
|
+
}
|
|
4346
|
+
if (registration.useVisible !== void 0 && typeof registration.useVisible !== "function") {
|
|
4347
|
+
throw new Error(`${kind}: "useVisible" must be a function`);
|
|
4348
|
+
}
|
|
4349
|
+
collected.threadContextSegments.push({
|
|
4350
|
+
id,
|
|
4351
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
4352
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
4353
|
+
...requireOptionalOrder(kind, registration.order),
|
|
4354
|
+
summary: registration.summary,
|
|
4355
|
+
...optionalComponent("action"),
|
|
4356
|
+
...optionalComponent("details"),
|
|
4357
|
+
...registration.useVisible !== void 0 ? { useVisible: registration.useVisible } : {}
|
|
4358
|
+
});
|
|
4359
|
+
},
|
|
4321
4360
|
experimental_threadInfoRow(registration) {
|
|
4322
4361
|
const kind = "slots.experimental_threadInfoRow";
|
|
4323
4362
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -5491,6 +5530,9 @@ var testPluginSdkApp = {
|
|
|
5491
5530
|
useSettings() {
|
|
5492
5531
|
return useSlotEnv("useSettings").settingsState;
|
|
5493
5532
|
},
|
|
5533
|
+
experimental_useExperiment(key) {
|
|
5534
|
+
return useSlotEnv("experimental_useExperiment").experiments.has(key);
|
|
5535
|
+
},
|
|
5494
5536
|
useBbContext() {
|
|
5495
5537
|
return useSlotEnv("useBbContext").bbContext;
|
|
5496
5538
|
},
|
|
@@ -5648,6 +5690,7 @@ var testPluginSdkApp = {
|
|
|
5648
5690
|
experimental_ThreadActionsContextMenu: TestThreadActionsContextMenu,
|
|
5649
5691
|
experimental_PluginRpcCallError,
|
|
5650
5692
|
experimental_THREAD_ACTION_GROUPS,
|
|
5693
|
+
experimental_THREAD_CONTEXT_SEGMENT_GROUPS,
|
|
5651
5694
|
experimental_THREAD_INFO_ROW_GROUPS,
|
|
5652
5695
|
experimental_THREAD_INFO_SECTION_GROUPS,
|
|
5653
5696
|
experimental_useSidebarNavigation() {
|
|
@@ -6542,6 +6585,7 @@ ${block}
|
|
|
6542
6585
|
threadActions: options.threadActions ?? NO_THREAD_ACTIONS,
|
|
6543
6586
|
threadActionRegistrations: options.threadActionRegistrations ?? NO_THREAD_ACTION_REGISTRATIONS,
|
|
6544
6587
|
sidebarDraftThreadIds,
|
|
6588
|
+
experiments: new Set(options.experiments ?? []),
|
|
6545
6589
|
sidebarRowStatuses,
|
|
6546
6590
|
sidebarShortcuts,
|
|
6547
6591
|
sidebarSplitLayout: options.sidebarSplitLayout ?? null,
|
package/dist/testing/index.js
CHANGED
|
@@ -974,10 +974,21 @@ function validateProviderOptionDescriptors(args) {
|
|
|
974
974
|
field: `${field}[${index}].description`,
|
|
975
975
|
value: record.description
|
|
976
976
|
});
|
|
977
|
+
const icon = record.experimental_icon === void 0 ? void 0 : requireNonBlankString({
|
|
978
|
+
providerId,
|
|
979
|
+
field: `${field}[${index}].experimental_icon`,
|
|
980
|
+
value: record.experimental_icon
|
|
981
|
+
});
|
|
982
|
+
if (icon !== void 0 && !isNamespacedGlyph(icon) && /[/\\]/u.test(icon)) {
|
|
983
|
+
throw new Error(
|
|
984
|
+
`provider "${providerId}" ${field}[${index}].experimental_icon must be a host glyph name ("Zap") or a declared icon ("<pluginId>/<name>")`
|
|
985
|
+
);
|
|
986
|
+
}
|
|
977
987
|
return Object.freeze({
|
|
978
988
|
id,
|
|
979
989
|
label,
|
|
980
|
-
...description === void 0 ? {} : { description }
|
|
990
|
+
...description === void 0 ? {} : { description },
|
|
991
|
+
...icon === void 0 ? {} : { experimental_icon: icon }
|
|
981
992
|
});
|
|
982
993
|
}
|
|
983
994
|
);
|
|
@@ -1967,6 +1978,23 @@ function undeclaredIconProblem(pluginId, declaredIconNames, glyph) {
|
|
|
1967
1978
|
function providerIconRefusalMessage(providerId, problem) {
|
|
1968
1979
|
return `provider "${providerId}" icon ${problem}`;
|
|
1969
1980
|
}
|
|
1981
|
+
function providerDeclarationIconRefusal(pluginId, declaredIconNames, declaration) {
|
|
1982
|
+
const iconProblem = declaration.icon === void 0 ? null : undeclaredIconProblem(pluginId, declaredIconNames, declaration.icon);
|
|
1983
|
+
if (iconProblem !== null) {
|
|
1984
|
+
return providerIconRefusalMessage(declaration.id, iconProblem);
|
|
1985
|
+
}
|
|
1986
|
+
for (const [index, tier] of (declaration.serviceTiers ?? []).entries()) {
|
|
1987
|
+
const tierProblem = tier.experimental_icon === void 0 ? null : undeclaredIconProblem(
|
|
1988
|
+
pluginId,
|
|
1989
|
+
declaredIconNames,
|
|
1990
|
+
tier.experimental_icon
|
|
1991
|
+
);
|
|
1992
|
+
if (tierProblem !== null) {
|
|
1993
|
+
return `provider "${declaration.id}" serviceTiers[${index}].experimental_icon ${tierProblem}`;
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return null;
|
|
1997
|
+
}
|
|
1970
1998
|
function agentToolIconRefusalMessage(toolName, problem) {
|
|
1971
1999
|
return `tool "${toolName}" presentation.icon ${problem}`;
|
|
1972
2000
|
}
|
|
@@ -3335,9 +3363,13 @@ function createFakePluginHostInternal(options, sharedState) {
|
|
|
3335
3363
|
function registerProviderDeclaration(declaration) {
|
|
3336
3364
|
assertLive();
|
|
3337
3365
|
const normalized = validatePluginProviderDeclaration(declaration);
|
|
3338
|
-
const
|
|
3339
|
-
|
|
3340
|
-
|
|
3366
|
+
const iconRefusal = providerDeclarationIconRefusal(
|
|
3367
|
+
pluginId,
|
|
3368
|
+
declaredIconNames,
|
|
3369
|
+
normalized
|
|
3370
|
+
);
|
|
3371
|
+
if (iconRefusal !== null) {
|
|
3372
|
+
throw new Error(iconRefusal);
|
|
3341
3373
|
}
|
|
3342
3374
|
if (options.experimental_hostEntry === false) {
|
|
3343
3375
|
throw new Error(providerWithoutBridgeMessage(normalized.id));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@get-bb/plugin-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.79",
|
|
4
4
|
"homepage": "https://github.com/get-bb/bb#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/get-bb/bb/issues"
|
|
@@ -163,6 +163,7 @@
|
|
|
163
163
|
"@bb/provider-bridge-protocol": "workspace:*",
|
|
164
164
|
"@bb/sdk": "workspace:*",
|
|
165
165
|
"@bb/server-contract": "workspace:*",
|
|
166
|
+
"@bb/skill-index": "workspace:*",
|
|
166
167
|
"@bb/tsconfig": "workspace:*",
|
|
167
168
|
"@testing-library/react": "^16.3.2",
|
|
168
169
|
"@types/better-sqlite3": "^7.6.12",
|