@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
@@ -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;
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // dist/src/hooks/cursor/wiki-worker.js
4
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync4, appendFileSync as appendFileSync2, mkdirSync as mkdirSync3, rmSync } from "node:fs";
4
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync4, appendFileSync as appendFileSync2, mkdirSync as mkdirSync4, rmSync } from "node:fs";
5
5
  import { execFileSync } from "node:child_process";
6
- import { dirname as dirname2, join as join6 } from "node:path";
6
+ import { dirname as dirname3, join as join6 } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
9
  // dist/src/hooks/summary-state.js
10
- import { readFileSync, writeFileSync, writeSync, mkdirSync, renameSync, existsSync, unlinkSync, openSync, closeSync, statSync } from "node:fs";
10
+ import { readFileSync, writeFileSync, writeSync, mkdirSync as mkdirSync2, renameSync, existsSync, unlinkSync, openSync, closeSync, statSync } from "node:fs";
11
11
  import { homedir as homedir2 } from "node:os";
12
12
  import { join as join2 } from "node:path";
13
13
 
14
14
  // dist/src/utils/debug.js
15
- import { appendFileSync } from "node:fs";
16
- import { join } from "node:path";
15
+ import { appendFileSync, mkdirSync } from "node:fs";
16
+ import { dirname, join } from "node:path";
17
17
  import { homedir } from "node:os";
18
18
  var LOG = join(homedir(), ".deeplake", "hook-debug.log");
19
19
  function isDebug() {
@@ -22,8 +22,12 @@ function isDebug() {
22
22
  function log(tag, msg) {
23
23
  if (!isDebug())
24
24
  return;
25
- appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
25
+ try {
26
+ mkdirSync(dirname(LOG), { recursive: true });
27
+ appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
26
28
  `);
29
+ } catch {
30
+ }
27
31
  }
28
32
 
29
33
  // dist/src/hooks/summary-state.js
@@ -47,14 +51,14 @@ function readState(sessionId) {
47
51
  }
48
52
  }
49
53
  function writeState(sessionId, state) {
50
- mkdirSync(STATE_DIR, { recursive: true });
54
+ mkdirSync2(STATE_DIR, { recursive: true });
51
55
  const p = statePath(sessionId);
52
56
  const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
53
57
  writeFileSync(tmp, JSON.stringify(state));
54
58
  renameSync(tmp, p);
55
59
  }
56
60
  function withRmwLock(sessionId, fn) {
57
- mkdirSync(STATE_DIR, { recursive: true });
61
+ mkdirSync2(STATE_DIR, { recursive: true });
58
62
  const rmwLock = statePath(sessionId) + ".rmw";
59
63
  const deadline = Date.now() + 2e3;
60
64
  let fd = null;
@@ -543,9 +547,9 @@ import { join as join5 } from "node:path";
543
547
  import { pathToFileURL } from "node:url";
544
548
 
545
549
  // dist/src/user-config.js
546
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
550
+ import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
547
551
  import { homedir as homedir4 } from "node:os";
548
- import { dirname, join as join4 } from "node:path";
552
+ import { dirname as dirname2, join as join4 } from "node:path";
549
553
  var _configPath = () => process.env.HIVEMIND_CONFIG_PATH ?? join4(homedir4(), ".deeplake", "config.json");
550
554
  var _cache = null;
551
555
  var _migrated = false;
@@ -570,9 +574,9 @@ function writeUserConfig(patch) {
570
574
  const current = readUserConfig();
571
575
  const merged = deepMerge(current, patch);
572
576
  const path = _configPath();
573
- const dir = dirname(path);
577
+ const dir = dirname2(path);
574
578
  if (!existsSync3(dir))
575
- mkdirSync2(dir, { recursive: true });
579
+ mkdirSync3(dir, { recursive: true });
576
580
  const tmp = `${path}.tmp.${process.pid}`;
577
581
  writeFileSync2(tmp, JSON.stringify(merged, null, 2) + "\n", "utf-8");
578
582
  renameSync2(tmp, path);
@@ -671,7 +675,7 @@ var tmpJsonl = join6(tmpDir, "session.jsonl");
671
675
  var tmpSummary = join6(tmpDir, "summary.md");
672
676
  function wlog(msg) {
673
677
  try {
674
- mkdirSync3(cfg.hooksDir, { recursive: true });
678
+ mkdirSync4(cfg.hooksDir, { recursive: true });
675
679
  appendFileSync2(cfg.wikiLog, `[${(/* @__PURE__ */ new Date()).toISOString().replace("T", " ").slice(0, 19)}] wiki-worker(${cfg.sessionId}): ${msg}
676
680
  `);
677
681
  } catch {
@@ -772,7 +776,7 @@ async function main() {
772
776
  let embedding = null;
773
777
  if (!embeddingsDisabled()) {
774
778
  try {
775
- const daemonEntry = join6(dirname2(fileURLToPath(import.meta.url)), "embeddings", "embed-daemon.js");
779
+ const daemonEntry = join6(dirname3(fileURLToPath(import.meta.url)), "embeddings", "embed-daemon.js");
776
780
  embedding = await new EmbedClient({ daemonEntry }).embed(text, "document");
777
781
  } catch (e) {
778
782
  wlog(`summary embedding failed, writing NULL: ${e.message}`);