@deeplake/hivemind 0.7.45 → 0.7.46

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 (35) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/bundle/cli.js +2215 -341
  4. package/codex/bundle/capture.js +43 -0
  5. package/codex/bundle/commands/auth-login.js +43 -0
  6. package/codex/bundle/graph-pull-worker.js +1185 -0
  7. package/codex/bundle/pre-tool-use.js +43 -0
  8. package/codex/bundle/session-start-setup.js +43 -0
  9. package/codex/bundle/session-start.js +70 -4
  10. package/codex/bundle/shell/deeplake-shell.js +577 -25
  11. package/codex/bundle/skillify-worker.js +30 -3
  12. package/codex/bundle/stop.js +97 -50
  13. package/cursor/bundle/capture.js +97 -50
  14. package/cursor/bundle/commands/auth-login.js +43 -0
  15. package/cursor/bundle/graph-pull-worker.js +1185 -0
  16. package/cursor/bundle/pre-tool-use.js +43 -0
  17. package/cursor/bundle/session-end.js +49 -44
  18. package/cursor/bundle/session-start.js +66 -0
  19. package/cursor/bundle/shell/deeplake-shell.js +577 -25
  20. package/cursor/bundle/skillify-worker.js +30 -3
  21. package/hermes/bundle/capture.js +97 -50
  22. package/hermes/bundle/commands/auth-login.js +43 -0
  23. package/hermes/bundle/graph-pull-worker.js +1185 -0
  24. package/hermes/bundle/pre-tool-use.js +43 -0
  25. package/hermes/bundle/session-end.js +49 -44
  26. package/hermes/bundle/session-start.js +66 -0
  27. package/hermes/bundle/shell/deeplake-shell.js +577 -25
  28. package/hermes/bundle/skillify-worker.js +30 -3
  29. package/mcp/bundle/server.js +43 -0
  30. package/openclaw/dist/chunks/{config-XEK4MJJS.js → config-O5PDJQ7Y.js} +1 -0
  31. package/openclaw/dist/index.js +47 -2
  32. package/openclaw/dist/skillify-worker.js +30 -3
  33. package/openclaw/openclaw.plugin.json +1 -1
  34. package/openclaw/package.json +1 -1
  35. package/package.json +3 -1
@@ -395,9 +395,33 @@ function validateSchema(label, cols) {
395
395
  }
396
396
  }
397
397
  }
398
+ var CODEBASE_COLUMNS = Object.freeze([
399
+ // Identity key (matches the PK below)
400
+ { name: "org_id", sql: "TEXT NOT NULL DEFAULT ''" },
401
+ { name: "workspace_id", sql: "TEXT NOT NULL DEFAULT ''" },
402
+ { name: "repo_slug", sql: "TEXT NOT NULL DEFAULT ''" },
403
+ { name: "user_id", sql: "TEXT NOT NULL DEFAULT ''" },
404
+ { name: "worktree_id", sql: "TEXT NOT NULL DEFAULT ''" },
405
+ { name: "commit_sha", sql: "TEXT NOT NULL DEFAULT ''" },
406
+ // Observation metadata
407
+ { name: "parent_sha", sql: "TEXT NOT NULL DEFAULT ''" },
408
+ { name: "branch", sql: "TEXT NOT NULL DEFAULT ''" },
409
+ { name: "ts", sql: "TIMESTAMP" },
410
+ { name: "pushed_by", sql: "TEXT NOT NULL DEFAULT ''" },
411
+ // Snapshot payload
412
+ { name: "snapshot_sha256", sql: "TEXT NOT NULL DEFAULT ''" },
413
+ { name: "snapshot_jsonb", sql: "TEXT NOT NULL DEFAULT ''" },
414
+ { name: "node_count", sql: "BIGINT NOT NULL DEFAULT 0" },
415
+ { name: "edge_count", sql: "BIGINT NOT NULL DEFAULT 0" },
416
+ // Generator metadata (for drift diagnostics — what hivemind version produced this?)
417
+ { name: "generator", sql: "TEXT NOT NULL DEFAULT 'hivemind-graph'" },
418
+ { name: "generator_version", sql: "TEXT NOT NULL DEFAULT ''" },
419
+ { name: "schema_version", sql: "BIGINT NOT NULL DEFAULT 1" }
420
+ ]);
398
421
  validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
399
422
  validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
400
423
  validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
