@deeplake/hivemind 0.7.64 → 0.7.66

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.
@@ -6,18 +6,18 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Cloud-backed persistent shared memory for AI agents powered by Deeplake",
9
- "version": "0.7.64"
9
+ "version": "0.7.66"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "hivemind",
14
14
  "description": "Persistent shared memory powered by Deeplake — captures all session activity and provides cross-session, cross-agent memory search",
15
- "version": "0.7.64",
15
+ "version": "0.7.66",
16
16
  "source": {
17
17
  "source": "git-subdir",
18
18
  "url": "https://github.com/activeloopai/hivemind.git",
19
19
  "path": "claude-code",
20
- "sha": "1b089b2e268cffb7387c5366eef9272d89d3b6e3"
20
+ "sha": "a81e56e347bbfa7c8affadedcc6345ec5e6e2a72"
21
21
  },
22
22
  "homepage": "https://github.com/activeloopai/hivemind"
23
23
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hivemind",
3
3
  "description": "Cloud-backed persistent memory powered by Deeplake — read, write, and share memory across Claude Code sessions and agents",
4
- "version": "0.7.64",
4
+ "version": "0.7.66",
5
5
  "author": {
6
6
  "name": "Activeloop",
7
7
  "url": "https://deeplake.ai"
package/bundle/cli.js CHANGED
@@ -382,9 +382,11 @@ function isHivemindHookEntry(entry, pluginDir = PLUGIN_DIR) {
382
382
  const cmd = h.command;
383
383
  if (typeof cmd !== "string")
384
384
  return false;
385
- if (cmd.includes(`${pluginDir}/bundle/`))
385
+ const nCmd = cmd.replace(/\\/g, "/");
386
+ const nPluginDir = pluginDir.replace(/\\/g, "/");
387
+ if (nCmd.includes(`${nPluginDir}/bundle/`))
386
388
  return true;
387
- return HIVEMIND_BUNDLE_FILES.some((f) => cmd.includes(`/bundle/${f}`));
389
+ return HIVEMIND_BUNDLE_FILES.some((f) => nCmd.includes(`/bundle/${f}`));
388
390
  });
389
391
  }
390
392
  function isForeignHivemindHookEntry(entry, pluginDir = PLUGIN_DIR) {
@@ -398,7 +400,7 @@ function isForeignHivemindHookEntry(entry, pluginDir = PLUGIN_DIR) {
398
400
  const cmd = h.command;
399
401
  if (typeof cmd !== "string")
400
402
  return false;
401
- return !cmd.includes(`${pluginDir}/bundle/`);
403
+ return !cmd.replace(/\\/g, "/").includes(`${pluginDir.replace(/\\/g, "/")}/bundle/`);
402
404
  });
403
405
  }
