@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,8 +16,8 @@ function readStdin() {
16
16
  }
17
17
 
18
18
  // dist/src/utils/debug.js
19
- import { appendFileSync } from "node:fs";
20
- import { join } from "node:path";
19
+ import { appendFileSync, mkdirSync } from "node:fs";
20
+ import { dirname, join } from "node:path";
21
21
  import { homedir } from "node:os";
22
22
  var LOG = join(homedir(), ".deeplake", "hook-debug.log");
23
23
  function isDebug() {
@@ -29,8 +29,12 @@ function utcTimestamp(d = /* @__PURE__ */ new Date()) {
29
29
  function log(tag, msg) {
30
30
  if (!isDebug())
31
31
  return;
32
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
32
+ try {
33
+ mkdirSync(dirname(LOG), { recursive: true });
34
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
33
35
  `);
36
+ } catch {
37
+ }
34
38
  }
35
39
 
36
40
  // dist/src/config.js
@@ -81,7 +85,7 @@ function loadConfig() {
81
85
  }
82
86
 
83
87
  // dist/src/hooks/summary-state.js
84
- import { readFileSync as readFileSync2, writeFileSync, writeSync, mkdirSync, renameSync, existsSync as existsSync2, unlinkSync, openSync, closeSync, statSync } from "node:fs";
88
+ import { readFileSync as readFileSync2, writeFileSync, writeSync, mkdirSync as mkdirSync2, renameSync, existsSync as existsSync2, unlinkSync, openSync, closeSync, statSync } from "node:fs";
85
89
  import { homedir as homedir3 } from "node:os";
86
90
  import { join as join3 } from "node:path";
87
91
  var dlog = (msg) => log("summary-state", msg);
@@ -91,7 +95,7 @@ function lockPath(sessionId) {
91
95
  return join3(STATE_DIR, `${sessionId}.lock`);
92
96
  }
93
97
  function tryAcquireLock(sessionId, maxAgeMs = 10 * 60 * 1e3) {
94
- mkdirSync(STATE_DIR, { recursive: true });
98
+ mkdirSync2(STATE_DIR, { recursive: true });
95
99
  const p = lockPath(sessionId);
96
100
  if (existsSync2(p)) {
97
101
  try {
@@ -126,12 +130,12 @@ function tryAcquireLock(sessionId, maxAgeMs = 10 * 60 * 1e3) {
126
130
  // dist/src/hooks/hermes/spawn-wiki-worker.js
127
131
  import { execSync } from "node:child_process";
128
132
  import { fileURLToPath } from "node:url";
129
- import { dirname as dirname2, join as join6 } from "node:path";
130
- import { writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "node:fs";
133
+ import { dirname as dirname3, join as join6 } from "node:path";
134
+ import { writeFileSync as writeFileSync2, mkdirSync as mkdirSync4 } from "node:fs";
131
135
  import { homedir as homedir4, tmpdir } from "node:os";
132
136
 
133
137
  // dist/src/utils/wiki-log.js
134
- import { mkdirSync as mkdirSync2, appendFileSync as appendFileSync2 } from "node:fs";
138
+ import { mkdirSync as mkdirSync3, appendFileSync as appendFileSync2 } from "node:fs";
135
139
  import { join as join4 } from "node:path";
136
140
  function makeWikiLogger(hooksDir, filename = "deeplake-wiki.log") {
137
141
  const path = join4(hooksDir, filename);
@@ -139,7 +143,7 @@ function makeWikiLogger(hooksDir, filename = "deeplake-wiki.log") {
139
143
  path,
140
144
  log(msg) {
141
145
  try {
142
- mkdirSync2(hooksDir, { recursive: true });
146
+ mkdirSync3(hooksDir, { recursive: true });
143
147
  appendFileSync2(path, `[${utcTimestamp()}] ${msg}
144
148
  `);
145
149
  } catch {
@@ -150,7 +154,7 @@ function makeWikiLogger(hooksDir, filename = "deeplake-wiki.log") {
150
154
 
151
155
  // dist/src/utils/version-check.js
152
156
  import { readFileSync as readFileSync3 } from "node:fs";
153
- import { dirname, join as join5 } from "node:path";
157
+ import { dirname as dirname2, join as join5 } from "node:path";
154
158
  function getInstalledVersion(bundleDir, pluginManifestDir) {
155
159
  try {
156
160
  const pluginJson = join5(bundleDir, "..", pluginManifestDir, "plugin.json");
@@ -182,7 +186,7 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
182
186
  return pkg.version;
183
187
  } catch {
184
188
  }
185
- const parent = dirname(dir);
189
+ const parent = dirname2(dir);
186
190
  if (parent === dir)
187
191
  break;
188
192
  dir = parent;
@@ -284,7 +288,7 @@ function spawnHermesWikiWorker(opts) {
284
288
  const { config, sessionId, cwd, bundleDir, reason } = opts;
285
289
  const projectName = projectNameFromCwd(cwd);
286
290
  const tmpDir = join6(tmpdir(), `deeplake-wiki-${sessionId}-${Date.now()}`);
287
- mkdirSync3(tmpDir, { recursive: true });
291
+ mkdirSync4(tmpDir, { recursive: true });
288
292
  const pluginVersion = getInstalledVersion(bundleDir, ".claude-plugin") ?? "";
289
293
  const configFile = join6(tmpDir, "config.json");
290
294
  writeFileSync2(configFile, JSON.stringify({
@@ -312,13 +316,13 @@ function spawnHermesWikiWorker(opts) {
312
316
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
313
317
  }
314
318
  function bundleDirFromImportMeta(importMetaUrl) {
315
- return dirname2(fileURLToPath(importMetaUrl));
319
+ return dirname3(fileURLToPath(importMetaUrl));
316
320
  }
317
321
 
318
322
  // dist/src/skillify/spawn-skillify-worker.js
319
323
  import { fileURLToPath as fileURLToPath2 } from "node:url";
320
- import { dirname as dirname3, join as join8 } from "node:path";
321
- import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync4, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
324
+ import { dirname as dirname4, join as join8 } from "node:path";
325
+ import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync5, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
322
326
  import { homedir as homedir6, tmpdir as tmpdir2 } from "node:os";
323
327
 
324
328
  // dist/src/skillify/gate-runner.js
@@ -393,7 +397,7 @@ var HOME2 = homedir6();
393
397
  var SKILLIFY_LOG = join8(HOME2, ".claude", "hooks", "skillify.log");
394
398
  function skillifyLog(msg) {
395
399
  try {
396
- mkdirSync4(dirname3(SKILLIFY_LOG), { recursive: true });
400
+ mkdirSync5(dirname4(SKILLIFY_LOG), { recursive: true });
397
401
  appendFileSync3(SKILLIFY_LOG, `[${utcTimestamp()}] ${msg}
398
402
  `);
399
403
  } catch {
@@ -402,7 +406,7 @@ function skillifyLog(msg) {
402
406
  function spawnSkillifyWorker(opts) {
403
407
  const { config, cwd, projectKey, project, bundleDir, agent, scopeConfig, currentSessionId, reason } = opts;
404
408
  const tmpDir = join8(tmpdir2(), `deeplake-skillify-${projectKey}-${Date.now()}`);
405
- mkdirSync4(tmpDir, { recursive: true, mode: 448 });
409
+ mkdirSync5(tmpDir, { recursive: true, mode: 448 });
406
410
  const gateBin = findAgentBin(agent);
407
411
  const configFile = join8(tmpDir, "config.json");
408
412
  writeFileSync3(configFile, JSON.stringify({
@@ -441,7 +445,7 @@ function spawnSkillifyWorker(opts) {
441
445
  }
442
446
 
443
447
  // dist/src/skillify/state.js
444
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, writeSync as writeSync2, mkdirSync as mkdirSync5, renameSync as renameSync3, rmdirSync, existsSync as existsSync5, lstatSync, unlinkSync as unlinkSync2, openSync as openSync2, closeSync as closeSync2 } from "node:fs";
448
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, writeSync as writeSync2, mkdirSync as mkdirSync6, renameSync as renameSync3, rmdirSync, existsSync as existsSync5, lstatSync, unlinkSync as unlinkSync2, openSync as openSync2, closeSync as closeSync2 } from "node:fs";
445
449
  import { join as join11 } from "node:path";
446
450
 
447
451
  // dist/src/utils/repo-identity.js
@@ -493,7 +497,7 @@ function deriveProjectKey(cwd) {
493
497
 
494
498
  // dist/src/skillify/legacy-migration.js
495
499
  import { existsSync as existsSync4, renameSync as renameSync2 } from "node:fs";
496
- import { dirname as dirname4, join as join10 } from "node:path";
500
+ import { dirname as dirname5, join as join10 } from "node:path";
497
501
 
498
502
  // dist/src/skillify/state-dir.js
499
503
  import { homedir as homedir7 } from "node:os";
@@ -513,7 +517,7 @@ function migrateLegacyStateDir() {
513
517
  return;
514
518
  attempted = true;
515
519
  const current = getStateDir();
516
- const legacy = join10(dirname4(current), "skilify");
520
+ const legacy = join10(dirname5(current), "skilify");
517
521
  if (!existsSync4(legacy))
518
522
  return;
519
523
  if (existsSync4(current))
@@ -557,7 +561,7 @@ function readState(projectKey) {
557
561
  }
558
562
  function writeState(projectKey, state) {
559
563
  migrateLegacyStateDir();
560
- mkdirSync5(getStateDir(), { recursive: true });
564
+ mkdirSync6(getStateDir(), { recursive: true });
561
565
  const p = statePath(projectKey);
562
566
  const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
563
567
  writeFileSync4(tmp, JSON.stringify(state, null, 2));
@@ -565,7 +569,7 @@ function writeState(projectKey, state) {
565
569
  }
566
570
  function withRmwLock(projectKey, fn) {
567
571
  migrateLegacyStateDir();
568
- mkdirSync5(getStateDir(), { recursive: true });
572
+ mkdirSync6(getStateDir(), { recursive: true });
569
573
  const rmw = lockPath2(projectKey) + ".rmw";
570
574
  const deadline = Date.now() + 2e3;
571
575
  let fd = null;
@@ -608,7 +612,7 @@ function resetCounter(projectKey) {
608
612
  }
609
613
  function tryAcquireWorkerLock(projectKey, maxAgeMs = 10 * 60 * 1e3) {
610
614
  migrateLegacyStateDir();
611
- mkdirSync5(getStateDir(), { recursive: true });
615
+ mkdirSync6(getStateDir(), { recursive: true });
612
616
  const p = lockPath2(projectKey);
613
617
  if (existsSync5(p)) {
614
618
  try {
@@ -660,7 +664,7 @@ function releaseWorkerLock(projectKey) {
660
664
  }
661
665
 
662
666
  // dist/src/skillify/scope-config.js
663
- import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
667
+ import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
664
668
  import { join as join12 } from "node:path";
665
669
  function configPath() {
666
670
  return join12(getStateDir(), "config.json");
@@ -732,10 +736,6 @@ async function main() {
732
736
  log2(`session=${sessionId || "?"} cwd=${input.cwd ?? "?"}`);
733
737
  if (!sessionId)
734
738
  return;
735
- if (!tryAcquireLock(sessionId)) {
736
- wikiLog(`SessionEnd: periodic worker already running for ${sessionId}, skipping final`);
737
- return;
738
- }
739
739
  const config = loadConfig();
740
740
  if (!config) {
741
741
  wikiLog(`SessionEnd: no config, skipping summary`);
@@ -743,26 +743,30 @@ async function main() {
743
743
  }
744
744
  const cwd = input.cwd ?? process.cwd();
745
745
  try {
746
- spawnHermesWikiWorker({
746
+ forceSessionEndTrigger({
747
747
  config,
748
- sessionId,
749
748
  cwd,
750
749
  bundleDir: bundleDirFromImportMeta(import.meta.url),
751
- reason: "SessionEnd"
750
+ agent: "hermes",
751
+ sessionId
752
752
  });
753
753
  } catch (e) {
754
- wikiLog(`SessionEnd: wiki spawn failed: ${e?.message ?? e}`);
754
+ wikiLog(`SessionEnd: skillify trigger failed: ${e?.message ?? e}`);
755
+ }
756
+ if (!tryAcquireLock(sessionId)) {
757
+ wikiLog(`SessionEnd: periodic worker already running for ${sessionId}, skipping final`);
758
+ return;
755
759
  }
756
760
  try {
757
- forceSessionEndTrigger({
761
+ spawnHermesWikiWorker({
758
762
  config,
763
+ sessionId,
759
764
  cwd,
760
765
  bundleDir: bundleDirFromImportMeta(import.meta.url),
761
- agent: "hermes",
762
- sessionId
766
+ reason: "SessionEnd"
763
767
  });
764
768
  } catch (e) {
765
- wikiLog(`SessionEnd: skillify trigger failed: ${e?.message ?? e}`);
769
+ wikiLog(`SessionEnd: wiki spawn failed: ${e?.message ?? e}`);
766
770
  }
767
771
  }
768
772
  main().catch((e) => {
@@ -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 mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
19
+ import { existsSync as existsSync2, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
20
20
  import { join as join6 } 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
- mkdirSync4(getIndexMarkerDir(), { recursive: true });
43
+ mkdirSync5(getIndexMarkerDir(), { recursive: true });
44
44
  writeFileSync4(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
45
45
  }
46
46
  var INDEX_MARKER_TTL_MS;
@@ -53,7 +53,7 @@ var init_index_marker_store = __esm({
53
53
 
54
54
  // dist/src/hooks/hermes/session-start.js
55
55
  import { fileURLToPath as fileURLToPath2 } from "node:url";
56
- import { dirname as dirname10 } from "node:path";
56
+ import { dirname as dirname11 } from "node:path";
57
57
 
58
58
  // dist/src/commands/auth.js
59
59
  import { execSync } from "node:child_process";
@@ -250,8 +250,8 @@ function loadConfig() {
250
250
  import { randomUUID as randomUUID2 } from "node:crypto";
251
251
 
252
252
  // dist/src/utils/debug.js
253
- import { appendFileSync } from "node:fs";
254
- import { join as join4 } from "node:path";
253
+ import { appendFileSync, mkdirSync as mkdirSync3 } from "node:fs";
254
+ import { dirname, join as join4 } from "node:path";
255
255
  import { homedir as homedir4 } from "node:os";
256
256
  var LOG = join4(homedir4(), ".deeplake", "hook-debug.log");
257
257
  function isDebug() {
@@ -260,8 +260,12 @@ function isDebug() {
260
260
  function log(tag, msg) {
261
261
  if (!isDebug())
262
262
  return;
263
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
263
+ try {
264
+ mkdirSync3(dirname(LOG), { recursive: true });
265
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
264
266
  `);
267
+ } catch {
268
+ }
265
269
  }
266
270
 
267
271
  // dist/src/utils/sql.js
@@ -461,7 +465,7 @@ async function healMissingColumns(args) {
461
465
  }
462
466
 
463
467
  // dist/src/notifications/queue.js
464
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync3, openSync, closeSync, unlinkSync as unlinkSync2, statSync } from "node:fs";
468
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync4, openSync, closeSync, unlinkSync as unlinkSync2, statSync } from "node:fs";
465
469
  import { join as join5, resolve } from "node:path";
