toon-memory 4.3.2 → 4.3.3
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/README.md +17 -11
- package/dist/cli/capture.js +3 -0
- package/dist/cli/setup.js +326 -134
- package/mcp/server.js +546 -125
- package/package.json +2 -2
- package/skills/toon-memory.md +3 -0
- package/src/cli/agents.ts +67 -0
- package/src/cli/commands.ts +54 -15
- package/src/cli/config-writer.ts +75 -10
- package/src/cli/hooks.ts +1 -1
- package/src/cli/types.ts +2 -2
- package/src/lib/evidence.ts +118 -0
- package/src/lib/graph.ts +12 -2
- package/src/lib/quality.ts +13 -3
- package/src/mcp/config.ts +10 -0
- package/src/mcp/consolidation.ts +65 -0
- package/src/mcp/tools.ts +164 -7
- package/src/mcp/vault.ts +176 -0
- package/src/viewer/html.ts +126 -80
- package/src/viewer/index.ts +27 -27
- package/src/viewer/logo-isologo.svg +16 -0
- package/src/viewer/logo.svg +49 -0
- package/src/viewer/types.ts +5 -5
package/mcp/server.js
CHANGED
|
@@ -22258,6 +22258,59 @@ var init_fuzzy = __esm({
|
|
|
22258
22258
|
}
|
|
22259
22259
|
});
|
|
22260
22260
|
|
|
22261
|
+
// src/lib/evidence.ts
|
|
22262
|
+
import { existsSync as existsSync5 } from "fs";
|
|
22263
|
+
function contentJaccard(a, b2) {
|
|
22264
|
+
const sa2 = new Set(tokenize(a));
|
|
22265
|
+
const sb2 = new Set(tokenize(b2));
|
|
22266
|
+
if (sa2.size === 0 && sb2.size === 0) return 1;
|
|
22267
|
+
if (sa2.size === 0 || sb2.size === 0) return 0;
|
|
22268
|
+
let inter = 0;
|
|
22269
|
+
for (const t of sa2) if (sb2.has(t)) inter++;
|
|
22270
|
+
const union2 = sa2.size + sb2.size - inter;
|
|
22271
|
+
return union2 > 0 ? inter / union2 : 0;
|
|
22272
|
+
}
|
|
22273
|
+
function detectContradictions(entries, candidate) {
|
|
22274
|
+
const candText = `${candidate.key} ${candidate.content} ${candidate.tags.join(" ")}`;
|
|
22275
|
+
const hits = [];
|
|
22276
|
+
for (const e of entries) {
|
|
22277
|
+
if (e.status === "obsolete" || e.status === "draft") continue;
|
|
22278
|
+
if (e.key === candidate.key) continue;
|
|
22279
|
+
const strong = e.category === "warning" || e.importance === "critical" || e.importance === "high";
|
|
22280
|
+
if (!strong) continue;
|
|
22281
|
+
const sim = contentJaccard(candText, `${e.key} ${e.content} ${e.tags.join(" ")}`);
|
|
22282
|
+
if (e.category === "warning" && sim < 0.22) continue;
|
|
22283
|
+
if (e.category !== "warning" && sim < 0.3) continue;
|
|
22284
|
+
hits.push({
|
|
22285
|
+
key: e.key,
|
|
22286
|
+
category: e.category,
|
|
22287
|
+
similarity: Math.round(sim * 100),
|
|
22288
|
+
note: e.category === "warning" ? "overlaps a WARNING (negative memory) \u2014 possible landmine" : "may contradict an existing critical/high decision"
|
|
22289
|
+
});
|
|
22290
|
+
}
|
|
22291
|
+
return hits.sort((a, b2) => b2.similarity - a.similarity).slice(0, 3);
|
|
22292
|
+
}
|
|
22293
|
+
function evidenceFor(entries, candidate, file2) {
|
|
22294
|
+
const conflicts = detectContradictions(entries, candidate);
|
|
22295
|
+
if (conflicts.length > 0) return "conflict";
|
|
22296
|
+
if (!file2) return "";
|
|
22297
|
+
const filePath = file2.split(":")[0];
|
|
22298
|
+
return existsSync5(filePath) ? "verified" : "unverified";
|
|
22299
|
+
}
|
|
22300
|
+
var EVIDENCE_BOOST, evidenceBoost;
|
|
22301
|
+
var init_evidence = __esm({
|
|
22302
|
+
"src/lib/evidence.ts"() {
|
|
22303
|
+
"use strict";
|
|
22304
|
+
init_utils();
|
|
22305
|
+
EVIDENCE_BOOST = {
|
|
22306
|
+
conflict: 0.15,
|
|
22307
|
+
verified: 0.03,
|
|
22308
|
+
unverified: -0.02
|
|
22309
|
+
};
|
|
22310
|
+
evidenceBoost = (evidence) => EVIDENCE_BOOST[evidence] ?? 0;
|
|
22311
|
+
}
|
|
22312
|
+
});
|
|
22313
|
+
|
|
22261
22314
|
// src/lib/graph.ts
|
|
22262
22315
|
function parseLinkToken(token) {
|
|
22263
22316
|
const idx = token.lastIndexOf(":");
|
|
@@ -22279,7 +22332,7 @@ function parseEntries(data) {
|
|
|
22279
22332
|
const out = [];
|
|
22280
22333
|
for (const line of entryLines(data)) {
|
|
22281
22334
|
const parts = parseToonLine(line);
|
|
22282
|
-
if (parts.length <
|
|
22335
|
+
if (parts.length < 3) continue;
|
|
22283
22336
|
const [id2, category, key, content, file2, tags, date5, ttl, accessedRaw, linksRaw] = parts;
|
|
22284
22337
|
out.push({
|
|
22285
22338
|
id: id2,
|
|
@@ -22298,7 +22351,8 @@ function parseEntries(data) {
|
|
|
22298
22351
|
origin: parts.length > 15 && parts[15] ? parts[15] : "agent",
|
|
22299
22352
|
status: parts.length > 16 && parts[16] ? parts[16] : "active",
|
|
22300
22353
|
supersededOn: parts.length > 17 ? parts[17] || "" : "",
|
|
22301
|
-
importance: parts.length > 18 ? parts[18] || "" : ""
|
|
22354
|
+
importance: parts.length > 18 ? parts[18] || "" : "",
|
|
22355
|
+
evidence: parts.length > 19 ? parts[19] || "" : ""
|
|
22302
22356
|
});
|
|
22303
22357
|
}
|
|
22304
22358
|
return out;
|
|
@@ -22490,6 +22544,7 @@ function buildReason(e, bm25Score, bm25Max, impScore, today = (/* @__PURE__ */ n
|
|
|
22490
22544
|
}
|
|
22491
22545
|
parts.push(impScore >= 0.7 ? "importance HIGH" : impScore >= 0.4 ? "importance MED" : "importance LOW");
|
|
22492
22546
|
if (e.importance) parts.push(`explicit ${e.importance}`);
|
|
22547
|
+
if (e.evidence) parts.push(`evidence ${e.evidence}`);
|
|
22493
22548
|
return parts.join(" \xB7 ");
|
|
22494
22549
|
}
|
|
22495
22550
|
function graphRecallDetailed(data, query, opts = {}) {
|
|
@@ -22578,6 +22633,7 @@ function graphRecallDetailed(data, query, opts = {}) {
|
|
|
22578
22633
|
}
|
|
22579
22634
|
if (e.category === "warning") s2 += 0.2;
|
|
22580
22635
|
s2 += importanceBoost(e.importance);
|
|
22636
|
+
s2 += evidenceBoost(e.evidence);
|
|
22581
22637
|
s2 *= decay;
|
|
22582
22638
|
return { e, s: s2, priority: e.priority };
|
|
22583
22639
|
}).sort((a, b2) => {
|
|
@@ -22674,9 +22730,10 @@ function renderCompact(entries, opts = {}) {
|
|
|
22674
22730
|
const statusInfo = e.status !== "active" ? ` \xB7 status: ${e.status}` : "";
|
|
22675
22731
|
const supersededInfo = e.supersededOn ? ` \xB7 superseded: ${e.supersededOn}` : "";
|
|
22676
22732
|
const impInfo = e.importance ? ` \xB7 importance: ${e.importance}` : "";
|
|
22733
|
+
const evInfo = e.evidence ? ` \xB7 evidence: ${e.evidence}` : "";
|
|
22677
22734
|
block = `[${n}] ${e.category}/${e.key}${pin} (${e.id})
|
|
22678
22735
|
${e.content}
|
|
22679
|
-
File: ${e.file} | Tags: ${e.tags.join(";")} | Date: ${e.date}${ttlInfo}${accessInfo}${lastAccess}${originInfo}${scopeInfo}${statusInfo}${supersededInfo}${impInfo}${links}`;
|
|
22736
|
+
File: ${e.file} | Tags: ${e.tags.join(";")} | Date: ${e.date}${ttlInfo}${accessInfo}${lastAccess}${originInfo}${scopeInfo}${statusInfo}${supersededInfo}${impInfo}${evInfo}${links}`;
|
|
22680
22737
|
} else {
|
|
22681
22738
|
let body = e.content;
|
|
22682
22739
|
if (!isSeed && e.content.length > snippetLen) {
|
|
@@ -22730,6 +22787,7 @@ var init_graph = __esm({
|
|
|
22730
22787
|
init_utils();
|
|
22731
22788
|
init_synonyms();
|
|
22732
22789
|
init_fuzzy();
|
|
22790
|
+
init_evidence();
|
|
22733
22791
|
DEFAULT_EDGE_TYPE = "related";
|
|
22734
22792
|
entryLines = (data) => data.split("\n").filter(
|
|
22735
22793
|
(l) => l.startsWith(" ") && l.includes("|") && !l.startsWith(" summaries:")
|
|
@@ -22841,7 +22899,10 @@ function mergeEntries(existingLine, newLine) {
|
|
|
22841
22899
|
const existingImportance = ep2.length > 18 ? ep2[18] || "" : "";
|
|
22842
22900
|
const newImportance = np2.length > 18 ? np2[18] || "" : "";
|
|
22843
22901
|
const importance2 = importanceRank(newImportance) >= importanceRank(existingImportance) ? newImportance : existingImportance;
|
|
22844
|
-
|
|
22902
|
+
const existingEvidence = ep2.length > 19 ? ep2[19] || "" : "";
|
|
22903
|
+
const newEvidence = np2.length > 19 ? np2[19] || "" : "";
|
|
22904
|
+
const evidence = existingEvidence === "conflict" || newEvidence === "conflict" ? "conflict" : newEvidence || existingEvidence;
|
|
22905
|
+
return toToonLine([id2, category, key, content, file2, mergedTags, date5, ttl, String(accessed), mergedLinks, quality.toFixed(2), String(confidence), lastAccessed, String(priority), path_scope, origin, status, existingSupersededOn, importance2, evidence]);
|
|
22845
22906
|
}
|
|
22846
22907
|
function generateSmartRecall(data, intent, opts = {}) {
|
|
22847
22908
|
const entries = parseEntries(data);
|
|
@@ -22897,11 +22958,12 @@ function generateSmartRecall(data, intent, opts = {}) {
|
|
|
22897
22958
|
if (e.path_scope && globMatch(e.path_scope, ".")) folderBoost = 0.05;
|
|
22898
22959
|
const warningBoost = e.category === "warning" ? 0.2 : 0;
|
|
22899
22960
|
const impBoost = importanceBoost(e.importance);
|
|
22961
|
+
const evBoost = evidenceBoost(e.evidence);
|
|
22900
22962
|
let combined;
|
|
22901
22963
|
if (opts.rrf) {
|
|
22902
|
-
combined = (fused?.get(e.key) ?? 0) - drift + sessionBias + langBoost + folderBoost + warningBoost + impBoost;
|
|
22964
|
+
combined = (fused?.get(e.key) ?? 0) - drift + sessionBias + langBoost + folderBoost + warningBoost + impBoost + evBoost;
|
|
22903
22965
|
} else {
|
|
22904
|
-
combined = bm25Score + 0.3 * centScore + 0.3 * impScore + (matchesQuery ? 0.5 : 0) - drift + sessionBias + langBoost + folderBoost + warningBoost + impBoost;
|
|
22966
|
+
combined = bm25Score + 0.3 * centScore + 0.3 * impScore + (matchesQuery ? 0.5 : 0) - drift + sessionBias + langBoost + folderBoost + warningBoost + impBoost + evBoost;
|
|
22905
22967
|
}
|
|
22906
22968
|
return { entry: e, score: combined, matchesQuery, priority: e.priority, bm25Score };
|
|
22907
22969
|
}).filter((x) => x.score > 0 || x.matchesQuery).sort((a, b2) => {
|
|
@@ -22995,6 +23057,7 @@ var init_quality = __esm({
|
|
|
22995
23057
|
init_utils();
|
|
22996
23058
|
init_synonyms();
|
|
22997
23059
|
init_fuzzy();
|
|
23060
|
+
init_evidence();
|
|
22998
23061
|
}
|
|
22999
23062
|
});
|
|
23000
23063
|
|
|
@@ -23013,7 +23076,7 @@ __export(sessions_exports, {
|
|
|
23013
23076
|
pruneSessions: () => pruneSessions,
|
|
23014
23077
|
resolveSessionId: () => resolveSessionId
|
|
23015
23078
|
});
|
|
23016
|
-
import { existsSync as
|
|
23079
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync4, readdirSync, unlinkSync as unlinkSync2, statSync as statSync2 } from "fs";
|
|
23017
23080
|
import { join as join2 } from "path";
|
|
23018
23081
|
function isAlive2(pid) {
|
|
23019
23082
|
if (!pid || pid <= 0) return false;
|
|
@@ -23032,7 +23095,7 @@ function sessionPath(id2) {
|
|
|
23032
23095
|
}
|
|
23033
23096
|
function ensureSessionDir() {
|
|
23034
23097
|
const dir = sessionDir();
|
|
23035
|
-
if (!
|
|
23098
|
+
if (!existsSync7(dir)) mkdirSync2(dir, { recursive: true });
|
|
23036
23099
|
}
|
|
23037
23100
|
function resolveSessionId(payload = {}) {
|
|
23038
23101
|
const fromPayload = payload.session_id || payload.sessionId || payload.session_id_untruncated;
|
|
@@ -23048,7 +23111,7 @@ function currentBranch() {
|
|
|
23048
23111
|
}
|
|
23049
23112
|
try {
|
|
23050
23113
|
let gitDir2 = join2(process.cwd(), ".git");
|
|
23051
|
-
if (
|
|
23114
|
+
if (existsSync7(gitDir2) && !statSync2(gitDir2).isDirectory()) {
|
|
23052
23115
|
const pointer = readFileSync5(gitDir2, "utf-8").trim();
|
|
23053
23116
|
if (pointer.startsWith("gitdir:")) {
|
|
23054
23117
|
const target = pointer.slice(7).trim();
|
|
@@ -23056,7 +23119,7 @@ function currentBranch() {
|
|
|
23056
23119
|
}
|
|
23057
23120
|
}
|
|
23058
23121
|
const headPath = join2(gitDir2, "HEAD");
|
|
23059
|
-
if (!
|
|
23122
|
+
if (!existsSync7(headPath)) return "unknown";
|
|
23060
23123
|
const head = readFileSync5(headPath, "utf-8").trim();
|
|
23061
23124
|
if (head.startsWith("ref:")) {
|
|
23062
23125
|
const ref = head.slice(4).trim();
|
|
@@ -23070,7 +23133,7 @@ function currentBranch() {
|
|
|
23070
23133
|
}
|
|
23071
23134
|
function readRecord(id2) {
|
|
23072
23135
|
const p2 = sessionPath(id2);
|
|
23073
|
-
if (!
|
|
23136
|
+
if (!existsSync7(p2)) return null;
|
|
23074
23137
|
try {
|
|
23075
23138
|
return JSON.parse(readFileSync5(p2, "utf-8"));
|
|
23076
23139
|
} catch {
|
|
@@ -23105,7 +23168,7 @@ function recentIso(iso) {
|
|
|
23105
23168
|
}
|
|
23106
23169
|
function listSessions() {
|
|
23107
23170
|
const dir = sessionDir();
|
|
23108
|
-
if (!
|
|
23171
|
+
if (!existsSync7(dir)) return [];
|
|
23109
23172
|
return readdirSync(dir).filter((f3) => f3.endsWith(".json")).map((f3) => {
|
|
23110
23173
|
try {
|
|
23111
23174
|
return JSON.parse(readFileSync5(join2(dir, f3), "utf-8"));
|
|
@@ -23121,7 +23184,7 @@ function listSessions() {
|
|
|
23121
23184
|
function pruneSessions() {
|
|
23122
23185
|
const pruned = [];
|
|
23123
23186
|
const dir = sessionDir();
|
|
23124
|
-
if (!
|
|
23187
|
+
if (!existsSync7(dir)) return pruned;
|
|
23125
23188
|
for (const f3 of readdirSync(dir).filter((x) => x.endsWith(".json"))) {
|
|
23126
23189
|
const p2 = join2(dir, f3);
|
|
23127
23190
|
let rec = null;
|
|
@@ -32865,8 +32928,8 @@ function N3(Z, $2, J2, X2, V2) {
|
|
|
32865
32928
|
}
|
|
32866
32929
|
|
|
32867
32930
|
// src/mcp/tools.ts
|
|
32868
|
-
import { readFileSync as readFileSync10, writeFileSync as writeFileSync5, existsSync as
|
|
32869
|
-
import { join as join7, basename } from "path";
|
|
32931
|
+
import { readFileSync as readFileSync10, writeFileSync as writeFileSync5, existsSync as existsSync12, copyFileSync, mkdirSync as mkdirSync3, readdirSync as readdirSync5 } from "fs";
|
|
32932
|
+
import { join as join7, basename, dirname } from "path";
|
|
32870
32933
|
|
|
32871
32934
|
// src/lib/lock.ts
|
|
32872
32935
|
import { openSync, closeSync, writeFileSync, readFileSync, unlinkSync, existsSync, statSync, renameSync } from "fs";
|
|
@@ -32965,10 +33028,13 @@ function readUnderLock(file2, encoding = "utf-8") {
|
|
|
32965
33028
|
// src/mcp/config.ts
|
|
32966
33029
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, mkdirSync } from "fs";
|
|
32967
33030
|
import { join } from "path";
|
|
33031
|
+
import { homedir } from "os";
|
|
32968
33032
|
var MEMORY_DIR = join(process.cwd(), ".toon-memory", "memory");
|
|
32969
33033
|
var MEMORY_FILE = join(MEMORY_DIR, "data.toon");
|
|
32970
33034
|
var ARCHIVE_FILE = join(MEMORY_DIR, "archive.toon");
|
|
32971
33035
|
var OBSERVATIONS_FILE = join(MEMORY_DIR, "observations.toon");
|
|
33036
|
+
var SECRETS_FILE = join(MEMORY_DIR, "secrets.toon");
|
|
33037
|
+
var GLOBAL_FILE = process.env.TOON_MEMORY_GLOBAL_FILE || join(homedir(), ".toon-memory", "memory", "global.toon");
|
|
32972
33038
|
var CONFIG_FILE = join(MEMORY_DIR, "config.json");
|
|
32973
33039
|
function getMaxEntries() {
|
|
32974
33040
|
const config2 = loadConfig();
|
|
@@ -33403,6 +33469,48 @@ function consolidateEntries() {
|
|
|
33403
33469
|
writeMemory(lines.join("\n"));
|
|
33404
33470
|
return { removed: totalRemoved, kept: order.length, duplicates };
|
|
33405
33471
|
}
|
|
33472
|
+
function mergeMemoryFiles(localData, incomingData) {
|
|
33473
|
+
const isEntry = (l) => l.startsWith(" ") && l.includes("|") && !l.startsWith(" summaries:");
|
|
33474
|
+
const localLines = localData.split("\n");
|
|
33475
|
+
const headerIdx = localLines.findIndex((l) => l.startsWith("entries[") || /^\[\d+\|]/.test(l));
|
|
33476
|
+
let prefix;
|
|
33477
|
+
let summaries;
|
|
33478
|
+
let localEntryLines;
|
|
33479
|
+
if (headerIdx === -1) {
|
|
33480
|
+
prefix = ["version: 1"];
|
|
33481
|
+
summaries = [];
|
|
33482
|
+
localEntryLines = [];
|
|
33483
|
+
} else {
|
|
33484
|
+
prefix = localLines.slice(0, headerIdx);
|
|
33485
|
+
const body = localLines.slice(headerIdx + 1);
|
|
33486
|
+
localEntryLines = body.filter(isEntry);
|
|
33487
|
+
summaries = body.filter((l) => !isEntry(l));
|
|
33488
|
+
}
|
|
33489
|
+
const merged = /* @__PURE__ */ new Map();
|
|
33490
|
+
for (const line of localEntryLines) {
|
|
33491
|
+
const parts = parseToonLine(line);
|
|
33492
|
+
if (parts.length >= 3) merged.set(parts[2], line.trim());
|
|
33493
|
+
}
|
|
33494
|
+
let added = 0;
|
|
33495
|
+
let updated = 0;
|
|
33496
|
+
for (const line of incomingData.split("\n").filter(isEntry)) {
|
|
33497
|
+
const parts = parseToonLine(line);
|
|
33498
|
+
if (parts.length < 3) continue;
|
|
33499
|
+
const key = parts[2];
|
|
33500
|
+
const existing = merged.get(key);
|
|
33501
|
+
if (existing === void 0) {
|
|
33502
|
+
merged.set(key, line.trim());
|
|
33503
|
+
added++;
|
|
33504
|
+
} else {
|
|
33505
|
+
merged.set(key, mergeEntries(existing, line.trim()));
|
|
33506
|
+
updated++;
|
|
33507
|
+
}
|
|
33508
|
+
}
|
|
33509
|
+
const header = `[${merged.size}|]{id|category|key|content|file|tags|date|ttl|accessed|links|quality|confidence|lastAccessed}:`;
|
|
33510
|
+
const indented = [...merged.values()].map((l) => l.startsWith(" ") ? l : ` ${l}`);
|
|
33511
|
+
const data = [...prefix, header, ...indented, ...summaries].join("\n");
|
|
33512
|
+
return { data, added, updated };
|
|
33513
|
+
}
|
|
33406
33514
|
function extractVersion(text) {
|
|
33407
33515
|
const m3 = text.match(/([A-Za-z][A-Za-z0-9._-]*?)\s*(?:v)?(\d+)\.(\d+)(?:\.(\d+))?/);
|
|
33408
33516
|
if (!m3) return null;
|
|
@@ -33471,6 +33579,121 @@ function consolidateVersions(dryRun) {
|
|
|
33471
33579
|
return { removed: changed, proposals: groups.map((g) => `Replace ${g.losers.join(", ")} by ${g.winner}`), groups };
|
|
33472
33580
|
}
|
|
33473
33581
|
|
|
33582
|
+
// src/mcp/vault.ts
|
|
33583
|
+
import { existsSync as existsSync6 } from "fs";
|
|
33584
|
+
init_utils();
|
|
33585
|
+
function vaultKey() {
|
|
33586
|
+
const key = getKey();
|
|
33587
|
+
if (!key) {
|
|
33588
|
+
throw new Error(
|
|
33589
|
+
`TOON_MEMORY_KEY is not set \u2014 the secrets vault needs it.
|
|
33590
|
+
export TOON_MEMORY_KEY=<64-hex-char-key>
|
|
33591
|
+
(generate one with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")`
|
|
33592
|
+
);
|
|
33593
|
+
}
|
|
33594
|
+
return key;
|
|
33595
|
+
}
|
|
33596
|
+
function readVault() {
|
|
33597
|
+
if (!existsSync6(SECRETS_FILE)) return "";
|
|
33598
|
+
const key = vaultKey();
|
|
33599
|
+
const raw = readUnderLock(SECRETS_FILE);
|
|
33600
|
+
try {
|
|
33601
|
+
return decrypt(raw, key);
|
|
33602
|
+
} catch {
|
|
33603
|
+
throw new Error("Failed to decrypt secrets.toon \u2014 wrong TOON_MEMORY_KEY or corrupted vault.");
|
|
33604
|
+
}
|
|
33605
|
+
}
|
|
33606
|
+
function writeVault(content) {
|
|
33607
|
+
const key = vaultKey();
|
|
33608
|
+
safeWrite(SECRETS_FILE, encrypt(content, key));
|
|
33609
|
+
}
|
|
33610
|
+
function vaultEntries(content) {
|
|
33611
|
+
const out = [];
|
|
33612
|
+
for (const line of content.split("\n")) {
|
|
33613
|
+
if (!line.startsWith(" ") || !line.includes("|")) continue;
|
|
33614
|
+
const parts = parseToonLine(line);
|
|
33615
|
+
if (parts.length < 7) continue;
|
|
33616
|
+
out.push({ id: parts[0], key: parts[2], value: parts[3] || "", file: parts[4] || "", tags: parts[5] || "", date: parts[6] || "", ttl: parts[7] || "" });
|
|
33617
|
+
}
|
|
33618
|
+
return out;
|
|
33619
|
+
}
|
|
33620
|
+
function rebuildVault(list) {
|
|
33621
|
+
const lines = [
|
|
33622
|
+
"version: 1",
|
|
33623
|
+
`[${list.length}|]{id|category|key|content|file|tags|date|ttl|accessed|links}:`,
|
|
33624
|
+
...list.map(
|
|
33625
|
+
(s2) => toToonLine([s2.id, "secret", s2.key, s2.value, s2.file, s2.tags, s2.date, s2.ttl, "0", ""])
|
|
33626
|
+
)
|
|
33627
|
+
];
|
|
33628
|
+
return lines.join("\n");
|
|
33629
|
+
}
|
|
33630
|
+
function storeSecret(key, value, opts = {}) {
|
|
33631
|
+
if (!value) throw new Error("A secret needs a non-empty value.");
|
|
33632
|
+
const vk2 = vaultKey();
|
|
33633
|
+
const encrypted = encrypt(value, vk2);
|
|
33634
|
+
const content = readVault();
|
|
33635
|
+
const list = vaultEntries(content);
|
|
33636
|
+
const date5 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
33637
|
+
const resolvedTtl = parseTTL(opts.ttl || "");
|
|
33638
|
+
const existing = list.find((s2) => s2.key === key);
|
|
33639
|
+
const id2 = existing ? existing.id : generateId();
|
|
33640
|
+
const merged = [];
|
|
33641
|
+
for (const s2 of list) {
|
|
33642
|
+
if (s2.key === key) {
|
|
33643
|
+
merged.push({ id: id2, key, value: encrypted, file: opts.file || s2.file, tags: opts.tags || s2.tags, date: date5, ttl: resolvedTtl || s2.ttl });
|
|
33644
|
+
} else {
|
|
33645
|
+
merged.push(s2);
|
|
33646
|
+
}
|
|
33647
|
+
}
|
|
33648
|
+
if (!existing) {
|
|
33649
|
+
merged.push({ id: id2, key, value: encrypted, file: opts.file || "", tags: opts.tags || "", date: date5, ttl: resolvedTtl });
|
|
33650
|
+
}
|
|
33651
|
+
writeVault(rebuildVault(merged));
|
|
33652
|
+
return { id: id2, date: date5 };
|
|
33653
|
+
}
|
|
33654
|
+
function getSecret(key) {
|
|
33655
|
+
const content = readVault();
|
|
33656
|
+
if (!content) return null;
|
|
33657
|
+
const hit = vaultEntries(content).find((s2) => s2.key === key);
|
|
33658
|
+
if (!hit) return null;
|
|
33659
|
+
const vk2 = vaultKey();
|
|
33660
|
+
let value;
|
|
33661
|
+
try {
|
|
33662
|
+
value = decrypt(hit.value, vk2);
|
|
33663
|
+
} catch {
|
|
33664
|
+
throw new Error(`Failed to decrypt secret "${key}" \u2014 wrong TOON_MEMORY_KEY or corrupted value.`);
|
|
33665
|
+
}
|
|
33666
|
+
return {
|
|
33667
|
+
key,
|
|
33668
|
+
value,
|
|
33669
|
+
file: hit.file,
|
|
33670
|
+
tags: hit.tags.split(";").map((t) => t.trim()).filter(Boolean),
|
|
33671
|
+
date: hit.date,
|
|
33672
|
+
ttl: hit.ttl
|
|
33673
|
+
};
|
|
33674
|
+
}
|
|
33675
|
+
function listSecrets() {
|
|
33676
|
+
const content = readVault();
|
|
33677
|
+
if (!content) return [];
|
|
33678
|
+
return vaultEntries(content).map((s2) => ({
|
|
33679
|
+
id: s2.id,
|
|
33680
|
+
key: s2.key,
|
|
33681
|
+
file: s2.file,
|
|
33682
|
+
tags: s2.tags.split(";").map((t) => t.trim()).filter(Boolean),
|
|
33683
|
+
date: s2.date,
|
|
33684
|
+
ttl: s2.ttl
|
|
33685
|
+
}));
|
|
33686
|
+
}
|
|
33687
|
+
function forgetSecret(key) {
|
|
33688
|
+
const content = readVault();
|
|
33689
|
+
if (!content) return false;
|
|
33690
|
+
const list = vaultEntries(content);
|
|
33691
|
+
const next = list.filter((s2) => s2.key !== key);
|
|
33692
|
+
if (next.length === list.length) return false;
|
|
33693
|
+
writeVault(rebuildVault(next));
|
|
33694
|
+
return true;
|
|
33695
|
+
}
|
|
33696
|
+
|
|
33474
33697
|
// src/mcp/tools.ts
|
|
33475
33698
|
init_graph();
|
|
33476
33699
|
init_quality();
|
|
@@ -33480,18 +33703,18 @@ init_graph();
|
|
|
33480
33703
|
init_utils();
|
|
33481
33704
|
init_synonyms();
|
|
33482
33705
|
init_fuzzy();
|
|
33483
|
-
import { existsSync as
|
|
33706
|
+
import { existsSync as existsSync11 } from "fs";
|
|
33484
33707
|
import { join as join6 } from "path";
|
|
33485
33708
|
init_sessions();
|
|
33486
33709
|
|
|
33487
33710
|
// src/lib/git.ts
|
|
33488
33711
|
init_sessions();
|
|
33489
|
-
import { existsSync as
|
|
33712
|
+
import { existsSync as existsSync8, readFileSync as readFileSync6, statSync as statSync3 } from "fs";
|
|
33490
33713
|
import { join as join3 } from "path";
|
|
33491
33714
|
import { inflateSync } from "zlib";
|
|
33492
33715
|
function gitDir(cwd) {
|
|
33493
33716
|
const dotgit = join3(cwd || process.cwd(), ".git");
|
|
33494
|
-
if (!
|
|
33717
|
+
if (!existsSync8(dotgit)) return null;
|
|
33495
33718
|
if (statSync3(dotgit).isDirectory()) return dotgit;
|
|
33496
33719
|
const pointer = readFileSync6(dotgit, "utf-8").trim();
|
|
33497
33720
|
if (pointer.startsWith("gitdir:")) {
|
|
@@ -33504,18 +33727,18 @@ function resolveHead(cwd) {
|
|
|
33504
33727
|
const dir = gitDir(cwd);
|
|
33505
33728
|
if (!dir) return null;
|
|
33506
33729
|
const headPath = join3(dir, "HEAD");
|
|
33507
|
-
if (!
|
|
33730
|
+
if (!existsSync8(headPath)) return null;
|
|
33508
33731
|
const head = readFileSync6(headPath, "utf-8").trim();
|
|
33509
33732
|
if (head.startsWith("ref:")) {
|
|
33510
33733
|
const refPath = join3(dir, head.slice(4).trim());
|
|
33511
|
-
if (!
|
|
33734
|
+
if (!existsSync8(refPath)) return null;
|
|
33512
33735
|
return readFileSync6(refPath, "utf-8").trim();
|
|
33513
33736
|
}
|
|
33514
33737
|
return head || null;
|
|
33515
33738
|
}
|
|
33516
33739
|
function parseIndex(dir) {
|
|
33517
33740
|
const indexPath = join3(dir, "index");
|
|
33518
|
-
if (!
|
|
33741
|
+
if (!existsSync8(indexPath)) return [];
|
|
33519
33742
|
const buf = readFileSync6(indexPath);
|
|
33520
33743
|
if (buf.length < 12) return [];
|
|
33521
33744
|
const sig = buf.toString("ascii", 0, 4);
|
|
@@ -33577,7 +33800,7 @@ function readObject(sha, cwd) {
|
|
|
33577
33800
|
const dir = gitDir(cwd);
|
|
33578
33801
|
if (!dir) return null;
|
|
33579
33802
|
const objPath = join3(dir, "objects", sha.slice(0, 2), sha.slice(2));
|
|
33580
|
-
if (!
|
|
33803
|
+
if (!existsSync8(objPath)) return null;
|
|
33581
33804
|
try {
|
|
33582
33805
|
const compressed = readFileSync6(objPath);
|
|
33583
33806
|
const decompressed = inflateSync(compressed);
|
|
@@ -33641,12 +33864,12 @@ function gitStatusSummary(cwd) {
|
|
|
33641
33864
|
const head = resolveHead(cwd);
|
|
33642
33865
|
const trackedFiles = readGitIndex(cwd).length;
|
|
33643
33866
|
const recentCommits = readRecentCommits(5, cwd);
|
|
33644
|
-
const hasGitignore =
|
|
33867
|
+
const hasGitignore = existsSync8(join3(cwd || process.cwd(), ".gitignore"));
|
|
33645
33868
|
return { branch, head, trackedFiles, recentCommits, hasGitignore };
|
|
33646
33869
|
}
|
|
33647
33870
|
|
|
33648
33871
|
// src/lib/project-scan.ts
|
|
33649
|
-
import { existsSync as
|
|
33872
|
+
import { existsSync as existsSync9, readFileSync as readFileSync7, readdirSync as readdirSync3, statSync as statSync4 } from "fs";
|
|
33650
33873
|
import { join as join4, extname } from "path";
|
|
33651
33874
|
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
33652
33875
|
"node_modules",
|
|
@@ -33704,7 +33927,7 @@ function readEnvExample(root) {
|
|
|
33704
33927
|
const candidates = [".env.example", ".env.template", ".env.sample"];
|
|
33705
33928
|
for (const name of candidates) {
|
|
33706
33929
|
const p2 = join4(root, name);
|
|
33707
|
-
if (
|
|
33930
|
+
if (existsSync9(p2)) {
|
|
33708
33931
|
try {
|
|
33709
33932
|
const content = readFileSync7(p2, "utf-8");
|
|
33710
33933
|
return parseEnvContent(content);
|
|
@@ -33733,7 +33956,7 @@ function parseEnvContent(content) {
|
|
|
33733
33956
|
}
|
|
33734
33957
|
function readManifest(root) {
|
|
33735
33958
|
const pkgPath = join4(root, "package.json");
|
|
33736
|
-
if (
|
|
33959
|
+
if (existsSync9(pkgPath)) {
|
|
33737
33960
|
try {
|
|
33738
33961
|
const pkg = JSON.parse(readFileSync7(pkgPath, "utf-8"));
|
|
33739
33962
|
return {
|
|
@@ -33749,7 +33972,7 @@ function readManifest(root) {
|
|
|
33749
33972
|
}
|
|
33750
33973
|
}
|
|
33751
33974
|
const cargoPath = join4(root, "Cargo.toml");
|
|
33752
|
-
if (
|
|
33975
|
+
if (existsSync9(cargoPath)) {
|
|
33753
33976
|
try {
|
|
33754
33977
|
const txt = readFileSync7(cargoPath, "utf-8");
|
|
33755
33978
|
const nameMatch = txt.match(/^name\s*=\s*"([^"]+)"/m);
|
|
@@ -33769,7 +33992,7 @@ function readManifest(root) {
|
|
|
33769
33992
|
}
|
|
33770
33993
|
}
|
|
33771
33994
|
const pyPath = join4(root, "pyproject.toml");
|
|
33772
|
-
if (
|
|
33995
|
+
if (existsSync9(pyPath)) {
|
|
33773
33996
|
try {
|
|
33774
33997
|
const txt = readFileSync7(pyPath, "utf-8");
|
|
33775
33998
|
const nameMatch = txt.match(/^name\s*=\s*"([^"]+)"/m);
|
|
@@ -33787,7 +34010,7 @@ function readManifest(root) {
|
|
|
33787
34010
|
}
|
|
33788
34011
|
}
|
|
33789
34012
|
const goPath = join4(root, "go.mod");
|
|
33790
|
-
if (
|
|
34013
|
+
if (existsSync9(goPath)) {
|
|
33791
34014
|
try {
|
|
33792
34015
|
const txt = readFileSync7(goPath, "utf-8");
|
|
33793
34016
|
const moduleMatch = txt.match(/^module\s+(.+)$/m);
|
|
@@ -34281,7 +34504,7 @@ function generateContextHealth(data, root) {
|
|
|
34281
34504
|
for (const e of entries) {
|
|
34282
34505
|
if (e.file) {
|
|
34283
34506
|
const filePath = e.file.split(":")[0];
|
|
34284
|
-
if (filePath && !
|
|
34507
|
+
if (filePath && !existsSync11(join6(root, filePath))) {
|
|
34285
34508
|
brokenFiles.push(`${e.key}: ${e.file}`);
|
|
34286
34509
|
}
|
|
34287
34510
|
}
|
|
@@ -34428,6 +34651,7 @@ _${e.date}${tags}${file2}${links}_`);
|
|
|
34428
34651
|
// src/mcp/tools.ts
|
|
34429
34652
|
init_sessions();
|
|
34430
34653
|
init_utils();
|
|
34654
|
+
init_evidence();
|
|
34431
34655
|
init_synonyms();
|
|
34432
34656
|
function registerTools(server2) {
|
|
34433
34657
|
function softDelete(key) {
|
|
@@ -34853,7 +35077,16 @@ ${mergeActions.join("\n")}`
|
|
|
34853
35077
|
const resolvedTags = tags ? tags : verbatim ? "" : inferTags(content, key, config2.vocab);
|
|
34854
35078
|
const existingParts = existingIdx !== -1 ? parseToonLine(lines[existingIdx]) : [];
|
|
34855
35079
|
const resolvedLinks = links ? links.split(/[\s;]+/).filter(Boolean).join(" ") : existingParts[9] || "";
|
|
34856
|
-
|
|
35080
|
+
const tagList = resolvedTags.split(";").map((t) => t.trim()).filter(Boolean);
|
|
35081
|
+
const candidate = { key, content, category, tags: tagList };
|
|
35082
|
+
const existingEntries = parseEntries(data);
|
|
35083
|
+
const conflicts = detectContradictions(existingEntries, candidate);
|
|
35084
|
+
const evidence = evidenceFor(
|
|
35085
|
+
existingEntries,
|
|
35086
|
+
candidate,
|
|
35087
|
+
file2 || ""
|
|
35088
|
+
);
|
|
35089
|
+
let newEntry = toToonLine([entryId, category, key, content, file2 || "", resolvedTags, date5, resolvedTtl, "0", resolvedLinks, "", "", "", "0", path_scope || "", origin, "", "", importance2, evidence]);
|
|
34857
35090
|
let action = "Saved";
|
|
34858
35091
|
let mergeInfo = "";
|
|
34859
35092
|
const tagsInferred = !tags && resolvedTags ? true : false;
|
|
@@ -34867,7 +35100,7 @@ ${mergeActions.join("\n")}`
|
|
|
34867
35100
|
const lastAccessed = "";
|
|
34868
35101
|
const quality = verbatim ? 0.5 : qualityScore(resolvedTags, resolvedLinks, content, date5, accessed, lastAccessed, origin);
|
|
34869
35102
|
const confidence = 1;
|
|
34870
|
-
newEntry = toToonLine([entryId, category, key, content, file2 || "", resolvedTags, date5, resolvedTtl, String(accessed), resolvedLinks, quality.toFixed(2), String(confidence), lastAccessed, "0", path_scope || "", origin, "active", "", importance2]);
|
|
35103
|
+
newEntry = toToonLine([entryId, category, key, content, file2 || "", resolvedTags, date5, resolvedTtl, String(accessed), resolvedLinks, quality.toFixed(2), String(confidence), lastAccessed, "0", path_scope || "", origin, "active", "", importance2, evidence]);
|
|
34871
35104
|
const match = lines[headerIdx].match(/\[(\d+)\|/);
|
|
34872
35105
|
const count = match ? parseInt(match[1]) : 0;
|
|
34873
35106
|
lines.splice(headerIdx + 1, 0, newEntry);
|
|
@@ -34888,6 +35121,17 @@ ${mergeActions.join("\n")}`
|
|
|
34888
35121
|
\u23F0 TTL: ${resolvedTtl}` : "";
|
|
34889
35122
|
const inferredMsg = tagsInferred ? `
|
|
34890
35123
|
\u{1F3F7}\uFE0F Inferred tags: ${resolvedTags}` : "";
|
|
35124
|
+
const evidenceMsg = evidence ? `
|
|
35125
|
+
\u{1F50E} Evidence: ${evidence}` : "";
|
|
35126
|
+
let conflictMsg = "";
|
|
35127
|
+
if (conflicts.length > 0) {
|
|
35128
|
+
const items = conflicts.map((c2) => ` \u26A0\uFE0F [${c2.category}] ${c2.key} (${c2.similarity}% overlap) \u2014 ${c2.note}`).join("\n");
|
|
35129
|
+
conflictMsg = `
|
|
35130
|
+
|
|
35131
|
+
\u26A0\uFE0F Potential CONTRADICTION with existing memory:
|
|
35132
|
+
${items}
|
|
35133
|
+
\u2192 The new claim was saved but flagged (evidence: conflict). Re-check before trusting it over the existing entry.`;
|
|
35134
|
+
}
|
|
34891
35135
|
const related = findRelatedEntries(`${key} ${content} ${resolvedTags}`, key, 3);
|
|
34892
35136
|
let relatedMsg = "";
|
|
34893
35137
|
if (related.length > 0) {
|
|
@@ -34899,7 +35143,7 @@ ${items}`;
|
|
|
34899
35143
|
}
|
|
34900
35144
|
return {
|
|
34901
35145
|
content: [{ type: "text", text: `\u{1F9E0} ${action}: ${category}/${key} (${entryId})
|
|
34902
|
-
${content}${ttlMsg}${inferredMsg}${archiveMsg}${mergeInfo}${relatedMsg}` }]
|
|
35146
|
+
${content}${ttlMsg}${inferredMsg}${archiveMsg}${mergeInfo}${evidenceMsg}${conflictMsg}${relatedMsg}` }]
|
|
34903
35147
|
};
|
|
34904
35148
|
}
|
|
34905
35149
|
);
|
|
@@ -35396,6 +35640,74 @@ ${formatted}` }] };
|
|
|
35396
35640
|
}
|
|
35397
35641
|
}
|
|
35398
35642
|
);
|
|
35643
|
+
server2.registerTool(
|
|
35644
|
+
"memory_secret",
|
|
35645
|
+
{
|
|
35646
|
+
title: "Encrypted Secrets Vault",
|
|
35647
|
+
description: "Store/retrieve secrets in the encrypted sidecar vault (secrets.toon, AES-256-GCM). Keeps data.toon readable and open while sensitive values stay encrypted at rest. Requires TOON_MEMORY_KEY. 'store' encrypts, 'get' decrypts, 'list' shows metadata only (no values), 'forget' removes.",
|
|
35648
|
+
inputSchema: {
|
|
35649
|
+
action: external_exports.enum(["store", "get", "list", "forget"]).describe("store = encrypt + save; get = decrypt + return; list = metadata only; forget = remove."),
|
|
35650
|
+
key: external_exports.string().optional().describe("Secret identifier (kebab-case). Required for store/get/forget."),
|
|
35651
|
+
value: external_exports.string().optional().describe("The secret value to encrypt (store only)."),
|
|
35652
|
+
file: external_exports.string().optional().default("").describe("Optional related file/line (e.g. .env, src/api.ts:40)."),
|
|
35653
|
+
tags: external_exports.string().optional().default("").describe("Semicolon-separated metadata tags (e.g. api;token)."),
|
|
35654
|
+
ttl: external_exports.string().optional().default("").describe("Time to live (e.g. 7d, 2026-07-17). Empty = no expiration.")
|
|
35655
|
+
},
|
|
35656
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
35657
|
+
},
|
|
35658
|
+
async ({ action, key, value, file: file2, tags, ttl }) => {
|
|
35659
|
+
try {
|
|
35660
|
+
if (action === "store") {
|
|
35661
|
+
if (!key || !value) {
|
|
35662
|
+
return { content: [{ type: "text", text: "\u274C 'store' needs both key and value." }] };
|
|
35663
|
+
}
|
|
35664
|
+
const { id: id2, date: date5 } = storeSecret(key, value, { file: file2 || "", tags: tags || "", ttl: ttl || "" });
|
|
35665
|
+
const ref = ` Reference it from memory with: memory_remember(category: "knowledge", key: "${key}", content: "Stored in secrets vault", file: "${file2 || "secrets.toon"}", tags: "secret;vault")`;
|
|
35666
|
+
return {
|
|
35667
|
+
content: [{ type: "text", text: `\u{1F510} Stored secret "${key}" (${id2}) on ${date5}
|
|
35668
|
+
Value is AES-256-GCM encrypted at rest in secrets.toon.
|
|
35669
|
+
${ref}` }]
|
|
35670
|
+
};
|
|
35671
|
+
}
|
|
35672
|
+
if (action === "get") {
|
|
35673
|
+
if (!key) return { content: [{ type: "text", text: "\u274C 'get' needs a key." }] };
|
|
35674
|
+
const hit = getSecret(key);
|
|
35675
|
+
if (!hit) {
|
|
35676
|
+
return { content: [{ type: "text", text: `\u274C No secret "${key}" in the vault. Run memory_secret(action: "list") to see stored keys.` }] };
|
|
35677
|
+
}
|
|
35678
|
+
const meta3 = `Secret: ${key} \xB7 file: ${hit.file || "\u2014"} \xB7 tags: ${hit.tags.join(";") || "\u2014"} \xB7 date: ${hit.date}${hit.ttl ? ` \xB7 ttl: ${hit.ttl}` : ""}`;
|
|
35679
|
+
return {
|
|
35680
|
+
content: [{ type: "text", text: `${meta3}
|
|
35681
|
+
|
|
35682
|
+
${hit.value}` }]
|
|
35683
|
+
};
|
|
35684
|
+
}
|
|
35685
|
+
if (action === "list") {
|
|
35686
|
+
const list = listSecrets();
|
|
35687
|
+
if (list.length === 0) {
|
|
35688
|
+
return { content: [{ type: "text", text: "\u{1F510} Vault is empty." }] };
|
|
35689
|
+
}
|
|
35690
|
+
const rows = list.map((s2) => ` \xB7 ${s2.key}${s2.file ? ` (${s2.file})` : ""} \u2014 saved ${s2.date}${s2.ttl ? ` \xB7 ttl ${s2.ttl}` : ""} [${s2.id}]`).join("\n");
|
|
35691
|
+
return {
|
|
35692
|
+
content: [{ type: "text", text: `\u{1F510} ${list.length} secret(s) in vault (values stay encrypted):
|
|
35693
|
+
${rows}
|
|
35694
|
+
|
|
35695
|
+
Get a value with memory_secret(action: "get", key: "<key>")` }]
|
|
35696
|
+
};
|
|
35697
|
+
}
|
|
35698
|
+
if (action === "forget") {
|
|
35699
|
+
if (!key) return { content: [{ type: "text", text: "\u274C 'forget' needs a key." }] };
|
|
35700
|
+
const removed = forgetSecret(key);
|
|
35701
|
+
return {
|
|
35702
|
+
content: [{ type: "text", text: removed ? `\u{1F5D1}\uFE0F Removed secret "${key}" from the vault.` : `\u274C No secret "${key}" in the vault.` }]
|
|
35703
|
+
};
|
|
35704
|
+
}
|
|
35705
|
+
return { content: [{ type: "text", text: "\u274C Unknown action." }] };
|
|
35706
|
+
} catch (err) {
|
|
35707
|
+
return { content: [{ type: "text", text: `\u274C ${err instanceof Error ? err.message : String(err)}` }] };
|
|
35708
|
+
}
|
|
35709
|
+
}
|
|
35710
|
+
);
|
|
35399
35711
|
server2.registerTool(
|
|
35400
35712
|
"memory_captured",
|
|
35401
35713
|
{
|
|
@@ -35411,7 +35723,7 @@ ${formatted}` }] };
|
|
|
35411
35723
|
},
|
|
35412
35724
|
async ({ limit, tool, file: file2, clear }) => {
|
|
35413
35725
|
if (clear) {
|
|
35414
|
-
if (
|
|
35726
|
+
if (existsSync12(OBSERVATIONS_FILE)) {
|
|
35415
35727
|
writeFileSync5(OBSERVATIONS_FILE, "version: 1\nobservations[0|]{ts|session|agent|branch|tool|hash|file|summary}:\n");
|
|
35416
35728
|
}
|
|
35417
35729
|
return { content: [{ type: "text", text: "\u{1F9F9} Capture log cleared" }] };
|
|
@@ -35635,16 +35947,16 @@ ${files}` : "";
|
|
|
35635
35947
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
35636
35948
|
},
|
|
35637
35949
|
async () => {
|
|
35638
|
-
if (!
|
|
35950
|
+
if (!existsSync12(MEMORY_FILE)) {
|
|
35639
35951
|
return { content: [{ type: "text", text: "No memory file to backup" }] };
|
|
35640
35952
|
}
|
|
35641
35953
|
const backupDir = join7(MEMORY_DIR, "backups");
|
|
35642
|
-
if (!
|
|
35954
|
+
if (!existsSync12(backupDir)) mkdirSync3(backupDir, { recursive: true });
|
|
35643
35955
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
35644
35956
|
const backupFile = join7(backupDir, `memory-${timestamp}.toon`);
|
|
35645
35957
|
copyFileSync(MEMORY_FILE, backupFile);
|
|
35646
35958
|
let archiveBackup = "";
|
|
35647
|
-
if (
|
|
35959
|
+
if (existsSync12(ARCHIVE_FILE)) {
|
|
35648
35960
|
const archiveBackupFile = join7(backupDir, `archive-${timestamp}.toon`);
|
|
35649
35961
|
copyFileSync(ARCHIVE_FILE, archiveBackupFile);
|
|
35650
35962
|
archiveBackup = `
|
|
@@ -35774,7 +36086,7 @@ ${files}` : "";
|
|
|
35774
36086
|
}]
|
|
35775
36087
|
};
|
|
35776
36088
|
}
|
|
35777
|
-
if (!
|
|
36089
|
+
if (!existsSync12(MEMORY_FILE)) {
|
|
35778
36090
|
return { content: [{ type: "text", text: "No memory file to export." }] };
|
|
35779
36091
|
}
|
|
35780
36092
|
const data = readFileSync10(MEMORY_FILE, "utf-8");
|
|
@@ -35865,7 +36177,7 @@ To import later: memory_import_gist(gist_id: "${gist.id}")`
|
|
|
35865
36177
|
}]
|
|
35866
36178
|
};
|
|
35867
36179
|
}
|
|
35868
|
-
const localData =
|
|
36180
|
+
const localData = existsSync12(MEMORY_FILE) ? readFileSync10(MEMORY_FILE, "utf-8") : "version: 1\nentries[0|]\n";
|
|
35869
36181
|
const localEntries = parseEntries(localData);
|
|
35870
36182
|
const remoteEntries = parseEntries(remoteData);
|
|
35871
36183
|
const localByKey = new Map(localEntries.map((e) => [e.key, e]));
|
|
@@ -35917,6 +36229,71 @@ To import later: memory_import_gist(gist_id: "${gist.id}")`
|
|
|
35917
36229
|
}
|
|
35918
36230
|
}
|
|
35919
36231
|
);
|
|
36232
|
+
server2.registerTool(
|
|
36233
|
+
"memory_export_global",
|
|
36234
|
+
{
|
|
36235
|
+
title: "Export to Global Memory",
|
|
36236
|
+
description: "Write the current project memory to the global memory file (~/.toon-memory/memory/global.toon, or TOON_MEMORY_GLOBAL_FILE). One-shot: the global file is a plain TOON document you curate and import into other projects with memory_import_global.",
|
|
36237
|
+
inputSchema: {
|
|
36238
|
+
target: external_exports.string().optional().describe("Override the global file path (defaults to TOON_MEMORY_GLOBAL_FILE or ~/.toon-memory/memory/global.toon).")
|
|
36239
|
+
},
|
|
36240
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
36241
|
+
},
|
|
36242
|
+
async ({ target }) => {
|
|
36243
|
+
const dest = target || GLOBAL_FILE;
|
|
36244
|
+
const data = readMemory();
|
|
36245
|
+
mkdirSync3(dirname(dest), { recursive: true });
|
|
36246
|
+
safeWrite(dest, data);
|
|
36247
|
+
const count = parseEntries(data).length;
|
|
36248
|
+
return {
|
|
36249
|
+
content: [{ type: "text", text: `\u{1F4E4} Exported ${count} entries to global memory:
|
|
36250
|
+
${dest}
|
|
36251
|
+
|
|
36252
|
+
Import them elsewhere with memory_import_global.` }]
|
|
36253
|
+
};
|
|
36254
|
+
}
|
|
36255
|
+
);
|
|
36256
|
+
server2.registerTool(
|
|
36257
|
+
"memory_import_global",
|
|
36258
|
+
{
|
|
36259
|
+
title: "Import Global Memory",
|
|
36260
|
+
description: "Merge cross-project conventions from the global memory file (~/.toon-memory/memory/global.toon, or TOON_MEMORY_GLOBAL_FILE) into this project. One-shot merge by key: keeps newer dates, unions tags/links, preserves all fields. Deterministic and offline.",
|
|
36261
|
+
inputSchema: {
|
|
36262
|
+
merge: external_exports.boolean().optional().default(true).describe("If true, merge with existing memory (default). If false, replace entirely."),
|
|
36263
|
+
source: external_exports.string().optional().describe("Override the global file path (defaults to TOON_MEMORY_GLOBAL_FILE or ~/.toon-memory/memory/global.toon).")
|
|
36264
|
+
},
|
|
36265
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false }
|
|
36266
|
+
},
|
|
36267
|
+
async ({ merge: merge2, source }) => {
|
|
36268
|
+
const src = source || GLOBAL_FILE;
|
|
36269
|
+
if (!existsSync12(src)) {
|
|
36270
|
+
return {
|
|
36271
|
+
content: [{ type: "text", text: `\u274C No global memory at:
|
|
36272
|
+
${src}
|
|
36273
|
+
|
|
36274
|
+
Export from another project with memory_export_global, or create the file with a few memory entries first.` }]
|
|
36275
|
+
};
|
|
36276
|
+
}
|
|
36277
|
+
const globalData = readFileSync10(src, "utf-8");
|
|
36278
|
+
if (!merge2) {
|
|
36279
|
+
safeWrite(MEMORY_FILE, globalData);
|
|
36280
|
+
const count = parseEntries(globalData).length;
|
|
36281
|
+
return {
|
|
36282
|
+
content: [{ type: "text", text: `\u{1F4E5} Memory replaced from global (${count} entries).` }]
|
|
36283
|
+
};
|
|
36284
|
+
}
|
|
36285
|
+
const localData = readMemory();
|
|
36286
|
+
const { data, added, updated } = mergeMemoryFiles(localData, globalData);
|
|
36287
|
+
writeMemory(data);
|
|
36288
|
+
const total = parseEntries(data).length;
|
|
36289
|
+
return {
|
|
36290
|
+
content: [{ type: "text", text: `\u{1F4E5} Global memory merged
|
|
36291
|
+
Added: ${added} new entries
|
|
36292
|
+
Updated: ${updated} existing entries
|
|
36293
|
+
Total: ${total} entries` }]
|
|
36294
|
+
};
|
|
36295
|
+
}
|
|
36296
|
+
);
|
|
35920
36297
|
server2.registerTool(
|
|
35921
36298
|
"memory_merge_sessions",
|
|
35922
36299
|
{
|
|
@@ -35947,7 +36324,7 @@ To import later: memory_import_gist(gist_id: "${gist.id}")`
|
|
|
35947
36324
|
}
|
|
35948
36325
|
const sharedFiles = [...allFiles.entries()].filter(([_2, sessions2]) => sessions2.length >= 2).sort((a, b2) => b2[1].length - a[1].length);
|
|
35949
36326
|
let observations = [];
|
|
35950
|
-
if (
|
|
36327
|
+
if (existsSync12(OBSERVATIONS_FILE)) {
|
|
35951
36328
|
const data = readFileSync10(OBSERVATIONS_FILE, "utf-8");
|
|
35952
36329
|
const sessionIds = new Set(recentSessions.map((s2) => s2.id));
|
|
35953
36330
|
observations = data.split("\n").filter((l) => l.startsWith(" ") && l.includes("|")).map((l) => {
|
|
@@ -47326,21 +47703,38 @@ function buildViewerData() {
|
|
|
47326
47703
|
|
|
47327
47704
|
// src/viewer/html.ts
|
|
47328
47705
|
import { readFileSync as readFileSync11 } from "fs";
|
|
47329
|
-
import { resolve, dirname } from "path";
|
|
47706
|
+
import { resolve, dirname as dirname2 } from "path";
|
|
47330
47707
|
import { fileURLToPath } from "url";
|
|
47331
47708
|
var d3Src = (() => {
|
|
47332
47709
|
try {
|
|
47333
|
-
const dir =
|
|
47710
|
+
const dir = dirname2(fileURLToPath(import.meta.url));
|
|
47334
47711
|
return readFileSync11(resolve(dir, "../src/viewer/d3.v7.min.js"), "utf-8");
|
|
47335
47712
|
} catch {
|
|
47336
47713
|
try {
|
|
47337
|
-
const dir =
|
|
47714
|
+
const dir = dirname2(fileURLToPath(import.meta.url));
|
|
47338
47715
|
return readFileSync11(resolve(dir, "d3.v7.min.js"), "utf-8");
|
|
47339
47716
|
} catch {
|
|
47340
47717
|
return null;
|
|
47341
47718
|
}
|
|
47342
47719
|
}
|
|
47343
47720
|
})();
|
|
47721
|
+
function readViewerAsset(name) {
|
|
47722
|
+
const dir = dirname2(fileURLToPath(import.meta.url));
|
|
47723
|
+
const candidates = [
|
|
47724
|
+
resolve(dir, `../src/viewer/${name}`),
|
|
47725
|
+
resolve(dir, `../../src/viewer/${name}`),
|
|
47726
|
+
resolve(dir, name)
|
|
47727
|
+
];
|
|
47728
|
+
for (const p2 of candidates) {
|
|
47729
|
+
try {
|
|
47730
|
+
return readFileSync11(p2, "utf-8");
|
|
47731
|
+
} catch {
|
|
47732
|
+
}
|
|
47733
|
+
}
|
|
47734
|
+
return "";
|
|
47735
|
+
}
|
|
47736
|
+
var logoSrc = readViewerAsset("logo.svg");
|
|
47737
|
+
var isologoSrc = readViewerAsset("logo-isologo.svg");
|
|
47344
47738
|
function generateHtml(viewerData) {
|
|
47345
47739
|
const jsonData = JSON.stringify(viewerData);
|
|
47346
47740
|
const d3Tag = d3Src ? `<script>${d3Src}</script>` : `<script src="https://d3js.org/d3.v7.min.js"></script>`;
|
|
@@ -47355,123 +47749,133 @@ ${d3Tag}
|
|
|
47355
47749
|
<style>
|
|
47356
47750
|
*{box-sizing:border-box;margin:0;padding:0}
|
|
47357
47751
|
:root{
|
|
47358
|
-
--bg
|
|
47359
|
-
--text
|
|
47360
|
-
--
|
|
47361
|
-
--
|
|
47362
|
-
|
|
47363
|
-
|
|
47752
|
+
--bg:oklch(8% 0.02 270);--bg2:oklch(12% 0.02 270);--bg3:oklch(15% 0.02 270);--border:oklch(21% 0.02 270);
|
|
47753
|
+
--text:oklch(91% 0.01 270);--muted:oklch(56% 0.02 270);
|
|
47754
|
+
--brand:oklch(55% 0.25 280);--brand-light:oklch(68% 0.22 280);--brand2:oklch(59% 0.25 300);--lavender:oklch(65% 0.25 310);--pink:oklch(65% 0.26 340);
|
|
47755
|
+
--green:oklch(78% 0.2 155);--red:oklch(65% 0.24 25);--amber:oklch(85% 0.18 85);
|
|
47756
|
+
--brand-wash:oklch(55% 0.25 280 / 0.12);--brand-wash-soft:oklch(55% 0.25 280 / 0.06);
|
|
47757
|
+
--gradient:linear-gradient(135deg,var(--brand),var(--brand2),var(--lavender));
|
|
47758
|
+
--ease-out:cubic-bezier(0.16,1,0.3,1);
|
|
47759
|
+
--font-body:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;--font-mono:'JetBrains Mono','Fira Code','Consolas',monospace
|
|
47760
|
+
}
|
|
47761
|
+
html,body{height:100%;font-family:var(--font-body);background:var(--bg);color:var(--text);overflow:hidden}
|
|
47364
47762
|
.app{display:grid;grid-template-rows:auto 1fr;height:100%}
|
|
47365
|
-
header{display:flex;align-items:center;justify-content:space-between;padding:0.
|
|
47366
|
-
|
|
47367
|
-
|
|
47763
|
+
header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0.65rem 1.25rem;border-bottom:1px solid var(--border);background:oklch(8% 0.02 270 / 0.85);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
|
|
47764
|
+
.brand{display:flex;align-items:center;gap:0.6rem}
|
|
47765
|
+
.brand-logo{display:flex;line-height:0}
|
|
47766
|
+
.brand-logo svg{width:26px;height:26px}
|
|
47767
|
+
.brand-word{display:flex;line-height:0}
|
|
47768
|
+
.brand-word svg{height:20px;width:auto}
|
|
47769
|
+
header .meta{display:flex;gap:0.6rem;font-size:0.78rem;color:var(--muted);align-items:center}
|
|
47368
47770
|
header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
47369
47771
|
.main{display:grid;grid-template-columns:var(--sidebar-w,320px) 1fr;overflow:hidden;position:relative}
|
|
47370
|
-
.sidebar{display:flex;flex-direction:column;border-right:1px solid var(--border);overflow:hidden}
|
|
47772
|
+
.sidebar{display:flex;flex-direction:column;border-right:1px solid var(--border);overflow:hidden;background:oklch(10% 0.02 270 / 0.5)}
|
|
47371
47773
|
.sidebar-resizer{width:4px;cursor:col-resize;background:transparent;position:absolute;left:var(--sidebar-w,320px);top:0;bottom:0;z-index:5;transition:background 0.15s}
|
|
47372
47774
|
.sidebar-resizer:hover,.sidebar-resizer:active{background:var(--brand)}
|
|
47373
|
-
.sidebar-header{padding:0.75rem 1rem;border-bottom:1px solid var(--border);background:
|
|
47775
|
+
.sidebar-header{padding:0.75rem 1rem;border-bottom:1px solid var(--border);background:oklch(8% 0.02 270 / 0.85);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
|
|
47374
47776
|
.sidebar-header h2{font-size:0.85rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);margin-bottom:0.5rem}
|
|
47375
|
-
.search-box{width:100%;padding:0.5rem 0.75rem;border:1px solid var(--border);border-radius:8px;background:var(--bg3);color:var(--text);font-size:0.85rem;outline:none}
|
|
47376
|
-
.search-box:focus{border-color:var(--brand)}
|
|
47777
|
+
.search-box{width:100%;padding:0.5rem 0.75rem;border:1px solid var(--border);border-radius:8px;background:var(--bg3);color:var(--text);font-size:0.85rem;outline:none;transition:border-color 0.15s,box-shadow 0.15s}
|
|
47778
|
+
.search-box:focus{border-color:var(--brand);box-shadow:0 0 0 3px oklch(55% 0.25 280 / 0.12)}
|
|
47377
47779
|
.filter-row{display:flex;gap:0.4rem;margin-top:0.5rem;flex-wrap:wrap}
|
|
47378
47780
|
.filter-btn{padding:0.2rem 0.5rem;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--muted);font-size:0.7rem;cursor:pointer;transition:all 0.15s}
|
|
47379
|
-
.filter-btn:hover,.filter-btn.active{border-color:var(--brand);color:var(--brand);background:
|
|
47781
|
+
.filter-btn:hover,.filter-btn.active{border-color:var(--brand);color:var(--brand);background:var(--brand-wash)}
|
|
47380
47782
|
.entries-list{flex:1;overflow-y:auto;padding:0.5rem}
|
|
47381
|
-
.entry-item{padding:0.6rem 0.75rem;border:1px solid var(--border);border-radius:
|
|
47382
|
-
.entry-item
|
|
47383
|
-
.entry-item
|
|
47783
|
+
.entry-item{position:relative;overflow:hidden;padding:0.6rem 0.75rem;border:1px solid var(--border);border-radius:12px;margin-bottom:0.4rem;cursor:pointer;transition:all 0.15s;background:var(--bg2)}
|
|
47784
|
+
.entry-item::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--gradient);opacity:0;transform:scaleX(0.5);transition:opacity 0.35s var(--ease-out),transform 0.5s var(--ease-out);border-radius:3px 3px 0 0}
|
|
47785
|
+
.entry-item:hover{transform:translateY(-2px);border-color:oklch(28% 0.02 270);box-shadow:0 10px 30px -12px oklch(0% 0 0 / 0.7)}
|
|
47786
|
+
.entry-item:hover::before{opacity:1;transform:scaleX(1)}
|
|
47787
|
+
.entry-item.selected{border-color:var(--brand);background:var(--brand-wash)}
|
|
47788
|
+
.entry-item.selected::before{opacity:1;transform:scaleX(1)}
|
|
47384
47789
|
.entry-cat{font-size:0.65rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:0.2rem}
|
|
47385
|
-
.entry-cat.decision{color:var(--brand)}
|
|
47386
|
-
.entry-cat.bug{color:var(--red)}
|
|
47387
|
-
.entry-cat.pattern{color:var(--green)}
|
|
47388
|
-
.entry-cat.knowledge{color:var(--cyan)}
|
|
47389
|
-
.entry-cat.architecture{color:var(--amber)}
|
|
47790
|
+
.entry-cat.decision{color:var(--brand)}.entry-cat.bug{color:var(--red)}.entry-cat.pattern{color:var(--green)}.entry-cat.knowledge{color:var(--lavender)}.entry-cat.architecture{color:var(--amber)}
|
|
47390
47791
|
.entry-key{font-size:0.85rem;font-weight:600;margin-bottom:0.15rem}
|
|
47391
47792
|
.entry-preview{font-size:0.75rem;color:var(--muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
|
47392
47793
|
.entry-tags{display:flex;gap:0.25rem;margin-top:0.3rem;flex-wrap:wrap}
|
|
47393
|
-
.entry-tag{font-size:0.6rem;padding:0.
|
|
47794
|
+
.entry-tag{font-size:0.6rem;padding:0.15em 0.4rem;border-radius:4px;background:oklch(55% 0.25 280 / 0.12);color:var(--brand-light);font-family:var(--font-mono)}
|
|
47394
47795
|
.viewer-area{display:flex;flex-direction:column;overflow:hidden}
|
|
47395
|
-
.tabs{display:flex;border-bottom:1px solid var(--border);background:
|
|
47396
|
-
.tab{padding:0.
|
|
47796
|
+
.tabs{display:flex;border-bottom:1px solid var(--border);background:oklch(8% 0.02 270 / 0.85);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);padding:0 1rem}
|
|
47797
|
+
.tab{position:relative;padding:0.65rem 1rem;font-size:0.7rem;font-weight:600;letter-spacing:0.08em;text-transform:uppercase;color:var(--muted);cursor:pointer;transition:color 0.15s}
|
|
47397
47798
|
.tab:hover{color:var(--text)}
|
|
47398
|
-
.tab.active{color:var(--
|
|
47799
|
+
.tab.active{color:var(--text)}
|
|
47800
|
+
.tab.active::after{content:'';position:absolute;left:0.6rem;right:0.6rem;bottom:0;height:2px;border-radius:2px;background:var(--gradient)}
|
|
47399
47801
|
.tab-content{flex:1;overflow:hidden;position:relative}
|
|
47400
47802
|
.tab-panel{display:none;width:100%;height:100%;overflow:auto}
|
|
47401
47803
|
.tab-panel.active{display:block}
|
|
47402
47804
|
.graph-container{width:100%;height:100%;min-height:300px;background:var(--bg);position:relative}
|
|
47403
|
-
.graph-container::before{content:'';position:absolute;inset:0;background
|
|
47805
|
+
.graph-container::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse 60% 50% at 50% 0%,oklch(55% 0.25 280 / 0.07) 0%,transparent 70%);pointer-events:none;z-index:0}
|
|
47404
47806
|
.graph-container svg{width:100%;height:100%;position:relative;z-index:1}
|
|
47405
|
-
.node-circle{cursor:pointer;transition:r 0.2s ease,opacity 0.2s ease,filter 0.2s ease,stroke 0.2s ease}
|
|
47807
|
+
.node-circle{cursor:pointer;transition:r 0.2s var(--ease-out),opacity 0.2s var(--ease-out),filter 0.2s var(--ease-out),stroke 0.2s var(--ease-out)}
|
|
47406
47808
|
.node-circle:hover{filter:brightness(1.3) drop-shadow(0 0 6px color-mix(in srgb,currentColor 60%,transparent))}
|
|
47407
47809
|
.node-circle.glow{filter:drop-shadow(0 0 12px var(--brand)) brightness(1.5)}
|
|
47408
47810
|
.node-circle.selected{stroke:var(--brand);stroke-width:3;filter:drop-shadow(0 0 14px var(--brand)) brightness(1.3)}
|
|
47409
|
-
.node-label{font-size:9px;font-family:
|
|
47410
|
-
.link{stroke:var(--border);stroke-opacity:0.4;transition:all 0.2s ease;cursor:pointer}
|
|
47811
|
+
.node-label{font-size:9px;font-family:var(--font-mono);fill:var(--text);pointer-events:none;text-anchor:middle;transition:opacity 0.2s var(--ease-out);font-weight:500;letter-spacing:0.02em}
|
|
47812
|
+
.link{stroke:var(--border);stroke-opacity:0.4;transition:all 0.2s var(--ease-out);cursor:pointer}
|
|
47411
47813
|
.link:hover{stroke-opacity:0.9;stroke-width:3}
|
|
47412
47814
|
.link.highlighted{stroke:var(--brand);stroke-opacity:0.9;stroke-width:2.5}
|
|
47413
47815
|
.link.faded{stroke-opacity:0.04}
|
|
47414
47816
|
.node-ring{fill:none;stroke-width:2;opacity:0;transition:opacity 0.3s ease,r 0.3s ease}
|
|
47415
47817
|
.node-ring.visible{opacity:0.6}
|
|
47416
47818
|
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;padding:1.5rem}
|
|
47417
|
-
.stat-card{background:var(--bg2);border:1px solid var(--border);border-radius:
|
|
47819
|
+
.stat-card{position:relative;overflow:hidden;background:var(--bg2);border:1px solid var(--border);border-radius:14px;padding:1.25rem;transition:transform 0.3s var(--ease-out),box-shadow 0.3s var(--ease-out),border-color 0.3s}
|
|
47820
|
+
.stat-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--gradient);opacity:0;transform:scaleX(0.5);transition:opacity 0.35s var(--ease-out),transform 0.5s var(--ease-out)}
|
|
47821
|
+
.stat-card:hover{transform:translateY(-4px);box-shadow:0 18px 40px -16px oklch(0% 0 0 / 0.7),0 0 0 1px oklch(55% 0.25 280 / 0.06)}
|
|
47822
|
+
.stat-card:hover::before{opacity:1;transform:scaleX(1)}
|
|
47418
47823
|
.stat-card h3{font-size:0.8rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);margin-bottom:0.75rem}
|
|
47419
|
-
.stat-big{font-size:2rem;font-weight:800;background:
|
|
47824
|
+
.stat-big{font-size:2rem;font-weight:800;background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;color:transparent}
|
|
47420
47825
|
.bar-chart{display:flex;flex-direction:column;gap:0.4rem}
|
|
47421
47826
|
.bar-row{display:flex;align-items:center;gap:0.5rem}
|
|
47422
47827
|
.bar-label{font-size:0.75rem;color:var(--muted);width:80px;text-align:right;flex-shrink:0}
|
|
47423
47828
|
.bar-track{flex:1;height:20px;background:var(--bg3);border-radius:4px;overflow:hidden}
|
|
47424
|
-
.bar-fill{height:100%;border-radius:4px;transition:width 0.
|
|
47829
|
+
.bar-fill{height:100%;border-radius:4px;width:0;transition:width 0.7s var(--ease-out)}
|
|
47425
47830
|
.bar-value{font-size:0.7rem;color:var(--muted);width:30px}
|
|
47426
47831
|
.tag-cloud{display:flex;flex-wrap:wrap;gap:0.4rem}
|
|
47427
|
-
.tag-pill{padding:0.25rem 0.6rem;border-radius:
|
|
47832
|
+
.tag-pill{padding:0.25rem 0.6rem;border-radius:9999px;font-size:0.75rem;font-family:var(--font-mono);border:1px solid var(--border);color:var(--muted);transition:all 0.15s}
|
|
47428
47833
|
.tag-pill:hover{border-color:var(--brand);color:var(--brand)}
|
|
47429
47834
|
.detail-panel{padding:1.5rem;max-width:700px}
|
|
47430
|
-
.detail-panel h2{font-size:1.2rem;font-weight:
|
|
47835
|
+
.detail-panel h2{font-size:1.2rem;font-weight:800;margin-bottom:0.5rem;background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;color:transparent}
|
|
47431
47836
|
.detail-panel .detail-cat{font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:1rem}
|
|
47432
47837
|
.detail-field{margin-bottom:1rem}
|
|
47433
47838
|
.detail-field label{display:block;font-size:0.75rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:0.3rem}
|
|
47434
47839
|
.detail-field .value{font-size:0.9rem;line-height:1.6}
|
|
47435
|
-
.detail-field .value.mono{font-family:
|
|
47840
|
+
.detail-field .value.mono{font-family:var(--font-mono);background:var(--bg3);padding:0.5rem;border-radius:8px;display:block;overflow-x:auto;white-space:pre-wrap}
|
|
47436
47841
|
.detail-links{display:flex;gap:0.4rem;flex-wrap:wrap}
|
|
47437
|
-
.detail-link{padding:0.2rem 0.5rem;border:1px solid var(--border);border-radius:
|
|
47438
|
-
.detail-link:hover{border-color:var(--brand);background:
|
|
47842
|
+
.detail-link{padding:0.2rem 0.5rem;border:1px solid var(--border);border-radius:9999px;font-size:0.75rem;font-family:var(--font-mono);color:var(--brand-light);background:oklch(55% 0.25 280 / 0.08);cursor:pointer;transition:all 0.15s}
|
|
47843
|
+
.detail-link:hover{border-color:var(--brand);background:var(--brand-wash)}
|
|
47439
47844
|
.empty-detail{display:flex;align-items:center;justify-content:center;height:100%;color:var(--muted);font-size:0.9rem}
|
|
47440
|
-
.graph-legend{position:absolute;bottom:3.5rem;left:0.5rem;background:
|
|
47845
|
+
.graph-legend{position:absolute;bottom:3.5rem;left:0.5rem;background:oklch(11% 0.02 270 / 0.9);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--border);border-radius:12px;padding:0.75rem;font-size:0.7rem;z-index:10}
|
|
47441
47846
|
.legend-item{display:flex;align-items:center;gap:0.4rem;margin-bottom:0.25rem}
|
|
47442
47847
|
.legend-dot{width:10px;height:10px;border-radius:50%}
|
|
47443
47848
|
.graph-controls{position:absolute;top:1rem;right:1rem;display:flex;gap:0.4rem;z-index:10}
|
|
47444
|
-
.graph-btn{width:32px;height:32px;border:1px solid var(--border);border-radius:
|
|
47445
|
-
.graph-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
47446
|
-
.tooltip{position:fixed;pointer-events:none;background:
|
|
47849
|
+
.graph-btn{width:32px;height:32px;border:1px solid var(--border);border-radius:8px;background:var(--bg2);color:var(--text);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1rem;transition:all 0.15s}
|
|
47850
|
+
.graph-btn:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-wash)}
|
|
47851
|
+
.tooltip{position:fixed;pointer-events:none;background:oklch(12% 0.02 270 / 0.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--border);border-radius:12px;padding:0.75rem 1rem;font-size:0.75rem;max-width:320px;z-index:1000;box-shadow:0 8px 32px rgba(0,0,0,0.5)}
|
|
47447
47852
|
.tooltip .tt-cat{font-size:0.6rem;font-weight:600;text-transform:uppercase;margin-bottom:0.2rem}
|
|
47448
47853
|
.tooltip .tt-key{font-weight:600;margin-bottom:0.2rem}
|
|
47449
47854
|
.tooltip .tt-content{color:var(--muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
|
|
47450
47855
|
.tooltip .tt-score{margin-top:0.3rem;font-size:0.65rem;color:var(--brand)}
|
|
47451
47856
|
.tooltip .tt-edge{font-size:0.65rem;color:var(--muted);margin-top:0.3rem;padding-top:0.3rem;border-top:1px solid var(--border)}
|
|
47452
47857
|
.timeline-container{padding:1.5rem;overflow-y:auto;height:100%}
|
|
47453
|
-
.timeline-header{font-size:1rem;font-weight:
|
|
47858
|
+
.timeline-header{font-size:1rem;font-weight:800;margin-bottom:1rem;background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;color:transparent}
|
|
47454
47859
|
.timeline-track{position:relative;padding-left:2rem}
|
|
47455
47860
|
.timeline-line{position:absolute;left:0.5rem;top:0;bottom:0;width:2px;background:var(--border)}
|
|
47456
|
-
.timeline-entry{position:relative;margin-bottom:1rem;padding:0.6rem 0.8rem;border:1px solid var(--border);border-radius:
|
|
47457
|
-
.timeline-entry:hover{border-color:var(--brand)}
|
|
47861
|
+
.timeline-entry{position:relative;margin-bottom:1rem;padding:0.6rem 0.8rem;border:1px solid var(--border);border-radius:12px;background:var(--bg2);transition:all 0.15s;cursor:pointer}
|
|
47862
|
+
.timeline-entry:hover{border-color:var(--brand);transform:translateY(-2px)}
|
|
47458
47863
|
.timeline-entry::before{content:'';position:absolute;left:-1.75rem;top:0.8rem;width:10px;height:10px;border-radius:50%;border:2px solid var(--border);background:var(--bg)}
|
|
47459
47864
|
.timeline-entry .tl-date{font-size:0.65rem;color:var(--muted);margin-bottom:0.2rem}
|
|
47460
47865
|
.timeline-entry .tl-cat{font-size:0.6rem;font-weight:600;text-transform:uppercase}
|
|
47461
47866
|
.timeline-entry .tl-key{font-size:0.85rem;font-weight:600}
|
|
47462
47867
|
.timeline-entry .tl-content{font-size:0.75rem;color:var(--muted);margin-top:0.2rem}
|
|
47463
|
-
.export-btn{padding:0.3rem 0.6rem;border:1px solid var(--border);border-radius:
|
|
47868
|
+
.export-btn{padding:0.3rem 0.6rem;border:1px solid var(--border);border-radius:9999px;background:var(--bg2);color:var(--text);font-size:0.7rem;cursor:pointer;transition:all 0.15s}
|
|
47464
47869
|
.export-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
47465
47870
|
.export-bar{display:flex;gap:0.4rem}
|
|
47466
|
-
.theme-toggle{background:
|
|
47467
|
-
.theme-toggle:hover{border-color:var(--brand);color:var(--brand)}
|
|
47468
|
-
.reload-btn{
|
|
47469
|
-
.reload-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
47871
|
+
.theme-toggle,.reload-btn{background:oklch(12% 0.02 270 / 0.5);border:1px solid var(--border);border-radius:9999px;padding:0.35rem 0.7rem;color:var(--text);cursor:pointer;font-size:0.8rem;line-height:1;transition:all 0.15s}
|
|
47872
|
+
.theme-toggle:hover,.reload-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
47873
|
+
.reload-btn{color:var(--muted);font-size:0.9rem}
|
|
47470
47874
|
.minimap{width:150px;height:100px;background:var(--bg2);border:1px solid var(--border);border-radius:8px;overflow:hidden;box-shadow:0 4px 16px rgba(0,0,0,0.3);cursor:pointer}
|
|
47471
47875
|
.minimap svg{width:100%;height:100%;display:block}
|
|
47472
|
-
.minimap-viewport{fill:
|
|
47876
|
+
.minimap-viewport{fill:oklch(55% 0.25 280 / 0.15);stroke:oklch(55% 0.25 280);stroke-width:1.5}
|
|
47473
47877
|
.graph-right{position:absolute;bottom:1rem;right:1rem;z-index:10;display:flex;flex-direction:column;align-items:flex-end;gap:0.4rem}
|
|
47474
|
-
.physics-panel{position:absolute;top:2.8rem;left:0.5rem;background:
|
|
47878
|
+
.physics-panel{position:absolute;top:2.8rem;left:0.5rem;background:oklch(11% 0.02 270 / 0.9);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--border);border-radius:12px;padding:0.75rem;font-size:0.7rem;z-index:10;min-width:180px}
|
|
47475
47879
|
.physics-panel h4{font-size:0.7rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);margin-bottom:0.5rem}
|
|
47476
47880
|
.graph-toolbar{position:absolute;top:1rem;left:0.5rem;display:flex;gap:0.4rem;z-index:11}
|
|
47477
47881
|
.physics-row{display:flex;align-items:center;gap:0.5rem;margin-bottom:0.4rem}
|
|
@@ -47481,17 +47885,22 @@ header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
|
47481
47885
|
.physics-row .physics-val{font-size:0.6rem;color:var(--muted);width:30px;text-align:right}
|
|
47482
47886
|
.node-circle.search-match{filter:drop-shadow(0 0 10px var(--brand)) brightness(1.4);animation:searchPulse 1.5s ease-in-out infinite}
|
|
47483
47887
|
@keyframes searchPulse{0%,100%{filter:drop-shadow(0 0 8px var(--brand)) brightness(1.2)}50%{filter:drop-shadow(0 0 18px var(--brand)) brightness(1.7)}}
|
|
47484
|
-
.path-btn.active{background:var(--
|
|
47485
|
-
.path-info{position:absolute;bottom:0.5rem;left:0.5rem;background:
|
|
47888
|
+
.path-btn.active{background:var(--gradient);color:#fff;border-color:transparent;box-shadow:0 2px 14px -2px oklch(55% 0.25 280 / 0.5)}
|
|
47889
|
+
.path-info{position:absolute;bottom:0.5rem;left:0.5rem;background:oklch(11% 0.02 270 / 0.9);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid var(--border);border-radius:12px;padding:0.4rem 0.7rem;font-size:0.7rem;z-index:10;display:none;max-width:500px;word-break:break-all}
|
|
47486
47890
|
.node-circle.path-start{stroke:var(--green);stroke-width:3;filter:drop-shadow(0 0 12px var(--green))}
|
|
47487
47891
|
.node-circle.path-end{stroke:var(--red);stroke-width:3;filter:drop-shadow(0 0 12px var(--red))}
|
|
47488
47892
|
.node-circle.path-node{stroke:var(--brand);stroke-width:2.5;animation:pathNodePulse 1.2s ease-in-out infinite}
|
|
47489
47893
|
@keyframes pathNodePulse{0%,100%{filter:drop-shadow(0 0 6px var(--brand))}50%{filter:drop-shadow(0 0 14px var(--brand))}}
|
|
47490
47894
|
.link.path-edge{stroke:var(--brand);stroke-opacity:0.9;stroke-width:3}
|
|
47491
|
-
|
|
47492
|
-
.
|
|
47493
|
-
.
|
|
47494
|
-
.
|
|
47895
|
+
@keyframes riseIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
|
|
47896
|
+
.app{animation:riseIn 0.6s var(--ease-out) both}
|
|
47897
|
+
.reveal{opacity:0;transform:translateY(14px);animation:riseIn 0.6s var(--ease-out) forwards}
|
|
47898
|
+
@media(prefers-reduced-motion:reduce){.app,.reveal{animation:none}.reveal{opacity:1;transform:none}.bar-fill{transition:none}.entry-item,.stat-card,.timeline-entry{transition:none}}
|
|
47899
|
+
.light{--bg:oklch(96% 0.005 270);--bg2:oklch(100% 0 0);--bg3:oklch(93% 0.005 270);--border:oklch(88% 0.01 270);--text:oklch(22% 0.02 270);--muted:oklch(45% 0.01 260);--brand:oklch(50% 0.22 280);--brand-light:oklch(45% 0.22 280)}
|
|
47900
|
+
.light header,.light .sidebar-header,.light .tabs{background:rgba(255,255,255,0.85)}
|
|
47901
|
+
.light .tooltip{background:rgba(255,255,255,0.95);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-color:var(--border);box-shadow:0 8px 32px rgba(0,0,0,0.1)}
|
|
47902
|
+
.light .timeline-entry{background:var(--bg2)}
|
|
47903
|
+
.light .graph-btn,.light .export-btn,.light .theme-toggle,.light .reload-btn{background:var(--bg2)}
|
|
47495
47904
|
.light .minimap{box-shadow:0 4px 16px rgba(0,0,0,0.08)}
|
|
47496
47905
|
@media(max-width:768px){.main{grid-template-columns:1fr}.sidebar{display:none}}
|
|
47497
47906
|
</style>
|
|
@@ -47499,7 +47908,10 @@ header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
|
47499
47908
|
<body>
|
|
47500
47909
|
<div class="app">
|
|
47501
47910
|
<header>
|
|
47502
|
-
<
|
|
47911
|
+
<div class="brand">
|
|
47912
|
+
<span class="brand-logo">${logoSrc}</span>
|
|
47913
|
+
<span class="brand-word">${isologoSrc}</span>
|
|
47914
|
+
</div>
|
|
47503
47915
|
<div class="meta">
|
|
47504
47916
|
<span id="totalCount"></span>
|
|
47505
47917
|
<span id="edgeCount"></span>
|
|
@@ -47573,10 +47985,7 @@ header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
|
47573
47985
|
<script>
|
|
47574
47986
|
const DATA = ${jsonData};
|
|
47575
47987
|
|
|
47576
|
-
const COLORS = {
|
|
47577
|
-
decision: '#a78bfa', bug: '#ef4444', pattern: '#22c55e',
|
|
47578
|
-
knowledge: '#06b6d4', architecture: '#f59e0b'
|
|
47579
|
-
};
|
|
47988
|
+
const COLORS = { decision: 'oklch(55% 0.25 280)', bug: 'oklch(65% 0.24 25)', pattern: 'oklch(78% 0.2 155)', knowledge: 'oklch(65% 0.25 310)', architecture: 'oklch(85% 0.18 85)' };
|
|
47580
47989
|
|
|
47581
47990
|
let selectedEntry = null;
|
|
47582
47991
|
let activeFilter = null;
|
|
@@ -47675,6 +48084,7 @@ document.getElementById('search').addEventListener('input', (e) => {
|
|
|
47675
48084
|
});
|
|
47676
48085
|
|
|
47677
48086
|
// --- Entries List ---
|
|
48087
|
+
let firstEntriesRender = true;
|
|
47678
48088
|
function renderEntries() {
|
|
47679
48089
|
const q = searchQuery;
|
|
47680
48090
|
const list = document.getElementById('entriesList');
|
|
@@ -47682,9 +48092,10 @@ function renderEntries() {
|
|
|
47682
48092
|
DATA.nodes
|
|
47683
48093
|
.filter(e => !activeFilter || e.category === activeFilter)
|
|
47684
48094
|
.filter(e => !q || e.id.toLowerCase().includes(q) || e.content.toLowerCase().includes(q) || e.tags.some(t => t.toLowerCase().includes(q)))
|
|
47685
|
-
.forEach(e => {
|
|
48095
|
+
.forEach((e, i) => {
|
|
47686
48096
|
const div = document.createElement('div');
|
|
47687
|
-
div.className = 'entry-item' + (selectedEntry && selectedEntry.id === e.id ? ' selected' : '');
|
|
48097
|
+
div.className = 'entry-item' + (selectedEntry && selectedEntry.id === e.id ? ' selected' : '') + (firstEntriesRender ? ' reveal' : '');
|
|
48098
|
+
if (firstEntriesRender) div.style.animationDelay = Math.min(i * 0.03, 0.6) + 's';
|
|
47688
48099
|
div.innerHTML =
|
|
47689
48100
|
'<div class="entry-cat ' + e.category + '">' + e.category + '</div>' +
|
|
47690
48101
|
'<div class="entry-key">' + escHtml(e.id) + '</div>' +
|
|
@@ -47693,6 +48104,7 @@ function renderEntries() {
|
|
|
47693
48104
|
div.onclick = () => selectEntry(e);
|
|
47694
48105
|
list.appendChild(div);
|
|
47695
48106
|
});
|
|
48107
|
+
firstEntriesRender = false;
|
|
47696
48108
|
}
|
|
47697
48109
|
|
|
47698
48110
|
function escHtml(s) { return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); }
|
|
@@ -47741,22 +48153,29 @@ function renderStats() {
|
|
|
47741
48153
|
const maxTag = Math.max(...topTags.map(t => t[1]));
|
|
47742
48154
|
const avgQuality = DATA.nodes.reduce((s, n) => s + (n.quality || 0), 0) / DATA.nodes.length;
|
|
47743
48155
|
const maxAccess = Math.max(...DATA.nodes.map(n => n.accessCount || 0));
|
|
48156
|
+
const card = (i, inner) => '<div class="stat-card reveal" style="animation-delay:' + (i * 0.07) + 's">' + inner + '</div>';
|
|
47744
48157
|
|
|
47745
48158
|
grid.innerHTML =
|
|
47746
|
-
'<
|
|
47747
|
-
'<
|
|
47748
|
-
'<
|
|
47749
|
-
'<
|
|
47750
|
-
'<
|
|
48159
|
+
card(0, '<h3>Total Entries</h3><div class="stat-big">' + DATA.totalEntries + '</div>') +
|
|
48160
|
+
card(1, '<h3>Graph Edges</h3><div class="stat-big">' + DATA.edges.length + '</div>') +
|
|
48161
|
+
card(2, '<h3>Avg Quality</h3><div class="stat-big">' + avgQuality.toFixed(2) + '</div>') +
|
|
48162
|
+
card(3, '<h3>Max Access</h3><div class="stat-big">' + maxAccess + '</div>') +
|
|
48163
|
+
card(4, '<h3>Categories</h3><div class="bar-chart">' +
|
|
47751
48164
|
catEntries.map(([cat, count]) =>
|
|
47752
|
-
'<div class="bar-row"><span class="bar-label">' + cat + '</span><div class="bar-track"><div class="bar-fill"
|
|
48165
|
+
'<div class="bar-row"><span class="bar-label">' + cat + '</span><div class="bar-track"><div class="bar-fill" data-w="' + (count/maxCat*100) + '" style="background:' + (COLORS[cat] || 'var(--brand)') + '"></div></div><span class="bar-value">' + count + '</span></div>'
|
|
47753
48166
|
).join('') +
|
|
47754
|
-
'</div
|
|
47755
|
-
'<
|
|
48167
|
+
'</div>') +
|
|
48168
|
+
card(5, '<h3>Top Tags</h3><div class="tag-cloud">' +
|
|
47756
48169
|
topTags.map(([tag, count]) =>
|
|
47757
48170
|
'<span class="tag-pill">' + escHtml(tag) + ' <small>(' + count + ')</small></span>'
|
|
47758
48171
|
).join('') +
|
|
47759
|
-
'</div
|
|
48172
|
+
'</div>');
|
|
48173
|
+
|
|
48174
|
+
requestAnimationFrame(() => {
|
|
48175
|
+
grid.querySelectorAll('.bar-fill').forEach(b => {
|
|
48176
|
+
b.style.width = b.getAttribute('data-w') + '%';
|
|
48177
|
+
});
|
|
48178
|
+
});
|
|
47760
48179
|
}
|
|
47761
48180
|
|
|
47762
48181
|
function renderTimeline() {
|
|
@@ -47770,14 +48189,16 @@ function renderTimeline() {
|
|
|
47770
48189
|
});
|
|
47771
48190
|
|
|
47772
48191
|
let html = '<div class="timeline-header">Timeline (' + DATA.totalEntries + ' entries)</div><div class="timeline-track"><div class="timeline-line"></div>';
|
|
48192
|
+
let idx = 0;
|
|
47773
48193
|
for (const [date, entries] of Object.entries(grouped)) {
|
|
47774
48194
|
for (const e of entries) {
|
|
47775
|
-
html += '<div class="timeline-entry
|
|
48195
|
+
html += '<div class="timeline-entry reveal" style="border-left:3px solid ' + (COLORS[e.category] || 'var(--border)') + ';animation-delay:' + Math.min(idx * 0.02, 0.6) + 's" onclick="selectEntryById(\\'' + e.id + '\\')">' +
|
|
47776
48196
|
'<div class="tl-date">' + escHtml(date) + '</div>' +
|
|
47777
48197
|
'<div class="tl-cat" style="color:' + (COLORS[e.category] || 'var(--muted)') + '">' + e.category + '</div>' +
|
|
47778
48198
|
'<div class="tl-key">' + escHtml(e.id) + '</div>' +
|
|
47779
48199
|
'<div class="tl-content">' + escHtml(e.content.substring(0, 100)) + '</div>' +
|
|
47780
48200
|
'</div>';
|
|
48201
|
+
idx++;
|
|
47781
48202
|
}
|
|
47782
48203
|
}
|
|
47783
48204
|
html += '</div>';
|
|
@@ -47845,8 +48266,8 @@ const graph = (function() {
|
|
|
47845
48266
|
const node = g.append('g').selectAll('circle').data(DATA.nodes).join('circle')
|
|
47846
48267
|
.attr('class', 'node-circle')
|
|
47847
48268
|
.attr('r', d => nodeRadius(d))
|
|
47848
|
-
.attr('fill', d => COLORS[d.category] || '
|
|
47849
|
-
.attr('stroke', d => { const c = COLORS[d.category] || '
|
|
48269
|
+
.attr('fill', d => COLORS[d.category] || 'oklch(56% 0.02 270)')
|
|
48270
|
+
.attr('stroke', d => { const c = COLORS[d.category] || 'oklch(56% 0.02 270)'; return c; })
|
|
47850
48271
|
.attr('stroke-width', 1.5)
|
|
47851
48272
|
.attr('stroke-opacity', 0.6)
|
|
47852
48273
|
.call(d3.drag()
|
|
@@ -48034,7 +48455,7 @@ const graph = (function() {
|
|
|
48034
48455
|
const minimapG = minimapSvg.append('g');
|
|
48035
48456
|
minimapG.append('g').attr('class', 'minimap-links');
|
|
48036
48457
|
minimapG.append('g').attr('class', 'minimap-nodes');
|
|
48037
|
-
const minimapViewport = minimapSvg.append('rect').attr('class', 'minimap-viewport').attr('fill', '
|
|
48458
|
+
const minimapViewport = minimapSvg.append('rect').attr('class', 'minimap-viewport').attr('fill', 'oklch(55% 0.25 280 / 0.15)').attr('stroke', 'oklch(55% 0.25 280)').attr('stroke-width', 1.5).attr('rx', 3);
|
|
48038
48459
|
|
|
48039
48460
|
function getGraphBounds() {
|
|
48040
48461
|
const allX = DATA.nodes.map(n => n.x || 0);
|
|
@@ -48051,11 +48472,11 @@ const graph = (function() {
|
|
|
48051
48472
|
.attr('y1', d => (d.source.y || 0) * minimapScale)
|
|
48052
48473
|
.attr('x2', d => (d.target.x || 0) * minimapScale)
|
|
48053
48474
|
.attr('y2', d => (d.target.y || 0) * minimapScale)
|
|
48054
|
-
.attr('stroke', '
|
|
48475
|
+
.attr('stroke', 'oklch(21% 0.02 270)').attr('stroke-width', 0.5).attr('stroke-opacity', 0.3);
|
|
48055
48476
|
|
|
48056
48477
|
minimapG.select('.minimap-nodes').selectAll('circle').data(DATA.nodes).join('circle')
|
|
48057
48478
|
.attr('cx', d => (d.x || 0) * minimapScale).attr('cy', d => (d.y || 0) * minimapScale)
|
|
48058
|
-
.attr('r', 1.8).attr('fill', d => COLORS[d.category] || '
|
|
48479
|
+
.attr('r', 1.8).attr('fill', d => COLORS[d.category] || 'oklch(56% 0.02 270)').attr('stroke', 'none');
|
|
48059
48480
|
|
|
48060
48481
|
const t = currentTransform;
|
|
48061
48482
|
const containerW = container.clientWidth;
|
|
@@ -48306,7 +48727,7 @@ function registerResources(server2) {
|
|
|
48306
48727
|
|
|
48307
48728
|
// src/mcp/server.ts
|
|
48308
48729
|
var server = new McpServer(
|
|
48309
|
-
{ name: "toon-memory", version: "4.3.
|
|
48730
|
+
{ name: "toon-memory", version: "4.3.3" },
|
|
48310
48731
|
{ capabilities: { tools: { listChanged: true }, resources: { listChanged: true }, experimental: { "io.modelcontextprotocol/ui": {} } } }
|
|
48311
48732
|
);
|
|
48312
48733
|
var s = server.server;
|
|
@@ -48318,7 +48739,7 @@ s.setRequestHandler(InitializeRequestSchema, async (request) => {
|
|
|
48318
48739
|
return {
|
|
48319
48740
|
protocolVersion,
|
|
48320
48741
|
capabilities: s.getCapabilities(),
|
|
48321
|
-
serverInfo: { name: "toon-memory", version: "4.3.
|
|
48742
|
+
serverInfo: { name: "toon-memory", version: "4.3.3" },
|
|
48322
48743
|
...s._instructions && { instructions: s._instructions }
|
|
48323
48744
|
};
|
|
48324
48745
|
});
|