@drewpayment/mink 0.12.0-beta.4 → 0.12.0-beta.6
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 +148 -69
- package/dist/cli.node.js +148 -69
- package/package.json +1 -1
- package/src/commands/post-read.ts +94 -9
- package/src/commands/status.ts +37 -12
- package/src/core/framework-advisor/generate.ts +11 -1
- package/src/core/note-linker.ts +12 -7
- package/src/core/state-aggregator.ts +3 -3
- package/src/types/hook-input.ts +10 -0
- /package/dashboard/out/_next/static/{i9-16JmUxsS4K70sSYdYA → 2qo2HCBP_HsNoQT7-KrRp}/_buildManifest.js +0 -0
- /package/dashboard/out/_next/static/{i9-16JmUxsS4K70sSYdYA → 2qo2HCBP_HsNoQT7-KrRp}/_ssgManifest.js +0 -0
package/dist/cli.node.js
CHANGED
|
@@ -2681,15 +2681,8 @@ function addBacklink(targetNotePath, sourceTitle) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
}
|
|
2683
2683
|
function updateMasterIndex(vaultRootPath) {
|
|
2684
|
-
const now = new Date().toISOString().split("T")[0];
|
|
2685
2684
|
const sections = [
|
|
2686
|
-
`---`,
|
|
2687
|
-
`updated: "${new Date().toISOString()}"`,
|
|
2688
|
-
`---`,
|
|
2689
|
-
``,
|
|
2690
2685
|
`# Knowledge Base`,
|
|
2691
|
-
``,
|
|
2692
|
-
`> Last updated: ${now}`,
|
|
2693
2686
|
``
|
|
2694
2687
|
];
|
|
2695
2688
|
const categories = [
|
|
@@ -2722,6 +2715,13 @@ function updateMasterIndex(vaultRootPath) {
|
|
|
2722
2715
|
}
|
|
2723
2716
|
sections.push("");
|
|
2724
2717
|
}
|
|
2718
|
+
const nowIso = new Date().toISOString();
|
|
2719
|
+
const nowDate = nowIso.split("T")[0];
|
|
2720
|
+
sections.push(`---`);
|
|
2721
|
+
sections.push(``);
|
|
2722
|
+
sections.push(`<!-- mink:footer (volatile — keep at end of file) -->`);
|
|
2723
|
+
sections.push(`> Last updated: ${nowDate} (${nowIso})`);
|
|
2724
|
+
sections.push(``);
|
|
2725
2725
|
const indexPath = vaultMasterIndexPath();
|
|
2726
2726
|
atomicWriteText(indexPath, sections.join(`
|
|
2727
2727
|
`));
|
|
@@ -6698,16 +6698,6 @@ function checkJsonFile(name, filePath, validator) {
|
|
|
6698
6698
|
return { name, path: filePath, status: "corrupt" };
|
|
6699
6699
|
return { name, path: filePath, status: "ok" };
|
|
6700
6700
|
}
|
|
6701
|
-
function checkTextFile(name, filePath) {
|
|
6702
|
-
if (!existsSync24(filePath))
|
|
6703
|
-
return { name, path: filePath, status: "missing" };
|
|
6704
|
-
try {
|
|
6705
|
-
readFileSync17(filePath, "utf-8");
|
|
6706
|
-
return { name, path: filePath, status: "ok" };
|
|
6707
|
-
} catch {
|
|
6708
|
-
return { name, path: filePath, status: "corrupt" };
|
|
6709
|
-
}
|
|
6710
|
-
}
|
|
6711
6701
|
function checkDbFile(name, filePath) {
|
|
6712
6702
|
if (!existsSync24(filePath))
|
|
6713
6703
|
return { name, path: filePath, status: "missing" };
|
|
@@ -6721,6 +6711,33 @@ function checkDbFile(name, filePath) {
|
|
|
6721
6711
|
return { name, path: filePath, status: "corrupt" };
|
|
6722
6712
|
}
|
|
6723
6713
|
}
|
|
6714
|
+
function checkShardedText(name, candidatePaths) {
|
|
6715
|
+
const canonical = candidatePaths[0];
|
|
6716
|
+
for (const p of candidatePaths) {
|
|
6717
|
+
if (!existsSync24(p))
|
|
6718
|
+
continue;
|
|
6719
|
+
try {
|
|
6720
|
+
if (statSync9(p).size === 0)
|
|
6721
|
+
continue;
|
|
6722
|
+
readFileSync17(p, "utf-8");
|
|
6723
|
+
return { name, path: p, status: "ok" };
|
|
6724
|
+
} catch {
|
|
6725
|
+
return { name, path: p, status: "corrupt" };
|
|
6726
|
+
}
|
|
6727
|
+
}
|
|
6728
|
+
return { name, path: canonical, status: "missing" };
|
|
6729
|
+
}
|
|
6730
|
+
function actionLogCandidates(cwd) {
|
|
6731
|
+
const dir = projectDir(cwd);
|
|
6732
|
+
return [
|
|
6733
|
+
actionLogPath(cwd),
|
|
6734
|
+
...listDeviceShardsAt(dir).map((id) => shardPath(dir, id, "action-log.md"))
|
|
6735
|
+
];
|
|
6736
|
+
}
|
|
6737
|
+
function learningMemoryCandidates(cwd) {
|
|
6738
|
+
const dir = projectDir(cwd);
|
|
6739
|
+
return [learningMemoryPath(cwd), ...listLearningMemorySidecarPathsAt(dir)];
|
|
6740
|
+
}
|
|
6724
6741
|
function status(cwd) {
|
|
6725
6742
|
console.log("[mink] project status");
|
|
6726
6743
|
console.log();
|
|
@@ -6731,8 +6748,8 @@ function status(cwd) {
|
|
|
6731
6748
|
checkJsonFile("session.json", sessionPath(cwd)),
|
|
6732
6749
|
checkDbFile("mink.db", projectDbPath(cwd)),
|
|
6733
6750
|
checkJsonFile("config.json", configPath(cwd)),
|
|
6734
|
-
|
|
6735
|
-
|
|
6751
|
+
checkShardedText("learning-memory.md", learningMemoryCandidates(cwd)),
|
|
6752
|
+
checkShardedText("action-log.md", actionLogCandidates(cwd))
|
|
6736
6753
|
];
|
|
6737
6754
|
console.log(" State files:");
|
|
6738
6755
|
for (const check of checks) {
|
|
@@ -7098,20 +7115,46 @@ var init_pre_read = __esm(() => {
|
|
|
7098
7115
|
var exports_post_read = {};
|
|
7099
7116
|
__export(exports_post_read, {
|
|
7100
7117
|
postRead: () => postRead,
|
|
7118
|
+
extractContent: () => extractContent,
|
|
7101
7119
|
analyzePostRead: () => analyzePostRead
|
|
7102
7120
|
});
|
|
7103
7121
|
import { relative as relative5 } from "path";
|
|
7122
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
7104
7123
|
function analyzePostRead(filePath, content, index) {
|
|
7105
7124
|
if (isBinaryFile(filePath, content ?? undefined)) {
|
|
7106
7125
|
const entry = index ? index.lookupEntry(filePath) : null;
|
|
7107
|
-
return {
|
|
7126
|
+
return {
|
|
7127
|
+
estimatedTokens: 0,
|
|
7128
|
+
indexHit: !!entry,
|
|
7129
|
+
source: "none",
|
|
7130
|
+
indexEntry: null
|
|
7131
|
+
};
|
|
7108
7132
|
}
|
|
7109
7133
|
if (content !== null && content.length > 0) {
|
|
7110
7134
|
const entry = index ? index.lookupEntry(filePath) : null;
|
|
7135
|
+
const tokens = estimateTokens2(content, filePath);
|
|
7136
|
+
let indexEntry = null;
|
|
7137
|
+
if (!entry) {
|
|
7138
|
+
let description = "";
|
|
7139
|
+
try {
|
|
7140
|
+
description = extractDescription(filePath, content);
|
|
7141
|
+
} catch {
|
|
7142
|
+
description = "";
|
|
7143
|
+
}
|
|
7144
|
+
const now = new Date().toISOString();
|
|
7145
|
+
indexEntry = {
|
|
7146
|
+
filePath,
|
|
7147
|
+
description,
|
|
7148
|
+
estimatedTokens: tokens,
|
|
7149
|
+
lastModified: now,
|
|
7150
|
+
lastIndexed: now
|
|
7151
|
+
};
|
|
7152
|
+
}
|
|
7111
7153
|
return {
|
|
7112
|
-
estimatedTokens:
|
|
7154
|
+
estimatedTokens: tokens,
|
|
7113
7155
|
indexHit: !!entry,
|
|
7114
|
-
source: "content"
|
|
7156
|
+
source: "content",
|
|
7157
|
+
indexEntry
|
|
7115
7158
|
};
|
|
7116
7159
|
}
|
|
7117
7160
|
if (index) {
|
|
@@ -7120,11 +7163,17 @@ function analyzePostRead(filePath, content, index) {
|
|
|
7120
7163
|
return {
|
|
7121
7164
|
estimatedTokens: entry.estimatedTokens,
|
|
7122
7165
|
indexHit: true,
|
|
7123
|
-
source: "index-fallback"
|
|
7166
|
+
source: "index-fallback",
|
|
7167
|
+
indexEntry: null
|
|
7124
7168
|
};
|
|
7125
7169
|
}
|
|
7126
7170
|
}
|
|
7127
|
-
return {
|
|
7171
|
+
return {
|
|
7172
|
+
estimatedTokens: 0,
|
|
7173
|
+
indexHit: false,
|
|
7174
|
+
source: "none",
|
|
7175
|
+
indexEntry: null
|
|
7176
|
+
};
|
|
7128
7177
|
}
|
|
7129
7178
|
function isPostToolUseInput(value) {
|
|
7130
7179
|
if (value === null || typeof value !== "object")
|
|
@@ -7137,9 +7186,22 @@ function isPostToolUseInput(value) {
|
|
|
7137
7186
|
return true;
|
|
7138
7187
|
}
|
|
7139
7188
|
function extractContent(input) {
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7189
|
+
const tr = input.tool_response;
|
|
7190
|
+
if (tr) {
|
|
7191
|
+
if (typeof tr.content === "string")
|
|
7192
|
+
return tr.content;
|
|
7193
|
+
if (Array.isArray(tr.content)) {
|
|
7194
|
+
const parts = tr.content.map((p) => p && typeof p.text === "string" ? p.text : "").filter((s) => s.length > 0);
|
|
7195
|
+
if (parts.length > 0)
|
|
7196
|
+
return parts.join("");
|
|
7197
|
+
}
|
|
7198
|
+
if (tr.file && typeof tr.file.content === "string") {
|
|
7199
|
+
return tr.file.content;
|
|
7200
|
+
}
|
|
7201
|
+
if (typeof tr.text === "string")
|
|
7202
|
+
return tr.text;
|
|
7203
|
+
}
|
|
7204
|
+
if (input.tool_output && typeof input.tool_output.content === "string") {
|
|
7143
7205
|
return input.tool_output.content;
|
|
7144
7206
|
}
|
|
7145
7207
|
return null;
|
|
@@ -7159,8 +7221,19 @@ async function postRead(cwd) {
|
|
|
7159
7221
|
const rawState = safeReadJson(sessionPath(cwd));
|
|
7160
7222
|
const state = isSessionState(rawState) ? rawState : createSessionState();
|
|
7161
7223
|
const repo = FileIndexRepo.for(cwd);
|
|
7162
|
-
|
|
7224
|
+
let content = null;
|
|
7225
|
+
try {
|
|
7226
|
+
content = readFileSync19(absolutePath, "utf-8");
|
|
7227
|
+
} catch {}
|
|
7228
|
+
if (content === null) {
|
|
7229
|
+
content = extractContent(input);
|
|
7230
|
+
}
|
|
7163
7231
|
const result = analyzePostRead(filePath, content, repo);
|
|
7232
|
+
if (result.indexEntry) {
|
|
7233
|
+
try {
|
|
7234
|
+
repo.upsert(result.indexEntry);
|
|
7235
|
+
} catch {}
|
|
7236
|
+
}
|
|
7164
7237
|
recordRead(state, filePath, result.estimatedTokens, result.indexHit);
|
|
7165
7238
|
try {
|
|
7166
7239
|
const logWriter = createActionLogWriter(actionLogShardPath(cwd, getOrCreateDeviceId()));
|
|
@@ -7177,6 +7250,7 @@ var init_post_read = __esm(() => {
|
|
|
7177
7250
|
init_session();
|
|
7178
7251
|
init_file_index_repo();
|
|
7179
7252
|
init_token_estimate();
|
|
7253
|
+
init_description();
|
|
7180
7254
|
init_action_log();
|
|
7181
7255
|
init_device();
|
|
7182
7256
|
});
|
|
@@ -7377,7 +7451,7 @@ __export(exports_post_write, {
|
|
|
7377
7451
|
analyzePostWrite: () => analyzePostWrite
|
|
7378
7452
|
});
|
|
7379
7453
|
import { relative as relative7 } from "path";
|
|
7380
|
-
import { readFileSync as
|
|
7454
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
7381
7455
|
function analyzePostWrite(filePath, fileContent, index) {
|
|
7382
7456
|
if (isWriteExcluded(filePath)) {
|
|
7383
7457
|
return {
|
|
@@ -7441,7 +7515,7 @@ async function postWrite(cwd) {
|
|
|
7441
7515
|
const filePath = relative7(cwd, absolutePath);
|
|
7442
7516
|
let fileContent = null;
|
|
7443
7517
|
try {
|
|
7444
|
-
fileContent =
|
|
7518
|
+
fileContent = readFileSync20(absolutePath, "utf-8");
|
|
7445
7519
|
} catch {}
|
|
7446
7520
|
const rawState = safeReadJson(sessionPath(cwd));
|
|
7447
7521
|
const state = isSessionState(rawState) ? rawState : createSessionState();
|
|
@@ -7794,7 +7868,7 @@ __export(exports_self_update, {
|
|
|
7794
7868
|
PACKAGE_NAME: () => PACKAGE_NAME
|
|
7795
7869
|
});
|
|
7796
7870
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
7797
|
-
import { existsSync as existsSync26, readFileSync as
|
|
7871
|
+
import { existsSync as existsSync26, readFileSync as readFileSync21 } from "fs";
|
|
7798
7872
|
import { dirname as dirname11 } from "path";
|
|
7799
7873
|
import { join as join23 } from "path";
|
|
7800
7874
|
function parseSemver(input) {
|
|
@@ -7861,7 +7935,7 @@ function getInstallInfo() {
|
|
|
7861
7935
|
}
|
|
7862
7936
|
let currentVersion = "0.0.0";
|
|
7863
7937
|
try {
|
|
7864
|
-
const pkg = JSON.parse(
|
|
7938
|
+
const pkg = JSON.parse(readFileSync21(packageJsonPath, "utf-8"));
|
|
7865
7939
|
if (typeof pkg.version === "string")
|
|
7866
7940
|
currentVersion = pkg.version;
|
|
7867
7941
|
} catch {}
|
|
@@ -7934,7 +8008,7 @@ function appendLogEntry(entry) {
|
|
|
7934
8008
|
}
|
|
7935
8009
|
function rotateLogIfNeeded(path) {
|
|
7936
8010
|
try {
|
|
7937
|
-
const content =
|
|
8011
|
+
const content = readFileSync21(path, "utf-8");
|
|
7938
8012
|
const lines = content.split(`
|
|
7939
8013
|
`);
|
|
7940
8014
|
if (lines.length <= LOG_MAX_LINES + 1)
|
|
@@ -8037,7 +8111,7 @@ async function runSelfUpgradeInner(opts) {
|
|
|
8037
8111
|
}
|
|
8038
8112
|
let verifiedVersion = latest;
|
|
8039
8113
|
try {
|
|
8040
|
-
const pkg = JSON.parse(
|
|
8114
|
+
const pkg = JSON.parse(readFileSync21(info.packageJsonPath, "utf-8"));
|
|
8041
8115
|
if (typeof pkg.version === "string")
|
|
8042
8116
|
verifiedVersion = pkg.version;
|
|
8043
8117
|
} catch {}
|
|
@@ -8143,10 +8217,10 @@ async function executeTask(taskId, projectCwd) {
|
|
|
8143
8217
|
if (task.actionType === "ai-cli") {
|
|
8144
8218
|
try {
|
|
8145
8219
|
const { learningMemoryPath: learningMemoryPath5 } = await Promise.resolve().then(() => (init_paths(), exports_paths));
|
|
8146
|
-
const { readFileSync:
|
|
8220
|
+
const { readFileSync: readFileSync22 } = await import("fs");
|
|
8147
8221
|
let memoryContent;
|
|
8148
8222
|
try {
|
|
8149
|
-
memoryContent =
|
|
8223
|
+
memoryContent = readFileSync22(learningMemoryPath5(projectCwd), "utf-8");
|
|
8150
8224
|
} catch {
|
|
8151
8225
|
console.log("[mink] no learning memory found, skipping reflection");
|
|
8152
8226
|
return;
|
|
@@ -8711,7 +8785,7 @@ var init_cron = __esm(() => {
|
|
|
8711
8785
|
|
|
8712
8786
|
// src/core/vault-templates.ts
|
|
8713
8787
|
import { join as join24 } from "path";
|
|
8714
|
-
import { existsSync as existsSync27, writeFileSync as writeFileSync9, readFileSync as
|
|
8788
|
+
import { existsSync as existsSync27, writeFileSync as writeFileSync9, readFileSync as readFileSync22, mkdirSync as mkdirSync13 } from "fs";
|
|
8715
8789
|
function seedTemplates(templatesDir) {
|
|
8716
8790
|
mkdirSync13(templatesDir, { recursive: true });
|
|
8717
8791
|
for (const [name, content] of Object.entries(DEFAULT_TEMPLATES)) {
|
|
@@ -8725,7 +8799,7 @@ function loadTemplate(templatesDir, templateName, vars) {
|
|
|
8725
8799
|
const filePath = join24(templatesDir, `${templateName}.md`);
|
|
8726
8800
|
let content;
|
|
8727
8801
|
if (existsSync27(filePath)) {
|
|
8728
|
-
content =
|
|
8802
|
+
content = readFileSync22(filePath, "utf-8");
|
|
8729
8803
|
} else if (DEFAULT_TEMPLATES[templateName]) {
|
|
8730
8804
|
content = DEFAULT_TEMPLATES[templateName];
|
|
8731
8805
|
} else {
|
|
@@ -8879,7 +8953,7 @@ category: resources
|
|
|
8879
8953
|
|
|
8880
8954
|
// src/core/note-writer.ts
|
|
8881
8955
|
import { join as join25 } from "path";
|
|
8882
|
-
import { existsSync as existsSync28, readFileSync as
|
|
8956
|
+
import { existsSync as existsSync28, readFileSync as readFileSync23 } from "fs";
|
|
8883
8957
|
import { createHash as createHash4 } from "crypto";
|
|
8884
8958
|
function sha256(content) {
|
|
8885
8959
|
return createHash4("sha256").update(content).digest("hex");
|
|
@@ -8904,7 +8978,7 @@ function resolveUniqueNotePath(dir, baseSlug, content) {
|
|
|
8904
8978
|
}
|
|
8905
8979
|
function sameContent(filePath, expectedHash) {
|
|
8906
8980
|
try {
|
|
8907
|
-
return sha256(
|
|
8981
|
+
return sha256(readFileSync23(filePath, "utf-8")) === expectedHash;
|
|
8908
8982
|
} catch {
|
|
8909
8983
|
return false;
|
|
8910
8984
|
}
|
|
@@ -9013,7 +9087,7 @@ ${content}
|
|
|
9013
9087
|
return filePath;
|
|
9014
9088
|
}
|
|
9015
9089
|
function ingestFile(sourcePath, meta) {
|
|
9016
|
-
const raw =
|
|
9090
|
+
const raw = readFileSync23(sourcePath, "utf-8");
|
|
9017
9091
|
const now = new Date().toISOString();
|
|
9018
9092
|
const headingMatch = raw.match(/^#\s+(.+)$/m);
|
|
9019
9093
|
const title = headingMatch?.[1] ?? sourcePath.split("/").pop().replace(/\.md$/, "");
|
|
@@ -9085,7 +9159,7 @@ var init_design_eval = __esm(() => {
|
|
|
9085
9159
|
});
|
|
9086
9160
|
|
|
9087
9161
|
// src/core/dashboard-api.ts
|
|
9088
|
-
import { existsSync as existsSync29, readFileSync as
|
|
9162
|
+
import { existsSync as existsSync29, readFileSync as readFileSync24 } from "fs";
|
|
9089
9163
|
import { readdirSync as readdirSync9, readFileSync as readFileSyncFS, existsSync as fsExistsSync } from "fs";
|
|
9090
9164
|
import { join as join26, resolve as resolve5, normalize, sep } from "path";
|
|
9091
9165
|
import { execSync as execSync6 } from "child_process";
|
|
@@ -9109,11 +9183,11 @@ function checkJsonFile2(name, filePath, validator) {
|
|
|
9109
9183
|
return { name, status: "corrupt" };
|
|
9110
9184
|
return { name, status: "ok" };
|
|
9111
9185
|
}
|
|
9112
|
-
function
|
|
9186
|
+
function checkTextFile(name, filePath) {
|
|
9113
9187
|
if (!existsSync29(filePath))
|
|
9114
9188
|
return { name, status: "missing" };
|
|
9115
9189
|
try {
|
|
9116
|
-
|
|
9190
|
+
readFileSync24(filePath, "utf-8");
|
|
9117
9191
|
return { name, status: "ok" };
|
|
9118
9192
|
} catch {
|
|
9119
9193
|
return { name, status: "corrupt" };
|
|
@@ -9123,7 +9197,7 @@ function checkDbFile2(name, filePath) {
|
|
|
9123
9197
|
if (!existsSync29(filePath))
|
|
9124
9198
|
return { name, status: "missing" };
|
|
9125
9199
|
try {
|
|
9126
|
-
const header =
|
|
9200
|
+
const header = readFileSync24(filePath).slice(0, 16).toString("utf-8");
|
|
9127
9201
|
return header.startsWith("SQLite format 3") ? { name, status: "ok" } : { name, status: "corrupt" };
|
|
9128
9202
|
} catch {
|
|
9129
9203
|
return { name, status: "corrupt" };
|
|
@@ -9158,8 +9232,8 @@ function loadOverview(cwd) {
|
|
|
9158
9232
|
checkJsonFile2("session.json", sessionPath(cwd)),
|
|
9159
9233
|
checkDbFile2("mink.db", projectDbPath(cwd)),
|
|
9160
9234
|
checkJsonFile2("config.json", configPath(cwd)),
|
|
9161
|
-
|
|
9162
|
-
|
|
9235
|
+
checkTextFile("learning-memory.md", learningMemoryPath(cwd)),
|
|
9236
|
+
checkTextFile("action-log.md", actionLogPath(cwd)),
|
|
9163
9237
|
checkJsonFile2("scheduler-manifest.json", schedulerManifestPath(cwd))
|
|
9164
9238
|
];
|
|
9165
9239
|
return { project, daemon, summary, stateFiles };
|
|
@@ -10785,7 +10859,7 @@ var exports_daemon = {};
|
|
|
10785
10859
|
__export(exports_daemon, {
|
|
10786
10860
|
daemon: () => daemon
|
|
10787
10861
|
});
|
|
10788
|
-
import { readFileSync as
|
|
10862
|
+
import { readFileSync as readFileSync25, existsSync as existsSync34 } from "fs";
|
|
10789
10863
|
async function daemon(cwd, args) {
|
|
10790
10864
|
const subcommand = args[0];
|
|
10791
10865
|
switch (subcommand) {
|
|
@@ -10806,7 +10880,7 @@ async function daemon(cwd, args) {
|
|
|
10806
10880
|
return;
|
|
10807
10881
|
}
|
|
10808
10882
|
try {
|
|
10809
|
-
const content =
|
|
10883
|
+
const content = readFileSync25(logPath, "utf-8");
|
|
10810
10884
|
const lines = content.split(`
|
|
10811
10885
|
`);
|
|
10812
10886
|
const tail = lines.slice(-50).join(`
|
|
@@ -11387,7 +11461,7 @@ var init_restore = __esm(() => {
|
|
|
11387
11461
|
});
|
|
11388
11462
|
|
|
11389
11463
|
// src/core/design-eval/server-detect.ts
|
|
11390
|
-
import { readFileSync as
|
|
11464
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
11391
11465
|
import { join as join30 } from "path";
|
|
11392
11466
|
async function probePort(port) {
|
|
11393
11467
|
try {
|
|
@@ -11410,7 +11484,7 @@ async function findRunningServer(ports = DEFAULT_PROBE_PORTS) {
|
|
|
11410
11484
|
}
|
|
11411
11485
|
function detectDevCommand(cwd) {
|
|
11412
11486
|
try {
|
|
11413
|
-
const raw =
|
|
11487
|
+
const raw = readFileSync26(join30(cwd, "package.json"), "utf-8");
|
|
11414
11488
|
const pkg = JSON.parse(raw);
|
|
11415
11489
|
const scripts = pkg.scripts;
|
|
11416
11490
|
if (!scripts || typeof scripts !== "object")
|
|
@@ -83779,7 +83853,7 @@ var init_fileUtil = __esm(() => {
|
|
|
83779
83853
|
// node_modules/@puppeteer/browsers/lib/esm/install.js
|
|
83780
83854
|
import assert2 from "node:assert";
|
|
83781
83855
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
83782
|
-
import { existsSync as existsSync36, readFileSync as
|
|
83856
|
+
import { existsSync as existsSync36, readFileSync as readFileSync27 } from "node:fs";
|
|
83783
83857
|
import { mkdir as mkdir2, unlink } from "node:fs/promises";
|
|
83784
83858
|
import os5 from "node:os";
|
|
83785
83859
|
import path8 from "node:path";
|
|
@@ -83869,7 +83943,7 @@ async function installDeps(installedBrowser) {
|
|
|
83869
83943
|
debugInstall(`deb.deps file was not found at ${depsPath}`);
|
|
83870
83944
|
return;
|
|
83871
83945
|
}
|
|
83872
|
-
const data =
|
|
83946
|
+
const data = readFileSync27(depsPath, "utf-8").split(`
|
|
83873
83947
|
`).join(",");
|
|
83874
83948
|
if (process.getuid?.() !== 0) {
|
|
83875
83949
|
throw new Error("Installing system dependencies requires root privileges");
|
|
@@ -85394,14 +85468,14 @@ var init_yerror = __esm(() => {
|
|
|
85394
85468
|
});
|
|
85395
85469
|
|
|
85396
85470
|
// node_modules/y18n/build/lib/platform-shims/node.js
|
|
85397
|
-
import { readFileSync as
|
|
85471
|
+
import { readFileSync as readFileSync28, statSync as statSync14, writeFile } from "fs";
|
|
85398
85472
|
import { format as format2 } from "util";
|
|
85399
85473
|
import { resolve as resolve12 } from "path";
|
|
85400
85474
|
var node_default;
|
|
85401
85475
|
var init_node = __esm(() => {
|
|
85402
85476
|
node_default = {
|
|
85403
85477
|
fs: {
|
|
85404
|
-
readFileSync:
|
|
85478
|
+
readFileSync: readFileSync28,
|
|
85405
85479
|
writeFile
|
|
85406
85480
|
},
|
|
85407
85481
|
format: format2,
|
|
@@ -85586,7 +85660,7 @@ var init_y18n = __esm(() => {
|
|
|
85586
85660
|
// node_modules/yargs/lib/platform-shims/esm.mjs
|
|
85587
85661
|
import { notStrictEqual, strictEqual } from "assert";
|
|
85588
85662
|
import { inspect } from "util";
|
|
85589
|
-
import { readFileSync as
|
|
85663
|
+
import { readFileSync as readFileSync29 } from "fs";
|
|
85590
85664
|
import { fileURLToPath } from "url";
|
|
85591
85665
|
import { basename as basename9, dirname as dirname16, extname as extname3, relative as relative9, resolve as resolve13 } from "path";
|
|
85592
85666
|
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;
|
|
@@ -85635,7 +85709,7 @@ var init_esm = __esm(() => {
|
|
|
85635
85709
|
nextTick: process.nextTick,
|
|
85636
85710
|
stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
|
|
85637
85711
|
},
|
|
85638
|
-
readFileSync:
|
|
85712
|
+
readFileSync: readFileSync29,
|
|
85639
85713
|
require: () => {
|
|
85640
85714
|
throw new YError(REQUIRE_ERROR);
|
|
85641
85715
|
},
|
|
@@ -91894,7 +91968,7 @@ function generateKnowledgeMarkdown(k) {
|
|
|
91894
91968
|
const parts = [];
|
|
91895
91969
|
parts.push(`# Framework Advisor Knowledge Base`);
|
|
91896
91970
|
parts.push("");
|
|
91897
|
-
parts.push(`>
|
|
91971
|
+
parts.push(`> Version: ${k.version} | Frameworks: ${k.frameworks.length}`);
|
|
91898
91972
|
parts.push("");
|
|
91899
91973
|
parts.push("## Comparison Matrix");
|
|
91900
91974
|
parts.push("");
|
|
@@ -91950,6 +92024,11 @@ function generateKnowledgeMarkdown(k) {
|
|
|
91950
92024
|
parts.push("");
|
|
91951
92025
|
}
|
|
91952
92026
|
}
|
|
92027
|
+
parts.push(`---`);
|
|
92028
|
+
parts.push(``);
|
|
92029
|
+
parts.push(`<!-- mink:footer (volatile — keep at end of file) -->`);
|
|
92030
|
+
parts.push(`> Generated: ${k.generatedAt}`);
|
|
92031
|
+
parts.push(``);
|
|
91953
92032
|
return parts.join(`
|
|
91954
92033
|
`);
|
|
91955
92034
|
}
|
|
@@ -92425,7 +92504,7 @@ __export(exports_note, {
|
|
|
92425
92504
|
note: () => note
|
|
92426
92505
|
});
|
|
92427
92506
|
import { resolve as resolve15 } from "path";
|
|
92428
|
-
import { existsSync as existsSync40, readFileSync as
|
|
92507
|
+
import { existsSync as existsSync40, readFileSync as readFileSync30 } from "fs";
|
|
92429
92508
|
async function note(cwd, args) {
|
|
92430
92509
|
if (!isWikiEnabled()) {
|
|
92431
92510
|
console.error("[mink] wiki feature is disabled");
|
|
@@ -92450,7 +92529,7 @@ async function note(cwd, args) {
|
|
|
92450
92529
|
const date = new Date().toISOString().split("T")[0];
|
|
92451
92530
|
const content = parsed.positional || parsed.body || "";
|
|
92452
92531
|
const filePath = appendToDaily(date, content);
|
|
92453
|
-
updateVaultIndexForFile(filePath,
|
|
92532
|
+
updateVaultIndexForFile(filePath, readFileSync30(filePath, "utf-8"));
|
|
92454
92533
|
console.log(`[mink] daily note: ${filePath}`);
|
|
92455
92534
|
return;
|
|
92456
92535
|
}
|
|
@@ -92783,7 +92862,7 @@ import { homedir as homedir7 } from "os";
|
|
|
92783
92862
|
import {
|
|
92784
92863
|
existsSync as existsSync42,
|
|
92785
92864
|
mkdirSync as mkdirSync18,
|
|
92786
|
-
readFileSync as
|
|
92865
|
+
readFileSync as readFileSync31,
|
|
92787
92866
|
writeFileSync as writeFileSync11
|
|
92788
92867
|
} from "fs";
|
|
92789
92868
|
import { createHash as createHash5 } from "crypto";
|
|
@@ -92807,7 +92886,7 @@ function getMinkVersion() {
|
|
|
92807
92886
|
const pkgPath = join36(dir, "package.json");
|
|
92808
92887
|
if (existsSync42(pkgPath)) {
|
|
92809
92888
|
try {
|
|
92810
|
-
const pkg = JSON.parse(
|
|
92889
|
+
const pkg = JSON.parse(readFileSync31(pkgPath, "utf-8"));
|
|
92811
92890
|
if (pkg.name && pkg.version)
|
|
92812
92891
|
return pkg.version;
|
|
92813
92892
|
} catch {}
|
|
@@ -92845,7 +92924,7 @@ function installAgentDefinition(opts) {
|
|
|
92845
92924
|
if (opts.skip && existsSync42(installed)) {
|
|
92846
92925
|
return { action: "skipped", path: installed };
|
|
92847
92926
|
}
|
|
92848
|
-
const template =
|
|
92927
|
+
const template = readFileSync31(templatePath, "utf-8");
|
|
92849
92928
|
const rendered = renderTemplate(template, {
|
|
92850
92929
|
MINK_ROOT: minkRoot(),
|
|
92851
92930
|
VAULT_PATH: resolveVaultPath(),
|
|
@@ -92853,7 +92932,7 @@ function installAgentDefinition(opts) {
|
|
|
92853
92932
|
});
|
|
92854
92933
|
const exists = existsSync42(installed);
|
|
92855
92934
|
if (!opts.force && exists) {
|
|
92856
|
-
const current =
|
|
92935
|
+
const current = readFileSync31(installed, "utf-8");
|
|
92857
92936
|
if (sha2562(current) === sha2562(rendered)) {
|
|
92858
92937
|
return { action: "unchanged", path: installed };
|
|
92859
92938
|
}
|
|
@@ -92981,7 +93060,7 @@ var init_agent = __esm(() => {
|
|
|
92981
93060
|
});
|
|
92982
93061
|
|
|
92983
93062
|
// src/core/sync-merge-drivers.ts
|
|
92984
|
-
import { readFileSync as
|
|
93063
|
+
import { readFileSync as readFileSync32, writeFileSync as writeFileSync12, appendFileSync as appendFileSync2, copyFileSync as copyFileSync2, unlinkSync as unlinkSync7 } from "fs";
|
|
92985
93064
|
import { join as join37 } from "path";
|
|
92986
93065
|
function logWarning(driver, args, err) {
|
|
92987
93066
|
try {
|
|
@@ -92992,14 +93071,14 @@ function logWarning(driver, args, err) {
|
|
|
92992
93071
|
}
|
|
92993
93072
|
function readJsonOrNull(path12) {
|
|
92994
93073
|
try {
|
|
92995
|
-
return JSON.parse(
|
|
93074
|
+
return JSON.parse(readFileSync32(path12, "utf-8"));
|
|
92996
93075
|
} catch {
|
|
92997
93076
|
return null;
|
|
92998
93077
|
}
|
|
92999
93078
|
}
|
|
93000
93079
|
function readTextOrEmpty(path12) {
|
|
93001
93080
|
try {
|
|
93002
|
-
return
|
|
93081
|
+
return readFileSync32(path12, "utf-8");
|
|
93003
93082
|
} catch {
|
|
93004
93083
|
return "";
|
|
93005
93084
|
}
|
|
@@ -93889,9 +93968,9 @@ switch (command2) {
|
|
|
93889
93968
|
const { resolve: resolve18, dirname: dirname20, basename: basename10 } = await import("path");
|
|
93890
93969
|
const bundlePath = new URL(import.meta.url).pathname;
|
|
93891
93970
|
const cliPath = resolve18(dirname20(bundlePath));
|
|
93892
|
-
const { readFileSync:
|
|
93971
|
+
const { readFileSync: readFileSync33 } = await import("fs");
|
|
93893
93972
|
try {
|
|
93894
|
-
const pkg = JSON.parse(
|
|
93973
|
+
const pkg = JSON.parse(readFileSync33(resolve18(cliPath, "../package.json"), "utf-8"));
|
|
93895
93974
|
console.log(`mink ${pkg.version}`);
|
|
93896
93975
|
} catch {
|
|
93897
93976
|
console.log("mink (unknown version)");
|
package/package.json
CHANGED