






























@@ -197,7 +197,7 @@ afterEach(() => {
197197describe("bundled channel entry shape guards", () => {
198198const bundledPluginRoots = listSourceBundledPluginRoots();
199199let realBundledSourceTreeProbe: {
200-hasAccountInspect: boolean;
200+hasAccountInspector: boolean;
201201pluginIds: readonly string[];
202202};
203203@@ -221,7 +221,7 @@ describe("bundled channel entry shape guards", () => {
221221"./bundled.js?scope=real-bundled-source-tree-preload",
222222);
223223realBundledSourceTreeProbe = {
224-hasAccountInspect: bundled.hasBundledChannelEntryFeature("slack", "accountInspect"),
224+hasAccountInspector: typeof bundled.getBundledChannelAccountInspector("slack") === "function",
225225pluginIds: [...bundled.listBundledChannelPluginIds()],
226226};
227227});
@@ -256,7 +256,7 @@ describe("bundled channel entry shape guards", () => {
256256257257it("loads real bundled channel entry contracts from the source tree", async () => {
258258expect(realBundledSourceTreeProbe.pluginIds).toEqual(["slack"]);
259-expect(realBundledSourceTreeProbe.hasAccountInspect).toBe(true);
259+expect(realBundledSourceTreeProbe.hasAccountInspector).toBe(true);
260260});
261261262262it("fills sparse bundled channel plugin metadata from package metadata", async () => {
@@ -316,12 +316,12 @@ describe("bundled channel entry shape guards", () => {
316316"./bundled.js?scope=bundled-package-metadata",
317317);
318318319-const plugin = bundled.requireBundledChannelPlugin("alpha");
320-expect(plugin.meta.id).toBe("alpha");
321-expect(plugin.meta.label).toBe("Alpha");
322-expect(plugin.meta.selectionLabel).toBe("Use Alpha");
323-expect(plugin.meta.docsPath).toBe("/channels/alpha");
324-expect(plugin.meta.blurb).toBe("Alpha channel metadata.");
319+const plugin = bundled.getBundledChannelPlugin("alpha");
320+expect(plugin?.meta.id).toBe("alpha");
321+expect(plugin?.meta.label).toBe("Alpha");
322+expect(plugin?.meta.selectionLabel).toBe("Use Alpha");
323+expect(plugin?.meta.docsPath).toBe("/channels/alpha");
324+expect(plugin?.meta.blurb).toBe("Alpha channel metadata.");
325325} finally {
326326restoreBundledPluginsDir(previousBundledPluginsDir);
327327fs.rmSync(tempRoot, { recursive: true, force: true });
@@ -392,7 +392,7 @@ describe("bundled channel entry shape guards", () => {
392392expect(metadataRootDir).toBe(tempRoot);
393393expect(generatedRootDir).toBe(tempRoot);
394394expect(testGlobal["__bundledOverrideRuntime"]).toBe("ok");
395-expect(bundled.requireBundledChannelPlugin("alpha").id).toBe("alpha");
395+expect(bundled.getBundledChannelPlugin("alpha")?.id).toBe("alpha");
396396} finally {
397397restoreBundledPluginsDir(previousBundledPluginsDir);
398398fs.rmSync(tempRoot, { recursive: true, force: true });
@@ -459,7 +459,7 @@ describe("bundled channel entry shape guards", () => {
459459"./bundled.js?scope=bundled-package-local-dist-sdk-alias",
460460);
461461462-expect(bundled.requireBundledChannelPlugin("alpha").meta.label).toBe("Package dist Alpha");
462+expect(bundled.getBundledChannelPlugin("alpha")?.meta.label).toBe("Package dist Alpha");
463463} finally {
464464fs.rmSync(root, { recursive: true, force: true });
465465}
@@ -514,7 +514,7 @@ describe("bundled channel entry shape guards", () => {
514514"./bundled.js?scope=bundled-direct-dist-sdk-alias",
515515);
516516517-expect(bundled.requireBundledChannelPlugin("alpha").meta.label).toBe("Direct dist Alpha");
517+expect(bundled.getBundledChannelPlugin("alpha")?.meta.label).toBe("Direct dist Alpha");
518518} finally {
519519restoreBundledPluginsDir(previousBundledPluginsDir);
520520fs.rmSync(root, { recursive: true, force: true });
@@ -588,7 +588,7 @@ describe("bundled channel entry shape guards", () => {
588588expect(generatedRootDir).toBe(pluginsRoot);
589589expect(generatedScanDir).toBe(pluginsRoot);
590590expect(testGlobal["__bundledOverrideRuntime"]).toBe("ok");
591-expect(bundled.requireBundledChannelPlugin("alpha").id).toBe("alpha");
591+expect(bundled.getBundledChannelPlugin("alpha")?.id).toBe("alpha");
592592} finally {
593593restoreBundledPluginsDir(previousBundledPluginsDir);
594594fs.rmSync(tempRoot, { recursive: true, force: true });
@@ -673,7 +673,7 @@ describe("bundled channel entry shape guards", () => {
673673);
674674675675process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = path.join(rootA, "dist", "extensions");
676-expect(bundled.requireBundledChannelPlugin("alpha").meta.label).toBe("Alpha A");
676+expect(bundled.getBundledChannelPlugin("alpha")?.meta.label).toBe("Alpha A");
677677expect(bundled.getBundledChannelSetupPlugin("alpha")?.meta.label).toBe("Setup A");
678678expect(bundled.getBundledChannelSecrets("alpha")?.secretTargetRegistryEntries?.[0]?.id).toBe(
679679"channels.alpha.A.entry-token",
@@ -684,7 +684,7 @@ describe("bundled channel entry shape guards", () => {
684684bundled.setBundledChannelRuntime("alpha", { marker: "first" } as never);
685685686686process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = path.join(rootB, "dist", "extensions");
687-expect(bundled.requireBundledChannelPlugin("alpha").meta.label).toBe("Alpha B");
687+expect(bundled.getBundledChannelPlugin("alpha")?.meta.label).toBe("Alpha B");
688688expect(bundled.getBundledChannelSetupPlugin("alpha")?.meta.label).toBe("Setup B");
689689expect(bundled.getBundledChannelSecrets("alpha")?.secretTargetRegistryEntries?.[0]?.id).toBe(
690690"channels.alpha.B.entry-token",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。