@deeplake/hivemind 0.7.21 → 0.7.23

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 (37) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +1 -1
  4. package/bundle/cli.js +66 -15
  5. package/codex/bundle/capture.js +60 -12
  6. package/codex/bundle/commands/auth-login.js +4 -2
  7. package/codex/bundle/pre-tool-use.js +4 -2
  8. package/codex/bundle/session-start-setup.js +52 -5
  9. package/codex/bundle/session-start.js +62 -11
  10. package/codex/bundle/shell/deeplake-shell.js +4 -2
  11. package/codex/bundle/skillify-worker.js +118 -29
  12. package/codex/bundle/stop.js +100 -52
  13. package/codex/bundle/wiki-worker.js +7 -3
  14. package/cursor/bundle/capture.js +87 -39
  15. package/cursor/bundle/commands/auth-login.js +4 -2
  16. package/cursor/bundle/pre-tool-use.js +4 -2
  17. package/cursor/bundle/session-end.js +78 -34
  18. package/cursor/bundle/session-start.js +67 -15
  19. package/cursor/bundle/shell/deeplake-shell.js +4 -2
  20. package/cursor/bundle/skillify-worker.js +118 -29
  21. package/cursor/bundle/wiki-worker.js +7 -3
  22. package/hermes/bundle/capture.js +87 -39
  23. package/hermes/bundle/commands/auth-login.js +4 -2
  24. package/hermes/bundle/pre-tool-use.js +4 -2
  25. package/hermes/bundle/session-end.js +78 -34
  26. package/hermes/bundle/session-start.js +67 -15
  27. package/hermes/bundle/shell/deeplake-shell.js +4 -2
  28. package/hermes/bundle/skillify-worker.js +118 -29
  29. package/hermes/bundle/wiki-worker.js +7 -3
  30. package/mcp/bundle/server.js +4 -2
  31. package/openclaw/dist/index.js +8 -6
  32. package/openclaw/dist/skillify-worker.js +118 -29
  33. package/openclaw/openclaw.plugin.json +1 -1
  34. package/openclaw/package.json +1 -1
  35. package/openclaw/skills/SKILL.md +1 -1
  36. package/package.json +1 -1
  37. package/pi/extension-source/hivemind.ts +18 -3
