@deeplake/hivemind 0.7.79 → 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 (46) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/bundle/cli.js +140 -94
  4. package/codex/bundle/capture.js +232 -72
  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 +366 -123
  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 +2061 -0
  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 +235 -85
  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 +298 -74
  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 +2061 -0
  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
  46. package/pi/extension-source/hivemind.ts +93 -0
@@ -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 mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
20
+ import { existsSync as existsSync2, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
21
21
  import { join as join6 } 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
- mkdirSync4(getIndexMarkerDir(), { recursive: true });
44
+ mkdirSync5(getIndexMarkerDir(), { recursive: true });
45
45
  writeFileSync4(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
46
46
  }
47
47
  var INDEX_MARKER_TTL_MS;
@@ -53,7 +53,7 @@ var init_index_marker_store = __esm({
53
53
  });
54
54
 
55
55
  // dist/src/hooks/codex/session-start-setup.js
56
- import { dirname as dirname2, join as join10 } from "node:path";
56
+ import { dirname as dirname3, join as join10 } from "node:path";
57
57
  import { fileURLToPath } from "node:url";
58
58
  import { homedir as homedir6 } from "node:os";
59
59
 
@@ -148,8 +148,8 @@ function loadConfig() {
148
148
  import { randomUUID as randomUUID2 } from "node:crypto";
149
149
 
150
150
  // dist/src/utils/debug.js
151
- import { appendFileSync } from "node:fs";
152
- import { join as join4 } from "node:path";
151
+ import { appendFileSync, mkdirSync as mkdirSync3 } from "node:fs";
152
+ import { dirname, join as join4 } from "node:path";
153
153
  import { homedir as homedir4 } from "node:os";
154
154
  var LOG = join4(homedir4(), ".deeplake", "hook-debug.log");
155
155
  function isDebug() {
@@ -161,8 +161,12 @@ function utcTimestamp(d = /* @__PURE__ */ new Date()) {
161
161
  function log(tag, msg) {
162
162
  if (!isDebug())
163
163
  return;
164
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
164
+ try {
165
+ mkdirSync3(dirname(LOG), { recursive: true });
166
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
165
167
  `);
168
+ } catch {
169
+ }
166
170
  }
167
171
 
168
172
  // dist/src/utils/sql.js
@@ -359,7 +363,7 @@ async function healMissingColumns(args) {
359
363
  }
360
364
 
361
365
  // dist/src/notifications/queue.js
362
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync3, openSync, closeSync, unlinkSync as unlinkSync2, statSync } from "node:fs";
366
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync4, openSync, closeSync, unlinkSync as unlinkSync2, statSync } from "node:fs";
363
367
  import { join as join5, resolve } from "node:path";
364
368
  import { homedir as homedir5 } from "node:os";
365
369
  import { setTimeout as sleep } from "node:timers/promises";
@@ -397,14 +401,14 @@ function writeQueue(q) {
397
401
  if (!_isQueuePathInsideHome(path, home)) {
398
402
  throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
399
403
  }
400
- mkdirSync3(join5(home, ".deeplake"), { recursive: true, mode: 448 });
404
+ mkdirSync4(join5(home, ".deeplake"), { recursive: true, mode: 448 });
401
405
  const tmp = `${path}.${process.pid}.tmp`;
402
406
  writeFileSync3(tmp, JSON.stringify(q, null, 2), { mode: 384 });
403
407
  renameSync(tmp, path);
404
408
  }
405
409
  async function withQueueLock(fn) {
406
410
  const path = lockPath();
407
- mkdirSync3(join5(homedir5(), ".deeplake"), { recursive: true, mode: 448 });
411
+ mkdirSync4(join5(homedir5(), ".deeplake"), { recursive: true, mode: 448 });
408
412
  let fd = null;
409
413
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
410
414
  try {
@@ -1002,7 +1006,7 @@ function readStdin() {
1002
1006
  }
1003
1007
 
1004
1008
  // dist/src/utils/wiki-log.js
1005
- import { mkdirSync as mkdirSync5, appendFileSync as appendFileSync2 } from "node:fs";
1009
+ import { mkdirSync as mkdirSync6, appendFileSync as appendFileSync2 } from "node:fs";
1006
1010
  import { join as join7 } from "node:path";
1007
1011
  function makeWikiLogger(hooksDir, filename = "deeplake-wiki.log") {
1008
1012
  const path = join7(hooksDir, filename);
@@ -1010,7 +1014,7 @@ function makeWikiLogger(hooksDir, filename = "deeplake-wiki.log") {
1010
1014
  path,
1011
1015
  log(msg) {
1012
1016
  try {
1013
- mkdirSync5(hooksDir, { recursive: true });
1017
+ mkdirSync6(hooksDir, { recursive: true });
1014
1018
  appendFileSync2(path, `[${utcTimestamp()}] ${msg}
1015
1019
  `);
1016
1020
  } catch {
@@ -1074,7 +1078,7 @@ async function autoUpdate(creds, opts) {
1074
1078
 
1075
1079
  // dist/src/utils/version-check.js
1076
1080
  import { readFileSync as readFileSync6 } from "node:fs";
1077
- import { dirname, join as join9 } from "node:path";
1081
+ import { dirname as dirname2, join as join9 } from "node:path";
1078
1082
  function getInstalledVersion(bundleDir, pluginManifestDir) {
1079
1083
  try {
1080
1084
  const pluginJson = join9(bundleDir, "..", pluginManifestDir, "plugin.json");
@@ -1106,7 +1110,7 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1106
1110
  return pkg.version;
1107
1111
  } catch {
1108
1112
  }
1109
- const parent = dirname(dir);
1113
+ const parent = dirname2(dir);
1110
1114
  if (parent === dir)
1111
1115
  break;
1112
1116
  dir = parent;
@@ -1117,7 +1121,7 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1117
1121
  // dist/src/hooks/codex/session-start-setup.js
1118
1122
  var log5 = (msg) => log("codex-session-setup", msg);
1119
1123
  var { log: wikiLog } = makeWikiLogger(join10(homedir6(), ".codex", "hooks"));
1120
- var __bundleDir = dirname2(fileURLToPath(import.meta.url));
1124
+ var __bundleDir = dirname3(fileURLToPath(import.meta.url));
1121
1125
  var PLUGIN_VERSION = getInstalledVersion(__bundleDir, ".codex-plugin") ?? "";
1122
1126
  async function createPlaceholder(api, table, sessionId, cwd, userName, orgName, workspaceId) {
1123
1127
  const summaryPath = `/summaries/${userName}/${sessionId}.md`;
@@ -17,7 +17,7 @@ __export(index_marker_store_exports, {
17
17
  hasFreshIndexMarker: () => hasFreshIndexMarker,
18
18
  writeIndexMarker: () => writeIndexMarker
19
19
  });
20
- import { existsSync as existsSync4, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "node:fs";
20
+ import { existsSync as existsSync4, mkdirSync as mkdirSync7, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "node:fs";
21
21
  import { join as join9 } 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
- mkdirSync6(getIndexMarkerDir(), { recursive: true });
44
+ mkdirSync7(getIndexMarkerDir(), { recursive: true });
45
45
  writeFileSync5(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
46
46
  }
47
47
  var INDEX_MARKER_TTL_MS;
@@ -55,7 +55,7 @@ var init_index_marker_store = __esm({
55
55
  // dist/src/hooks/codex/session-start.js
56
56
  import { spawn as spawn3 } from "node:child_process";
57
57
  import { fileURLToPath as fileURLToPath2 } from "node:url";
58
- import { dirname as dirname7, join as join17 } from "node:path";
58
+ import { dirname as dirname8, join as join17 } from "node:path";
59
59
 
60
60
  // dist/src/commands/auth.js
61
61
  import { execSync } from "node:child_process";
@@ -347,8 +347,8 @@ function maybeAutoMineLocal() {
347
347
  }
348
348
 
349
349
  // dist/src/utils/debug.js
350
- import { appendFileSync } from "node:fs";
351
- import { join as join5 } from "node:path";
350
+ import { appendFileSync, mkdirSync as mkdirSync5 } from "node:fs";
351
+ import { dirname as dirname3, join as join5 } from "node:path";
352
352
  import { homedir as homedir5 } from "node:os";
353
353
  var LOG = join5(homedir5(), ".deeplake", "hook-debug.log");
354
354
  function isDebug() {
@@ -357,13 +357,17 @@ function isDebug() {
357
357
  function log(tag, msg) {
358
358
  if (!isDebug())
359
359
  return;
360
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
360
+ try {
361
+ mkdirSync5(dirname3(LOG), { recursive: true });
362
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
361
363
  `);
364
+ } catch {
365
+ }
362
366
  }
363
367
 
364
368
  // dist/src/utils/version-check.js
365
369
  import { readFileSync as readFileSync4 } from "node:fs";
366
- import { dirname as dirname3, join as join6 } from "node:path";
370
+ import { dirname as dirname4, join as join6 } from "node:path";
367
371
  function getInstalledVersion(bundleDir, pluginManifestDir) {
368
372
  try {
369
373
  const pluginJson = join6(bundleDir, "..", pluginManifestDir, "plugin.json");
@@ -395,7 +399,7 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
395
399
  return pkg.version;
396
400
  } catch {
397
401
  }
398
- const parent = dirname3(dir);
402
+ const parent = dirname4(dir);
399
403
  if (parent === dir)
400
404
  break;
401
405
  dir = parent;
@@ -647,7 +651,7 @@ async function healMissingColumns(args) {
647
651
  }
648
652
 
649
653
  // dist/src/notifications/queue.js
650
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, renameSync, mkdirSync as mkdirSync5, openSync as openSync2, closeSync as closeSync2, unlinkSync as unlinkSync3, statSync as statSync2 } from "node:fs";
654
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, renameSync, mkdirSync as mkdirSync6, openSync as openSync2, closeSync as closeSync2, unlinkSync as unlinkSync3, statSync as statSync2 } from "node:fs";
651
655
  import { join as join8, resolve } from "node:path";
652
656
  import { homedir as homedir7 } from "node:os";
653
657
  import { setTimeout as sleep } from "node:timers/promises";
@@ -685,14 +689,14 @@ function writeQueue(q) {
685
689
  if (!_isQueuePathInsideHome(path, home)) {
686
690
  throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
687
691
  }
688
- mkdirSync5(join8(home, ".deeplake"), { recursive: true, mode: 448 });
692
+ mkdirSync6(join8(home, ".deeplake"), { recursive: true, mode: 448 });
689
693
  const tmp = `${path}.${process.pid}.tmp`;
690
694
  writeFileSync4(tmp, JSON.stringify(q, null, 2), { mode: 384 });
691
695
  renameSync(tmp, path);
692
696
  }
693
697
  async function withQueueLock(fn) {
694
698
  const path = lockPath();
695
- mkdirSync5(join8(homedir7(), ".deeplake"), { recursive: true, mode: 448 });
699
+ mkdirSync6(join8(homedir7(), ".deeplake"), { recursive: true, mode: 448 });
696
700
  let fd = null;
697
701
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
698
702
  try {
@@ -1267,12 +1271,12 @@ var DeeplakeApi = class {
1267
1271
  };
1268
1272
 
1269
1273
  // dist/src/skillify/pull.js
1270
- import { existsSync as existsSync9, readFileSync as readFileSync10, writeFileSync as writeFileSync8, mkdirSync as mkdirSync9, renameSync as renameSync4, lstatSync as lstatSync2, readlinkSync, symlinkSync, unlinkSync as unlinkSync5 } from "node:fs";
1274
+ import { existsSync as existsSync9, readFileSync as readFileSync10, writeFileSync as writeFileSync8, mkdirSync as mkdirSync10, renameSync as renameSync4, lstatSync as lstatSync2, readlinkSync, symlinkSync, unlinkSync as unlinkSync5 } from "node:fs";
1271
1275
  import { homedir as homedir11 } from "node:os";
1272
- import { dirname as dirname6, join as join15 } from "node:path";
1276
+ import { dirname as dirname7, join as join15 } from "node:path";
1273
1277
 
1274
1278
  // dist/src/skillify/skill-writer.js
1275
- import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync8, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync6 } from "node:fs";
1279
+ import { existsSync as existsSync5, mkdirSync as mkdirSync8, readFileSync as readFileSync8, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync6 } from "node:fs";
1276
1280
  import { homedir as homedir8 } from "node:os";
1277
1281
  import { join as join10 } from "node:path";
1278
1282
  function assertValidSkillName(name) {
@@ -1340,12 +1344,12 @@ function parseFrontmatter(text) {
1340
1344
  }
1341
1345
 
1342
1346
  // dist/src/skillify/manifest.js
1343
- import { existsSync as existsSync7, lstatSync, mkdirSync as mkdirSync8, readFileSync as readFileSync9, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync7 } from "node:fs";
1344
- import { dirname as dirname5, join as join13 } from "node:path";
1347
+ import { existsSync as existsSync7, lstatSync, mkdirSync as mkdirSync9, readFileSync as readFileSync9, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync7 } from "node:fs";
1348
+ import { dirname as dirname6, join as join13 } from "node:path";
1345
1349
 
1346
1350
  // dist/src/skillify/legacy-migration.js
1347
1351
  import { existsSync as existsSync6, renameSync as renameSync2 } from "node:fs";
1348
- import { dirname as dirname4, join as join12 } from "node:path";
1352
+ import { dirname as dirname5, join as join12 } from "node:path";
1349
1353
 
1350
1354
  // dist/src/skillify/state-dir.js
1351
1355
  import { homedir as homedir9 } from "node:os";
@@ -1365,7 +1369,7 @@ function migrateLegacyStateDir() {
1365
1369
  return;
1366
1370
  attempted = true;
1367
1371
  const current = getStateDir();
1368
- const legacy = join12(dirname4(current), "skilify");
1372
+ const legacy = join12(dirname5(current), "skilify");
1369
1373
  if (!existsSync6(legacy))
1370
1374
  return;
1371
1375
  if (existsSync6(current))
@@ -1443,7 +1447,7 @@ function loadManifest(path = manifestPath()) {
1443
1447
  }
1444
1448
  function saveManifest(m, path = manifestPath()) {
1445
1449
  migrateLegacyStateDir();
1446
- mkdirSync8(dirname5(path), { recursive: true });
1450
+ mkdirSync9(dirname6(path), { recursive: true });
1447
1451
  const tmp = `${path}.tmp`;
1448
1452
  writeFileSync7(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
1449
1453
  renameSync3(tmp, path);
@@ -1593,7 +1597,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
1593
1597
  }
1594
1598
  }
1595
1599
  try {
1596
- mkdirSync9(dirname6(link), { recursive: true });
1600
+ mkdirSync10(dirname7(link), { recursive: true });
1597
1601
  symlinkSync(canonicalDir, link, "dir");
1598
1602
  out.push(link);
1599
1603
  } catch {
@@ -1833,7 +1837,7 @@ async function runPull(opts) {
1833
1837
  });
1834
1838
  let manifestError;
1835
1839
  if (action === "wrote") {
1836
- mkdirSync9(skillDir, { recursive: true });
1840
+ mkdirSync10(skillDir, { recursive: true });
1837
1841
  if (existsSync9(skillFile)) {
1838
1842
  try {
1839
1843
  renameSync4(skillFile, `${skillFile}.bak`);
@@ -1971,7 +1975,7 @@ function spawnGraphPullWorker(cwd, bundleDir, deps = {}) {
1971
1975
 
1972
1976
  // dist/src/hooks/codex/session-start.js
1973
1977
  var log5 = (msg) => log("codex-session-start", msg);
1974
- var __bundleDir = dirname7(fileURLToPath2(import.meta.url));
1978
+ var __bundleDir = dirname8(fileURLToPath2(import.meta.url));
1975
1979
  async function main() {
1976
1980
  if (process.env.HIVEMIND_WIKI_WORKER === "1")
1977
1981
  return;
@@ -59941,7 +59941,7 @@ __export(index_marker_store_exports, {
59941
59941
  hasFreshIndexMarker: () => hasFreshIndexMarker,
59942
59942
  writeIndexMarker: () => writeIndexMarker
59943
59943
  });
59944
- import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
59944
+ import { existsSync as existsSync3, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
59945
59945
  import { join as join8 } from "node:path";
59946
59946
  import { tmpdir } from "node:os";
59947
59947
  function getIndexMarkerDir() {
@@ -59965,7 +59965,7 @@ function hasFreshIndexMarker(markerPath) {
59965
59965
  }
59966
59966
  }
59967
59967
  function writeIndexMarker(markerPath) {
59968
- mkdirSync3(getIndexMarkerDir(), { recursive: true });
59968
+ mkdirSync4(getIndexMarkerDir(), { recursive: true });
59969
59969
  writeFileSync3(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
59970
59970
  }
59971
59971
  var INDEX_MARKER_TTL_MS;
@@ -66814,8 +66814,8 @@ function loadConfig() {
66814
66814
  import { randomUUID } from "node:crypto";
66815
66815
 
66816
66816
  // dist/src/utils/debug.js
66817
- import { appendFileSync } from "node:fs";
66818
- import { join as join5 } from "node:path";
66817
+ import { appendFileSync, mkdirSync } from "node:fs";
66818
+ import { dirname as dirname4, join as join5 } from "node:path";
66819
66819
  import { homedir as homedir2 } from "node:os";
66820
66820
  var LOG = join5(homedir2(), ".deeplake", "hook-debug.log");
66821
66821
  function isDebug() {
@@ -66824,8 +66824,12 @@ function isDebug() {
66824
66824
  function log(tag, msg) {
66825
66825
  if (!isDebug())
66826
66826
  return;
66827
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
66827
+ try {
66828
+ mkdirSync(dirname4(LOG), { recursive: true });
66829
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
66828
66830
  `);
66831
+ } catch {
66832
+ }
66829
66833
  }
66830
66834
 
66831
66835
  // dist/src/utils/sql.js
@@ -67034,7 +67038,7 @@ async function healMissingColumns(args) {
67034
67038
  }
67035
67039
 
67036
67040
  // dist/src/notifications/queue.js
67037
- import { readFileSync as readFileSync2, writeFileSync, renameSync, mkdirSync, openSync, closeSync, unlinkSync, statSync as statSync2 } from "node:fs";
67041
+ import { readFileSync as readFileSync2, writeFileSync, renameSync, mkdirSync as mkdirSync2, openSync, closeSync, unlinkSync, statSync as statSync2 } from "node:fs";
67038
67042
  import { join as join6, resolve as resolve4 } from "node:path";
67039
67043
  import { homedir as homedir3 } from "node:os";
67040
67044
  import { setTimeout as sleep } from "node:timers/promises";
@@ -67072,14 +67076,14 @@ function writeQueue(q17) {
67072
67076
  if (!_isQueuePathInsideHome(path2, home)) {
67073
67077
  throw new Error(`notifications-queue write blocked: ${path2} is outside ${home}`);
67074
67078
  }
67075
- mkdirSync(join6(home, ".deeplake"), { recursive: true, mode: 448 });
67079
+ mkdirSync2(join6(home, ".deeplake"), { recursive: true, mode: 448 });
67076
67080
  const tmp = `${path2}.${process.pid}.tmp`;
67077
67081
  writeFileSync(tmp, JSON.stringify(q17, null, 2), { mode: 384 });
67078
67082
  renameSync(tmp, path2);
67079
67083
  }
67080
67084
  async function withQueueLock(fn4) {
67081
67085
  const path2 = lockPath();
67082
- mkdirSync(join6(homedir3(), ".deeplake"), { recursive: true, mode: 448 });
67086
+ mkdirSync2(join6(homedir3(), ".deeplake"), { recursive: true, mode: 448 });
67083
67087
  let fd = null;
67084
67088
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
67085
67089
  try {
@@ -67135,7 +67139,7 @@ async function enqueueNotification(n24) {
67135
67139
  }
67136
67140
 
67137
67141
  // dist/src/commands/auth-creds.js
67138
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, unlinkSync as unlinkSync2 } from "node:fs";
67142
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2 } from "node:fs";
67139
67143
  import { join as join7 } from "node:path";
67140
67144
  import { homedir as homedir4 } from "node:os";
67141
67145
  function configDir() {
@@ -67675,7 +67679,7 @@ var DeeplakeApi = class {
67675
67679
  import { basename as basename5, posix as posix2 } from "node:path";
67676
67680
  import { randomUUID as randomUUID2 } from "node:crypto";
67677
67681
  import { fileURLToPath } from "node:url";
67678
- import { dirname as dirname9, join as join16 } from "node:path";
67682
+ import { dirname as dirname10, join as join16 } from "node:path";
67679
67683
 
67680
67684
  // dist/src/shell/grep-core.js
67681
67685
  var TOOL_INPUT_FIELDS = [
@@ -68507,9 +68511,9 @@ import { join as join11 } from "node:path";
68507
68511
  import { pathToFileURL } from "node:url";
68508
68512
 
68509
68513
  // dist/src/user-config.js
68510
- import { existsSync as existsSync5, mkdirSync as mkdirSync4, readFileSync as readFileSync6, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
68514
+ import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync6, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "node:fs";
68511
68515
  import { homedir as homedir6 } from "node:os";
68512
- import { dirname as dirname4, join as join10 } from "node:path";
68516
+ import { dirname as dirname5, join as join10 } from "node:path";
68513
68517
  var _configPath = () => process.env.HIVEMIND_CONFIG_PATH ?? join10(homedir6(), ".deeplake", "config.json");
68514
68518
  var _cache = null;
68515
68519
  var _migrated = false;
@@ -68534,9 +68538,9 @@ function writeUserConfig(patch) {
68534
68538
  const current = readUserConfig();
68535
68539
  const merged = deepMerge(current, patch);
68536
68540
  const path2 = _configPath();
68537
- const dir = dirname4(path2);
68541
+ const dir = dirname5(path2);
68538
68542
  if (!existsSync5(dir))
68539
- mkdirSync4(dir, { recursive: true });
68543
+ mkdirSync5(dir, { recursive: true });
68540
68544
  const tmp = `${path2}.tmp.${process.pid}`;
68541
68545
  writeFileSync4(tmp, JSON.stringify(merged, null, 2) + "\n", "utf-8");
68542
68546
  renameSync2(tmp, path2);
@@ -68758,13 +68762,13 @@ function composeKpiPath(parts) {
68758
68762
  }
68759
68763
 
68760
68764
  // dist/src/graph/vfs-handler.js
68761
- import { existsSync as existsSync8, mkdirSync as mkdirSync8, readFileSync as readFileSync9, renameSync as renameSync5, writeFileSync as writeFileSync7 } from "node:fs";
68765
+ import { existsSync as existsSync8, mkdirSync as mkdirSync9, readFileSync as readFileSync9, renameSync as renameSync5, writeFileSync as writeFileSync7 } from "node:fs";
68762
68766
  import { createHash as createHash3 } from "node:crypto";
68763
- import { join as join15, dirname as dirname8 } from "node:path";
68767
+ import { join as join15, dirname as dirname9 } from "node:path";
68764
68768
 
68765
68769
  // dist/src/graph/last-build.js
68766
- import { existsSync as existsSync6, mkdirSync as mkdirSync5, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
68767
- import { dirname as dirname5, join as join12 } from "node:path";
68770
+ import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync5 } from "node:fs";
68771
+ import { dirname as dirname6, join as join12 } from "node:path";
68768
68772
  function lastBuildPath(baseDir, worktreeId) {
68769
68773
  if (worktreeId !== void 0) {
68770
68774
  return join12(baseDir, "worktrees", worktreeId, ".last-build.json");
@@ -68814,13 +68818,13 @@ function readLastBuild(baseDir, worktreeId) {
68814
68818
 
68815
68819
  // dist/src/graph/snapshot.js
68816
68820
  import { createHash } from "node:crypto";
68817
- import { mkdirSync as mkdirSync7, renameSync as renameSync4, writeFileSync as writeFileSync6 } from "node:fs";
68821
+ import { mkdirSync as mkdirSync8, renameSync as renameSync4, writeFileSync as writeFileSync6 } from "node:fs";
68818
68822
  import { homedir as homedir8 } from "node:os";
68819
- import { dirname as dirname7, join as join14 } from "node:path";
68823
+ import { dirname as dirname8, join as join14 } from "node:path";
68820
68824
 
68821
68825
  // dist/src/graph/history.js
68822
- import { appendFileSync as appendFileSync2, existsSync as existsSync7, mkdirSync as mkdirSync6, readFileSync as readFileSync8 } from "node:fs";
68823
- import { dirname as dirname6, join as join13 } from "node:path";
68826
+ import { appendFileSync as appendFileSync2, existsSync as existsSync7, mkdirSync as mkdirSync7, readFileSync as readFileSync8 } from "node:fs";
68827
+ import { dirname as dirname7, join as join13 } from "node:path";
68824
68828
 
68825
68829
  // dist/src/graph/resolve/cross-file.js
68826
68830
  import { posix } from "node:path";
@@ -69866,7 +69870,7 @@ function saveHandles(baseDir, worktreeId, ids, pattern) {
69866
69870
  const path2 = handlesPath(baseDir, worktreeId);
69867
69871
  const payload = { pattern, ts: Date.now(), ids };
69868
69872
  try {
69869
- mkdirSync8(dirname8(path2), { recursive: true });
69873
+ mkdirSync9(dirname9(path2), { recursive: true });
69870
69874
  const tmp = `${path2}.tmp.${process.pid}.${Date.now()}`;
69871
69875
  writeFileSync7(tmp, JSON.stringify(payload));
69872
69876
  renameSync5(tmp, path2);
@@ -69925,7 +69929,7 @@ function normalizeSessionMessage(path2, message) {
69925
69929
  return normalizeContent(path2, raw);
69926
69930
  }
69927
69931
  function resolveEmbedDaemonPath() {
69928
- return join16(dirname9(fileURLToPath(import.meta.url)), "..", "embeddings", "embed-daemon.js");
69932
+ return join16(dirname10(fileURLToPath(import.meta.url)), "..", "embeddings", "embed-daemon.js");
69929
69933
  }
69930
69934
  function joinSessionMessages(path2, messages) {
69931
69935
  return messages.map((message) => normalizeSessionMessage(path2, message)).join("\n");
@@ -71744,11 +71748,11 @@ var lib_default = yargsParser;
71744
71748
 
71745
71749
  // dist/src/shell/grep-interceptor.js
71746
71750
  import { fileURLToPath as fileURLToPath2 } from "node:url";
71747
- import { dirname as dirname10, join as join17 } from "node:path";
71751
+ import { dirname as dirname11, join as join17 } from "node:path";
71748
71752
  var SEMANTIC_SEARCH_ENABLED = process.env.HIVEMIND_SEMANTIC_SEARCH !== "false" && !embeddingsDisabled();
71749
71753
  var SEMANTIC_EMBED_TIMEOUT_MS = Number(process.env.HIVEMIND_SEMANTIC_EMBED_TIMEOUT_MS ?? "500");
71750
71754
  function resolveGrepEmbedDaemonPath() {
71751
- return join17(dirname10(fileURLToPath2(import.meta.url)), "..", "embeddings", "embed-daemon.js");
71755
+ return join17(dirname11(fileURLToPath2(import.meta.url)), "..", "embeddings", "embed-daemon.js");
71752
71756
  }
71753
71757
  var sharedGrepEmbedClient = null;
71754
71758
  function getGrepEmbedClient() {
@@ -5,8 +5,8 @@ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, existsS
5
5
  import { join as join7 } from "node:path";
6
6
 
7
7
  // dist/src/utils/debug.js
8
- import { appendFileSync } from "node:fs";
9
- import { join } from "node:path";
8
+ import { appendFileSync, mkdirSync } from "node:fs";
9
+ import { dirname, join } from "node:path";
10
10
  import { homedir } from "node:os";
11
11
  var LOG = join(homedir(), ".deeplake", "hook-debug.log");
12
12
  function isDebug() {
@@ -18,8 +18,12 @@ function utcTimestamp(d = /* @__PURE__ */ new Date()) {
18
18
  function log(tag, msg) {
19
19
  if (!isDebug())
20
20
  return;
21
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
21
+ try {
22
+ mkdirSync(dirname(LOG), { recursive: true });
23
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
22
24
  `);
25
+ } catch {
26
+ }
23
27
  }
24
28
 
25
29
  // dist/src/utils/client-header.js
@@ -63,7 +67,7 @@ function extractPairs(rows) {
63
67
  }
64
68
 
65
69
  // dist/src/skillify/skill-writer.js
66
- import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
70
+ import { existsSync, mkdirSync as mkdirSync2, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
67
71
  import { homedir as homedir2 } from "node:os";
68
72
  import { join as join2 } from "node:path";
69
73
  function assertValidSkillName(name) {
@@ -165,7 +169,7 @@ function writeNewSkill(args) {
165
169
  if (existsSync(path)) {
166
170
  throw new Error(`skill already exists at ${path}; use mergeSkill`);
167
171
  }
168
- mkdirSync(dir, { recursive: true });
172
+ mkdirSync2(dir, { recursive: true });
169
173
  const now = (/* @__PURE__ */ new Date()).toISOString();
170
174
  const author = args.author && args.author.length > 0 ? args.author : void 0;
171
175
  const contributors = author ? [author] : [];
@@ -754,7 +758,7 @@ function resolveRecordScope(args) {
754
758
  }
755
759
 
756
760
  // dist/src/skillify/state.js
757
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, writeSync, mkdirSync as mkdirSync2, renameSync as renameSync2, rmdirSync, existsSync as existsSync4, lstatSync, unlinkSync, openSync, closeSync } from "node:fs";
761
+ import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, writeSync, mkdirSync as mkdirSync3, renameSync as renameSync2, rmdirSync, existsSync as existsSync4, lstatSync, unlinkSync, openSync, closeSync } from "node:fs";
758
762
  import { join as join6 } from "node:path";
759
763
 
760
764
  // dist/src/utils/repo-identity.js
@@ -764,7 +768,7 @@ import { basename, resolve } from "node:path";
764
768
 
765
769
  // dist/src/skillify/legacy-migration.js
766
770
  import { existsSync as existsSync3, renameSync } from "node:fs";
767
- import { dirname, join as join5 } from "node:path";
771
+ import { dirname as dirname2, join as join5 } from "node:path";
768
772
 
769
773
  // dist/src/skillify/state-dir.js
770
774
  import { homedir as homedir4 } from "node:os";
@@ -784,7 +788,7 @@ function migrateLegacyStateDir() {
784
788
  return;
785
789
  attempted = true;
786
790
  const current = getStateDir();
787
- const legacy = join5(dirname(current), "skilify");
791
+ const legacy = join5(dirname2(current), "skilify");
788
792
  if (!existsSync3(legacy))
789
793
  return;
790
794
  if (existsSync3(current))
@@ -828,7 +832,7 @@ function readState(projectKey) {
828
832
  }
829
833
  function writeState(projectKey, state) {
830
834
  migrateLegacyStateDir();
831
- mkdirSync2(getStateDir(), { recursive: true });
835
+ mkdirSync3(getStateDir(), { recursive: true });
832
836
  const p = statePath(projectKey);
833
837
  const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
834
838
  writeFileSync2(tmp, JSON.stringify(state, null, 2));
@@ -836,7 +840,7 @@ function writeState(projectKey, state) {
836
840
  }
837
841
  function withRmwLock(projectKey, fn) {
838
842
  migrateLegacyStateDir();
839
- mkdirSync2(getStateDir(), { recursive: true });
843
+ mkdirSync3(getStateDir(), { recursive: true });
840
844
  const rmw = lockPath(projectKey) + ".rmw";
841
845
  const deadline = Date.now() + 2e3;
842
846
  let fd = null;