424
+ validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
401
425
  function buildCreateTableSql(tableName, cols) {
402
426
  const safe = sqlIdent(tableName);
403
427
  const colSql = cols.map((c) => `${c.name} ${c.sql}`).join(", ");
@@ -693,9 +717,12 @@ function resolveRecordScope(args) {
693
717
 
694
718
  // dist/src/skillify/state.js
695
719
  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";
720
+ import { join as join6 } from "node:path";
721
+
722
+ // dist/src/utils/repo-identity.js
696
723
  import { execSync } from "node:child_process";
697
724
  import { createHash } from "node:crypto";
698
- import { join as join6, basename } from "node:path";
725
+ import { basename, resolve } from "node:path";
699
726
 
700
727
  // dist/src/skillify/legacy-migration.js
701
728
  import { existsSync as existsSync3, renameSync } from "node:fs";
@@ -881,7 +908,7 @@ async function query(sql, retries = 4) {
881
908
  const base = Math.min(3e4, 2e3 * Math.pow(2, attempt));
882
909
  const delay = base + Math.floor(Math.random() * 1e3);
883
910
  wlog(`fetch failed (${e?.name ?? e?.code ?? e?.message}), retrying in ${delay}ms (attempt ${attempt + 1}/${retries})`);
884
- await new Promise((resolve) => setTimeout(resolve, delay));
911
+ await new Promise((resolve2) => setTimeout(resolve2, delay));
885
912
  continue;
886
913
  }
887
914
  throw e;
@@ -897,7 +924,7 @@ async function query(sql, retries = 4) {
897
924
  const base = Math.min(3e4, 2e3 * Math.pow(2, attempt));
898
925
  const delay = base + Math.floor(Math.random() * 1e3);
899
926
  wlog(`API ${r.status}, retrying in ${delay}ms (attempt ${attempt + 1}/${retries})`);
900
- await new Promise((resolve) => setTimeout(resolve, delay));
927
+ await new Promise((resolve2) => setTimeout(resolve2, delay));
901
928
  continue;
902
929
  }
903
930
  throw new Error(`API ${r.status}: ${(await r.text()).slice(0, 200)}`);
@@ -23330,6 +23330,7 @@ function loadConfig() {
23330
23330
  tableName: process.env.HIVEMIND_TABLE ?? "memory",
23331
23331
  sessionsTableName: process.env.HIVEMIND_SESSIONS_TABLE ?? "sessions",
23332
23332
  skillsTableName: process.env.HIVEMIND_SKILLS_TABLE ?? "skills",
23333
+ codebaseTableName: process.env.HIVEMIND_CODEBASE_TABLE ?? "codebase",
23333
23334
  memoryPath: process.env.HIVEMIND_MEMORY_PATH ?? join3(home, ".deeplake", "memory")
23334
23335
  };
23335
23336
  }
@@ -23438,9 +23439,33 @@ function validateSchema(label, cols) {
23438
23439
  }
23439
23440
  }
23440
23441
  }
23442
+ var CODEBASE_COLUMNS = Object.freeze([
23443
+ // Identity key (matches the PK below)
23444
+ { name: "org_id", sql: "TEXT NOT NULL DEFAULT ''" },
23445
+ { name: "workspace_id", sql: "TEXT NOT NULL DEFAULT ''" },
23446
+ { name: "repo_slug", sql: "TEXT NOT NULL DEFAULT ''" },
23447
+ { name: "user_id", sql: "TEXT NOT NULL DEFAULT ''" },
23448
+ { name: "worktree_id", sql: "TEXT NOT NULL DEFAULT ''" },
23449
+ { name: "commit_sha", sql: "TEXT NOT NULL DEFAULT ''" },
23450
+ // Observation metadata
23451
+ { name: "parent_sha", sql: "TEXT NOT NULL DEFAULT ''" },
23452
+ { name: "branch", sql: "TEXT NOT NULL DEFAULT ''" },
23453
+ { name: "ts", sql: "TIMESTAMP" },
23454
+ { name: "pushed_by", sql: "TEXT NOT NULL DEFAULT ''" },
23455
+ // Snapshot payload
23456
+ { name: "snapshot_sha256", sql: "TEXT NOT NULL DEFAULT ''" },
23457
+ { name: "snapshot_jsonb", sql: "TEXT NOT NULL DEFAULT ''" },
23458
+ { name: "node_count", sql: "BIGINT NOT NULL DEFAULT 0" },
23459
+ { name: "edge_count", sql: "BIGINT NOT NULL DEFAULT 0" },
23460
+ // Generator metadata (for drift diagnostics — what hivemind version produced this?)
23461
+ { name: "generator", sql: "TEXT NOT NULL DEFAULT 'hivemind-graph'" },
23462
+ { name: "generator_version", sql: "TEXT NOT NULL DEFAULT ''" },
23463
+ { name: "schema_version", sql: "BIGINT NOT NULL DEFAULT 1" }
23464
+ ]);
23441
23465
  validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
