@drewpayment/mink 0.12.0-beta.3 → 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.
Files changed (47) hide show
  1. package/dashboard/out/404.html +1 -1
  2. package/dashboard/out/action-log.html +1 -1
  3. package/dashboard/out/action-log.txt +1 -1
  4. package/dashboard/out/activity.html +1 -1
  5. package/dashboard/out/activity.txt +1 -1
  6. package/dashboard/out/bugs.html +1 -1
  7. package/dashboard/out/bugs.txt +1 -1
  8. package/dashboard/out/capture.html +1 -1
  9. package/dashboard/out/capture.txt +1 -1
  10. package/dashboard/out/config.html +1 -1
  11. package/dashboard/out/config.txt +1 -1
  12. package/dashboard/out/daemon.html +1 -1
  13. package/dashboard/out/daemon.txt +1 -1
  14. package/dashboard/out/design.html +1 -1
  15. package/dashboard/out/design.txt +1 -1
  16. package/dashboard/out/discord.html +1 -1
  17. package/dashboard/out/discord.txt +1 -1
  18. package/dashboard/out/file-index.html +1 -1
  19. package/dashboard/out/file-index.txt +1 -1
  20. package/dashboard/out/index.html +1 -1
  21. package/dashboard/out/index.txt +1 -1
  22. package/dashboard/out/insights.html +1 -1
  23. package/dashboard/out/insights.txt +1 -1
  24. package/dashboard/out/learning.html +1 -1
  25. package/dashboard/out/learning.txt +1 -1
  26. package/dashboard/out/overview.html +1 -1
  27. package/dashboard/out/overview.txt +1 -1
  28. package/dashboard/out/scheduler.html +1 -1
  29. package/dashboard/out/scheduler.txt +1 -1
  30. package/dashboard/out/sync.html +1 -1
  31. package/dashboard/out/sync.txt +1 -1
  32. package/dashboard/out/tokens.html +1 -1
  33. package/dashboard/out/tokens.txt +1 -1
  34. package/dashboard/out/waste.html +1 -1
  35. package/dashboard/out/waste.txt +1 -1
  36. package/dashboard/out/wiki.html +1 -1
  37. package/dashboard/out/wiki.txt +1 -1
  38. package/dist/cli.bun.js +139 -57
  39. package/dist/cli.node.js +139 -57
  40. package/package.json +1 -1
  41. package/src/commands/dashboard.ts +49 -3
  42. package/src/commands/post-read.ts +94 -9
  43. package/src/core/framework-advisor/generate.ts +11 -1
  44. package/src/core/note-linker.ts +12 -7
  45. package/src/types/hook-input.ts +10 -0
  46. /package/dashboard/out/_next/static/{qQncyEK2SSmDpJw1uhqt9 → eZlC6TEe7TWUABN2-Ho0J}/_buildManifest.js +0 -0
  47. /package/dashboard/out/_next/static/{qQncyEK2SSmDpJw1uhqt9 → 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 { estimatedTokens: 0, indexHit: !!entry, source: "none" };
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: estimateTokens2(content, filePath),
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 { estimatedTokens: 0, indexHit: false, source: "none" };
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
- if (!input.tool_output)
6802
- return null;
6803
- if (typeof input.tool_output.content === "string") {
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
- const content = extractContent(input);
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 readFileSync18 } from "fs";
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 = readFileSync18(absolutePath, "utf-8");
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 readFileSync19 } from "fs";
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(readFileSync19(packageJsonPath, "utf-8"));
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 = readFileSync19(path, "utf-8");
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(readFileSync19(info.packageJsonPath, "utf-8"));
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: readFileSync20 } = await import("fs");
7812
+ const { readFileSync: readFileSync21 } = await import("fs");
7756
7813
  let memoryContent;
