codexport 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +16 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { homedir, platform } from "node:os";
11
11
  import path from "node:path";
12
12
  import { spawn } from "node:child_process";
13
13
  import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
14
- const VERSION = "0.3.2";
14
+ const VERSION = "0.3.3";
15
15
  const DEFAULT_PORT = 17342;
16
16
  const DEFAULT_TIMEOUT_MS = 5_000;
17
17
  const CODEXPORT_DIR = ".codexport";
@@ -928,14 +928,22 @@ async function repairGitquarryEnvIfNeeded(name, env) {
928
928
  const current = env.GITQUARRY_CLI_PATH;
929
929
  if (current && await executableExists(current, env))
930
930
  return;
931
- if (!(await executableExists("gitquarry", env))) {
932
- await runCommandWithEnv("npm", ["install", "-g", "gitquarry"], env);
933
- }
934
- const resolved = await resolveExecutable("gitquarry", env);
935
- if (!resolved) {
936
- throw new CliError("MCP repair could not find gitquarry after installing the gitquarry npm package.", 1);
931
+ const existing = await resolveExecutable("gitquarry", env);
932
+ if (existing) {
933
+ env.GITQUARRY_CLI_PATH = existing;
934
+ return;
937
935
  }
938
- env.GITQUARRY_CLI_PATH = resolved;
936
+ const installHome = env.HOME ?? env.USERPROFILE ?? homedir();
937
+ const installDir = path.join(installHome, ".codexport", "tools", "gitquarry");
938
+ await ensureDir(installDir);
939
+ await runCommandWithEnv("npm", ["install", "--prefix", installDir, "gitquarry"], env);
940
+ const binaryPath = platform() === "win32"
941
+ ? path.join(installDir, "node_modules", ".bin", "gitquarry.cmd")
942
+ : path.join(installDir, "node_modules", ".bin", "gitquarry");
943
+ if (!(await pathExists(binaryPath))) {
944
+ throw new CliError("MCP repair installed gitquarry but could not find its npm shim.", 1);
945
+ }
946
+ env.GITQUARRY_CLI_PATH = binaryPath;
939
947
  }
940
948
  async function executableExists(command, env) {
941
949
  return Boolean(await resolveExecutable(command, env));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexport",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "sync a canonical Codex setup from one master machine to follower machines",
5
5
  "author": "Microck <contact@micr.dev>",
6
6
  "license": "MIT",