@get-bb/plugin-sdk 0.4.56 → 0.4.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -12
- package/bundled-types/bb-plugin-sdk-app.d.ts +137 -20
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +35 -3
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +406 -52
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +8 -3
- package/bundled-types/bb-plugin-sdk-machine-provider.d.ts +84 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +57 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +131 -2
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +7 -2
- package/bundled-types/bb-plugin-sdk-testing.d.ts +212 -12
- package/bundled-types/bb-plugin-sdk.d.ts +749 -49
- package/dist/app.js +4 -0
- package/dist/host.js +1 -1
- package/dist/internal/host-policy.js +855 -68
- package/dist/internal/plugin-app-collector.js +116 -91
- package/dist/machine-provider.js +0 -0
- package/dist/provider-bridge-acp.js +1964 -2045
- package/dist/provider-bridge-testing.js +1378 -1404
- package/dist/provider-bridge-worker-entry.mjs +0 -1
- package/dist/provider-bridge.js +1455 -1498
- package/dist/testing/app.js +134 -91
- package/dist/testing/index.js +1092 -730
- package/package.json +7 -2
|
@@ -375,6 +375,39 @@ var sidebarFooterItemsByRegistrationSet = /* @__PURE__ */ new WeakMap();
|
|
|
375
375
|
function getCollectedSidebarFooterItems(registrations) {
|
|
376
376
|
return sidebarFooterItemsByRegistrationSet.get(registrations) ?? null;
|
|
377
377
|
}
|
|
378
|
+
function collectTitledComponent(kind, seen, registration) {
|
|
379
|
+
const id = requireSlotId(kind, registration?.id);
|
|
380
|
+
requireUniqueId(kind, seen, id);
|
|
381
|
+
const description = requireOptionalString(
|
|
382
|
+
kind,
|
|
383
|
+
"description",
|
|
384
|
+
registration.description
|
|
385
|
+
);
|
|
386
|
+
return {
|
|
387
|
+
id,
|
|
388
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
389
|
+
...description !== void 0 ? { description } : {},
|
|
390
|
+
component: requireComponent(kind, registration.component)
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function collectPanelAction(kind, seen, registration) {
|
|
394
|
+
const id = requireSlotId(kind, registration?.id);
|
|
395
|
+
requireUniqueId(kind, seen, id);
|
|
396
|
+
if (registration.run !== void 0 && typeof registration.run !== "function") {
|
|
397
|
+
throw new Error(`${kind}: "run" must be a function when set`);
|
|
398
|
+
}
|
|
399
|
+
if (registration.layout !== void 0 && registration.layout !== "padded" && registration.layout !== "flush") {
|
|
400
|
+
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
id,
|
|
404
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
405
|
+
...registration.icon !== void 0 ? { icon: requireNonEmptyString(kind, "icon", registration.icon) } : {},
|
|
406
|
+
component: requireComponent(kind, registration.component),
|
|
407
|
+
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
408
|
+
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
378
411
|
function collectPluginAppRegistrations(definition, onComposerCustomizationRejected = (reason) => console.warn(reason)) {
|
|
379
412
|
const sidebarFooterItems = [];
|
|
380
413
|
const collected = {
|
|
@@ -398,8 +431,10 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
398
431
|
messageActions: [],
|
|
399
432
|
commandPaletteActions: [],
|
|
400
433
|
providerIcons: [],
|
|
434
|
+
icons: [],
|
|
401
435
|
timelineRenderers: [],
|
|
402
436
|
environmentProviderInputs: [],
|
|
437
|
+
machineProviderInputs: [],
|
|
403
438
|
contentScripts: []
|
|
404
439
|
};
|
|
405
440
|
sidebarFooterItemsByRegistrationSet.set(collected, sidebarFooterItems);
|
|
@@ -425,6 +460,7 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
425
460
|
providerIcon: /* @__PURE__ */ new Set(),
|
|
426
461
|
timelineRenderer: /* @__PURE__ */ new Set(),
|
|
427
462
|
environmentProviderInputs: /* @__PURE__ */ new Set(),
|
|
463
|
+
machineProviderInputs: /* @__PURE__ */ new Set(),
|
|
428
464
|
contentScript: /* @__PURE__ */ new Set()
|
|
429
465
|
};
|
|
430
466
|
definition.setup({
|
|
@@ -551,46 +587,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
551
587
|
});
|
|
552
588
|
},
|
|
553
589
|
threadPanelAction(registration) {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
562
|
-
}
|
|
563
|
-
collected.threadPanelActions.push({
|
|
564
|
-
id,
|
|
565
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
566
|
-
...registration.icon !== void 0 ? {
|
|
567
|
-
icon: requireNonEmptyString(kind, "icon", registration.icon)
|
|
568
|
-
} : {},
|
|
569
|
-
component: requireComponent(kind, registration.component),
|
|
570
|
-
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
571
|
-
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
572
|
-
});
|
|
590
|
+
collected.threadPanelActions.push(
|
|
591
|
+
collectPanelAction(
|
|
592
|
+
"slots.threadPanelAction",
|
|
593
|
+
seenIds.threadPanelAction,
|
|
594
|
+
registration
|
|
595
|
+
)
|
|
596
|
+
);
|
|
573
597
|
},
|
|
574
598
|
experimental_newThreadPanelAction(registration) {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
583
|
-
}
|
|
584
|
-
collected.newThreadPanelActions.push({
|
|
585
|
-
id,
|
|
586
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
587
|
-
...registration.icon !== void 0 ? {
|
|
588
|
-
icon: requireNonEmptyString(kind, "icon", registration.icon)
|
|
589
|
-
} : {},
|
|
590
|
-
component: requireComponent(kind, registration.component),
|
|
591
|
-
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
592
|
-
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
593
|
-
});
|
|
599
|
+
collected.newThreadPanelActions.push(
|
|
600
|
+
collectPanelAction(
|
|
601
|
+
"slots.experimental_newThreadPanelAction",
|
|
602
|
+
seenIds.newThreadPanelAction,
|
|
603
|
+
registration
|
|
604
|
+
)
|
|
605
|
+
);
|
|
594
606
|
},
|
|
595
607
|
pendingInteraction(registration) {
|
|
596
608
|
const kind = "slots.pendingInteraction";
|
|
@@ -618,36 +630,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
618
630
|
sidebarFooterItems.push(adaptSidebarFooterAction(legacyRegistration));
|
|
619
631
|
},
|
|
620
632
|
experimental_sidebarNavigation(registration) {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
registration.description
|
|
633
|
+
collected.experimentalSidebarNavigations.push(
|
|
634
|
+
collectTitledComponent(
|
|
635
|
+
"slots.experimental_sidebarNavigation",
|
|
636
|
+
seenIds.sidebarNavigation,
|
|
637
|
+
registration
|
|
638
|
+
)
|
|
628
639
|
);
|
|
629
|
-
collected.experimentalSidebarNavigations.push({
|
|
630
|
-
id,
|
|
631
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
632
|
-
...description !== void 0 ? { description } : {},
|
|
633
|
-
component: requireComponent(kind, registration.component)
|
|
634
|
-
});
|
|
635
640
|
},
|
|
636
641
|
experimental_threadList(registration) {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
registration.description
|
|
642
|
+
collected.threadLists.push(
|
|
643
|
+
collectTitledComponent(
|
|
644
|
+
"slots.experimental_threadList",
|
|
645
|
+
seenIds.threadList,
|
|
646
|
+
registration
|
|
647
|
+
)
|
|
644
648
|
);
|
|
645
|
-
collected.threadLists.push({
|
|
646
|
-
id,
|
|
647
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
648
|
-
...description !== void 0 ? { description } : {},
|
|
649
|
-
component: requireComponent(kind, registration.component)
|
|
650
|
-
});
|
|
651
649
|
},
|
|
652
650
|
experimental_threadHeaderAction(registration) {
|
|
653
651
|
const kind = "slots.experimental_threadHeaderAction";
|
|
@@ -685,36 +683,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
685
683
|
});
|
|
686
684
|
},
|
|
687
685
|
experimental_sourceCodeRenderer(registration) {
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
registration.description
|
|
686
|
+
collected.sourceCodeRenderers.push(
|
|
687
|
+
collectTitledComponent(
|
|
688
|
+
"slots.experimental_sourceCodeRenderer",
|
|
689
|
+
seenIds.sourceCodeRenderer,
|
|
690
|
+
registration
|
|
691
|
+
)
|
|
695
692
|
);
|
|
696
|
-
collected.sourceCodeRenderers.push({
|
|
697
|
-
id,
|
|
698
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
699
|
-
...description !== void 0 ? { description } : {},
|
|
700
|
-
component: requireComponent(kind, registration.component)
|
|
701
|
-
});
|
|
702
693
|
},
|
|
703
694
|
experimental_diffRenderer(registration) {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
registration.description
|
|
695
|
+
collected.diffRenderers.push(
|
|
696
|
+
collectTitledComponent(
|
|
697
|
+
"slots.experimental_diffRenderer",
|
|
698
|
+
seenIds.diffRenderer,
|
|
699
|
+
registration
|
|
700
|
+
)
|
|
711
701
|
);
|
|
712
|
-
collected.diffRenderers.push({
|
|
713
|
-
id,
|
|
714
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
715
|
-
...description !== void 0 ? { description } : {},
|
|
716
|
-
component: requireComponent(kind, registration.component)
|
|
717
|
-
});
|
|
718
702
|
},
|
|
719
703
|
messageDirective(registration) {
|
|
720
704
|
const kind = "slots.messageDirective";
|
|
@@ -761,8 +745,18 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
761
745
|
experimental_providerIcon(registration) {
|
|
762
746
|
const kind = "slots.experimental_providerIcon";
|
|
763
747
|
const providerId = requireProviderId(kind, registration?.providerId);
|
|
764
|
-
|
|
748
|
+
const declaredKind = registration.providerKind;
|
|
749
|
+
if (declaredKind !== void 0 && declaredKind !== "agent" && declaredKind !== "machine" && declaredKind !== "environment") {
|
|
750
|
+
throw new Error(`${kind}: invalid providerKind`);
|
|
751
|
+
}
|
|
752
|
+
const providerKind = declaredKind ?? "all";
|
|
753
|
+
requireUniqueId(
|
|
754
|
+
kind,
|
|
755
|
+
seenIds.providerIcon,
|
|
756
|
+
`${providerKind}:${providerId}`
|
|
757
|
+
);
|
|
765
758
|
collected.providerIcons.push({
|
|
759
|
+
providerKind,
|
|
766
760
|
providerId,
|
|
767
761
|
icon: requireComponent(kind, registration.icon)
|
|
768
762
|
});
|
|
@@ -791,6 +785,18 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
791
785
|
environmentProviderId,
|
|
792
786
|
component: requireComponent(kind, registration.component)
|
|
793
787
|
});
|
|
788
|
+
},
|
|
789
|
+
experimental_machineProviderInputs(registration) {
|
|
790
|
+
const kind = "slots.experimental_machineProviderInputs";
|
|
791
|
+
const machineProviderId = requireProviderId(
|
|
792
|
+
kind,
|
|
793
|
+
registration?.machineProviderId
|
|
794
|
+
);
|
|
795
|
+
requireUniqueId(kind, seenIds.machineProviderInputs, machineProviderId);
|
|
796
|
+
collected.machineProviderInputs.push({
|
|
797
|
+
machineProviderId,
|
|
798
|
+
component: requireComponent(kind, registration.component)
|
|
799
|
+
});
|
|
794
800
|
}
|
|
795
801
|
},
|
|
796
802
|
experimental_sidebarFooter: new SidebarFooterCollector(
|
|
@@ -810,6 +816,25 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
810
816
|
}
|
|
811
817
|
}
|
|
812
818
|
},
|
|
819
|
+
experimental_icons: {
|
|
820
|
+
register(registration) {
|
|
821
|
+
const kind = "experimental_icons.register";
|
|
822
|
+
const name = requireNonEmptyString(
|
|
823
|
+
kind,
|
|
824
|
+
"name",
|
|
825
|
+
registration?.name
|
|
826
|
+
).trim();
|
|
827
|
+
if (name.length === 0)
|
|
828
|
+
throw new Error(`${kind}: "name" must not be blank`);
|
|
829
|
+
if (collected.icons.some((icon) => icon.name === name)) {
|
|
830
|
+
throw new Error(`${kind}: duplicate icon name "${name}"`);
|
|
831
|
+
}
|
|
832
|
+
collected.icons.push({
|
|
833
|
+
name,
|
|
834
|
+
component: requireComponent(kind, registration.component)
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
},
|
|
813
838
|
contentScripts: {
|
|
814
839
|
register(registration) {
|
|
815
840
|
const kind = "contentScripts.register";
|
|
File without changes
|