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