@deeplake/hivemind 0.7.80 → 0.7.81

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 (45) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/bundle/cli.js +131 -94
  4. package/codex/bundle/capture.js +66 -39
  5. package/codex/bundle/commands/auth-login.js +14 -10
  6. package/codex/bundle/embeddings/embed-daemon.js +9 -5
  7. package/codex/bundle/graph-on-stop.js +32 -28
  8. package/codex/bundle/graph-pull-worker.js +27 -23
  9. package/codex/bundle/pre-tool-use.js +56 -36
  10. package/codex/bundle/session-start-setup.js +18 -14
  11. package/codex/bundle/session-start.js +26 -22
  12. package/codex/bundle/shell/deeplake-shell.js +30 -26
  13. package/codex/bundle/skillify-worker.js +14 -10
  14. package/codex/bundle/skillopt-worker.js +17 -13
  15. package/codex/bundle/stop.js +50 -45
  16. package/codex/bundle/wiki-worker.js +18 -14
  17. package/cursor/bundle/capture.js +71 -44
  18. package/cursor/bundle/commands/auth-login.js +14 -10
  19. package/cursor/bundle/embeddings/embed-daemon.js +9 -5
  20. package/cursor/bundle/graph-on-stop.js +32 -28
  21. package/cursor/bundle/graph-pull-worker.js +27 -23
  22. package/cursor/bundle/pre-tool-use.js +28 -24
  23. package/cursor/bundle/session-end.js +40 -36
  24. package/cursor/bundle/session-start.js +39 -35
  25. package/cursor/bundle/shell/deeplake-shell.js +30 -26
  26. package/cursor/bundle/skillify-worker.js +14 -10
  27. package/cursor/bundle/wiki-worker.js +18 -14
  28. package/hermes/bundle/capture.js +73 -46
  29. package/hermes/bundle/commands/auth-login.js +14 -10
  30. package/hermes/bundle/embeddings/embed-daemon.js +9 -5
  31. package/hermes/bundle/graph-on-stop.js +32 -28
  32. package/hermes/bundle/graph-pull-worker.js +27 -23
  33. package/hermes/bundle/pre-tool-use.js +32 -28
  34. package/hermes/bundle/session-end.js +40 -36
  35. package/hermes/bundle/session-start.js +39 -35
  36. package/hermes/bundle/shell/deeplake-shell.js +30 -26
  37. package/hermes/bundle/skillify-worker.js +14 -10
  38. package/hermes/bundle/skillopt-worker.js +17 -13
  39. package/hermes/bundle/wiki-worker.js +18 -14
  40. package/mcp/bundle/server.js +15 -11
  41. package/openclaw/dist/index.js +11 -7
  42. package/openclaw/dist/skillify-worker.js +14 -10
  43. package/openclaw/openclaw.plugin.json +1 -1
  44. package/openclaw/package.json +1 -1
  45. package/package.json +1 -1
@@ -16,7 +16,7 @@ __export(index_marker_store_exports, {
16
16
  hasFreshIndexMarker: () => hasFreshIndexMarker,
17
17
  writeIndexMarker: () => writeIndexMarker
18
18
  });
