docdex 0.2.13 → 0.2.14

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.13
3
+ ## 0.2.14
4
4
  - Repo memory now tags items with `repoId` and filters recalls to prevent cross-repo leakage in multi-repo daemons.
5
5
  - MCP HTTP requires explicit repo selection when multiple repos are active.
6
6
  - Postinstall banner now guides users to run `docdex setup`.
@@ -1161,7 +1161,11 @@ function commandExists(cmd, spawnSyncFn) {
1161
1161
  }
1162
1162
 
1163
1163
  function launchMacTerminal({ binaryPath, args, spawnSyncFn, logger }) {
1164
- const command = [binaryPath, ...args].join(" ");
1164
+ const command = [
1165
+ "DOCDEX_SETUP_AUTO=1",
1166
+ `"${binaryPath}"`,
1167
+ ...args.map((arg) => `"${arg}"`)
1168
+ ].join(" ");
1165
1169
  const script = [
1166
1170
  'tell application "Terminal"',
1167
1171
  'if not (exists window 1) then',
@@ -1179,15 +1183,16 @@ function launchMacTerminal({ binaryPath, args, spawnSyncFn, logger }) {
1179
1183
  }
1180
1184
 
1181
1185
  function launchLinuxTerminal({ binaryPath, args, spawnFn, spawnSyncFn }) {
1186
+ const envArgs = ["env", "DOCDEX_SETUP_AUTO=1", binaryPath, ...args];
1182
1187
  const candidates = [
1183
- { cmd: "x-terminal-emulator", args: ["-e", binaryPath, ...args] },
1184
- { cmd: "gnome-terminal", args: ["--", binaryPath, ...args] },
1185
- { cmd: "konsole", args: ["-e", binaryPath, ...args] },
1186
- { cmd: "xfce4-terminal", args: ["-e", binaryPath, ...args] },
1187
- { cmd: "xterm", args: ["-e", binaryPath, ...args] },
1188
- { cmd: "kitty", args: ["-e", binaryPath, ...args] },
1189
- { cmd: "alacritty", args: ["-e", binaryPath, ...args] },
1190
- { cmd: "wezterm", args: ["start", "--", binaryPath, ...args] }
1188
+ { cmd: "x-terminal-emulator", args: ["-e", ...envArgs] },
1189
+ { cmd: "gnome-terminal", args: ["--", ...envArgs] },
1190
+ { cmd: "konsole", args: ["-e", ...envArgs] },
1191
+ { cmd: "xfce4-terminal", args: ["-e", ...envArgs] },
1192
+ { cmd: "xterm", args: ["-e", ...envArgs] },
1193
+ { cmd: "kitty", args: ["-e", ...envArgs] },
1194
+ { cmd: "alacritty", args: ["-e", ...envArgs] },
1195
+ { cmd: "wezterm", args: ["start", "--", ...envArgs] }
1191
1196
  ];
1192
1197
  for (const candidate of candidates) {
1193
1198
  if (!commandExists(candidate.cmd, spawnSyncFn)) continue;
@@ -1234,7 +1239,8 @@ function launchSetupWizard({
1234
1239
 
1235
1240
  if (platform === "win32") {
1236
1241
  const quoted = `"${binaryPath}" ${args.map((arg) => `"${arg}"`).join(" ")}`;
1237
- const result = spawnSyncFn("cmd", ["/c", "start", "", quoted]);
1242
+ const cmdline = `set DOCDEX_SETUP_AUTO=1 && ${quoted}`;
1243
+ const result = spawnSyncFn("cmd", ["/c", "start", "", "cmd", "/c", cmdline]);
1238
1244
  if (result.status === 0) return { ok: true };
1239
1245
  logger?.warn?.(`[docdex] cmd start failed: ${result.stderr || "unknown error"}`);
1240
1246
  return { ok: false, reason: "terminal_launch_failed" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docdex",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "mcpName": "io.github.bekirdag/docdex",
5
5
  "description": "Docdex CLI as an npm-installable binary wrapper.",
6
6
  "bin": {