docdex 0.2.12 → 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,7 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.12
4
- - Added glama support
3
+ ## 0.2.14
4
+ - Repo memory now tags items with `repoId` and filters recalls to prevent cross-repo leakage in multi-repo daemons.
5
+ - MCP HTTP requires explicit repo selection when multiple repos are active.
6
+ - Postinstall banner now guides users to run `docdex setup`.
7
+ - Docs refreshed with memory, agent memory, code intelligence, web search, and Ollama guidance.
5
8
 
6
9
  ## 0.1.10
7
10
  - smithery deployment work to get a bettwe score. enriched server.js, added mcp.json and an icon address.
package/lib/install.js CHANGED
@@ -1899,6 +1899,55 @@ async function main() {
1899
1899
  } catch (err) {
1900
1900
  console.warn(`[docdex] postinstall setup skipped: ${err?.message || err}`);
1901
1901
  }
1902
+ printPostInstallBanner();
1903
+ }
1904
+
1905
+ function printPostInstallBanner() {
1906
+ const frame = "\x1b[35m";
1907
+ const reset = "\x1b[0m";
1908
+ const stripAnsi = (text) => text.replace(/\x1b\[[0-9;]*m/g, "");
1909
+ const writeDirect = (message) => {
1910
+ const ttyPath = process.platform === "win32" ? "CONOUT$" : "/dev/tty";
1911
+ try {
1912
+ const fd = fs.openSync(ttyPath, "w");
1913
+ fs.writeSync(fd, message);
1914
+ fs.closeSync(fd);
1915
+ return true;
1916
+ } catch {
1917
+ return false;
1918
+ }
1919
+ };
1920
+ let width = 0;
1921
+ const content = [
1922
+ "\x1b[31m _ _ \x1b[0m",
1923
+ "\x1b[31m __| | ___ ___ __| | _____ __\x1b[0m",
1924
+ "\x1b[31m / _` |/ _ \\ / __/ _` |/ _ \\ \\/ /\x1b[0m",
1925
+ "\x1b[31m | (_| | (_) | (_| (_| | __/> < \x1b[0m",
1926
+ "\x1b[31m \\__,_|\\___/ \\___\\__,_|\\___/_/\\_\\\x1b[0m",
1927
+ "",
1928
+ "\x1b[32mDocdex installed successfully!\x1b[0m",
1929
+ "\x1b[41m\x1b[97m IMPORTANT \x1b[0m \x1b[33mNext step:\x1b[0m run \x1b[32m`docdex setup`\x1b[0m to complete the installation.",
1930
+ "\x1b[33mSetup:\x1b[0m configures Ollama/models + browser.",
1931
+ "\x1b[34mTip:\x1b[0m after setup, start the daemon with \x1b[36m`docdexd serve --repo <path>`\x1b[0m"
1932
+ ];
1933
+ width = Math.max(72, content.reduce((max, line) => Math.max(max, stripAnsi(line).length), 0));
1934
+ const padLine = (text) => {
1935
+ const visible = stripAnsi(text).length;
1936
+ const padding = Math.max(0, width - visible);
1937
+ return `${text}${" ".repeat(padding)}`;
1938
+ };
1939
+
1940
+ const top = `${frame}╭${"─".repeat(width + 2)}╮${reset}`;
1941
+ const bottom = `${frame}╰${"─".repeat(width + 2)}╯${reset}`;
1942
+ const lines = [top];
1943
+ for (const line of content) {
1944
+ lines.push(`${frame}│ ${reset}${padLine(line)}${frame} │${reset}`);
1945
+ }
1946
+ lines.push(bottom);
1947
+ const banner = `\r\x1b[2K${lines.join("\n")}\n`;
1948
+ if (!writeDirect(banner)) {
1949
+ console.log(banner);
1950
+ }
1902
1951
  }
1903
1952
 
1904
1953
  function appendInstallSafetyLines(lines, err) {
@@ -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.12",
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": {