23442
23466
  validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
23443
23467
  validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
23468
+ validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
23444
23469
  function buildCreateTableSql(tableName, cols) {
23445
23470
  const safe = sqlIdent(tableName);
23446
23471
  const colSql = cols.map((c) => `${c.name} ${c.sql}`).join(", ");
@@ -23987,6 +24012,24 @@ var DeeplakeApi = class {
23987
24012
  * This sidesteps the Deeplake UPDATE-coalescing quirk that bit the wiki
23988
24013
  * worker.
23989
24014
  */
24015
+ /**
24016
+ * Create the codebase table. One row per (org, workspace, repo, user,
24017
+ * worktree, commit) — see CODEBASE_COLUMNS for the schema. Healing
24018
+ * + index follow the same pattern as ensureSessionsTable.
24019
+ */
24020
+ async ensureCodebaseTable(name) {
24021
+ const safe = sqlIdent(name);
24022
+ const tables = await this.listTables();
24023
+ if (!tables.includes(safe)) {
24024
+ log3(`table "${safe}" not found, creating`);
24025
+ await this.createTableWithRetry(buildCreateTableSql(safe, CODEBASE_COLUMNS), safe);
24026
+ log3(`table "${safe}" created`);
24027
+ if (!tables.includes(safe))
24028
+ this._tablesCache = [...tables, safe];
24029
+ }
24030
+ await this.healSchema(safe, CODEBASE_COLUMNS);
24031
+ await this.ensureLookupIndex(safe, "codebase_identity", `("org_id", "workspace_id", "repo_slug", "user_id", "worktree_id", "commit_sha")`);
24032
+ }
23990
24033
  async ensureSkillsTable(name) {
23991
24034
  const safe = sqlIdent(name);
23992
24035
  const tables = await this.listTables();
@@ -28,6 +28,7 @@ function loadConfig() {
28
28
  tableName: "memory",
29
29
  sessionsTableName: "sessions",
30
30
  skillsTableName: process.env.HIVEMIND_SKILLS_TABLE ?? "skills",
31
+ codebaseTableName: "codebase",
31
32
  memoryPath: join(home, ".deeplake", "memory")
32
33
  };
33
34
  }
@@ -219,9 +219,33 @@ function validateSchema(label, cols) {
219
219
  }
220
220
  }
221
221
  }
222
+ var CODEBASE_COLUMNS = Object.freeze([
223
+ // Identity key (matches the PK below)
224
+ { name: "org_id", sql: "TEXT NOT NULL DEFAULT ''" },
225
+ { name: "workspace_id", sql: "TEXT NOT NULL DEFAULT ''" },
226
+ { name: "repo_slug", sql: "TEXT NOT NULL DEFAULT ''" },
227
+ { name: "user_id", sql: "TEXT NOT NULL DEFAULT ''" },
228
+ { name: "worktree_id", sql: "TEXT NOT NULL DEFAULT ''" },
229
+ { name: "commit_sha", sql: "TEXT NOT NULL DEFAULT ''" },
230
+ // Observation metadata
231
+ { name: "parent_sha", sql: "TEXT NOT NULL DEFAULT ''" },
232
+ { name: "branch", sql: "TEXT NOT NULL DEFAULT ''" },
233
+ { name: "ts", sql: "TIMESTAMP" },
234
+ { name: "pushed_by", sql: "TEXT NOT NULL DEFAULT ''" },
235
+ // Snapshot payload
236
+ { name: "snapshot_sha256", sql: "TEXT NOT NULL DEFAULT ''" },
237
+ { name: "snapshot_jsonb", sql: "TEXT NOT NULL DEFAULT ''" },
238
+ { name: "node_count", sql: "BIGINT NOT NULL DEFAULT 0" },
239
+ { name: "edge_count", sql: "BIGINT NOT NULL DEFAULT 0" },
240
+ // Generator metadata (for drift diagnostics — what hivemind version produced this?)
241
+ { name: "generator", sql: "TEXT NOT NULL DEFAULT 'hivemind-graph'" },
242
+ { name: "generator_version", sql: "TEXT NOT NULL DEFAULT ''" },
243
+ { name: "schema_version", sql: "BIGINT NOT NULL DEFAULT 1" }
244
+ ]);
222
245
  validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
