@drewpayment/mink 0.12.0-beta.4 → 0.12.0-beta.5
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/dashboard/out/404.html +1 -1
- package/dashboard/out/action-log.html +1 -1
- package/dashboard/out/action-log.txt +1 -1
- package/dashboard/out/activity.html +1 -1
- package/dashboard/out/activity.txt +1 -1
- package/dashboard/out/bugs.html +1 -1
- package/dashboard/out/bugs.txt +1 -1
- package/dashboard/out/capture.html +1 -1
- package/dashboard/out/capture.txt +1 -1
- package/dashboard/out/config.html +1 -1
- package/dashboard/out/config.txt +1 -1
- package/dashboard/out/daemon.html +1 -1
- package/dashboard/out/daemon.txt +1 -1
- package/dashboard/out/design.html +1 -1
- package/dashboard/out/design.txt +1 -1
- package/dashboard/out/discord.html +1 -1
- package/dashboard/out/discord.txt +1 -1
- package/dashboard/out/file-index.html +1 -1
- package/dashboard/out/file-index.txt +1 -1
- package/dashboard/out/index.html +1 -1
- package/dashboard/out/index.txt +1 -1
- package/dashboard/out/insights.html +1 -1
- package/dashboard/out/insights.txt +1 -1
- package/dashboard/out/learning.html +1 -1
- package/dashboard/out/learning.txt +1 -1
- package/dashboard/out/overview.html +1 -1
- package/dashboard/out/overview.txt +1 -1
- package/dashboard/out/scheduler.html +1 -1
- package/dashboard/out/scheduler.txt +1 -1
- package/dashboard/out/sync.html +1 -1
- package/dashboard/out/sync.txt +1 -1
- package/dashboard/out/tokens.html +1 -1
- package/dashboard/out/tokens.txt +1 -1
- package/dashboard/out/waste.html +1 -1
- package/dashboard/out/waste.txt +1 -1
- package/dashboard/out/wiki.html +1 -1
- package/dashboard/out/wiki.txt +1 -1
- package/dist/cli.bun.js +116 -54
- package/dist/cli.node.js +116 -54
- package/package.json +1 -1
- package/src/commands/post-read.ts +94 -9
- package/src/core/framework-advisor/generate.ts +11 -1
- package/src/core/note-linker.ts +12 -7
- package/src/types/hook-input.ts +10 -0
- /package/dashboard/out/_next/static/{i9-16JmUxsS4K70sSYdYA → eZlC6TEe7TWUABN2-Ho0J}/_buildManifest.js +0 -0
- /package/dashboard/out/_next/static/{i9-16JmUxsS4K70sSYdYA → eZlC6TEe7TWUABN2-Ho0J}/_ssgManifest.js +0 -0
package/dist/cli.bun.js
CHANGED
|
@@ -2680,15 +2680,8 @@ function addBacklink(targetNotePath, sourceTitle) {
|
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
2682
|
function updateMasterIndex(vaultRootPath) {
|
|
2683
|
-
const now = new Date().toISOString().split("T")[0];
|
|
2684
2683
|
const sections = [
|
|
2685
|
-
`---`,
|
|
2686
|
-
`updated: "${new Date().toISOString()}"`,
|
|
2687
|
-
`---`,
|
|
2688
|
-
``,
|
|
2689
2684
|
`# Knowledge Base`,
|
|
2690
|
-
``,
|
|
2691
|
-
`> Last updated: ${now}`,
|
|
2692
2685
|
``
|
|
2693
2686
|
];
|
|
2694
2687
|
const categories = [
|
|
@@ -2721,6 +2714,13 @@ function updateMasterIndex(vaultRootPath) {
|
|
|
2721
2714
|
}
|
|
2722
2715
|
sections.push("");
|
|
2723
2716
|
}
|
|
2717
|
+
const nowIso = new Date().toISOString();
|
|
2718
|
+
const nowDate = nowIso.split("T")[0];
|
|
2719
|
+
sections.push(`---`);
|
|
2720
|
+
sections.push(``);
|
|
2721
|
+
sections.push(`<!-- mink:footer (volatile \u2014 keep at end of file) -->`);
|
|
2722
|
+
sections.push(`> Last updated: ${nowDate} (${nowIso})`);
|
|
2723
|
+
sections.push(``);
|
|
2724
2724
|
const indexPath = vaultMasterIndexPath();
|
|
2725
2725
|
atomicWriteText(indexPath, sections.join(`
|
|
2726
2726
|
`));
|
|
@@ -6759,20 +6759,46 @@ var init_pre_read = __esm(() => {
|
|
|
6759
6759
|
var exports_post_read = {};
|
|
6760
6760
|
__export(exports_post_read, {
|
|
6761
6761
|
postRead: () => postRead,
|
|
6762
|
+
extractContent: () => extractContent,
|
|
6762
6763
|
analyzePostRead: () => analyzePostRead
|
|
6763
6764
|
});
|
|
6764
6765
|
import { relative as relative4 } from "path";
|
|
6766
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
6765
6767
|
function analyzePostRead(filePath, content, index) {
|
|
6766
6768
|
if (isBinaryFile(filePath, content ?? undefined)) {
|
|
6767
6769
|
const entry = index ? index.lookupEntry(filePath) : null;
|
|
6768
|
-
return {
|
|
6770
|
+
return {
|
|
6771
|
+
estimatedTokens: 0,
|
|
6772
|
+
indexHit: !!entry,
|
|
6773
|
+
source: "none",
|
|
6774
|
+
indexEntry: null
|
|
6775
|
+
};
|
|
6769
6776
|
}
|
|
6770
6777
|
if (content !== null && content.length > 0) {
|
|
6771
6778
|
const entry = index ? index.lookupEntry(filePath) : null;
|
|
6779
|
+
const tokens = estimateTokens2(content, filePath);
|
|
6780
|
+
let indexEntry = null;
|
|
6781
|
+
if (!entry) {
|
|
6782
|
+
let description = "";
|
|
6783
|
+
try {
|
|
6784
|
+
description = extractDescription(filePath, content);
|
|
6785
|
+
} catch {
|
|
6786
|
+
description = "";
|
|
6787
|
+
}
|
|
6788
|
+
const now = new Date().toISOString();
|
|
6789
|
+
indexEntry = {
|
|
6790
|
+
filePath,
|
|
6791
|
+
description,
|
|
6792
|
+
estimatedTokens: tokens,
|
|
6793
|
+
lastModified: now,
|
|
6794
|
+
lastIndexed: now
|
|
6795
|
+
};
|
|
6796
|
+
}
|
|
6772
6797
|
return {
|
|
6773
|
-
estimatedTokens:
|
|
6798
|
+
estimatedTokens: tokens,
|
|
6774
6799
|
indexHit: !!entry,
|
|
6775
|
-
source: "content"
|
|
6800
|
+
source: "content",
|
|
6801
|
+
indexEntry
|
|
6776
6802
|
};
|
|
6777
6803
|
}
|
|
6778
6804
|
if (index) {
|
|
@@ -6781,11 +6807,17 @@ function analyzePostRead(filePath, content, index) {
|
|
|
6781
6807
|
return {
|
|
6782
6808
|
estimatedTokens: entry.estimatedTokens,
|
|
6783
6809
|
indexHit: true,
|
|
6784
|
-
source: "index-fallback"
|
|
6810
|
+
source: "index-fallback",
|
|
6811
|
+
indexEntry: null
|
|
6785
6812
|
};
|
|
6786
6813
|
}
|
|
6787
6814
|
}
|
|
6788
|
-
return {
|
|
6815
|
+
return {
|
|
6816
|
+
estimatedTokens: 0,
|
|
6817
|
+
indexHit: false,
|
|
6818
|
+
source: "none",
|
|
6819
|
+
indexEntry: null
|
|
6820
|
+
};
|
|
6789
6821
|
}
|
|
6790
6822
|
function isPostToolUseInput(value) {
|
|
6791
6823
|
if (value === null || typeof value !== "object")
|
|
@@ -6798,9 +6830,22 @@ function isPostToolUseInput(value) {
|
|
|
6798
6830
|
return true;
|
|
6799
6831
|
}
|
|
6800
6832
|
function extractContent(input) {
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6833
|
+
const tr = input.tool_response;
|
|
6834
|
+
if (tr) {
|
|
6835
|
+
if (typeof tr.content === "string")
|
|
6836
|
+
return tr.content;
|
|
6837
|
+
if (Array.isArray(tr.content)) {
|
|
6838
|
+
const parts = tr.content.map((p) => p && typeof p.text === "string" ? p.text : "").filter((s) => s.length > 0);
|
|
6839
|
+
if (parts.length > 0)
|
|
6840
|
+
return parts.join("");
|
|
6841
|
+
}
|
|
6842
|
+
if (tr.file && typeof tr.file.content === "string") {
|
|
6843
|
+
return tr.file.content;
|
|
6844
|
+
}
|
|
6845
|
+
if (typeof tr.text === "string")
|
|
6846
|
+
return tr.text;
|
|
6847
|
+
}
|
|
6848
|
+
if (input.tool_output && typeof input.tool_output.content === "string") {
|
|
6804
6849
|
return input.tool_output.content;
|
|
6805
6850
|
}
|
|
6806
6851
|
return null;
|
|
@@ -6820,8 +6865,19 @@ async function postRead(cwd) {
|
|
|
6820
6865
|
const rawState = safeReadJson(sessionPath(cwd));
|
|
6821
6866
|
const state = isSessionState(rawState) ? rawState : createSessionState();
|
|
6822
6867
|
const repo = FileIndexRepo.for(cwd);
|
|
6823
|
-
|
|
6868
|
+
let content = null;
|
|
6869
|
+
try {
|
|
6870
|
+
content = readFileSync18(absolutePath, "utf-8");
|
|
6871
|
+
} catch {}
|
|
6872
|
+
if (content === null) {
|
|
6873
|
+
content = extractContent(input);
|
|
6874
|
+
}
|
|
6824
6875
|
const result = analyzePostRead(filePath, content, repo);
|
|
6876
|
+
if (result.indexEntry) {
|
|
6877
|
+
try {
|
|
6878
|
+
repo.upsert(result.indexEntry);
|
|
6879
|
+
} catch {}
|
|
6880
|
+
}
|
|
6825
6881
|
recordRead(state, filePath, result.estimatedTokens, result.indexHit);
|
|
6826
6882
|
try {
|
|
6827
6883
|
const logWriter = createActionLogWriter(actionLogShardPath(cwd, getOrCreateDeviceId()));
|
|
@@ -6838,6 +6894,7 @@ var init_post_read = __esm(() => {
|
|
|
6838
6894
|
init_session();
|
|
6839
6895
|
init_file_index_repo();
|
|
6840
6896
|
init_token_estimate();
|
|
6897
|
+
init_description();
|
|
6841
6898
|
init_action_log();
|
|
6842
6899
|
init_device();
|
|
6843
6900
|
});
|
|
@@ -7038,7 +7095,7 @@ __export(exports_post_write, {
|
|
|
7038
7095
|
analyzePostWrite: () => analyzePostWrite
|
|
7039
7096
|
});
|
|
7040
7097
|
import { relative as relative6 } from "path";
|
|
7041
|
-
import { readFileSync as
|
|
7098
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
7042
7099
|
function analyzePostWrite(filePath, fileContent, index) {
|
|
7043
7100
|
if (isWriteExcluded(filePath)) {
|
|
7044
7101
|
return {
|
|
@@ -7102,7 +7159,7 @@ async function postWrite(cwd) {
|
|
|
7102
7159
|
const filePath = relative6(cwd, absolutePath);
|
|
7103
7160
|
let fileContent = null;
|
|
7104
7161
|
try {
|
|
7105
|
-
fileContent =
|
|
7162
|
+
fileContent = readFileSync19(absolutePath, "utf-8");
|
|
7106
7163
|
} catch {}
|
|
7107
7164
|
const rawState = safeReadJson(sessionPath(cwd));
|
|
7108
7165
|
const state = isSessionState(rawState) ? rawState : createSessionState();
|
|
@@ -7403,7 +7460,7 @@ __export(exports_self_update, {
|
|
|
7403
7460
|
PACKAGE_NAME: () => PACKAGE_NAME
|
|
7404
7461
|
});
|
|
7405
7462
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
7406
|
-
import { existsSync as existsSync24, readFileSync as
|
|
7463
|
+
import { existsSync as existsSync24, readFileSync as readFileSync20 } from "fs";
|
|
7407
7464
|
import { dirname as dirname10 } from "path";
|
|
7408
7465
|
import { join as join21 } from "path";
|
|
7409
7466
|
function parseSemver(input) {
|
|
@@ -7470,7 +7527,7 @@ function getInstallInfo() {
|
|
|
7470
7527
|
}
|
|
7471
7528
|
let currentVersion = "0.0.0";
|
|
7472
7529
|
try {
|
|
7473
|
-
const pkg = JSON.parse(
|
|
7530
|
+
const pkg = JSON.parse(readFileSync20(packageJsonPath, "utf-8"));
|
|
7474
7531
|
if (typeof pkg.version === "string")
|
|
7475
7532
|
currentVersion = pkg.version;
|
|
7476
7533
|
} catch {}
|
|
@@ -7543,7 +7600,7 @@ function appendLogEntry(entry) {
|
|
|
7543
7600
|
}
|
|
7544
7601
|
function rotateLogIfNeeded(path) {
|
|
7545
7602
|
try {
|
|
7546
|
-
const content =
|
|
7603
|
+
const content = readFileSync20(path, "utf-8");
|
|
7547
7604
|
const lines = content.split(`
|
|
7548
7605
|
`);
|
|
7549
7606
|
if (lines.length <= LOG_MAX_LINES + 1)
|
|
@@ -7646,7 +7703,7 @@ async function runSelfUpgradeInner(opts) {
|
|
|
7646
7703
|
}
|
|
7647
7704
|
let verifiedVersion = latest;
|
|
7648
7705
|
try {
|
|
7649
|
-
const pkg = JSON.parse(
|
|
7706
|
+
const pkg = JSON.parse(readFileSync20(info.packageJsonPath, "utf-8"));
|
|
7650
7707
|
if (typeof pkg.version === "string")
|
|
7651
7708
|
verifiedVersion = pkg.version;
|
|
7652
7709
|
} catch {}
|
|
@@ -7752,10 +7809,10 @@ async function executeTask(taskId, projectCwd) {
|
|
|
7752
7809
|
if (task.actionType === "ai-cli") {
|
|
7753
7810
|
try {
|
|
7754
7811
|
const { learningMemoryPath: learningMemoryPath4 } = await Promise.resolve().then(() => (init_paths(), exports_paths));
|
|
7755
|
-
const { readFileSync:
|
|
7812
|
+
const { readFileSync: readFileSync21 } = await import("fs");
|
|
7756
7813
|
let memoryContent;
|
|
7757
7814
|
try {
|
|
7758
|
-
memoryContent =
|
|
7815
|
+
memoryContent = readFileSync21(learningMemoryPath4(projectCwd), "utf-8");
|
|
7759
7816
|
} catch {
|
|
7760
7817
|
console.log("[mink] no learning memory found, skipping reflection");
|
|
7761
7818
|
return;
|
|
@@ -8320,7 +8377,7 @@ var init_cron = __esm(() => {
|
|
|
8320
8377
|
|
|
8321
8378
|
// src/core/vault-templates.ts
|
|
8322
8379
|
import { join as join22 } from "path";
|
|
8323
|
-
import { existsSync as existsSync25, writeFileSync as writeFileSync9, readFileSync as
|
|
8380
|
+
import { existsSync as existsSync25, writeFileSync as writeFileSync9, readFileSync as readFileSync21, mkdirSync as mkdirSync13 } from "fs";
|
|
8324
8381
|
function seedTemplates(templatesDir) {
|
|
8325
8382
|
mkdirSync13(templatesDir, { recursive: true });
|
|
8326
8383
|
for (const [name, content] of Object.entries(DEFAULT_TEMPLATES)) {
|
|
@@ -8334,7 +8391,7 @@ function loadTemplate(templatesDir, templateName, vars) {
|
|
|
8334
8391
|
const filePath = join22(templatesDir, `${templateName}.md`);
|
|
8335
8392
|
let content;
|
|
8336
8393
|
if (existsSync25(filePath)) {
|
|
8337
|
-
content =
|
|
8394
|
+
content = readFileSync21(filePath, "utf-8");
|
|
8338
8395
|
} else if (DEFAULT_TEMPLATES[templateName]) {
|
|
8339
8396
|
content = DEFAULT_TEMPLATES[templateName];
|
|
8340
8397
|
} else {
|
|
@@ -8488,7 +8545,7 @@ category: resources
|
|
|
8488
8545
|
|
|
8489
8546
|
// src/core/note-writer.ts
|
|
8490
8547
|
import { join as join23 } from "path";
|
|
8491
|
-
import { existsSync as existsSync26, readFileSync as
|
|
8548
|
+
import { existsSync as existsSync26, readFileSync as readFileSync22 } from "fs";
|
|
8492
8549
|
import { createHash as createHash3 } from "crypto";
|
|
8493
8550
|
function sha256(content) {
|
|
8494
8551
|
return createHash3("sha256").update(content).digest("hex");
|
|
@@ -8513,7 +8570,7 @@ function resolveUniqueNotePath(dir, baseSlug, content) {
|
|
|
8513
8570
|
}
|
|
8514
8571
|
function sameContent(filePath, expectedHash) {
|
|
8515
8572
|
try {
|
|
8516
|
-
return sha256(
|
|
8573
|
+
return sha256(readFileSync22(filePath, "utf-8")) === expectedHash;
|
|
8517
8574
|
} catch {
|
|
8518
8575
|
return false;
|
|
8519
8576
|
}
|
|
@@ -8622,7 +8679,7 @@ ${content}
|
|
|
8622
8679
|
return filePath;
|
|
8623
8680
|
}
|
|
8624
8681
|
function ingestFile(sourcePath, meta) {
|
|
8625
|
-
const raw =
|
|
8682
|
+
const raw = readFileSync22(sourcePath, "utf-8");
|
|
8626
8683
|
const now = new Date().toISOString();
|
|
8627
8684
|
const headingMatch = raw.match(/^#\s+(.+)$/m);
|
|
8628
8685
|
const title = headingMatch?.[1] ?? sourcePath.split("/").pop().replace(/\.md$/, "");
|
|
@@ -8694,7 +8751,7 @@ var init_design_eval = __esm(() => {
|
|
|
8694
8751
|
});
|
|
8695
8752
|
|
|
8696
8753
|
// src/core/dashboard-api.ts
|
|
8697
|
-
import { existsSync as existsSync27, readFileSync as
|
|
8754
|
+
import { existsSync as existsSync27, readFileSync as readFileSync23 } from "fs";
|
|
8698
8755
|
import { readdirSync as readdirSync9, readFileSync as readFileSyncFS, existsSync as fsExistsSync } from "fs";
|
|
8699
8756
|
import { join as join24, resolve as resolve5, normalize, sep } from "path";
|
|
8700
8757
|
import { execSync as execSync6 } from "child_process";
|
|
@@ -8722,7 +8779,7 @@ function checkTextFile2(name, filePath) {
|
|
|
8722
8779
|
if (!existsSync27(filePath))
|
|
8723
8780
|
return { name, status: "missing" };
|
|
8724
8781
|
try {
|
|
8725
|
-
|
|
8782
|
+
readFileSync23(filePath, "utf-8");
|
|
8726
8783
|
return { name, status: "ok" };
|
|
8727
8784
|
} catch {
|
|
8728
8785
|
return { name, status: "corrupt" };
|
|
@@ -8732,7 +8789,7 @@ function checkDbFile2(name, filePath) {
|
|
|
8732
8789
|
if (!existsSync27(filePath))
|
|
8733
8790
|
return { name, status: "missing" };
|
|
8734
8791
|
try {
|
|
8735
|
-
const header =
|
|
8792
|
+
const header = readFileSync23(filePath).slice(0, 16).toString("utf-8");
|
|
8736
8793
|
return header.startsWith("SQLite format 3") ? { name, status: "ok" } : { name, status: "corrupt" };
|
|
8737
8794
|
} catch {
|
|
8738
8795
|
return { name, status: "corrupt" };
|
|
@@ -10322,7 +10379,7 @@ var exports_daemon = {};
|
|
|
10322
10379
|
__export(exports_daemon, {
|
|
10323
10380
|
daemon: () => daemon
|
|
10324
10381
|
});
|
|
10325
|
-
import { readFileSync as
|
|
10382
|
+
import { readFileSync as readFileSync24, existsSync as existsSync31 } from "fs";
|
|
10326
10383
|
async function daemon(cwd, args) {
|
|
10327
10384
|
const subcommand = args[0];
|
|
10328
10385
|
switch (subcommand) {
|
|
@@ -10343,7 +10400,7 @@ async function daemon(cwd, args) {
|
|
|
10343
10400
|
return;
|
|
10344
10401
|
}
|
|
10345
10402
|
try {
|
|
10346
|
-
const content =
|
|
10403
|
+
const content = readFileSync24(logPath, "utf-8");
|
|
10347
10404
|
const lines = content.split(`
|
|
10348
10405
|
`);
|
|
10349
10406
|
const tail = lines.slice(-50).join(`
|
|
@@ -10924,7 +10981,7 @@ var init_restore = __esm(() => {
|
|
|
10924
10981
|
});
|
|
10925
10982
|
|
|
10926
10983
|
// src/core/design-eval/server-detect.ts
|
|
10927
|
-
import { readFileSync as
|
|
10984
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
10928
10985
|
import { join as join27 } from "path";
|
|
10929
10986
|
async function probePort(port) {
|
|
10930
10987
|
try {
|
|
@@ -10947,7 +11004,7 @@ async function findRunningServer(ports = DEFAULT_PROBE_PORTS) {
|
|
|
10947
11004
|
}
|
|
10948
11005
|
function detectDevCommand(cwd) {
|
|
10949
11006
|
try {
|
|
10950
|
-
const raw =
|
|
11007
|
+
const raw = readFileSync25(join27(cwd, "package.json"), "utf-8");
|
|
10951
11008
|
const pkg = JSON.parse(raw);
|
|
10952
11009
|
const scripts = pkg.scripts;
|
|
10953
11010
|
if (!scripts || typeof scripts !== "object")
|
|
@@ -80449,7 +80506,7 @@ var init_fileUtil = __esm(() => {
|
|
|
80449
80506
|
// node_modules/@puppeteer/browsers/lib/esm/install.js
|
|
80450
80507
|
import assert2 from "assert";
|
|
80451
80508
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
80452
|
-
import { existsSync as existsSync33, readFileSync as
|
|
80509
|
+
import { existsSync as existsSync33, readFileSync as readFileSync26 } from "fs";
|
|
80453
80510
|
import { mkdir as mkdir2, unlink } from "fs/promises";
|
|
80454
80511
|
import os5 from "os";
|
|
80455
80512
|
import path8 from "path";
|
|
@@ -80539,7 +80596,7 @@ async function installDeps(installedBrowser) {
|
|
|
80539
80596
|
debugInstall(`deb.deps file was not found at ${depsPath}`);
|
|
80540
80597
|
return;
|
|
80541
80598
|
}
|
|
80542
|
-
const data =
|
|
80599
|
+
const data = readFileSync26(depsPath, "utf-8").split(`
|
|
80543
80600
|
`).join(",");
|
|
80544
80601
|
if (process.getuid?.() !== 0) {
|
|
80545
80602
|
throw new Error("Installing system dependencies requires root privileges");
|
|
@@ -82064,14 +82121,14 @@ var init_yerror = __esm(() => {
|
|
|
82064
82121
|
});
|
|
82065
82122
|
|
|
82066
82123
|
// node_modules/y18n/build/lib/platform-shims/node.js
|
|
82067
|
-
import { readFileSync as
|
|
82124
|
+
import { readFileSync as readFileSync27, statSync as statSync13, writeFile } from "fs";
|
|
82068
82125
|
import { format as format2 } from "util";
|
|
82069
82126
|
import { resolve as resolve11 } from "path";
|
|
82070
82127
|
var node_default;
|
|
82071
82128
|
var init_node = __esm(() => {
|
|
82072
82129
|
node_default = {
|
|
82073
82130
|
fs: {
|
|
82074
|
-
readFileSync:
|
|
82131
|
+
readFileSync: readFileSync27,
|
|
82075
82132
|
writeFile
|
|
82076
82133
|
},
|
|
82077
82134
|
format: format2,
|
|
@@ -82256,7 +82313,7 @@ var init_y18n = __esm(() => {
|
|
|
82256
82313
|
// node_modules/yargs/lib/platform-shims/esm.mjs
|
|
82257
82314
|
import { notStrictEqual, strictEqual } from "assert";
|
|
82258
82315
|
import { inspect } from "util";
|
|
82259
|
-
import { readFileSync as
|
|
82316
|
+
import { readFileSync as readFileSync28 } from "fs";
|
|
82260
82317
|
import { fileURLToPath } from "url";
|
|
82261
82318
|
import { basename as basename8, dirname as dirname14, extname as extname3, relative as relative8, resolve as resolve12 } from "path";
|
|
82262
82319
|
var REQUIRE_ERROR = "require is not supported by ESM", REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM", __dirname2, mainFilename, esm_default;
|
|
@@ -82305,7 +82362,7 @@ var init_esm = __esm(() => {
|
|
|
82305
82362
|
nextTick: process.nextTick,
|
|
82306
82363
|
stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
|
|
82307
82364
|
},
|
|
82308
|
-
readFileSync:
|
|
82365
|
+
readFileSync: readFileSync28,
|
|
82309
82366
|
require: () => {
|
|
82310
82367
|
throw new YError(REQUIRE_ERROR);
|
|
82311
82368
|
},
|
|
@@ -88564,7 +88621,7 @@ function generateKnowledgeMarkdown(k) {
|
|
|
88564
88621
|
const parts = [];
|
|
88565
88622
|
parts.push(`# Framework Advisor Knowledge Base`);
|
|
88566
88623
|
parts.push("");
|
|
88567
|
-
parts.push(`>
|
|
88624
|
+
parts.push(`> Version: ${k.version} | Frameworks: ${k.frameworks.length}`);
|
|
88568
88625
|
parts.push("");
|
|
88569
88626
|
parts.push("## Comparison Matrix");
|
|
88570
88627
|
parts.push("");
|
|
@@ -88620,6 +88677,11 @@ function generateKnowledgeMarkdown(k) {
|
|
|
88620
88677
|
parts.push("");
|
|
88621
88678
|
}
|
|
88622
88679
|
}
|
|
88680
|
+
parts.push(`---`);
|
|
88681
|
+
parts.push(``);
|
|
88682
|
+
parts.push(`<!-- mink:footer (volatile \u2014 keep at end of file) -->`);
|
|
88683
|
+
parts.push(`> Generated: ${k.generatedAt}`);
|
|
88684
|
+
parts.push(``);
|
|
88623
88685
|
return parts.join(`
|
|
88624
88686
|
`);
|
|
88625
88687
|
}
|
|
@@ -89095,7 +89157,7 @@ __export(exports_note, {
|
|
|
89095
89157
|
note: () => note
|
|
89096
89158
|
});
|
|
89097
89159
|
import { resolve as resolve14 } from "path";
|
|
89098
|
-
import { existsSync as existsSync37, readFileSync as
|
|
89160
|
+
import { existsSync as existsSync37, readFileSync as readFileSync29 } from "fs";
|
|
89099
89161
|
async function note(cwd, args) {
|
|
89100
89162
|
if (!isWikiEnabled()) {
|
|
89101
89163
|
console.error("[mink] wiki feature is disabled");
|
|
@@ -89120,7 +89182,7 @@ async function note(cwd, args) {
|
|
|
89120
89182
|
const date = new Date().toISOString().split("T")[0];
|
|
89121
89183
|
const content = parsed.positional || parsed.body || "";
|
|
89122
89184
|
const filePath = appendToDaily(date, content);
|
|
89123
|
-
updateVaultIndexForFile(filePath,
|
|
89185
|
+
updateVaultIndexForFile(filePath, readFileSync29(filePath, "utf-8"));
|
|
89124
89186
|
console.log(`[mink] daily note: ${filePath}`);
|
|
89125
89187
|
return;
|
|
89126
89188
|
}
|
|
@@ -89453,7 +89515,7 @@ import { homedir as homedir6 } from "os";
|
|
|
89453
89515
|
import {
|
|
89454
89516
|
existsSync as existsSync39,
|
|
89455
89517
|
mkdirSync as mkdirSync17,
|
|
89456
|
-
readFileSync as
|
|
89518
|
+
readFileSync as readFileSync30,
|
|
89457
89519
|
writeFileSync as writeFileSync11
|
|
89458
89520
|
} from "fs";
|
|
89459
89521
|
import { createHash as createHash4 } from "crypto";
|
|
@@ -89477,7 +89539,7 @@ function getMinkVersion() {
|
|
|
89477
89539
|
const pkgPath = join33(dir, "package.json");
|
|
89478
89540
|
if (existsSync39(pkgPath)) {
|
|
89479
89541
|
try {
|
|
89480
|
-
const pkg = JSON.parse(
|
|
89542
|
+
const pkg = JSON.parse(readFileSync30(pkgPath, "utf-8"));
|
|
89481
89543
|
if (pkg.name && pkg.version)
|
|
89482
89544
|
return pkg.version;
|
|
89483
89545
|
} catch {}
|
|
@@ -89515,7 +89577,7 @@ function installAgentDefinition(opts) {
|
|
|
89515
89577
|
if (opts.skip && existsSync39(installed)) {
|
|
89516
89578
|
return { action: "skipped", path: installed };
|
|
89517
89579
|
}
|
|
89518
|
-
const template =
|
|
89580
|
+
const template = readFileSync30(templatePath, "utf-8");
|
|
89519
89581
|
const rendered = renderTemplate(template, {
|
|
89520
89582
|
MINK_ROOT: minkRoot(),
|
|
89521
89583
|
VAULT_PATH: resolveVaultPath(),
|
|
@@ -89523,7 +89585,7 @@ function installAgentDefinition(opts) {
|
|
|
89523
89585
|
});
|
|
89524
89586
|
const exists = existsSync39(installed);
|
|
89525
89587
|
if (!opts.force && exists) {
|
|
89526
|
-
const current =
|
|
89588
|
+
const current = readFileSync30(installed, "utf-8");
|
|
89527
89589
|
if (sha2562(current) === sha2562(rendered)) {
|
|
89528
89590
|
return { action: "unchanged", path: installed };
|
|
89529
89591
|
}
|
|
@@ -89651,7 +89713,7 @@ var init_agent = __esm(() => {
|
|
|
89651
89713
|
});
|
|
89652
89714
|
|
|
89653
89715
|
// src/core/sync-merge-drivers.ts
|
|
89654
|
-
import { readFileSync as
|
|
89716
|
+
import { readFileSync as readFileSync31, writeFileSync as writeFileSync12, appendFileSync as appendFileSync2, copyFileSync as copyFileSync2, unlinkSync as unlinkSync7 } from "fs";
|
|
89655
89717
|
import { join as join34 } from "path";
|
|
89656
89718
|
function logWarning(driver, args, err) {
|
|
89657
89719
|
try {
|
|
@@ -89662,14 +89724,14 @@ function logWarning(driver, args, err) {
|
|
|
89662
89724
|
}
|
|
89663
89725
|
function readJsonOrNull(path12) {
|
|
89664
89726
|
try {
|
|
89665
|
-
return JSON.parse(
|
|
89727
|
+
return JSON.parse(readFileSync31(path12, "utf-8"));
|
|
89666
89728
|
} catch {
|
|
89667
89729
|
return null;
|
|
89668
89730
|
}
|
|
89669
89731
|
}
|
|
89670
89732
|
function readTextOrEmpty(path12) {
|
|
89671
89733
|
try {
|
|
89672
|
-
return
|
|
89734
|
+
return readFileSync31(path12, "utf-8");
|
|
89673
89735
|
} catch {
|
|
89674
89736
|
return "";
|
|
89675
89737
|
}
|
|
@@ -90559,9 +90621,9 @@ switch (command2) {
|
|
|
90559
90621
|
const { resolve: resolve17, dirname: dirname18, basename: basename9 } = await import("path");
|
|
90560
90622
|
const bundlePath = new URL(import.meta.url).pathname;
|
|
90561
90623
|
const cliPath = resolve17(dirname18(bundlePath));
|
|
90562
|
-
const { readFileSync:
|
|
90624
|
+
const { readFileSync: readFileSync32 } = await import("fs");
|
|
90563
90625
|
try {
|
|
90564
|
-
const pkg = JSON.parse(
|
|
90626
|
+
const pkg = JSON.parse(readFileSync32(resolve17(cliPath, "../package.json"), "utf-8"));
|
|
90565
90627
|
console.log(`mink ${pkg.version}`);
|
|
90566
90628
|
} catch {
|
|
90567
90629
|
console.log("mink (unknown version)");
|