7757
7814
  try {
7758
- memoryContent = readFileSync20(learningMemoryPath4(projectCwd), "utf-8");
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 readFileSync20, mkdirSync as mkdirSync13 } from "fs";
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 = readFileSync20(filePath, "utf-8");
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 readFileSync21 } from "fs";
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(readFileSync21(filePath, "utf-8")) === expectedHash;
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 = readFileSync21(sourcePath, "utf-8");
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 readFileSync22 } from "fs";
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
- readFileSync22(filePath, "utf-8");
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 = readFileSync22(filePath).slice(0, 16).toString("utf-8");
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" };
@@ -10106,25 +10163,45 @@ var init_dashboard_server = __esm(() => {
10106
10163
  // src/commands/dashboard.ts
10107
10164
  var exports_dashboard = {};
10108
10165
  __export(exports_dashboard, {
10166
+ resolveStartupCwd: () => resolveStartupCwd,
10109
10167
  dashboard: () => dashboard
10110
10168
  });
10111
10169
  import { existsSync as existsSync29 } from "fs";
10170
+ function resolveStartupCwd(cwd, registered = listRegisteredProjects()) {
10171
+ if (existsSync29(projectDir(cwd))) {
10172
+ return { kind: "active", cwd };
10173
+ }
10174
+ if (registered.length === 0) {
10175
+ return { kind: "none" };
10176
+ }
10177
+ const fallback = [...registered].sort((a, b) => a.name.localeCompare(b.name))[0];
10178
+ return { kind: "fallback", cwd: fallback.cwd, project: fallback };
10179
+ }
10112
10180
  async function dashboard(cwd, args) {
10113
- if (!existsSync29(projectDir(cwd))) {
10114
- console.error("[mink] project not initialized. Run: mink init");
10181
+ const resolution = resolveStartupCwd(cwd);
10182
+ if (resolution.kind === "none") {
10183
+ console.error("[mink] no mink projects found. Run `mink init` in a project first.");
10115
10184
  process.exit(1);
10116
10185
  }
10186
+ if (resolution.kind === "fallback") {
10187
+ console.log(`[mink] not in a mink project \u2014 starting dashboard with "${resolution.project.name}". ` + "Use the in-app project switcher to change projects.");
10188
+ }
10189
+ const startupCwd = resolution.cwd;
10117
10190
  const portArg = args.find((a) => a.startsWith("--port="));
10118
10191
  const port = portArg ? parseInt(portArg.split("=")[1], 10) : 4040;
10119
10192
  const noOpen = args.includes("--no-open");
10120
10193
  const { startDashboardServer: startDashboardServer2 } = await Promise.resolve().then(() => (init_dashboard_server(), exports_dashboard_server));
10121
- const { url } = await startDashboardServer2(cwd, { port, open: !noOpen });
10194
+ const { url } = await startDashboardServer2(startupCwd, {
10195
+ port,
10196
+ open: !noOpen
10197
+ });
10122
10198
  console.log(`[mink] dashboard running at ${url}`);
10123
10199
  console.log("[mink] press Ctrl+C to stop");
10124
10200
  await new Promise(() => {});
10125
10201
  }
10126
10202
  var init_dashboard = __esm(() => {
10127
10203
  init_paths();
10204
+ init_project_registry();
10128
10205
  });
10129
10206
 
10130
10207
  // src/core/daemon-service.ts
@@ -10302,7 +10379,7 @@ var exports_daemon = {};
10302
10379
  __export(exports_daemon, {
10303
10380
  daemon: () => daemon
10304
10381
  });
10305
- import { readFileSync as readFileSync23, existsSync as existsSync31 } from "fs";
10382
+ import { readFileSync as readFileSync24, existsSync as existsSync31 } from "fs";
10306
10383
  async function daemon(cwd, args) {
10307
10384
  const subcommand = args[0];
10308
10385
  switch (subcommand) {
@@ -10323,7 +10400,7 @@ async function daemon(cwd, args) {
10323
10400
  return;
10324
10401
  }
10325
10402
  try {
10326
- const content = readFileSync23(logPath, "utf-8");
10403
+ const content = readFileSync24(logPath, "utf-8");
10327
10404
  const lines = content.split(`
10328
10405
  `);
10329
10406
  const tail = lines.slice(-50).join(`
@@ -10904,7 +10981,7 @@ var init_restore = __esm(() => {
10904
10981
  });
10905
10982
 
10906
10983
  // src/core/design-eval/server-detect.ts
10907
- import { readFileSync as readFileSync24 } from "fs";
10984
+ import { readFileSync as readFileSync25 } from "fs";
10908
10985
  import { join as join27 } from "path";
10909
10986
  async function probePort(port) {
10910
10987
  try {
@@ -10927,7 +11004,7 @@ async function findRunningServer(ports = DEFAULT_PROBE_PORTS) {
10927
11004
  }
10928
11005
  function detectDevCommand(cwd) {
10929
11006
  try {
10930
- const raw = readFileSync24(join27(cwd, "package.json"), "utf-8");
11007
+ const raw = readFileSync25(join27(cwd, "package.json"), "utf-8");
10931
11008
  const pkg = JSON.parse(raw);
10932
11009
  const scripts = pkg.scripts;
10933
11010
  if (!scripts || typeof scripts !== "object")
@@ -80429,7 +80506,7 @@ var init_fileUtil = __esm(() => {
80429
80506
  // node_modules/@puppeteer/browsers/lib/esm/install.js
80430
80507
  import assert2 from "assert";
80431
80508
  import { spawnSync as spawnSync4 } from "child_process";
80432
- import { existsSync as existsSync33, readFileSync as readFileSync25 } from "fs";
80509
+ import { existsSync as existsSync33, readFileSync as readFileSync26 } from "fs";
80433
80510
  import { mkdir as mkdir2, unlink } from "fs/promises";
80434
80511
  import os5 from "os";
80435
80512
  import path8 from "path";
@@ -80519,7 +80596,7 @@ async function installDeps(installedBrowser) {
80519
80596
  debugInstall(`deb.deps file was not found at ${depsPath}`);
80520
80597
  return;
80521
80598
  }
80522
- const data = readFileSync25(depsPath, "utf-8").split(`
80599
+ const data = readFileSync26(depsPath, "utf-8").split(`
80523
80600
  `).join(",");
80524
80601
  if (process.getuid?.() !== 0) {
80525
80602
  throw new Error("Installing system dependencies requires root privileges");
@@ -82044,14 +82121,14 @@ var init_yerror = __esm(() => {
82044
82121
  });
82045
82122
 
82046
82123
  // node_modules/y18n/build/lib/platform-shims/node.js
82047
- import { readFileSync as readFileSync26, statSync as statSync13, writeFile } from "fs";
82124
+ import { readFileSync as readFileSync27, statSync as statSync13, writeFile } from "fs";
82048
82125
  import { format as format2 } from "util";
82049
82126
  import { resolve as resolve11 } from "path";
82050
82127
  var node_default;
82051
82128
  var init_node = __esm(() => {
82052
82129
  node_default = {
82053
82130
  fs: {
82054
- readFileSync: readFileSync26,
82131
+ readFileSync: readFileSync27,
82055
82132
  writeFile
82056
82133
  },
82057
82134
  format: format2,
@@ -82236,7 +82313,7 @@ var init_y18n = __esm(() => {
82236
82313
  // node_modules/yargs/lib/platform-shims/esm.mjs
82237
82314
  import { notStrictEqual, strictEqual } from "assert";
82238
82315
  import { inspect } from "util";
82239
- import { readFileSync as readFileSync27 } from "fs";
82316
+ import { readFileSync as readFileSync28 } from "fs";
82240
82317
  import { fileURLToPath } from "url";
82241
82318
  import { basename as basename8, dirname as dirname14, extname as extname3, relative as relative8, resolve as resolve12 } from "path";
82242
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;
@@ -82285,7 +82362,7 @@ var init_esm = __esm(() => {
82285
82362
  nextTick: process.nextTick,
82286
82363
  stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
82287
82364
  },
82288
- readFileSync: readFileSync27,
82365
+ readFileSync: readFileSync28,
82289
82366
  require: () => {
82290
82367
  throw new YError(REQUIRE_ERROR);
82291
82368
  },
@@ -88544,7 +88621,7 @@ function generateKnowledgeMarkdown(k) {
88544
88621
  const parts = [];
88545
88622
  parts.push(`# Framework Advisor Knowledge Base`);
88546
88623
  parts.push("");
88547
- parts.push(`> Generated: ${k.generatedAt} | Version: ${k.version} | Frameworks: ${k.frameworks.length}`);
88624
+ parts.push(`> Version: ${k.version} | Frameworks: ${k.frameworks.length}`);
88548
88625
  parts.push("");
88549
88626
  parts.push("## Comparison Matrix");
88550
88627
  parts.push("");
@@ -88600,6 +88677,11 @@ function generateKnowledgeMarkdown(k) {
88600
88677
  parts.push("");
88601
88678
  }
88602
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(``);
88603
88685
  return parts.join(`
88604
88686
  `);
88605
88687
  }
@@ -89075,7 +89157,7 @@ __export(exports_note, {
89075
89157
  note: () => note
89076
89158
  });
89077
89159
  import { resolve as resolve14 } from "path";
89078
- import { existsSync as existsSync37, readFileSync as readFileSync28 } from "fs";
89160
+ import { existsSync as existsSync37, readFileSync as readFileSync29 } from "fs";
89079
89161
  async function note(cwd, args) {
89080
89162
  if (!isWikiEnabled()) {
89081
89163
  console.error("[mink] wiki feature is disabled");
@@ -89100,7 +89182,7 @@ async function note(cwd, args) {
89100
89182
  const date = new Date().toISOString().split("T")[0];
89101
89183
  const content = parsed.positional || parsed.body || "";
89102
89184
  const filePath = appendToDaily(date, content);
89103
- updateVaultIndexForFile(filePath, readFileSync28(filePath, "utf-8"));
89185
+ updateVaultIndexForFile(filePath, readFileSync29(filePath, "utf-8"));
89104
89186
  console.log(`[mink] daily note: ${filePath}`);
89105
89187
  return;
89106
89188
  }
@@ -89433,7 +89515,7 @@ import { homedir as homedir6 } from "os";
89433
89515
  import {
89434
89516
  existsSync as existsSync39,
89435
89517
  mkdirSync as mkdirSync17,
89436
- readFileSync as readFileSync29,
89518
+ readFileSync as readFileSync30,
89437
89519
  writeFileSync as writeFileSync11
89438
89520
  } from "fs";
89439
89521
  import { createHash as createHash4 } from "crypto";
@@ -89457,7 +89539,7 @@ function getMinkVersion() {
89457
89539
  const pkgPath = join33(dir, "package.json");
89458
89540
  if (existsSync39(pkgPath)) {
89459
89541
  try {
89460
- const pkg = JSON.parse(readFileSync29(pkgPath, "utf-8"));
89542
+ const pkg = JSON.parse(readFileSync30(pkgPath, "utf-8"));
89461
89543
  if (pkg.name && pkg.version)
89462
89544
  return pkg.version;
89463
89545
  } catch {}
@@ -89495,7 +89577,7 @@ function installAgentDefinition(opts) {
89495
89577
  if (opts.skip && existsSync39(installed)) {
89496
89578
  return { action: "skipped", path: installed };
89497
89579
  }
89498
- const template = readFileSync29(templatePath, "utf-8");
89580
+ const template = readFileSync30(templatePath, "utf-8");
89499
89581
  const rendered = renderTemplate(template, {
89500
89582
  MINK_ROOT: minkRoot(),
89501
89583
  VAULT_PATH: resolveVaultPath(),
@@ -89503,7 +89585,7 @@ function installAgentDefinition(opts) {
89503
89585
  });
89504
89586
  const exists = existsSync39(installed);
89505
89587
  if (!opts.force && exists) {
89506
- const current = readFileSync29(installed, "utf-8");
89588
+ const current = readFileSync30(installed, "utf-8");
89507
89589
  if (sha2562(current) === sha2562(rendered)) {
89508
89590
  return { action: "unchanged", path: installed };
89509
89591
  }
@@ -89631,7 +89713,7 @@ var init_agent = __esm(() => {
89631
89713
  });
89632
89714
 
89633
89715
  // src/core/sync-merge-drivers.ts
89634
- import { readFileSync as readFileSync30, writeFileSync as writeFileSync12, appendFileSync as appendFileSync2, copyFileSync as copyFileSync2, unlinkSync as unlinkSync7 } from "fs";
89716
+ import { readFileSync as readFileSync31, writeFileSync as writeFileSync12, appendFileSync as appendFileSync2, copyFileSync as copyFileSync2, unlinkSync as unlinkSync7 } from "fs";
89635
89717
  import { join as join34 } from "path";
89636
89718
  function logWarning(driver, args, err) {
89637
89719
  try {
@@ -89642,14 +89724,14 @@ function logWarning(driver, args, err) {
89642
89724
  }
89643
89725
  function readJsonOrNull(path12) {
89644
89726
  try {
89645
- return JSON.parse(readFileSync30(path12, "utf-8"));
89727
+ return JSON.parse(readFileSync31(path12, "utf-8"));
89646
89728
  } catch {
89647
89729
  return null;
89648
89730
  }
89649
89731
  }
89650
89732
  function readTextOrEmpty(path12) {
89651
89733
  try {
89652
- return readFileSync30(path12, "utf-8");
89734
+ return readFileSync31(path12, "utf-8");
89653
89735
  } catch {
89654
89736
  return "";
89655
89737
  }
@@ -90539,9 +90621,9 @@ switch (command2) {
90539
90621
  const { resolve: resolve17, dirname: dirname18, basename: basename9 } = await import("path");
90540
90622
  const bundlePath = new URL(import.meta.url).pathname;
90541
90623
  const cliPath = resolve17(dirname18(bundlePath));
90542
- const { readFileSync: readFileSync31 } = await import("fs");
90624
+ const { readFileSync: readFileSync32 } = await import("fs");
90543
90625
  try {
90544
- const pkg = JSON.parse(readFileSync31(resolve17(cliPath, "../package.json"), "utf-8"));
90626
+ const pkg = JSON.parse(readFileSync32(resolve17(cliPath, "../package.json"), "utf-8"));
90545
90627
  console.log(`mink ${pkg.version}`);
90546
90628
  } catch {
90547
90629
  console.log("mink (unknown version)");