@deeplake/hivemind 0.7.79 → 0.7.81
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 +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/bundle/cli.js +140 -94
- package/codex/bundle/capture.js +232 -72
- package/codex/bundle/commands/auth-login.js +14 -10
- package/codex/bundle/embeddings/embed-daemon.js +9 -5
- package/codex/bundle/graph-on-stop.js +32 -28
- package/codex/bundle/graph-pull-worker.js +27 -23
- package/codex/bundle/pre-tool-use.js +366 -123
- package/codex/bundle/session-start-setup.js +18 -14
- package/codex/bundle/session-start.js +26 -22
- package/codex/bundle/shell/deeplake-shell.js +30 -26
- package/codex/bundle/skillify-worker.js +14 -10
- package/codex/bundle/skillopt-worker.js +2061 -0
- package/codex/bundle/stop.js +50 -45
- package/codex/bundle/wiki-worker.js +18 -14
- package/cursor/bundle/capture.js +71 -44
- package/cursor/bundle/commands/auth-login.js +14 -10
- package/cursor/bundle/embeddings/embed-daemon.js +9 -5
- package/cursor/bundle/graph-on-stop.js +32 -28
- package/cursor/bundle/graph-pull-worker.js +27 -23
- package/cursor/bundle/pre-tool-use.js +28 -24
- package/cursor/bundle/session-end.js +40 -36
- package/cursor/bundle/session-start.js +39 -35
- package/cursor/bundle/shell/deeplake-shell.js +30 -26
- package/cursor/bundle/skillify-worker.js +14 -10
- package/cursor/bundle/wiki-worker.js +18 -14
- package/hermes/bundle/capture.js +235 -85
- package/hermes/bundle/commands/auth-login.js +14 -10
- package/hermes/bundle/embeddings/embed-daemon.js +9 -5
- package/hermes/bundle/graph-on-stop.js +32 -28
- package/hermes/bundle/graph-pull-worker.js +27 -23
- package/hermes/bundle/pre-tool-use.js +298 -74
- package/hermes/bundle/session-end.js +40 -36
- package/hermes/bundle/session-start.js +39 -35
- package/hermes/bundle/shell/deeplake-shell.js +30 -26
- package/hermes/bundle/skillify-worker.js +14 -10
- package/hermes/bundle/skillopt-worker.js +2061 -0
- package/hermes/bundle/wiki-worker.js +18 -14
- package/mcp/bundle/server.js +15 -11
- package/openclaw/dist/index.js +11 -7
- package/openclaw/dist/skillify-worker.js +14 -10
- package/openclaw/openclaw.plugin.json +1 -1
- package/openclaw/package.json +1 -1
- package/package.json +1 -1
- package/pi/extension-source/hivemind.ts +93 -0
package/bundle/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ __export(index_marker_store_exports, {
|
|
|
17
17
|
hasFreshIndexMarker: () => hasFreshIndexMarker,
|
|
18
18
|
writeIndexMarker: () => writeIndexMarker
|
|
19
19
|
});
|
|
20
|
-
import { existsSync as existsSync14, mkdirSync as
|
|
20
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync7, readFileSync as readFileSync14, writeFileSync as writeFileSync11 } from "node:fs";
|
|
21
21
|
import { join as join19 } from "node:path";
|
|
22
22
|
import { tmpdir } from "node:os";
|
|
23
23
|
function getIndexMarkerDir() {
|
|
@@ -41,7 +41,7 @@ function hasFreshIndexMarker(markerPath) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
function writeIndexMarker(markerPath) {
|
|
44
|
-
|
|
44
|
+
mkdirSync7(getIndexMarkerDir(), { recursive: true });
|
|
45
45
|
writeFileSync11(markerPath, JSON.stringify({ updatedAt: (/* @__PURE__ */ new Date()).toISOString() }), "utf-8");
|
|
46
46
|
}
|
|
47
47
|
var INDEX_MARKER_TTL_MS;
|
|
@@ -331,7 +331,7 @@ function uninstallClaude() {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
// dist/src/cli/install-codex.js
|
|
334
|
-
import { existsSync as existsSync3, readFileSync as readFileSync4, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
334
|
+
import { existsSync as existsSync3, lstatSync as lstatSync2, readFileSync as readFileSync4, rmSync, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
335
335
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
336
336
|
import { join as join4 } from "node:path";
|
|
337
337
|
|
|
@@ -522,6 +522,17 @@ function installCodex() {
|
|
|
522
522
|
} else {
|
|
523
523
|
warn(` Codex skill source missing at ${skillTarget}; skipping symlink`);
|
|
524
524
|
}
|
|
525
|
+
const pluginNm = join4(PLUGIN_DIR, "node_modules");
|
|
526
|
+
const embedDepsNm = join4(HOME, ".hivemind", "embed-deps", "node_modules");
|
|
527
|
+
if (existsSync3(embedDepsNm)) {
|
|
528
|
+
try {
|
|
529
|
+
const st = lstatSync2(pluginNm);
|
|
530
|
+
if (st.isDirectory() && !st.isSymbolicLink())
|
|
531
|
+
rmSync(pluginNm, { recursive: true });
|
|
532
|
+
} catch {
|
|
533
|
+
}
|
|
534
|
+
symlinkForce(embedDepsNm, pluginNm);
|
|
535
|
+
}
|
|
525
536
|
writeVersionStamp(PLUGIN_DIR, getVersion());
|
|
526
537
|
log(` Codex installed -> ${PLUGIN_DIR}`);
|
|
527
538
|
}
|
|
@@ -558,7 +569,7 @@ function uninstallCodex() {
|
|
|
558
569
|
}
|
|
559
570
|
|
|
560
571
|
// dist/src/cli/install-openclaw.js
|
|
561
|
-
import { existsSync as existsSync5, copyFileSync, rmSync } from "node:fs";
|
|
572
|
+
import { existsSync as existsSync5, copyFileSync, rmSync as rmSync2 } from "node:fs";
|
|
562
573
|
import { join as join6 } from "node:path";
|
|
563
574
|
|
|
564
575
|
// dist/openclaw/src/setup-config.js
|
|
@@ -658,7 +669,7 @@ function installOpenclaw() {
|
|
|
658
669
|
throw new Error(`OpenClaw bundle missing at ${srcDist}. Run 'npm run build' first.`);
|
|
659
670
|
}
|
|
660
671
|
ensureDir(PLUGIN_DIR2);
|
|
661
|
-
|
|
672
|
+
rmSync2(join6(PLUGIN_DIR2, "dist"), { recursive: true, force: true });
|
|
662
673
|
copyDir(srcDist, join6(PLUGIN_DIR2, "dist"));
|
|
663
674
|
if (existsSync5(srcManifest))
|
|
664
675
|
copyFileSync(srcManifest, join6(PLUGIN_DIR2, "openclaw.plugin.json"));
|
|
@@ -691,7 +702,7 @@ function installOpenclaw() {
|
|
|
691
702
|
}
|
|
692
703
|
function uninstallOpenclaw() {
|
|
693
704
|
if (existsSync5(PLUGIN_DIR2)) {
|
|
694
|
-
|
|
705
|
+
rmSync2(PLUGIN_DIR2, { recursive: true, force: true });
|
|
695
706
|
log(` OpenClaw removed ${PLUGIN_DIR2}`);
|
|
696
707
|
} else {
|
|
697
708
|
log(` OpenClaw nothing to remove`);
|
|
@@ -699,7 +710,7 @@ function uninstallOpenclaw() {
|
|
|
699
710
|
}
|
|
700
711
|
|
|
701
712
|
// dist/src/cli/install-cursor.js
|
|
702
|
-
import { existsSync as existsSync6, unlinkSync as unlinkSync3 } from "node:fs";
|
|
713
|
+
import { existsSync as existsSync6, lstatSync as lstatSync3, rmSync as rmSync3, unlinkSync as unlinkSync3 } from "node:fs";
|
|
703
714
|
import { join as join7 } from "node:path";
|
|
704
715
|
var CURSOR_HOME = join7(HOME, ".cursor");
|
|
705
716
|
var PLUGIN_DIR3 = join7(CURSOR_HOME, "hivemind");
|
|
@@ -786,6 +797,17 @@ function installCursor() {
|
|
|
786
797
|
const existing = readJson(HOOKS_PATH2);
|
|
787
798
|
const merged = mergeHooks2(existing);
|
|
788
799
|
writeJsonIfChanged(HOOKS_PATH2, merged);
|
|
800
|
+
const pluginNm = join7(PLUGIN_DIR3, "node_modules");
|
|
801
|
+
const embedDepsNm = join7(HOME, ".hivemind", "embed-deps", "node_modules");
|
|
802
|
+
if (existsSync6(embedDepsNm)) {
|
|
803
|
+
try {
|
|
804
|
+
const st = lstatSync3(pluginNm);
|
|
805
|
+
if (st.isDirectory() && !st.isSymbolicLink())
|
|
806
|
+
rmSync3(pluginNm, { recursive: true });
|
|
807
|
+
} catch {
|
|
808
|
+
}
|
|
809
|
+
symlinkForce(embedDepsNm, pluginNm);
|
|
810
|
+
}
|
|
789
811
|
writeVersionStamp(PLUGIN_DIR3, getVersion());
|
|
790
812
|
log(` Cursor installed -> ${PLUGIN_DIR3}`);
|
|
791
813
|
}
|
|
@@ -807,7 +829,7 @@ function uninstallCursor() {
|
|
|
807
829
|
}
|
|
808
830
|
|
|
809
831
|
// dist/src/cli/install-hermes.js
|
|
810
|
-
import { existsSync as existsSync8, writeFileSync as writeFileSync5, readFileSync as readFileSync6, rmSync as
|
|
832
|
+
import { existsSync as existsSync8, lstatSync as lstatSync4, writeFileSync as writeFileSync5, readFileSync as readFileSync6, rmSync as rmSync4, unlinkSync as unlinkSync4 } from "node:fs";
|
|
811
833
|
import { join as join9 } from "node:path";
|
|
812
834
|
|
|
813
835
|
// node_modules/js-yaml/dist/js-yaml.mjs
|
|
@@ -3553,6 +3575,17 @@ function installHermes() {
|
|
|
3553
3575
|
}
|
|
3554
3576
|
ensureDir(HIVEMIND_DIR2);
|
|
3555
3577
|
copyDir(srcBundle, BUNDLE_DIR);
|
|
3578
|
+
const pluginNm = join9(HIVEMIND_DIR2, "node_modules");
|
|
3579
|
+
const embedDepsNm = join9(HOME, ".hivemind", "embed-deps", "node_modules");
|
|
3580
|
+
if (existsSync8(embedDepsNm)) {
|
|
3581
|
+
try {
|
|
3582
|
+
const st = lstatSync4(pluginNm);
|
|
3583
|
+
if (st.isDirectory() && !st.isSymbolicLink())
|
|
3584
|
+
rmSync4(pluginNm, { recursive: true });
|
|
3585
|
+
} catch {
|
|
3586
|
+
}
|
|
3587
|
+
symlinkForce(embedDepsNm, pluginNm);
|
|
3588
|
+
}
|
|
3556
3589
|
writeVersionStamp(HIVEMIND_DIR2, getVersion());
|
|
3557
3590
|
log(` Hermes bundle installed -> ${BUNDLE_DIR}`);
|
|
3558
3591
|
ensureMcpServerInstalled();
|
|
@@ -3570,11 +3603,11 @@ function installHermes() {
|
|
|
3570
3603
|
}
|
|
3571
3604
|
function uninstallHermes() {
|
|
3572
3605
|
if (existsSync8(SKILLS_DIR)) {
|
|
3573
|
-
|
|
3606
|
+
rmSync4(SKILLS_DIR, { recursive: true, force: true });
|
|
3574
3607
|
log(` Hermes removed ${SKILLS_DIR}`);
|
|
3575
3608
|
}
|
|
3576
3609
|
if (existsSync8(HIVEMIND_DIR2)) {
|
|
3577
|
-
|
|
3610
|
+
rmSync4(HIVEMIND_DIR2, { recursive: true, force: true });
|
|
3578
3611
|
log(` Hermes removed ${HIVEMIND_DIR2}`);
|
|
3579
3612
|
}
|
|
3580
3613
|
if (existsSync8(CONFIG_PATH)) {
|
|
@@ -3610,7 +3643,7 @@ function uninstallHermes() {
|
|
|
3610
3643
|
}
|
|
3611
3644
|
|
|
3612
3645
|
// dist/src/cli/install-pi.js
|
|
3613
|
-
import { existsSync as existsSync9, writeFileSync as writeFileSync6, rmSync as
|
|
3646
|
+
import { existsSync as existsSync9, writeFileSync as writeFileSync6, rmSync as rmSync5, readFileSync as readFileSync7, copyFileSync as copyFileSync2 } from "node:fs";
|
|
3614
3647
|
import { join as join10 } from "node:path";
|
|
3615
3648
|
var PI_AGENT_DIR = join10(HOME, ".pi", "agent");
|
|
3616
3649
|
var AGENTS_MD = join10(PI_AGENT_DIR, "AGENTS.md");
|
|
@@ -3622,6 +3655,7 @@ var WIKI_WORKER_DIR = join10(PI_AGENT_DIR, "hivemind");
|
|
|
3622
3655
|
var WIKI_WORKER_PATH = join10(WIKI_WORKER_DIR, "wiki-worker.js");
|
|
3623
3656
|
var SKILLIFY_WORKER_PATH = join10(WIKI_WORKER_DIR, "skillify-worker.js");
|
|
3624
3657
|
var AUTOPULL_WORKER_PATH = join10(WIKI_WORKER_DIR, "autopull-worker.js");
|
|
3658
|
+
var SKILLOPT_WORKER_PATH = join10(WIKI_WORKER_DIR, "skillopt-worker.js");
|
|
3625
3659
|
var HIVEMIND_BLOCK_START = "<!-- BEGIN hivemind-memory -->";
|
|
3626
3660
|
var HIVEMIND_BLOCK_END = "<!-- END hivemind-memory -->";
|
|
3627
3661
|
var HIVEMIND_BLOCK_BODY = `${HIVEMIND_BLOCK_START}
|
|
@@ -3690,7 +3724,7 @@ ${after}`;
|
|
|
3690
3724
|
function installPi() {
|
|
3691
3725
|
ensureDir(PI_AGENT_DIR);
|
|
3692
3726
|
if (existsSync9(LEGACY_SKILL_DIR)) {
|
|
3693
|
-
|
|
3727
|
+
rmSync5(LEGACY_SKILL_DIR, { recursive: true, force: true });
|
|
3694
3728
|
}
|
|
3695
3729
|
const prior = existsSync9(AGENTS_MD) ? readFileSync7(AGENTS_MD, "utf-8") : null;
|
|
3696
3730
|
const next = upsertHivemindBlock(prior);
|
|
@@ -3716,6 +3750,11 @@ function installPi() {
|
|
|
3716
3750
|
ensureDir(WIKI_WORKER_DIR);
|
|
3717
3751
|
copyFileSync2(srcAutopullWorker, AUTOPULL_WORKER_PATH);
|
|
3718
3752
|
}
|
|
3753
|
+
const srcSkilloptWorker = join10(pkgRoot(), "pi", "bundle", "skillopt-worker.js");
|
|
3754
|
+
if (existsSync9(srcSkilloptWorker)) {
|
|
3755
|
+
ensureDir(WIKI_WORKER_DIR);
|
|
3756
|
+
copyFileSync2(srcSkilloptWorker, SKILLOPT_WORKER_PATH);
|
|
3757
|
+
}
|
|
3719
3758
|
ensureDir(VERSION_DIR);
|
|
3720
3759
|
writeVersionStamp(VERSION_DIR, getVersion());
|
|
3721
3760
|
log(` pi AGENTS.md updated -> ${AGENTS_MD}`);
|
|
@@ -3729,25 +3768,28 @@ function installPi() {
|
|
|
3729
3768
|
if (existsSync9(AUTOPULL_WORKER_PATH)) {
|
|
3730
3769
|
log(` pi autopull-worker installed -> ${AUTOPULL_WORKER_PATH}`);
|
|
3731
3770
|
}
|
|
3771
|
+
if (existsSync9(SKILLOPT_WORKER_PATH)) {
|
|
3772
|
+
log(` pi skillopt-worker installed -> ${SKILLOPT_WORKER_PATH}`);
|
|
3773
|
+
}
|
|
3732
3774
|
}
|
|
3733
3775
|
function uninstallPi() {
|
|
3734
3776
|
if (existsSync9(LEGACY_SKILL_DIR)) {
|
|
3735
|
-
|
|
3777
|
+
rmSync5(LEGACY_SKILL_DIR, { recursive: true, force: true });
|
|
3736
3778
|
log(` pi removed ${LEGACY_SKILL_DIR}`);
|
|
3737
3779
|
}
|
|
3738
3780
|
if (existsSync9(EXTENSION_PATH)) {
|
|
3739
|
-
|
|
3781
|
+
rmSync5(EXTENSION_PATH, { force: true });
|
|
3740
3782
|
log(` pi removed extension ${EXTENSION_PATH}`);
|
|
3741
3783
|
}
|
|
3742
3784
|
if (existsSync9(WIKI_WORKER_DIR)) {
|
|
3743
|
-
|
|
3785
|
+
rmSync5(WIKI_WORKER_DIR, { recursive: true, force: true });
|
|
3744
3786
|
log(` pi removed wiki-worker dir ${WIKI_WORKER_DIR}`);
|
|
3745
3787
|
}
|
|
3746
3788
|
if (existsSync9(AGENTS_MD)) {
|
|
3747
3789
|
const prior = readFileSync7(AGENTS_MD, "utf-8");
|
|
3748
3790
|
const stripped = stripHivemindBlock(prior);
|
|
3749
3791
|
if (stripped.trim().length === 0) {
|
|
3750
|
-
|
|
3792
|
+
rmSync5(AGENTS_MD, { force: true });
|
|
3751
3793
|
log(` pi removed empty ${AGENTS_MD}`);
|
|
3752
3794
|
} else {
|
|
3753
3795
|
writeFileSync6(AGENTS_MD, stripped);
|
|
@@ -3755,12 +3797,12 @@ function uninstallPi() {
|
|
|
3755
3797
|
}
|
|
3756
3798
|
}
|
|
3757
3799
|
if (existsSync9(VERSION_DIR)) {
|
|
3758
|
-
|
|
3800
|
+
rmSync5(VERSION_DIR, { recursive: true, force: true });
|
|
3759
3801
|
}
|
|
3760
3802
|
}
|
|
3761
3803
|
|
|
3762
3804
|
// dist/src/cli/embeddings.js
|
|
3763
|
-
import { copyFileSync as copyFileSync3, chmodSync, existsSync as existsSync11, lstatSync as
|
|
3805
|
+
import { copyFileSync as copyFileSync3, chmodSync, existsSync as existsSync11, lstatSync as lstatSync5, readdirSync, readFileSync as readFileSync9, readlinkSync, rmSync as rmSync6, statSync, unlinkSync as unlinkSync5 } from "node:fs";
|
|
3764
3806
|
import { execFileSync as execFileSync3, spawnSync } from "node:child_process";
|
|
3765
3807
|
import { userInfo } from "node:os";
|
|
3766
3808
|
import { join as join12 } from "node:path";
|
|
@@ -3904,7 +3946,7 @@ function isSymlinkToSharedDeps(linkPath, sharedNodeModules) {
|
|
|
3904
3946
|
if (!existsSync11(linkPath))
|
|
3905
3947
|
return false;
|
|
3906
3948
|
try {
|
|
3907
|
-
if (!
|
|
3949
|
+
if (!lstatSync5(linkPath).isSymbolicLink())
|
|
3908
3950
|
return false;
|
|
3909
3951
|
return readlinkSync(linkPath) === sharedNodeModules;
|
|
3910
3952
|
} catch {
|
|
@@ -3916,7 +3958,7 @@ function linkStateFor(install, sharedNodeModules = SHARED_NODE_MODULES) {
|
|
|
3916
3958
|
if (!existsSync11(link) && !isSymbolicLink(link))
|
|
3917
3959
|
return { kind: "no-node-modules" };
|
|
3918
3960
|
try {
|
|
3919
|
-
if (
|
|
3961
|
+
if (lstatSync5(link).isSymbolicLink()) {
|
|
3920
3962
|
const target = readlinkSync(link);
|
|
3921
3963
|
return target === sharedNodeModules ? { kind: "linked-to-shared" } : { kind: "linked-elsewhere", target };
|
|
3922
3964
|
}
|
|
@@ -3927,7 +3969,7 @@ function linkStateFor(install, sharedNodeModules = SHARED_NODE_MODULES) {
|
|
|
3927
3969
|
}
|
|
3928
3970
|
function isSymbolicLink(path) {
|
|
3929
3971
|
try {
|
|
3930
|
-
return
|
|
3972
|
+
return lstatSync5(path).isSymbolicLink();
|
|
3931
3973
|
} catch {
|
|
3932
3974
|
return false;
|
|
3933
3975
|
}
|
|
@@ -4002,7 +4044,7 @@ function uninstallEmbeddings(opts) {
|
|
|
4002
4044
|
}
|
|
4003
4045
|
}
|
|
4004
4046
|
if (opts?.prune && existsSync11(SHARED_DIR)) {
|
|
4005
|
-
|
|
4047
|
+
rmSync6(SHARED_DIR, { recursive: true, force: true });
|
|
4006
4048
|
log(` Embeddings pruned ${SHARED_DIR}`);
|
|
4007
4049
|
}
|
|
4008
4050
|
setEmbeddingsEnabled(false);
|
|
@@ -4515,8 +4557,8 @@ function loadConfig() {
|
|
|
4515
4557
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
4516
4558
|
|
|
4517
4559
|
// dist/src/utils/debug.js
|
|
4518
|
-
import { appendFileSync } from "node:fs";
|
|
4519
|
-
import { join as join17 } from "node:path";
|
|
4560
|
+
import { appendFileSync, mkdirSync as mkdirSync5 } from "node:fs";
|
|
4561
|
+
import { dirname as dirname3, join as join17 } from "node:path";
|
|
4520
4562
|
import { homedir as homedir8 } from "node:os";
|
|
4521
4563
|
var LOG = join17(homedir8(), ".deeplake", "hook-debug.log");
|
|
4522
4564
|
function isDebug() {
|
|
@@ -4525,8 +4567,12 @@ function isDebug() {
|
|
|
4525
4567
|
function log2(tag, msg) {
|
|
4526
4568
|
if (!isDebug())
|
|
4527
4569
|
return;
|
|
4528
|
-
|
|
4570
|
+
try {
|
|
4571
|
+
mkdirSync5(dirname3(LOG), { recursive: true });
|
|
4572
|
+
appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
|
|
4529
4573
|
`);
|
|
4574
|
+
} catch {
|
|
4575
|
+
}
|
|
4530
4576
|
}
|
|
4531
4577
|
|
|
4532
4578
|
// dist/src/utils/sql.js
|
|
@@ -4735,7 +4781,7 @@ function isMissingTableError(message) {
|
|
|
4735
4781
|
}
|
|
4736
4782
|
|
|
4737
4783
|
// dist/src/notifications/queue.js
|
|
4738
|
-
import { readFileSync as readFileSync13, writeFileSync as writeFileSync10, renameSync as renameSync3, mkdirSync as
|
|
4784
|
+
import { readFileSync as readFileSync13, writeFileSync as writeFileSync10, renameSync as renameSync3, mkdirSync as mkdirSync6, openSync, closeSync, unlinkSync as unlinkSync7, statSync as statSync2 } from "node:fs";
|
|
4739
4785
|
import { join as join18, resolve } from "node:path";
|
|
4740
4786
|
import { homedir as homedir9 } from "node:os";
|
|
4741
4787
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
@@ -4773,14 +4819,14 @@ function writeQueue(q) {
|
|
|
4773
4819
|
if (!_isQueuePathInsideHome(path, home)) {
|
|
4774
4820
|
throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
|
|
4775
4821
|
}
|
|
4776
|
-
|
|
4822
|
+
mkdirSync6(join18(home, ".deeplake"), { recursive: true, mode: 448 });
|
|
4777
4823
|
const tmp = `${path}.${process.pid}.tmp`;
|
|
4778
4824
|
writeFileSync10(tmp, JSON.stringify(q, null, 2), { mode: 384 });
|
|
4779
4825
|
renameSync3(tmp, path);
|
|
4780
4826
|
}
|
|
4781
4827
|
async function withQueueLock(fn) {
|
|
4782
4828
|
const path = lockPath();
|
|
4783
|
-
|
|
4829
|
+
mkdirSync6(join18(homedir9(), ".deeplake"), { recursive: true, mode: 448 });
|
|
4784
4830
|
let fd = null;
|
|
4785
4831
|
for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
|
|
4786
4832
|
try {
|
|
@@ -5679,8 +5725,8 @@ import { createHash as createHash6 } from "node:crypto";
|
|
|
5679
5725
|
|
|
5680
5726
|
// dist/src/graph/cache.js
|
|
5681
5727
|
import { createHash } from "node:crypto";
|
|
5682
|
-
import { existsSync as existsSync15, mkdirSync as
|
|
5683
|
-
import { dirname as
|
|
5728
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync8, readFileSync as readFileSync15, renameSync as renameSync4, writeFileSync as writeFileSync12 } from "node:fs";
|
|
5729
|
+
import { dirname as dirname4, join as join20 } from "node:path";
|
|
5684
5730
|
var CACHE_SCHEMA_VERSION = 1;
|
|
5685
5731
|
function fileContentHash(contents) {
|
|
5686
5732
|
return createHash("sha256").update(contents).digest("hex");
|
|
@@ -5780,7 +5826,7 @@ function writeCache(baseDir, contentSha256, extraction) {
|
|
|
5780
5826
|
};
|
|
5781
5827
|
const path = cachePath(baseDir, contentSha256);
|
|
5782
5828
|
try {
|
|
5783
|
-
|
|
5829
|
+
mkdirSync8(dirname4(path), { recursive: true });
|
|
5784
5830
|
const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
|
|
5785
5831
|
writeFileSync12(tmp, JSON.stringify(entry));
|
|
5786
5832
|
renameSync4(tmp, path);
|
|
@@ -5913,8 +5959,8 @@ function canonicalJSON(value) {
|
|
|
5913
5959
|
// dist/src/graph/deeplake-pull.js
|
|
5914
5960
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
5915
5961
|
import { createHash as createHash5 } from "node:crypto";
|
|
5916
|
-
import { existsSync as existsSync18, mkdirSync as
|
|
5917
|
-
import { dirname as
|
|
5962
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync12, renameSync as renameSync7, writeFileSync as writeFileSync15 } from "node:fs";
|
|
5963
|
+
import { dirname as dirname8, join as join24 } from "node:path";
|
|
5918
5964
|
|
|
5919
5965
|
// dist/src/utils/repo-identity.js
|
|
5920
5966
|
import { execSync as execSync2 } from "node:child_process";
|
|
@@ -5964,8 +6010,8 @@ function deriveProjectKey(cwd) {
|
|
|
5964
6010
|
}
|
|
5965
6011
|
|
|
5966
6012
|
// dist/src/graph/last-build.js
|
|
5967
|
-
import { existsSync as existsSync16, mkdirSync as
|
|
5968
|
-
import { dirname as
|
|
6013
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync9, readFileSync as readFileSync16, renameSync as renameSync5, writeFileSync as writeFileSync13 } from "node:fs";
|
|
6014
|
+
import { dirname as dirname5, join as join21 } from "node:path";
|
|
5969
6015
|
function lastBuildPath(baseDir, worktreeId) {
|
|
5970
6016
|
if (worktreeId !== void 0) {
|
|
5971
6017
|
return join21(baseDir, "worktrees", worktreeId, ".last-build.json");
|
|
@@ -5975,7 +6021,7 @@ function lastBuildPath(baseDir, worktreeId) {
|
|
|
5975
6021
|
function writeLastBuild(baseDir, state, worktreeId) {
|
|
5976
6022
|
const path = lastBuildPath(baseDir, worktreeId);
|
|
5977
6023
|
try {
|
|
5978
|
-
|
|
6024
|
+
mkdirSync9(dirname5(path), { recursive: true });
|
|
5979
6025
|
const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
|
|
5980
6026
|
writeFileSync13(tmp, JSON.stringify(state));
|
|
5981
6027
|
renameSync5(tmp, path);
|
|
@@ -6024,15 +6070,15 @@ function readLastBuild(baseDir, worktreeId) {
|
|
|
6024
6070
|
}
|
|
6025
6071
|
|
|
6026
6072
|
// dist/src/graph/history.js
|
|
6027
|
-
import { appendFileSync as appendFileSync2, existsSync as existsSync17, mkdirSync as
|
|
6028
|
-
import { dirname as
|
|
6073
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync17, mkdirSync as mkdirSync10, readFileSync as readFileSync17 } from "node:fs";
|
|
6074
|
+
import { dirname as dirname6, join as join22 } from "node:path";
|
|
6029
6075
|
function historyPath(baseDir) {
|
|
6030
6076
|
return join22(baseDir, "history.jsonl");
|
|
6031
6077
|
}
|
|
6032
6078
|
function appendHistoryEntry(baseDir, entry) {
|
|
6033
6079
|
const path = historyPath(baseDir);
|
|
6034
6080
|
try {
|
|
6035
|
-
|
|
6081
|
+
mkdirSync10(dirname6(path), { recursive: true });
|
|
6036
6082
|
appendFileSync2(path, JSON.stringify(entry) + "\n");
|
|
6037
6083
|
} catch {
|
|
6038
6084
|
}
|
|
@@ -6111,9 +6157,9 @@ function parseLine(line) {
|
|
|
6111
6157
|
|
|
6112
6158
|
// dist/src/graph/snapshot.js
|
|
6113
6159
|
import { createHash as createHash4 } from "node:crypto";
|
|
6114
|
-
import { mkdirSync as
|
|
6160
|
+
import { mkdirSync as mkdirSync11, renameSync as renameSync6, writeFileSync as writeFileSync14 } from "node:fs";
|
|
6115
6161
|
import { homedir as homedir10 } from "node:os";
|
|
6116
|
-
import { dirname as
|
|
6162
|
+
import { dirname as dirname7, join as join23 } from "node:path";
|
|
6117
6163
|
|
|
6118
6164
|
// dist/src/graph/resolve/cross-file.js
|
|
6119
6165
|
import { posix } from "node:path";
|
|
@@ -6493,7 +6539,7 @@ function writeSnapshot(snapshot, baseDir, trigger = "unknown", worktreeId) {
|
|
|
6493
6539
|
return { snapshotPath, latestCommitPath, snapshotSha256: sha256 };
|
|
6494
6540
|
}
|
|
6495
6541
|
function writeFileAtomic(filePath, contents) {
|
|
6496
|
-
|
|
6542
|
+
mkdirSync11(dirname7(filePath), { recursive: true });
|
|
6497
6543
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
6498
6544
|
writeFileSync14(tmp, contents);
|
|
6499
6545
|
renameSync6(tmp, filePath);
|
|
@@ -6650,7 +6696,7 @@ function coerceSnapshotPayload(raw) {
|
|
|
6650
6696
|
return null;
|
|
6651
6697
|
}
|
|
6652
6698
|
function writeFileAtomic2(filePath, contents) {
|
|
6653
|
-
|
|
6699
|
+
mkdirSync12(dirname8(filePath), { recursive: true });
|
|
6654
6700
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
6655
6701
|
writeFileSync15(tmp, contents);
|
|
6656
6702
|
renameSync7(tmp, filePath);
|
|
@@ -7534,7 +7580,7 @@ function extractFile(sourceCode, relativePath) {
|
|
|
7534
7580
|
}
|
|
7535
7581
|
|
|
7536
7582
|
// dist/src/graph/ignore-config.js
|
|
7537
|
-
import { mkdirSync as
|
|
7583
|
+
import { mkdirSync as mkdirSync13, readFileSync as readFileSync19, writeFileSync as writeFileSync16 } from "node:fs";
|
|
7538
7584
|
import { homedir as homedir11 } from "node:os";
|
|
7539
7585
|
import { join as join26 } from "node:path";
|
|
7540
7586
|
var DEFAULT_IGNORE_DIRS = [
|
|
@@ -7615,7 +7661,7 @@ function loadGraphIgnore(deeplakeDir = join26(homedir11(), ".deeplake")) {
|
|
|
7615
7661
|
} catch {
|
|
7616
7662
|
}
|
|
7617
7663
|
try {
|
|
7618
|
-
|
|
7664
|
+
mkdirSync13(deeplakeDir, { recursive: true });
|
|
7619
7665
|
writeFileSync16(path, JSON.stringify(defaultConfigObject(), null, 2) + "\n", { flag: "wx" });
|
|
7620
7666
|
} catch {
|
|
7621
7667
|
}
|
|
@@ -7630,8 +7676,8 @@ function pathHasIgnoredSegment(relPath, ignore) {
|
|
|
7630
7676
|
}
|
|
7631
7677
|
|
|
7632
7678
|
// dist/src/graph/git-hook-install.js
|
|
7633
|
-
import { chmodSync as chmodSync2, existsSync as existsSync20, mkdirSync as
|
|
7634
|
-
import { dirname as
|
|
7679
|
+
import { chmodSync as chmodSync2, existsSync as existsSync20, mkdirSync as mkdirSync14, readFileSync as readFileSync20, unlinkSync as unlinkSync8, writeFileSync as writeFileSync17 } from "node:fs";
|
|
7680
|
+
import { dirname as dirname9, join as join27, resolve as resolve3 } from "node:path";
|
|
7635
7681
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
7636
7682
|
var HOOK_BEGIN_MARKER = "# HIVEMIND_GRAPH_HOOK_BEGIN \u2014 managed by `hivemind graph init`";
|
|
7637
7683
|
var HOOK_END_MARKER = "# HIVEMIND_GRAPH_HOOK_END";
|
|
@@ -7723,7 +7769,7 @@ function installPostCommitHook(cwd, opts = {}) {
|
|
|
7723
7769
|
hint: "hivemind binary not found on PATH. Install hivemind globally (`npm install -g @deeplake/hivemind`) before running `hivemind graph init`, so the hook can find a stable absolute path to call."
|
|
7724
7770
|
};
|
|
7725
7771
|
}
|
|
7726
|
-
|
|
7772
|
+
mkdirSync14(dirname9(path), { recursive: true });
|
|
7727
7773
|
writeFileSync17(path, buildHookFile(hivemindPath), { mode: 493 });
|
|
7728
7774
|
try {
|
|
7729
7775
|
chmodSync2(path, 493);
|
|
@@ -8353,9 +8399,9 @@ function readGitBranch(cwd) {
|
|
|
8353
8399
|
}
|
|
8354
8400
|
|
|
8355
8401
|
// dist/src/commands/dashboard.js
|
|
8356
|
-
import { mkdirSync as
|
|
8402
|
+
import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync20 } from "node:fs";
|
|
8357
8403
|
import { homedir as homedir16 } from "node:os";
|
|
8358
|
-
import { dirname as
|
|
8404
|
+
import { dirname as dirname13, join as join36, resolve as resolve5 } from "node:path";
|
|
8359
8405
|
|
|
8360
8406
|
// dist/src/dashboard/data.js
|
|
8361
8407
|
import { existsSync as existsSync25, readFileSync as readFileSync25, readdirSync as readdirSync4, statSync as statSync3 } from "node:fs";
|
|
@@ -8363,9 +8409,9 @@ import { homedir as homedir15 } from "node:os";
|
|
|
8363
8409
|
import { join as join34 } from "node:path";
|
|
8364
8410
|
|
|
8365
8411
|
// dist/src/notifications/sources/org-stats.js
|
|
8366
|
-
import { existsSync as existsSync21, mkdirSync as
|
|
8412
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync15, readFileSync as readFileSync22, writeFileSync as writeFileSync18 } from "node:fs";
|
|
8367
8413
|
import { homedir as homedir12 } from "node:os";
|
|
8368
|
-
import { dirname as
|
|
8414
|
+
import { dirname as dirname10, join as join29 } from "node:path";
|
|
8369
8415
|
var log5 = (msg) => log2("notifications-org-stats", msg);
|
|
8370
8416
|
var FETCH_TIMEOUT_MS = 1500;
|
|
8371
8417
|
var DEFAULT_API_URL3 = "https://api.deeplake.ai";
|
|
@@ -8421,7 +8467,7 @@ function readCache2(scopeKey) {
|
|
|
8421
8467
|
}
|
|
8422
8468
|
function writeCache2(scopeKey, data) {
|
|
8423
8469
|
try {
|
|
8424
|
-
|
|
8470
|
+
mkdirSync15(dirname10(cacheFilePath()), { recursive: true });
|
|
8425
8471
|
const body = { fetchedAt: Date.now(), scopeKey, data };
|
|
8426
8472
|
writeFileSync18(cacheFilePath(), JSON.stringify(body), "utf-8");
|
|
8427
8473
|
} catch (e) {
|
|
@@ -8475,8 +8521,8 @@ async function fetchOrgStats(creds) {
|
|
|
8475
8521
|
}
|
|
8476
8522
|
|
|
8477
8523
|
// dist/src/notifications/usage-tracker.js
|
|
8478
|
-
import { appendFileSync as appendFileSync3, existsSync as existsSync22, mkdirSync as
|
|
8479
|
-
import { dirname as
|
|
8524
|
+
import { appendFileSync as appendFileSync3, existsSync as existsSync22, mkdirSync as mkdirSync16, readFileSync as readFileSync23, readdirSync as readdirSync3 } from "node:fs";
|
|
8525
|
+
import { dirname as dirname11, join as join30 } from "node:path";
|
|
8480
8526
|
import { homedir as homedir13 } from "node:os";
|
|
8481
8527
|
var log6 = (msg) => log2("usage-tracker", msg);
|
|
8482
8528
|
function statsFilePath() {
|
|
@@ -8542,12 +8588,12 @@ function countUserGeneratedSkills(userName) {
|
|
|
8542
8588
|
}
|
|
8543
8589
|
|
|
8544
8590
|
// dist/src/skillify/state.js
|
|
8545
|
-
import { readFileSync as readFileSync24, writeFileSync as writeFileSync19, writeSync, mkdirSync as
|
|
8591
|
+
import { readFileSync as readFileSync24, writeFileSync as writeFileSync19, writeSync, mkdirSync as mkdirSync17, renameSync as renameSync9, rmdirSync, existsSync as existsSync24, lstatSync as lstatSync6, unlinkSync as unlinkSync9, openSync as openSync2, closeSync as closeSync2 } from "node:fs";
|
|
8546
8592
|
import { join as join33 } from "node:path";
|
|
8547
8593
|
|
|
8548
8594
|
// dist/src/skillify/legacy-migration.js
|
|
8549
8595
|
import { existsSync as existsSync23, renameSync as renameSync8 } from "node:fs";
|
|
8550
|
-
import { dirname as
|
|
8596
|
+
import { dirname as dirname12, join as join32 } from "node:path";
|
|
8551
8597
|
|
|
8552
8598
|
// dist/src/skillify/state-dir.js
|
|
8553
8599
|
import { homedir as homedir14 } from "node:os";
|
|
@@ -8567,7 +8613,7 @@ function migrateLegacyStateDir() {
|
|
|
8567
8613
|
return;
|
|
8568
8614
|
attempted = true;
|
|
8569
8615
|
const current = getStateDir();
|
|
8570
|
-
const legacy = join32(
|
|
8616
|
+
const legacy = join32(dirname12(current), "skilify");
|
|
8571
8617
|
if (!existsSync23(legacy))
|
|
8572
8618
|
return;
|
|
8573
8619
|
if (existsSync23(current))
|
|
@@ -9299,7 +9345,7 @@ async function runDashboardCommand(rawArgs, runOpts = {}) {
|
|
|
9299
9345
|
const finalOut = outPath || defaultDashboardOutPath(data.repoKey);
|
|
9300
9346
|
const absOut = resolve5(finalOut);
|
|
9301
9347
|
try {
|
|
9302
|
-
|
|
9348
|
+
mkdirSync18(dirname13(absOut), { recursive: true });
|
|
9303
9349
|
writeFileSync20(absOut, html, "utf-8");
|
|
9304
9350
|
} catch (e) {
|
|
9305
9351
|
err(`hivemind dashboard: failed to write ${absOut}: ${e?.message ?? String(e)}
|
|
@@ -9379,12 +9425,12 @@ function defaultOnSignal(signal, handler) {
|
|
|
9379
9425
|
}
|
|
9380
9426
|
|
|
9381
9427
|
// dist/src/commands/skillify.js
|
|
9382
|
-
import { readdirSync as readdirSync8, existsSync as existsSync36, readFileSync as readFileSync33, mkdirSync as
|
|
9428
|
+
import { readdirSync as readdirSync8, existsSync as existsSync36, readFileSync as readFileSync33, mkdirSync as mkdirSync25, renameSync as renameSync12 } from "node:fs";
|
|
9383
9429
|
import { homedir as homedir25 } from "node:os";
|
|
9384
|
-
import { dirname as
|
|
9430
|
+
import { dirname as dirname18, join as join47 } from "node:path";
|
|
9385
9431
|
|
|
9386
9432
|
// dist/src/skillify/scope-config.js
|
|
9387
|
-
import { existsSync as existsSync26, mkdirSync as
|
|
9433
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync19, readFileSync as readFileSync26, writeFileSync as writeFileSync21 } from "node:fs";
|
|
9388
9434
|
import { join as join37 } from "node:path";
|
|
9389
9435
|
function configPath() {
|
|
9390
9436
|
return join37(getStateDir(), "config.json");
|
|
@@ -9407,17 +9453,17 @@ function loadScopeConfig() {
|
|
|
9407
9453
|
}
|
|
9408
9454
|
function saveScopeConfig(cfg) {
|
|
9409
9455
|
migrateLegacyStateDir();
|
|
9410
|
-
|
|
9456
|
+
mkdirSync19(getStateDir(), { recursive: true });
|
|
9411
9457
|
writeFileSync21(configPath(), JSON.stringify(cfg, null, 2));
|
|
9412
9458
|
}
|
|
9413
9459
|
|
|
9414
9460
|
// dist/src/skillify/pull.js
|
|
9415
|
-
import { existsSync as existsSync30, readFileSync as readFileSync29, writeFileSync as writeFileSync24, mkdirSync as
|
|
9461
|
+
import { existsSync as existsSync30, readFileSync as readFileSync29, writeFileSync as writeFileSync24, mkdirSync as mkdirSync22, renameSync as renameSync11, lstatSync as lstatSync8, readlinkSync as readlinkSync2, symlinkSync as symlinkSync2, unlinkSync as unlinkSync11 } from "node:fs";
|
|
9416
9462
|
import { homedir as homedir19 } from "node:os";
|
|
9417
|
-
import { dirname as
|
|
9463
|
+
import { dirname as dirname15, join as join41 } from "node:path";
|
|
9418
9464
|
|
|
9419
9465
|
// dist/src/skillify/skill-writer.js
|
|
9420
|
-
import { existsSync as existsSync27, mkdirSync as
|
|
9466
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync20, readFileSync as readFileSync27, readdirSync as readdirSync5, statSync as statSync5, writeFileSync as writeFileSync22 } from "node:fs";
|
|
9421
9467
|
import { homedir as homedir17 } from "node:os";
|
|
9422
9468
|
import { join as join38 } from "node:path";
|
|
9423
9469
|
function assertValidSkillName(name) {
|
|
@@ -9519,7 +9565,7 @@ function writeNewSkill(args) {
|
|
|
9519
9565
|
if (existsSync27(path)) {
|
|
9520
9566
|
throw new Error(`skill already exists at ${path}; use mergeSkill`);
|
|
9521
9567
|
}
|
|
9522
|
-
|
|
9568
|
+
mkdirSync20(dir, { recursive: true });
|
|
9523
9569
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
9524
9570
|
const author = args.author && args.author.length > 0 ? args.author : void 0;
|
|
9525
9571
|
const contributors = author ? [author] : [];
|
|
@@ -9570,8 +9616,8 @@ function resolveSkillsRoot(install, cwd) {
|
|
|
9570
9616
|
}
|
|
9571
9617
|
|
|
9572
9618
|
// dist/src/skillify/manifest.js
|
|
9573
|
-
import { existsSync as existsSync28, lstatSync as
|
|
9574
|
-
import { dirname as
|
|
9619
|
+
import { existsSync as existsSync28, lstatSync as lstatSync7, mkdirSync as mkdirSync21, readFileSync as readFileSync28, renameSync as renameSync10, unlinkSync as unlinkSync10, writeFileSync as writeFileSync23 } from "node:fs";
|
|
9620
|
+
import { dirname as dirname14, join as join39 } from "node:path";
|
|
9575
9621
|
function emptyManifest() {
|
|
9576
9622
|
return { version: 1, entries: [] };
|
|
9577
9623
|
}
|
|
@@ -9631,7 +9677,7 @@ function loadManifest(path = manifestPath()) {
|
|
|
9631
9677
|
}
|
|
9632
9678
|
function saveManifest(m, path = manifestPath()) {
|
|
9633
9679
|
migrateLegacyStateDir();
|
|
9634
|
-
|
|
9680
|
+
mkdirSync21(dirname14(path), { recursive: true });
|
|
9635
9681
|
const tmp = `${path}.tmp`;
|
|
9636
9682
|
writeFileSync23(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
|
|
9637
9683
|
renameSync10(tmp, path);
|
|
@@ -9659,7 +9705,7 @@ function unlinkSymlinks(paths) {
|
|
|
9659
9705
|
for (const path of paths) {
|
|
9660
9706
|
let st;
|
|
9661
9707
|
try {
|
|
9662
|
-
st =
|
|
9708
|
+
st = lstatSync7(path);
|
|
9663
9709
|
} catch {
|
|
9664
9710
|
continue;
|
|
9665
9711
|
}
|
|
@@ -9763,7 +9809,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
|
|
|
9763
9809
|
const link = join41(root, dirName);
|
|
9764
9810
|
let existing;
|
|
9765
9811
|
try {
|
|
9766
|
-
existing =
|
|
9812
|
+
existing = lstatSync8(link);
|
|
9767
9813
|
} catch {
|
|
9768
9814
|
existing = null;
|
|
9769
9815
|
}
|
|
@@ -9788,7 +9834,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
|
|
|
9788
9834
|
}
|
|
9789
9835
|
}
|
|
9790
9836
|
try {
|
|
9791
|
-
|
|
9837
|
+
mkdirSync22(dirname15(link), { recursive: true });
|
|
9792
9838
|
symlinkSync2(canonicalDir, link, "dir");
|
|
9793
9839
|
out.push(link);
|
|
9794
9840
|
} catch {
|
|
@@ -10028,7 +10074,7 @@ async function runPull(opts) {
|
|
|
10028
10074
|
});
|
|
10029
10075
|
let manifestError;
|
|
10030
10076
|
if (action === "wrote") {
|
|
10031
|
-
|
|
10077
|
+
mkdirSync22(skillDir2, { recursive: true });
|
|
10032
10078
|
if (existsSync30(skillFile)) {
|
|
10033
10079
|
try {
|
|
10034
10080
|
renameSync11(skillFile, `${skillFile}.bak`);
|
|
@@ -10077,7 +10123,7 @@ async function runPull(opts) {
|
|
|
10077
10123
|
}
|
|
10078
10124
|
|
|
10079
10125
|
// dist/src/skillify/unpull.js
|
|
10080
|
-
import { existsSync as existsSync31, readdirSync as readdirSync6, rmSync as
|
|
10126
|
+
import { existsSync as existsSync31, readdirSync as readdirSync6, rmSync as rmSync7, statSync as statSync6 } from "node:fs";
|
|
10081
10127
|
import { homedir as homedir20 } from "node:os";
|
|
10082
10128
|
import { join as join42 } from "node:path";
|
|
10083
10129
|
function resolveUnpullRoot(install, cwd) {
|
|
@@ -10149,7 +10195,7 @@ function runUnpull(opts) {
|
|
|
10149
10195
|
summary.wouldRemove++;
|
|
10150
10196
|
} else {
|
|
10151
10197
|
try {
|
|
10152
|
-
|
|
10198
|
+
rmSync7(path, { recursive: true, force: true });
|
|
10153
10199
|
unlinkSymlinks(entry.symlinks);
|
|
10154
10200
|
removePullEntry(opts.install, entry.installRoot, entry.dirName);
|
|
10155
10201
|
result.action = "removed";
|
|
@@ -10216,7 +10262,7 @@ function runUnpull(opts) {
|
|
|
10216
10262
|
summary.wouldRemove++;
|
|
10217
10263
|
} else {
|
|
10218
10264
|
try {
|
|
10219
|
-
|
|
10265
|
+
rmSync7(path, { recursive: true, force: true });
|
|
10220
10266
|
result.action = "removed";
|
|
10221
10267
|
summary.removed++;
|
|
10222
10268
|
} catch (e) {
|
|
@@ -10246,9 +10292,9 @@ function decideTargetForManifestEntry(entry, opts, userFilter, haveUserFilter) {
|
|
|
10246
10292
|
|
|
10247
10293
|
// dist/src/commands/mine-local.js
|
|
10248
10294
|
import { spawn as spawn2 } from "node:child_process";
|
|
10249
|
-
import { existsSync as existsSync35, mkdirSync as
|
|
10295
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync24, readFileSync as readFileSync32, writeFileSync as writeFileSync26 } from "node:fs";
|
|
10250
10296
|
import { homedir as homedir24 } from "node:os";
|
|
10251
|
-
import { basename as basename2, dirname as
|
|
10297
|
+
import { basename as basename2, dirname as dirname17, join as join46 } from "node:path";
|
|
10252
10298
|
|
|
10253
10299
|
// dist/src/skillify/local-source.js
|
|
10254
10300
|
import { readdirSync as readdirSync7, readFileSync as readFileSync30, existsSync as existsSync32, statSync as statSync7 } from "node:fs";
|
|
@@ -10556,9 +10602,9 @@ function extractJsonBlock(s) {
|
|
|
10556
10602
|
}
|
|
10557
10603
|
|
|
10558
10604
|
// dist/src/skillify/local-manifest.js
|
|
10559
|
-
import { existsSync as existsSync34, mkdirSync as
|
|
10605
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync23, readFileSync as readFileSync31, writeFileSync as writeFileSync25 } from "node:fs";
|
|
10560
10606
|
import { homedir as homedir23 } from "node:os";
|
|
10561
|
-
import { dirname as
|
|
10607
|
+
import { dirname as dirname16, join as join45 } from "node:path";
|
|
10562
10608
|
var LOCAL_MANIFEST_PATH = join45(homedir23(), ".claude", "hivemind", "local-mined.json");
|
|
10563
10609
|
var LOCAL_MINE_LOCK_PATH = join45(homedir23(), ".claude", "hivemind", "local-mined.lock");
|
|
10564
10610
|
function readLocalManifest(path = LOCAL_MANIFEST_PATH) {
|
|
@@ -10571,7 +10617,7 @@ function readLocalManifest(path = LOCAL_MANIFEST_PATH) {
|
|
|
10571
10617
|
}
|
|
10572
10618
|
}
|
|
10573
10619
|
function writeLocalManifest(m, path = LOCAL_MANIFEST_PATH) {
|
|
10574
|
-
|
|
10620
|
+
mkdirSync23(dirname16(path), { recursive: true });
|
|
10575
10621
|
writeFileSync25(path, JSON.stringify(m, null, 2));
|
|
10576
10622
|
}
|
|
10577
10623
|
function countLocalManifestEntries(path = LOCAL_MANIFEST_PATH) {
|
|
@@ -11007,7 +11053,7 @@ async function runMineLocalImpl(args) {
|
|
|
11007
11053
|
return;
|
|
11008
11054
|
}
|
|
11009
11055
|
const tmpDir = join46(homedir24(), ".claude", "hivemind", `mine-local-${Date.now()}`);
|
|
11010
|
-
|
|
11056
|
+
mkdirSync24(tmpDir, { recursive: true });
|
|
11011
11057
|
console.log(`Running ${picked.length} gate call(s) in parallel (concurrency=${GATE_CONCURRENCY}, timeout=${GATE_TIMEOUT_MS / 1e3}s each)...`);
|
|
11012
11058
|
const results = await parallelMap(picked, GATE_CONCURRENCY, async (s) => {
|
|
11013
11059
|
const shortId = s.sessionId.slice(0, 8);
|
|
@@ -11019,7 +11065,7 @@ async function runMineLocalImpl(args) {
|
|
|
11019
11065
|
}
|
|
11020
11066
|
const tail = pairs2.slice(-PER_SESSION_PAIR_CAP);
|
|
11021
11067
|
const sessionTmp = join46(tmpDir, `s-${shortId}`);
|
|
11022
|
-
|
|
11068
|
+
mkdirSync24(sessionTmp, { recursive: true });
|
|
11023
11069
|
const verdictPath = join46(sessionTmp, "verdict.json");
|
|
11024
11070
|
const prompt = buildSessionPrompt(tail, s, verdictPath);
|
|
11025
11071
|
writeFileSync26(join46(sessionTmp, "prompt.txt"), prompt);
|
|
@@ -11086,7 +11132,7 @@ async function runMineLocalImpl(args) {
|
|
|
11086
11132
|
sourceSessions: [session.sessionId],
|
|
11087
11133
|
agent: gateAgent
|
|
11088
11134
|
});
|
|
11089
|
-
const canonicalDir =
|
|
11135
|
+
const canonicalDir = dirname17(result.path);
|
|
11090
11136
|
const symlinks = fanOutRoots.length > 0 ? fanOutSymlinks(canonicalDir, basename2(canonicalDir), fanOutRoots) : [];
|
|
11091
11137
|
const symlinkSuffix = symlinks.length > 0 ? `, fan-out \u2192 ${symlinks.length} root(s)` : "";
|
|
11092
11138
|
console.log(` wrote ${skill.name} \u2190 session ${session.sessionId.slice(0, 8)} (${session.agent}${symlinkSuffix})`);
|
|
@@ -11320,7 +11366,7 @@ function promoteSkill(name, cwd) {
|
|
|
11320
11366
|
console.error(`Skill '${name}' already exists at ${globalPath}/SKILL.md \u2014 refusing to overwrite. Remove it first or rename the project skill.`);
|
|
11321
11367
|
process.exit(1);
|
|
11322
11368
|
}
|
|
11323
|
-
|
|
11369
|
+
mkdirSync25(dirname18(globalPath), { recursive: true });
|
|
11324
11370
|
renameSync12(projectPath, globalPath);
|
|
11325
11371
|
console.log(`Promoted '${name}' from ${projectPath} \u2192 ${globalPath}.`);
|
|
11326
11372
|
}
|
|
@@ -12345,14 +12391,14 @@ async function runContextCommand(args) {
|
|
|
12345
12391
|
|
|
12346
12392
|
// dist/src/cli/update.js
|
|
12347
12393
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
12348
|
-
import { closeSync as closeSync3, existsSync as existsSync37, mkdirSync as
|
|
12394
|
+
import { closeSync as closeSync3, existsSync as existsSync37, mkdirSync as mkdirSync26, openSync as openSync3, readFileSync as readFileSync35, realpathSync, unlinkSync as unlinkSync13, writeSync as writeSync2 } from "node:fs";
|
|
12349
12395
|
import { homedir as homedir26 } from "node:os";
|
|
12350
|
-
import { dirname as
|
|
12396
|
+
import { dirname as dirname20, join as join49, sep as sep2 } from "node:path";
|
|
12351
12397
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
12352
12398
|
|
|
12353
12399
|
// dist/src/utils/version-check.js
|
|
12354
12400
|
import { readFileSync as readFileSync34 } from "node:fs";
|
|
12355
|
-
import { dirname as
|
|
12401
|
+
import { dirname as dirname19, join as join48 } from "node:path";
|
|
12356
12402
|
function isNewer(latest, current) {
|
|
12357
12403
|
const parse = (v) => v.split(".").map(Number);
|
|
12358
12404
|
const [la, lb, lc] = parse(latest);
|
|
@@ -12374,7 +12420,7 @@ function detectInstallKind(argv1) {
|
|
|
12374
12420
|
return argv1 ?? process.argv[1] ?? fileURLToPath2(import.meta.url);
|
|
12375
12421
|
}
|
|
12376
12422
|
})();
|
|
12377
|
-
let dir =
|
|
12423
|
+
let dir = dirname20(realArgv1);
|
|
12378
12424
|
let installDir = null;
|
|
12379
12425
|
for (let i = 0; i < 10; i++) {
|
|
12380
12426
|
const pkgPath = `${dir}${sep2}package.json`;
|
|
@@ -12386,12 +12432,12 @@ function detectInstallKind(argv1) {
|
|
|
12386
12432
|
}
|
|
12387
12433
|
} catch {
|
|
12388
12434
|
}
|
|
12389
|
-
const parent =
|
|
12435
|
+
const parent = dirname20(dir);
|
|
12390
12436
|
if (parent === dir)
|
|
12391
12437
|
break;
|
|
12392
12438
|
dir = parent;
|
|
12393
12439
|
}
|
|
12394
|
-
installDir ??=
|
|
12440
|
+
installDir ??= dirname20(realArgv1);
|
|
12395
12441
|
if (realArgv1.includes(`${sep2}_npx${sep2}`) || realArgv1.includes(`${sep2}.npx${sep2}`)) {
|
|
12396
12442
|
return { kind: "npx", installDir };
|
|
12397
12443
|
}
|
|
@@ -12403,7 +12449,7 @@ function detectInstallKind(argv1) {
|
|
|
12403
12449
|
if (existsSync37(`${gitDir}${sep2}.git`)) {
|
|
12404
12450
|
return { kind: "local-dev", installDir };
|
|
12405
12451
|
}
|
|
12406
|
-
const parent =
|
|
12452
|
+
const parent = dirname20(gitDir);
|
|
12407
12453
|
if (parent === gitDir)
|
|
12408
12454
|
break;
|
|
12409
12455
|
gitDir = parent;
|
|
@@ -12425,7 +12471,7 @@ var defaultSpawn = (cmd, args) => {
|
|
|
12425
12471
|
execFileSync6(cmd, args, { stdio: "inherit" });
|
|
12426
12472
|
};
|
|
12427
12473
|
function tryAcquireLock(path) {
|
|
12428
|
-
|
|
12474
|
+
mkdirSync26(dirname20(path), { recursive: true, mode: 448 });
|
|
12429
12475
|
const claim = () => {
|
|
12430
12476
|
const fd = openSync3(path, "wx", 384);
|
|
12431
12477
|
writeSync2(fd, String(process.pid));
|