@deeplake/hivemind 0.7.32 → 0.7.34
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/bundle/cli.js +332 -189
- package/codex/bundle/capture.js +365 -332
- package/codex/bundle/commands/auth-login.js +163 -30
- package/codex/bundle/pre-tool-use.js +334 -301
- package/codex/bundle/session-start-setup.js +193 -60
- package/codex/bundle/session-start.js +229 -87
- package/codex/bundle/shell/deeplake-shell.js +328 -295
- package/codex/bundle/skillify-worker.js +26 -18
- package/codex/bundle/stop.js +450 -394
- package/codex/bundle/wiki-worker.js +174 -292
- package/cursor/bundle/capture.js +448 -392
- package/cursor/bundle/commands/auth-login.js +163 -30
- package/cursor/bundle/pre-tool-use.js +324 -291
- package/cursor/bundle/session-end.js +43 -20
- package/cursor/bundle/session-start.js +272 -130
- package/cursor/bundle/shell/deeplake-shell.js +328 -295
- package/cursor/bundle/skillify-worker.js +26 -18
- package/cursor/bundle/wiki-worker.js +174 -292
- package/hermes/bundle/capture.js +448 -392
- package/hermes/bundle/commands/auth-login.js +163 -30
- package/hermes/bundle/pre-tool-use.js +324 -291
- package/hermes/bundle/session-end.js +43 -20
- package/hermes/bundle/session-start.js +269 -127
- package/hermes/bundle/shell/deeplake-shell.js +328 -295
- package/hermes/bundle/skillify-worker.js +26 -18
- package/hermes/bundle/wiki-worker.js +174 -292
- package/mcp/bundle/server.js +190 -57
- package/openclaw/dist/index.js +160 -32
- package/openclaw/dist/skillify-worker.js +26 -18
- package/openclaw/openclaw.plugin.json +1 -1
- package/openclaw/package.json +1 -1
- package/package.json +1 -1
|
@@ -405,25 +405,34 @@ function spawnSkillifyWorker(opts) {
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
// dist/src/skillify/state.js
|
|
408
|
-
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";
|
|
408
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, writeSync as writeSync2, mkdirSync as mkdirSync5, renameSync as renameSync3, rmdirSync, existsSync as existsSync5, lstatSync, unlinkSync as unlinkSync2, openSync as openSync2, closeSync as closeSync2 } from "node:fs";
|
|
409
409
|
import { execSync as execSync2 } from "node:child_process";
|
|
410
|
-
import { homedir as homedir8 } from "node:os";
|
|
411
410
|
import { createHash } from "node:crypto";
|
|
412
|
-
import { join as
|
|
411
|
+
import { join as join11, basename } from "node:path";
|
|
413
412
|
|
|
414
413
|
// dist/src/skillify/legacy-migration.js
|
|
415
414
|
import { existsSync as existsSync4, renameSync as renameSync2 } from "node:fs";
|
|
415
|
+
import { dirname as dirname4, join as join10 } from "node:path";
|
|
416
|
+
|
|
417
|
+
// dist/src/skillify/state-dir.js
|
|
416
418
|
import { homedir as homedir7 } from "node:os";
|
|
417
419
|
import { join as join9 } from "node:path";
|
|
420
|
+
function getStateDir() {
|
|
421
|
+
const override = process.env.HIVEMIND_STATE_DIR?.trim();
|
|
422
|
+
return override && override.length > 0 ? override : join9(homedir7(), ".deeplake", "state", "skillify");
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// dist/src/skillify/legacy-migration.js
|
|
418
426
|
var dlog2 = (msg) => log("skillify-migrate", msg);
|
|
419
427
|
var attempted = false;
|
|
420
428
|
function migrateLegacyStateDir() {
|
|
429
|
+
if (process.env.HIVEMIND_STATE_DIR?.trim())
|
|
430
|
+
return;
|
|
421
431
|
if (attempted)
|
|
422
432
|
return;
|
|
423
433
|
attempted = true;
|
|
424
|
-
const
|
|
425
|
-
const legacy =
|
|
426
|
-
const current = join9(root, "skillify");
|
|
434
|
+
const current = getStateDir();
|
|
435
|
+
const legacy = join10(dirname4(current), "skilify");
|
|
427
436
|
if (!existsSync4(legacy))
|
|
428
437
|
return;
|
|
429
438
|
if (existsSync4(current))
|
|
@@ -433,8 +442,8 @@ function migrateLegacyStateDir() {
|
|
|
433
442
|
dlog2(`migrated ${legacy} -> ${current}`);
|
|
434
443
|
} catch (err) {
|
|
435
444
|
const code = err.code;
|
|
436
|
-
if (code === "EXDEV" || code === "EPERM") {
|
|
437
|
-
dlog2(`migration
|
|
445
|
+
if (code === "EXDEV" || code === "EPERM" || code === "ENOENT" || code === "EEXIST" || code === "ENOTEMPTY") {
|
|
446
|
+
dlog2(`migration skipped (${code}); legacy dir left as-is or another process handled it`);
|
|
438
447
|
return;
|
|
439
448
|
}
|
|
440
449
|
throw err;
|
|
@@ -443,17 +452,16 @@ function migrateLegacyStateDir() {
|
|
|
443
452
|
|
|
444
453
|
// dist/src/skillify/state.js
|
|
445
454
|
var dlog3 = (msg) => log("skillify-state", msg);
|
|
446
|
-
var STATE_DIR2 = join10(homedir8(), ".deeplake", "state", "skillify");
|
|
447
455
|
var YIELD_BUF2 = new Int32Array(new SharedArrayBuffer(4));
|
|
448
456
|
var TRIGGER_THRESHOLD = (() => {
|
|
449
457
|
const n = Number(process.env.HIVEMIND_SKILLIFY_EVERY_N_TURNS ?? "");
|
|
450
458
|
return Number.isInteger(n) && n > 0 ? n : 20;
|
|
451
459
|
})();
|
|
452
460
|
function statePath(projectKey) {
|
|
453
|
-
return
|
|
461
|
+
return join11(getStateDir(), `${projectKey}.json`);
|
|
454
462
|
}
|
|
455
463
|
function lockPath2(projectKey) {
|
|
456
|
-
return
|
|
464
|
+
return join11(getStateDir(), `${projectKey}.lock`);
|
|
457
465
|
}
|
|
458
466
|
var DEFAULT_PORTS = {
|
|
459
467
|
http: "80",
|
|
@@ -509,7 +517,7 @@ function readState(projectKey) {
|
|
|
509
517
|
}
|
|
510
518
|
function writeState(projectKey, state) {
|
|
511
519
|
migrateLegacyStateDir();
|
|
512
|
-
mkdirSync5(
|
|
520
|
+
mkdirSync5(getStateDir(), { recursive: true });
|
|
513
521
|
const p = statePath(projectKey);
|
|
514
522
|
const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
|
|
515
523
|
writeFileSync4(tmp, JSON.stringify(state, null, 2));
|
|
@@ -517,7 +525,7 @@ function writeState(projectKey, state) {
|
|
|
517
525
|
}
|
|
518
526
|
function withRmwLock(projectKey, fn) {
|
|
519
527
|
migrateLegacyStateDir();
|
|
520
|
-
mkdirSync5(
|
|
528
|
+
mkdirSync5(getStateDir(), { recursive: true });
|
|
521
529
|
const rmw = lockPath2(projectKey) + ".rmw";
|
|
522
530
|
const deadline = Date.now() + 2e3;
|
|
523
531
|
let fd = null;
|
|
@@ -560,7 +568,7 @@ function resetCounter(projectKey) {
|
|
|
560
568
|
}
|
|
561
569
|
function tryAcquireWorkerLock(projectKey, maxAgeMs = 10 * 60 * 1e3) {
|
|
562
570
|
migrateLegacyStateDir();
|
|
563
|
-
mkdirSync5(
|
|
571
|
+
mkdirSync5(getStateDir(), { recursive: true });
|
|
564
572
|
const p = lockPath2(projectKey);
|
|
565
573
|
if (existsSync5(p)) {
|
|
566
574
|
try {
|
|
@@ -573,8 +581,22 @@ function tryAcquireWorkerLock(projectKey, maxAgeMs = 10 * 60 * 1e3) {
|
|
|
573
581
|
try {
|
|
574
582
|
unlinkSync2(p);
|
|
575
583
|
} catch (unlinkErr) {
|
|
576
|
-
|
|
577
|
-
|
|
584
|
+
if (unlinkErr?.code !== "EISDIR" && unlinkErr?.code !== "EPERM" && unlinkErr?.code !== "ENOENT") {
|
|
585
|
+
dlog3(`could not unlink stale worker lock for ${projectKey}: ${unlinkErr.message}`);
|
|
586
|
+
return false;
|
|
587
|
+
}
|
|
588
|
+
let isDir = false;
|
|
589
|
+
try {
|
|
590
|
+
isDir = lstatSync(p).isDirectory();
|
|
591
|
+
} catch {
|
|
592
|
+
}
|
|
593
|
+
if (isDir) {
|
|
594
|
+
try {
|
|
595
|
+
rmdirSync(p);
|
|
596
|
+
} catch (rmErr) {
|
|
597
|
+
dlog3(`rmdir stale lock skipped for ${projectKey}: ${rmErr.message}`);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
578
600
|
}
|
|
579
601
|
}
|
|
580
602
|
try {
|
|
@@ -599,13 +621,14 @@ function releaseWorkerLock(projectKey) {
|
|
|
599
621
|
|
|
600
622
|
// dist/src/skillify/scope-config.js
|
|
601
623
|
import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
|
|
602
|
-
import {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
624
|
+
import { join as join12 } from "node:path";
|
|
625
|
+
function configPath() {
|
|
626
|
+
return join12(getStateDir(), "config.json");
|
|
627
|
+
}
|
|
606
628
|
var DEFAULT = { scope: "me", team: [], install: "project" };
|
|
607
629
|
function loadScopeConfig() {
|
|
608
630
|
migrateLegacyStateDir();
|
|
631
|
+
const CONFIG_PATH = configPath();
|
|
609
632
|
if (!existsSync6(CONFIG_PATH))
|
|
610
633
|
return DEFAULT;
|
|
611
634
|
try {
|