Fix Windows bundle MCP and Matrix contract seams
This commit is contained in:
parent
52020d3a0c
commit
f571f6d534
@ -12,3 +12,8 @@ export {
|
|||||||
resolveMatrixLegacyFlatStoreRoot,
|
resolveMatrixLegacyFlatStoreRoot,
|
||||||
sanitizeMatrixPathSegment,
|
sanitizeMatrixPathSegment,
|
||||||
} from "./helper-api.js";
|
} from "./helper-api.js";
|
||||||
|
export {
|
||||||
|
createMatrixThreadBindingManager,
|
||||||
|
resetMatrixThreadBindingsForTests,
|
||||||
|
} from "./src/matrix/thread-bindings.js";
|
||||||
|
export { setMatrixRuntime } from "./src/runtime.js";
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import { createFeishuThreadBindingManager } from "../../../../extensions/feishu/
|
|||||||
import {
|
import {
|
||||||
createMatrixThreadBindingManager,
|
createMatrixThreadBindingManager,
|
||||||
resetMatrixThreadBindingsForTests,
|
resetMatrixThreadBindingsForTests,
|
||||||
} from "../../../../extensions/matrix/src/matrix/thread-bindings.js";
|
setMatrixRuntime,
|
||||||
import { setMatrixRuntime } from "../../../../extensions/matrix/src/runtime.js";
|
} from "../../../../extensions/matrix/runtime-api.js";
|
||||||
import { createTelegramThreadBindingManager } from "../../../../extensions/telegram/runtime-api.js";
|
import { createTelegramThreadBindingManager } from "../../../../extensions/telegram/runtime-api.js";
|
||||||
import type { OpenClawConfig } from "../../../config/config.js";
|
import type { OpenClawConfig } from "../../../config/config.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { beforeEach, describe, vi } from "vitest";
|
import { beforeEach, describe, vi } from "vitest";
|
||||||
import { __testing as discordThreadBindingTesting } from "../../../../extensions/discord/src/monitor/thread-bindings.manager.js";
|
import { __testing as discordThreadBindingTesting } from "../../../../extensions/discord/src/monitor/thread-bindings.manager.js";
|
||||||
import { __testing as feishuThreadBindingTesting } from "../../../../extensions/feishu/src/thread-bindings.js";
|
import { __testing as feishuThreadBindingTesting } from "../../../../extensions/feishu/src/thread-bindings.js";
|
||||||
import { resetMatrixThreadBindingsForTests } from "../../../../extensions/matrix/src/matrix/thread-bindings.js";
|
import { resetMatrixThreadBindingsForTests } from "../../../../extensions/matrix/runtime-api.js";
|
||||||
import { __testing as telegramThreadBindingTesting } from "../../../../extensions/telegram/src/thread-bindings.js";
|
import { __testing as telegramThreadBindingTesting } from "../../../../extensions/telegram/src/thread-bindings.js";
|
||||||
import { __testing as sessionBindingTesting } from "../../../infra/outbound/session-binding-service.js";
|
import { __testing as sessionBindingTesting } from "../../../infra/outbound/session-binding-service.js";
|
||||||
import { sessionBindingContractRegistry } from "./registry.js";
|
import { sessionBindingContractRegistry } from "./registry.js";
|
||||||
|
|||||||
@ -11,6 +11,10 @@ function getServerArgs(value: unknown): unknown[] | undefined {
|
|||||||
return isRecord(value) && Array.isArray(value.args) ? value.args : undefined;
|
return isRecord(value) && Array.isArray(value.args) ? value.args : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizePluginPath(value: string): string {
|
||||||
|
return path.normalize(value.replaceAll("/", path.sep));
|
||||||
|
}
|
||||||
|
|
||||||
const tempHarness = createBundleMcpTempHarness();
|
const tempHarness = createBundleMcpTempHarness();
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
@ -177,16 +181,18 @@ describe("loadEnabledBundleMcpConfig", () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
expect(loaded.diagnostics).toEqual([]);
|
expect(loaded.diagnostics).toEqual([]);
|
||||||
expect(loaded.config.mcpServers.inlineProbe).toEqual({
|
const inlineProbe = loaded.config.mcpServers.inlineProbe;
|
||||||
command: path.join(pluginRoot, "bin", "server.sh"),
|
expect(isRecord(inlineProbe)).toBe(true);
|
||||||
args: [
|
expect(normalizePluginPath(String(isRecord(inlineProbe) ? inlineProbe.command : ""))).toBe(
|
||||||
path.join(pluginRoot, "servers", "probe.mjs"),
|
normalizePluginPath(path.join(pluginRoot, "bin", "server.sh")),
|
||||||
path.join(pluginRoot, "local-probe.mjs"),
|
);
|
||||||
],
|
expect(getServerArgs(inlineProbe)?.map((arg) => normalizePluginPath(String(arg)))).toEqual([
|
||||||
cwd: pluginRoot,
|
normalizePluginPath(path.join(pluginRoot, "servers", "probe.mjs")),
|
||||||
env: {
|
normalizePluginPath(path.join(pluginRoot, "local-probe.mjs")),
|
||||||
PLUGIN_ROOT: pluginRoot,
|
]);
|
||||||
},
|
expect(isRecord(inlineProbe) ? inlineProbe.cwd : undefined).toBe(pluginRoot);
|
||||||
|
expect(isRecord(inlineProbe) ? inlineProbe.env : undefined).toEqual({
|
||||||
|
PLUGIN_ROOT: pluginRoot,
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
env.restore();
|
env.restore();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user