@deeplake/hivemind 0.7.22 → 0.7.24

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.
package/bundle/cli.js CHANGED
@@ -17,21 +17,21 @@ __export(index_marker_store_exports, {
17
17
  hasFreshIndexMarker: () => hasFreshIndexMarker,
18
18
  writeIndexMarker: () => writeIndexMarker
19
19
  });
20
- import { existsSync as existsSync11, mkdirSync as mkdirSync3, readFileSync as readFileSync8, writeFileSync as writeFileSync5 } from "node:fs";
21
- import { join as join14 } from "node:path";
20
+ import { existsSync as existsSync12, mkdirSync as mkdirSync3, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "node:fs";
21
+ import { join as join15 } from "node:path";
22
22
  import { tmpdir } from "node:os";
23
23
  function getIndexMarkerDir() {
24
- return process.env.HIVEMIND_INDEX_MARKER_DIR ?? join14(tmpdir(), "hivemind-deeplake-indexes");
24
+ return process.env.HIVEMIND_INDEX_MARKER_DIR ?? join15(tmpdir(), "hivemind-deeplake-indexes");
25
25
  }
26
26
  function buildIndexMarkerPath(workspaceId, orgId, table, suffix) {
27
27
  const markerKey = [workspaceId, orgId, table, suffix].join("__").replace(/[^a-zA-Z0-9_.-]/g, "_");
28
- return join14(getIndexMarkerDir(), `${markerKey}.json`);
28
+ return join15(getIndexMarkerDir(), `${markerKey}.json`);
29
29
  }
30
30
  function hasFreshIndexMarker(markerPath) {
31
- if (!existsSync11(markerPath))
31
+ if (!existsSync12(markerPath))
32
32
  return false;
33
33
  try {
34
- const raw = JSON.parse(readFileSync8(markerPath, "utf-8"));
34
+ const raw = JSON.parse(readFileSync9(markerPath, "utf-8"));
35
35
  const updatedAt = raw.updatedAt ? new Date(raw.updatedAt).getTime() : NaN;
36
36
  if (!Number.isFinite(updatedAt) || Date.now() - updatedAt > INDEX_MARKER_TTL_MS)
37
37
  return false;
@@ -42,7 +42,7 @@ function hasFreshIndexMarker(markerPath) {
42
42
  }
43
43
  function writeIndexMarker(markerPath) {
44
44
  mkdirSync3(getIndexMarkerDir(), { recursive: true });
45
- writeFileSync5(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
45
+ writeFileSync6(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
46
46
  }
47
47
  var INDEX_MARKER_TTL_MS;
48
48
  var init_index_marker_store = __esm({
@@ -54,6 +54,9 @@ var init_index_marker_store = __esm({
54
54
 
55
55
  // dist/src/cli/install-claude.js
56
56
  import { execFileSync } from "node:child_process";
57
+ import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
58
+ import { homedir as homedir2 } from "node:os";
59
+ import { join as join2 } from "node:path";
57
60
 
58
61
  // dist/src/cli/util.js
59
62
  import { existsSync, mkdirSync, readFileSync, writeFileSync, cpSync, symlinkSync, unlinkSync, lstatSync } from "node:fs";
@@ -178,6 +181,75 @@ function pluginAlreadyInstalled() {
178
181
  return r.stdout.includes(PLUGIN_KEY);
179
182
  }
180
183
  var PLUGIN_SCOPES = ["user", "project", "local", "managed"];
184
+ function resolvePluginRoot() {
185
+ return join2(homedir2(), ".claude", "plugins", "hivemind");
186
+ }
187
+ function marketplaceHooksJsonPath() {
188
+ return join2(homedir2(), ".claude", "plugins", "marketplaces", "hivemind", "claude-code", "hooks", "hooks.json");
189
+ }
190
+ function settingsJsonPath() {
191
+ return join2(homedir2(), ".claude", "settings.json");
192
+ }
193
+ function resolveCommand(command, pluginRoot) {
194
+ return command.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, pluginRoot);
195
+ }
196
+ function isHivemindMatcher(matcher) {
197
+ return matcher.hooks?.some((h) => {
198
+ if (typeof h.command !== "string")
199
+ return false;
200
+ const normalized = h.command.replace(/\\/g, "/");
201
+ return normalized.includes("plugins/hivemind/bundle/");
202
+ }) ?? false;
203
+ }
204
+ function syncHivemindHooksToSettings() {
205
+ const hooksPath = marketplaceHooksJsonPath();
206
+ const settingsPath = settingsJsonPath();
207
+ if (!existsSync2(hooksPath))
208
+ return { changed: false, events: [] };
209
+ let canonical;
210
+ try {
211
+ canonical = JSON.parse(readFileSync2(hooksPath, "utf-8"));
212
+ } catch {
213
+ return { changed: false, events: [] };
214
+ }
215
+ if (!canonical.hooks)
216
+ return { changed: false, events: [] };
217
+ let settings = {};
218
+ if (existsSync2(settingsPath)) {
219
+ try {
220
+ settings = JSON.parse(readFileSync2(settingsPath, "utf-8"));
221
+ } catch {
222
+ return { changed: false, events: [] };
223
+ }
224
+ }
225
+ settings.hooks = settings.hooks ?? {};
226
+ const pluginRoot = resolvePluginRoot();
227
+ const changedEvents = [];
228
+ let changed = false;
229
+ for (const [event, matchers] of Object.entries(canonical.hooks)) {
230
+ const resolvedMatchers = matchers.map((m) => ({
231
+ ...m.matcher !== void 0 ? { matcher: m.matcher } : {},
232
+ hooks: m.hooks.map((h) => ({
233
+ ...h.type !== void 0 ? { type: h.type } : {},
234
+ ...h.command !== void 0 ? { command: resolveCommand(h.command, pluginRoot) } : {},
235
+ ...h.timeout !== void 0 ? { timeout: h.timeout } : {},
236
+ ...h.async !== void 0 ? { async: h.async } : {}
237
+ }))
238
+ }));
239
+ const existing = settings.hooks[event] ?? [];
240
+ const preserved = existing.filter((m) => !isHivemindMatcher(m));
241
+ const next = [...preserved, ...resolvedMatchers];
242
+ if (JSON.stringify(next) !== JSON.stringify(existing)) {
243
+ settings.hooks[event] = next;
244
+ changedEvents.push(event);
245
+ changed = true;
246
+ }
247
+ }
248
+ if (changed) {
249
+ writeFileSync2(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
250
+ }
251
+ return { changed, events: changedEvents };
252
+ }
181
253
  function installClaude() {
182
254
  requireClaudeCli();
183
255
  if (!marketplaceAlreadyAdded()) {
@@ -200,6 +272,14 @@ function installClaude() {
200
272
  log(` Claude Code refreshed via marketplace ${MARKETPLACE_SOURCE}`);
201
273
  }
202
274
  runClaude(["plugin", "enable", PLUGIN_KEY]);
275
+ try {
276
+ const sync = syncHivemindHooksToSettings();
277
+ if (sync.changed) {
278
+ log(` Claude Code settings.json hooks synced (${sync.events.join(", ")})`);
279
+ }
280
+ } catch (e) {
281
+ log(` Claude Code settings.json sync skipped: ${e?.message ?? String(e)}`);
282
+ }
203
283
  }
204
284
  function uninstallClaude() {
205
285
  try {
@@ -214,16 +294,16 @@ function uninstallClaude() {
214
294
  }
215
295
 
216
296
  // dist/src/cli/install-codex.js
217
- import { existsSync as existsSync2, readFileSync as readFileSync3, unlinkSync as unlinkSync2 } from "node:fs";
297
+ import { existsSync as existsSync3, readFileSync as readFileSync4, unlinkSync as unlinkSync2 } from "node:fs";
218
298
  import { execFileSync as execFileSync2 } from "node:child_process";
219
- import { join as join3 } from "node:path";
299
+ import { join as join4 } from "node:path";
220
300
 
221
301
  // dist/src/cli/version.js
222
- import { readFileSync as readFileSync2 } from "node:fs";
223
- import { join as join2 } from "node:path";
302
+ import { readFileSync as readFileSync3 } from "node:fs";
303
+ import { join as join3 } from "node:path";
224
304
  function getVersion() {
225
305
  try {
226
- const pkg = JSON.parse(readFileSync2(join2(pkgRoot(), "package.json"), "utf-8"));
306
+ const pkg = JSON.parse(readFileSync3(join3(pkgRoot(), "package.json"), "utf-8"));
227
307
  return pkg.version ?? "0.0.0";
228
308
  } catch {
229
309
  return "0.0.0";
@@ -231,16 +311,16 @@ function getVersion() {
231
311
  }
232
312
 
233
313
  // dist/src/cli/install-codex.js
234
- var CODEX_HOME = join3(HOME, ".codex");
235
- var PLUGIN_DIR = join3(CODEX_HOME, "hivemind");
236
- var HOOKS_PATH = join3(CODEX_HOME, "hooks.json");
237
- var AGENTS_SKILLS_DIR = join3(HOME, ".agents", "skills");
238
- var SKILL_LINK = join3(AGENTS_SKILLS_DIR, "hivemind-memory");
314
+ var CODEX_HOME = join4(HOME, ".codex");
315
+ var PLUGIN_DIR = join4(CODEX_HOME, "hivemind");
316
+ var HOOKS_PATH = join4(CODEX_HOME, "hooks.json");
317
+ var AGENTS_SKILLS_DIR = join4(HOME, ".agents", "skills");
318
+ var SKILL_LINK = join4(AGENTS_SKILLS_DIR, "hivemind-memory");
239
319
  function hookCmd(bundleFile, timeout, matcher) {
240
320
  const block = {
241
321
  hooks: [{
242
322
  type: "command",
243
- command: `node "${join3(PLUGIN_DIR, "bundle", bundleFile)}"`,
323
+ command: `node "${join4(PLUGIN_DIR, "bundle", bundleFile)}"`,
244
324
  timeout
245
325
  }]
246
326
  };
@@ -314,8 +394,8 @@ function mergeHooks(existing, ours, pluginDir = PLUGIN_DIR) {
314
394
  function mergeHooksJson(ours) {
315
395
  let existing = {};
316
396
  try {
317
- if (existsSync2(HOOKS_PATH)) {
318
- const parsed = JSON.parse(readFileSync3(HOOKS_PATH, "utf-8"));
397
+ if (existsSync3(HOOKS_PATH)) {
398
+ const parsed = JSON.parse(readFileSync4(HOOKS_PATH, "utf-8"));
319
399
  if (parsed && typeof parsed === "object")
320
400
  existing = parsed;
321
401
  }
@@ -354,20 +434,20 @@ function tryEnableCodexHooks() {
354
434
  }
355
435
  }
356
436
  function installCodex() {
357
- const srcBundle = join3(pkgRoot(), "codex", "bundle");
358
- const srcSkills = join3(pkgRoot(), "codex", "skills");
359
- if (!existsSync2(srcBundle)) {
437
+ const srcBundle = join4(pkgRoot(), "codex", "bundle");
438
+ const srcSkills = join4(pkgRoot(), "codex", "skills");
439
+ if (!existsSync3(srcBundle)) {
360
440
  throw new Error(`Codex bundle missing at ${srcBundle}. Run 'npm run build' first.`);
361
441
  }
362
442
  ensureDir(PLUGIN_DIR);
363
- copyDir(srcBundle, join3(PLUGIN_DIR, "bundle"));
364
- if (existsSync2(srcSkills))
365
- copyDir(srcSkills, join3(PLUGIN_DIR, "skills"));
443
+ copyDir(srcBundle, join4(PLUGIN_DIR, "bundle"));
444
+ if (existsSync3(srcSkills))
445
+ copyDir(srcSkills, join4(PLUGIN_DIR, "skills"));
366
446
  tryEnableCodexHooks();
367
447
  writeJson(HOOKS_PATH, mergeHooksJson(buildHooksJson()));
368
448
  ensureDir(AGENTS_SKILLS_DIR);
369
- const skillTarget = join3(PLUGIN_DIR, "skills", "deeplake-memory");
370
- if (existsSync2(skillTarget)) {
449
+ const skillTarget = join4(PLUGIN_DIR, "skills", "deeplake-memory");
450
+ if (existsSync3(skillTarget)) {
371
451
  symlinkForce(skillTarget, SKILL_LINK);
372
452
  } else {
373
453
  warn(` Codex skill source missing at ${skillTarget}; skipping symlink`);
@@ -376,10 +456,10 @@ function installCodex() {
376
456
  log(` Codex installed -> ${PLUGIN_DIR}`);
377
457
  }
378
458
  function uninstallCodex() {
379
- if (existsSync2(HOOKS_PATH)) {
459
+ if (existsSync3(HOOKS_PATH)) {
380
460
  let existing = {};
381
461
  try {
382
- const raw = JSON.parse(readFileSync3(HOOKS_PATH, "utf-8"));
462
+ const raw = JSON.parse(readFileSync4(HOOKS_PATH, "utf-8"));
383
463
  if (raw && typeof raw === "object")
384
464
  existing = raw;
385
465
  } catch {
@@ -400,7 +480,7 @@ function uninstallCodex() {
400
480
  }
401
481
  }
402
482
  }
403
- if (existsSync2(SKILL_LINK)) {
483
+ if (existsSync3(SKILL_LINK)) {
404
484
  unlinkSync2(SKILL_LINK);
405
485
  log(` Codex removed ${SKILL_LINK}`);
406
486
  }
@@ -408,30 +488,30 @@ function uninstallCodex() {
408
488
  }
409
489
 
410
490
  // dist/src/cli/install-openclaw.js
411
- import { existsSync as existsSync3, copyFileSync, rmSync } from "node:fs";
412
- import { join as join4 } from "node:path";
413
- var PLUGIN_DIR2 = join4(HOME, ".openclaw", "extensions", "hivemind");
491
+ import { existsSync as existsSync4, copyFileSync, rmSync } from "node:fs";
492
+ import { join as join5 } from "node:path";
493
+ var PLUGIN_DIR2 = join5(HOME, ".openclaw", "extensions", "hivemind");
414
494
  function installOpenclaw() {
415
- const srcDist = join4(pkgRoot(), "openclaw", "dist");
416
- const srcManifest = join4(pkgRoot(), "openclaw", "openclaw.plugin.json");
417
- const srcPkg = join4(pkgRoot(), "openclaw", "package.json");
418
- const srcSkills = join4(pkgRoot(), "openclaw", "skills");
419
- if (!existsSync3(srcDist)) {
495
+ const srcDist = join5(pkgRoot(), "openclaw", "dist");
496
+ const srcManifest = join5(pkgRoot(), "openclaw", "openclaw.plugin.json");
497
+ const srcPkg = join5(pkgRoot(), "openclaw", "package.json");
498
+ const srcSkills = join5(pkgRoot(), "openclaw", "skills");
499
+ if (!existsSync4(srcDist)) {
420
500
  throw new Error(`OpenClaw bundle missing at ${srcDist}. Run 'npm run build' first.`);
421
501
  }
422
502
  ensureDir(PLUGIN_DIR2);
423
- copyDir(srcDist, join4(PLUGIN_DIR2, "dist"));
424
- if (existsSync3(srcManifest))
425
- copyFileSync(srcManifest, join4(PLUGIN_DIR2, "openclaw.plugin.json"));
426
- if (existsSync3(srcPkg))
427
- copyFileSync(srcPkg, join4(PLUGIN_DIR2, "package.json"));
428
- if (existsSync3(srcSkills))
429
- copyDir(srcSkills, join4(PLUGIN_DIR2, "skills"));
503
+ copyDir(srcDist, join5(PLUGIN_DIR2, "dist"));
504
+ if (existsSync4(srcManifest))
505
+ copyFileSync(srcManifest, join5(PLUGIN_DIR2, "openclaw.plugin.json"));
506
+ if (existsSync4(srcPkg))
507
+ copyFileSync(srcPkg, join5(PLUGIN_DIR2, "package.json"));
508
+ if (existsSync4(srcSkills))
509
+ copyDir(srcSkills, join5(PLUGIN_DIR2, "skills"));
430
510
  writeVersionStamp(PLUGIN_DIR2, getVersion());
431
511
  log(` OpenClaw installed -> ${PLUGIN_DIR2}`);
432
512
  }
433
513
  function uninstallOpenclaw() {
434
- if (existsSync3(PLUGIN_DIR2)) {
514
+ if (existsSync4(PLUGIN_DIR2)) {
435
515
  rmSync(PLUGIN_DIR2, { recursive: true, force: true });
436
516
  log(` OpenClaw removed ${PLUGIN_DIR2}`);
437
517
  } else {
@@ -440,23 +520,23 @@ function uninstallOpenclaw() {
440
520
  }
441
521
 
442
522
  // dist/src/cli/install-cursor.js
443
- import { existsSync as existsSync4, unlinkSync as unlinkSync3 } from "node:fs";
444
- import { join as join5 } from "node:path";
445
- var CURSOR_HOME = join5(HOME, ".cursor");
446
- var PLUGIN_DIR3 = join5(CURSOR_HOME, "hivemind");
447
- var HOOKS_PATH2 = join5(CURSOR_HOME, "hooks.json");
523
+ import { existsSync as existsSync5, unlinkSync as unlinkSync3 } from "node:fs";
524
+ import { join as join6 } from "node:path";
525
+ var CURSOR_HOME = join6(HOME, ".cursor");
526
+ var PLUGIN_DIR3 = join6(CURSOR_HOME, "hivemind");
527
+ var HOOKS_PATH2 = join6(CURSOR_HOME, "hooks.json");
448
528
  var HIVEMIND_MARKER_KEY = "_hivemindManaged";
449
529
  function buildHookCmd(bundleFile, timeout) {
450
530
  return {
451
531
  type: "command",
452
- command: `node "${join5(PLUGIN_DIR3, "bundle", bundleFile)}"`,
532
+ command: `node "${join6(PLUGIN_DIR3, "bundle", bundleFile)}"`,
453
533
  timeout
454
534
  };
455
535
  }
456
536
  function buildHookCmdShellMatcher(bundleFile, timeout) {
457
537
  return {
458
538
  type: "command",
459
- command: `node "${join5(PLUGIN_DIR3, "bundle", bundleFile)}"`,
539
+ command: `node "${join6(PLUGIN_DIR3, "bundle", bundleFile)}"`,
460
540
  timeout,
461
541
  matcher: "Shell"
462
542
  };
@@ -512,12 +592,12 @@ function stripHooksFromConfig(existing) {
512
592
  return existing;
513
593
  }
514
594
  function installCursor() {
515
- const srcBundle = join5(pkgRoot(), "cursor", "bundle");
516
- if (!existsSync4(srcBundle)) {
595
+ const srcBundle = join6(pkgRoot(), "cursor", "bundle");
596
+ if (!existsSync5(srcBundle)) {
517
597
  throw new Error(`Cursor bundle missing at ${srcBundle}. Run 'npm run build' first.`);
518
598
  }
519
599
  ensureDir(PLUGIN_DIR3);
520
- copyDir(srcBundle, join5(PLUGIN_DIR3, "bundle"));
600
+ copyDir(srcBundle, join6(PLUGIN_DIR3, "bundle"));
521
601
  const existing = readJson(HOOKS_PATH2);
522
602
  const merged = mergeHooks2(existing);
523
603
  writeJson(HOOKS_PATH2, merged);
@@ -533,7 +613,7 @@ function uninstallCursor() {
533
613
  const stripped = stripHooksFromConfig(existing);
534
614
  const meaningfulKeys = stripped ? Object.keys(stripped).filter((k) => k !== "version").length : 0;
535
615
  if (!stripped || meaningfulKeys === 0) {
536
- if (existsSync4(HOOKS_PATH2))
616
+ if (existsSync5(HOOKS_PATH2))
537
617
  unlinkSync3(HOOKS_PATH2);
538
618
  } else {
539
619
  writeJson(HOOKS_PATH2, stripped);
@@ -542,8 +622,8 @@ function uninstallCursor() {
542
622
  }
543
623
 
544
624
  // dist/src/cli/install-hermes.js
545
- import { existsSync as existsSync6, writeFileSync as writeFileSync2, readFileSync as readFileSync4, rmSync as rmSync2, unlinkSync as unlinkSync4 } from "node:fs";
546
- import { join as join7 } from "node:path";
625
+ import { existsSync as existsSync7, writeFileSync as writeFileSync3, readFileSync as readFileSync5, rmSync as rmSync2, unlinkSync as unlinkSync4 } from "node:fs";
626
+ import { join as join8 } from "node:path";
547
627
 
548
628
  // node_modules/js-yaml/dist/js-yaml.mjs
549
629
  function isNothing(subject) {
@@ -3132,15 +3212,15 @@ var safeLoadAll = renamed("safeLoadAll", "loadAll");
3132
3212
  var safeDump = renamed("safeDump", "dump");
3133
3213
 
3134
3214
  // dist/src/cli/install-mcp-shared.js
3135
- import { existsSync as existsSync5 } from "node:fs";
3136
- import { join as join6 } from "node:path";
3137
- var HIVEMIND_DIR = join6(HOME, ".hivemind");
3138
- var MCP_DIR = join6(HIVEMIND_DIR, "mcp");
3139
- var MCP_SERVER_PATH = join6(MCP_DIR, "server.js");
3140
- var MCP_PACKAGE_JSON = join6(MCP_DIR, "package.json");
3215
+ import { existsSync as existsSync6 } from "node:fs";
3216
+ import { join as join7 } from "node:path";
3217
+ var HIVEMIND_DIR = join7(HOME, ".hivemind");
3218
+ var MCP_DIR = join7(HIVEMIND_DIR, "mcp");
3219
+ var MCP_SERVER_PATH = join7(MCP_DIR, "server.js");
3220
+ var MCP_PACKAGE_JSON = join7(MCP_DIR, "package.json");
3141
3221
  function ensureMcpServerInstalled() {
3142
- const srcDir = join6(pkgRoot(), "mcp", "bundle");
3143
- if (!existsSync5(srcDir)) {
3222
+ const srcDir = join7(pkgRoot(), "mcp", "bundle");
3223
+ if (!existsSync6(srcDir)) {
3144
3224
  throw new Error(`MCP server bundle missing at ${srcDir}. Run 'npm run build' to produce it before installing Tier B consumers.`);
3145
3225
  }
3146
3226
  ensureDir(MCP_DIR);
@@ -3150,11 +3230,11 @@ function ensureMcpServerInstalled() {
3150
3230
  }
3151
3231
 
3152
3232
  // dist/src/cli/install-hermes.js
3153
- var HERMES_HOME = join7(HOME, ".hermes");
3154
- var SKILLS_DIR = join7(HERMES_HOME, "skills", "hivemind-memory");
3155
- var HIVEMIND_DIR2 = join7(HERMES_HOME, "hivemind");
3156
- var BUNDLE_DIR = join7(HIVEMIND_DIR2, "bundle");
3157
- var CONFIG_PATH = join7(HERMES_HOME, "config.yaml");
3233
+ var HERMES_HOME = join8(HOME, ".hermes");
3234
+ var SKILLS_DIR = join8(HERMES_HOME, "skills", "hivemind-memory");
3235
+ var HIVEMIND_DIR2 = join8(HERMES_HOME, "hivemind");
3236
+ var BUNDLE_DIR = join8(HIVEMIND_DIR2, "bundle");
3237
+ var CONFIG_PATH = join8(HERMES_HOME, "config.yaml");
3158
3238
  var SERVER_KEY = "hivemind";
3159
3239
  var SKILL_BODY = `---
3160
3240
  name: hivemind-memory
@@ -3212,7 +3292,7 @@ function isHivemindHook(entry) {
3212
3292
  }
3213
3293
  function buildHookEntry(bundleFile, timeout, matcher) {
3214
3294
  const entry = {
3215
- command: `node ${join7(BUNDLE_DIR, bundleFile)}`,
3295
+ command: `node ${join8(BUNDLE_DIR, bundleFile)}`,
3216
3296
  timeout
3217
3297
  };
3218
3298
  if (matcher)
@@ -3256,10 +3336,10 @@ function stripHivemindHooks(existing) {
3256
3336
  return Object.keys(out).length > 0 ? out : void 0;
3257
3337
  }
3258
3338
  function readConfig() {
3259
- if (!existsSync6(CONFIG_PATH))
3339
+ if (!existsSync7(CONFIG_PATH))
3260
3340
  return {};
3261
3341
  try {
3262
- const raw = readFileSync4(CONFIG_PATH, "utf-8");
3342
+ const raw = readFileSync5(CONFIG_PATH, "utf-8");
3263
3343
  const parsed = load(raw);
3264
3344
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
3265
3345
  return parsed;
@@ -3272,15 +3352,15 @@ function readConfig() {
3272
3352
  function writeConfig(cfg) {
3273
3353
  ensureDir(HERMES_HOME);
3274
3354
  const dumped = dump(cfg, { lineWidth: 100, noRefs: true });
3275
- writeFileSync2(CONFIG_PATH, dumped);
3355
+ writeFileSync3(CONFIG_PATH, dumped);
3276
3356
  }
3277
3357
  function installHermes() {
3278
3358
  ensureDir(SKILLS_DIR);
3279
- writeFileSync2(join7(SKILLS_DIR, "SKILL.md"), SKILL_BODY);
3359
+ writeFileSync3(join8(SKILLS_DIR, "SKILL.md"), SKILL_BODY);
3280
3360
  writeVersionStamp(SKILLS_DIR, getVersion());
3281
3361
  log(` Hermes skill installed -> ${SKILLS_DIR}`);
3282
- const srcBundle = join7(pkgRoot(), "hermes", "bundle");
3283
- if (!existsSync6(srcBundle)) {
3362
+ const srcBundle = join8(pkgRoot(), "hermes", "bundle");
3363
+ if (!existsSync7(srcBundle)) {
3284
3364
  throw new Error(`Hermes bundle missing at ${srcBundle}. Run 'npm run build' first.`);
3285
3365
  }
3286
3366
  ensureDir(HIVEMIND_DIR2);
@@ -3301,15 +3381,15 @@ function installHermes() {
3301
3381
  log(` Hermes config updated -> ${CONFIG_PATH} (mcp_servers + hooks + hooks_auto_accept)`);
3302
3382
  }
3303
3383
  function uninstallHermes() {
3304
- if (existsSync6(SKILLS_DIR)) {
3384
+ if (existsSync7(SKILLS_DIR)) {
3305
3385
  rmSync2(SKILLS_DIR, { recursive: true, force: true });
3306
3386
  log(` Hermes removed ${SKILLS_DIR}`);
3307
3387
  }
3308
- if (existsSync6(HIVEMIND_DIR2)) {
3388
+ if (existsSync7(HIVEMIND_DIR2)) {
3309
3389
  rmSync2(HIVEMIND_DIR2, { recursive: true, force: true });
3310
3390
  log(` Hermes removed ${HIVEMIND_DIR2}`);
3311
3391
  }
3312
- if (existsSync6(CONFIG_PATH)) {
3392
+ if (existsSync7(CONFIG_PATH)) {
3313
3393
  const cfg = readConfig();
3314
3394
  let touched = false;
3315
3395
  if (cfg.mcp_servers && typeof cfg.mcp_servers === "object" && SERVER_KEY in cfg.mcp_servers) {
@@ -3342,18 +3422,18 @@ function uninstallHermes() {
3342
3422
  }
3343
3423
 
3344
3424
  // dist/src/cli/install-pi.js
3345
- import { existsSync as existsSync7, writeFileSync as writeFileSync3, rmSync as rmSync3, readFileSync as readFileSync5, copyFileSync as copyFileSync2 } from "node:fs";
3346
- import { join as join8 } from "node:path";
3347
- var PI_AGENT_DIR = join8(HOME, ".pi", "agent");
3348
- var AGENTS_MD = join8(PI_AGENT_DIR, "AGENTS.md");
3349
- var LEGACY_SKILL_DIR = join8(PI_AGENT_DIR, "skills", "hivemind-memory");
3350
- var EXTENSIONS_DIR = join8(PI_AGENT_DIR, "extensions");
3351
- var EXTENSION_PATH = join8(EXTENSIONS_DIR, "hivemind.ts");
3352
- var VERSION_DIR = join8(PI_AGENT_DIR, ".hivemind");
3353
- var WIKI_WORKER_DIR = join8(PI_AGENT_DIR, "hivemind");
3354
- var WIKI_WORKER_PATH = join8(WIKI_WORKER_DIR, "wiki-worker.js");
3355
- var SKILLIFY_WORKER_PATH = join8(WIKI_WORKER_DIR, "skillify-worker.js");
3356
- var AUTOPULL_WORKER_PATH = join8(WIKI_WORKER_DIR, "autopull-worker.js");
3425
+ import { existsSync as existsSync8, writeFileSync as writeFileSync4, rmSync as rmSync3, readFileSync as readFileSync6, copyFileSync as copyFileSync2 } from "node:fs";
3426
+ import { join as join9 } from "node:path";
3427
+ var PI_AGENT_DIR = join9(HOME, ".pi", "agent");
3428
+ var AGENTS_MD = join9(PI_AGENT_DIR, "AGENTS.md");
3429
+ var LEGACY_SKILL_DIR = join9(PI_AGENT_DIR, "skills", "hivemind-memory");
3430
+ var EXTENSIONS_DIR = join9(PI_AGENT_DIR, "extensions");
3431
+ var EXTENSION_PATH = join9(EXTENSIONS_DIR, "hivemind.ts");
3432
+ var VERSION_DIR = join9(PI_AGENT_DIR, ".hivemind");
3433
+ var WIKI_WORKER_DIR = join9(PI_AGENT_DIR, "hivemind");
3434
+ var WIKI_WORKER_PATH = join9(WIKI_WORKER_DIR, "wiki-worker.js");
3435
+ var SKILLIFY_WORKER_PATH = join9(WIKI_WORKER_DIR, "skillify-worker.js");
3436
+ var AUTOPULL_WORKER_PATH = join9(WIKI_WORKER_DIR, "autopull-worker.js");
3357
3437
  var HIVEMIND_BLOCK_START = "<!-- BEGIN hivemind-memory -->";
3358
3438
  var HIVEMIND_BLOCK_END = "<!-- END hivemind-memory -->";
3359
3439
  var HIVEMIND_BLOCK_BODY = `${HIVEMIND_BLOCK_START}
@@ -3421,30 +3501,30 @@ ${after}`;
3421
3501
  }
3422
3502
  function installPi() {
3423
3503
  ensureDir(PI_AGENT_DIR);
3424
- if (existsSync7(LEGACY_SKILL_DIR)) {
3504
+ if (existsSync8(LEGACY_SKILL_DIR)) {
3425
3505
  rmSync3(LEGACY_SKILL_DIR, { recursive: true, force: true });
3426
3506
  }
3427
- const prior = existsSync7(AGENTS_MD) ? readFileSync5(AGENTS_MD, "utf-8") : null;
3507
+ const prior = existsSync8(AGENTS_MD) ? readFileSync6(AGENTS_MD, "utf-8") : null;
3428
3508
  const next = upsertHivemindBlock(prior);
3429
- writeFileSync3(AGENTS_MD, next);
3430
- const srcExtension = join8(pkgRoot(), "pi", "extension-source", "hivemind.ts");
3431
- if (!existsSync7(srcExtension)) {
3509
+ writeFileSync4(AGENTS_MD, next);
3510
+ const srcExtension = join9(pkgRoot(), "pi", "extension-source", "hivemind.ts");
3511
+ if (!existsSync8(srcExtension)) {
3432
3512
  throw new Error(`pi extension source missing at ${srcExtension}. Reinstall the @deeplake/hivemind package.`);
3433
3513
  }
3434
3514
  ensureDir(EXTENSIONS_DIR);
3435
3515
  copyFileSync2(srcExtension, EXTENSION_PATH);
3436
- const srcWorker = join8(pkgRoot(), "pi", "bundle", "wiki-worker.js");
3437
- if (existsSync7(srcWorker)) {
3516
+ const srcWorker = join9(pkgRoot(), "pi", "bundle", "wiki-worker.js");
3517
+ if (existsSync8(srcWorker)) {
3438
3518
  ensureDir(WIKI_WORKER_DIR);
3439
3519
  copyFileSync2(srcWorker, WIKI_WORKER_PATH);
3440
3520
  }
3441
- const srcSkillifyWorker = join8(pkgRoot(), "pi", "bundle", "skillify-worker.js");
3442
- if (existsSync7(srcSkillifyWorker)) {
3521
+ const srcSkillifyWorker = join9(pkgRoot(), "pi", "bundle", "skillify-worker.js");
3522
+ if (existsSync8(srcSkillifyWorker)) {
3443
3523
  ensureDir(WIKI_WORKER_DIR);
3444
3524
  copyFileSync2(srcSkillifyWorker, SKILLIFY_WORKER_PATH);
3445
3525
  }
3446
- const srcAutopullWorker = join8(pkgRoot(), "pi", "bundle", "autopull-worker.js");
3447
- if (existsSync7(srcAutopullWorker)) {
3526
+ const srcAutopullWorker = join9(pkgRoot(), "pi", "bundle", "autopull-worker.js");
3527
+ if (existsSync8(srcAutopullWorker)) {
3448
3528
  ensureDir(WIKI_WORKER_DIR);
3449
3529
  copyFileSync2(srcAutopullWorker, AUTOPULL_WORKER_PATH);
3450
3530
  }
@@ -3452,82 +3532,82 @@ function installPi() {
3452
3532
  writeVersionStamp(VERSION_DIR, getVersion());
3453
3533
  log(` pi AGENTS.md updated -> ${AGENTS_MD}`);
3454
3534
  log(` pi extension installed -> ${EXTENSION_PATH}`);
3455
- if (existsSync7(WIKI_WORKER_PATH)) {
3535
+ if (existsSync8(WIKI_WORKER_PATH)) {
3456
3536
  log(` pi wiki-worker installed -> ${WIKI_WORKER_PATH}`);
3457
3537
  }
3458
- if (existsSync7(SKILLIFY_WORKER_PATH)) {
3538
+ if (existsSync8(SKILLIFY_WORKER_PATH)) {
3459
3539
  log(` pi skillify-worker installed -> ${SKILLIFY_WORKER_PATH}`);
3460
3540
  }
3461
- if (existsSync7(AUTOPULL_WORKER_PATH)) {
3541
+ if (existsSync8(AUTOPULL_WORKER_PATH)) {
3462
3542
  log(` pi autopull-worker installed -> ${AUTOPULL_WORKER_PATH}`);
3463
3543
  }
3464
3544
  }
3465
3545
  function uninstallPi() {
3466
- if (existsSync7(LEGACY_SKILL_DIR)) {
3546
+ if (existsSync8(LEGACY_SKILL_DIR)) {
3467
3547
  rmSync3(LEGACY_SKILL_DIR, { recursive: true, force: true });
3468
3548
  log(` pi removed ${LEGACY_SKILL_DIR}`);
3469
3549
  }
3470
- if (existsSync7(EXTENSION_PATH)) {
3550
+ if (existsSync8(EXTENSION_PATH)) {
3471
3551
  rmSync3(EXTENSION_PATH, { force: true });
3472
3552
  log(` pi removed extension ${EXTENSION_PATH}`);
3473
3553
  }
3474
- if (existsSync7(WIKI_WORKER_DIR)) {
3554
+ if (existsSync8(WIKI_WORKER_DIR)) {
3475
3555
  rmSync3(WIKI_WORKER_DIR, { recursive: true, force: true });
3476
3556
  log(` pi removed wiki-worker dir ${WIKI_WORKER_DIR}`);
3477
3557
  }
3478
- if (existsSync7(AGENTS_MD)) {
3479
- const prior = readFileSync5(AGENTS_MD, "utf-8");
3558
+ if (existsSync8(AGENTS_MD)) {
3559
+ const prior = readFileSync6(AGENTS_MD, "utf-8");
3480
3560
  const stripped = stripHivemindBlock(prior);
3481
3561
  if (stripped.trim().length === 0) {
3482
3562
  rmSync3(AGENTS_MD, { force: true });
3483
3563
  log(` pi removed empty ${AGENTS_MD}`);
3484
3564
  } else {
3485
- writeFileSync3(AGENTS_MD, stripped);
3565
+ writeFileSync4(AGENTS_MD, stripped);
3486
3566
  log(` pi stripped hivemind block from ${AGENTS_MD}`);
3487
3567
  }
3488
3568
  }
3489
- if (existsSync7(VERSION_DIR)) {
3569
+ if (existsSync8(VERSION_DIR)) {
3490
3570
  rmSync3(VERSION_DIR, { recursive: true, force: true });
3491
3571
  }
3492
3572
  }
3493
3573
 
3494
3574
  // dist/src/cli/embeddings.js
3495
- import { copyFileSync as copyFileSync3, chmodSync, existsSync as existsSync8, lstatSync as lstatSync2, readdirSync, readlinkSync, rmSync as rmSync4, statSync, unlinkSync as unlinkSync5 } from "node:fs";
3575
+ import { copyFileSync as copyFileSync3, chmodSync, existsSync as existsSync9, lstatSync as lstatSync2, readdirSync, readlinkSync, rmSync as rmSync4, statSync, unlinkSync as unlinkSync5 } from "node:fs";
3496
3576
  import { execFileSync as execFileSync3 } from "node:child_process";
3497
- import { join as join9 } from "node:path";
3498
- var SHARED_DIR = join9(HOME, ".hivemind", "embed-deps");
3499
- var SHARED_NODE_MODULES = join9(SHARED_DIR, "node_modules");
3500
- var SHARED_DAEMON_PATH = join9(SHARED_DIR, "embed-daemon.js");
3577
+ import { join as join10 } from "node:path";
3578
+ var SHARED_DIR = join10(HOME, ".hivemind", "embed-deps");
3579
+ var SHARED_NODE_MODULES = join10(SHARED_DIR, "node_modules");
3580
+ var SHARED_DAEMON_PATH = join10(SHARED_DIR, "embed-daemon.js");
3501
3581
  var TRANSFORMERS_PKG = "@huggingface/transformers";
3502
3582
  var TRANSFORMERS_RANGE = "^3.0.0";
3503
3583
  function findHivemindInstalls(home = HOME) {
3504
3584
  const out = [];
3505
3585
  const fixed = [
3506
- { id: "codex", pluginDir: join9(home, ".codex", "hivemind") },
3507
- { id: "cursor", pluginDir: join9(home, ".cursor", "hivemind") },
3508
- { id: "hermes", pluginDir: join9(home, ".hermes", "hivemind") }
3586
+ { id: "codex", pluginDir: join10(home, ".codex", "hivemind") },
3587
+ { id: "cursor", pluginDir: join10(home, ".cursor", "hivemind") },
3588
+ { id: "hermes", pluginDir: join10(home, ".hermes", "hivemind") }
3509
3589
  ];
3510
3590
  for (const inst of fixed) {
3511
- if (existsSync8(join9(inst.pluginDir, "bundle")))
3591
+ if (existsSync9(join10(inst.pluginDir, "bundle")))
3512
3592
  out.push(inst);
3513
3593
  }
3514
- const ccCache = join9(home, ".claude", "plugins", "cache", "hivemind", "hivemind");
3515
- if (existsSync8(ccCache)) {
3594
+ const ccCache = join10(home, ".claude", "plugins", "cache", "hivemind", "hivemind");
3595
+ if (existsSync9(ccCache)) {
3516
3596
  let entries = [];
3517
3597
  try {
3518
3598
  entries = readdirSync(ccCache);
3519
3599
  } catch {
3520
3600
  }
3521
3601
  for (const ver of entries) {
3522
- const dir = join9(ccCache, ver);
3602
+ const dir = join10(ccCache, ver);
3523
3603
  try {
3524
3604
  if (!statSync(dir).isDirectory())
3525
3605
  continue;
3526
3606
  } catch {
3527
3607
  continue;
3528
3608
  }
3529
- const candidates = [join9(dir, "bundle"), join9(dir, "claude-code", "bundle")];
3530
- if (candidates.some((p) => existsSync8(p))) {
3609
+ const candidates = [join10(dir, "bundle"), join10(dir, "claude-code", "bundle")];
3610
+ if (candidates.some((p) => existsSync9(p))) {
3531
3611
  out.push({ id: `claude (${ver})`, pluginDir: dir });
3532
3612
  }
3533
3613
  }
@@ -3535,10 +3615,10 @@ function findHivemindInstalls(home = HOME) {
3535
3615
  return out;
3536
3616
  }
3537
3617
  function isSharedDepsInstalled(sharedNodeModules = SHARED_NODE_MODULES) {
3538
- return existsSync8(join9(sharedNodeModules, TRANSFORMERS_PKG));
3618
+ return existsSync9(join10(sharedNodeModules, TRANSFORMERS_PKG));
3539
3619
  }
3540
3620
  function isSymlinkToSharedDeps(linkPath, sharedNodeModules) {
3541
- if (!existsSync8(linkPath))
3621
+ if (!existsSync9(linkPath))
3542
3622
  return false;
3543
3623
  try {
3544
3624
  if (!lstatSync2(linkPath).isSymbolicLink())
@@ -3549,8 +3629,8 @@ function isSymlinkToSharedDeps(linkPath, sharedNodeModules) {
3549
3629
  }
3550
3630
  }
3551
3631
  function linkStateFor(install, sharedNodeModules = SHARED_NODE_MODULES) {
3552
- const link = join9(install.pluginDir, "node_modules");
3553
- if (!existsSync8(link) && !isSymbolicLink(link))
3632
+ const link = join10(install.pluginDir, "node_modules");
3633
+ if (!existsSync9(link) && !isSymbolicLink(link))
3554
3634
  return { kind: "no-node-modules" };
3555
3635
  try {
3556
3636
  if (lstatSync2(link).isSymbolicLink()) {
@@ -3574,7 +3654,7 @@ function ensureSharedDeps() {
3574
3654
  log(` Embeddings installing ${TRANSFORMERS_PKG}@${TRANSFORMERS_RANGE} into ${SHARED_DIR}`);
3575
3655
  log(` (~600 MB; first install only \u2014 every agent will share this)`);
3576
3656
  ensureDir(SHARED_DIR);
3577
- writeJson(join9(SHARED_DIR, "package.json"), {
3657
+ writeJson(join10(SHARED_DIR, "package.json"), {
3578
3658
  name: "hivemind-embed-deps",
3579
3659
  version: "1.0.0",
3580
3660
  private: true,
@@ -3588,8 +3668,8 @@ function ensureSharedDeps() {
3588
3668
  log(` Embeddings shared deps already present at ${SHARED_DIR}`);
3589
3669
  }
3590
3670
  ensureDir(SHARED_DIR);
3591
- const src = join9(pkgRoot(), "embeddings", "embed-daemon.js");
3592
- if (existsSync8(src)) {
3671
+ const src = join10(pkgRoot(), "embeddings", "embed-daemon.js");
3672
+ if (existsSync9(src)) {
3593
3673
  copyFileSync3(src, SHARED_DAEMON_PATH);
3594
3674
  chmodSync(SHARED_DAEMON_PATH, 493);
3595
3675
  } else {
@@ -3597,7 +3677,7 @@ function ensureSharedDeps() {
3597
3677
  }
3598
3678
  }
3599
3679
  function linkAgent(install) {
3600
- const link = join9(install.pluginDir, "node_modules");
3680
+ const link = join10(install.pluginDir, "node_modules");
3601
3681
  symlinkForce(SHARED_NODE_MODULES, link);
3602
3682
  log(` Embeddings linked ${install.id.padEnd(20)} -> shared deps`);
3603
3683
  }
@@ -3616,13 +3696,13 @@ function enableEmbeddings() {
3616
3696
  function disableEmbeddings(opts) {
3617
3697
  const installs = findHivemindInstalls();
3618
3698
  for (const inst of installs) {
3619
- const link = join9(inst.pluginDir, "node_modules");
3699
+ const link = join10(inst.pluginDir, "node_modules");
3620
3700
  if (isSymlinkToSharedDeps(link, SHARED_NODE_MODULES)) {
3621
3701
  unlinkSync5(link);
3622
3702
  log(` Embeddings unlinked ${inst.id}`);
3623
3703
  }
3624
3704
  }
3625
- if (opts?.prune && existsSync8(SHARED_DIR)) {
3705
+ if (opts?.prune && existsSync9(SHARED_DIR)) {
3626
3706
  rmSync4(SHARED_DIR, { recursive: true, force: true });
3627
3707
  log(` Embeddings pruned ${SHARED_DIR}`);
3628
3708
  }
@@ -3630,7 +3710,7 @@ function disableEmbeddings(opts) {
3630
3710
  function statusEmbeddings() {
3631
3711
  log(`Shared deps: ${SHARED_DIR}`);
3632
3712
  log(`Installed: ${isSharedDepsInstalled() ? "yes" : "no"}`);
3633
- log(`Daemon: ${existsSync8(SHARED_DAEMON_PATH) ? SHARED_DAEMON_PATH : "(not present)"}`);
3713
+ log(`Daemon: ${existsSync9(SHARED_DAEMON_PATH) ? SHARED_DAEMON_PATH : "(not present)"}`);
3634
3714
  log("");
3635
3715
  log(`Agent installs:`);
3636
3716
  const installs = findHivemindInstalls();
@@ -3661,8 +3741,8 @@ function statusEmbeddings() {
3661
3741
  }
3662
3742
 
3663
3743
  // dist/src/cli/auth.js
3664
- import { existsSync as existsSync9 } from "node:fs";
3665
- import { join as join11 } from "node:path";
3744
+ import { existsSync as existsSync10 } from "node:fs";
3745
+ import { join as join12 } from "node:path";
3666
3746
 
3667
3747
  // dist/src/commands/auth.js
3668
3748
  import { execSync } from "node:child_process";
@@ -3677,25 +3757,25 @@ function deeplakeClientHeader() {
3677
3757
  }
3678
3758
 
3679
3759
  // dist/src/commands/auth-creds.js
3680
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync2, unlinkSync as unlinkSync6 } from "node:fs";
3681
- import { join as join10 } from "node:path";
3682
- import { homedir as homedir2 } from "node:os";
3760
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync2, unlinkSync as unlinkSync6 } from "node:fs";
3761
+ import { join as join11 } from "node:path";
3762
+ import { homedir as homedir3 } from "node:os";
3683
3763
  function configDir() {
3684
- return join10(homedir2(), ".deeplake");
3764
+ return join11(homedir3(), ".deeplake");
3685
3765
  }
3686
3766
  function credsPath() {
3687
- return join10(configDir(), "credentials.json");
3767
+ return join11(configDir(), "credentials.json");
3688
3768
  }
3689
3769
  function loadCredentials() {
3690
3770
  try {
3691
- return JSON.parse(readFileSync6(credsPath(), "utf-8"));
3771
+ return JSON.parse(readFileSync7(credsPath(), "utf-8"));
3692
3772
  } catch {
3693
3773
  return null;
3694
3774
  }
3695
3775
  }
3696
3776
  function saveCredentials(creds) {
3697
3777
  mkdirSync2(configDir(), { recursive: true, mode: 448 });
3698
- writeFileSync4(credsPath(), JSON.stringify({ ...creds, savedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2), { mode: 384 });
3778
+ writeFileSync5(credsPath(), JSON.stringify({ ...creds, savedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2), { mode: 384 });
3699
3779
  }
3700
3780
  function deleteCredentials() {
3701
3781
  try {
@@ -3884,9 +3964,9 @@ Using: ${orgName}
3884
3964
  }
3885
3965
 
3886
3966
  // dist/src/cli/auth.js
3887
- var CREDS_PATH = join11(HOME, ".deeplake", "credentials.json");
3967
+ var CREDS_PATH = join12(HOME, ".deeplake", "credentials.json");
3888
3968
  function isLoggedIn() {
3889
- return existsSync9(CREDS_PATH) && loadCredentials() !== null;
3969
+ return existsSync10(CREDS_PATH) && loadCredentials() !== null;
3890
3970
  }
3891
3971
  async function ensureLoggedIn() {
3892
3972
  if (isLoggedIn())
@@ -3919,16 +3999,16 @@ async function maybeShowOrgChoice() {
3919
3999
  }
3920
4000
 
3921
4001
  // dist/src/config.js
3922
- import { readFileSync as readFileSync7, existsSync as existsSync10 } from "node:fs";
3923
- import { join as join12 } from "node:path";
3924
- import { homedir as homedir3, userInfo } from "node:os";
4002
+ import { readFileSync as readFileSync8, existsSync as existsSync11 } from "node:fs";
4003
+ import { join as join13 } from "node:path";
4004
+ import { homedir as homedir4, userInfo } from "node:os";
3925
4005
  function loadConfig() {
3926
- const home = homedir3();
3927
- const credPath = join12(home, ".deeplake", "credentials.json");
4006
+ const home = homedir4();
4007
+ const credPath = join13(home, ".deeplake", "credentials.json");
3928
4008
  let creds = null;
3929
- if (existsSync10(credPath)) {
4009
+ if (existsSync11(credPath)) {
3930
4010
  try {
3931
- creds = JSON.parse(readFileSync7(credPath, "utf-8"));
4011
+ creds = JSON.parse(readFileSync8(credPath, "utf-8"));
3932
4012
  } catch {
3933
4013
  return null;
3934
4014
  }
@@ -3947,7 +4027,7 @@ function loadConfig() {
3947
4027
  tableName: process.env.HIVEMIND_TABLE ?? "memory",
3948
4028
  sessionsTableName: process.env.HIVEMIND_SESSIONS_TABLE ?? "sessions",
3949
4029
  skillsTableName: process.env.HIVEMIND_SKILLS_TABLE ?? "skills",
3950
- memoryPath: process.env.HIVEMIND_MEMORY_PATH ?? join12(home, ".deeplake", "memory")
4030
+ memoryPath: process.env.HIVEMIND_MEMORY_PATH ?? join13(home, ".deeplake", "memory")
3951
4031
  };
3952
4032
  }
3953
4033
 
@@ -3956,10 +4036,10 @@ import { randomUUID } from "node:crypto";
3956
4036
 
3957
4037
  // dist/src/utils/debug.js
3958
4038
  import { appendFileSync } from "node:fs";
3959
- import { join as join13 } from "node:path";
3960
- import { homedir as homedir4 } from "node:os";
4039
+ import { join as join14 } from "node:path";
4040
+ import { homedir as homedir5 } from "node:os";
3961
4041
  var DEBUG = process.env.HIVEMIND_DEBUG === "1";
3962
- var LOG = join13(homedir4(), ".deeplake", "hook-debug.log");
4042
+ var LOG = join14(homedir5(), ".deeplake", "hook-debug.log");
3963
4043
  function log2(tag, msg) {
3964
4044
  if (!DEBUG)
3965
4045
  return;
@@ -4721,31 +4801,31 @@ if (process.argv[1] && process.argv[1].endsWith("auth-login.js")) {
4721
4801
  }
4722
4802
 
4723
4803
  // dist/src/commands/skillify.js
4724
- import { readdirSync as readdirSync4, existsSync as existsSync19, readFileSync as readFileSync13, mkdirSync as mkdirSync8, renameSync as renameSync4 } from "node:fs";
4725
- import { homedir as homedir12 } from "node:os";
4726
- import { dirname as dirname4, join as join22 } from "node:path";
4804
+ import { readdirSync as readdirSync4, existsSync as existsSync20, readFileSync as readFileSync14, mkdirSync as mkdirSync8, renameSync as renameSync4 } from "node:fs";
4805
+ import { homedir as homedir13 } from "node:os";
4806
+ import { dirname as dirname4, join as join23 } from "node:path";
4727
4807
 
4728
4808
  // dist/src/skillify/scope-config.js
4729
- import { existsSync as existsSync13, mkdirSync as mkdirSync4, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "node:fs";
4730
- import { homedir as homedir6 } from "node:os";
4731
- import { join as join16 } from "node:path";
4809
+ import { existsSync as existsSync14, mkdirSync as mkdirSync4, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "node:fs";
4810
+ import { homedir as homedir7 } from "node:os";
4811
+ import { join as join17 } from "node:path";
4732
4812
 
4733
4813
  // dist/src/skillify/legacy-migration.js
4734
- import { existsSync as existsSync12, renameSync } from "node:fs";
4735
- import { homedir as homedir5 } from "node:os";
4736
- import { join as join15 } from "node:path";
4814
+ import { existsSync as existsSync13, renameSync } from "node:fs";
4815
+ import { homedir as homedir6 } from "node:os";
4816
+ import { join as join16 } from "node:path";
4737
4817
  var dlog = (msg) => log2("skillify-migrate", msg);
4738
4818
  var attempted = false;
4739
4819
  function migrateLegacyStateDir() {
4740
4820
  if (attempted)
4741
4821
  return;
4742
4822
  attempted = true;
4743
- const root = join15(homedir5(), ".deeplake", "state");
4744
- const legacy = join15(root, "skilify");
4745
- const current = join15(root, "skillify");
4746
- if (!existsSync12(legacy))
4823
+ const root = join16(homedir6(), ".deeplake", "state");
4824
+ const legacy = join16(root, "skilify");
4825
+ const current = join16(root, "skillify");
4826
+ if (!existsSync13(legacy))
4747
4827
  return;
4748
- if (existsSync12(current))
4828
+ if (existsSync13(current))
4749
4829
  return;
4750
4830
  try {
4751
4831
  renameSync(legacy, current);
@@ -4761,16 +4841,16 @@ function migrateLegacyStateDir() {
4761
4841
  }
4762
4842
 
4763
4843
  // dist/src/skillify/scope-config.js
4764
- var STATE_DIR = join16(homedir6(), ".deeplake", "state", "skillify");
4765
- var CONFIG_PATH2 = join16(STATE_DIR, "config.json");
4844
+ var STATE_DIR = join17(homedir7(), ".deeplake", "state", "skillify");
4845
+ var CONFIG_PATH2 = join17(STATE_DIR, "config.json");
4766
4846
  var DEFAULT = { scope: "me", team: [], install: "project" };
4767
4847
  function loadScopeConfig() {
4768
4848
  migrateLegacyStateDir();
4769
- if (!existsSync13(CONFIG_PATH2))
4849
+ if (!existsSync14(CONFIG_PATH2))
4770
4850
  return DEFAULT;
4771
4851
  try {
4772
- const raw = JSON.parse(readFileSync9(CONFIG_PATH2, "utf-8"));
4773
- const scope = raw.scope === "team" || raw.scope === "org" ? raw.scope : "me";
4852
+ const raw = JSON.parse(readFileSync10(CONFIG_PATH2, "utf-8"));
4853
+ const scope = raw.scope === "team" ? "team" : raw.scope === "org" ? "team" : "me";
4774
4854
  const team = Array.isArray(raw.team) ? raw.team.filter((s) => typeof s === "string") : [];
4775
4855
  const install = raw.install === "global" ? "global" : "project";
4776
4856
  return { scope, team, install };
@@ -4781,18 +4861,18 @@ function loadScopeConfig() {
4781
4861
  function saveScopeConfig(cfg) {
4782
4862
  migrateLegacyStateDir();
4783
4863
  mkdirSync4(STATE_DIR, { recursive: true });
4784
- writeFileSync6(CONFIG_PATH2, JSON.stringify(cfg, null, 2));
4864
+ writeFileSync7(CONFIG_PATH2, JSON.stringify(cfg, null, 2));
4785
4865
  }
4786
4866
 
4787
4867
  // dist/src/skillify/pull.js
4788
- import { existsSync as existsSync17, readFileSync as readFileSync12, writeFileSync as writeFileSync9, mkdirSync as mkdirSync7, renameSync as renameSync3, lstatSync as lstatSync4, readlinkSync as readlinkSync2, symlinkSync as symlinkSync2, unlinkSync as unlinkSync8 } from "node:fs";
4789
- import { homedir as homedir10 } from "node:os";
4790
- import { dirname as dirname3, join as join20 } from "node:path";
4868
+ import { existsSync as existsSync18, readFileSync as readFileSync13, writeFileSync as writeFileSync10, mkdirSync as mkdirSync7, renameSync as renameSync3, lstatSync as lstatSync4, readlinkSync as readlinkSync2, symlinkSync as symlinkSync2, unlinkSync as unlinkSync8 } from "node:fs";
4869
+ import { homedir as homedir11 } from "node:os";
4870
+ import { dirname as dirname3, join as join21 } from "node:path";
4791
4871
 
4792
4872
  // dist/src/skillify/skill-writer.js
4793
- import { existsSync as existsSync14, mkdirSync as mkdirSync5, readFileSync as readFileSync10, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync7 } from "node:fs";
4794
- import { homedir as homedir7 } from "node:os";
4795
- import { join as join17 } from "node:path";
4873
+ import { existsSync as existsSync15, mkdirSync as mkdirSync5, readFileSync as readFileSync11, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync8 } from "node:fs";
4874
+ import { homedir as homedir8 } from "node:os";
4875
+ import { join as join18 } from "node:path";
4796
4876
  function assertValidSkillName(name) {
4797
4877
  if (typeof name !== "string" || name.length === 0) {
4798
4878
  throw new Error(`invalid skill name: empty or non-string`);
@@ -4816,18 +4896,25 @@ function parseFrontmatter(text) {
4816
4896
  const head = text.slice(4, end).trim();
4817
4897
  const body = text.slice(end + 4).replace(/^\r?\n/, "");
4818
4898
  const fm = { source_sessions: [] };
4819
- let mode = "kv";
4899
+ let arrayKey = null;
4820
4900
  for (const raw of head.split(/\r?\n/)) {
4821
- if (mode === "sources") {
4901
+ if (arrayKey) {
4822
4902
  const m2 = raw.match(/^\s+-\s+(.+)$/);
4823
4903
  if (m2) {
4824
- fm.source_sessions.push(m2[1].trim());
4904
+ const arr = fm[arrayKey] ?? [];
4905
+ arr.push(m2[1].trim());
4906
+ fm[arrayKey] = arr;
4825
4907
  continue;
4826
4908
  }
4827
- mode = "kv";
4909
+ arrayKey = null;
4828
4910
  }
4829
4911
  if (raw.startsWith("source_sessions:")) {
4830
- mode = "sources";
4912
+ arrayKey = "source_sessions";
4913
+ continue;
4914
+ }
4915
+ if (raw.startsWith("contributors:")) {
4916
+ arrayKey = "contributors";
4917
+ fm.contributors = [];
4831
4918
  continue;
4832
4919
  }
4833
4920
  const m = raw.match(/^([a-zA-Z_]+):\s*(.*)$/);
@@ -4851,22 +4938,22 @@ function parseFrontmatter(text) {
4851
4938
  }
4852
4939
 
4853
4940
  // dist/src/skillify/manifest.js
4854
- import { existsSync as existsSync15, lstatSync as lstatSync3, mkdirSync as mkdirSync6, readFileSync as readFileSync11, renameSync as renameSync2, unlinkSync as unlinkSync7, writeFileSync as writeFileSync8 } from "node:fs";
4855
- import { homedir as homedir8 } from "node:os";
4856
- import { dirname as dirname2, join as join18 } from "node:path";
4941
+ import { existsSync as existsSync16, lstatSync as lstatSync3, mkdirSync as mkdirSync6, readFileSync as readFileSync12, renameSync as renameSync2, unlinkSync as unlinkSync7, writeFileSync as writeFileSync9 } from "node:fs";
4942
+ import { homedir as homedir9 } from "node:os";
4943
+ import { dirname as dirname2, join as join19 } from "node:path";
4857
4944
  function emptyManifest() {
4858
4945
  return { version: 1, entries: [] };
4859
4946
  }
4860
4947
  function manifestPath() {
4861
- return join18(homedir8(), ".deeplake", "state", "skillify", "pulled.json");
4948
+ return join19(homedir9(), ".deeplake", "state", "skillify", "pulled.json");
4862
4949
  }
4863
4950
  function loadManifest(path = manifestPath()) {
4864
4951
  migrateLegacyStateDir();
4865
- if (!existsSync15(path))
4952
+ if (!existsSync16(path))
4866
4953
  return emptyManifest();
4867
4954
  let raw;
4868
4955
  try {
4869
- raw = readFileSync11(path, "utf-8");
4956
+ raw = readFileSync12(path, "utf-8");
4870
4957
  } catch {
4871
4958
  return emptyManifest();
4872
4959
  }
@@ -4915,7 +5002,7 @@ function saveManifest(m, path = manifestPath()) {
4915
5002
  migrateLegacyStateDir();
4916
5003
  mkdirSync6(dirname2(path), { recursive: true });
4917
5004
  const tmp = `${path}.tmp`;
4918
- writeFileSync8(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
5005
+ writeFileSync9(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
4919
5006
  renameSync2(tmp, path);
4920
5007
  }
4921
5008
  function recordPull(entry, path = manifestPath()) {
@@ -4958,7 +5045,7 @@ function pruneOrphanedEntries(path = manifestPath()) {
4958
5045
  const live = [];
4959
5046
  let pruned = 0;
4960
5047
  for (const e of m.entries) {
4961
- if (existsSync15(join18(e.installRoot, e.dirName))) {
5048
+ if (existsSync16(join19(e.installRoot, e.dirName))) {
4962
5049
  live.push(e);
4963
5050
  continue;
4964
5051
  }
@@ -4971,26 +5058,26 @@ function pruneOrphanedEntries(path = manifestPath()) {
4971
5058
  }
4972
5059
 
4973
5060
  // dist/src/skillify/agent-roots.js
4974
- import { existsSync as existsSync16 } from "node:fs";
4975
- import { homedir as homedir9 } from "node:os";
4976
- import { join as join19 } from "node:path";
5061
+ import { existsSync as existsSync17 } from "node:fs";
5062
+ import { homedir as homedir10 } from "node:os";
5063
+ import { join as join20 } from "node:path";
4977
5064
  function resolveDetected(home) {
4978
5065
  const out = [];
4979
- const codexInstalled = existsSync16(join19(home, ".codex"));
4980
- const piInstalled = existsSync16(join19(home, ".pi", "agent"));
4981
- const hermesInstalled = existsSync16(join19(home, ".hermes"));
5066
+ const codexInstalled = existsSync17(join20(home, ".codex"));
5067
+ const piInstalled = existsSync17(join20(home, ".pi", "agent"));
5068
+ const hermesInstalled = existsSync17(join20(home, ".hermes"));
4982
5069
  if (codexInstalled || piInstalled) {
4983
- out.push(join19(home, ".agents", "skills"));
5070
+ out.push(join20(home, ".agents", "skills"));
4984
5071
  }
4985
5072
  if (hermesInstalled) {
4986
- out.push(join19(home, ".hermes", "skills"));
5073
+ out.push(join20(home, ".hermes", "skills"));
4987
5074
  }
4988
5075
  if (piInstalled) {
4989
- out.push(join19(home, ".pi", "agent", "skills"));
5076
+ out.push(join20(home, ".pi", "agent", "skills"));
4990
5077
  }
4991
5078
  return out;
4992
5079
  }
4993
- function detectAgentSkillsRoots(canonicalRoot, home = homedir9()) {
5080
+ function detectAgentSkillsRoots(canonicalRoot, home = homedir10()) {
4994
5081
  return resolveDetected(home).filter((p) => p !== canonicalRoot);
4995
5082
  }
4996
5083
 
@@ -5017,24 +5104,32 @@ function buildPullSql(args) {
5017
5104
  where.push(`name = '${esc(args.skillName)}'`);
5018
5105
  }
5019
5106
  const whereClause = where.length > 0 ? ` WHERE ${where.join(" AND ")}` : "";
5020
- 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`;
5107
+ const contributorsCol = args.includeContributors === false ? "" : "contributors, ";
5108
+ 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`;
5109
+ }
5110
+ function isMissingContributorsColumnError(message) {
5111
+ if (!message)
5112
+ return false;
5113
+ return /contributors.*(?:does not exist|not found|unknown)/i.test(message) || /(?:does not exist|unknown column).*contributors/i.test(message);
5021
5114
  }
5022
5115
  function isMissingTableError(message) {
5023
5116
  if (!message)
5024
5117
  return false;
5118
+ if (/\bcolumn\b/i.test(message))
5119
+ return false;
5025
5120
  return /Table does not exist|relation .* does not exist|no such table/i.test(message);
5026
5121
  }
5027
5122
  function resolvePullDestination(install, cwd) {
5028
5123
  if (install === "global")
5029
- return join20(homedir10(), ".claude", "skills");
5124
+ return join21(homedir11(), ".claude", "skills");
5030
5125
  if (!cwd)
5031
5126
  throw new Error("install=project requires a cwd");
5032
- return join20(cwd, ".claude", "skills");
5127
+ return join21(cwd, ".claude", "skills");
5033
5128
  }
5034
5129
  function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
5035
5130
  const out = [];
5036
5131
  for (const root of agentRoots) {
5037
- const link = join20(root, dirName);
5132
+ const link = join21(root, dirName);
5038
5133
  let existing;
5039
5134
  try {
5040
5135
  existing = lstatSync4(link);
@@ -5077,8 +5172,8 @@ function backfillSymlinks(installRoot) {
5077
5172
  return;
5078
5173
  const detected = detectAgentSkillsRoots(installRoot);
5079
5174
  for (const entry of entries) {
5080
- const canonical = join20(entry.installRoot, entry.dirName);
5081
- if (!existsSync17(canonical))
5175
+ const canonical = join21(entry.installRoot, entry.dirName);
5176
+ if (!existsSync18(canonical))
5082
5177
  continue;
5083
5178
  const fresh = fanOutSymlinks(canonical, entry.dirName, detected);
5084
5179
  if (sameSorted(fresh, entry.symlinks))
@@ -5117,11 +5212,16 @@ function selectLatestPerName(rows) {
5117
5212
  }
5118
5213
  function renderSkillFile(row) {
5119
5214
  const sources = parseSourceSessions(row.source_sessions);
5215
+ const author = typeof row.author === "string" && row.author.length > 0 ? row.author : void 0;
5216
+ const contributors = parseContributors(row.contributors);
5217
+ const renderedContributors = contributors.length > 0 ? contributors : author ? [author] : [];
5120
5218
  const fm = {
5121
5219
  name: String(row.name ?? ""),
5122
5220
  description: String(row.description ?? ""),
5123
5221
  trigger: typeof row.trigger_text === "string" && row.trigger_text.length > 0 ? String(row.trigger_text) : void 0,
5222
+ author,
5124
5223
  source_sessions: sources,
5224
+ contributors: renderedContributors,
5125
5225
  version: Number(row.version ?? 1),
5126
5226
  created_by_agent: String(row.source_agent ?? "unknown"),
5127
5227
  created_at: String(row.created_at ?? (/* @__PURE__ */ new Date()).toISOString()),
@@ -5146,15 +5246,35 @@ function parseSourceSessions(v) {
5146
5246
  }
5147
5247
  return [];
5148
5248
  }
5249
+ function parseContributors(v) {
5250
+ if (Array.isArray(v))
5251
+ return v.map(String);
5252
+ if (typeof v === "string") {
5253
+ try {
5254
+ const parsed = JSON.parse(v);
5255
+ if (Array.isArray(parsed))
5256
+ return parsed.map(String);
5257
+ } catch {
5258
+ }
5259
+ }
5260
+ return [];
5261
+ }
5149
5262
  function renderFrontmatter(fm) {
5150
5263
  const lines = ["---"];
5151
5264
  lines.push(`name: ${fm.name}`);
5152
5265
  lines.push(`description: ${JSON.stringify(fm.description)}`);
5153
5266
  if (fm.trigger)
5154
5267
  lines.push(`trigger: ${JSON.stringify(fm.trigger)}`);
5268
+ if (fm.author)
5269
+ lines.push(`author: ${fm.author}`);
5155
5270
  lines.push(`source_sessions:`);
5156
5271
  for (const s of fm.source_sessions)
5157
5272
  lines.push(` - ${s}`);
5273
+ if (fm.contributors && fm.contributors.length > 0) {
5274
+ lines.push(`contributors:`);
5275
+ for (const c of fm.contributors)
5276
+ lines.push(` - ${c}`);
5277
+ }
5158
5278
  lines.push(`version: ${fm.version}`);
5159
5279
  lines.push(`created_by_agent: ${fm.created_by_agent}`);
5160
5280
  lines.push(`created_at: ${fm.created_at}`);
@@ -5163,10 +5283,10 @@ function renderFrontmatter(fm) {
5163
5283
  return lines.join("\n");
5164
5284
  }
5165
5285
  function readLocalVersion(path) {
5166
- if (!existsSync17(path))
5286
+ if (!existsSync18(path))
5167
5287
  return null;
5168
5288
  try {
5169
- const text = readFileSync12(path, "utf-8");
5289
+ const text = readFileSync13(path, "utf-8");
5170
5290
  const parsed = parseFrontmatter(text);
5171
5291
  if (!parsed)
5172
5292
  return null;
@@ -5194,10 +5314,19 @@ async function runPull(opts) {
5194
5314
  try {
5195
5315
  rows = await opts.query(sql);
5196
5316
  } catch (e) {
5197
- if (isMissingTableError(e?.message))
5317
+ if (isMissingTableError(e?.message)) {
5198
5318
  rows = [];
5199
- else
5319
+ } else if (isMissingContributorsColumnError(e?.message)) {
5320
+ const legacySql = buildPullSql({
5321
+ tableName: opts.tableName,
5322
+ users: opts.users,
5323
+ skillName: opts.skillName,
5324
+ includeContributors: false
5325
+ });
5326
+ rows = await opts.query(legacySql);
5327
+ } else {
5200
5328
  throw e;
5329
+ }
5201
5330
  }
5202
5331
  const latest = selectLatestPerName(rows);
5203
5332
  const root = resolvePullDestination(opts.install, opts.cwd);
@@ -5252,8 +5381,8 @@ async function runPull(opts) {
5252
5381
  summary.skipped++;
5253
5382
  continue;
5254
5383
  }
5255
- const skillDir = join20(root, dirName);
5256
- const skillFile = join20(skillDir, "SKILL.md");
5384
+ const skillDir = join21(root, dirName);
5385
+ const skillFile = join21(skillDir, "SKILL.md");
5257
5386
  const remoteVersion = Number(row.version ?? 1);
5258
5387
  const localVersion = readLocalVersion(skillFile);
5259
5388
  const action = decideAction({
@@ -5265,13 +5394,13 @@ async function runPull(opts) {
5265
5394
  let manifestError;
5266
5395
  if (action === "wrote") {
5267
5396
  mkdirSync7(skillDir, { recursive: true });
5268
- if (existsSync17(skillFile)) {
5397
+ if (existsSync18(skillFile)) {
5269
5398
  try {
5270
5399
  renameSync3(skillFile, `${skillFile}.bak`);
5271
5400
  } catch {
5272
5401
  }
5273
5402
  }
5274
- writeFileSync9(skillFile, renderSkillFile(row));
5403
+ writeFileSync10(skillFile, renderSkillFile(row));
5275
5404
  const symlinks = opts.install === "global" ? fanOutSymlinks(skillDir, dirName, detectAgentSkillsRoots(root)) : [];
5276
5405
  try {
5277
5406
  recordPull({
@@ -5313,15 +5442,15 @@ async function runPull(opts) {
5313
5442
  }
5314
5443
 
5315
5444
  // dist/src/skillify/unpull.js
5316
- import { existsSync as existsSync18, readdirSync as readdirSync3, rmSync as rmSync5, statSync as statSync3 } from "node:fs";
5317
- import { homedir as homedir11 } from "node:os";
5318
- import { join as join21 } from "node:path";
5445
+ import { existsSync as existsSync19, readdirSync as readdirSync3, rmSync as rmSync5, statSync as statSync3 } from "node:fs";
5446
+ import { homedir as homedir12 } from "node:os";
5447
+ import { join as join22 } from "node:path";
5319
5448
  function resolveUnpullRoot(install, cwd) {
5320
5449
  if (install === "global")
5321
- return join21(homedir11(), ".claude", "skills");
5450
+ return join22(homedir12(), ".claude", "skills");
5322
5451
  if (!cwd)
5323
5452
  throw new Error("cwd required when install === 'project'");
5324
- return join21(cwd, ".claude", "skills");
5453
+ return join22(cwd, ".claude", "skills");
5325
5454
  }
5326
5455
  function runUnpull(opts) {
5327
5456
  const root = resolveUnpullRoot(opts.install, opts.cwd);
@@ -5344,8 +5473,8 @@ function runUnpull(opts) {
5344
5473
  const entries = entriesForRoot(manifest, opts.install, root);
5345
5474
  for (const entry of entries) {
5346
5475
  summary.scanned++;
5347
- const path = join21(root, entry.dirName);
5348
- if (!existsSync18(path)) {
5476
+ const path = join22(root, entry.dirName);
5477
+ if (!existsSync19(path)) {
5349
5478
  if (!opts.dryRun) {
5350
5479
  unlinkSymlinks(entry.symlinks);
5351
5480
  removePullEntry(opts.install, entry.installRoot, entry.dirName);
@@ -5398,12 +5527,12 @@ function runUnpull(opts) {
5398
5527
  }
5399
5528
  summary.entries.push(result);
5400
5529
  }
5401
- if (existsSync18(root) && (opts.all || opts.legacyCleanup)) {
5530
+ if (existsSync19(root) && (opts.all || opts.legacyCleanup)) {
5402
5531
  const manifestDirNames = new Set(entries.map((e) => e.dirName));
5403
5532
  for (const dirName of readdirSync3(root)) {
5404
5533
  if (manifestDirNames.has(dirName))
5405
5534
  continue;
5406
- const path = join21(root, dirName);
5535
+ const path = join22(root, dirName);
5407
5536
  let st;
5408
5537
  try {
5409
5538
  st = statSync3(path);
@@ -5482,7 +5611,7 @@ function decideTargetForManifestEntry(entry, opts, userFilter, haveUserFilter) {
5482
5611
 
5483
5612
  // dist/src/commands/skillify.js
5484
5613
  function stateDir() {
5485
- return join22(homedir12(), ".deeplake", "state", "skillify");
5614
+ return join23(homedir13(), ".deeplake", "state", "skillify");
5486
5615
  }
5487
5616
  function showStatus() {
5488
5617
  const cfg = loadScopeConfig();
@@ -5490,7 +5619,7 @@ function showStatus() {
5490
5619
  console.log(`team: ${cfg.team.length === 0 ? "(empty)" : cfg.team.join(", ")}`);
5491
5620
  console.log(`install: ${cfg.install} (${cfg.install === "global" ? "~/.claude/skills/" : "<project>/.claude/skills/"})`);
5492
5621
  const dir = stateDir();
5493
- if (!existsSync19(dir)) {
5622
+ if (!existsSync20(dir)) {
5494
5623
  console.log(`state: (no projects tracked yet)`);
5495
5624
  return;
5496
5625
  }
@@ -5502,7 +5631,7 @@ function showStatus() {
5502
5631
  console.log(`state: ${files.length} project(s) tracked`);
5503
5632
  for (const f of files) {
5504
5633
  try {
5505
- const s = JSON.parse(readFileSync13(join22(dir, f), "utf-8"));
5634
+ const s = JSON.parse(readFileSync14(join23(dir, f), "utf-8"));
5506
5635
  const last = typeof s.updatedAt === "number" ? new Date(s.updatedAt).toISOString() : s.lastDate ?? "never";
5507
5636
  const skills = Array.isArray(s.skillsGenerated) && s.skillsGenerated.length > 0 ? s.skillsGenerated.join(", ") : "none";
5508
5637
  console.log(` - ${s.project} (counter=${s.counter}, last=${last}, skills=${skills})`);
@@ -5511,8 +5640,8 @@ function showStatus() {
5511
5640
  }
5512
5641
  }
5513
5642
  function setScope(scope) {
5514
- if (scope !== "me" && scope !== "team" && scope !== "org") {
5515
- console.error(`Invalid scope '${scope}'. Use one of: me, team, org`);
5643
+ if (scope !== "me" && scope !== "team") {
5644
+ console.error(`Invalid scope '${scope}'. Use one of: me, team`);
5516
5645
  process.exit(1);
5517
5646
  }
5518
5647
  const cfg = loadScopeConfig();
@@ -5529,7 +5658,7 @@ function setInstall(loc) {
5529
5658
  }
5530
5659
  const cfg = loadScopeConfig();
5531
5660
  saveScopeConfig({ ...cfg, install: loc });
5532
- const path = loc === "global" ? join22(homedir12(), ".claude", "skills") : "<cwd>/.claude/skills";
5661
+ const path = loc === "global" ? join23(homedir13(), ".claude", "skills") : "<cwd>/.claude/skills";
5533
5662
  console.log(`Install location set to '${loc}'. New skills will be written to ${path}/<name>/SKILL.md.`);
5534
5663
  }
5535
5664
  function promoteSkill(name, cwd) {
@@ -5537,13 +5666,13 @@ function promoteSkill(name, cwd) {
5537
5666
  console.error("Usage: hivemind skillify promote <skill-name>");
5538
5667
  process.exit(1);
5539
5668
  }
5540
- const projectPath = join22(cwd, ".claude", "skills", name);
5541
- const globalPath = join22(homedir12(), ".claude", "skills", name);
5542
- if (!existsSync19(join22(projectPath, "SKILL.md"))) {
5669
+ const projectPath = join23(cwd, ".claude", "skills", name);
5670
+ const globalPath = join23(homedir13(), ".claude", "skills", name);
5671
+ if (!existsSync20(join23(projectPath, "SKILL.md"))) {
5543
5672
  console.error(`Skill '${name}' not found at ${projectPath}/SKILL.md`);
5544
5673
  process.exit(1);
5545
5674
  }
5546
- if (existsSync19(join22(globalPath, "SKILL.md"))) {
5675
+ if (existsSync20(join23(globalPath, "SKILL.md"))) {
5547
5676
  console.error(`Skill '${name}' already exists at ${globalPath}/SKILL.md \u2014 refusing to overwrite. Remove it first or rename the project skill.`);
5548
5677
  process.exit(1);
5549
5678
  }
@@ -5591,7 +5720,7 @@ function teamList() {
5591
5720
  function usage() {
5592
5721
  console.log("Usage:");
5593
5722
  console.log(" hivemind skillify show current scope, team, install, and per-project state");
5594
- console.log(" hivemind skillify scope <me|team|org> set the mining scope");
5723
+ console.log(" hivemind skillify scope <me|team> set the mining scope");
5595
5724
  console.log(" hivemind skillify install <project|global> set where new skills are written");
5596
5725
  console.log(" hivemind skillify promote <skill-name> move a project skill to the global location");
5597
5726
  console.log(" hivemind skillify team add <username> add a username to the team list");
@@ -5678,7 +5807,7 @@ async function pullSkills(args) {
5678
5807
  console.error(`pull failed: ${e?.message ?? e}`);
5679
5808
  process.exit(1);
5680
5809
  }
5681
- const dest = toRaw === "global" ? join22(homedir12(), ".claude", "skills") : `${process.cwd()}/.claude/skills`;
5810
+ const dest = toRaw === "global" ? join23(homedir13(), ".claude", "skills") : `${process.cwd()}/.claude/skills`;
5682
5811
  const filterDesc = users.length === 0 ? "all users" : users.join(", ");
5683
5812
  console.log(`Destination: ${dest}`);
5684
5813
  console.log(`Filter: ${filterDesc}${skillName ? ` \xB7 skill='${skillName}'` : ""}${dryRun ? " \xB7 dry-run" : ""}${force ? " \xB7 force" : ""}`);
@@ -5728,7 +5857,7 @@ async function unpullSkills(args) {
5728
5857
  all,
5729
5858
  legacyCleanup
5730
5859
  });
5731
- const dest = toRaw === "global" ? join22(homedir12(), ".claude", "skills") : `${process.cwd()}/.claude/skills`;
5860
+ const dest = toRaw === "global" ? join23(homedir13(), ".claude", "skills") : `${process.cwd()}/.claude/skills`;
5732
5861
  const filterParts = [];
5733
5862
  if (users.length > 0)
5734
5863
  filterParts.push(`users=${users.join(",")}`);
@@ -5817,13 +5946,13 @@ if (process.argv[1] && process.argv[1].endsWith("skillify.js")) {
5817
5946
 
5818
5947
  // dist/src/cli/update.js
5819
5948
  import { execFileSync as execFileSync4 } from "node:child_process";
5820
- import { existsSync as existsSync20, readFileSync as readFileSync15, realpathSync } from "node:fs";
5949
+ import { existsSync as existsSync21, readFileSync as readFileSync16, realpathSync } from "node:fs";
5821
5950
  import { dirname as dirname6, sep } from "node:path";
5822
5951
  import { fileURLToPath as fileURLToPath2 } from "node:url";
5823
5952
 
5824
5953
  // dist/src/utils/version-check.js
5825
- import { readFileSync as readFileSync14 } from "node:fs";
5826
- import { dirname as dirname5, join as join23 } from "node:path";
5954
+ import { readFileSync as readFileSync15 } from "node:fs";
5955
+ import { dirname as dirname5, join as join24 } from "node:path";
5827
5956
  function isNewer(latest, current) {
5828
5957
  const parse = (v) => v.split(".").map(Number);
5829
5958
  const [la, lb, lc] = parse(latest);
@@ -5847,7 +5976,7 @@ function detectInstallKind(argv1) {
5847
5976
  for (let i = 0; i < 10; i++) {
5848
5977
  const pkgPath = `${dir}${sep}package.json`;
5849
5978
  try {
5850
- const pkg = JSON.parse(readFileSync15(pkgPath, "utf-8"));
5979
+ const pkg = JSON.parse(readFileSync16(pkgPath, "utf-8"));
5851
5980
  if (pkg.name === PKG_NAME || pkg.name === "hivemind") {
5852
5981
  installDir = dir;
5853
5982
  break;
@@ -5868,7 +5997,7 @@ function detectInstallKind(argv1) {
5868
5997
  }
5869
5998
  let gitDir = installDir;
5870
5999
  for (let i = 0; i < 6; i++) {
5871
- if (existsSync20(`${gitDir}${sep}.git`)) {
6000
+ if (existsSync21(`${gitDir}${sep}.git`)) {
5872
6001
  return { kind: "local-dev", installDir };
5873
6002
  }
5874
6003
  const parent = dirname6(gitDir);
@@ -6041,7 +6170,7 @@ Skill management (mine + share reusable Claude skills across the org):
6041
6170
  --to <project|global>, --dry-run,
6042
6171
  --all (also locally-mined),
6043
6172
  --legacy-cleanup (pre-suffix-author dirs).
6044
- hivemind skillify scope <me|team|org> Set the sharing scope for newly mined skills.
6173
+ hivemind skillify scope <me|team> Set the sharing scope for newly mined skills.
6045
6174
  hivemind skillify install <project|global> Set where new skills are written.
6046
6175
  hivemind skillify promote <name> Move a project skill to the global location.
6047
6176
  hivemind skillify team add <username> Add a username to the team list.