@deeplake/hivemind 0.7.75 → 0.7.77

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.
@@ -148,6 +148,33 @@ async function healDriftedOrgToken(creds, log4 = () => {
148
148
  organization_id: creds.orgId
149
149
  }, creds.token, apiUrl);
150
150
  const healed = { ...creds, token: tokenData.token.token };
151
+ try {
152
+ const orgs = await listOrgs(healed.token, apiUrl);
153
+ const matchedOrg = orgs.find((o) => o.id === creds.orgId);
154
+ if (matchedOrg && matchedOrg.name !== creds.orgName) {
155
+ log4(`orgName realigned: ${creds.orgName ?? "(unset)"} -> ${matchedOrg.name}`);
156
+ healed.orgName = matchedOrg.name;
157
+ }
158
+ } catch (e) {
159
+ log4(`orgName realign skipped: ${e.message}`);
160
+ }
161
+ const currentWs = creds.workspaceId ?? "default";
162
+ if (currentWs !== "default") {
163
+ try {
164
+ const wsList = await listWorkspaces(healed.token, apiUrl, creds.orgId);
165
+ const lcWs = currentWs.toLowerCase();
166
+ const wsMatch = wsList.find((w) => w.id === currentWs || w.name && w.name.toLowerCase() === lcWs);
167
+ if (!wsMatch) {
168
+ log4(`workspace '${currentWs}' not in org ${creds.orgId} \u2014 reset to default`);
169
+ healed.workspaceId = "default";
170
+ } else if (wsMatch.id !== currentWs) {
171
+ log4(`workspace '${currentWs}' resolved to id '${wsMatch.id}'`);
172
+ healed.workspaceId = wsMatch.id;
173
+ }
174
+ } catch (e) {
175
+ log4(`workspace realign skipped: ${e.message}`);
176
+ }
177
+ }
151
178
  saveCredentials(healed);
152
179
  log4(`token re-minted for org=${creds.orgId}`);
153
180
  return healed;
@@ -1801,7 +1828,7 @@ function extractLatestVersion(body) {
1801
1828
  return typeof v === "string" && v.length > 0 ? v : null;
1802
1829
  }
1803
1830
  function getInstalledVersion() {
1804
- return "0.7.75".length > 0 ? "0.7.75" : null;
1831
+ return "0.7.77".length > 0 ? "0.7.77" : null;
1805
1832
  }
1806
1833
  function isNewer(latest, current) {
1807
1834
  const parse = (v) => v.replace(/-.*$/, "").split(".").map(Number);
@@ -54,5 +54,5 @@
54
54
  }
55
55
  }
56
56
  },
57
- "version": "0.7.75"
57
+ "version": "0.7.77"
58
58
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hivemind",
3
- "version": "0.7.75",
3
+ "version": "0.7.77",
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.75",
3
+ "version": "0.7.77",
4
4
  "description": "Cloud-backed persistent shared memory for AI agents powered by Deeplake",
5
5
  "type": "module",
6
6
  "repository": {
@@ -61,6 +61,7 @@
61
61
  "deeplake": "^0.3.30",
62
62
  "js-yaml": "^4.1.1",
63
63
  "just-bash": "^2.14.0",
64
+ "tree-sitter-python": "^0.21.0",
64
65
  "yargs-parser": "^22.0.0",
65
66
  "zod": "^4.3.6"
66
67
  },
@@ -17,7 +17,7 @@ import { createRequire } from 'node:module';
17
17
 
18
18
  const ROOT = process.cwd();
19
19
  const require = createRequire(`${ROOT}/`);
20
- const PKGS = ['tree-sitter', 'tree-sitter-typescript'];
20
+ const PKGS = ['tree-sitter', 'tree-sitter-typescript', 'tree-sitter-python'];
21
21
 
22
22
  function bindingsLoad() {
23
23
  try {
@@ -26,6 +26,11 @@ function bindingsLoad() {
26
26
  const parser = new Parser();
27
27
  parser.setLanguage(TS);
28
28
  parser.parse('const x = 1;');
29
+ // B6: also verify the Python grammar loads on this platform / Node ABI.
30
+ const Py = require('tree-sitter-python');
31
+ const pyParser = new Parser();
32
+ pyParser.setLanguage(Py);
33
+ pyParser.parse('x = 1\n');
29
34
  return true;
30
35
  } catch {
31
36
  return false;