223
246
  validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
224
247
  validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
248
+ validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
225
249
  function buildCreateTableSql(tableName, cols) {
226
250
  const safe = sqlIdent(tableName);
227
251
  const colSql = cols.map((c) => `${c.name} ${c.sql}`).join(", ");
@@ -757,6 +781,27 @@ var DeeplakeApi = class {
757
781
  * This sidesteps the Deeplake UPDATE-coalescing quirk that bit the wiki
758
782
  * worker.
759
783
  */
784
+ /**
785
+ * Create the codebase table. One row per (org, workspace, repo, user,
786
+ * worktree, commit) — see CODEBASE_COLUMNS for the schema. Healing
787
+ * + index follow the same pattern as ensureSessionsTable.
788
+ */
789
+ async ensureCodebaseTable(name) {
790
+ const safe = sqlIdent(name);
791
+ const tables = await this.listTables();
792
+ if (!tables.includes(safe)) {
793
+ log3(`table "${safe}" not found, creating`);
794
+ await this.createTableWithRetry(buildCreateTableSql(safe, CODEBASE_COLUMNS), safe);
795
+ log3(`table "${safe}" created`);
796
+ if (!tables.includes(safe)) this._tablesCache = [...tables, safe];
797
+ }
798
+ await this.healSchema(safe, CODEBASE_COLUMNS);
799
+ await this.ensureLookupIndex(
800
+ safe,
801
+ "codebase_identity",
802
+ `("org_id", "workspace_id", "repo_slug", "user_id", "worktree_id", "commit_sha")`
803
+ );
804
+ }
760
805
  async ensureSkillsTable(name) {
761
806
  const safe = sqlIdent(name);
762
807
  const tables = await this.listTables();
@@ -1528,7 +1573,7 @@ function loadCredsModule() {
1528
1573
  return credsModulePromise;
1529
1574
  }
1530
1575
  function loadConfigModule() {
1531
- if (!configModulePromise) configModulePromise = import("./chunks/config-XEK4MJJS.js");
1576
+ if (!configModulePromise) configModulePromise = import("./chunks/config-O5PDJQ7Y.js");
1532
1577
  return configModulePromise;
1533
1578
  }
1534
1579
  async function loadCredentials2() {
@@ -1584,7 +1629,7 @@ function extractLatestVersion(body) {
1584
1629
  return typeof v === "string" && v.length > 0 ? v : null;
1585
1630
  }
1586
1631
  function getInstalledVersion() {
1587
- return "0.7.45".length > 0 ? "0.7.45" : null;
1632
+ return "0.7.46".length > 0 ? "0.7.46" : null;
1588
1633
  }
1589
1634
  function isNewer(latest, current) {
1590
1635
  const parse = (v) => v.replace(/-.*$/, "").split(".").map(Number);
@@ -396,9 +396,33 @@ function validateSchema(label, cols) {
396
396
  }
397
397
  }
398
398
  }
399
+ var CODEBASE_COLUMNS = Object.freeze([
400
+ // Identity key (matches the PK below)
401
+ { name: "org_id", sql: "TEXT NOT NULL DEFAULT ''" },
402
+ { name: "workspace_id", sql: "TEXT NOT NULL DEFAULT ''" },
403
+ { name: "repo_slug", sql: "TEXT NOT NULL DEFAULT ''" },
404
+ { name: "user_id", sql: "TEXT NOT NULL DEFAULT ''" },
405
+ { name: "worktree_id", sql: "TEXT NOT NULL DEFAULT ''" },
406
+ { name: "commit_sha", sql: "TEXT NOT NULL DEFAULT ''" },
407
+ // Observation metadata
408
+ { name: "parent_sha", sql: "TEXT NOT NULL DEFAULT ''" },
409
+ { name: "branch", sql: "TEXT NOT NULL DEFAULT ''" },
410
+ { name: "ts", sql: "TIMESTAMP" },
411
+ { name: "pushed_by", sql: "TEXT NOT NULL DEFAULT ''" },
412
+ // Snapshot payload
413
+ { name: "snapshot_sha256", sql: "TEXT NOT NULL DEFAULT ''" },
414
+ { name: "snapshot_jsonb", sql: "TEXT NOT NULL DEFAULT ''" },
415
+ { name: "node_count", sql: "BIGINT NOT NULL DEFAULT 0" },
416
+ { name: "edge_count", sql: "BIGINT NOT NULL DEFAULT 0" },
417
+ // Generator metadata (for drift diagnostics — what hivemind version produced this?)
418
+ { name: "generator", sql: "TEXT NOT NULL DEFAULT 'hivemind-graph'" },
419
+ { name: "generator_version", sql: "TEXT NOT NULL DEFAULT ''" },
420
+ { name: "schema_version", sql: "BIGINT NOT NULL DEFAULT 1" }
421
+ ]);
399
422
  validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
400
423
  validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
401
424
  validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
425
+ validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
402
426
  function buildCreateTableSql(tableName, cols) {
403
427
  const safe = sqlIdent(tableName);
404
428
  const colSql = cols.map((c) => `${c.name} ${c.sql}`).join(", ");
@@ -694,9 +718,12 @@ function resolveRecordScope(args) {
694
718
 
695
719
  // dist/src/skillify/state.js
696
720
  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";
721
+ import { join as join6 } from "node:path";
722
+
723
+ // dist/src/utils/repo-identity.js
697
724
  import { execSync } from "node:child_process";
698
725
  import { createHash } from "node:crypto";
699
- import { join as join6, basename } from "node:path";
726
+ import { basename, resolve } from "node:path";
700
727
 
701
728
  // dist/src/skillify/legacy-migration.js
702
729
  import { existsSync as existsSync3, renameSync } from "node:fs";
@@ -882,7 +909,7 @@ async function query(sql, retries = 4) {
882
909
  const base = Math.min(3e4, 2e3 * Math.pow(2, attempt));
883
910
  const delay = base + Math.floor(Math.random() * 1e3);
884
911
  wlog(`fetch failed (${e?.name ?? e?.code ?? e?.message}), retrying in ${delay}ms (attempt ${attempt + 1}/${retries})`);
885
- await new Promise((resolve) => setTimeout(resolve, delay));
912
+ await new Promise((resolve2) => setTimeout(resolve2, delay));
886
913
  continue;
887
914
  }
888
915
  throw e;
@@ -898,7 +925,7 @@ async function query(sql, retries = 4) {
898
925
  const base = Math.min(3e4, 2e3 * Math.pow(2, attempt));
899
926
  const delay = base + Math.floor(Math.random() * 1e3);
900
927
  wlog(`API ${r.status}, retrying in ${delay}ms (attempt ${attempt + 1}/${retries})`);
901
- await new Promise((resolve) => setTimeout(resolve, delay));
928
+ await new Promise((resolve2) => setTimeout(resolve2, delay));
902
929
  continue;
903
930
  }
904
931
  throw new Error(`API ${r.status}: ${(await r.text()).slice(0, 200)}`);
@@ -52,5 +52,5 @@
52
52
  }
53
53
  }
54
54
  },
55
- "version": "0.7.45"
55
+ "version": "0.7.46"
56
56
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hivemind",
3
- "version": "0.7.45",
3
+ "version": "0.7.46",
4
4
  "type": "module",
5
5
  "description": "Hivemind — cloud-backed persistent shared memory for AI agents, powered by DeepLake",
6
6
  "license": "Apache-2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeplake/hivemind",
3
- "version": "0.7.45",
3
+ "version": "0.7.46",
4
4
  "description": "Cloud-backed persistent shared memory for AI agents powered by Deeplake",
5
5
  "type": "module",
6
6
  "repository": {
@@ -57,6 +57,8 @@
57
57
  "deeplake": "^0.3.30",
58
58
  "js-yaml": "^4.1.1",
59
59
  "just-bash": "^2.14.0",
60
+ "tree-sitter": "^0.21.1",
61
+ "tree-sitter-typescript": "^0.23.2",
60
62
  "yargs-parser": "^22.0.0",
61
63
  "zod": "^4.3.6"
62
64
  },