19
- import { existsSync as existsSync4, mkdirSync as mkdirSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "node:fs";
19
+ import { existsSync as existsSync4, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "node:fs";
20
20
  import { join as join8 } from "node:path";
21
21
  import { tmpdir } from "node:os";
22
22
  function getIndexMarkerDir() {
@@ -40,7 +40,7 @@ function hasFreshIndexMarker(markerPath) {
40
40
  }
41
41
  }
42
42
  function writeIndexMarker(markerPath) {
43
- mkdirSync5(getIndexMarkerDir(), { recursive: true });
43
+ mkdirSync6(getIndexMarkerDir(), { recursive: true });
44
44
  writeFileSync5(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
45
45
  }
46
46
  var INDEX_MARKER_TTL_MS;
@@ -54,7 +54,7 @@ var init_index_marker_store = __esm({
54
54
  // dist/src/hooks/graph-on-stop.js
55
55
  import { execFileSync as execFileSync3 } from "node:child_process";
56
56
  import { createHash as createHash7 } from "node:crypto";
57
- import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync13 } from "node:fs";
57
+ import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync14 } from "node:fs";
58
58
  import { join as join18 } from "node:path";
59
59
 
60
60
  // dist/src/commands/graph.js
@@ -309,8 +309,8 @@ function loadConfig() {
309
309
  import { randomUUID } from "node:crypto";
310
310
 
311
311
  // dist/src/utils/debug.js
312
- import { appendFileSync } from "node:fs";
313
- import { join as join5 } from "node:path";
312
+ import { appendFileSync, mkdirSync as mkdirSync3 } from "node:fs";
313
+ import { dirname as dirname3, join as join5 } from "node:path";
314
314
  import { homedir as homedir3 } from "node:os";
315
315
  var LOG = join5(homedir3(), ".deeplake", "hook-debug.log");
316
316
  function isDebug() {
@@ -319,8 +319,12 @@ function isDebug() {
319
319
  function log(tag, msg) {
320
320
  if (!isDebug())
321
321
  return;
322
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
322
+ try {
323
+ mkdirSync3(dirname3(LOG), { recursive: true });
324
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
323
325
  `);
326
+ } catch {
327
+ }
324
328
  }
325
329
 
326
330
  // dist/src/utils/sql.js
@@ -526,7 +530,7 @@ async function healMissingColumns(args) {
526
530
  }
527
531
 
528
532
  // dist/src/notifications/queue.js
529
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, renameSync as renameSync2, mkdirSync as mkdirSync3, openSync, closeSync, unlinkSync as unlinkSync2, statSync } from "node:fs";
533
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, renameSync as renameSync2, mkdirSync as mkdirSync4, openSync, closeSync, unlinkSync as unlinkSync2, statSync } from "node:fs";
530
534
  import { join as join6, resolve } from "node:path";
531
535
  import { homedir as homedir4 } from "node:os";
532
536
  import { setTimeout as sleep } from "node:timers/promises";
@@ -564,14 +568,14 @@ function writeQueue(q) {
564
568
  if (!_isQueuePathInsideHome(path, home)) {
565
569
  throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
566
570
  }
567
- mkdirSync3(join6(home, ".deeplake"), { recursive: true, mode: 448 });
571
+ mkdirSync4(join6(home, ".deeplake"), { recursive: true, mode: 448 });
568
572
  const tmp = `${path}.${process.pid}.tmp`;
569
573
  writeFileSync3(tmp, JSON.stringify(q, null, 2), { mode: 384 });
570
574
  renameSync2(tmp, path);
571
575
  }
572
576
  async function withQueueLock(fn) {
573
577
  const path = lockPath();
574
- mkdirSync3(join6(homedir4(), ".deeplake"), { recursive: true, mode: 448 });
578
+ mkdirSync4(join6(homedir4(), ".deeplake"), { recursive: true, mode: 448 });
575
579
  let fd = null;
576
580
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
577
581
  try {
@@ -627,7 +631,7 @@ async function enqueueNotification(n) {
627
631
  }
628
632
 
629
633
  // dist/src/commands/auth-creds.js
630
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, unlinkSync as unlinkSync3 } from "node:fs";
634
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync5, unlinkSync as unlinkSync3 } from "node:fs";
631
635
  import { join as join7 } from "node:path";
632
636
  import { homedir as homedir5 } from "node:os";
633
637
  function configDir() {
@@ -1255,8 +1259,8 @@ function canonicalJSON(value) {
1255
1259
  // dist/src/graph/deeplake-pull.js
1256
1260
  import { execFileSync } from "node:child_process";
1257
1261
  import { createHash as createHash5 } from "node:crypto";
1258
- import { existsSync as existsSync7, mkdirSync as mkdirSync9, renameSync as renameSync5, writeFileSync as writeFileSync8 } from "node:fs";
1259
- import { dirname as dirname6, join as join12 } from "node:path";
1262
+ import { existsSync as existsSync7, mkdirSync as mkdirSync10, renameSync as renameSync5, writeFileSync as writeFileSync8 } from "node:fs";
1263
+ import { dirname as dirname7, join as join12 } from "node:path";
1260
1264
 
1261
1265
  // dist/src/utils/repo-identity.js
1262
1266
  import { execSync } from "node:child_process";
@@ -1306,8 +1310,8 @@ function deriveProjectKey(cwd) {
1306
1310
  }
1307
1311
 
1308
1312
  // dist/src/graph/last-build.js
1309
- import { existsSync as existsSync5, mkdirSync as mkdirSync6, readFileSync as readFileSync8, renameSync as renameSync3, writeFileSync as writeFileSync6 } from "node:fs";
1310
- import { dirname as dirname3, join as join9 } from "node:path";
1313
+ import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync8, renameSync as renameSync3, writeFileSync as writeFileSync6 } from "node:fs";
1314
+ import { dirname as dirname4, join as join9 } from "node:path";
1311
1315
  function lastBuildPath(baseDir, worktreeId) {
1312
1316
  if (worktreeId !== void 0) {
1313
1317
  return join9(baseDir, "worktrees", worktreeId, ".last-build.json");
@@ -1317,7 +1321,7 @@ function lastBuildPath(baseDir, worktreeId) {
1317
1321
  function writeLastBuild(baseDir, state, worktreeId) {
1318
1322
  const path = lastBuildPath(baseDir, worktreeId);
1319
1323
  try {
1320
- mkdirSync6(dirname3(path), { recursive: true });
1324
+ mkdirSync7(dirname4(path), { recursive: true });
1321
1325
  const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
1322
1326
  writeFileSync6(tmp, JSON.stringify(state));
1323
1327
  renameSync3(tmp, path);
@@ -1366,15 +1370,15 @@ function readLastBuild(baseDir, worktreeId) {
1366
1370
  }
1367
1371
 
1368
1372
  // dist/src/graph/history.js
1369
- import { appendFileSync as appendFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync9 } from "node:fs";
1370
- import { dirname as dirname4, join as join10 } from "node:path";
1373
+ import { appendFileSync as appendFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync8, readFileSync as readFileSync9 } from "node:fs";
1374
+ import { dirname as dirname5, join as join10 } from "node:path";
1371
1375
  function historyPath(baseDir) {
1372
1376
  return join10(baseDir, "history.jsonl");
1373
1377
  }
1374
1378
  function appendHistoryEntry(baseDir, entry) {
1375
1379
  const path = historyPath(baseDir);
1376
1380
  try {
1377
- mkdirSync7(dirname4(path), { recursive: true });
1381
+ mkdirSync8(dirname5(path), { recursive: true });
1378
1382
  appendFileSync2(path, JSON.stringify(entry) + "\n");
1379
1383
  } catch {
1380
1384
  }
@@ -1392,9 +1396,9 @@ function entryFromSnapshot(snapshot, snapshot_sha256, trigger) {
1392
1396
 
1393
1397
  // dist/src/graph/snapshot.js
1394
1398
  import { createHash as createHash4 } from "node:crypto";
1395
- import { mkdirSync as mkdirSync8, renameSync as renameSync4, writeFileSync as writeFileSync7 } from "node:fs";
1399
+ import { mkdirSync as mkdirSync9, renameSync as renameSync4, writeFileSync as writeFileSync7 } from "node:fs";
1396
1400
  import { homedir as homedir6 } from "node:os";
1397
- import { dirname as dirname5, join as join11 } from "node:path";
1401
+ import { dirname as dirname6, join as join11 } from "node:path";
1398
1402
 
1399
1403
  // dist/src/graph/resolve/cross-file.js
1400
1404
  import { posix } from "node:path";
@@ -1774,7 +1778,7 @@ function writeSnapshot(snapshot, baseDir, trigger = "unknown", worktreeId) {
1774
1778
  return { snapshotPath, latestCommitPath, snapshotSha256: sha256 };
1775
1779
  }
1776
1780
  function writeFileAtomic(filePath, contents) {
1777
- mkdirSync8(dirname5(filePath), { recursive: true });
1781
+ mkdirSync9(dirname6(filePath), { recursive: true });
1778
1782
  const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
1779
1783
  writeFileSync7(tmp, contents);
1780
1784
  renameSync4(tmp, filePath);
@@ -2572,7 +2576,7 @@ function extractFile(sourceCode, relativePath) {
2572
2576
  }
2573
2577
 
2574
2578
  // dist/src/graph/ignore-config.js
2575
- import { mkdirSync as mkdirSync10, readFileSync as readFileSync11, writeFileSync as writeFileSync9 } from "node:fs";
2579
+ import { mkdirSync as mkdirSync11, readFileSync as readFileSync11, writeFileSync as writeFileSync9 } from "node:fs";
2576
2580
  import { homedir as homedir7 } from "node:os";
2577
2581
  import { join as join14 } from "node:path";
2578
2582
  var DEFAULT_IGNORE_DIRS = [
@@ -2653,7 +2657,7 @@ function loadGraphIgnore(deeplakeDir = join14(homedir7(), ".deeplake")) {
2653
2657
  } catch {
2654
2658
  }
2655
2659
  try {
2656
- mkdirSync10(deeplakeDir, { recursive: true });
2660
+ mkdirSync11(deeplakeDir, { recursive: true });
2657
2661
  writeFileSync9(path, JSON.stringify(defaultConfigObject(), null, 2) + "\n", { flag: "wx" });
2658
2662
  } catch {
2659
2663
  }
@@ -2668,8 +2672,8 @@ function pathHasIgnoredSegment(relPath, ignore) {
2668
2672
  }
2669
2673
 
2670
2674
  // dist/src/graph/git-hook-install.js
2671
- import { chmodSync, existsSync as existsSync9, mkdirSync as mkdirSync11, readFileSync as readFileSync12, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "node:fs";
2672
- import { dirname as dirname7, join as join15, resolve as resolve3 } from "node:path";
2675
+ import { chmodSync, existsSync as existsSync9, mkdirSync as mkdirSync12, readFileSync as readFileSync12, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "node:fs";
2676
+ import { dirname as dirname8, join as join15, resolve as resolve3 } from "node:path";
2673
2677
  import { execFileSync as execFileSync2 } from "node:child_process";
2674
2678
 
2675
2679
  // dist/src/commands/graph.js
@@ -2946,7 +2950,7 @@ function readGitBranch(cwd) {
2946
2950
  }
2947
2951
 
2948
2952
  // dist/src/graph/build-lock.js
2949
- import { mkdirSync as mkdirSync12, readFileSync as readFileSync14, statSync as statSync2, unlinkSync as unlinkSync5, writeFileSync as writeFileSync11 } from "node:fs";
2953
+ import { mkdirSync as mkdirSync13, readFileSync as readFileSync14, statSync as statSync2, unlinkSync as unlinkSync5, writeFileSync as writeFileSync11 } from "node:fs";
2950
2954
  import { join as join17 } from "node:path";
2951
2955
  var STALE_LOCK_MS = 5 * 60 * 1e3;
2952
2956
  function lockPath2(baseDir) {
@@ -2955,7 +2959,7 @@ function lockPath2(baseDir) {
2955
2959
  function acquireBuildLock(baseDir) {
2956
2960
  const path = lockPath2(baseDir);
2957
2961
  try {
2958
- mkdirSync12(baseDir, { recursive: true });
2962
+ mkdirSync13(baseDir, { recursive: true });
2959
2963
  } catch {
2960
2964
  return { acquired: false, reason: "fs-error" };
2961
2965
  }
@@ -3130,7 +3134,7 @@ function logToFile(cwd, line) {
3130
3134
  try {
3131
3135
  const { key } = deriveProjectKey(cwd);
3132
3136
  const dir = repoDir(key);
3133
- mkdirSync13(dir, { recursive: true });
3137
+ mkdirSync14(dir, { recursive: true });
3134
3138
  appendFileSync3(join18(dir, ".graph-on-stop.log"), `[${(/* @__PURE__ */ new Date()).toISOString()}] ${line}
3135
3139
  `);
3136
3140
  } catch {
@@ -17,7 +17,7 @@ __export(index_marker_store_exports, {
17
17
  hasFreshIndexMarker: () => hasFreshIndexMarker,
18
18
  writeIndexMarker: () => writeIndexMarker
19
19
  });
20
- import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
20
+ import { existsSync as existsSync2, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
21
21
  import { join as join5 } from "node:path";
22
22
  import { tmpdir } from "node:os";
23
23
  function getIndexMarkerDir() {
@@ -41,7 +41,7 @@ function hasFreshIndexMarker(markerPath) {
41
41
  }
42
42
  }
43
43
  function writeIndexMarker(markerPath) {
44
- mkdirSync3(getIndexMarkerDir(), { recursive: true });
44
+ mkdirSync4(getIndexMarkerDir(), { recursive: true });
45
45
  writeFileSync3(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
46
46
  }
47
47
  var INDEX_MARKER_TTL_MS;
@@ -53,14 +53,14 @@ var init_index_marker_store = __esm({
53
53
  });
54
54
 
55
55
  // dist/src/hooks/graph-pull-worker.js
56
- import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync8 } from "node:fs";
56
+ import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync9 } from "node:fs";
57
57
  import { join as join10 } from "node:path";
58
58
 
59
59
  // dist/src/graph/deeplake-pull.js
60
60
  import { execFileSync } from "node:child_process";
61
61
  import { createHash as createHash3 } from "node:crypto";
62
- import { existsSync as existsSync5, mkdirSync as mkdirSync7, renameSync as renameSync4, writeFileSync as writeFileSync6 } from "node:fs";
63
- import { dirname as dirname4, join as join9 } from "node:path";
62
+ import { existsSync as existsSync5, mkdirSync as mkdirSync8, renameSync as renameSync4, writeFileSync as writeFileSync6 } from "node:fs";
63
+ import { dirname as dirname5, join as join9 } from "node:path";
64
64
 
65
65
  // dist/src/config.js
66
66
  import { readFileSync, existsSync } from "node:fs";
@@ -113,8 +113,8 @@ function loadConfig() {
113
113
  import { randomUUID } from "node:crypto";
114
114
 
115
115
  // dist/src/utils/debug.js
116
- import { appendFileSync } from "node:fs";
117
- import { join as join2 } from "node:path";
116
+ import { appendFileSync, mkdirSync } from "node:fs";
117
+ import { dirname, join as join2 } from "node:path";
118
118
  import { homedir as homedir2 } from "node:os";
119
119
  var LOG = join2(homedir2(), ".deeplake", "hook-debug.log");
120
120
  function isDebug() {
@@ -123,8 +123,12 @@ function isDebug() {
123
123
  function log(tag, msg) {
124
124
  if (!isDebug())
125
125
  return;
126
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
126
+ try {
127
+ mkdirSync(dirname(LOG), { recursive: true });
128
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
127
129
  `);
130
+ } catch {
131
+ }
128
132
  }
129
133
 
130
134
  // dist/src/utils/sql.js
@@ -330,7 +334,7 @@ async function healMissingColumns(args) {
330
334
  }
331
335
 
332
336
  // dist/src/notifications/queue.js
333
- import { readFileSync as readFileSync2, writeFileSync, renameSync, mkdirSync, openSync, closeSync, unlinkSync, statSync } from "node:fs";
337
+ import { readFileSync as readFileSync2, writeFileSync, renameSync, mkdirSync as mkdirSync2, openSync, closeSync, unlinkSync, statSync } from "node:fs";
334
338
  import { join as join3, resolve } from "node:path";
335
339
  import { homedir as homedir3 } from "node:os";
336
340
  import { setTimeout as sleep } from "node:timers/promises";
@@ -368,14 +372,14 @@ function writeQueue(q) {
368
372
  if (!_isQueuePathInsideHome(path, home)) {
369
373
  throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
370
374
  }
371
- mkdirSync(join3(home, ".deeplake"), { recursive: true, mode: 448 });
375
+ mkdirSync2(join3(home, ".deeplake"), { recursive: true, mode: 448 });
372
376
  const tmp = `${path}.${process.pid}.tmp`;
373
377
  writeFileSync(tmp, JSON.stringify(q, null, 2), { mode: 384 });
374
378
  renameSync(tmp, path);
375
379
  }
376
380
  async function withQueueLock(fn) {
377
381
  const path = lockPath();
378
- mkdirSync(join3(homedir3(), ".deeplake"), { recursive: true, mode: 448 });
382
+ mkdirSync2(join3(homedir3(), ".deeplake"), { recursive: true, mode: 448 });
379
383
  let fd = null;
380
384
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
381
385
  try {
@@ -431,7 +435,7 @@ async function enqueueNotification(n) {
431
435
  }
432
436
 
433
437
  // dist/src/commands/auth-creds.js
434
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, unlinkSync as unlinkSync2 } from "node:fs";
438
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2 } from "node:fs";
435
439
  import { join as join4 } from "node:path";
436
440
  import { homedir as homedir4 } from "node:os";
437
441
  function configDir() {
@@ -1015,8 +1019,8 @@ function deriveProjectKey(cwd) {
1015
1019
  }
1016
1020
 
1017
1021
  // dist/src/graph/last-build.js
1018
- import { existsSync as existsSync3, mkdirSync as mkdirSync4, readFileSync as readFileSync5, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
1019
- import { dirname, join as join6 } from "node:path";
1022
+ import { existsSync as existsSync3, mkdirSync as mkdirSync5, readFileSync as readFileSync5, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
1023
+ import { dirname as dirname2, join as join6 } from "node:path";
1020
1024
  function lastBuildPath(baseDir, worktreeId) {
1021
1025
  if (worktreeId !== void 0) {
1022
1026
  return join6(baseDir, "worktrees", worktreeId, ".last-build.json");
@@ -1026,7 +1030,7 @@ function lastBuildPath(baseDir, worktreeId) {
1026
1030
  function writeLastBuild(baseDir, state, worktreeId) {
1027
1031
  const path = lastBuildPath(baseDir, worktreeId);
1028
1032
  try {
1029
- mkdirSync4(dirname(path), { recursive: true });
1033
+ mkdirSync5(dirname2(path), { recursive: true });
1030
1034
  const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
1031
1035
  writeFileSync4(tmp, JSON.stringify(state));
1032
1036
  renameSync2(tmp, path);
@@ -1075,15 +1079,15 @@ function readLastBuild(baseDir, worktreeId) {
1075
1079
  }
1076
1080
 
1077
1081
  // dist/src/graph/history.js
1078
- import { appendFileSync as appendFileSync2, existsSync as existsSync4, mkdirSync as mkdirSync5, readFileSync as readFileSync6 } from "node:fs";
1079
- import { dirname as dirname2, join as join7 } from "node:path";
1082
+ import { appendFileSync as appendFileSync2, existsSync as existsSync4, mkdirSync as mkdirSync6, readFileSync as readFileSync6 } from "node:fs";
1083
+ import { dirname as dirname3, join as join7 } from "node:path";
1080
1084
  function historyPath(baseDir) {
1081
1085
  return join7(baseDir, "history.jsonl");
1082
1086
  }
1083
1087
  function appendHistoryEntry(baseDir, entry) {
1084
1088
  const path = historyPath(baseDir);
1085
1089
  try {
1086
- mkdirSync5(dirname2(path), { recursive: true });
1090
+ mkdirSync6(dirname3(path), { recursive: true });
1087
1091
  appendFileSync2(path, JSON.stringify(entry) + "\n");
1088
1092
  } catch {
1089
1093
  }
@@ -1091,9 +1095,9 @@ function appendHistoryEntry(baseDir, entry) {
1091
1095
 
1092
1096
  // dist/src/graph/snapshot.js
1093
1097
  import { createHash as createHash2 } from "node:crypto";
1094
- import { mkdirSync as mkdirSync6, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
1098
+ import { mkdirSync as mkdirSync7, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
1095
1099
  import { homedir as homedir5 } from "node:os";
1096
- import { dirname as dirname3, join as join8 } from "node:path";
1100
+ import { dirname as dirname4, join as join8 } from "node:path";
1097
1101
 
1098
1102
  // dist/src/graph/resolve/cross-file.js
1099
1103
  import { posix } from "node:path";
@@ -1279,7 +1283,7 @@ function coerceSnapshotPayload(raw) {
1279
1283
  return null;
1280
1284
  }
1281
1285
  function writeFileAtomic(filePath, contents) {
1282
- mkdirSync7(dirname4(filePath), { recursive: true });
1286
+ mkdirSync8(dirname5(filePath), { recursive: true });
1283
1287
  const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
1284
1288
  writeFileSync6(tmp, contents);
1285
1289
  renameSync4(tmp, filePath);
@@ -1319,7 +1323,7 @@ async function main() {
1319
1323
  try {
1320
1324
  const { key } = deriveProjectKey(cwd);
1321
1325
  const dir = repoDir(key);
1322
- mkdirSync8(dir, { recursive: true });
1326
+ mkdirSync9(dir, { recursive: true });
1323
1327
  appendFileSync3(join10(dir, ".graph-pull.log"), logLine);
1324
1328
  } catch {
1325
1329
  }
@@ -1351,7 +1355,7 @@ async function main() {
1351
1355
  try {
1352
1356
  const { key } = deriveProjectKey(cwd);
1353
1357
  const dir = repoDir(key);
1354
- mkdirSync8(dir, { recursive: true });
1358
+ mkdirSync9(dir, { recursive: true });
1355
1359
  appendFileSync3(join10(dir, ".graph-pull.log"), logLine);
1356
1360
  } catch {
1357
1361
  }
@@ -16,7 +16,7 @@ __export(index_marker_store_exports, {
16
16
  hasFreshIndexMarker: () => hasFreshIndexMarker,
17
17
  writeIndexMarker: () => writeIndexMarker
18
18
  });
19
- import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
19
+ import { existsSync as existsSync2, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
20
20
  import { join as join5 } from "node:path";
21
21
  import { tmpdir } from "node:os";
22
22
  function getIndexMarkerDir() {
@@ -40,7 +40,7 @@ function hasFreshIndexMarker(markerPath) {
40
40
  }
41
41
  }
42
42
  function writeIndexMarker(markerPath) {
43
- mkdirSync3(getIndexMarkerDir(), { recursive: true });
43
+ mkdirSync4(getIndexMarkerDir(), { recursive: true });
44
44
  writeFileSync3(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
45
45
  }
46
46
  var INDEX_MARKER_TTL_MS;
@@ -119,8 +119,8 @@ function loadConfig() {
119
119
  import { randomUUID } from "node:crypto";
120
120
 
121
121
  // dist/src/utils/debug.js
122
- import { appendFileSync } from "node:fs";
123
- import { join as join2 } from "node:path";
122
+ import { appendFileSync, mkdirSync } from "node:fs";
123
+ import { dirname, join as join2 } from "node:path";
124
124
  import { homedir as homedir2 } from "node:os";
125
125
  var LOG = join2(homedir2(), ".deeplake", "hook-debug.log");
126
126
  function isDebug() {
@@ -129,8 +129,12 @@ function isDebug() {
129
129
  function log(tag, msg) {
130
130
  if (!isDebug())
131
131
  return;
132
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
132
+ try {
133
+ mkdirSync(dirname(LOG), { recursive: true });
134
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
133
135
  `);
136
+ } catch {
137
+ }
134
138
  }
135
139
 
136
140
  // dist/src/utils/sql.js
@@ -339,7 +343,7 @@ async function healMissingColumns(args) {
339
343
  }
340
344
 
341
345
  // dist/src/notifications/queue.js
342
- import { readFileSync as readFileSync2, writeFileSync, renameSync, mkdirSync, openSync, closeSync, unlinkSync, statSync } from "node:fs";
346
+ import { readFileSync as readFileSync2, writeFileSync, renameSync, mkdirSync as mkdirSync2, openSync, closeSync, unlinkSync, statSync } from "node:fs";
343
347
  import { join as join3, resolve } from "node:path";
344
348
  import { homedir as homedir3 } from "node:os";
345
349
  import { setTimeout as sleep } from "node:timers/promises";
@@ -377,14 +381,14 @@ function writeQueue(q) {
377
381
  if (!_isQueuePathInsideHome(path, home)) {
378
382
  throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
379
383
  }
380
- mkdirSync(join3(home, ".deeplake"), { recursive: true, mode: 448 });
384
+ mkdirSync2(join3(home, ".deeplake"), { recursive: true, mode: 448 });
381
385
  const tmp = `${path}.${process.pid}.tmp`;
382
386
  writeFileSync(tmp, JSON.stringify(q, null, 2), { mode: 384 });
383
387
  renameSync(tmp, path);
384
388
  }
385
389
  async function withQueueLock(fn) {
386
390
  const path = lockPath();
387
- mkdirSync(join3(homedir3(), ".deeplake"), { recursive: true, mode: 448 });
391
+ mkdirSync2(join3(homedir3(), ".deeplake"), { recursive: true, mode: 448 });
388
392
  let fd = null;
389
393
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
390
394
  try {
@@ -440,7 +444,7 @@ async function enqueueNotification(n) {
440
444
  }
441
445
 
442
446
  // dist/src/commands/auth-creds.js
443
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, unlinkSync as unlinkSync2 } from "node:fs";
447
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2 } from "node:fs";
444
448
  import { join as join4 } from "node:path";
445
449
  import { homedir as homedir4 } from "node:os";
446
450
  function configDir() {
@@ -1847,9 +1851,9 @@ import { join as join8 } from "node:path";
1847
1851
  import { pathToFileURL } from "node:url";
1848
1852
 
1849
1853
  // dist/src/user-config.js
1850
- import { existsSync as existsSync4, mkdirSync as mkdirSync4, readFileSync as readFileSync6, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
1854
+ import { existsSync as existsSync4, mkdirSync as mkdirSync5, readFileSync as readFileSync6, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
1851
1855
  import { homedir as homedir6 } from "node:os";
1852
- import { dirname, join as join7 } from "node:path";
1856
+ import { dirname as dirname2, join as join7 } from "node:path";
1853
1857
  var _configPath = () => process.env.HIVEMIND_CONFIG_PATH ?? join7(homedir6(), ".deeplake", "config.json");
1854
1858
  var _cache = null;
1855
1859
  var _migrated = false;
@@ -1874,9 +1878,9 @@ function writeUserConfig(patch) {
1874
1878
  const current = readUserConfig();
1875
1879
  const merged = deepMerge(current, patch);
1876
1880
  const path = _configPath();
1877
- const dir = dirname(path);
1881
+ const dir = dirname2(path);
1878
1882
  if (!existsSync4(dir))
1879
- mkdirSync4(dir, { recursive: true });
1883
+ mkdirSync5(dir, { recursive: true });
1880
1884
  const tmp = `${path}.tmp.${process.pid}`;
1881
1885
  writeFileSync4(tmp, JSON.stringify(merged, null, 2) + "\n", "utf-8");
1882
1886
  renameSync2(tmp, path);
@@ -1960,11 +1964,11 @@ function embeddingsDisabled() {
1960
1964
 
1961
1965
  // dist/src/hooks/grep-direct.js
1962
1966
  import { fileURLToPath } from "node:url";
1963
- import { dirname as dirname2, join as join9 } from "node:path";
1967
+ import { dirname as dirname3, join as join9 } from "node:path";
1964
1968
  var SEMANTIC_ENABLED = process.env.HIVEMIND_SEMANTIC_SEARCH !== "false" && !embeddingsDisabled();
1965
1969
  var SEMANTIC_TIMEOUT_MS = Number(process.env.HIVEMIND_SEMANTIC_EMBED_TIMEOUT_MS ?? "500");
1966
1970
  function resolveDaemonPath() {
1967
- return join9(dirname2(fileURLToPath(import.meta.url)), "..", "embeddings", "embed-daemon.js");
1971
+ return join9(dirname3(fileURLToPath(import.meta.url)), "..", "embeddings", "embed-daemon.js");
1968
1972
  }
1969
1973
  var sharedEmbedClient = null;
1970
1974
  function getEmbedClient() {
@@ -2336,13 +2340,13 @@ function rewritePaths(cmd) {
2336
2340
  }
2337
2341
 
2338
2342
  // dist/src/graph/vfs-handler.js
2339
- import { existsSync as existsSync7, mkdirSync as mkdirSync8, readFileSync as readFileSync9, renameSync as renameSync5, writeFileSync as writeFileSync7 } from "node:fs";
2343
+ import { existsSync as existsSync7, mkdirSync as mkdirSync9, readFileSync as readFileSync9, renameSync as renameSync5, writeFileSync as writeFileSync7 } from "node:fs";
2340
2344
  import { createHash as createHash3 } from "node:crypto";
2341
- import { join as join14, dirname as dirname6 } from "node:path";
2345
+ import { join as join14, dirname as dirname7 } from "node:path";
2342
2346
 
2343
2347
  // dist/src/graph/last-build.js
2344
- import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
2345
- import { dirname as dirname3, join as join11 } from "node:path";
2348
+ import { existsSync as existsSync5, mkdirSync as mkdirSync6, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
2349
+ import { dirname as dirname4, join as join11 } from "node:path";
2346
2350
  function lastBuildPath(baseDir, worktreeId) {
2347
2351
  if (worktreeId !== void 0) {
2348
2352
  return join11(baseDir, "worktrees", worktreeId, ".last-build.json");
@@ -2392,13 +2396,13 @@ function readLastBuild(baseDir, worktreeId) {
2392
2396
 
2393
2397
  // dist/src/graph/snapshot.js
2394
2398
  import { createHash } from "node:crypto";
2395
- import { mkdirSync as mkdirSync7, renameSync as renameSync4, writeFileSync as writeFileSync6 } from "node:fs";
2399
+ import { mkdirSync as mkdirSync8, renameSync as renameSync4, writeFileSync as writeFileSync6 } from "node:fs";
2396
2400
  import { homedir as homedir9 } from "node:os";
2397
- import { dirname as dirname5, join as join13 } from "node:path";
2401
+ import { dirname as dirname6, join as join13 } from "node:path";
2398
2402
 
2399
2403
  // dist/src/graph/history.js
2400
- import { appendFileSync as appendFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync8 } from "node:fs";
2401
- import { dirname as dirname4, join as join12 } from "node:path";
2404
+ import { appendFileSync as appendFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync8 } from "node:fs";
2405
+ import { dirname as dirname5, join as join12 } from "node:path";
2402
2406
 
2403
2407
  // dist/src/graph/resolve/cross-file.js
2404
2408
  import { posix } from "node:path";
@@ -3444,7 +3448,7 @@ function saveHandles(baseDir, worktreeId, ids, pattern) {
3444
3448
  const path = handlesPath(baseDir, worktreeId);
3445
3449
  const payload = { pattern, ts: Date.now(), ids };
3446
3450
  try {
3447
- mkdirSync8(dirname6(path), { recursive: true });
3451
+ mkdirSync9(dirname7(path), { recursive: true });
3448
3452
  const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
3449
3453
  writeFileSync7(tmp, JSON.stringify(payload));
3450
3454
  renameSync5(tmp, path);