@deeplake/hivemind 0.7.80 → 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 +131 -94
- package/codex/bundle/capture.js +66 -39
- 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 +56 -36
- 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 +17 -13
- 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 +73 -46
- 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 +32 -28
- 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 +17 -13
- 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/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");
|
|
@@ -3691,7 +3724,7 @@ ${after}`;
|
|
|
3691
3724
|
function installPi() {
|
|
3692
3725
|
ensureDir(PI_AGENT_DIR);
|
|
3693
3726
|
if (existsSync9(LEGACY_SKILL_DIR)) {
|
|
3694
|
-
|
|
3727
|
+
rmSync5(LEGACY_SKILL_DIR, { recursive: true, force: true });
|
|
3695
3728
|
}
|
|
3696
3729
|
const prior = existsSync9(AGENTS_MD) ? readFileSync7(AGENTS_MD, "utf-8") : null;
|
|
3697
3730
|
const next = upsertHivemindBlock(prior);
|
|
@@ -3741,22 +3774,22 @@ function installPi() {
|
|
|
3741
3774
|
}
|
|
3742
3775
|
function uninstallPi() {
|
|
3743
3776
|
if (existsSync9(LEGACY_SKILL_DIR)) {
|
|
3744
|
-
|
|
3777
|
+
rmSync5(LEGACY_SKILL_DIR, { recursive: true, force: true });
|
|
3745
3778
|
log(` pi removed ${LEGACY_SKILL_DIR}`);
|
|
3746
3779
|
}
|
|
3747
3780
|
if (existsSync9(EXTENSION_PATH)) {
|
|
3748
|
-
|
|
3781
|
+
rmSync5(EXTENSION_PATH, { force: true });
|
|
3749
3782
|
log(` pi removed extension ${EXTENSION_PATH}`);
|
|
3750
3783
|
}
|
|
3751
3784
|
if (existsSync9(WIKI_WORKER_DIR)) {
|
|
3752
|
-
|
|
3785
|
+
rmSync5(WIKI_WORKER_DIR, { recursive: true, force: true });
|
|
3753
3786
|
log(` pi removed wiki-worker dir ${WIKI_WORKER_DIR}`);
|
|
3754
3787
|
}
|
|
3755
3788
|
if (existsSync9(AGENTS_MD)) {
|
|
3756
3789
|
const prior = readFileSync7(AGENTS_MD, "utf-8");
|
|
3757
3790
|
const stripped = stripHivemindBlock(prior);
|
|
3758
3791
|
if (stripped.trim().length === 0) {
|
|
3759
|
-
|
|
3792
|
+
rmSync5(AGENTS_MD, { force: true });
|
|
3760
3793
|
log(` pi removed empty ${AGENTS_MD}`);
|
|
3761
3794
|
} else {
|
|
3762
3795
|
writeFileSync6(AGENTS_MD, stripped);
|
|
@@ -3764,12 +3797,12 @@ function uninstallPi() {
|
|
|
3764
3797
|
}
|
|
3765
3798
|
}
|
|
3766
3799
|
if (existsSync9(VERSION_DIR)) {
|
|
3767
|
-
|
|
3800
|
+
rmSync5(VERSION_DIR, { recursive: true, force: true });
|
|
3768
3801
|
}
|
|
3769
3802
|
}
|
|
3770
3803
|
|
|
3771
3804
|
// dist/src/cli/embeddings.js
|
|
3772
|
-
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";
|
|
3773
3806
|
import { execFileSync as execFileSync3, spawnSync } from "node:child_process";
|
|
3774
3807
|
import { userInfo } from "node:os";
|
|
3775
3808
|
import { join as join12 } from "node:path";
|
|
@@ -3913,7 +3946,7 @@ function isSymlinkToSharedDeps(linkPath, sharedNodeModules) {
|
|
|
3913
3946
|
if (!existsSync11(linkPath))
|
|
3914
3947
|
return false;
|
|
3915
3948
|
try {
|
|
3916
|
-
if (!
|
|
3949
|
+
if (!lstatSync5(linkPath).isSymbolicLink())
|
|
3917
3950
|
return false;
|
|
3918
3951
|
return readlinkSync(linkPath) === sharedNodeModules;
|
|
3919
3952
|
} catch {
|
|
@@ -3925,7 +3958,7 @@ function linkStateFor(install, sharedNodeModules = SHARED_NODE_MODULES) {
|
|
|
3925
3958
|
if (!existsSync11(link) && !isSymbolicLink(link))
|
|
3926
3959
|
return { kind: "no-node-modules" };
|
|
3927
3960
|
try {
|
|
3928
|
-
if (
|
|
3961
|
+
if (lstatSync5(link).isSymbolicLink()) {
|
|
3929
3962
|
const target = readlinkSync(link);
|
|
3930
3963
|
return target === sharedNodeModules ? { kind: "linked-to-shared" } : { kind: "linked-elsewhere", target };
|
|
3931
3964
|
}
|
|
@@ -3936,7 +3969,7 @@ function linkStateFor(install, sharedNodeModules = SHARED_NODE_MODULES) {
|
|
|
3936
3969
|
}
|
|
3937
3970
|
function isSymbolicLink(path) {
|
|
3938
3971
|
try {
|
|
3939
|
-
return
|
|
3972
|
+
return lstatSync5(path).isSymbolicLink();
|
|
3940
3973
|
} catch {
|
|
3941
3974
|
return false;
|
|
3942
3975
|
}
|
|
@@ -4011,7 +4044,7 @@ function uninstallEmbeddings(opts) {
|
|
|
4011
4044
|
}
|
|
4012
4045
|
}
|
|
4013
4046
|
if (opts?.prune && existsSync11(SHARED_DIR)) {
|
|
4014
|
-
|
|
4047
|
+
rmSync6(SHARED_DIR, { recursive: true, force: true });
|
|
4015
4048
|
log(` Embeddings pruned ${SHARED_DIR}`);
|
|
4016
4049
|
}
|
|
4017
4050
|
setEmbeddingsEnabled(false);
|
|
@@ -4524,8 +4557,8 @@ function loadConfig() {
|
|
|
4524
4557
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
4525
4558
|
|
|
4526
4559
|
// dist/src/utils/debug.js
|
|
4527
|
-
import { appendFileSync } from "node:fs";
|
|
4528
|
-
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";
|
|
4529
4562
|
import { homedir as homedir8 } from "node:os";
|
|
4530
4563
|
var LOG = join17(homedir8(), ".deeplake", "hook-debug.log");
|
|
4531
4564
|
function isDebug() {
|
|
@@ -4534,8 +4567,12 @@ function isDebug() {
|
|
|
4534
4567
|
function log2(tag, msg) {
|
|
4535
4568
|
if (!isDebug())
|
|
4536
4569
|
return;
|
|
4537
|
-
|
|
4570
|
+
try {
|
|
4571
|
+
mkdirSync5(dirname3(LOG), { recursive: true });
|
|
4572
|
+
appendFileSync(LOG, `${(/* @__PURE__ */ new Date()).toISOString()} [${tag}] ${msg}
|
|
4538
4573
|
`);
|
|
4574
|
+
} catch {
|
|
4575
|
+
}
|
|
4539
4576
|
}
|
|
4540
4577
|
|
|
4541
4578
|
// dist/src/utils/sql.js
|
|
@@ -4744,7 +4781,7 @@ function isMissingTableError(message) {
|
|
|
4744
4781
|
}
|
|
4745
4782
|
|
|
4746
4783
|
// dist/src/notifications/queue.js
|
|
4747
|
-
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";
|
|
4748
4785
|
import { join as join18, resolve } from "node:path";
|
|
4749
4786
|
import { homedir as homedir9 } from "node:os";
|
|
4750
4787
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
@@ -4782,14 +4819,14 @@ function writeQueue(q) {
|
|
|
4782
4819
|
if (!_isQueuePathInsideHome(path, home)) {
|
|
4783
4820
|
throw new Error(`notifications-queue write blocked: ${path} is outside ${home}`);
|
|
4784
4821
|
}
|
|
4785
|
-
|
|
4822
|
+
mkdirSync6(join18(home, ".deeplake"), { recursive: true, mode: 448 });
|
|
4786
4823
|
const tmp = `${path}.${process.pid}.tmp`;
|
|
4787
4824
|
writeFileSync10(tmp, JSON.stringify(q, null, 2), { mode: 384 });
|
|
4788
4825
|
renameSync3(tmp, path);
|
|
4789
4826
|
}
|
|
4790
4827
|
async function withQueueLock(fn) {
|
|
4791
4828
|
const path = lockPath();
|
|
4792
|
-
|
|
4829
|
+
mkdirSync6(join18(homedir9(), ".deeplake"), { recursive: true, mode: 448 });
|
|
4793
4830
|
let fd = null;
|
|
4794
4831
|
for (let attempt = 0; attempt < LOCK_RETRY_MAX; attempt++) {
|
|
4795
4832
|
try {
|
|
@@ -5688,8 +5725,8 @@ import { createHash as createHash6 } from "node:crypto";
|
|
|
5688
5725
|
|
|
5689
5726
|
// dist/src/graph/cache.js
|
|
5690
5727
|
import { createHash } from "node:crypto";
|
|
5691
|
-
import { existsSync as existsSync15, mkdirSync as
|
|
5692
|
-
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";
|
|
5693
5730
|
var CACHE_SCHEMA_VERSION = 1;
|
|
5694
5731
|
function fileContentHash(contents) {
|
|
5695
5732
|
return createHash("sha256").update(contents).digest("hex");
|
|
@@ -5789,7 +5826,7 @@ function writeCache(baseDir, contentSha256, extraction) {
|
|
|
5789
5826
|
};
|
|
5790
5827
|
const path = cachePath(baseDir, contentSha256);
|
|
5791
5828
|
try {
|
|
5792
|
-
|
|
5829
|
+
mkdirSync8(dirname4(path), { recursive: true });
|
|
5793
5830
|
const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
|
|
5794
5831
|
writeFileSync12(tmp, JSON.stringify(entry));
|
|
5795
5832
|
renameSync4(tmp, path);
|
|
@@ -5922,8 +5959,8 @@ function canonicalJSON(value) {
|
|
|
5922
5959
|
// dist/src/graph/deeplake-pull.js
|
|
5923
5960
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
5924
5961
|
import { createHash as createHash5 } from "node:crypto";
|
|
5925
|
-
import { existsSync as existsSync18, mkdirSync as
|
|
5926
|
-
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";
|
|
5927
5964
|
|
|
5928
5965
|
// dist/src/utils/repo-identity.js
|
|
5929
5966
|
import { execSync as execSync2 } from "node:child_process";
|
|
@@ -5973,8 +6010,8 @@ function deriveProjectKey(cwd) {
|
|
|
5973
6010
|
}
|
|
5974
6011
|
|
|
5975
6012
|
// dist/src/graph/last-build.js
|
|
5976
|
-
import { existsSync as existsSync16, mkdirSync as
|
|
5977
|
-
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";
|
|
5978
6015
|
function lastBuildPath(baseDir, worktreeId) {
|
|
5979
6016
|
if (worktreeId !== void 0) {
|
|
5980
6017
|
return join21(baseDir, "worktrees", worktreeId, ".last-build.json");
|
|
@@ -5984,7 +6021,7 @@ function lastBuildPath(baseDir, worktreeId) {
|
|
|
5984
6021
|
function writeLastBuild(baseDir, state, worktreeId) {
|
|
5985
6022
|
const path = lastBuildPath(baseDir, worktreeId);
|
|
5986
6023
|
try {
|
|
5987
|
-
|
|
6024
|
+
mkdirSync9(dirname5(path), { recursive: true });
|
|
5988
6025
|
const tmp = `${path}.tmp.${process.pid}.${Date.now()}`;
|
|
5989
6026
|
writeFileSync13(tmp, JSON.stringify(state));
|
|
5990
6027
|
renameSync5(tmp, path);
|
|
@@ -6033,15 +6070,15 @@ function readLastBuild(baseDir, worktreeId) {
|
|
|
6033
6070
|
}
|
|
6034
6071
|
|
|
6035
6072
|
// dist/src/graph/history.js
|
|
6036
|
-
import { appendFileSync as appendFileSync2, existsSync as existsSync17, mkdirSync as
|
|
6037
|
-
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";
|
|
6038
6075
|
function historyPath(baseDir) {
|
|
6039
6076
|
return join22(baseDir, "history.jsonl");
|
|
6040
6077
|
}
|
|
6041
6078
|
function appendHistoryEntry(baseDir, entry) {
|
|
6042
6079
|
const path = historyPath(baseDir);
|
|
6043
6080
|
try {
|
|
6044
|
-
|
|
6081
|
+
mkdirSync10(dirname6(path), { recursive: true });
|
|
6045
6082
|
appendFileSync2(path, JSON.stringify(entry) + "\n");
|
|
6046
6083
|
} catch {
|
|
6047
6084
|
}
|
|
@@ -6120,9 +6157,9 @@ function parseLine(line) {
|
|
|
6120
6157
|
|
|
6121
6158
|
// dist/src/graph/snapshot.js
|
|
6122
6159
|
import { createHash as createHash4 } from "node:crypto";
|
|
6123
|
-
import { mkdirSync as
|
|
6160
|
+
import { mkdirSync as mkdirSync11, renameSync as renameSync6, writeFileSync as writeFileSync14 } from "node:fs";
|
|
6124
6161
|
import { homedir as homedir10 } from "node:os";
|
|
6125
|
-
import { dirname as
|
|
6162
|
+
import { dirname as dirname7, join as join23 } from "node:path";
|
|
6126
6163
|
|
|
6127
6164
|
// dist/src/graph/resolve/cross-file.js
|
|
6128
6165
|
import { posix } from "node:path";
|
|
@@ -6502,7 +6539,7 @@ function writeSnapshot(snapshot, baseDir, trigger = "unknown", worktreeId) {
|
|
|
6502
6539
|
return { snapshotPath, latestCommitPath, snapshotSha256: sha256 };
|
|
6503
6540
|
}
|
|
6504
6541
|
function writeFileAtomic(filePath, contents) {
|
|
6505
|
-
|
|
6542
|
+
mkdirSync11(dirname7(filePath), { recursive: true });
|
|
6506
6543
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
6507
6544
|
writeFileSync14(tmp, contents);
|
|
6508
6545
|
renameSync6(tmp, filePath);
|
|
@@ -6659,7 +6696,7 @@ function coerceSnapshotPayload(raw) {
|
|
|
6659
6696
|
return null;
|
|
6660
6697
|
}
|
|
6661
6698
|
function writeFileAtomic2(filePath, contents) {
|
|
6662
|
-
|
|
6699
|
+
mkdirSync12(dirname8(filePath), { recursive: true });
|
|
6663
6700
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
6664
6701
|
writeFileSync15(tmp, contents);
|
|
6665
6702
|
renameSync7(tmp, filePath);
|
|
@@ -7543,7 +7580,7 @@ function extractFile(sourceCode, relativePath) {
|
|
|
7543
7580
|
}
|
|
7544
7581
|
|
|
7545
7582
|
// dist/src/graph/ignore-config.js
|
|
7546
|
-
import { mkdirSync as
|
|
7583
|
+
import { mkdirSync as mkdirSync13, readFileSync as readFileSync19, writeFileSync as writeFileSync16 } from "node:fs";
|
|
7547
7584
|
import { homedir as homedir11 } from "node:os";
|
|
7548
7585
|
import { join as join26 } from "node:path";
|
|
7549
7586
|
var DEFAULT_IGNORE_DIRS = [
|
|
@@ -7624,7 +7661,7 @@ function loadGraphIgnore(deeplakeDir = join26(homedir11(), ".deeplake")) {
|
|
|
7624
7661
|
} catch {
|
|
7625
7662
|
}
|
|
7626
7663
|
try {
|
|
7627
|
-
|
|
7664
|
+
mkdirSync13(deeplakeDir, { recursive: true });
|
|
7628
7665
|
writeFileSync16(path, JSON.stringify(defaultConfigObject(), null, 2) + "\n", { flag: "wx" });
|
|
7629
7666
|
} catch {
|
|
7630
7667
|
}
|
|
@@ -7639,8 +7676,8 @@ function pathHasIgnoredSegment(relPath, ignore) {
|
|
|
7639
7676
|
}
|
|
7640
7677
|
|
|
7641
7678
|
// dist/src/graph/git-hook-install.js
|
|
7642
|
-
import { chmodSync as chmodSync2, existsSync as existsSync20, mkdirSync as
|
|
7643
|
-
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";
|
|
7644
7681
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
7645
7682
|
var HOOK_BEGIN_MARKER = "# HIVEMIND_GRAPH_HOOK_BEGIN \u2014 managed by `hivemind graph init`";
|
|
7646
7683
|
var HOOK_END_MARKER = "# HIVEMIND_GRAPH_HOOK_END";
|
|
@@ -7732,7 +7769,7 @@ function installPostCommitHook(cwd, opts = {}) {
|
|
|
7732
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."
|
|
7733
7770
|
};
|
|
7734
7771
|
}
|
|
7735
|
-
|
|
7772
|
+
mkdirSync14(dirname9(path), { recursive: true });
|
|
7736
7773
|
writeFileSync17(path, buildHookFile(hivemindPath), { mode: 493 });
|
|
7737
7774
|
try {
|
|
7738
7775
|
chmodSync2(path, 493);
|
|
@@ -8362,9 +8399,9 @@ function readGitBranch(cwd) {
|
|
|
8362
8399
|
}
|
|
8363
8400
|
|
|
8364
8401
|
// dist/src/commands/dashboard.js
|
|
8365
|
-
import { mkdirSync as
|
|
8402
|
+
import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync20 } from "node:fs";
|
|
8366
8403
|
import { homedir as homedir16 } from "node:os";
|
|
8367
|
-
import { dirname as
|
|
8404
|
+
import { dirname as dirname13, join as join36, resolve as resolve5 } from "node:path";
|
|
8368
8405
|
|
|
8369
8406
|
// dist/src/dashboard/data.js
|
|
8370
8407
|
import { existsSync as existsSync25, readFileSync as readFileSync25, readdirSync as readdirSync4, statSync as statSync3 } from "node:fs";
|
|
@@ -8372,9 +8409,9 @@ import { homedir as homedir15 } from "node:os";
|
|
|
8372
8409
|
import { join as join34 } from "node:path";
|
|
8373
8410
|
|
|
8374
8411
|
// dist/src/notifications/sources/org-stats.js
|
|
8375
|
-
import { existsSync as existsSync21, mkdirSync as
|
|
8412
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync15, readFileSync as readFileSync22, writeFileSync as writeFileSync18 } from "node:fs";
|
|
8376
8413
|
import { homedir as homedir12 } from "node:os";
|
|
8377
|
-
import { dirname as
|
|
8414
|
+
import { dirname as dirname10, join as join29 } from "node:path";
|
|
8378
8415
|
var log5 = (msg) => log2("notifications-org-stats", msg);
|
|
8379
8416
|
var FETCH_TIMEOUT_MS = 1500;
|
|
8380
8417
|
var DEFAULT_API_URL3 = "https://api.deeplake.ai";
|
|
@@ -8430,7 +8467,7 @@ function readCache2(scopeKey) {
|
|
|
8430
8467
|
}
|
|
8431
8468
|
function writeCache2(scopeKey, data) {
|
|
8432
8469
|
try {
|
|
8433
|
-
|
|
8470
|
+
mkdirSync15(dirname10(cacheFilePath()), { recursive: true });
|
|
8434
8471
|
const body = { fetchedAt: Date.now(), scopeKey, data };
|
|
8435
8472
|
writeFileSync18(cacheFilePath(), JSON.stringify(body), "utf-8");
|
|
8436
8473
|
} catch (e) {
|
|
@@ -8484,8 +8521,8 @@ async function fetchOrgStats(creds) {
|
|
|
8484
8521
|
}
|
|
8485
8522
|
|
|
8486
8523
|
// dist/src/notifications/usage-tracker.js
|
|
8487
|
-
import { appendFileSync as appendFileSync3, existsSync as existsSync22, mkdirSync as
|
|
8488
|
-
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";
|
|
8489
8526
|
import { homedir as homedir13 } from "node:os";
|
|
8490
8527
|
var log6 = (msg) => log2("usage-tracker", msg);
|
|
8491
8528
|
function statsFilePath() {
|
|
@@ -8551,12 +8588,12 @@ function countUserGeneratedSkills(userName) {
|
|
|
8551
8588
|
}
|
|
8552
8589
|
|
|
8553
8590
|
// dist/src/skillify/state.js
|
|
8554
|
-
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";
|
|
8555
8592
|
import { join as join33 } from "node:path";
|
|
8556
8593
|
|
|
8557
8594
|
// dist/src/skillify/legacy-migration.js
|
|
8558
8595
|
import { existsSync as existsSync23, renameSync as renameSync8 } from "node:fs";
|
|
8559
|
-
import { dirname as
|
|
8596
|
+
import { dirname as dirname12, join as join32 } from "node:path";
|
|
8560
8597
|
|
|
8561
8598
|
// dist/src/skillify/state-dir.js
|
|
8562
8599
|
import { homedir as homedir14 } from "node:os";
|
|
@@ -8576,7 +8613,7 @@ function migrateLegacyStateDir() {
|
|
|
8576
8613
|
return;
|
|
8577
8614
|
attempted = true;
|
|
8578
8615
|
const current = getStateDir();
|
|
8579
|
-
const legacy = join32(
|
|
8616
|
+
const legacy = join32(dirname12(current), "skilify");
|
|
8580
8617
|
if (!existsSync23(legacy))
|
|
8581
8618
|
return;
|
|
8582
8619
|
if (existsSync23(current))
|
|
@@ -9308,7 +9345,7 @@ async function runDashboardCommand(rawArgs, runOpts = {}) {
|
|
|
9308
9345
|
const finalOut = outPath || defaultDashboardOutPath(data.repoKey);
|
|
9309
9346
|
const absOut = resolve5(finalOut);
|
|
9310
9347
|
try {
|
|
9311
|
-
|
|
9348
|
+
mkdirSync18(dirname13(absOut), { recursive: true });
|
|
9312
9349
|
writeFileSync20(absOut, html, "utf-8");
|
|
9313
9350
|
} catch (e) {
|
|
9314
9351
|
err(`hivemind dashboard: failed to write ${absOut}: ${e?.message ?? String(e)}
|
|
@@ -9388,12 +9425,12 @@ function defaultOnSignal(signal, handler) {
|
|
|
9388
9425
|
}
|
|
9389
9426
|
|
|
9390
9427
|
// dist/src/commands/skillify.js
|
|
9391
|
-
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";
|
|
9392
9429
|
import { homedir as homedir25 } from "node:os";
|
|
9393
|
-
import { dirname as
|
|
9430
|
+
import { dirname as dirname18, join as join47 } from "node:path";
|
|
9394
9431
|
|
|
9395
9432
|
// dist/src/skillify/scope-config.js
|
|
9396
|
-
import { existsSync as existsSync26, mkdirSync as
|
|
9433
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync19, readFileSync as readFileSync26, writeFileSync as writeFileSync21 } from "node:fs";
|
|
9397
9434
|
import { join as join37 } from "node:path";
|
|
9398
9435
|
function configPath() {
|
|
9399
9436
|
return join37(getStateDir(), "config.json");
|
|
@@ -9416,17 +9453,17 @@ function loadScopeConfig() {
|
|
|
9416
9453
|
}
|
|
9417
9454
|
function saveScopeConfig(cfg) {
|
|
9418
9455
|
migrateLegacyStateDir();
|
|
9419
|
-
|
|
9456
|
+
mkdirSync19(getStateDir(), { recursive: true });
|
|
9420
9457
|
writeFileSync21(configPath(), JSON.stringify(cfg, null, 2));
|
|
9421
9458
|
}
|
|
9422
9459
|
|
|
9423
9460
|
// dist/src/skillify/pull.js
|
|
9424
|
-
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";
|
|
9425
9462
|
import { homedir as homedir19 } from "node:os";
|
|
9426
|
-
import { dirname as
|
|
9463
|
+
import { dirname as dirname15, join as join41 } from "node:path";
|
|
9427
9464
|
|
|
9428
9465
|
// dist/src/skillify/skill-writer.js
|
|
9429
|
-
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";
|
|
9430
9467
|
import { homedir as homedir17 } from "node:os";
|
|
9431
9468
|
import { join as join38 } from "node:path";
|
|
9432
9469
|
function assertValidSkillName(name) {
|
|
@@ -9528,7 +9565,7 @@ function writeNewSkill(args) {
|
|
|
9528
9565
|
if (existsSync27(path)) {
|
|
9529
9566
|
throw new Error(`skill already exists at ${path}; use mergeSkill`);
|
|
9530
9567
|
}
|
|
9531
|
-
|
|
9568
|
+
mkdirSync20(dir, { recursive: true });
|
|
9532
9569
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
9533
9570
|
const author = args.author && args.author.length > 0 ? args.author : void 0;
|
|
9534
9571
|
const contributors = author ? [author] : [];
|
|
@@ -9579,8 +9616,8 @@ function resolveSkillsRoot(install, cwd) {
|
|
|
9579
9616
|
}
|
|
9580
9617
|
|
|
9581
9618
|
// dist/src/skillify/manifest.js
|
|
9582
|
-
import { existsSync as existsSync28, lstatSync as
|
|
9583
|
-
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";
|
|
9584
9621
|
function emptyManifest() {
|
|
9585
9622
|
return { version: 1, entries: [] };
|
|
9586
9623
|
}
|
|
@@ -9640,7 +9677,7 @@ function loadManifest(path = manifestPath()) {
|
|
|
9640
9677
|
}
|
|
9641
9678
|
function saveManifest(m, path = manifestPath()) {
|
|
9642
9679
|
migrateLegacyStateDir();
|
|
9643
|
-
|
|
9680
|
+
mkdirSync21(dirname14(path), { recursive: true });
|
|
9644
9681
|
const tmp = `${path}.tmp`;
|
|
9645
9682
|
writeFileSync23(tmp, JSON.stringify(m, null, 2) + "\n", { mode: 384 });
|
|
9646
9683
|
renameSync10(tmp, path);
|
|
@@ -9668,7 +9705,7 @@ function unlinkSymlinks(paths) {
|
|
|
9668
9705
|
for (const path of paths) {
|
|
9669
9706
|
let st;
|
|
9670
9707
|
try {
|
|
9671
|
-
st =
|
|
9708
|
+
st = lstatSync7(path);
|
|
9672
9709
|
} catch {
|
|
9673
9710
|
continue;
|
|
9674
9711
|
}
|
|
@@ -9772,7 +9809,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
|
|
|
9772
9809
|
const link = join41(root, dirName);
|
|
9773
9810
|
let existing;
|
|
9774
9811
|
try {
|
|
9775
|
-
existing =
|
|
9812
|
+
existing = lstatSync8(link);
|
|
9776
9813
|
} catch {
|
|
9777
9814
|
existing = null;
|
|
9778
9815
|
}
|
|
@@ -9797,7 +9834,7 @@ function fanOutSymlinks(canonicalDir, dirName, agentRoots) {
|
|
|
9797
9834
|
}
|
|
9798
9835
|
}
|
|
9799
9836
|
try {
|
|
9800
|
-
|
|
9837
|
+
mkdirSync22(dirname15(link), { recursive: true });
|
|
9801
9838
|
symlinkSync2(canonicalDir, link, "dir");
|
|
9802
9839
|
out.push(link);
|
|
9803
9840
|
} catch {
|
|
@@ -10037,7 +10074,7 @@ async function runPull(opts) {
|
|
|
10037
10074
|
});
|
|
10038
10075
|
let manifestError;
|
|
10039
10076
|
if (action === "wrote") {
|
|
10040
|
-
|
|
10077
|
+
mkdirSync22(skillDir2, { recursive: true });
|
|
10041
10078
|
if (existsSync30(skillFile)) {
|
|
10042
10079
|
try {
|
|
10043
10080
|
renameSync11(skillFile, `${skillFile}.bak`);
|
|
@@ -10086,7 +10123,7 @@ async function runPull(opts) {
|
|
|
10086
10123
|
}
|
|
10087
10124
|
|
|
10088
10125
|
// dist/src/skillify/unpull.js
|
|
10089
|
-
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";
|
|
10090
10127
|
import { homedir as homedir20 } from "node:os";
|
|
10091
10128
|
import { join as join42 } from "node:path";
|
|
10092
10129
|
function resolveUnpullRoot(install, cwd) {
|
|
@@ -10158,7 +10195,7 @@ function runUnpull(opts) {
|
|
|
10158
10195
|
summary.wouldRemove++;
|
|
10159
10196
|
} else {
|
|
10160
10197
|
try {
|
|
10161
|
-
|
|
10198
|
+
rmSync7(path, { recursive: true, force: true });
|
|
10162
10199
|
unlinkSymlinks(entry.symlinks);
|
|
10163
10200
|
removePullEntry(opts.install, entry.installRoot, entry.dirName);
|
|
10164
10201
|
result.action = "removed";
|
|
@@ -10225,7 +10262,7 @@ function runUnpull(opts) {
|
|
|
10225
10262
|
summary.wouldRemove++;
|
|
10226
10263
|
} else {
|
|
10227
10264
|
try {
|
|
10228
|
-
|
|
10265
|
+
rmSync7(path, { recursive: true, force: true });
|
|
10229
10266
|
result.action = "removed";
|
|
10230
10267
|
summary.removed++;
|
|
10231
10268
|
} catch (e) {
|
|
@@ -10255,9 +10292,9 @@ function decideTargetForManifestEntry(entry, opts, userFilter, haveUserFilter) {
|
|
|
10255
10292
|
|
|
10256
10293
|
// dist/src/commands/mine-local.js
|
|
10257
10294
|
import { spawn as spawn2 } from "node:child_process";
|
|
10258
|
-
import { existsSync as existsSync35, mkdirSync as
|
|
10295
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync24, readFileSync as readFileSync32, writeFileSync as writeFileSync26 } from "node:fs";
|
|
10259
10296
|
import { homedir as homedir24 } from "node:os";
|
|
10260
|
-
import { basename as basename2, dirname as
|
|
10297
|
+
import { basename as basename2, dirname as dirname17, join as join46 } from "node:path";
|
|
10261
10298
|
|
|
10262
10299
|
// dist/src/skillify/local-source.js
|
|
10263
10300
|
import { readdirSync as readdirSync7, readFileSync as readFileSync30, existsSync as existsSync32, statSync as statSync7 } from "node:fs";
|
|
@@ -10565,9 +10602,9 @@ function extractJsonBlock(s) {
|
|
|
10565
10602
|
}
|
|
10566
10603
|
|
|
10567
10604
|
// dist/src/skillify/local-manifest.js
|
|
10568
|
-
import { existsSync as existsSync34, mkdirSync as
|
|
10605
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync23, readFileSync as readFileSync31, writeFileSync as writeFileSync25 } from "node:fs";
|
|
10569
10606
|
import { homedir as homedir23 } from "node:os";
|
|
10570
|
-
import { dirname as
|
|
10607
|
+
import { dirname as dirname16, join as join45 } from "node:path";
|
|
10571
10608
|
var LOCAL_MANIFEST_PATH = join45(homedir23(), ".claude", "hivemind", "local-mined.json");
|
|
10572
10609
|
var LOCAL_MINE_LOCK_PATH = join45(homedir23(), ".claude", "hivemind", "local-mined.lock");
|
|
10573
10610
|
function readLocalManifest(path = LOCAL_MANIFEST_PATH) {
|
|
@@ -10580,7 +10617,7 @@ function readLocalManifest(path = LOCAL_MANIFEST_PATH) {
|
|
|
10580
10617
|
}
|
|
10581
10618
|
}
|
|
10582
10619
|
function writeLocalManifest(m, path = LOCAL_MANIFEST_PATH) {
|
|
10583
|
-
|
|
10620
|
+
mkdirSync23(dirname16(path), { recursive: true });
|
|
10584
10621
|
writeFileSync25(path, JSON.stringify(m, null, 2));
|
|
10585
10622
|
}
|
|
10586
10623
|
function countLocalManifestEntries(path = LOCAL_MANIFEST_PATH) {
|
|
@@ -11016,7 +11053,7 @@ async function runMineLocalImpl(args) {
|
|
|
11016
11053
|
return;
|
|
11017
11054
|
}
|
|
11018
11055
|
const tmpDir = join46(homedir24(), ".claude", "hivemind", `mine-local-${Date.now()}`);
|
|
11019
|
-
|
|
11056
|
+
mkdirSync24(tmpDir, { recursive: true });
|
|
11020
11057
|
console.log(`Running ${picked.length} gate call(s) in parallel (concurrency=${GATE_CONCURRENCY}, timeout=${GATE_TIMEOUT_MS / 1e3}s each)...`);
|
|
11021
11058
|
const results = await parallelMap(picked, GATE_CONCURRENCY, async (s) => {
|
|
11022
11059
|
const shortId = s.sessionId.slice(0, 8);
|
|
@@ -11028,7 +11065,7 @@ async function runMineLocalImpl(args) {
|
|
|
11028
11065
|
}
|
|
11029
11066
|
const tail = pairs2.slice(-PER_SESSION_PAIR_CAP);
|
|
11030
11067
|
const sessionTmp = join46(tmpDir, `s-${shortId}`);
|
|
11031
|
-
|
|
11068
|
+
mkdirSync24(sessionTmp, { recursive: true });
|
|
11032
11069
|
const verdictPath = join46(sessionTmp, "verdict.json");
|
|
11033
11070
|
const prompt = buildSessionPrompt(tail, s, verdictPath);
|
|
11034
11071
|
writeFileSync26(join46(sessionTmp, "prompt.txt"), prompt);
|
|
@@ -11095,7 +11132,7 @@ async function runMineLocalImpl(args) {
|
|
|
11095
11132
|
sourceSessions: [session.sessionId],
|
|
11096
11133
|
agent: gateAgent
|
|
11097
11134
|
});
|
|
11098
|
-
const canonicalDir =
|
|
11135
|
+
const canonicalDir = dirname17(result.path);
|
|
11099
11136
|
const symlinks = fanOutRoots.length > 0 ? fanOutSymlinks(canonicalDir, basename2(canonicalDir), fanOutRoots) : [];
|
|
11100
11137
|
const symlinkSuffix = symlinks.length > 0 ? `, fan-out \u2192 ${symlinks.length} root(s)` : "";
|
|
11101
11138
|
console.log(` wrote ${skill.name} \u2190 session ${session.sessionId.slice(0, 8)} (${session.agent}${symlinkSuffix})`);
|
|
@@ -11329,7 +11366,7 @@ function promoteSkill(name, cwd) {
|
|
|
11329
11366
|
console.error(`Skill '${name}' already exists at ${globalPath}/SKILL.md \u2014 refusing to overwrite. Remove it first or rename the project skill.`);
|
|
11330
11367
|
process.exit(1);
|
|
11331
11368
|
}
|
|
11332
|
-
|
|
11369
|
+
mkdirSync25(dirname18(globalPath), { recursive: true });
|
|
11333
11370
|
renameSync12(projectPath, globalPath);
|
|
11334
11371
|
console.log(`Promoted '${name}' from ${projectPath} \u2192 ${globalPath}.`);
|
|
11335
11372
|
}
|
|
@@ -12354,14 +12391,14 @@ async function runContextCommand(args) {
|
|
|
12354
12391
|
|
|
12355
12392
|
// dist/src/cli/update.js
|
|
12356
12393
|
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
12357
|
-
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";
|
|
12358
12395
|
import { homedir as homedir26 } from "node:os";
|
|
12359
|
-
import { dirname as
|
|
12396
|
+
import { dirname as dirname20, join as join49, sep as sep2 } from "node:path";
|
|
12360
12397
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
12361
12398
|
|
|
12362
12399
|
// dist/src/utils/version-check.js
|
|
12363
12400
|
import { readFileSync as readFileSync34 } from "node:fs";
|
|
12364
|
-
import { dirname as
|
|
12401
|
+
import { dirname as dirname19, join as join48 } from "node:path";
|
|
12365
12402
|
function isNewer(latest, current) {
|
|
12366
12403
|
const parse = (v) => v.split(".").map(Number);
|
|
12367
12404
|
const [la, lb, lc] = parse(latest);
|
|
@@ -12383,7 +12420,7 @@ function detectInstallKind(argv1) {
|
|
|
12383
12420
|
return argv1 ?? process.argv[1] ?? fileURLToPath2(import.meta.url);
|
|
12384
12421
|
}
|
|
12385
12422
|
})();
|
|
12386
|
-
let dir =
|
|
12423
|
+
let dir = dirname20(realArgv1);
|
|
12387
12424
|
let installDir = null;
|
|
12388
12425
|
for (let i = 0; i < 10; i++) {
|
|
12389
12426
|
const pkgPath = `${dir}${sep2}package.json`;
|
|
@@ -12395,12 +12432,12 @@ function detectInstallKind(argv1) {
|
|
|
12395
12432
|
}
|
|
12396
12433
|
} catch {
|
|
12397
12434
|
}
|
|
12398
|
-
const parent =
|
|
12435
|
+
const parent = dirname20(dir);
|
|
12399
12436
|
if (parent === dir)
|
|
12400
12437
|
break;
|
|
12401
12438
|
dir = parent;
|
|
12402
12439
|
}
|
|
12403
|
-
installDir ??=
|
|
12440
|
+
installDir ??= dirname20(realArgv1);
|
|
12404
12441
|
if (realArgv1.includes(`${sep2}_npx${sep2}`) || realArgv1.includes(`${sep2}.npx${sep2}`)) {
|
|
12405
12442
|
return { kind: "npx", installDir };
|
|
12406
12443
|
}
|
|
@@ -12412,7 +12449,7 @@ function detectInstallKind(argv1) {
|
|
|
12412
12449
|
if (existsSync37(`${gitDir}${sep2}.git`)) {
|
|
12413
12450
|
return { kind: "local-dev", installDir };
|
|
12414
12451
|
}
|
|
12415
|
-
const parent =
|
|
12452
|
+
const parent = dirname20(gitDir);
|
|
12416
12453
|
if (parent === gitDir)
|
|
12417
12454
|
break;
|
|
12418
12455
|
gitDir = parent;
|
|
@@ -12434,7 +12471,7 @@ var defaultSpawn = (cmd, args) => {
|
|
|
12434
12471
|
execFileSync6(cmd, args, { stdio: "inherit" });
|
|
12435
12472
|
};
|
|
12436
12473
|
function tryAcquireLock(path) {
|
|
12437
|
-
|
|
12474
|
+
mkdirSync26(dirname20(path), { recursive: true, mode: 448 });
|
|
12438
12475
|
const claim = () => {
|
|
12439
12476
|
const fd = openSync3(path, "wx", 384);
|
|
12440
12477
|
writeSync2(fd, String(process.pid));
|