fix(codex): harden windows light install

This commit is contained in:
YeonGyu-Kim
2026-05-31 13:23:24 +09:00
parent 4e31d7df5d
commit 92bad87d84
42 changed files with 1675 additions and 23 deletions
@@ -12,6 +12,7 @@ test("#given external MCP package runtime #when installing cached plugin #then r
const codexHome = await makeTempDir();
const sourceRoot = join(repoRoot, "packages", "omo-codex", "plugin");
const astGrepPackageRoot = join(repoRoot, "packages", "ast-grep-mcp");
const gitBashPackageRoot = join(repoRoot, "packages", "git-bash-mcp");
const lspPackageRoot = join(repoRoot, "packages", "lsp-tools-mcp");
await writeJson(join(astGrepPackageRoot, "package.json"), {
@@ -26,6 +27,12 @@ test("#given external MCP package runtime #when installing cached plugin #then r
type: "module",
bin: { "omo-lsp": "./dist/cli.js" },
});
await writeJson(join(gitBashPackageRoot, "package.json"), {
name: "@example/git-bash-mcp",
version: "0.1.0",
type: "module",
bin: { "omo-git-bash": "./dist/cli.js" },
});
await writeJson(join(sourceRoot, "package.json"), {
name: "@example/omo",
version: "0.1.0",
@@ -37,6 +44,11 @@ test("#given external MCP package runtime #when installing cached plugin #then r
args: ["../../ast-grep-mcp/dist/cli.js", "mcp"],
cwd: ".",
},
git_bash: {
command: "node",
args: ["../../git-bash-mcp/dist/cli.js", "mcp"],
cwd: ".",
},
lsp: {
command: "node",
args: ["../../lsp-tools-mcp/dist/cli.js", "mcp"],
@@ -45,6 +57,7 @@ test("#given external MCP package runtime #when installing cached plugin #then r
},
});
await writeJson(join(astGrepPackageRoot, "dist", "cli.js"), { executable: true });
await writeJson(join(gitBashPackageRoot, "dist", "cli.js"), { executable: true });
await writeJson(join(lspPackageRoot, "dist", "cli.js"), { executable: true });
await writeJson(join(lspPackageRoot, "dist", "lsp", "manager.js"), { copied: true });
@@ -59,13 +72,17 @@ test("#given external MCP package runtime #when installing cached plugin #then r
const cachedMcp = JSON.parse(await readFile(join(result.path, ".mcp.json"), "utf8"));
const copiedAstGrepCli = join(result.path, "mcp", "ast_grep", "dist", "cli.js");
const copiedGitBashCli = join(result.path, "mcp", "git_bash", "dist", "cli.js");
const copiedCli = join(result.path, "mcp", "lsp", "dist", "cli.js");
assert.deepEqual(cachedMcp.mcpServers.ast_grep.args, [copiedAstGrepCli, "mcp"]);
assert.deepEqual(cachedMcp.mcpServers.git_bash.args, [copiedGitBashCli, "mcp"]);
assert.deepEqual(cachedMcp.mcpServers.lsp.args, [copiedCli, "mcp"]);
assert.equal(Object.hasOwn(cachedMcp.mcpServers.ast_grep, "cwd"), false);
assert.equal(Object.hasOwn(cachedMcp.mcpServers.git_bash, "cwd"), false);
assert.equal(Object.hasOwn(cachedMcp.mcpServers.lsp, "cwd"), false);
assert.equal((await stat(copiedAstGrepCli)).isFile(), true);
assert.equal((await stat(copiedGitBashCli)).isFile(), true);
assert.equal((await stat(copiedCli)).isFile(), true);
assert.equal((await stat(join(result.path, "mcp", "lsp", "dist", "lsp", "manager.js"))).isFile(), true);
});