@deeplake/hivemind 0.7.33 → 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 +126 -116
- package/codex/bundle/session-start.js +40 -31
- package/codex/bundle/skillify-worker.js +26 -18
- package/codex/bundle/stop.js +61 -38
- package/cursor/bundle/capture.js +46 -23
- package/cursor/bundle/session-end.js +43 -20
- package/cursor/bundle/session-start.js +39 -30
- package/cursor/bundle/skillify-worker.js +26 -18
- package/hermes/bundle/capture.js +46 -23
- package/hermes/bundle/session-end.js +43 -20
- package/hermes/bundle/session-start.js +39 -30
- package/hermes/bundle/skillify-worker.js +26 -18
- package/openclaw/dist/index.js +1 -1
- 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
package/hermes/bundle/capture.js
CHANGED
|
@@ -1300,7 +1300,7 @@ function createSymlinkAtomic(target, link) {
|
|
|
1300
1300
|
|
|
1301
1301
|
// dist/src/hooks/hermes/capture.js
|
|
1302
1302
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
1303
|
-
import { dirname as
|
|
1303
|
+
import { dirname as dirname7, join as join20 } from "node:path";
|
|
1304
1304
|
|
|
1305
1305
|
// dist/src/hooks/summary-state.js
|
|
1306
1306
|
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, writeSync as writeSync2, mkdirSync as mkdirSync6, renameSync as renameSync4, existsSync as existsSync6, unlinkSync as unlinkSync4, openSync as openSync3, closeSync as closeSync3 } from "node:fs";
|
|
@@ -1732,25 +1732,34 @@ function spawnSkillifyWorker(opts) {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
|
|
1734
1734
|
// dist/src/skillify/state.js
|
|
1735
|
-
import { readFileSync as readFileSync9, writeFileSync as writeFileSync8, writeSync as writeSync3, mkdirSync as mkdirSync10, renameSync as renameSync6, existsSync as existsSync9, unlinkSync as unlinkSync5, openSync as openSync4, closeSync as closeSync4 } from "node:fs";
|
|
1735
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync8, writeSync as writeSync3, mkdirSync as mkdirSync10, renameSync as renameSync6, rmdirSync, existsSync as existsSync9, lstatSync as lstatSync2, unlinkSync as unlinkSync5, openSync as openSync4, closeSync as closeSync4 } from "node:fs";
|
|
1736
1736
|
import { execSync as execSync2 } from "node:child_process";
|
|
1737
|
-
import { homedir as homedir14 } from "node:os";
|
|
1738
1737
|
import { createHash } from "node:crypto";
|
|
1739
|
-
import { join as
|
|
1738
|
+
import { join as join18, basename as basename2 } from "node:path";
|
|
1740
1739
|
|
|
1741
1740
|
// dist/src/skillify/legacy-migration.js
|
|
1742
1741
|
import { existsSync as existsSync8, renameSync as renameSync5 } from "node:fs";
|
|
1742
|
+
import { dirname as dirname6, join as join17 } from "node:path";
|
|
1743
|
+
|
|
1744
|
+
// dist/src/skillify/state-dir.js
|
|
1743
1745
|
import { homedir as homedir13 } from "node:os";
|
|
1744
1746
|
import { join as join16 } from "node:path";
|
|
1747
|
+
function getStateDir() {
|
|
1748
|
+
const override = process.env.HIVEMIND_STATE_DIR?.trim();
|
|
1749
|
+
return override && override.length > 0 ? override : join16(homedir13(), ".deeplake", "state", "skillify");
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
// dist/src/skillify/legacy-migration.js
|
|
1745
1753
|
var dlog2 = (msg) => log("skillify-migrate", msg);
|
|
1746
1754
|
var attempted = false;
|
|
1747
1755
|
function migrateLegacyStateDir() {
|
|
1756
|
+
if (process.env.HIVEMIND_STATE_DIR?.trim())
|
|
1757
|
+
return;
|
|
1748
1758
|
if (attempted)
|
|
1749
1759
|
return;
|
|
1750
1760
|
attempted = true;
|
|
1751
|
-
const
|
|
1752
|
-
const legacy =
|
|
1753
|
-
const current = join16(root, "skillify");
|
|
1761
|
+
const current = getStateDir();
|
|
1762
|
+
const legacy = join17(dirname6(current), "skilify");
|
|
1754
1763
|
if (!existsSync8(legacy))
|
|
1755
1764
|
return;
|
|
1756
1765
|
if (existsSync8(current))
|
|
@@ -1760,8 +1769,8 @@ function migrateLegacyStateDir() {
|
|
|
1760
1769
|
dlog2(`migrated ${legacy} -> ${current}`);
|
|
1761
1770
|
} catch (err) {
|
|
1762
1771
|
const code = err.code;
|
|
1763
|
-
if (code === "EXDEV" || code === "EPERM") {
|
|
1764
|
-
dlog2(`migration
|
|
1772
|
+
if (code === "EXDEV" || code === "EPERM" || code === "ENOENT" || code === "EEXIST" || code === "ENOTEMPTY") {
|
|
1773
|
+
dlog2(`migration skipped (${code}); legacy dir left as-is or another process handled it`);
|
|
1765
1774
|
return;
|
|
1766
1775
|
}
|
|
1767
1776
|
throw err;
|
|
@@ -1770,17 +1779,16 @@ function migrateLegacyStateDir() {
|
|
|
1770
1779
|
|
|
1771
1780
|
// dist/src/skillify/state.js
|
|
1772
1781
|
var dlog3 = (msg) => log("skillify-state", msg);
|
|
1773
|
-
var STATE_DIR2 = join17(homedir14(), ".deeplake", "state", "skillify");
|
|
1774
1782
|
var YIELD_BUF2 = new Int32Array(new SharedArrayBuffer(4));
|
|
1775
1783
|
var TRIGGER_THRESHOLD = (() => {
|
|
1776
1784
|
const n = Number(process.env.HIVEMIND_SKILLIFY_EVERY_N_TURNS ?? "");
|
|
1777
1785
|
return Number.isInteger(n) && n > 0 ? n : 20;
|
|
1778
1786
|
})();
|
|
1779
1787
|
function statePath2(projectKey) {
|
|
1780
|
-
return
|
|
1788
|
+
return join18(getStateDir(), `${projectKey}.json`);
|
|
1781
1789
|
}
|
|
1782
1790
|
function lockPath3(projectKey) {
|
|
1783
|
-
return
|
|
1791
|
+
return join18(getStateDir(), `${projectKey}.lock`);
|
|
1784
1792
|
}
|
|
1785
1793
|
var DEFAULT_PORTS = {
|
|
1786
1794
|
http: "80",
|
|
@@ -1836,7 +1844,7 @@ function readState2(projectKey) {
|
|
|
1836
1844
|
}
|
|
1837
1845
|
function writeState2(projectKey, state) {
|
|
1838
1846
|
migrateLegacyStateDir();
|
|
1839
|
-
mkdirSync10(
|
|
1847
|
+
mkdirSync10(getStateDir(), { recursive: true });
|
|
1840
1848
|
const p = statePath2(projectKey);
|
|
1841
1849
|
const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
|
|
1842
1850
|
writeFileSync8(tmp, JSON.stringify(state, null, 2));
|
|
@@ -1844,7 +1852,7 @@ function writeState2(projectKey, state) {
|
|
|
1844
1852
|
}
|
|
1845
1853
|
function withRmwLock2(projectKey, fn) {
|
|
1846
1854
|
migrateLegacyStateDir();
|
|
1847
|
-
mkdirSync10(
|
|
1855
|
+
mkdirSync10(getStateDir(), { recursive: true });
|
|
1848
1856
|
const rmw = lockPath3(projectKey) + ".rmw";
|
|
1849
1857
|
const deadline = Date.now() + 2e3;
|
|
1850
1858
|
let fd = null;
|
|
@@ -1904,7 +1912,7 @@ function resetCounter(projectKey) {
|
|
|
1904
1912
|
}
|
|
1905
1913
|
function tryAcquireWorkerLock(projectKey, maxAgeMs = 10 * 60 * 1e3) {
|
|
1906
1914
|
migrateLegacyStateDir();
|
|
1907
|
-
mkdirSync10(
|
|
1915
|
+
mkdirSync10(getStateDir(), { recursive: true });
|
|
1908
1916
|
const p = lockPath3(projectKey);
|
|
1909
1917
|
if (existsSync9(p)) {
|
|
1910
1918
|
try {
|
|
@@ -1917,8 +1925,22 @@ function tryAcquireWorkerLock(projectKey, maxAgeMs = 10 * 60 * 1e3) {
|
|
|
1917
1925
|
try {
|
|
1918
1926
|
unlinkSync5(p);
|
|
1919
1927
|
} catch (unlinkErr) {
|
|
1920
|
-
|
|
1921
|
-
|
|
1928
|
+
if (unlinkErr?.code !== "EISDIR" && unlinkErr?.code !== "EPERM" && unlinkErr?.code !== "ENOENT") {
|
|
1929
|
+
dlog3(`could not unlink stale worker lock for ${projectKey}: ${unlinkErr.message}`);
|
|
1930
|
+
return false;
|
|
1931
|
+
}
|
|
1932
|
+
let isDir = false;
|
|
1933
|
+
try {
|
|
1934
|
+
isDir = lstatSync2(p).isDirectory();
|
|
1935
|
+
} catch {
|
|
1936
|
+
}
|
|
1937
|
+
if (isDir) {
|
|
1938
|
+
try {
|
|
1939
|
+
rmdirSync(p);
|
|
1940
|
+
} catch (rmErr) {
|
|
1941
|
+
dlog3(`rmdir stale lock skipped for ${projectKey}: ${rmErr.message}`);
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1922
1944
|
}
|
|
1923
1945
|
}
|
|
1924
1946
|
try {
|
|
@@ -1943,13 +1965,14 @@ function releaseWorkerLock(projectKey) {
|
|
|
1943
1965
|
|
|
1944
1966
|
// dist/src/skillify/scope-config.js
|
|
1945
1967
|
import { existsSync as existsSync10, mkdirSync as mkdirSync11, readFileSync as readFileSync10, writeFileSync as writeFileSync9 } from "node:fs";
|
|
1946
|
-
import {
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1968
|
+
import { join as join19 } from "node:path";
|
|
1969
|
+
function configPath() {
|
|
1970
|
+
return join19(getStateDir(), "config.json");
|
|
1971
|
+
}
|
|
1950
1972
|
var DEFAULT = { scope: "me", team: [], install: "project" };
|
|
1951
1973
|
function loadScopeConfig() {
|
|
1952
1974
|
migrateLegacyStateDir();
|
|
1975
|
+
const CONFIG_PATH = configPath();
|
|
1953
1976
|
if (!existsSync10(CONFIG_PATH))
|
|
1954
1977
|
return DEFAULT;
|
|
1955
1978
|
try {
|
|
@@ -2006,9 +2029,9 @@ function tryStopCounterTrigger(opts) {
|
|
|
2006
2029
|
// dist/src/hooks/hermes/capture.js
|
|
2007
2030
|
var log5 = (msg) => log("hermes-capture", msg);
|
|
2008
2031
|
function resolveEmbedDaemonPath() {
|
|
2009
|
-
return
|
|
2032
|
+
return join20(dirname7(fileURLToPath3(import.meta.url)), "embeddings", "embed-daemon.js");
|
|
2010
2033
|
}
|
|
2011
|
-
var __bundleDir =
|
|
2034
|
+
var __bundleDir = dirname7(fileURLToPath3(import.meta.url));
|
|
2012
2035
|
var PLUGIN_VERSION = getInstalledVersion(__bundleDir, ".claude-plugin") ?? "";
|
|
2013
2036
|
if (!embeddingsDisabled()) {
|
|
2014
2037
|
try {
|
|
@@ -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 {
|
|
@@ -53,7 +53,7 @@ var init_index_marker_store = __esm({
|
|
|
53
53
|
|
|
54
54
|
// dist/src/hooks/hermes/session-start.js
|
|
55
55
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
56
|
-
import { dirname as
|
|
56
|
+
import { dirname as dirname7 } from "node:path";
|
|
57
57
|
|
|
58
58
|
// dist/src/commands/auth.js
|
|
59
59
|
import { execSync } from "node:child_process";
|
|
@@ -968,8 +968,8 @@ async function autoUpdate(creds, opts) {
|
|
|
968
968
|
|
|
969
969
|
// dist/src/skillify/pull.js
|
|
970
970
|
import { existsSync as existsSync10, readFileSync as readFileSync9, writeFileSync as writeFileSync7, mkdirSync as mkdirSync8, renameSync as renameSync4, lstatSync as lstatSync2, readlinkSync, symlinkSync, unlinkSync as unlinkSync5 } from "node:fs";
|
|
971
|
-
import { homedir as
|
|
972
|
-
import { dirname as
|
|
971
|
+
import { homedir as homedir10 } from "node:os";
|
|
972
|
+
import { dirname as dirname6, join as join15 } from "node:path";
|
|
973
973
|
|
|
974
974
|
// dist/src/skillify/skill-writer.js
|
|
975
975
|
import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync7, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
@@ -1041,22 +1041,31 @@ function parseFrontmatter(text) {
|
|
|
1041
1041
|
|
|
1042
1042
|
// dist/src/skillify/manifest.js
|
|
1043
1043
|
import { existsSync as existsSync8, lstatSync, mkdirSync as mkdirSync7, readFileSync as readFileSync8, renameSync as renameSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync6 } from "node:fs";
|
|
1044
|
-
import {
|
|
1045
|
-
import { dirname as dirname4, join as join12 } from "node:path";
|
|
1044
|
+
import { dirname as dirname5, join as join13 } from "node:path";
|
|
1046
1045
|
|
|
1047
1046
|
// dist/src/skillify/legacy-migration.js
|
|
1048
1047
|
import { existsSync as existsSync7, renameSync as renameSync2 } from "node:fs";
|
|
1048
|
+
import { dirname as dirname4, join as join12 } from "node:path";
|
|
1049
|
+
|
|
1050
|
+
// dist/src/skillify/state-dir.js
|
|
1049
1051
|
import { homedir as homedir8 } from "node:os";
|
|
1050
1052
|
import { join as join11 } from "node:path";
|
|
1053
|
+
function getStateDir() {
|
|
1054
|
+
const override = process.env.HIVEMIND_STATE_DIR?.trim();
|
|
1055
|
+
return override && override.length > 0 ? override : join11(homedir8(), ".deeplake", "state", "skillify");
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
// dist/src/skillify/legacy-migration.js
|
|
1051
1059
|
var dlog = (msg) => log("skillify-migrate", msg);
|
|
1052
1060
|
var attempted = false;
|
|
1053
1061
|
function migrateLegacyStateDir() {
|
|
1062
|
+
if (process.env.HIVEMIND_STATE_DIR?.trim())
|
|
1063
|
+
return;
|
|
1054
1064
|
if (attempted)
|
|
1055
1065
|
return;
|
|
1056
1066
|
attempted = true;
|
|
1057
|
-
const
|
|
1058
|
-
const legacy =
|
|
1059
|
-
const current = join11(root, "skillify");
|
|
1067
|
+
const current = getStateDir();
|
|
1068
|
+
const legacy = join12(dirname4(current), "skilify");
|
|
1060
1069
|
if (!existsSync7(legacy))
|
|
1061
1070
|
return;
|
|
1062
1071
|
if (existsSync7(current))
|
|
@@ -1066,8 +1075,8 @@ function migrateLegacyStateDir() {
|
|
|
1066
1075
|
dlog(`migrated ${legacy} -> ${current}`);
|
|
1067
1076
|
} catch (err) {
|
|
1068
1077
|
const code = err.code;
|
|
1069
|
-
if (code === "EXDEV" || code === "EPERM") {
|
|
1070
|
-
dlog(`migration
|
|
1078
|
+
if (code === "EXDEV" || code === "EPERM" || code === "ENOENT" || code === "EEXIST" || code === "ENOTEMPTY") {
|
|
1079
|
+
dlog(`migration skipped (${code}); legacy dir left as-is or another process handled it`);
|
|
1071
1080
|
return;
|
|
1072
1081
|
}
|
|
1073
1082
|
throw err;
|
|
@@ -1079,7 +1088,7 @@ function emptyManifest() {
|
|
|
1079
1088
|
return { version: 1, entries: [] };
|
|
1080
1089
|
}
|
|
1081
1090
|
function manifestPath() {
|
|
1082
|
-
return
|
|
1091
|
+
return join13(getStateDir(), "pulled.json");
|
|
1083
1092
|
}
|
|
1084
1093
|
function loadManifest(path = manifestPath()) {
|
|
1085
1094
|
migrateLegacyStateDir();
|
|
@@ -1134,7 +1143,7 @@ function loadManifest(path = manifestPath()) {
|
|
|
1134
1143
|
}
|
|
1135
1144
|
function saveManifest(m, path = manifestPath()) {
|
|
1136
1145
|
migrateLegacyStateDir();
|
|
1137
|
-
mkdirSync7(
|
|
1146
|
+
mkdirSync7(dirname5(path), { recursive: true });
|
|
1138
1147
|
const tmp = `${path}.tmp`;
|
|
1139
1148
|
writeFileSync6(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
|
|
1140
1149
|
renameSync3(tmp, path);
|
|
@@ -1172,7 +1181,7 @@ function pruneOrphanedEntries(path = manifestPath()) {
|
|
|
1172
1181
|
const live = [];
|
|
1173
1182
|
let pruned = 0;
|
|
1174
1183
|
for (const e of m.entries) {
|
|
1175
|
-
if (existsSync8(
|
|
1184
|
+
if (existsSync8(join13(e.installRoot, e.dirName))) {
|
|
1176
1185
|
live.push(e);
|
|
1177
1186
|
continue;
|
|
1178
1187
|
}
|
|
@@ -1186,25 +1195,25 @@ function pruneOrphanedEntries(path = manifestPath()) {
|
|
|
1186
1195
|
|
|
1187
1196
|
// dist/src/skillify/agent-roots.js
|
|
1188
1197
|
import { existsSync as existsSync9 } from "node:fs";
|
|
1189
|
-
import { homedir as
|
|
1190
|
-
import { join as
|
|
1198
|
+
import { homedir as homedir9 } from "node:os";
|
|
1199
|
+
import { join as join14 } from "node:path";
|
|
1191
1200
|
function resolveDetected(home) {
|
|
1192
1201
|
const out = [];
|
|
1193
|
-
const codexInstalled = existsSync9(
|
|
1194
|
-
const piInstalled = existsSync9(
|
|
1195
|
-
const hermesInstalled = existsSync9(
|
|
1202
|
+
const codexInstalled = existsSync9(join14(home, ".codex"));
|
|
1203
|
+
const piInstalled = existsSync9(join14(home, ".pi", "agent"));
|
|
1204
|
+
const hermesInstalled = existsSync9(join14(home, ".hermes"));
|
|
1196
1205
|
if (codexInstalled || piInstalled) {
|
|
1197
|
-
out.push(
|
|
1206
|
+
out.push(join14(home, ".agents", "skills"));
|
|
1198
1207
|
}
|
|
1199
1208
|
if (hermesInstalled) {
|
|
1200
|
-
out.push(
|
|
1209
|
+
out.push(join14(home, ".hermes", "skills"));
|
|
1201
1210
|
}
|
|
1202
1211
|
if (piInstalled) {
|
|
1203
|
-
out.push(
|
|
1212
|
+
out.push(join14(home, ".pi", "agent", "skills"));
|
|
1204
1213
|
}
|
|
1205
1214
|
return out;
|
|
1206
1215
|
}
|
|
1207
|
-
function detectAgentSkillsRoots(canonicalRoot, home =
|
|
1216
|
+
function detectAgentSkillsRoots(canonicalRoot, home = homedir9()) {
|
|
1208
1217
|
return resolveDetected(home).filter((p) => p !== canonicalRoot);
|
|
1209
1218
|
}
|
|
1210
1219
|
|
|
@@ -1248,15 +1257,15 @@ function isMissingTableError(message) {
|
|
|
1248
1257
|
}
|
|
1249
1258
|
function resolvePullDestination(install, cwd) {
|
|
1250
1259
|
if (install === "global")
|
|
1251
|
-
return
|
|
1260
|
+
return join15(homedir10(), ".claude", "skills");
|
|
1252
1261
|
if (!cwd)
|
|
1253
1262
|
throw new Error("install=project requires a cwd");
|
|
1254
|
-
return
|
|
1263
|
+
return join15(cwd, ".claude", "skills");
|
|
1255
1264
|
}
|
|
1256
1265
|
function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
|
|
1257
1266
|
const out = [];
|
|
1258
1267
|
for (const root of agentRoots) {
|
|
1259
|
-
const link =
|
|
1268
|
+
const link = join15(root, dirName);
|
|
1260
1269
|
let existing;
|
|
1261
1270
|
try {
|
|
1262
1271
|
existing = lstatSync2(link);
|
|
@@ -1284,7 +1293,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
|
|
|
1284
1293
|
}
|
|
1285
1294
|
}
|
|
1286
1295
|
try {
|
|
1287
|
-
mkdirSync8(
|
|
1296
|
+
mkdirSync8(dirname6(link), { recursive: true });
|
|
1288
1297
|
symlinkSync(canonicalDir, link, "dir");
|
|
1289
1298
|
out.push(link);
|
|
1290
1299
|
} catch {
|
|
@@ -1299,7 +1308,7 @@ function backfillSymlinks(installRoot) {
|
|
|
1299
1308
|
return;
|
|
1300
1309
|
const detected = detectAgentSkillsRoots(installRoot);
|
|
1301
1310
|
for (const entry of entries) {
|
|
1302
|
-
const canonical =
|
|
1311
|
+
const canonical = join15(entry.installRoot, entry.dirName);
|
|
1303
1312
|
if (!existsSync10(canonical))
|
|
1304
1313
|
continue;
|
|
1305
1314
|
const fresh = fanOutSymlinks(canonical, entry.dirName, detected);
|
|
@@ -1508,8 +1517,8 @@ async function runPull(opts) {
|
|
|
1508
1517
|
summary.skipped++;
|
|
1509
1518
|
continue;
|
|
1510
1519
|
}
|
|
1511
|
-
const skillDir =
|
|
1512
|
-
const skillFile =
|
|
1520
|
+
const skillDir = join15(root, dirName);
|
|
1521
|
+
const skillFile = join15(skillDir, "SKILL.md");
|
|
1513
1522
|
const remoteVersion = Number(row.version ?? 1);
|
|
1514
1523
|
const localVersion = readLocalVersion(skillFile);
|
|
1515
1524
|
const action = decideAction({
|
|
@@ -1623,7 +1632,7 @@ async function autoPullSkills(deps = {}) {
|
|
|
1623
1632
|
|
|
1624
1633
|
// dist/src/hooks/hermes/session-start.js
|
|
1625
1634
|
var log6 = (msg) => log("hermes-session-start", msg);
|
|
1626
|
-
var __bundleDir =
|
|
1635
|
+
var __bundleDir = dirname7(fileURLToPath2(import.meta.url));
|
|
1627
1636
|
var context = `DEEPLAKE MEMORY: Persistent memory at ~/.deeplake/memory/ shared across sessions, users, and agents.
|
|
1628
1637
|
|
|
1629
1638
|
Structure: index.md (start here) \u2192 summaries/*.md \u2192 sessions/*.jsonl (last resort). Do NOT jump straight to JSONL.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// dist/src/skillify/skillify-worker.js
|
|
4
4
|
import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, existsSync as existsSync5, appendFileSync as appendFileSync2, rmSync } from "node:fs";
|
|
5
|
-
import { join as
|
|
5
|
+
import { join as join7 } from "node:path";
|
|
6
6
|
|
|
7
7
|
// dist/src/utils/debug.js
|
|
8
8
|
import { appendFileSync } from "node:fs";
|
|
@@ -561,25 +561,34 @@ function resolveRecordScope(args) {
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
// dist/src/skillify/state.js
|
|
564
|
-
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, writeSync, mkdirSync as mkdirSync2, renameSync as renameSync2, existsSync as existsSync4, unlinkSync, openSync, closeSync } from "node:fs";
|
|
564
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, writeSync, mkdirSync as mkdirSync2, renameSync as renameSync2, rmdirSync, existsSync as existsSync4, lstatSync, unlinkSync, openSync, closeSync } from "node:fs";
|
|
565
565
|
import { execSync } from "node:child_process";
|
|
566
|
-
import { homedir as homedir5 } from "node:os";
|
|
567
566
|
import { createHash } from "node:crypto";
|
|
568
|
-
import { join as
|
|
567
|
+
import { join as join6, basename } from "node:path";
|
|
569
568
|
|
|
570
569
|
// dist/src/skillify/legacy-migration.js
|
|
571
570
|
import { existsSync as existsSync3, renameSync } from "node:fs";
|
|
571
|
+
import { dirname, join as join5 } from "node:path";
|
|
572
|
+
|
|
573
|
+
// dist/src/skillify/state-dir.js
|
|
572
574
|
import { homedir as homedir4 } from "node:os";
|
|
573
575
|
import { join as join4 } from "node:path";
|
|
576
|
+
function getStateDir() {
|
|
577
|
+
const override = process.env.HIVEMIND_STATE_DIR?.trim();
|
|
578
|
+
return override && override.length > 0 ? override : join4(homedir4(), ".deeplake", "state", "skillify");
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// dist/src/skillify/legacy-migration.js
|
|
574
582
|
var dlog = (msg) => log("skillify-migrate", msg);
|
|
575
583
|
var attempted = false;
|
|
576
584
|
function migrateLegacyStateDir() {
|
|
585
|
+
if (process.env.HIVEMIND_STATE_DIR?.trim())
|
|
586
|
+
return;
|
|
577
587
|
if (attempted)
|
|
578
588
|
return;
|
|
579
589
|
attempted = true;
|
|
580
|
-
const
|
|
581
|
-
const legacy =
|
|
582
|
-
const current = join4(root, "skillify");
|
|
590
|
+
const current = getStateDir();
|
|
591
|
+
const legacy = join5(dirname(current), "skilify");
|
|
583
592
|
if (!existsSync3(legacy))
|
|
584
593
|
return;
|
|
585
594
|
if (existsSync3(current))
|
|
@@ -589,8 +598,8 @@ function migrateLegacyStateDir() {
|
|
|
589
598
|
dlog(`migrated ${legacy} -> ${current}`);
|
|
590
599
|
} catch (err) {
|
|
591
600
|
const code = err.code;
|
|
592
|
-
if (code === "EXDEV" || code === "EPERM") {
|
|
593
|
-
dlog(`migration
|
|
601
|
+
if (code === "EXDEV" || code === "EPERM" || code === "ENOENT" || code === "EEXIST" || code === "ENOTEMPTY") {
|
|
602
|
+
dlog(`migration skipped (${code}); legacy dir left as-is or another process handled it`);
|
|
594
603
|
return;
|
|
595
604
|
}
|
|
596
605
|
throw err;
|
|
@@ -599,17 +608,16 @@ function migrateLegacyStateDir() {
|
|
|
599
608
|
|
|
600
609
|
// dist/src/skillify/state.js
|
|
601
610
|
var dlog2 = (msg) => log("skillify-state", msg);
|
|
602
|
-
var STATE_DIR = join5(homedir5(), ".deeplake", "state", "skillify");
|
|
603
611
|
var YIELD_BUF = new Int32Array(new SharedArrayBuffer(4));
|
|
604
612
|
var TRIGGER_THRESHOLD = (() => {
|
|
605
613
|
const n = Number(process.env.HIVEMIND_SKILLIFY_EVERY_N_TURNS ?? "");
|
|
606
614
|
return Number.isInteger(n) && n > 0 ? n : 20;
|
|
607
615
|
})();
|
|
608
616
|
function statePath(projectKey) {
|
|
609
|
-
return
|
|
617
|
+
return join6(getStateDir(), `${projectKey}.json`);
|
|
610
618
|
}
|
|
611
619
|
function lockPath(projectKey) {
|
|
612
|
-
return
|
|
620
|
+
return join6(getStateDir(), `${projectKey}.lock`);
|
|
613
621
|
}
|
|
614
622
|
function readState(projectKey) {
|
|
615
623
|
migrateLegacyStateDir();
|
|
@@ -624,7 +632,7 @@ function readState(projectKey) {
|
|
|
624
632
|
}
|
|
625
633
|
function writeState(projectKey, state) {
|
|
626
634
|
migrateLegacyStateDir();
|
|
627
|
-
mkdirSync2(
|
|
635
|
+
mkdirSync2(getStateDir(), { recursive: true });
|
|
628
636
|
const p = statePath(projectKey);
|
|
629
637
|
const tmp = `${p}.${process.pid}.${Date.now()}.tmp`;
|
|
630
638
|
writeFileSync2(tmp, JSON.stringify(state, null, 2));
|
|
@@ -632,7 +640,7 @@ function writeState(projectKey, state) {
|
|
|
632
640
|
}
|
|
633
641
|
function withRmwLock(projectKey, fn) {
|
|
634
642
|
migrateLegacyStateDir();
|
|
635
|
-
mkdirSync2(
|
|
643
|
+
mkdirSync2(getStateDir(), { recursive: true });
|
|
636
644
|
const rmw = lockPath(projectKey) + ".rmw";
|
|
637
645
|
const deadline = Date.now() + 2e3;
|
|
638
646
|
let fd = null;
|
|
@@ -705,8 +713,8 @@ function releaseWorkerLock(projectKey) {
|
|
|
705
713
|
var cfg = JSON.parse(readFileSync3(process.argv[2], "utf-8"));
|
|
706
714
|
globalThis.__hivemind_tuning__ = cfg.tuning ?? {};
|
|
707
715
|
var tmpDir = cfg.tmpDir;
|
|
708
|
-
var verdictPath =
|
|
709
|
-
var promptPath =
|
|
716
|
+
var verdictPath = join7(tmpDir, "verdict.json");
|
|
717
|
+
var promptPath = join7(tmpDir, "prompt.txt");
|
|
710
718
|
var SESSIONS_TO_MINE = 10;
|
|
711
719
|
var PAIR_CHAR_CAP = 2e3;
|
|
712
720
|
var TOTAL_PAIRS_CHAR_CAP = 4e4;
|
|
@@ -953,9 +961,9 @@ async function main() {
|
|
|
953
961
|
timeoutMs: 12e4
|
|
954
962
|
});
|
|
955
963
|
try {
|
|
956
|
-
writeFileSync3(
|
|
964
|
+
writeFileSync3(join7(tmpDir, "gate-stdout.txt"), gate.stdout);
|
|
957
965
|
if (gate.stderr)
|
|
958
|
-
writeFileSync3(
|
|
966
|
+
writeFileSync3(join7(tmpDir, "gate-stderr.txt"), gate.stderr);
|
|
959
967
|
} catch {
|
|
960
968
|
}
|
|
961
969
|
if (gate.errored) {
|
package/openclaw/dist/index.js
CHANGED
|
@@ -1239,7 +1239,7 @@ function extractLatestVersion(body) {
|
|
|
1239
1239
|
return typeof v === "string" && v.length > 0 ? v : null;
|
|
1240
1240
|
}
|
|
1241
1241
|
function getInstalledVersion() {
|
|
1242
|
-
return "0.7.
|
|
1242
|
+
return "0.7.34".length > 0 ? "0.7.34" : null;
|
|
1243
1243
|
}
|
|
1244
1244
|
function isNewer(latest, current) {
|
|
1245
1245
|
const parse = (v) => v.replace(/-.*$/, "").split(".").map(Number);
|