404
406
  function mergeHooks(existing, ours, pluginDir = PLUGIN_DIR) {
@@ -707,7 +709,9 @@ function isHivemindEntry(entry) {
707
709
  if (!entry || typeof entry !== "object")
708
710
  return false;
709
711
  const cmd = entry.command;
710
- return typeof cmd === "string" && cmd.includes("/.cursor/hivemind/bundle/");
712
+ if (typeof cmd !== "string")
713
+ return false;
714
+ return cmd.replace(/\\/g, "/").includes("/.cursor/hivemind/bundle/");
711
715
  }
712
716
  function mergeHooks2(existing) {
713
717
  const root = existing ?? { version: 1, hooks: {} };
@@ -1005,6 +1005,12 @@ var DeeplakeApi = class {
1005
1005
  }
1006
1006
  };
1007
1007
 
1008
+ // dist/src/utils/project-name.js
1009
+ import { basename } from "node:path";
1010
+ function projectNameFromCwd(cwd) {
1011
+ return basename(cwd ?? "") || "unknown";
1012
+ }
1013
+
1008
1014
  // dist/src/utils/session-path.js
1009
1015
  function buildSessionPath(config, sessionId) {
1010
1016
  const workspace = config.workspaceId ?? "default";
@@ -1530,9 +1536,9 @@ function embeddingsDisabled() {
1530
1536
  // dist/src/embeddings/self-heal.js
1531
1537
  import { existsSync as existsSync5, lstatSync, mkdirSync as mkdirSync5, readlinkSync, renameSync as renameSync3, rmSync, symlinkSync, statSync as statSync2 } from "node:fs";
1532
1538
  import { homedir as homedir8 } from "node:os";
1533
- import { basename, dirname as dirname2, join as join9 } from "node:path";
1539
+ import { basename as basename2, dirname as dirname2, join as join9 } from "node:path";
1534
1540
  function ensurePluginNodeModulesLink(opts) {
1535
- if (basename(opts.bundleDir) !== "bundle") {
1541
+ if (basename2(opts.bundleDir) !== "bundle") {
1536
1542
  return { kind: "not-bundle-layout", bundleDir: opts.bundleDir };
1537
1543
  }
1538
1544
  const target = opts.sharedNodeModules ?? join9(homedir8(), ".hivemind", "embed-deps", "node_modules");
@@ -1731,7 +1737,7 @@ function releaseLock(sessionId) {
1731
1737
  }
1732
1738
 
1733
1739
  // dist/src/hooks/codex/spawn-wiki-worker.js
1734
- import { spawn as spawn2, execSync } from "node:child_process";
1740
+ import { execSync } from "node:child_process";
1735
1741
  import { fileURLToPath } from "node:url";
1736
1742
  import { dirname as dirname4, join as join13 } from "node:path";
1737
1743
  import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync8 } from "node:fs";
@@ -1797,6 +1803,26 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1797
1803
  return null;
1798
1804
  }
1799
1805
 
1806
+ // dist/src/utils/spawn-detached.js
1807
+ import { spawn as nodeSpawn } from "node:child_process";
1808
+ function spawnDetachedNodeWorker(workerPath, args = [], deps = {}) {
1809
+ const spawn2 = deps.spawn ?? nodeSpawn;
1810
+ const execPath = deps.execPath ?? process.execPath;
1811
+ try {
1812
+ const child = spawn2(execPath, [workerPath, ...args], {
1813
+ detached: true,
1814
+ stdio: ["ignore", "ignore", "ignore"],
1815
+ // Suppress the transient console window Windows would otherwise pop for
1816
+ // the detached worker. No-op on POSIX.
1817
+ windowsHide: true
1818
+ });
1819
+ child.on("error", () => {
1820
+ });
1821
+ child.unref();
1822
+ } catch {
1823
+ }
1824
+ }
1825
+
1800
1826
  // dist/src/hooks/codex/spawn-wiki-worker.js
1801
1827
  var HOME = homedir10();
1802
1828
  var wikiLogger = makeWikiLogger(join13(HOME, ".codex", "hooks"));
@@ -1860,7 +1886,7 @@ function findCodexBin() {
1860
1886
  }
1861
1887
  function spawnCodexWikiWorker(opts) {
1862
1888
  const { config, sessionId, cwd, bundleDir, reason } = opts;
1863
- const projectName = cwd.split("/").pop() || "unknown";
1889
+ const projectName = projectNameFromCwd(cwd);
1864
1890
  const tmpDir = join13(tmpdir2(), `deeplake-wiki-${sessionId}-${Date.now()}`);
1865
1891
  mkdirSync8(tmpDir, { recursive: true });
1866
1892
  const pluginVersion = getInstalledVersion(bundleDir, ".codex-plugin") ?? "";
@@ -1884,10 +1910,7 @@ function spawnCodexWikiWorker(opts) {
1884
1910
  }));
1885
1911
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
1886
1912
  const workerPath = join13(bundleDir, "wiki-worker.js");
1887
- spawn2("nohup", ["node", workerPath, configFile], {
1888
- detached: true,
1889
- stdio: ["ignore", "ignore", "ignore"]
1890
- }).unref();
1913
+ spawnDetachedNodeWorker(workerPath, [configFile]);
1891
1914
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
1892
1915
  }
1893
1916
  function bundleDirFromImportMeta(importMetaUrl) {
@@ -1956,7 +1979,7 @@ async function main() {
1956
1979
  const sessionPath = buildSessionPath(config, input.session_id);
1957
1980
  const line = JSON.stringify(entry);
1958
1981
  log5(`writing to ${sessionPath}`);
1959
- const projectName = (input.cwd ?? "").split("/").pop() || "unknown";
1982
+ const projectName = projectNameFromCwd(input.cwd);
1960
1983
  const filename = sessionPath.split("/").pop() ?? "";
1961
1984
  const jsonForSql = line.replace(/'/g, "''");
1962
1985
  const embedding = embeddingsDisabled() ? null : await new EmbedClient({ daemonEntry: resolveEmbedDaemonPath() }).embed(line, "document");
@@ -1006,6 +1006,12 @@ var DeeplakeApi = class {
1006
1006
  }
1007
1007
  };
1008
1008
 
1009
+ // dist/src/utils/project-name.js
1010
+ import { basename } from "node:path";
1011
+ function projectNameFromCwd(cwd) {
1012
+ return basename(cwd ?? "") || "unknown";
1013
+ }
1014
+
1009
1015
  // dist/src/utils/stdin.js
1010
1016
  function readStdin() {
1011
1017
  return new Promise((resolve2, reject) => {
@@ -1149,7 +1155,7 @@ async function createPlaceholder(api, table, sessionId, cwd, userName, orgName,
1149
1155
  return;
1150
1156
  }
1151
1157
  const now = (/* @__PURE__ */ new Date()).toISOString();
1152
- const projectName = cwd.split("/").pop() ?? "unknown";
1158
+ const projectName = projectNameFromCwd(cwd);
1153
1159
  const sessionSource = `/sessions/${userName}/${userName}_${orgName}_${workspaceId}_${sessionId}.jsonl`;
1154
1160
  const content = [
1155
1161
  `# Session ${sessionId}`,
@@ -1010,8 +1010,14 @@ var DeeplakeApi = class {
1010
1010
  }
1011
1011
  };
1012
1012
 
1013
+ // dist/src/utils/project-name.js
1014
+ import { basename } from "node:path";
1015
+ function projectNameFromCwd(cwd) {
1016
+ return basename(cwd ?? "") || "unknown";
1017
+ }
1018
+
1013
1019
  // dist/src/hooks/codex/spawn-wiki-worker.js
1014
- import { spawn, execSync } from "node:child_process";
1020
+ import { execSync } from "node:child_process";
1015
1021
  import { fileURLToPath } from "node:url";
1016
1022
  import { dirname as dirname2, join as join8 } from "node:path";
1017
1023
  import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync5 } from "node:fs";
@@ -1077,6 +1083,26 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1077
1083
  return null;
1078
1084
  }
1079
1085
 
1086
+ // dist/src/utils/spawn-detached.js
1087
+ import { spawn as nodeSpawn } from "node:child_process";
1088
+ function spawnDetachedNodeWorker(workerPath, args = [], deps = {}) {
1089
+ const spawn2 = deps.spawn ?? nodeSpawn;
1090
+ const execPath = deps.execPath ?? process.execPath;
1091
+ try {
1092
+ const child = spawn2(execPath, [workerPath, ...args], {
1093
+ detached: true,
1094
+ stdio: ["ignore", "ignore", "ignore"],
1095
+ // Suppress the transient console window Windows would otherwise pop for
1096
+ // the detached worker. No-op on POSIX.
1097
+ windowsHide: true
1098
+ });
1099
+ child.on("error", () => {
1100
+ });
1101
+ child.unref();
1102
+ } catch {
1103
+ }
1104
+ }
1105
+
1080
1106
  // dist/src/hooks/codex/spawn-wiki-worker.js
1081
1107
  var HOME = homedir5();
1082
1108
  var wikiLogger = makeWikiLogger(join8(HOME, ".codex", "hooks"));
@@ -1140,7 +1166,7 @@ function findCodexBin() {
1140
1166
  }
1141
1167
  function spawnCodexWikiWorker(opts) {
1142
1168
  const { config, sessionId, cwd, bundleDir, reason } = opts;
1143
- const projectName = cwd.split("/").pop() || "unknown";
1169
+ const projectName = projectNameFromCwd(cwd);
1144
1170
  const tmpDir = join8(tmpdir2(), `deeplake-wiki-${sessionId}-${Date.now()}`);
1145
1171
  mkdirSync5(tmpDir, { recursive: true });
1146
1172
  const pluginVersion = getInstalledVersion(bundleDir, ".codex-plugin") ?? "";
@@ -1164,10 +1190,7 @@ function spawnCodexWikiWorker(opts) {
1164
1190
  }));
1165
1191
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
1166
1192
  const workerPath = join8(bundleDir, "wiki-worker.js");
1167
- spawn("nohup", ["node", workerPath, configFile], {
1168
- detached: true,
1169
- stdio: ["ignore", "ignore", "ignore"]
1170
- }).unref();
1193
+ spawnDetachedNodeWorker(workerPath, [configFile]);
1171
1194
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
1172
1195
  }
1173
1196
  function bundleDirFromImportMeta(importMetaUrl) {
@@ -1175,7 +1198,6 @@ function bundleDirFromImportMeta(importMetaUrl) {
1175
1198
  }
1176
1199
 
1177
1200
  // dist/src/skillify/spawn-skillify-worker.js
1178
- import { spawn as spawn2 } from "node:child_process";
1179
1201
  import { fileURLToPath as fileURLToPath2 } from "node:url";
1180
1202
  import { dirname as dirname3, join as join10 } from "node:path";
1181
1203
  import { writeFileSync as writeFileSync5, mkdirSync as mkdirSync6, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
@@ -1296,10 +1318,7 @@ function spawnSkillifyWorker(opts) {
1296
1318
  }
1297
1319
  skillifyLog(`${reason}: spawning skillify worker for project=${project} key=${projectKey}`);
1298
1320
  const workerPath = join10(bundleDir, "skillify-worker.js");
1299
- spawn2("nohup", ["node", workerPath, configFile], {
1300
- detached: true,
1301
- stdio: ["ignore", "ignore", "ignore"]
1302
- }).unref();
1321
+ spawnDetachedNodeWorker(workerPath, [configFile]);
1303
1322
  skillifyLog(`${reason}: spawned skillify worker for ${projectKey}`);
1304
1323
  }
1305
1324
 
@@ -1310,7 +1329,7 @@ import { join as join13 } from "node:path";
1310
1329
  // dist/src/utils/repo-identity.js
1311
1330
  import { execSync as execSync2 } from "node:child_process";
1312
1331
  import { createHash } from "node:crypto";
1313
- import { basename, resolve as resolve2 } from "node:path";
1332
+ import { basename as basename2, resolve as resolve2 } from "node:path";
1314
1333
  var DEFAULT_PORTS = {
1315
1334
  http: "80",
1316
1335
  https: "443",
@@ -1338,7 +1357,7 @@ function normalizeGitRemoteUrl(url) {
1338
1357
  }
1339
1358
  function deriveProjectKey(cwd) {
1340
1359
  const absCwd = resolve2(cwd);
1341
- const project = basename(absCwd) || "unknown";
1360
+ const project = basename2(absCwd) || "unknown";
1342
1361
  let signature = null;
1343
1362
  try {
1344
1363
  const raw = execSync2("git config --get remote.origin.url", {
@@ -1645,7 +1664,7 @@ function buildSessionPath(config, sessionId) {
1645
1664
 
1646
1665
  // dist/src/embeddings/client.js
1647
1666
  import { connect } from "node:net";
1648
- import { spawn as spawn3 } from "node:child_process";
1667
+ import { spawn } from "node:child_process";
1649
1668
  import { openSync as openSync4, closeSync as closeSync4, writeSync as writeSync3, unlinkSync as unlinkSync5, existsSync as existsSync8, readFileSync as readFileSync9 } from "node:fs";
1650
1669
  import { homedir as homedir10 } from "node:os";
1651
1670
  import { join as join16 } from "node:path";
@@ -1944,7 +1963,7 @@ var EmbedClient = class {
1944
1963
  return;
1945
1964
  }
1946
1965
  try {
1947
- const child = spawn3(process.execPath, [this.daemonEntry], {
1966
+ const child = spawn(process.execPath, [this.daemonEntry], {
1948
1967
  detached: true,
1949
1968
  stdio: "ignore",
1950
1969
  env: process.env
@@ -2225,7 +2244,7 @@ async function main() {
2225
2244
  };
2226
2245
  const line = JSON.stringify(entry);
2227
2246
  const sessionPath = buildSessionPath(config, sessionId);
2228
- const projectName = (input.cwd ?? "").split("/").pop() || "unknown";
2247
+ const projectName = projectNameFromCwd(input.cwd);
2229
2248
  const filename = sessionPath.split("/").pop() ?? "";
2230
2249
  const jsonForSql = line.replace(/'/g, "''");
2231
2250
  const embedding = embeddingsDisabled() ? null : await new EmbedClient({ daemonEntry: resolveEmbedDaemonPath() }).embed(line, "document");
@@ -1005,6 +1005,12 @@ var DeeplakeApi = class {
1005
1005
  }
1006
1006
  };
1007
1007
 
1008
+ // dist/src/utils/project-name.js
1009
+ import { basename } from "node:path";
1010
+ function projectNameFromCwd(cwd) {
1011
+ return basename(cwd ?? "") || "unknown";
1012
+ }
1013
+
1008
1014
  // dist/src/utils/session-path.js
1009
1015
  function buildSessionPath(config, sessionId) {
1010
1016
  const workspace = config.workspaceId ?? "default";
@@ -1530,9 +1536,9 @@ function embeddingsDisabled() {
1530
1536
  // dist/src/embeddings/self-heal.js
1531
1537
  import { existsSync as existsSync5, lstatSync, mkdirSync as mkdirSync5, readlinkSync, renameSync as renameSync3, rmSync, symlinkSync, statSync as statSync2 } from "node:fs";
1532
1538
  import { homedir as homedir8 } from "node:os";
1533
- import { basename, dirname as dirname2, join as join9 } from "node:path";
1539
+ import { basename as basename2, dirname as dirname2, join as join9 } from "node:path";
1534
1540
  function ensurePluginNodeModulesLink(opts) {
1535
- if (basename(opts.bundleDir) !== "bundle") {
1541
+ if (basename2(opts.bundleDir) !== "bundle") {
1536
1542
  return { kind: "not-bundle-layout", bundleDir: opts.bundleDir };
1537
1543
  }
1538
1544
  const target = opts.sharedNodeModules ?? join9(homedir8(), ".hivemind", "embed-deps", "node_modules");
@@ -1731,7 +1737,7 @@ function releaseLock(sessionId) {
1731
1737
  }
1732
1738
 
1733
1739
  // dist/src/hooks/cursor/spawn-wiki-worker.js
1734
- import { spawn as spawn2, execSync } from "node:child_process";
1740
+ import { execSync } from "node:child_process";
1735
1741
  import { fileURLToPath } from "node:url";
1736
1742
  import { dirname as dirname4, join as join13 } from "node:path";
1737
1743
  import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync8 } from "node:fs";
@@ -1797,6 +1803,26 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1797
1803
  return null;
1798
1804
  }
1799
1805
 
1806
+ // dist/src/utils/spawn-detached.js
1807
+ import { spawn as nodeSpawn } from "node:child_process";
1808
+ function spawnDetachedNodeWorker(workerPath, args = [], deps = {}) {
1809
+ const spawn2 = deps.spawn ?? nodeSpawn;
1810
+ const execPath = deps.execPath ?? process.execPath;
1811
+ try {
1812
+ const child = spawn2(execPath, [workerPath, ...args], {
1813
+ detached: true,
1814
+ stdio: ["ignore", "ignore", "ignore"],
1815
+ // Suppress the transient console window Windows would otherwise pop for
1816
+ // the detached worker. No-op on POSIX.
1817
+ windowsHide: true
1818
+ });
1819
+ child.on("error", () => {
1820
+ });
1821
+ child.unref();
1822
+ } catch {
1823
+ }
1824
+ }
1825
+
1800
1826
  // dist/src/hooks/cursor/spawn-wiki-worker.js
1801
1827
  var HOME = homedir10();
1802
1828
  var wikiLogger = makeWikiLogger(join13(HOME, ".cursor", "hooks"));
@@ -1860,7 +1886,7 @@ function findCursorBin() {
1860
1886
  }
1861
1887
  function spawnCursorWikiWorker(opts) {
1862
1888
  const { config, sessionId, cwd, bundleDir, reason } = opts;
1863
- const projectName = cwd.split("/").pop() || "unknown";
1889
+ const projectName = projectNameFromCwd(cwd);
1864
1890
  const tmpDir = join13(tmpdir2(), `deeplake-wiki-${sessionId}-${Date.now()}`);
1865
1891
  mkdirSync8(tmpDir, { recursive: true });
1866
1892
  const pluginVersion = getInstalledVersion(bundleDir, ".claude-plugin") ?? "";
@@ -1885,10 +1911,7 @@ function spawnCursorWikiWorker(opts) {
1885
1911
  }));
1886
1912
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
1887
1913
  const workerPath = join13(bundleDir, "wiki-worker.js");
1888
- spawn2("nohup", ["node", workerPath, configFile], {
1889
- detached: true,
1890
- stdio: ["ignore", "ignore", "ignore"]
1891
- }).unref();
1914
+ spawnDetachedNodeWorker(workerPath, [configFile]);
1892
1915
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
1893
1916
  }
1894
1917
  function bundleDirFromImportMeta(importMetaUrl) {
@@ -1896,7 +1919,6 @@ function bundleDirFromImportMeta(importMetaUrl) {
1896
1919
  }
1897
1920
 
1898
1921
  // dist/src/skillify/spawn-skillify-worker.js
1899
- import { spawn as spawn3 } from "node:child_process";
1900
1922
  import { fileURLToPath as fileURLToPath2 } from "node:url";
1901
1923
  import { dirname as dirname5, join as join15 } from "node:path";
1902
1924
  import { writeFileSync as writeFileSync7, mkdirSync as mkdirSync9, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
@@ -2017,10 +2039,7 @@ function spawnSkillifyWorker(opts) {
2017
2039
  }
2018
2040
  skillifyLog(`${reason}: spawning skillify worker for project=${project} key=${projectKey}`);
2019
2041
  const workerPath = join15(bundleDir, "skillify-worker.js");
2020
- spawn3("nohup", ["node", workerPath, configFile], {
2021
- detached: true,
2022
- stdio: ["ignore", "ignore", "ignore"]
2023
- }).unref();
2042
+ spawnDetachedNodeWorker(workerPath, [configFile]);
2024
2043
  skillifyLog(`${reason}: spawned skillify worker for ${projectKey}`);
2025
2044
  }
2026
2045
 
@@ -2031,7 +2050,7 @@ import { join as join18 } from "node:path";
2031
2050
  // dist/src/utils/repo-identity.js
2032
2051
  import { execSync as execSync2 } from "node:child_process";
2033
2052
  import { createHash } from "node:crypto";
2034
- import { basename as basename2, resolve as resolve2 } from "node:path";
2053
+ import { basename as basename3, resolve as resolve2 } from "node:path";
2035
2054
  var DEFAULT_PORTS = {
2036
2055
  http: "80",
2037
2056
  https: "443",
@@ -2059,7 +2078,7 @@ function normalizeGitRemoteUrl(url) {
2059
2078
  }
2060
2079
  function deriveProjectKey(cwd) {
2061
2080
  const absCwd = resolve2(cwd);
2062
- const project = basename2(absCwd) || "unknown";
2081
+ const project = basename3(absCwd) || "unknown";
2063
2082
  let signature = null;
2064
2083
  try {
2065
2084
  const raw = execSync2("git config --get remote.origin.url", {
@@ -2403,7 +2422,7 @@ async function main() {
2403
2422
  const sessionPath = buildSessionPath(config, sessionId);
2404
2423
  const line = JSON.stringify(entry);
2405
2424
  log5(`writing to ${sessionPath}`);
2406
- const projectName = cwd.split("/").pop() || "unknown";
2425
+ const projectName = projectNameFromCwd(cwd);
2407
2426
  const filename = sessionPath.split("/").pop() ?? "";
2408
2427
  const jsonForSql = line.replace(/'/g, "''");
2409
2428
  const embedding = embeddingsDisabled() ? null : await new EmbedClient({ daemonEntry: resolveEmbedDaemonPath() }).embed(line, "document");
@@ -126,7 +126,7 @@ function tryAcquireLock(sessionId, maxAgeMs = 10 * 60 * 1e3) {
126
126
  }
127
127
 
128
128
  // dist/src/hooks/cursor/spawn-wiki-worker.js
129
- import { spawn, execSync } from "node:child_process";
129
+ import { execSync } from "node:child_process";
130
130
  import { fileURLToPath } from "node:url";
131
131
  import { dirname as dirname2, join as join6 } from "node:path";
132
132
  import { writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "node:fs";
@@ -192,6 +192,32 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
192
192
  return null;
193
193
  }
194
194
 
195
+ // dist/src/utils/spawn-detached.js
196
+ import { spawn as nodeSpawn } from "node:child_process";
197
+ function spawnDetachedNodeWorker(workerPath, args = [], deps = {}) {
198
+ const spawn = deps.spawn ?? nodeSpawn;
199
+ const execPath = deps.execPath ?? process.execPath;
200
+ try {
201
+ const child = spawn(execPath, [workerPath, ...args], {
202
+ detached: true,
203
+ stdio: ["ignore", "ignore", "ignore"],
204
+ // Suppress the transient console window Windows would otherwise pop for
205
+ // the detached worker. No-op on POSIX.
206
+ windowsHide: true
207
+ });
208
+ child.on("error", () => {
209
+ });
210
+ child.unref();
211
+ } catch {
212
+ }
213
+ }
214
+
215
+ // dist/src/utils/project-name.js
216
+ import { basename } from "node:path";
217
+ function projectNameFromCwd(cwd) {
218
+ return basename(cwd ?? "") || "unknown";
219
+ }
220
+
195
221
  // dist/src/hooks/cursor/spawn-wiki-worker.js
196
222
  var HOME = homedir4();
197
223
  var wikiLogger = makeWikiLogger(join6(HOME, ".cursor", "hooks"));
@@ -255,7 +281,7 @@ function findCursorBin() {
255
281
  }
256
282
  function spawnCursorWikiWorker(opts) {
257
283
  const { config, sessionId, cwd, bundleDir, reason } = opts;
258
- const projectName = cwd.split("/").pop() || "unknown";
284
+ const projectName = projectNameFromCwd(cwd);
259
285
  const tmpDir = join6(tmpdir(), `deeplake-wiki-${sessionId}-${Date.now()}`);
260
286
  mkdirSync3(tmpDir, { recursive: true });
261
287
  const pluginVersion = getInstalledVersion(bundleDir, ".claude-plugin") ?? "";
@@ -280,10 +306,7 @@ function spawnCursorWikiWorker(opts) {
280
306
  }));
281
307
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
282
308
  const workerPath = join6(bundleDir, "wiki-worker.js");
283
- spawn("nohup", ["node", workerPath, configFile], {
284
- detached: true,
285
- stdio: ["ignore", "ignore", "ignore"]
286
- }).unref();
309
+ spawnDetachedNodeWorker(workerPath, [configFile]);
287
310
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
288
311
  }
289
312
  function bundleDirFromImportMeta(importMetaUrl) {
@@ -291,7 +314,6 @@ function bundleDirFromImportMeta(importMetaUrl) {
291
314
  }
292
315
 
293
316
  // dist/src/skillify/spawn-skillify-worker.js
294
- import { spawn as spawn2 } from "node:child_process";
295
317
  import { fileURLToPath as fileURLToPath2 } from "node:url";
296
318
  import { dirname as dirname3, join as join8 } from "node:path";
297
319
  import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync4, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
@@ -412,10 +434,7 @@ function spawnSkillifyWorker(opts) {
412
434
  }
413
435
  skillifyLog(`${reason}: spawning skillify worker for project=${project} key=${projectKey}`);
414
436
  const workerPath = join8(bundleDir, "skillify-worker.js");
415
- spawn2("nohup", ["node", workerPath, configFile], {
416
- detached: true,
417
- stdio: ["ignore", "ignore", "ignore"]
418
- }).unref();
437
+ spawnDetachedNodeWorker(workerPath, [configFile]);
419
438
  skillifyLog(`${reason}: spawned skillify worker for ${projectKey}`);
420
439
  }
421
440
 
@@ -426,7 +445,7 @@ import { join as join11 } from "node:path";
426
445
  // dist/src/utils/repo-identity.js
427
446
  import { execSync as execSync2 } from "node:child_process";
428
447
  import { createHash } from "node:crypto";
429
- import { basename, resolve } from "node:path";
448
+ import { basename as basename2, resolve } from "node:path";
430
449
  var DEFAULT_PORTS = {
431
450
  http: "80",
432
451
  https: "443",
@@ -454,7 +473,7 @@ function normalizeGitRemoteUrl(url) {
454
473
  }
455
474
  function deriveProjectKey(cwd) {
456
475
  const absCwd = resolve(cwd);
457
- const project = basename(absCwd) || "unknown";
476
+ const project = basename2(absCwd) || "unknown";
458
477
  let signature = null;
459
478
  try {
460
479
  const raw = execSync2("git config --get remote.origin.url", {
@@ -1222,6 +1222,12 @@ function sanitizeForInject(text) {
1222
1222
  }
1223
1223
  var LINE_TERMINATOR_RE = /\r\n?|[\n\u2028\u2029\u0085]/g;
1224
1224
 
1225
+ // dist/src/utils/project-name.js
1226
+ import { basename } from "node:path";
1227
+ function projectNameFromCwd(cwd) {
1228
+ return basename(cwd ?? "") || "unknown";
1229
+ }
1230
+
1225
1231
  // dist/src/cli/skillify-spec.js
1226
1232
  var SKILLIFY_COMMANDS = [
1227
1233
  { cmd: "hivemind skillify", desc: "show scope, team, install, per-project state" },
@@ -2274,7 +2280,7 @@ async function createPlaceholder(api, table, sessionId, cwd, userName, orgName,
2274
2280
  if (existing.length > 0)
2275
2281
  return;
2276
2282
  const now = (/* @__PURE__ */ new Date()).toISOString();
2277
- const projectName = cwd.split("/").pop() ?? "unknown";
2283
+ const projectName = projectNameFromCwd(cwd);
2278
2284
  const sessionSource = `/sessions/${userName}/${userName}_${orgName}_${workspaceId}_${sessionId}.jsonl`;
2279
2285
  const content = [
2280
2286
  `# Session ${sessionId}`,
@@ -1004,6 +1004,12 @@ var DeeplakeApi = class {
1004
1004
  }
1005
1005
  };
1006
1006
 
1007
+ // dist/src/utils/project-name.js
1008
+ import { basename } from "node:path";
1009
+ function projectNameFromCwd(cwd) {
1010
+ return basename(cwd ?? "") || "unknown";
1011
+ }
1012
+
1007
1013
  // dist/src/utils/session-path.js
1008
1014
  function buildSessionPath(config, sessionId) {
1009
1015
  const workspace = config.workspaceId ?? "default";
@@ -1529,9 +1535,9 @@ function embeddingsDisabled() {
1529
1535
  // dist/src/embeddings/self-heal.js
1530
1536
  import { existsSync as existsSync5, lstatSync, mkdirSync as mkdirSync5, readlinkSync, renameSync as renameSync3, rmSync, symlinkSync, statSync as statSync2 } from "node:fs";
1531
1537
  import { homedir as homedir8 } from "node:os";
1532
- import { basename, dirname as dirname2, join as join9 } from "node:path";
1538
+ import { basename as basename2, dirname as dirname2, join as join9 } from "node:path";
1533
1539
  function ensurePluginNodeModulesLink(opts) {
1534
- if (basename(opts.bundleDir) !== "bundle") {
1540
+ if (basename2(opts.bundleDir) !== "bundle") {
1535
1541
  return { kind: "not-bundle-layout", bundleDir: opts.bundleDir };
1536
1542
  }
1537
1543
  const target = opts.sharedNodeModules ?? join9(homedir8(), ".hivemind", "embed-deps", "node_modules");
@@ -1730,7 +1736,7 @@ function releaseLock(sessionId) {
1730
1736
  }
1731
1737
 
1732
1738
  // dist/src/hooks/hermes/spawn-wiki-worker.js
1733
- import { spawn as spawn2, execSync } from "node:child_process";
1739
+ import { execSync } from "node:child_process";
1734
1740
  import { fileURLToPath } from "node:url";
1735
1741
  import { dirname as dirname4, join as join13 } from "node:path";
1736
1742
  import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync8 } from "node:fs";
@@ -1796,6 +1802,26 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1796
1802
  return null;
1797
1803
  }
1798
1804
 
1805
+ // dist/src/utils/spawn-detached.js
1806
+ import { spawn as nodeSpawn } from "node:child_process";
1807
+ function spawnDetachedNodeWorker(workerPath, args = [], deps = {}) {
1808
+ const spawn2 = deps.spawn ?? nodeSpawn;
1809
+ const execPath = deps.execPath ?? process.execPath;
1810
+ try {
1811
+ const child = spawn2(execPath, [workerPath, ...args], {
1812
+ detached: true,
1813
+ stdio: ["ignore", "ignore", "ignore"],
1814
+ // Suppress the transient console window Windows would otherwise pop for
1815
+ // the detached worker. No-op on POSIX.
1816
+ windowsHide: true
1817
+ });
1818
+ child.on("error", () => {
1819
+ });
1820
+ child.unref();
1821
+ } catch {
1822
+ }
1823
+ }
1824
+
1799
1825
  // dist/src/hooks/hermes/spawn-wiki-worker.js
1800
1826
  var HOME = homedir10();
1801
1827
  var wikiLogger = makeWikiLogger(join13(HOME, ".hermes", "hooks"));
@@ -1859,7 +1885,7 @@ function findHermesBin() {
1859
1885
  }
1860
1886
  function spawnHermesWikiWorker(opts) {
1861
1887
  const { config, sessionId, cwd, bundleDir, reason } = opts;
1862
- const projectName = cwd.split("/").pop() || "unknown";
1888
+ const projectName = projectNameFromCwd(cwd);
1863
1889
  const tmpDir = join13(tmpdir2(), `deeplake-wiki-${sessionId}-${Date.now()}`);
1864
1890
  mkdirSync8(tmpDir, { recursive: true });
1865
1891
  const pluginVersion = getInstalledVersion(bundleDir, ".claude-plugin") ?? "";
@@ -1885,10 +1911,7 @@ function spawnHermesWikiWorker(opts) {
1885
1911
  }));
1886
1912
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
1887
1913
  const workerPath = join13(bundleDir, "wiki-worker.js");
1888
- spawn2("nohup", ["node", workerPath, configFile], {
1889
- detached: true,
1890
- stdio: ["ignore", "ignore", "ignore"]
1891
- }).unref();
1914
+ spawnDetachedNodeWorker(workerPath, [configFile]);
1892
1915
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
1893
1916
  }
1894
1917
  function bundleDirFromImportMeta(importMetaUrl) {
@@ -1896,7 +1919,6 @@ function bundleDirFromImportMeta(importMetaUrl) {
1896
1919
  }
1897
1920
 
1898
1921
  // dist/src/skillify/spawn-skillify-worker.js
1899
- import { spawn as spawn3 } from "node:child_process";
1900
1922
  import { fileURLToPath as fileURLToPath2 } from "node:url";
1901
1923
  import { dirname as dirname5, join as join15 } from "node:path";
1902
1924
  import { writeFileSync as writeFileSync7, mkdirSync as mkdirSync9, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
@@ -2017,10 +2039,7 @@ function spawnSkillifyWorker(opts) {
2017
2039
  }
2018
2040
  skillifyLog(`${reason}: spawning skillify worker for project=${project} key=${projectKey}`);
2019
2041
  const workerPath = join15(bundleDir, "skillify-worker.js");
2020
- spawn3("nohup", ["node", workerPath, configFile], {
2021
- detached: true,
2022
- stdio: ["ignore", "ignore", "ignore"]
2023
- }).unref();
2042
+ spawnDetachedNodeWorker(workerPath, [configFile]);
2024
2043
  skillifyLog(`${reason}: spawned skillify worker for ${projectKey}`);
2025
2044
  }
2026
2045
 
@@ -2031,7 +2050,7 @@ import { join as join18 } from "node:path";
2031
2050
  // dist/src/utils/repo-identity.js
2032
2051
  import { execSync as execSync2 } from "node:child_process";
2033
2052
  import { createHash } from "node:crypto";
2034
- import { basename as basename2, resolve as resolve2 } from "node:path";
2053
+ import { basename as basename3, resolve as resolve2 } from "node:path";
2035
2054
  var DEFAULT_PORTS = {
2036
2055
  http: "80",
2037
2056
  https: "443",
@@ -2059,7 +2078,7 @@ function normalizeGitRemoteUrl(url) {
2059
2078
  }
2060
2079
  function deriveProjectKey(cwd) {
2061
2080
  const absCwd = resolve2(cwd);
2062
- const project = basename2(absCwd) || "unknown";
2081
+ const project = basename3(absCwd) || "unknown";
2063
2082
  let signature = null;
2064
2083
  try {
2065
2084
  const raw = execSync2("git config --get remote.origin.url", {
@@ -2401,7 +2420,7 @@ async function main() {
2401
2420
  const sessionPath = buildSessionPath(config, sessionId);
2402
2421
  const line = JSON.stringify(entry);
2403
2422
  log5(`writing to ${sessionPath}`);
2404
- const projectName = cwd.split("/").pop() || "unknown";
2423
+ const projectName = projectNameFromCwd(cwd);
2405
2424
  const filename = sessionPath.split("/").pop() ?? "";
2406
2425
  const jsonForSql = line.replace(/'/g, "''");
2407
2426
  const embedding = embeddingsDisabled() ? null : await new EmbedClient({ daemonEntry: resolveEmbedDaemonPath() }).embed(line, "document");
@@ -124,7 +124,7 @@ function tryAcquireLock(sessionId, maxAgeMs = 10 * 60 * 1e3) {
124
124
  }
125
125
 
126
126
  // dist/src/hooks/hermes/spawn-wiki-worker.js
127
- import { spawn, execSync } from "node:child_process";
127
+ import { execSync } from "node:child_process";
128
128
  import { fileURLToPath } from "node:url";
129
129
  import { dirname as dirname2, join as join6 } from "node:path";
130
130
  import { writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "node:fs";
@@ -190,6 +190,32 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
190
190
  return null;
191
191
  }
192
192
 
193
+ // dist/src/utils/spawn-detached.js
194
+ import { spawn as nodeSpawn } from "node:child_process";
195
+ function spawnDetachedNodeWorker(workerPath, args = [], deps = {}) {
196
+ const spawn = deps.spawn ?? nodeSpawn;
197
+ const execPath = deps.execPath ?? process.execPath;
198
+ try {
199
+ const child = spawn(execPath, [workerPath, ...args], {
200
+ detached: true,
201
+ stdio: ["ignore", "ignore", "ignore"],
202
+ // Suppress the transient console window Windows would otherwise pop for
203
+ // the detached worker. No-op on POSIX.
204
+ windowsHide: true
205
+ });
206
+ child.on("error", () => {
207
+ });
208
+ child.unref();
209
+ } catch {
210
+ }
211
+ }
212
+
213
+ // dist/src/utils/project-name.js
214
+ import { basename } from "node:path";
215
+ function projectNameFromCwd(cwd) {
216
+ return basename(cwd ?? "") || "unknown";
217
+ }
218
+
193
219
  // dist/src/hooks/hermes/spawn-wiki-worker.js
194
220
  var HOME = homedir4();
195
221
  var wikiLogger = makeWikiLogger(join6(HOME, ".hermes", "hooks"));
@@ -253,7 +279,7 @@ function findHermesBin() {
253
279
  }
254
280
  function spawnHermesWikiWorker(opts) {
255
281
  const { config, sessionId, cwd, bundleDir, reason } = opts;
256
- const projectName = cwd.split("/").pop() || "unknown";
282
+ const projectName = projectNameFromCwd(cwd);
257
283
  const tmpDir = join6(tmpdir(), `deeplake-wiki-${sessionId}-${Date.now()}`);
258
284
  mkdirSync3(tmpDir, { recursive: true });
259
285
  const pluginVersion = getInstalledVersion(bundleDir, ".claude-plugin") ?? "";
@@ -279,10 +305,7 @@ function spawnHermesWikiWorker(opts) {
279
305
  }));
280
306
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
281
307
  const workerPath = join6(bundleDir, "wiki-worker.js");
282
- spawn("nohup", ["node", workerPath, configFile], {
283
- detached: true,
284
- stdio: ["ignore", "ignore", "ignore"]
285
- }).unref();
308
+ spawnDetachedNodeWorker(workerPath, [configFile]);
286
309
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
287
310
  }
288
311
  function bundleDirFromImportMeta(importMetaUrl) {
@@ -290,7 +313,6 @@ function bundleDirFromImportMeta(importMetaUrl) {
290
313
  }
291
314
 
292
315
  // dist/src/skillify/spawn-skillify-worker.js
293
- import { spawn as spawn2 } from "node:child_process";
294
316
  import { fileURLToPath as fileURLToPath2 } from "node:url";
295
317
  import { dirname as dirname3, join as join8 } from "node:path";
296
318
  import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync4, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
@@ -411,10 +433,7 @@ function spawnSkillifyWorker(opts) {
411
433
  }
412
434
  skillifyLog(`${reason}: spawning skillify worker for project=${project} key=${projectKey}`);
413
435
  const workerPath = join8(bundleDir, "skillify-worker.js");
414
- spawn2("nohup", ["node", workerPath, configFile], {
415
- detached: true,
416
- stdio: ["ignore", "ignore", "ignore"]
417
- }).unref();
436
+ spawnDetachedNodeWorker(workerPath, [configFile]);
418
437
  skillifyLog(`${reason}: spawned skillify worker for ${projectKey}`);
419
438
  }
420
439
 
@@ -425,7 +444,7 @@ import { join as join11 } from "node:path";
425
444
  // dist/src/utils/repo-identity.js
426
445
  import { execSync as execSync2 } from "node:child_process";
427
446
  import { createHash } from "node:crypto";
428
- import { basename, resolve } from "node:path";
447
+ import { basename as basename2, resolve } from "node:path";
429
448
  var DEFAULT_PORTS = {
430
449
  http: "80",
431
450
  https: "443",
@@ -453,7 +472,7 @@ function normalizeGitRemoteUrl(url) {
453
472
  }
454
473
  function deriveProjectKey(cwd) {
455
474
  const absCwd = resolve(cwd);
456
- const project = basename(absCwd) || "unknown";
475
+ const project = basename2(absCwd) || "unknown";
457
476
  let signature = null;
458
477
  try {
459
478
  const raw = execSync2("git config --get remote.origin.url", {
@@ -1221,6 +1221,12 @@ function sanitizeForInject(text) {
1221
1221
  }
1222
1222
  var LINE_TERMINATOR_RE = /\r\n?|[\n\u2028\u2029\u0085]/g;
1223
1223
 
1224
+ // dist/src/utils/project-name.js
1225
+ import { basename } from "node:path";
1226
+ function projectNameFromCwd(cwd) {
1227
+ return basename(cwd ?? "") || "unknown";
1228
+ }
1229
+
1224
1230
  // dist/src/cli/skillify-spec.js
1225
1231
  var SKILLIFY_COMMANDS = [
1226
1232
  { cmd: "hivemind skillify", desc: "show scope, team, install, per-project state" },
@@ -2264,7 +2270,7 @@ async function createPlaceholder(api, table, sessionId, cwd, userName, orgName,
2264
2270
  if (existing.length > 0)
2265
2271
  return;
2266
2272
  const now = (/* @__PURE__ */ new Date()).toISOString();
2267
- const projectName = cwd.split("/").pop() ?? "unknown";
2273
+ const projectName = projectNameFromCwd(cwd);
2268
2274
  const sessionSource = `/sessions/${userName}/${userName}_${orgName}_${workspaceId}_${sessionId}.jsonl`;
2269
2275
  const content = [
2270
2276
  `# Session ${sessionId}`,
@@ -1823,7 +1823,7 @@ function extractLatestVersion(body) {
1823
1823
  return typeof v === "string" && v.length > 0 ? v : null;
1824
1824
  }
1825
1825
  function getInstalledVersion() {
1826
- return "0.7.64".length > 0 ? "0.7.64" : null;
1826
+ return "0.7.66".length > 0 ? "0.7.66" : null;
1827
1827
  }
1828
1828
  function isNewer(latest, current) {
1829
1829
  const parse = (v) => v.replace(/-.*$/, "").split(".").map(Number);
@@ -54,5 +54,5 @@
54
54
  }
55
55
  }
56
56
  },
57
- "version": "0.7.64"
57
+ "version": "0.7.66"
58
58
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hivemind",
3
- "version": "0.7.64",
3
+ "version": "0.7.66",
4
4
  "type": "module",
5
5
  "description": "Hivemind — cloud-backed persistent shared memory for AI agents, powered by DeepLake",
6
6
  "license": "Apache-2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeplake/hivemind",
3
- "version": "0.7.64",
3
+ "version": "0.7.66",
4
4
  "description": "Cloud-backed persistent shared memory for AI agents powered by Deeplake",
5
5
  "type": "module",
6
6
  "repository": {