466
470
  import { homedir as homedir5 } from "node:os";
467
471
  import { setTimeout as sleep } from "node:timers/promises";
@@ -499,14 +503,14 @@ function writeQueue(q) {
499
503
  if (!_isQueuePathInsideHome(path, home)) {
500
504
  throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
501
505
  }
502
- mkdirSync3(join5(home, ".deeplake"), { recursive: true, mode: 448 });
506
+ mkdirSync4(join5(home, ".deeplake"), { recursive: true, mode: 448 });
503
507
  const tmp = `${path}.${process.pid}.tmp`;
504
508
  writeFileSync3(tmp, JSON.stringify(q, null, 2), { mode: 384 });
505
509
  renameSync(tmp, path);
506
510
  }
507
511
  async function withQueueLock(fn) {
508
512
  const path = lockPath();
509
- mkdirSync3(join5(homedir5(), ".deeplake"), { recursive: true, mode: 448 });
513
+ mkdirSync4(join5(homedir5(), ".deeplake"), { recursive: true, mode: 448 });
510
514
  let fd = null;
511
515
  for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
512
516
  try {
@@ -1278,9 +1282,9 @@ function renderSkillifyCommands() {
1278
1282
  }
1279
1283
 
1280
1284
  // dist/src/skillify/local-manifest.js
1281
- import { existsSync as existsSync3, mkdirSync as mkdirSync5, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "node:fs";
1285
+ import { existsSync as existsSync3, mkdirSync as mkdirSync6, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "node:fs";
1282
1286
  import { homedir as homedir6 } from "node:os";
1283
- import { dirname, join as join7 } from "node:path";
1287
+ import { dirname as dirname2, join as join7 } from "node:path";
1284
1288
  var LOCAL_MANIFEST_PATH = join7(homedir6(), ".claude", "hivemind", "local-mined.json");
1285
1289
  var LOCAL_MINE_LOCK_PATH = join7(homedir6(), ".claude", "hivemind", "local-mined.lock");
1286
1290
  function readLocalManifest(path = LOCAL_MANIFEST_PATH) {
@@ -1300,9 +1304,9 @@ var LATEST_RUN_WINDOW_MS = 5 * 60 * 1e3;
1300
1304
 
1301
1305
  // dist/src/skillify/spawn-mine-local-worker.js
1302
1306
  import { execFileSync, spawn } from "node:child_process";
1303
- import { closeSync as closeSync2, existsSync as existsSync4, mkdirSync as mkdirSync6, openSync as openSync2, readdirSync, statSync as statSync2, unlinkSync as unlinkSync3 } from "node:fs";
1307
+ import { closeSync as closeSync2, existsSync as existsSync4, mkdirSync as mkdirSync7, openSync as openSync2, readdirSync, statSync as statSync2, unlinkSync as unlinkSync3 } from "node:fs";
1304
1308
  import { homedir as homedir7 } from "node:os";
1305
- import { dirname as dirname2, join as join8 } from "node:path";
1309
+ import { dirname as dirname3, join as join8 } from "node:path";
1306
1310
  import { fileURLToPath } from "node:url";
1307
1311
  var HOME = homedir7();
1308
1312
  var HIVEMIND_DIR = join8(HOME, ".claude", "hivemind");
@@ -1311,7 +1315,7 @@ var CLAUDE_PROJECTS_DIR = join8(HOME, ".claude", "projects");
1311
1315
  var LOCK_STALE_MS2 = 15 * 60 * 1e3;
1312
1316
  function findBundledCliPath() {
1313
1317
  try {
1314
- const thisDir = dirname2(fileURLToPath(import.meta.url));
1318
+ const thisDir = dirname3(fileURLToPath(import.meta.url));
1315
1319
  const cliPath = join8(thisDir, "..", "..", "bundle", "cli.js");
1316
1320
  return existsSync4(cliPath) ? cliPath : null;
1317
1321
  } catch {
@@ -1378,14 +1382,14 @@ function maybeAutoMineLocal() {
1378
1382
  if (!launcher)
1379
1383
  return { triggered: false, reason: "no-hivemind-bin" };
1380
1384
  try {
1381
- mkdirSync6(HIVEMIND_DIR, { recursive: true });
1385
+ mkdirSync7(HIVEMIND_DIR, { recursive: true });
1382
1386
  const fd = openSync2(LOCAL_MINE_LOCK_PATH, "wx");
1383
1387
  closeSync2(fd);
1384
1388
  } catch {
1385
1389
  return { triggered: false, reason: "lock-acquire-failed" };
1386
1390
  }
1387
1391
  try {
1388
- mkdirSync6(join8(HOME, ".claude", "hooks"), { recursive: true });
1392
+ mkdirSync7(join8(HOME, ".claude", "hooks"), { recursive: true });
1389
1393
  const out = openSync2(LOG_PATH, "a");
1390
1394
  const [cmd, args] = launcher.kind === "node-script" ? [process.execPath, [launcher.path, "skillify", "mine-local"]] : [launcher.path, ["skillify", "mine-local"]];
1391
1395
  const child = spawn(cmd, args, {
@@ -1424,7 +1428,7 @@ function readStdin() {
1424
1428
 
1425
1429
  // dist/src/utils/version-check.js
1426
1430
  import { readFileSync as readFileSync7 } from "node:fs";
1427
- import { dirname as dirname3, join as join9 } from "node:path";
1431
+ import { dirname as dirname4, join as join9 } from "node:path";
1428
1432
  function getInstalledVersion(bundleDir, pluginManifestDir) {
1429
1433
  try {
1430
1434
  const pluginJson = join9(bundleDir, "..", pluginManifestDir, "plugin.json");
@@ -1456,7 +1460,7 @@ function getInstalledVersion(bundleDir, pluginManifestDir) {
1456
1460
  return pkg.version;
1457
1461
  } catch {
1458
1462
  }
1459
- const parent = dirname3(dir);
1463
+ const parent = dirname4(dir);
1460
1464
  if (parent === dir)
1461
1465
  break;
1462
1466
  dir = parent;
@@ -1518,12 +1522,12 @@ async function autoUpdate(creds, opts) {
1518
1522
  }
1519
1523
 
1520
1524
  // dist/src/skillify/pull.js
1521
- import { existsSync as existsSync10, readFileSync as readFileSync10, writeFileSync as writeFileSync8, mkdirSync as mkdirSync9, renameSync as renameSync4, lstatSync as lstatSync2, readlinkSync, symlinkSync, unlinkSync as unlinkSync5 } from "node:fs";
1525
+ import { existsSync as existsSync10, readFileSync as readFileSync10, writeFileSync as writeFileSync8, mkdirSync as mkdirSync10, renameSync as renameSync4, lstatSync as lstatSync2, readlinkSync, symlinkSync, unlinkSync as unlinkSync5 } from "node:fs";
1522
1526
  import { homedir as homedir11 } from "node:os";
1523
- import { dirname as dirname6, join as join16 } from "node:path";
1527
+ import { dirname as dirname7, join as join16 } from "node:path";
1524
1528
 
1525
1529
  // dist/src/skillify/skill-writer.js
1526
- import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync8, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync6 } from "node:fs";
1530
+ import { existsSync as existsSync6, mkdirSync as mkdirSync8, readFileSync as readFileSync8, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync6 } from "node:fs";
1527
1531
  import { homedir as homedir8 } from "node:os";
1528
1532
  import { join as join11 } from "node:path";
1529
1533
  function assertValidSkillName(name) {
@@ -1591,12 +1595,12 @@ function parseFrontmatter(text) {
1591
1595
  }
1592
1596
 
1593
1597
  // dist/src/skillify/manifest.js
1594
- import { existsSync as existsSync8, lstatSync, mkdirSync as mkdirSync8, readFileSync as readFileSync9, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync7 } from "node:fs";
1595
- import { dirname as dirname5, join as join14 } from "node:path";
1598
+ import { existsSync as existsSync8, lstatSync, mkdirSync as mkdirSync9, readFileSync as readFileSync9, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync7 } from "node:fs";
1599
+ import { dirname as dirname6, join as join14 } from "node:path";
1596
1600
 
1597
1601
  // dist/src/skillify/legacy-migration.js
1598
1602
  import { existsSync as existsSync7, renameSync as renameSync2 } from "node:fs";
1599
- import { dirname as dirname4, join as join13 } from "node:path";
1603
+ import { dirname as dirname5, join as join13 } from "node:path";
1600
1604
 
1601
1605
  // dist/src/skillify/state-dir.js
1602
1606
  import { homedir as homedir9 } from "node:os";
@@ -1616,7 +1620,7 @@ function migrateLegacyStateDir() {
1616
1620
  return;
1617
1621
  attempted = true;
1618
1622
  const current = getStateDir();
1619
- const legacy = join13(dirname4(current), "skilify");
1623
+ const legacy = join13(dirname5(current), "skilify");
1620
1624
  if (!existsSync7(legacy))
1621
1625
  return;
1622
1626
  if (existsSync7(current))
@@ -1694,7 +1698,7 @@ function loadManifest(path = manifestPath()) {
1694
1698
  }
1695
1699
  function saveManifest(m, path = manifestPath()) {
1696
1700
  migrateLegacyStateDir();
1697
- mkdirSync8(dirname5(path), { recursive: true });
1701
+ mkdirSync9(dirname6(path), { recursive: true });
1698
1702
  const tmp = `${path}.tmp`;
1699
1703
  writeFileSync7(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
1700
1704
  renameSync3(tmp, path);
@@ -1844,7 +1848,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
1844
1848
  }
1845
1849
  }
1846
1850
  try {
1847
- mkdirSync9(dirname6(link), { recursive: true });
1851
+ mkdirSync10(dirname7(link), { recursive: true });
1848
1852
  symlinkSync(canonicalDir, link, "dir");
1849
1853
  out.push(link);
1850
1854
  } catch {
@@ -2084,7 +2088,7 @@ async function runPull(opts) {
2084
2088
  });
2085
2089
  let manifestError;
2086
2090
  if (action === "wrote") {
2087
- mkdirSync9(skillDir, { recursive: true });
2091
+ mkdirSync10(skillDir, { recursive: true });
2088
2092
  if (existsSync10(skillFile)) {
2089
2093
  try {
2090
2094
  renameSync4(skillFile, `${skillFile}.bak`);
@@ -2260,8 +2264,8 @@ import { existsSync as existsSync13 } from "node:fs";
2260
2264
  import { join as join21 } from "node:path";
2261
2265
 
2262
2266
  // dist/src/graph/last-build.js
2263
- import { existsSync as existsSync11, mkdirSync as mkdirSync10, readFileSync as readFileSync11, renameSync as renameSync5, writeFileSync as writeFileSync9 } from "node:fs";
2264
- import { dirname as dirname7, join as join18 } from "node:path";
2267
+ import { existsSync as existsSync11, mkdirSync as mkdirSync11, readFileSync as readFileSync11, renameSync as renameSync5, writeFileSync as writeFileSync9 } from "node:fs";
2268
+ import { dirname as dirname8, join as join18 } from "node:path";
2265
2269
  function lastBuildPath(baseDir, worktreeId) {
2266
2270
  if (worktreeId !== void 0) {
2267
2271
  return join18(baseDir, "worktrees", worktreeId, ".last-build.json");
@@ -2311,13 +2315,13 @@ function readLastBuild(baseDir, worktreeId) {
2311
2315
 
2312
2316
  // dist/src/graph/snapshot.js
2313
2317
  import { createHash } from "node:crypto";
2314
- import { mkdirSync as mkdirSync12, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
2318
+ import { mkdirSync as mkdirSync13, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
2315
2319
  import { homedir as homedir12 } from "node:os";
2316
- import { dirname as dirname9, join as join20 } from "node:path";
2320
+ import { dirname as dirname10, join as join20 } from "node:path";
2317
2321
 
2318
2322
  // dist/src/graph/history.js
2319
- import { appendFileSync as appendFileSync2, existsSync as existsSync12, mkdirSync as mkdirSync11, readFileSync as readFileSync12 } from "node:fs";
2320
- import { dirname as dirname8, join as join19 } from "node:path";
2323
+ import { appendFileSync as appendFileSync2, existsSync as existsSync12, mkdirSync as mkdirSync12, readFileSync as readFileSync12 } from "node:fs";
2324
+ import { dirname as dirname9, join as join19 } from "node:path";
2321
2325
 
2322
2326
  // dist/src/graph/resolve/cross-file.js
2323
2327
  import { posix } from "node:path";
@@ -2460,7 +2464,7 @@ function formatAge(ms) {
2460
2464
 
2461
2465
  // dist/src/hooks/hermes/session-start.js
2462
2466
  var log6 = (msg) => log("hermes-session-start", msg);
2463
- var __bundleDir = dirname10(fileURLToPath2(import.meta.url));
2467
+ var __bundleDir = dirname11(fileURLToPath2(import.meta.url));
2464
2468
  var context = `DEEPLAKE MEMORY: Persistent memory at ~/.deeplake/memory/ shared across sessions, users, and agents.
2465
2469
 
2466
2470
  Structure: index.md (start here) \u2192 summaries/*.md \u2192 sessions/*.jsonl (last resort). Do NOT jump straight to JSONL.
@@ -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() {