@@ -110,7 +110,7 @@ function tryAcquireLock(sessionId, maxAgeMs = 10 * 60 * 1e3) {
110
110
  // dist/src/hooks/hermes/spawn-wiki-worker.js
111
111
  import { spawn, execSync } from "node:child_process";
112
112
  import { fileURLToPath } from "node:url";
113
- import { dirname, join as join5 } from "node:path";
113
+ import { dirname as dirname2, join as join6 } from "node:path";
114
114
  import { writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "node:fs";
115
115
  import { homedir as homedir4, tmpdir } from "node:os";
116
116
 
@@ -132,9 +132,51 @@ function makeWikiLogger(hooksDir, filename = "deeplake-wiki.log") {
132
132
  };
133
133
  }
134
134
 
135
+ // dist/src/utils/version-check.js
136
+ import { readFileSync as readFileSync3 } from "node:fs";
137
+ import { dirname, join as join5 } from "node:path";
138
+ function getInstalledVersion(bundleDir, pluginManifestDir) {
139
+ try {
140
+ const pluginJson = join5(bundleDir, "..", pluginManifestDir, "plugin.json");
141
+ const plugin = JSON.parse(readFileSync3(pluginJson, "utf-8"));
142
+ if (plugin.version)
143
+ return plugin.version;
144
+ } catch {
145
+ }
146
+ try {
147
+ const stamp = readFileSync3(join5(bundleDir, "..", ".hivemind_version"), "utf-8").trim();
148
+ if (stamp)
149
+ return stamp;
150
+ } catch {
151
+ }
152
+ const HIVEMIND_PKG_NAMES = /* @__PURE__ */ new Set([
153
+ "hivemind",
154
+ "hivemind-codex",
155
+ "@deeplake/hivemind",
156
+ "@deeplake/hivemind-codex",
157
+ "@activeloop/hivemind",
158
+ "@activeloop/hivemind-codex"
159
+ ]);
160
+ let dir = bundleDir;
161
+ for (let i = 0; i < 5; i++) {
162
+ const candidate = join5(dir, "package.json");
163
+ try {
164
+ const pkg = JSON.parse(readFileSync3(candidate, "utf-8"));
165
+ if (HIVEMIND_PKG_NAMES.has(pkg.name) && pkg.version)
166
+ return pkg.version;
167
+ } catch {
168
+ }
169
+ const parent = dirname(dir);
170
+ if (parent === dir)
171
+ break;
172
+ dir = parent;
173
+ }
174
+ return null;
175
+ }
176
+
135
177
  // dist/src/hooks/hermes/spawn-wiki-worker.js
136
178
  var HOME = homedir4();
137
- var wikiLogger = makeWikiLogger(join5(HOME, ".hermes", "hooks"));
179
+ var wikiLogger = makeWikiLogger(join6(HOME, ".hermes", "hooks"));
138
180
  var WIKI_LOG = wikiLogger.path;
139
181
  var WIKI_PROMPT_TEMPLATE = `You are building a personal wiki from a coding session. Your goal is to extract every piece of knowledge \u2014 entities, decisions, relationships, and facts \u2014 into a structured, searchable wiki entry.
140
182
 
@@ -196,9 +238,10 @@ function findHermesBin() {
196
238
  function spawnHermesWikiWorker(opts) {
197
239
  const { config, sessionId, cwd, bundleDir, reason } = opts;
198
240
  const projectName = cwd.split("/").pop() || "unknown";
199
- const tmpDir = join5(tmpdir(), `deeplake-wiki-${sessionId}-${Date.now()}`);
241
+ const tmpDir = join6(tmpdir(), `deeplake-wiki-${sessionId}-${Date.now()}`);
200
242
  mkdirSync3(tmpDir, { recursive: true });
201
- const configFile = join5(tmpDir, "config.json");
243
+ const pluginVersion = getInstalledVersion(bundleDir, ".claude-plugin") ?? "";
244
+ const configFile = join6(tmpDir, "config.json");
202
245
  writeFileSync2(configFile, JSON.stringify({
203
246
  apiUrl: config.apiUrl,
204
247
  token: config.token,
@@ -209,16 +252,17 @@ function spawnHermesWikiWorker(opts) {
209
252
  sessionId,
210
253
  userName: config.userName,
211
254
  project: projectName,
255
+ pluginVersion,
212
256
  tmpDir,
213
257
  hermesBin: findHermesBin(),
214
258
  hermesProvider: process.env.HIVEMIND_HERMES_PROVIDER ?? "openrouter",
215
259
  hermesModel: process.env.HIVEMIND_HERMES_MODEL ?? "anthropic/claude-haiku-4-5",
216
260
  wikiLog: WIKI_LOG,
217
- hooksDir: join5(HOME, ".hermes", "hooks"),
261
+ hooksDir: join6(HOME, ".hermes", "hooks"),
218
262
  promptTemplate: WIKI_PROMPT_TEMPLATE
219
263
  }));
220
264
  wikiLog(`${reason}: spawning summary worker for ${sessionId}`);
221
- const workerPath = join5(bundleDir, "wiki-worker.js");
265
+ const workerPath = join6(bundleDir, "wiki-worker.js");
222
266
  spawn("nohup", ["node", workerPath, configFile], {
223
267
  detached: true,
224
268
  stdio: ["ignore", "ignore", "ignore"]
@@ -226,13 +270,13 @@ function spawnHermesWikiWorker(opts) {
226
270
  wikiLog(`${reason}: spawned summary worker for ${sessionId}`);
227
271
  }
228
272
  function bundleDirFromImportMeta(importMetaUrl) {
229
- return dirname(fileURLToPath(importMetaUrl));
273
+ return dirname2(fileURLToPath(importMetaUrl));
230
274
  }
231
275
 
232
276
  // dist/src/skillify/spawn-skillify-worker.js
233
277
  import { spawn as spawn2 } from "node:child_process";
234
278
  import { fileURLToPath as fileURLToPath2 } from "node:url";
235
- import { dirname as dirname2, join as join7 } from "node:path";
279
+ import { dirname as dirname3, join as join8 } from "node:path";
236
280
  import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync4, appendFileSync as appendFileSync3, chmodSync } from "node:fs";
237
281
  import { homedir as homedir6, tmpdir as tmpdir2 } from "node:os";
238
282
 
@@ -240,7 +284,7 @@ import { homedir as homedir6, tmpdir as tmpdir2 } from "node:os";
240
284
  import { execFileSync } from "node:child_process";
241
285
  import { existsSync as existsSync3 } from "node:fs";
242
286
  import { homedir as homedir5 } from "node:os";
243
- import { join as join6 } from "node:path";
287
+ import { join as join7 } from "node:path";
244
288
  function findAgentBin(agent) {
245
289
  const which = (name) => {
246
290
  try {
@@ -255,24 +299,24 @@ function findAgentBin(agent) {
255
299
  };
256
300
  switch (agent) {
257
301
  case "claude_code":
258
- return which("claude") ?? join6(homedir5(), ".claude", "local", "claude");
302
+ return which("claude") ?? join7(homedir5(), ".claude", "local", "claude");
259
303
  case "codex":
260
304
  return which("codex") ?? "/usr/local/bin/codex";
261
305
  case "cursor":
262
306
  return which("cursor-agent") ?? "/usr/local/bin/cursor-agent";
263
307
  case "hermes":
264
- return which("hermes") ?? join6(homedir5(), ".local", "bin", "hermes");
308
+ return which("hermes") ?? join7(homedir5(), ".local", "bin", "hermes");
265
309
  case "pi":
266
- return which("pi") ?? join6(homedir5(), ".local", "bin", "pi");
310
+ return which("pi") ?? join7(homedir5(), ".local", "bin", "pi");
267
311
  }
268
312
  }
269
313
 
270
314
  // dist/src/skillify/spawn-skillify-worker.js
271
315
  var HOME2 = homedir6();
272
- var SKILLIFY_LOG = join7(HOME2, ".claude", "hooks", "skillify.log");
316
+ var SKILLIFY_LOG = join8(HOME2, ".claude", "hooks", "skillify.log");
273
317
  function skillifyLog(msg) {
274
318
  try {
275
- mkdirSync4(dirname2(SKILLIFY_LOG), { recursive: true });
319
+ mkdirSync4(dirname3(SKILLIFY_LOG), { recursive: true });
276
320
  appendFileSync3(SKILLIFY_LOG, `[${utcTimestamp()}] ${msg}
277
321
  `);
278
322
  } catch {
@@ -280,10 +324,10 @@ function skillifyLog(msg) {
280
324
  }
281
325
  function spawnSkillifyWorker(opts) {
282
326
  const { config, cwd, projectKey, project, bundleDir, agent, scopeConfig, currentSessionId, reason } = opts;
283
- const tmpDir = join7(tmpdir2(), `deeplake-skillify-${projectKey}-${Date.now()}`);
327
+ const tmpDir = join8(tmpdir2(), `deeplake-skillify-${projectKey}-${Date.now()}`);
284
328
  mkdirSync4(tmpDir, { recursive: true, mode: 448 });
285
329
  const gateBin = findAgentBin(agent);
286
- const configFile = join7(tmpDir, "config.json");
330
+ const configFile = join8(tmpDir, "config.json");
287
331
  writeFileSync3(configFile, JSON.stringify({
288
332
  apiUrl: config.apiUrl,
289
333
  token: config.token,
@@ -314,7 +358,7 @@ function spawnSkillifyWorker(opts) {
314
358
  } catch {
315
359
  }
316
360
  skillifyLog(`${reason}: spawning skillify worker for project=${project} key=${projectKey}`);
317
- const workerPath = join7(bundleDir, "skillify-worker.js");
361
+ const workerPath = join8(bundleDir, "skillify-worker.js");
318
362
  spawn2("nohup", ["node", workerPath, configFile], {
319
363
  detached: true,
320
364
  stdio: ["ignore", "ignore", "ignore"]
@@ -323,25 +367,25 @@ function spawnSkillifyWorker(opts) {
323
367
  }
324
368
 
325
369
  // dist/src/skillify/state.js
326
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync4, writeSync as writeSync2, mkdirSync as mkdirSync5, renameSync as renameSync3, existsSync as existsSync5, unlinkSync as unlinkSync2, openSync as openSync2, closeSync as closeSync2 } from "node:fs";
370
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, writeSync as writeSync2, mkdirSync as mkdirSync5, renameSync as renameSync3, existsSync as existsSync5, unlinkSync as unlinkSync2, openSync as openSync2, closeSync as closeSync2 } from "node:fs";
327
371
  import { execSync as execSync2 } from "node:child_process";
328
372
  import { homedir as homedir8 } from "node:os";
329
373
  import { createHash } from "node:crypto";
330
- import { join as join9, basename } from "node:path";
374
+ import { join as join10, basename } from "node:path";
331
375
 
332
376
  // dist/src/skillify/legacy-migration.js
333
377
  import { existsSync as existsSync4, renameSync as renameSync2 } from "node:fs";
334
378
  import { homedir as homedir7 } from "node:os";
335
- import { join as join8 } from "node:path";
379
+ import { join as join9 } from "node:path";
336
380
  var dlog2 = (msg) => log("skillify-migrate", msg);
337
381
  var attempted = false;
338
382
  function migrateLegacyStateDir() {
339
383
  if (attempted)
340
384
  return;
341
385
  attempted = true;
342
- const root = join8(homedir7(), ".deeplake", "state");
343
- const legacy = join8(root, "skilify");
344
- const current = join8(root, "skillify");
386
+ const root = join9(homedir7(), ".deeplake", "state");
387
+ const legacy = join9(root, "skilify");
388
+ const current = join9(root, "skillify");
345
389
  if (!existsSync4(legacy))
346
390
  return;
347
391
  if (existsSync4(current))
@@ -361,17 +405,17 @@ function migrateLegacyStateDir() {
361
405
 
362
406
  // dist/src/skillify/state.js
363
407
  var dlog3 = (msg) => log("skillify-state", msg);
364
- var STATE_DIR2 = join9(homedir8(), ".deeplake", "state", "skillify");
408
+ var STATE_DIR2 = join10(homedir8(), ".deeplake", "state", "skillify");
365
409
  var YIELD_BUF2 = new Int32Array(new SharedArrayBuffer(4));
366
410
  var TRIGGER_THRESHOLD = (() => {
367
411
  const n = Number(process.env.HIVEMIND_SKILLIFY_EVERY_N_TURNS ?? "");
368
412
  return Number.isInteger(n) && n > 0 ? n : 20;
369
413
  })();
370
414
  function statePath(projectKey) {
371
- return join9(STATE_DIR2, `${projectKey}.json`);
415
+ return join10(STATE_DIR2, `${projectKey}.json`);
372
416
  }
373
417
  function lockPath2(projectKey) {
374
- return join9(STATE_DIR2, `${projectKey}.lock`);
418
+ return join10(STATE_DIR2, `${projectKey}.lock`);
375
419
  }
376
420
  var DEFAULT_PORTS = {
377
421
  http: "80",
@@ -420,7 +464,7 @@ function readState(projectKey) {
420
464
  if (!existsSync5(p))
421
465
  return null;
422
466
  try {
423
- return JSON.parse(readFileSync3(p, "utf-8"));
467
+ return JSON.parse(readFileSync4(p, "utf-8"));
424
468
  } catch {
425
469
  return null;
426
470
  }
@@ -482,7 +526,7 @@ function tryAcquireWorkerLock(projectKey, maxAgeMs = 10 * 60 * 1e3) {
482
526
  const p = lockPath2(projectKey);
483
527
  if (existsSync5(p)) {
484
528
  try {
485
- const ageMs = Date.now() - parseInt(readFileSync3(p, "utf-8"), 10);
529
+ const ageMs = Date.now() - parseInt(readFileSync4(p, "utf-8"), 10);
486
530
  if (Number.isFinite(ageMs) && ageMs < maxAgeMs)
487
531
  return false;
488
532
  } catch (readErr) {
@@ -516,19 +560,19 @@ function releaseWorkerLock(projectKey) {
516
560
  }
517
561
 
518
562
  // dist/src/skillify/scope-config.js
519
- import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync4, writeFileSync as writeFileSync5 } from "node:fs";
563
+ import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
520
564
  import { homedir as homedir9 } from "node:os";
521
- import { join as join10 } from "node:path";
522
- var STATE_DIR3 = join10(homedir9(), ".deeplake", "state", "skillify");
523
- var CONFIG_PATH = join10(STATE_DIR3, "config.json");
565
+ import { join as join11 } from "node:path";
566
+ var STATE_DIR3 = join11(homedir9(), ".deeplake", "state", "skillify");
567
+ var CONFIG_PATH = join11(STATE_DIR3, "config.json");
524
568
  var DEFAULT = { scope: "me", team: [], install: "project" };
525
569
  function loadScopeConfig() {
526
570
  migrateLegacyStateDir();
527
571
  if (!existsSync6(CONFIG_PATH))
528
572
  return DEFAULT;
529
573
  try {
530
- const raw = JSON.parse(readFileSync4(CONFIG_PATH, "utf-8"));
531
- const scope = raw.scope === "team" || raw.scope === "org" ? raw.scope : "me";
574
+ const raw = JSON.parse(readFileSync5(CONFIG_PATH, "utf-8"));
575
+ const scope = raw.scope === "team" ? "team" : raw.scope === "org" ? "team" : "me";
532
576
  const team = Array.isArray(raw.team) ? raw.team.filter((s) => typeof s === "string") : [];
533
577
  const install = raw.install === "global" ? "global" : "project";
534
578
  return { scope, team, install };
@@ -511,13 +511,14 @@ var DeeplakeApi = class {
511
511
  const tables = await this.listTables();
512
512
  if (!tables.includes(tbl)) {
513
513
  log2(`table "${tbl}" not found, creating`);
514
- await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${tbl}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', summary TEXT NOT NULL DEFAULT '', summary_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'text/plain', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, tbl);
514
+ await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${tbl}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', summary TEXT NOT NULL DEFAULT '', summary_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'text/plain', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', plugin_version TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, tbl);
515
515
  log2(`table "${tbl}" created`);
516
516
  if (!tables.includes(tbl))
517
517
  this._tablesCache = [...tables, tbl];
518
518
  }
519
519
  await this.ensureEmbeddingColumn(tbl, SUMMARY_EMBEDDING_COL);
520
520
  await this.ensureColumn(tbl, "agent", "TEXT NOT NULL DEFAULT ''");
521
+ await this.ensureColumn(tbl, "plugin_version", "TEXT NOT NULL DEFAULT ''");
521
522
  }
522
523
  /** Create the sessions table (uses JSONB for message since every row is a JSON event). */
523
524
  async ensureSessionsTable(name) {
@@ -525,13 +526,14 @@ var DeeplakeApi = class {
525
526
  const tables = await this.listTables();
526
527
  if (!tables.includes(safe)) {
527
528
  log2(`table "${safe}" not found, creating`);
528
- await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${safe}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', message JSONB, message_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'application/json', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, safe);
529
+ await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${safe}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', message JSONB, message_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'application/json', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', plugin_version TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, safe);
529
530
  log2(`table "${safe}" created`);
530
531
  if (!tables.includes(safe))
531
532
  this._tablesCache = [...tables, safe];
532
533
  }
533
534
  await this.ensureEmbeddingColumn(safe, MESSAGE_EMBEDDING_COL);
534
535
  await this.ensureColumn(safe, "agent", "TEXT NOT NULL DEFAULT ''");
536
+ await this.ensureColumn(safe, "plugin_version", "TEXT NOT NULL DEFAULT ''");
535
537
  await this.ensureLookupIndex(safe, "path_creation_date", `("path", "creation_date")`);
536
538
  }
537
539
  /**
@@ -702,18 +704,25 @@ function parseFrontmatter(text) {
702
704
  const head = text.slice(4, end).trim();
703
705
  const body = text.slice(end + 4).replace(/^\r?\n/, "");
704
706
  const fm = { source_sessions: [] };
705
- let mode = "kv";
707
+ let arrayKey = null;
706
708
  for (const raw of head.split(/\r?\n/)) {
707
- if (mode === "sources") {
709
+ if (arrayKey) {
708
710
  const m2 = raw.match(/^\s+-\s+(.+)$/);
709
711
  if (m2) {
710
- fm.source_sessions.push(m2[1].trim());
712
+ const arr = fm[arrayKey] ?? [];
713
+ arr.push(m2[1].trim());
714
+ fm[arrayKey] = arr;
711
715
  continue;
712
716
  }
713
- mode = "kv";
717
+ arrayKey = null;
714
718
  }
715
719
  if (raw.startsWith("source_sessions:")) {
716
- mode = "sources";
720
+ arrayKey = "source_sessions";
721
+ continue;
722
+ }
723
+ if (raw.startsWith("contributors:")) {
724
+ arrayKey = "contributors";
725
+ fm.contributors = [];
717
726
  continue;
718
727
  }
719
728
  const m = raw.match(/^([a-zA-Z_]+):\s*(.*)$/);
@@ -928,11 +937,19 @@ function buildPullSql(args) {
928
937
  where.push(`name = '${esc(args.skillName)}'`);
929
938
  }
930
939
  const whereClause = where.length > 0 ? ` WHERE ${where.join(" AND ")}` : "";
931
- return `SELECT name, project, project_key, body, version, source_agent, scope, author, description, trigger_text, source_sessions, install, created_at, updated_at FROM "${args.tableName}"${whereClause} ORDER BY project_key ASC, name ASC, version DESC`;
940
+ const contributorsCol = args.includeContributors === false ? "" : "contributors, ";
941
+ return `SELECT name, project, project_key, body, version, source_agent, scope, author, ${contributorsCol}description, trigger_text, source_sessions, install, created_at, updated_at FROM "${args.tableName}"${whereClause} ORDER BY project_key ASC, name ASC, version DESC`;
942
+ }
943
+ function isMissingContributorsColumnError(message) {
944
+ if (!message)
945
+ return false;
946
+ return /contributors.*(?:does not exist|not found|unknown)/i.test(message) || /(?:does not exist|unknown column).*contributors/i.test(message);
932
947
  }
933
948
  function isMissingTableError(message) {
934
949
  if (!message)
935
950
  return false;
951
+ if (/\bcolumn\b/i.test(message))
952
+ return false;
936
953
  return /Table does not exist|relation .* does not exist|no such table/i.test(message);
937
954
  }
938
955
  function resolvePullDestination(install, cwd) {
@@ -1028,11 +1045,16 @@ function selectLatestPerName(rows) {
1028
1045
  }
1029
1046
  function renderSkillFile(row) {
1030
1047
  const sources = parseSourceSessions(row.source_sessions);
1048
+ const author = typeof row.author === "string" && row.author.length > 0 ? row.author : void 0;
1049
+ const contributors = parseContributors(row.contributors);
1050
+ const renderedContributors = contributors.length > 0 ? contributors : author ? [author] : [];
1031
1051
  const fm = {
1032
1052
  name: String(row.name ?? ""),
1033
1053
  description: String(row.description ?? ""),
1034
1054
  trigger: typeof row.trigger_text === "string" && row.trigger_text.length > 0 ? String(row.trigger_text) : void 0,
1055
+ author,
1035
1056
  source_sessions: sources,
1057
+ contributors: renderedContributors,
1036
1058
  version: Number(row.version ?? 1),
1037
1059
  created_by_agent: String(row.source_agent ?? "unknown"),
1038
1060
  created_at: String(row.created_at ?? (/* @__PURE__ */ new Date()).toISOString()),
@@ -1057,15 +1079,35 @@ function parseSourceSessions(v) {
1057
1079
  }
1058
1080
  return [];
1059
1081
  }
1082
+ function parseContributors(v) {
1083
+ if (Array.isArray(v))
1084
+ return v.map(String);
1085
+ if (typeof v === "string") {
1086
+ try {
1087
+ const parsed = JSON.parse(v);
1088
+ if (Array.isArray(parsed))
1089
+ return parsed.map(String);
1090
+ } catch {
1091
+ }
1092
+ }
1093
+ return [];
1094
+ }
1060
1095
  function renderFrontmatter(fm) {
1061
1096
  const lines = ["---"];
1062
1097
  lines.push(`name: ${fm.name}`);
1063
1098
  lines.push(`description: ${JSON.stringify(fm.description)}`);
1064
1099
  if (fm.trigger)
1065
1100
  lines.push(`trigger: ${JSON.stringify(fm.trigger)}`);
1101
+ if (fm.author)
1102
+ lines.push(`author: ${fm.author}`);
1066
1103
  lines.push(`source_sessions:`);
1067
1104
  for (const s of fm.source_sessions)
1068
1105
  lines.push(` - ${s}`);
1106
+ if (fm.contributors && fm.contributors.length > 0) {
1107
+ lines.push(`contributors:`);
1108
+ for (const c of fm.contributors)
1109
+ lines.push(` - ${c}`);
1110
+ }
1069
1111
  lines.push(`version: ${fm.version}`);
1070
1112
  lines.push(`created_by_agent: ${fm.created_by_agent}`);
1071
1113
  lines.push(`created_at: ${fm.created_at}`);
@@ -1105,10 +1147,19 @@ async function runPull(opts) {
1105
1147
  try {
1106
1148
  rows = await opts.query(sql);
1107
1149
  } catch (e) {
1108
- if (isMissingTableError(e?.message))
1150
+ if (isMissingTableError(e?.message)) {
1109
1151
  rows = [];
1110
- else
1152
+ } else if (isMissingContributorsColumnError(e?.message)) {
1153
+ const legacySql = buildPullSql({
1154
+ tableName: opts.tableName,
1155
+ users: opts.users,
1156
+ skillName: opts.skillName,
1157
+ includeContributors: false
1158
+ });
1159
+ rows = await opts.query(legacySql);
1160
+ } else {
1111
1161
  throw e;
1162
+ }
1112
1163
  }
1113
1164
  const latest = selectLatestPerName(rows);
1114
1165
  const root = resolvePullDestination(opts.install, opts.cwd);
@@ -1312,10 +1363,10 @@ SKILLS (skillify) \u2014 mine + share reusable skills across the org:
1312
1363
  - hivemind skillify unpull --user <email> \u2014 remove only that author's pulls
1313
1364
  - hivemind skillify unpull --not-mine \u2014 remove all pulls except your own
1314
1365
  - hivemind skillify unpull --dry-run \u2014 preview without touching disk
1315
- - hivemind skillify scope <me|team|org> \u2014 sharing scope for new skills
1366
+ - hivemind skillify scope <me|team> \u2014 sharing scope for new skills
1316
1367
  - hivemind skillify install <project|global> \u2014 default install location
1317
1368
  - hivemind skillify team add|remove|list <name> \u2014 manage team list`;
1318
- async function createPlaceholder(api, table, sessionId, cwd, userName, orgName, workspaceId) {
1369
+ async function createPlaceholder(api, table, sessionId, cwd, userName, orgName, workspaceId, pluginVersion) {
1319
1370
  const summaryPath = `/summaries/${userName}/${sessionId}.md`;
1320
1371
  const existing = await api.query(`SELECT path FROM "${table}" WHERE path = '${sqlStr(summaryPath)}' LIMIT 1`);
1321
1372
  if (existing.length > 0)
@@ -1332,7 +1383,7 @@ async function createPlaceholder(api, table, sessionId, cwd, userName, orgName,
1332
1383
  ""
1333
1384
  ].join("\n");
1334
1385
  const filename = `${sessionId}.md`;
1335
- await api.query(`INSERT INTO "${table}" (id, path, filename, summary, author, mime_type, size_bytes, project, description, agent, creation_date, last_update_date) VALUES ('${crypto.randomUUID()}', '${sqlStr(summaryPath)}', '${sqlStr(filename)}', E'${sqlStr(content)}', '${sqlStr(userName)}', 'text/markdown', ${Buffer.byteLength(content, "utf-8")}, '${sqlStr(projectName)}', 'in progress', 'hermes', '${now}', '${now}')`);
1386
+ await api.query(`INSERT INTO "${table}" (id, path, filename, summary, author, mime_type, size_bytes, project, description, agent, plugin_version, creation_date, last_update_date) VALUES ('${crypto.randomUUID()}', '${sqlStr(summaryPath)}', '${sqlStr(filename)}', E'${sqlStr(content)}', '${sqlStr(userName)}', 'text/markdown', ${Buffer.byteLength(content, "utf-8")}, '${sqlStr(projectName)}', 'in progress', 'hermes', '${sqlStr(pluginVersion)}', '${now}', '${now}')`);
1336
1387
  }
1337
1388
  async function main() {
1338
1389
  if (process.env.HIVEMIND_WIKI_WORKER === "1")
@@ -1343,6 +1394,8 @@ async function main() {
1343
1394
  const creds = loadCredentials();
1344
1395
  const captureEnabled = process.env.HIVEMIND_CAPTURE !== "false";
1345
1396
  await autoUpdate(creds, { agent: "hermes" });
1397
+ const current = getInstalledVersion(__bundleDir, ".claude-plugin");
1398
+ const pluginVersion = current ?? "";
1346
1399
  if (creds?.token && captureEnabled) {
1347
1400
  try {
1348
1401
  const config = loadConfig();
@@ -1350,7 +1403,7 @@ async function main() {
1350
1403
  const api = new DeeplakeApi(config.token, config.apiUrl, config.orgId, config.workspaceId, config.tableName);
1351
1404
  await api.ensureTable();
1352
1405
  await api.ensureSessionsTable(config.sessionsTableName);
1353
- await createPlaceholder(api, config.tableName, sessionId, cwd, config.userName, config.orgName, config.workspaceId);
1406
+ await createPlaceholder(api, config.tableName, sessionId, cwd, config.userName, config.orgName, config.workspaceId, pluginVersion);
1354
1407
  log5("placeholder created");
1355
1408
  }
1356
1409
  } catch (e) {
@@ -1360,7 +1413,6 @@ async function main() {
1360
1413
  const pullResult = await autoPullSkills();
1361
1414
  log5(`autopull: pulled=${pullResult.pulled} skipped=${pullResult.skipped}`);
1362
1415
  let versionNotice = "";
1363
- const current = getInstalledVersion(__bundleDir, ".claude-plugin");
1364
1416
  if (current)
1365
1417
  versionNotice = `
1366
1418
  Hivemind v${current}`;
@@ -67201,13 +67201,14 @@ var DeeplakeApi = class {
67201
67201
  const tables = await this.listTables();
67202
67202
  if (!tables.includes(tbl)) {
67203
67203
  log2(`table "${tbl}" not found, creating`);
67204
- await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${tbl}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', summary TEXT NOT NULL DEFAULT '', summary_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'text/plain', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, tbl);
67204
+ await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${tbl}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', summary TEXT NOT NULL DEFAULT '', summary_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'text/plain', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', plugin_version TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, tbl);
67205
67205
  log2(`table "${tbl}" created`);
67206
67206
  if (!tables.includes(tbl))
67207
67207
  this._tablesCache = [...tables, tbl];
67208
67208
  }
67209
67209
  await this.ensureEmbeddingColumn(tbl, SUMMARY_EMBEDDING_COL);
67210
67210
  await this.ensureColumn(tbl, "agent", "TEXT NOT NULL DEFAULT ''");
67211
+ await this.ensureColumn(tbl, "plugin_version", "TEXT NOT NULL DEFAULT ''");
67211
67212
  }
67212
67213
  /** Create the sessions table (uses JSONB for message since every row is a JSON event). */
67213
67214
  async ensureSessionsTable(name) {
@@ -67215,13 +67216,14 @@ var DeeplakeApi = class {
67215
67216
  const tables = await this.listTables();
67216
67217
  if (!tables.includes(safe)) {
67217
67218
  log2(`table "${safe}" not found, creating`);
67218
- await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${safe}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', message JSONB, message_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'application/json', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, safe);
67219
+ await this.createTableWithRetry(`CREATE TABLE IF NOT EXISTS "${safe}" (id TEXT NOT NULL DEFAULT '', path TEXT NOT NULL DEFAULT '', filename TEXT NOT NULL DEFAULT '', message JSONB, message_embedding FLOAT4[], author TEXT NOT NULL DEFAULT '', mime_type TEXT NOT NULL DEFAULT 'application/json', size_bytes BIGINT NOT NULL DEFAULT 0, project TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', agent TEXT NOT NULL DEFAULT '', plugin_version TEXT NOT NULL DEFAULT '', creation_date TEXT NOT NULL DEFAULT '', last_update_date TEXT NOT NULL DEFAULT '') USING deeplake`, safe);
67219
67220
  log2(`table "${safe}" created`);
67220
67221
  if (!tables.includes(safe))
67221
67222
  this._tablesCache = [...tables, safe];
67222
67223
  }
67223
67224
  await this.ensureEmbeddingColumn(safe, MESSAGE_EMBEDDING_COL);
67224
67225
  await this.ensureColumn(safe, "agent", "TEXT NOT NULL DEFAULT ''");
67226
+ await this.ensureColumn(safe, "plugin_version", "TEXT NOT NULL DEFAULT ''");
67225
67227
  await this.ensureLookupIndex(safe, "path_creation_date", `("path", "creation_date")`);
67226
67228
  }
67227
67229
  /**