fix(feishu): wire setup runtime setter (#89814) · openclaw/openclaw@a61c94b
clawsweeper
·
2026-06-03
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +// Narrow entry point for setFeishuRuntime. Keep setup/runtime registration |
| 2 | +// from pulling in the broader Feishu runtime-api barrel. |
| 3 | +export { setFeishuRuntime } from "./src/runtime.js"; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,5 +17,16 @@ describe("feishu setup entry", () => {
|
17 | 17 | expect(setupEntry.features).toEqual({ legacyStateMigrations: true }); |
18 | 18 | expect(typeof setupEntry.loadSetupPlugin).toBe("function"); |
19 | 19 | expect(setupEntry.loadLegacyStateMigrationDetector?.()).toBeTypeOf("function"); |
| 20 | +expect(typeof setupEntry.setChannelRuntime).toBe("function"); |
| 21 | +}); |
| 22 | + |
| 23 | +it("wires the Feishu runtime from setup-only registration", async () => { |
| 24 | +const { default: setupEntry } = await import("./setup-entry.js"); |
| 25 | +const runtime = { channel: { inbound: { run: vi.fn() } } }; |
| 26 | + |
| 27 | +setupEntry.setChannelRuntime?.(runtime as never); |
| 28 | + |
| 29 | +const { getFeishuRuntime } = await import("./src/runtime.js"); |
| 30 | +expect(getFeishuRuntime()).toBe(runtime); |
20 | 31 | }); |
21 | 32 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,4 +17,8 @@ export default defineBundledChannelSetupEntry({
|
17 | 17 | specifier: "./secret-contract-api.js", |
18 | 18 | exportName: "channelSecrets", |
19 | 19 | }, |
| 20 | +runtime: { |
| 21 | +specifier: "./runtime-setter-api.js", |
| 22 | +exportName: "setFeishuRuntime", |
| 23 | +}, |
20 | 24 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -381,4 +381,15 @@ describe("runtime api guardrails", () => {
|
381 | 381 | 'export { setMatrixRuntime } from "./src/runtime.js";', |
382 | 382 | ]); |
383 | 383 | }); |
| 384 | + |
| 385 | +it("keeps Feishu's narrow runtime-setter entrypoint pinned to a single export", () => { |
| 386 | +const setterFile = bundledPluginFile({ |
| 387 | +rootDir: ROOT_DIR, |
| 388 | +pluginId: "feishu", |
| 389 | +relativePath: "runtime-setter-api.ts", |
| 390 | +}); |
| 391 | +expect(readExportStatements(setterFile)).toEqual([ |
| 392 | +'export { setFeishuRuntime } from "./src/runtime.js";', |
| 393 | +]); |
| 394 | +}); |
384 | 395 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。