@get-bb/plugin-sdk 0.6.94 → 0.6.104
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 +504 -121
- package/bundled-types/bb-plugin-sdk-host.d.ts +64 -64
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +18 -8
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +4 -1
- package/bundled-types/bb-plugin-sdk-internal-rpc-query-host.d.ts +6 -6
- package/bundled-types/bb-plugin-sdk-internal-rpc-tags.d.ts +1 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +4 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +4 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +4 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +12 -1
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +20 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +19 -10
- package/bundled-types/bb-plugin-sdk.d.ts +575 -183
- package/dist/app.js +20 -0
- package/dist/host.js +12 -7
- package/dist/internal/host-policy.js +9 -5
- package/dist/internal/plugin-app-collector.js +45 -0
- package/dist/internal/rpc-query-host.js +4 -10
- package/dist/process.js +12 -7
- package/dist/provider-bridge-acp-next.js +2172 -2023
- package/dist/provider-bridge-acp.js +2172 -2023
- package/dist/provider-bridge-testing.js +126 -134
- package/dist/provider-bridge.js +622 -599
- package/dist/testing/app.js +120 -11
- package/dist/testing/index.js +26 -6
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -187,6 +187,12 @@ var experimental_DetailRow = runtimeComponent(
|
|
|
187
187
|
"experimental_DetailRow"
|
|
188
188
|
);
|
|
189
189
|
var experimental_InfoList = runtimeComponent("experimental_InfoList");
|
|
190
|
+
var experimental_ThreadContextCardRow = runtimeComponent(
|
|
191
|
+
"experimental_ThreadContextCardRow"
|
|
192
|
+
);
|
|
193
|
+
var experimental_PanelTabIcon = runtimeComponent(
|
|
194
|
+
"experimental_PanelTabIcon"
|
|
195
|
+
);
|
|
190
196
|
var experimental_InfoListRow = runtimeComponent(
|
|
191
197
|
"experimental_InfoListRow"
|
|
192
198
|
);
|
|
@@ -222,6 +228,9 @@ var experimental_useCanOpenFileExternally = runtimeFunction(
|
|
|
222
228
|
var experimental_useTabVisible = runtimeFunction(
|
|
223
229
|
"experimental_useTabVisible"
|
|
224
230
|
);
|
|
231
|
+
var experimental_useServers = runtimeFunction(
|
|
232
|
+
"experimental_useServers"
|
|
233
|
+
);
|
|
225
234
|
var experimental_useAppPanel = runtimeFunction(
|
|
226
235
|
"experimental_useAppPanel"
|
|
227
236
|
);
|
|
@@ -306,6 +315,12 @@ var experimental_ThreadActionsContextMenu = runtimeComponent(
|
|
|
306
315
|
var experimental_useExperiment = runtimeFunction(
|
|
307
316
|
"experimental_useExperiment"
|
|
308
317
|
);
|
|
318
|
+
var experimental_useThreadContextKind = runtimeFunction(
|
|
319
|
+
"experimental_useThreadContextKind"
|
|
320
|
+
);
|
|
321
|
+
var experimental_usePanelTabs = runtimeFunction(
|
|
322
|
+
"experimental_usePanelTabs"
|
|
323
|
+
);
|
|
309
324
|
var experimental_useSidebarThreadSplit = runtimeFunction(
|
|
310
325
|
"experimental_useSidebarThreadSplit"
|
|
311
326
|
);
|
|
@@ -377,6 +392,7 @@ export {
|
|
|
377
392
|
experimental_InfoListRow,
|
|
378
393
|
experimental_InfoSection,
|
|
379
394
|
experimental_NewThreadComposer,
|
|
395
|
+
experimental_PanelTabIcon,
|
|
380
396
|
experimental_PermissionModePicker,
|
|
381
397
|
experimental_PluginIcon,
|
|
382
398
|
experimental_PluginRpcCallError,
|
|
@@ -392,6 +408,7 @@ export {
|
|
|
392
408
|
experimental_THREAD_INFO_SECTION_GROUPS,
|
|
393
409
|
experimental_ThreadActionsContextMenu,
|
|
394
410
|
experimental_ThreadActionsMenu,
|
|
411
|
+
experimental_ThreadContextCardRow,
|
|
395
412
|
experimental_ThreadRowMetadata,
|
|
396
413
|
experimental_ThreadStatusGlyph,
|
|
397
414
|
experimental_ThreadTitleText,
|
|
@@ -417,6 +434,7 @@ export {
|
|
|
417
434
|
experimental_useComposerRenderer,
|
|
418
435
|
experimental_useExperiment,
|
|
419
436
|
experimental_useFixedTabTarget,
|
|
437
|
+
experimental_usePanelTabs,
|
|
420
438
|
experimental_usePluginId,
|
|
421
439
|
experimental_useProviders,
|
|
422
440
|
experimental_useQuestionFormHost,
|
|
@@ -424,6 +442,7 @@ export {
|
|
|
424
442
|
experimental_useRpcMutation,
|
|
425
443
|
experimental_useRpcQuery,
|
|
426
444
|
experimental_useRpcRefresh,
|
|
445
|
+
experimental_useServers,
|
|
427
446
|
experimental_useSidebarNavigation,
|
|
428
447
|
experimental_useSidebarNavigationSplit,
|
|
429
448
|
experimental_useSidebarThreadActions,
|
|
@@ -432,6 +451,7 @@ export {
|
|
|
432
451
|
experimental_useTabVisible,
|
|
433
452
|
experimental_useThreadActionRegistrations,
|
|
434
453
|
experimental_useThreadActions,
|
|
454
|
+
experimental_useThreadContextKind,
|
|
435
455
|
experimental_useThreadTitleDisplayText,
|
|
436
456
|
useBbContext,
|
|
437
457
|
useBbNavigate,
|
package/dist/host.js
CHANGED
|
@@ -1373,14 +1373,19 @@ function observe(child) {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
function spawnHostProcess(command, args = [], options = {}) {
|
|
1375
1375
|
const launch = options.shell ? { command, args: [...args], env: hostToolchain.environment(options.env) } : hostToolchain.command(command, args, options);
|
|
1376
|
+
const spawnOptions = {
|
|
1377
|
+
...options,
|
|
1378
|
+
env: launch.env,
|
|
1379
|
+
windowsHide: options.windowsHide ?? true
|
|
1380
|
+
};
|
|
1381
|
+
if (process.platform === "win32" && !options.shell && /[\\/]/u.test(command)) {
|
|
1382
|
+
const parsed = parse(launch.command, launch.args, spawnOptions);
|
|
1383
|
+
return observe(
|
|
1384
|
+
parsed.file ? nodeSpawn(parsed.command, parsed.args, parsed.options) : nodeSpawn(launch.command, launch.args, spawnOptions)
|
|
1385
|
+
);
|
|
1386
|
+
}
|
|
1376
1387
|
const spawn2 = options.shell ? nodeSpawn : crossSpawn;
|
|
1377
|
-
return observe(
|
|
1378
|
-
spawn2(launch.command, launch.args, {
|
|
1379
|
-
...options,
|
|
1380
|
-
env: launch.env,
|
|
1381
|
-
windowsHide: options.windowsHide ?? true
|
|
1382
|
-
})
|
|
1383
|
-
);
|
|
1388
|
+
return observe(spawn2(launch.command, launch.args, spawnOptions));
|
|
1384
1389
|
}
|
|
1385
1390
|
function prepareExecFile(command, args, options) {
|
|
1386
1391
|
const launch = hostToolchain.command(command, args, options);
|
|
@@ -419,7 +419,10 @@ function registerSettingDescriptors(target, added) {
|
|
|
419
419
|
`invalid setting key "${key}" \u2014 use letters, digits, "-" and "_"`
|
|
420
420
|
);
|
|
421
421
|
}
|
|
422
|
-
if (key
|
|
422
|
+
if (key === "__proto__") {
|
|
423
|
+
throw new Error(`setting key "${key}" is reserved`);
|
|
424
|
+
}
|
|
425
|
+
if (Object.hasOwn(target, key)) {
|
|
423
426
|
throw new Error(`setting "${key}" is already defined`);
|
|
424
427
|
}
|
|
425
428
|
const parsed = settingDescriptorSchema.safeParse(raw);
|
|
@@ -482,7 +485,10 @@ function settingSchemaError(key, schema, value) {
|
|
|
482
485
|
function validateSettingsUpdate(descriptors, values) {
|
|
483
486
|
const errors = [];
|
|
484
487
|
for (const [key, value] of Object.entries(values)) {
|
|
485
|
-
const descriptor =
|
|
488
|
+
const descriptor = Object.hasOwn(
|
|
489
|
+
descriptors,
|
|
490
|
+
key
|
|
491
|
+
) ? descriptors[key] : void 0;
|
|
486
492
|
if (!descriptor) {
|
|
487
493
|
errors.push(`unknown setting "${key}"`);
|
|
488
494
|
continue;
|
|
@@ -2134,9 +2140,7 @@ function runPluginStorageMigrations(database, statements) {
|
|
|
2134
2140
|
if (!migrationColumns.some((column) => column.name === "statement_hash")) {
|
|
2135
2141
|
database.exec("ALTER TABLE _bb_migrations ADD COLUMN statement_hash TEXT");
|
|
2136
2142
|
}
|
|
2137
|
-
const rows = database.prepare(
|
|
2138
|
-
"SELECT id, statement_hash FROM _bb_migrations ORDER BY id"
|
|
2139
|
-
).all();
|
|
2143
|
+
const rows = database.prepare("SELECT id, statement_hash FROM _bb_migrations ORDER BY id").all();
|
|
2140
2144
|
const applied = /* @__PURE__ */ new Map();
|
|
2141
2145
|
for (const row of rows) applied.set(row.id, row.statement_hash);
|
|
2142
2146
|
const statementHashes = statements.map(migrationStatementHash);
|
|
@@ -503,6 +503,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
503
503
|
threadInfoRows: [],
|
|
504
504
|
threadRowMetadata: [],
|
|
505
505
|
threadInfoSections: [],
|
|
506
|
+
threadContextCardRows: [],
|
|
507
|
+
threadContextCardSections: [],
|
|
506
508
|
threadActions: [],
|
|
507
509
|
browserToolbarActions: [],
|
|
508
510
|
fileOpeners: [],
|
|
@@ -512,6 +514,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
512
514
|
messageDirectives: [],
|
|
513
515
|
codeFenceRenderers: [],
|
|
514
516
|
messageActions: [],
|
|
517
|
+
messageMetadata: [],
|
|
515
518
|
commandPaletteActions: [],
|
|
516
519
|
providerIcons: [],
|
|
517
520
|
icons: [],
|
|
@@ -540,6 +543,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
540
543
|
threadInfoRow: /* @__PURE__ */ new Set(),
|
|
541
544
|
threadRowMetadata: /* @__PURE__ */ new Set(),
|
|
542
545
|
threadInfoSection: /* @__PURE__ */ new Set(),
|
|
546
|
+
threadContextCardRow: /* @__PURE__ */ new Set(),
|
|
547
|
+
threadContextCardSection: /* @__PURE__ */ new Set(),
|
|
543
548
|
threadAction: /* @__PURE__ */ new Set(),
|
|
544
549
|
browserToolbarAction: /* @__PURE__ */ new Set(),
|
|
545
550
|
fileOpener: /* @__PURE__ */ new Set(),
|
|
@@ -550,6 +555,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
550
555
|
codeFenceRenderer: /* @__PURE__ */ new Set(),
|
|
551
556
|
codeFenceLanguage: /* @__PURE__ */ new Set(),
|
|
552
557
|
messageAction: /* @__PURE__ */ new Set(),
|
|
558
|
+
messageMetadata: /* @__PURE__ */ new Set(),
|
|
553
559
|
command: /* @__PURE__ */ new Set(),
|
|
554
560
|
providerIcon: /* @__PURE__ */ new Set(),
|
|
555
561
|
timelineRenderer: /* @__PURE__ */ new Set(),
|
|
@@ -942,6 +948,29 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
942
948
|
component: requireComponent(kind, registration.component)
|
|
943
949
|
});
|
|
944
950
|
},
|
|
951
|
+
experimental_threadContextCardRow(registration) {
|
|
952
|
+
const kind = "slots.experimental_threadContextCardRow";
|
|
953
|
+
const id = requireSlotId(kind, registration?.id);
|
|
954
|
+
requireUniqueId(kind, seenIds.threadContextCardRow, id);
|
|
955
|
+
collected.threadContextCardRows.push({
|
|
956
|
+
id,
|
|
957
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
958
|
+
...requireOptionalOrder(kind, registration.order),
|
|
959
|
+
component: requireComponent(kind, registration.component)
|
|
960
|
+
});
|
|
961
|
+
},
|
|
962
|
+
experimental_threadContextCardSection(registration) {
|
|
963
|
+
const kind = "slots.experimental_threadContextCardSection";
|
|
964
|
+
const id = requireSlotId(kind, registration?.id);
|
|
965
|
+
requireUniqueId(kind, seenIds.threadContextCardSection, id);
|
|
966
|
+
collected.threadContextCardSections.push({
|
|
967
|
+
id,
|
|
968
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
969
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
970
|
+
...requireOptionalOrder(kind, registration.order),
|
|
971
|
+
component: requireComponent(kind, registration.component)
|
|
972
|
+
});
|
|
973
|
+
},
|
|
945
974
|
experimental_threadAction(registration) {
|
|
946
975
|
const kind = "slots.experimental_threadAction";
|
|
947
976
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -1089,6 +1118,22 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
1089
1118
|
run: registration.run
|
|
1090
1119
|
});
|
|
1091
1120
|
},
|
|
1121
|
+
experimental_messageMetadata(registration) {
|
|
1122
|
+
const kind = "slots.experimental_messageMetadata";
|
|
1123
|
+
const id = requireSlotId(kind, registration?.id);
|
|
1124
|
+
requireUniqueId(kind, seenIds.messageMetadata, id);
|
|
1125
|
+
const placement = registration.placement ?? "above";
|
|
1126
|
+
if (placement !== "above" && placement !== "actionRow") {
|
|
1127
|
+
throw new Error(
|
|
1128
|
+
`${kind}: "placement" must be "above" or "actionRow"`
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
collected.messageMetadata.push({
|
|
1132
|
+
id,
|
|
1133
|
+
placement,
|
|
1134
|
+
component: requireComponent(kind, registration.component)
|
|
1135
|
+
});
|
|
1136
|
+
},
|
|
1092
1137
|
commandPaletteAction(registration) {
|
|
1093
1138
|
registerCommand(registration);
|
|
1094
1139
|
},
|
|
@@ -991,13 +991,13 @@ async function invalidateTags(client, scope, tags) {
|
|
|
991
991
|
}
|
|
992
992
|
async function executeTaggedMutation(invalidate, call, prediction) {
|
|
993
993
|
const { result, invalidated } = await call();
|
|
994
|
-
prediction
|
|
994
|
+
prediction.accept(result);
|
|
995
995
|
const refresh = async () => {
|
|
996
996
|
try {
|
|
997
997
|
if (invalidate !== void 0 && invalidated.length > 0)
|
|
998
998
|
await invalidate(invalidated);
|
|
999
999
|
} finally {
|
|
1000
|
-
prediction
|
|
1000
|
+
prediction.settle();
|
|
1001
1001
|
}
|
|
1002
1002
|
};
|
|
1003
1003
|
void refresh().catch(() => {
|
|
@@ -1505,7 +1505,7 @@ var sessionOptionSelectionsSchema = z2.record(
|
|
|
1505
1505
|
var runtimeThreadExecutionBaseOptionsSchema = z2.object({
|
|
1506
1506
|
model: z2.string().min(1),
|
|
1507
1507
|
serviceTier: serviceTierSchema,
|
|
1508
|
-
reasoningLevel: reasoningLevelSchema,
|
|
1508
|
+
reasoningLevel: reasoningLevelSchema.optional(),
|
|
1509
1509
|
promptMode: promptModeSchema.optional(),
|
|
1510
1510
|
sessionOptions: sessionOptionSelectionsSchema.optional(),
|
|
1511
1511
|
providerOptions: jsonObjectSchema
|
|
@@ -2031,6 +2031,7 @@ var SYSTEM_CHANGE_KINDS = [
|
|
|
2031
2031
|
"plugin-install-jobs-changed",
|
|
2032
2032
|
"plugin-update-jobs-changed",
|
|
2033
2033
|
"provider-registrations-changed",
|
|
2034
|
+
"ui-preferences-changed",
|
|
2034
2035
|
"environment-availability-changed",
|
|
2035
2036
|
"server-move-changed",
|
|
2036
2037
|
"app-update-changed"
|
|
@@ -2188,11 +2189,6 @@ var systemChangedMessageSchema = z17.object({
|
|
|
2188
2189
|
entity: z17.literal("system"),
|
|
2189
2190
|
changes: z17.array(systemChangeKindSchema).readonly()
|
|
2190
2191
|
}).strict();
|
|
2191
|
-
var tagsChangedMessageSchema = z17.object({
|
|
2192
|
-
type: z17.literal("changed"),
|
|
2193
|
-
entity: z17.literal("tags"),
|
|
2194
|
-
tags: z17.array(z17.string().min(1)).min(1)
|
|
2195
|
-
}).strict();
|
|
2196
2192
|
var pluginChangedMessageSchema = z17.object({
|
|
2197
2193
|
type: z17.literal("changed"),
|
|
2198
2194
|
entity: z17.literal("plugin"),
|
|
@@ -2205,7 +2201,6 @@ var changedMessageSchema = z17.discriminatedUnion("entity", [
|
|
|
2205
2201
|
environmentChangedMessageSchema,
|
|
2206
2202
|
hostChangedMessageSchema,
|
|
2207
2203
|
systemChangedMessageSchema,
|
|
2208
|
-
tagsChangedMessageSchema,
|
|
2209
2204
|
pluginChangedMessageSchema
|
|
2210
2205
|
]);
|
|
2211
2206
|
function lenientKinds(kinds) {
|
|
@@ -2265,7 +2260,6 @@ var changedMessageLenientSchema = z17.discriminatedUnion("entity", [
|
|
|
2265
2260
|
environmentChangedMessageLenientSchema,
|
|
2266
2261
|
hostChangedMessageLenientSchema,
|
|
2267
2262
|
systemChangedMessageLenientSchema,
|
|
2268
|
-
tagsChangedMessageSchema.strip(),
|
|
2269
2263
|
pluginChangedMessageSchema.strip()
|
|
2270
2264
|
]);
|
|
2271
2265
|
|
package/dist/process.js
CHANGED
|
@@ -579,14 +579,19 @@ function observe(child) {
|
|
|
579
579
|
}
|
|
580
580
|
function spawnHostProcess(command, args = [], options = {}) {
|
|
581
581
|
const launch = options.shell ? { command, args: [...args], env: hostToolchain.environment(options.env) } : hostToolchain.command(command, args, options);
|
|
582
|
+
const spawnOptions = {
|
|
583
|
+
...options,
|
|
584
|
+
env: launch.env,
|
|
585
|
+
windowsHide: options.windowsHide ?? true
|
|
586
|
+
};
|
|
587
|
+
if (process.platform === "win32" && !options.shell && /[\\/]/u.test(command)) {
|
|
588
|
+
const parsed = parse(launch.command, launch.args, spawnOptions);
|
|
589
|
+
return observe(
|
|
590
|
+
parsed.file ? nodeSpawn(parsed.command, parsed.args, parsed.options) : nodeSpawn(launch.command, launch.args, spawnOptions)
|
|
591
|
+
);
|
|
592
|
+
}
|
|
582
593
|
const spawn2 = options.shell ? nodeSpawn : crossSpawn;
|
|
583
|
-
return observe(
|
|
584
|
-
spawn2(launch.command, launch.args, {
|
|
585
|
-
...options,
|
|
586
|
-
env: launch.env,
|
|
587
|
-
windowsHide: options.windowsHide ?? true
|
|
588
|
-
})
|
|
589
|
-
);
|
|
594
|
+
return observe(spawn2(launch.command, launch.args, spawnOptions));
|
|
590
595
|
}
|
|
591
596
|
function forkHostProcess(modulePath, args = [], options = {}) {
|
|
592
597
|
const { nodeArgs: execArgv, env } = prepareNodeNetworkLaunch(
|