@get-bb/plugin-sdk 0.6.99 → 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 +297 -4
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +3 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +2 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +13 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +8 -2
- package/bundled-types/bb-plugin-sdk.d.ts +292 -3
- package/dist/app.js +16 -0
- package/dist/host.js +12 -7
- package/dist/internal/host-policy.js +8 -2
- package/dist/internal/plugin-app-collector.js +27 -0
- package/dist/process.js +12 -7
- package/dist/provider-bridge-acp-next.js +14 -7
- package/dist/provider-bridge-acp.js +14 -7
- package/dist/provider-bridge-testing.js +14 -7
- package/dist/provider-bridge.js +14 -7
- package/dist/testing/app.js +94 -1
- package/dist/testing/index.js +21 -2
- 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
|
);
|
|
@@ -309,6 +315,12 @@ var experimental_ThreadActionsContextMenu = runtimeComponent(
|
|
|
309
315
|
var experimental_useExperiment = runtimeFunction(
|
|
310
316
|
"experimental_useExperiment"
|
|
311
317
|
);
|
|
318
|
+
var experimental_useThreadContextKind = runtimeFunction(
|
|
319
|
+
"experimental_useThreadContextKind"
|
|
320
|
+
);
|
|
321
|
+
var experimental_usePanelTabs = runtimeFunction(
|
|
322
|
+
"experimental_usePanelTabs"
|
|
323
|
+
);
|
|
312
324
|
var experimental_useSidebarThreadSplit = runtimeFunction(
|
|
313
325
|
"experimental_useSidebarThreadSplit"
|
|
314
326
|
);
|
|
@@ -380,6 +392,7 @@ export {
|
|
|
380
392
|
experimental_InfoListRow,
|
|
381
393
|
experimental_InfoSection,
|
|
382
394
|
experimental_NewThreadComposer,
|
|
395
|
+
experimental_PanelTabIcon,
|
|
383
396
|
experimental_PermissionModePicker,
|
|
384
397
|
experimental_PluginIcon,
|
|
385
398
|
experimental_PluginRpcCallError,
|
|
@@ -395,6 +408,7 @@ export {
|
|
|
395
408
|
experimental_THREAD_INFO_SECTION_GROUPS,
|
|
396
409
|
experimental_ThreadActionsContextMenu,
|
|
397
410
|
experimental_ThreadActionsMenu,
|
|
411
|
+
experimental_ThreadContextCardRow,
|
|
398
412
|
experimental_ThreadRowMetadata,
|
|
399
413
|
experimental_ThreadStatusGlyph,
|
|
400
414
|
experimental_ThreadTitleText,
|
|
@@ -420,6 +434,7 @@ export {
|
|
|
420
434
|
experimental_useComposerRenderer,
|
|
421
435
|
experimental_useExperiment,
|
|
422
436
|
experimental_useFixedTabTarget,
|
|
437
|
+
experimental_usePanelTabs,
|
|
423
438
|
experimental_usePluginId,
|
|
424
439
|
experimental_useProviders,
|
|
425
440
|
experimental_useQuestionFormHost,
|
|
@@ -436,6 +451,7 @@ export {
|
|
|
436
451
|
experimental_useTabVisible,
|
|
437
452
|
experimental_useThreadActionRegistrations,
|
|
438
453
|
experimental_useThreadActions,
|
|
454
|
+
experimental_useThreadContextKind,
|
|
439
455
|
experimental_useThreadTitleDisplayText,
|
|
440
456
|
useBbContext,
|
|
441
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;
|
|
@@ -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: [],
|
|
@@ -541,6 +543,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
541
543
|
threadInfoRow: /* @__PURE__ */ new Set(),
|
|
542
544
|
threadRowMetadata: /* @__PURE__ */ new Set(),
|
|
543
545
|
threadInfoSection: /* @__PURE__ */ new Set(),
|
|
546
|
+
threadContextCardRow: /* @__PURE__ */ new Set(),
|
|
547
|
+
threadContextCardSection: /* @__PURE__ */ new Set(),
|
|
544
548
|
threadAction: /* @__PURE__ */ new Set(),
|
|
545
549
|
browserToolbarAction: /* @__PURE__ */ new Set(),
|
|
546
550
|
fileOpener: /* @__PURE__ */ new Set(),
|
|
@@ -944,6 +948,29 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
944
948
|
component: requireComponent(kind, registration.component)
|
|
945
949
|
});
|
|
946
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
|
+
},
|
|
947
974
|
experimental_threadAction(registration) {
|
|
948
975
|
const kind = "slots.experimental_threadAction";
|
|
949
976
|
const id = requireSlotId(kind, registration?.id);
|
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(
|
|
@@ -2119,6 +2119,8 @@ import { z as z15 } from "zod";
|
|
|
2119
2119
|
var threadTimelineGoalStatusSchema = z15.enum([
|
|
2120
2120
|
"active",
|
|
2121
2121
|
"paused",
|
|
2122
|
+
"blocked",
|
|
2123
|
+
"usageLimited",
|
|
2122
2124
|
"budgetLimited",
|
|
2123
2125
|
"complete"
|
|
2124
2126
|
]);
|
|
@@ -4982,14 +4984,19 @@ function observe(child) {
|
|
|
4982
4984
|
}
|
|
4983
4985
|
function spawnHostProcess(command, args = [], options = {}) {
|
|
4984
4986
|
const launch = options.shell ? { command, args: [...args], env: hostToolchain.environment(options.env) } : hostToolchain.command(command, args, options);
|
|
4987
|
+
const spawnOptions = {
|
|
4988
|
+
...options,
|
|
4989
|
+
env: launch.env,
|
|
4990
|
+
windowsHide: options.windowsHide ?? true
|
|
4991
|
+
};
|
|
4992
|
+
if (process.platform === "win32" && !options.shell && /[\\/]/u.test(command)) {
|
|
4993
|
+
const parsed = parse(launch.command, launch.args, spawnOptions);
|
|
4994
|
+
return observe(
|
|
4995
|
+
parsed.file ? nodeSpawn(parsed.command, parsed.args, parsed.options) : nodeSpawn(launch.command, launch.args, spawnOptions)
|
|
4996
|
+
);
|
|
4997
|
+
}
|
|
4985
4998
|
const spawn3 = options.shell ? nodeSpawn : crossSpawn;
|
|
4986
|
-
return observe(
|
|
4987
|
-
spawn3(launch.command, launch.args, {
|
|
4988
|
-
...options,
|
|
4989
|
-
env: launch.env,
|
|
4990
|
-
windowsHide: options.windowsHide ?? true
|
|
4991
|
-
})
|
|
4992
|
-
);
|
|
4999
|
+
return observe(spawn3(launch.command, launch.args, spawnOptions));
|
|
4993
5000
|
}
|
|
4994
5001
|
function prepareExecFile(command, args, options) {
|
|
4995
5002
|
const launch = hostToolchain.command(command, args, options);
|
|
@@ -2119,6 +2119,8 @@ import { z as z15 } from "zod";
|
|
|
2119
2119
|
var threadTimelineGoalStatusSchema = z15.enum([
|
|
2120
2120
|
"active",
|
|
2121
2121
|
"paused",
|
|
2122
|
+
"blocked",
|
|
2123
|
+
"usageLimited",
|
|
2122
2124
|
"budgetLimited",
|
|
2123
2125
|
"complete"
|
|
2124
2126
|
]);
|
|
@@ -4982,14 +4984,19 @@ function observe(child) {
|
|
|
4982
4984
|
}
|
|
4983
4985
|
function spawnHostProcess(command, args = [], options = {}) {
|
|
4984
4986
|
const launch = options.shell ? { command, args: [...args], env: hostToolchain.environment(options.env) } : hostToolchain.command(command, args, options);
|
|
4987
|
+
const spawnOptions = {
|
|
4988
|
+
...options,
|
|
4989
|
+
env: launch.env,
|
|
4990
|
+
windowsHide: options.windowsHide ?? true
|
|
4991
|
+
};
|
|
4992
|
+
if (process.platform === "win32" && !options.shell && /[\\/]/u.test(command)) {
|
|
4993
|
+
const parsed = parse(launch.command, launch.args, spawnOptions);
|
|
4994
|
+
return observe(
|
|
4995
|
+
parsed.file ? nodeSpawn(parsed.command, parsed.args, parsed.options) : nodeSpawn(launch.command, launch.args, spawnOptions)
|
|
4996
|
+
);
|
|
4997
|
+
}
|
|
4985
4998
|
const spawn3 = options.shell ? nodeSpawn : crossSpawn;
|
|
4986
|
-
return observe(
|
|
4987
|
-
spawn3(launch.command, launch.args, {
|
|
4988
|
-
...options,
|
|
4989
|
-
env: launch.env,
|
|
4990
|
-
windowsHide: options.windowsHide ?? true
|
|
4991
|
-
})
|
|
4992
|
-
);
|
|
4999
|
+
return observe(spawn3(launch.command, launch.args, spawnOptions));
|
|
4993
5000
|
}
|
|
4994
5001
|
function prepareExecFile(command, args, options) {
|
|
4995
5002
|
const launch = hostToolchain.command(command, args, options);
|
|
@@ -1209,6 +1209,8 @@ import { z as z13 } from "zod";
|
|
|
1209
1209
|
var threadTimelineGoalStatusSchema = z13.enum([
|
|
1210
1210
|
"active",
|
|
1211
1211
|
"paused",
|
|
1212
|
+
"blocked",
|
|
1213
|
+
"usageLimited",
|
|
1212
1214
|
"budgetLimited",
|
|
1213
1215
|
"complete"
|
|
1214
1216
|
]);
|
|
@@ -6883,14 +6885,19 @@ function observe(child) {
|
|
|
6883
6885
|
}
|
|
6884
6886
|
function spawnHostProcess(command, args = [], options = {}) {
|
|
6885
6887
|
const launch = options.shell ? { command, args: [...args], env: hostToolchain.environment(options.env) } : hostToolchain.command(command, args, options);
|
|
6888
|
+
const spawnOptions = {
|
|
6889
|
+
...options,
|
|
6890
|
+
env: launch.env,
|
|
6891
|
+
windowsHide: options.windowsHide ?? true
|
|
6892
|
+
};
|
|
6893
|
+
if (process.platform === "win32" && !options.shell && /[\\/]/u.test(command)) {
|
|
6894
|
+
const parsed = parse(launch.command, launch.args, spawnOptions);
|
|
6895
|
+
return observe(
|
|
6896
|
+
parsed.file ? nodeSpawn(parsed.command, parsed.args, parsed.options) : nodeSpawn(launch.command, launch.args, spawnOptions)
|
|
6897
|
+
);
|
|
6898
|
+
}
|
|
6886
6899
|
const spawn2 = options.shell ? nodeSpawn : crossSpawn;
|
|
6887
|
-
return observe(
|
|
6888
|
-
spawn2(launch.command, launch.args, {
|
|
6889
|
-
...options,
|
|
6890
|
-
env: launch.env,
|
|
6891
|
-
windowsHide: options.windowsHide ?? true
|
|
6892
|
-
})
|
|
6893
|
-
);
|
|
6900
|
+
return observe(spawn2(launch.command, launch.args, spawnOptions));
|
|
6894
6901
|
}
|
|
6895
6902
|
|
|
6896
6903
|
// ../process-utils/src/vcs-process-scheduler.ts
|
package/dist/provider-bridge.js
CHANGED
|
@@ -2639,6 +2639,8 @@ import { z as z17 } from "zod";
|
|
|
2639
2639
|
var threadTimelineGoalStatusSchema = z17.enum([
|
|
2640
2640
|
"active",
|
|
2641
2641
|
"paused",
|
|
2642
|
+
"blocked",
|
|
2643
|
+
"usageLimited",
|
|
2642
2644
|
"budgetLimited",
|
|
2643
2645
|
"complete"
|
|
2644
2646
|
]);
|
|
@@ -4517,14 +4519,19 @@ function observe(child) {
|
|
|
4517
4519
|
}
|
|
4518
4520
|
function spawnHostProcess(command, args = [], options = {}) {
|
|
4519
4521
|
const launch = options.shell ? { command, args: [...args], env: hostToolchain.environment(options.env) } : hostToolchain.command(command, args, options);
|
|
4522
|
+
const spawnOptions = {
|
|
4523
|
+
...options,
|
|
4524
|
+
env: launch.env,
|
|
4525
|
+
windowsHide: options.windowsHide ?? true
|
|
4526
|
+
};
|
|
4527
|
+
if (process.platform === "win32" && !options.shell && /[\\/]/u.test(command)) {
|
|
4528
|
+
const parsed = parse(launch.command, launch.args, spawnOptions);
|
|
4529
|
+
return observe(
|
|
4530
|
+
parsed.file ? nodeSpawn(parsed.command, parsed.args, parsed.options) : nodeSpawn(launch.command, launch.args, spawnOptions)
|
|
4531
|
+
);
|
|
4532
|
+
}
|
|
4520
4533
|
const spawn3 = options.shell ? nodeSpawn : crossSpawn;
|
|
4521
|
-
return observe(
|
|
4522
|
-
spawn3(launch.command, launch.args, {
|
|
4523
|
-
...options,
|
|
4524
|
-
env: launch.env,
|
|
4525
|
-
windowsHide: options.windowsHide ?? true
|
|
4526
|
-
})
|
|
4527
|
-
);
|
|
4534
|
+
return observe(spawn3(launch.command, launch.args, spawnOptions));
|
|
4528
4535
|
}
|
|
4529
4536
|
function prepareExecFile(command, args, options) {
|
|
4530
4537
|
const launch = hostToolchain.command(command, args, options);
|
package/dist/testing/app.js
CHANGED
|
@@ -3850,6 +3850,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
3850
3850
|
threadInfoRows: [],
|
|
3851
3851
|
threadRowMetadata: [],
|
|
3852
3852
|
threadInfoSections: [],
|
|
3853
|
+
threadContextCardRows: [],
|
|
3854
|
+
threadContextCardSections: [],
|
|
3853
3855
|
threadActions: [],
|
|
3854
3856
|
browserToolbarActions: [],
|
|
3855
3857
|
fileOpeners: [],
|
|
@@ -3888,6 +3890,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
3888
3890
|
threadInfoRow: /* @__PURE__ */ new Set(),
|
|
3889
3891
|
threadRowMetadata: /* @__PURE__ */ new Set(),
|
|
3890
3892
|
threadInfoSection: /* @__PURE__ */ new Set(),
|
|
3893
|
+
threadContextCardRow: /* @__PURE__ */ new Set(),
|
|
3894
|
+
threadContextCardSection: /* @__PURE__ */ new Set(),
|
|
3891
3895
|
threadAction: /* @__PURE__ */ new Set(),
|
|
3892
3896
|
browserToolbarAction: /* @__PURE__ */ new Set(),
|
|
3893
3897
|
fileOpener: /* @__PURE__ */ new Set(),
|
|
@@ -4291,6 +4295,29 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
4291
4295
|
component: requireComponent(kind, registration.component)
|
|
4292
4296
|
});
|
|
4293
4297
|
},
|
|
4298
|
+
experimental_threadContextCardRow(registration) {
|
|
4299
|
+
const kind = "slots.experimental_threadContextCardRow";
|
|
4300
|
+
const id = requireSlotId(kind, registration?.id);
|
|
4301
|
+
requireUniqueId(kind, seenIds.threadContextCardRow, id);
|
|
4302
|
+
collected.threadContextCardRows.push({
|
|
4303
|
+
id,
|
|
4304
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
4305
|
+
...requireOptionalOrder(kind, registration.order),
|
|
4306
|
+
component: requireComponent(kind, registration.component)
|
|
4307
|
+
});
|
|
4308
|
+
},
|
|
4309
|
+
experimental_threadContextCardSection(registration) {
|
|
4310
|
+
const kind = "slots.experimental_threadContextCardSection";
|
|
4311
|
+
const id = requireSlotId(kind, registration?.id);
|
|
4312
|
+
requireUniqueId(kind, seenIds.threadContextCardSection, id);
|
|
4313
|
+
collected.threadContextCardSections.push({
|
|
4314
|
+
id,
|
|
4315
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
4316
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
4317
|
+
...requireOptionalOrder(kind, registration.order),
|
|
4318
|
+
component: requireComponent(kind, registration.component)
|
|
4319
|
+
});
|
|
4320
|
+
},
|
|
4294
4321
|
experimental_threadAction(registration) {
|
|
4295
4322
|
const kind = "slots.experimental_threadAction";
|
|
4296
4323
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -4689,7 +4716,9 @@ function TestThreadStatusGlyph({
|
|
|
4689
4716
|
}
|
|
4690
4717
|
);
|
|
4691
4718
|
}
|
|
4692
|
-
function TestThreadRowMetadata({
|
|
4719
|
+
function TestThreadRowMetadata({
|
|
4720
|
+
thread
|
|
4721
|
+
}) {
|
|
4693
4722
|
return /* @__PURE__ */ jsx("span", { "data-thread-row-metadata": thread.id });
|
|
4694
4723
|
}
|
|
4695
4724
|
function SlotLifecycleGuard({
|
|
@@ -5446,6 +5475,46 @@ function TestDetailRow({ label, icon, children }) {
|
|
|
5446
5475
|
/* @__PURE__ */ jsx("dd", { children })
|
|
5447
5476
|
] });
|
|
5448
5477
|
}
|
|
5478
|
+
var NO_PANEL_TABS = {
|
|
5479
|
+
open: false,
|
|
5480
|
+
selectedKey: null,
|
|
5481
|
+
tabs: []
|
|
5482
|
+
};
|
|
5483
|
+
function TestPanelTabIcon({ tabKey }) {
|
|
5484
|
+
return /* @__PURE__ */ jsx("span", { "data-panel-tab-icon": tabKey });
|
|
5485
|
+
}
|
|
5486
|
+
function TestThreadContextCardRow(props) {
|
|
5487
|
+
const { icon, leading, label, trailing, title, disabled, action } = props;
|
|
5488
|
+
const content = /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
5489
|
+
leading,
|
|
5490
|
+
label,
|
|
5491
|
+
trailing
|
|
5492
|
+
] });
|
|
5493
|
+
const main = props.onClick !== void 0 ? /* @__PURE__ */ jsx(
|
|
5494
|
+
"button",
|
|
5495
|
+
{
|
|
5496
|
+
type: "button",
|
|
5497
|
+
"data-testid": "bb-thread-context-card-row",
|
|
5498
|
+
"data-icon": icon,
|
|
5499
|
+
title,
|
|
5500
|
+
disabled,
|
|
5501
|
+
onClick: () => props.onClick?.(),
|
|
5502
|
+
children: content
|
|
5503
|
+
}
|
|
5504
|
+
) : /* @__PURE__ */ jsx(
|
|
5505
|
+
"div",
|
|
5506
|
+
{
|
|
5507
|
+
"data-testid": "bb-thread-context-card-row",
|
|
5508
|
+
"data-icon": icon,
|
|
5509
|
+
title,
|
|
5510
|
+
children: content
|
|
5511
|
+
}
|
|
5512
|
+
);
|
|
5513
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
5514
|
+
main,
|
|
5515
|
+
action
|
|
5516
|
+
] });
|
|
5517
|
+
}
|
|
5449
5518
|
function TestInfoList({
|
|
5450
5519
|
items,
|
|
5451
5520
|
getKey,
|
|
@@ -5521,6 +5590,9 @@ var testPluginSdkApp = {
|
|
|
5521
5590
|
experimental_useExperiment(key) {
|
|
5522
5591
|
return useSlotEnv("experimental_useExperiment").experiments.has(key);
|
|
5523
5592
|
},
|
|
5593
|
+
experimental_useThreadContextKind() {
|
|
5594
|
+
return useSlotEnv("experimental_useThreadContextKind").threadContextKind;
|
|
5595
|
+
},
|
|
5524
5596
|
useBbContext() {
|
|
5525
5597
|
return useSlotEnv("useBbContext").bbContext;
|
|
5526
5598
|
},
|
|
@@ -5536,6 +5608,9 @@ var testPluginSdkApp = {
|
|
|
5536
5608
|
experimental_useAppPanel() {
|
|
5537
5609
|
return useSlotEnv("experimental_useAppPanel").appPanel;
|
|
5538
5610
|
},
|
|
5611
|
+
experimental_usePanelTabs() {
|
|
5612
|
+
return useSlotEnv("experimental_usePanelTabs").panelTabs;
|
|
5613
|
+
},
|
|
5539
5614
|
experimental_useFixedTabTarget(tab) {
|
|
5540
5615
|
const store = useSlotEnv("experimental_useFixedTabTarget").fixedTabTarget;
|
|
5541
5616
|
const state = useSyncExternalStore2(
|
|
@@ -5633,6 +5708,8 @@ var testPluginSdkApp = {
|
|
|
5633
5708
|
experimental_Diff: TestDiff,
|
|
5634
5709
|
experimental_InfoSection: TestInfoSection,
|
|
5635
5710
|
experimental_DetailRow: TestDetailRow,
|
|
5711
|
+
experimental_ThreadContextCardRow: TestThreadContextCardRow,
|
|
5712
|
+
experimental_PanelTabIcon: TestPanelTabIcon,
|
|
5636
5713
|
experimental_InfoList: TestInfoList,
|
|
5637
5714
|
experimental_InfoListRow: TestInfoListRow,
|
|
5638
5715
|
experimental_useSidebarThreads() {
|
|
@@ -6120,6 +6197,17 @@ function renderSlot(registration, props, options = {}) {
|
|
|
6120
6197
|
if (json === null) return false;
|
|
6121
6198
|
return options.experimental_panel?.toggleTab?.(json) ?? false;
|
|
6122
6199
|
},
|
|
6200
|
+
getTabs() {
|
|
6201
|
+
return options.experimental_panel?.getTabs?.() ?? options.experimental_panelTabs ?? NO_PANEL_TABS;
|
|
6202
|
+
},
|
|
6203
|
+
selectTab(key) {
|
|
6204
|
+
experimental_panelCalls.push({ method: "selectTab", key });
|
|
6205
|
+
return options.experimental_panel?.selectTab?.(key) ?? false;
|
|
6206
|
+
},
|
|
6207
|
+
closeTab(key) {
|
|
6208
|
+
experimental_panelCalls.push({ method: "closeTab", key });
|
|
6209
|
+
return options.experimental_panel?.closeTab?.(key) ?? false;
|
|
6210
|
+
},
|
|
6123
6211
|
close() {
|
|
6124
6212
|
experimental_panelCalls.push({ method: "close" });
|
|
6125
6213
|
return options.experimental_panel?.close?.() ?? false;
|
|
@@ -6596,12 +6684,16 @@ ${block}
|
|
|
6596
6684
|
pluginId: options.pluginId ?? "test-plugin",
|
|
6597
6685
|
questionFormHost: {
|
|
6598
6686
|
shortcuts: /* @__PURE__ */ new Map(),
|
|
6687
|
+
actionShortcuts: /* @__PURE__ */ new Map(),
|
|
6599
6688
|
registerChoiceHandler: () => () => {
|
|
6689
|
+
},
|
|
6690
|
+
registerActionHandler: () => () => {
|
|
6600
6691
|
}
|
|
6601
6692
|
},
|
|
6602
6693
|
navigate,
|
|
6603
6694
|
navigateCalls,
|
|
6604
6695
|
appPanel,
|
|
6696
|
+
panelTabs: options.experimental_panelTabs ?? NO_PANEL_TABS,
|
|
6605
6697
|
fixedTabTarget,
|
|
6606
6698
|
composer,
|
|
6607
6699
|
composerLog,
|
|
@@ -6616,6 +6708,7 @@ ${block}
|
|
|
6616
6708
|
threadActionRegistrations: options.threadActionRegistrations ?? NO_THREAD_ACTION_REGISTRATIONS,
|
|
6617
6709
|
sidebarDraftThreadIds,
|
|
6618
6710
|
experiments: new Set(options.experiments ?? []),
|
|
6711
|
+
threadContextKind: options.threadContextKind ?? "banner",
|
|
6619
6712
|
sidebarRowStatuses,
|
|
6620
6713
|
sidebarShortcuts,
|
|
6621
6714
|
sidebarSplitLayout: options.sidebarSplitLayout ?? null,
|
package/dist/testing/index.js
CHANGED
|
@@ -560,7 +560,10 @@ function registerSettingDescriptors(target, added) {
|
|
|
560
560
|
`invalid setting key "${key}" \u2014 use letters, digits, "-" and "_"`
|
|
561
561
|
);
|
|
562
562
|
}
|
|
563
|
-
if (key
|
|
563
|
+
if (key === "__proto__") {
|
|
564
|
+
throw new Error(`setting key "${key}" is reserved`);
|
|
565
|
+
}
|
|
566
|
+
if (Object.hasOwn(target, key)) {
|
|
564
567
|
throw new Error(`setting "${key}" is already defined`);
|
|
565
568
|
}
|
|
566
569
|
const parsed = settingDescriptorSchema.safeParse(raw);
|
|
@@ -623,7 +626,10 @@ function settingSchemaError(key, schema, value) {
|
|
|
623
626
|
function validateSettingsUpdate(descriptors, values) {
|
|
624
627
|
const errors = [];
|
|
625
628
|
for (const [key, value] of Object.entries(values)) {
|
|
626
|
-
const descriptor =
|
|
629
|
+
const descriptor = Object.hasOwn(
|
|
630
|
+
descriptors,
|
|
631
|
+
key
|
|
632
|
+
) ? descriptors[key] : void 0;
|
|
627
633
|
if (!descriptor) {
|
|
628
634
|
errors.push(`unknown setting "${key}"`);
|
|
629
635
|
continue;
|
|
@@ -3173,6 +3179,7 @@ function createFakePluginHostInternal(options, sharedState) {
|
|
|
3173
3179
|
assertLive();
|
|
3174
3180
|
if (!databaseHandle?.open) {
|
|
3175
3181
|
databaseHandle = new Database(join(storageRoot, "data.db"));
|
|
3182
|
+
databaseHandle.pragma("journal_mode = WAL");
|
|
3176
3183
|
databaseHandle.pragma("busy_timeout = 5000");
|
|
3177
3184
|
}
|
|
3178
3185
|
return databaseHandle;
|
|
@@ -4745,6 +4752,17 @@ function makeTurnFailedEvent(overrides = {}) {
|
|
|
4745
4752
|
...overrides
|
|
4746
4753
|
};
|
|
4747
4754
|
}
|
|
4755
|
+
function makePanelController(overrides = {}) {
|
|
4756
|
+
return {
|
|
4757
|
+
openTab: () => false,
|
|
4758
|
+
toggleTab: () => false,
|
|
4759
|
+
close: () => false,
|
|
4760
|
+
getTabs: () => ({ open: false, selectedKey: null, tabs: [] }),
|
|
4761
|
+
selectTab: () => false,
|
|
4762
|
+
closeTab: () => false,
|
|
4763
|
+
...overrides
|
|
4764
|
+
};
|
|
4765
|
+
}
|
|
4748
4766
|
|
|
4749
4767
|
// src/testing/public-sdk-only.ts
|
|
4750
4768
|
import { readdirSync, readFileSync } from "node:fs";
|
|
@@ -5190,6 +5208,7 @@ export {
|
|
|
5190
5208
|
PluginContextStaleError,
|
|
5191
5209
|
createFakePluginHost,
|
|
5192
5210
|
createFakeSdk,
|
|
5211
|
+
makePanelController as experimental_makePanelController,
|
|
5193
5212
|
scanPublicSdkOnly as experimental_scanPublicSdkOnly,
|
|
5194
5213
|
makeHostResponse,
|
|
5195
5214
|
makeMessageDispatchHookContext,
|