toon-memory 4.3.1 → 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 +335 -141
- package/mcp/server.js +558 -131
- package/package.json +2 -2
- package/skills/toon-memory.md +3 -0
- package/src/cli/agents.ts +67 -0
- package/src/cli/commands.ts +59 -18
- package/src/cli/config-writer.ts +75 -10
- package/src/cli/constants.ts +7 -4
- 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/archive.ts +16 -6
- 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/dist/cli/setup.js
CHANGED
|
@@ -3,10 +3,11 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
|
3
3
|
|
|
4
4
|
// src/cli/constants.ts
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
6
7
|
var projectRoot = process.cwd();
|
|
7
8
|
var HOME = process.env.HOME || process.env.USERPROFILE || "~";
|
|
8
9
|
var MEMORY_DIR = join(projectRoot, ".toon-memory", "memory");
|
|
9
|
-
var scriptDir = dirname(
|
|
10
|
+
var scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
10
11
|
var CAPTURE_JS = join(scriptDir, "capture.js");
|
|
11
12
|
var SESSION_START_JS = join(scriptDir, "session-start.js");
|
|
12
13
|
var CAPTURE_CONFIG = join(MEMORY_DIR, "config.json");
|
|
@@ -282,6 +283,66 @@ function detectAgents() {
|
|
|
282
283
|
needsHooks: false,
|
|
283
284
|
needsInstructions: false
|
|
284
285
|
});
|
|
286
|
+
agents.push({
|
|
287
|
+
name: "qwen",
|
|
288
|
+
global: join3(HOME, ".qwen", "settings.json"),
|
|
289
|
+
local: join3(projectRoot, ".qwen", "settings.json"),
|
|
290
|
+
mcpKey: "mcpServers",
|
|
291
|
+
format: "json",
|
|
292
|
+
needsHooks: true,
|
|
293
|
+
needsInstructions: true,
|
|
294
|
+
instructionFile: join3(projectRoot, ".qwen", "AGENTS.md"),
|
|
295
|
+
captureJson: ["PostToolUse", "Stop"]
|
|
296
|
+
});
|
|
297
|
+
agents.push({
|
|
298
|
+
name: "kimi",
|
|
299
|
+
global: join3(HOME, ".kimi", "mcp.json"),
|
|
300
|
+
mcpKey: "mcpServers",
|
|
301
|
+
format: "json",
|
|
302
|
+
needsHooks: false,
|
|
303
|
+
needsInstructions: false
|
|
304
|
+
});
|
|
305
|
+
agents.push({
|
|
306
|
+
name: "goose",
|
|
307
|
+
global: join3(HOME, ".config", "goose", "config.yaml"),
|
|
308
|
+
mcpKey: "extensions",
|
|
309
|
+
format: "yaml",
|
|
310
|
+
needsHooks: false,
|
|
311
|
+
needsInstructions: false
|
|
312
|
+
});
|
|
313
|
+
agents.push({
|
|
314
|
+
name: "junie",
|
|
315
|
+
local: join3(projectRoot, ".junie", "mcp", "mcp.json"),
|
|
316
|
+
mcpKey: "mcpServers",
|
|
317
|
+
format: "json",
|
|
318
|
+
needsHooks: false,
|
|
319
|
+
needsInstructions: false
|
|
320
|
+
});
|
|
321
|
+
agents.push({
|
|
322
|
+
name: "amp",
|
|
323
|
+
global: join3(HOME, ".config", "amp", "settings.json"),
|
|
324
|
+
mcpKey: "amp.mcpServers",
|
|
325
|
+
format: "json",
|
|
326
|
+
needsHooks: false,
|
|
327
|
+
needsInstructions: false
|
|
328
|
+
});
|
|
329
|
+
agents.push({
|
|
330
|
+
name: "grok",
|
|
331
|
+
global: join3(HOME, ".grok", "config.toml"),
|
|
332
|
+
local: join3(projectRoot, ".grok", "config.toml"),
|
|
333
|
+
mcpKey: "mcp_servers",
|
|
334
|
+
format: "toml",
|
|
335
|
+
needsHooks: false,
|
|
336
|
+
needsInstructions: false
|
|
337
|
+
});
|
|
338
|
+
agents.push({
|
|
339
|
+
name: "trae",
|
|
340
|
+
local: join3(projectRoot, ".trae", "mcp.json"),
|
|
341
|
+
mcpKey: "mcpServers",
|
|
342
|
+
format: "json",
|
|
343
|
+
needsHooks: false,
|
|
344
|
+
needsInstructions: false
|
|
345
|
+
});
|
|
285
346
|
return agents;
|
|
286
347
|
}
|
|
287
348
|
|
|
@@ -429,6 +490,12 @@ function loadJSON(file) {
|
|
|
429
490
|
return null;
|
|
430
491
|
}
|
|
431
492
|
}
|
|
493
|
+
function nested(obj, key) {
|
|
494
|
+
return key.split(".").reduce((acc, part) => {
|
|
495
|
+
if (typeof acc[part] !== "object" || acc[part] === null) acc[part] = {};
|
|
496
|
+
return acc[part];
|
|
497
|
+
}, obj);
|
|
498
|
+
}
|
|
432
499
|
function installJSONConfig(agent, scope) {
|
|
433
500
|
const configPath = scope === "global" ? agent.global : agent.local;
|
|
434
501
|
if (!configPath) {
|
|
@@ -443,20 +510,20 @@ function installJSONConfig(agent, scope) {
|
|
|
443
510
|
return;
|
|
444
511
|
}
|
|
445
512
|
const mcpKey = agent.mcpKey || "mcpServers";
|
|
446
|
-
|
|
513
|
+
const servers = nested(config, mcpKey);
|
|
447
514
|
if (agent.name === "opencode") {
|
|
448
|
-
|
|
515
|
+
servers["toon-memory"] = {
|
|
449
516
|
enabled: true,
|
|
450
517
|
type: "local",
|
|
451
518
|
command: ["npx", "-y", "toon-memory", "mcp"]
|
|
452
519
|
};
|
|
453
520
|
} else if (agent.name === "kilocode") {
|
|
454
|
-
|
|
521
|
+
servers["toon-memory"] = {
|
|
455
522
|
type: "local",
|
|
456
523
|
command: ["npx", "-y", "toon-memory", "mcp"]
|
|
457
524
|
};
|
|
458
525
|
} else {
|
|
459
|
-
|
|
526
|
+
servers["toon-memory"] = {
|
|
460
527
|
command: "npx",
|
|
461
528
|
args: ["-y", "toon-memory", "mcp"]
|
|
462
529
|
};
|
|
@@ -464,16 +531,61 @@ function installJSONConfig(agent, scope) {
|
|
|
464
531
|
writeFileSync3(configPath, JSON.stringify(config, null, 2));
|
|
465
532
|
console.log(` MCP server added to ${configPath}`);
|
|
466
533
|
}
|
|
467
|
-
function installTOMLConfig(agent) {
|
|
468
|
-
const configPath = agent.local;
|
|
534
|
+
function installTOMLConfig(agent, scope) {
|
|
535
|
+
const configPath = scope === "global" ? agent.global : agent.local;
|
|
469
536
|
if (!configPath) return;
|
|
470
537
|
const configDir = dirname3(configPath);
|
|
471
538
|
if (!existsSync5(configDir)) mkdirSync3(configDir, { recursive: true });
|
|
472
|
-
const
|
|
539
|
+
const table = agent.mcpKey || "mcpServers";
|
|
540
|
+
const block = `[${table}.toon-memory]
|
|
473
541
|
command = "npx"
|
|
474
542
|
args = ["-y", "toon-memory", "mcp"]
|
|
475
543
|
`;
|
|
476
|
-
|
|
544
|
+
let content = "";
|
|
545
|
+
if (existsSync5(configPath)) {
|
|
546
|
+
content = readFileSync5(configPath, "utf-8");
|
|
547
|
+
if (content.includes(`[${table}.toon-memory]`)) {
|
|
548
|
+
console.log(` MCP server already registered in ${configPath}`);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
if (content && !content.endsWith("\n")) content += "\n";
|
|
552
|
+
}
|
|
553
|
+
writeFileSync3(configPath, content + block);
|
|
554
|
+
console.log(` MCP server added to ${configPath}`);
|
|
555
|
+
}
|
|
556
|
+
function installYAMLConfig(agent, scope) {
|
|
557
|
+
const configPath = scope === "global" ? agent.global : agent.local;
|
|
558
|
+
if (!configPath) {
|
|
559
|
+
console.log(` No ${scope} config path for ${agent.name}`);
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
const configDir = dirname3(configPath);
|
|
563
|
+
if (!existsSync5(configDir)) mkdirSync3(configDir, { recursive: true });
|
|
564
|
+
const entry = ` toon-memory:
|
|
565
|
+
type: stdio
|
|
566
|
+
cmd: npx
|
|
567
|
+
args: ["-y", "toon-memory", "mcp"]
|
|
568
|
+
`;
|
|
569
|
+
let content = "";
|
|
570
|
+
if (existsSync5(configPath)) {
|
|
571
|
+
content = readFileSync5(configPath, "utf-8");
|
|
572
|
+
if (content.includes("toon-memory")) {
|
|
573
|
+
console.log(` MCP server already registered in ${configPath}`);
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
if (!content) {
|
|
578
|
+
content = `extensions:
|
|
579
|
+
${entry}`;
|
|
580
|
+
} else if (/^extensions:\s*$/m.test(content)) {
|
|
581
|
+
content = content.replace(/^extensions:\s*$/m, `extensions:
|
|
582
|
+
${entry}`);
|
|
583
|
+
} else {
|
|
584
|
+
if (!content.endsWith("\n")) content += "\n";
|
|
585
|
+
content += `extensions:
|
|
586
|
+
${entry}`;
|
|
587
|
+
}
|
|
588
|
+
writeFileSync3(configPath, content);
|
|
477
589
|
console.log(` MCP server added to ${configPath}`);
|
|
478
590
|
}
|
|
479
591
|
function installZedConfig(agent) {
|
|
@@ -561,7 +673,9 @@ function installMCPConfig(agent, scope) {
|
|
|
561
673
|
return;
|
|
562
674
|
}
|
|
563
675
|
if (agent.format === "toml") {
|
|
564
|
-
installTOMLConfig(agent);
|
|
676
|
+
installTOMLConfig(agent, scope);
|
|
677
|
+
} else if (agent.format === "yaml") {
|
|
678
|
+
installYAMLConfig(agent, scope);
|
|
565
679
|
} else if (agent.format === "jsonc") {
|
|
566
680
|
installZedConfig(agent);
|
|
567
681
|
} else if (agent.format === "continue") {
|
|
@@ -745,7 +859,7 @@ function registerHookJSON(agent, hookPath) {
|
|
|
745
859
|
console.log(` \u26A0\uFE0F Skipping ${configPath}: existing file is not valid JSON \u2014 fix it manually, then re-run.`);
|
|
746
860
|
return;
|
|
747
861
|
}
|
|
748
|
-
if (agent.name === "claude" || agent.name === "gemini") {
|
|
862
|
+
if (agent.name === "claude" || agent.name === "gemini" || agent.name === "qwen") {
|
|
749
863
|
if (!config.hooks) config.hooks = {};
|
|
750
864
|
if (!config.hooks.SessionStart) config.hooks.SessionStart = [];
|
|
751
865
|
if (!config.hooks.SessionStart.some((h) => h.command === hookPath)) {
|
|
@@ -1066,8 +1180,9 @@ function uninstall() {
|
|
|
1066
1180
|
config = JSON.parse(readFileSync9(configPath, "utf-8"));
|
|
1067
1181
|
}
|
|
1068
1182
|
const mcpKey = agent.mcpKey || "mcpServers";
|
|
1069
|
-
|
|
1070
|
-
|
|
1183
|
+
const servers = config[mcpKey] ?? mcpKey.split(".").reduce((acc, k) => acc?.[k], config);
|
|
1184
|
+
if (servers?.["toon-memory"]) {
|
|
1185
|
+
delete servers["toon-memory"];
|
|
1071
1186
|
writeFileSync7(configPath, JSON.stringify(config, null, 2));
|
|
1072
1187
|
console.log(` Removed MCP from ${agent.name} (${configPath})`);
|
|
1073
1188
|
}
|
|
@@ -1075,13 +1190,32 @@ function uninstall() {
|
|
|
1075
1190
|
}
|
|
1076
1191
|
}
|
|
1077
1192
|
}
|
|
1078
|
-
if (agent.format === "toml"
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1193
|
+
if (agent.format === "toml") {
|
|
1194
|
+
const configs = [agent.global, agent.local].filter(Boolean);
|
|
1195
|
+
const table = agent.mcpKey || "mcpServers";
|
|
1196
|
+
for (const configPath of configs) {
|
|
1197
|
+
if (!existsSync9(configPath)) continue;
|
|
1198
|
+
try {
|
|
1199
|
+
let content = readFileSync9(configPath, "utf-8");
|
|
1200
|
+
content = content.replace(new RegExp(`\\[${table}\\.toon-memory\\][\\s\\S]*?(?=\\n\\[|$)`), "").trim() + "\n";
|
|
1201
|
+
writeFileSync7(configPath, content);
|
|
1202
|
+
console.log(` Removed MCP from ${agent.name} (${configPath})`);
|
|
1203
|
+
} catch {
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
if (agent.format === "yaml") {
|
|
1208
|
+
const configs = [agent.global, agent.local].filter(Boolean);
|
|
1209
|
+
for (const configPath of configs) {
|
|
1210
|
+
if (!existsSync9(configPath)) continue;
|
|
1211
|
+
try {
|
|
1212
|
+
let content = readFileSync9(configPath, "utf-8");
|
|
1213
|
+
if (!content.includes("toon-memory")) continue;
|
|
1214
|
+
content = content.replace(/^extensions:\s*$/m, "").replace(/^ toon-memory:\n(?:(?:^ .*\n?)|(?:^ -.*\n?)|(?:^ \[.*\n?))*/gm, "").trim();
|
|
1215
|
+
writeFileSync7(configPath, content + "\n");
|
|
1216
|
+
console.log(` Removed MCP from ${agent.name} (${configPath})`);
|
|
1217
|
+
} catch {
|
|
1218
|
+
}
|
|
1085
1219
|
}
|
|
1086
1220
|
}
|
|
1087
1221
|
}
|
|
@@ -1179,16 +1313,27 @@ function status() {
|
|
|
1179
1313
|
} else {
|
|
1180
1314
|
config = JSON.parse(readFileSync9(configPath, "utf-8"));
|
|
1181
1315
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}
|
|
1316
|
+
const servers = config[agent.mcpKey] ?? agent.mcpKey.split(".").reduce((acc, k) => acc?.[k], config);
|
|
1317
|
+
if (servers?.["toon-memory"]) configured = true;
|
|
1185
1318
|
} catch {
|
|
1186
1319
|
}
|
|
1187
1320
|
}
|
|
1188
1321
|
}
|
|
1189
|
-
if (agent.format === "toml"
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1322
|
+
if (agent.format === "toml") {
|
|
1323
|
+
const configs = [agent.global, agent.local].filter(Boolean);
|
|
1324
|
+
for (const configPath of configs) {
|
|
1325
|
+
if (!existsSync9(configPath)) continue;
|
|
1326
|
+
const content = readFileSync9(configPath, "utf-8");
|
|
1327
|
+
if (content.includes("toon-memory")) configured = true;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
if (agent.format === "yaml") {
|
|
1331
|
+
const configs = [agent.global, agent.local].filter(Boolean);
|
|
1332
|
+
for (const configPath of configs) {
|
|
1333
|
+
if (!existsSync9(configPath)) continue;
|
|
1334
|
+
const content = readFileSync9(configPath, "utf-8");
|
|
1335
|
+
if (content.includes("toon-memory")) configured = true;
|
|
1336
|
+
}
|
|
1192
1337
|
}
|
|
1193
1338
|
const hasInstructions = agent.instructionFile ? existsSync9(agent.instructionFile) : false;
|
|
1194
1339
|
const hookPath = join7(projectRoot, ".toon-memory", "hooks", `session-start-${agent.name}.sh`);
|
|
@@ -1329,14 +1474,15 @@ function importMemory() {
|
|
|
1329
1474
|
if (existsSync9(memoryFile)) {
|
|
1330
1475
|
const existing = readFileSync9(memoryFile, "utf-8");
|
|
1331
1476
|
const existingCount = existing.split("\n").filter((l) => l.startsWith(" ") && l.includes("|")).length;
|
|
1477
|
+
const newCount = existingCount + newEntries.length;
|
|
1332
1478
|
const updated = existing.replace(
|
|
1333
|
-
|
|
1334
|
-
|
|
1479
|
+
/^(version: 1\n)?(entries)?\[(\d+)\|/,
|
|
1480
|
+
(m, _v, prefix) => `${m.startsWith("version: 1\n") ? "version: 1\n" : ""}${prefix || ""}[${newCount}|`
|
|
1335
1481
|
) + "\n" + newLines;
|
|
1336
1482
|
writeFileSync7(memoryFile, updated);
|
|
1337
1483
|
} else {
|
|
1338
1484
|
writeFileSync7(memoryFile, `version: 1
|
|
1339
|
-
|
|
1485
|
+
[${newEntries.length}|]{id|category|key|content|file|tags|date}:
|
|
1340
1486
|
${newLines}
|
|
1341
1487
|
`);
|
|
1342
1488
|
}
|
|
@@ -1627,10 +1773,13 @@ function readUnderLock(file, encoding = "utf-8") {
|
|
|
1627
1773
|
// src/mcp/config.ts
|
|
1628
1774
|
import { readFileSync as readFileSync12, writeFileSync as writeFileSync10, existsSync as existsSync12, mkdirSync as mkdirSync9 } from "fs";
|
|
1629
1775
|
import { join as join9 } from "path";
|
|
1776
|
+
import { homedir } from "os";
|
|
1630
1777
|
var MEMORY_DIR3 = join9(process.cwd(), ".toon-memory", "memory");
|
|
1631
1778
|
var MEMORY_FILE = join9(MEMORY_DIR3, "data.toon");
|
|
1632
1779
|
var ARCHIVE_FILE = join9(MEMORY_DIR3, "archive.toon");
|
|
1633
1780
|
var OBSERVATIONS_FILE = join9(MEMORY_DIR3, "observations.toon");
|
|
1781
|
+
var SECRETS_FILE = join9(MEMORY_DIR3, "secrets.toon");
|
|
1782
|
+
var GLOBAL_FILE = process.env.TOON_MEMORY_GLOBAL_FILE || join9(homedir(), ".toon-memory", "memory", "global.toon");
|
|
1634
1783
|
var CONFIG_FILE = join9(MEMORY_DIR3, "config.json");
|
|
1635
1784
|
var ALGORITHM = "aes-256-gcm";
|
|
1636
1785
|
function loadConfig() {
|
|
@@ -1706,7 +1855,7 @@ function parseEntries(data) {
|
|
|
1706
1855
|
const out = [];
|
|
1707
1856
|
for (const line of entryLines(data)) {
|
|
1708
1857
|
const parts = parseToonLine(line);
|
|
1709
|
-
if (parts.length <
|
|
1858
|
+
if (parts.length < 3) continue;
|
|
1710
1859
|
const [id, category, key, content, file, tags, date, ttl, accessedRaw, linksRaw] = parts;
|
|
1711
1860
|
out.push({
|
|
1712
1861
|
id,
|
|
@@ -1725,7 +1874,8 @@ function parseEntries(data) {
|
|
|
1725
1874
|
origin: parts.length > 15 && parts[15] ? parts[15] : "agent",
|
|
1726
1875
|
status: parts.length > 16 && parts[16] ? parts[16] : "active",
|
|
1727
1876
|
supersededOn: parts.length > 17 ? parts[17] || "" : "",
|
|
1728
|
-
importance: parts.length > 18 ? parts[18] || "" : ""
|
|
1877
|
+
importance: parts.length > 18 ? parts[18] || "" : "",
|
|
1878
|
+
evidence: parts.length > 19 ? parts[19] || "" : ""
|
|
1729
1879
|
});
|
|
1730
1880
|
}
|
|
1731
1881
|
return out;
|
|
@@ -1888,20 +2038,37 @@ function buildViewerData() {
|
|
|
1888
2038
|
// src/viewer/html.ts
|
|
1889
2039
|
import { readFileSync as readFileSync13 } from "fs";
|
|
1890
2040
|
import { resolve, dirname as dirname8 } from "path";
|
|
1891
|
-
import { fileURLToPath } from "url";
|
|
2041
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1892
2042
|
var d3Src = (() => {
|
|
1893
2043
|
try {
|
|
1894
|
-
const dir = dirname8(
|
|
2044
|
+
const dir = dirname8(fileURLToPath2(import.meta.url));
|
|
1895
2045
|
return readFileSync13(resolve(dir, "../src/viewer/d3.v7.min.js"), "utf-8");
|
|
1896
2046
|
} catch {
|
|
1897
2047
|
try {
|
|
1898
|
-
const dir = dirname8(
|
|
2048
|
+
const dir = dirname8(fileURLToPath2(import.meta.url));
|
|
1899
2049
|
return readFileSync13(resolve(dir, "d3.v7.min.js"), "utf-8");
|
|
1900
2050
|
} catch {
|
|
1901
2051
|
return null;
|
|
1902
2052
|
}
|
|
1903
2053
|
}
|
|
1904
2054
|
})();
|
|
2055
|
+
function readViewerAsset(name) {
|
|
2056
|
+
const dir = dirname8(fileURLToPath2(import.meta.url));
|
|
2057
|
+
const candidates = [
|
|
2058
|
+
resolve(dir, `../src/viewer/${name}`),
|
|
2059
|
+
resolve(dir, `../../src/viewer/${name}`),
|
|
2060
|
+
resolve(dir, name)
|
|
2061
|
+
];
|
|
2062
|
+
for (const p of candidates) {
|
|
2063
|
+
try {
|
|
2064
|
+
return readFileSync13(p, "utf-8");
|
|
2065
|
+
} catch {
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return "";
|
|
2069
|
+
}
|
|
2070
|
+
var logoSrc = readViewerAsset("logo.svg");
|
|
2071
|
+
var isologoSrc = readViewerAsset("logo-isologo.svg");
|
|
1905
2072
|
function generateHtml(viewerData) {
|
|
1906
2073
|
const jsonData = JSON.stringify(viewerData);
|
|
1907
2074
|
const d3Tag = d3Src ? `<script>${d3Src}</script>` : `<script src="https://d3js.org/d3.v7.min.js"></script>`;
|
|
@@ -1916,123 +2083,133 @@ ${d3Tag}
|
|
|
1916
2083
|
<style>
|
|
1917
2084
|
*{box-sizing:border-box;margin:0;padding:0}
|
|
1918
2085
|
:root{
|
|
1919
|
-
--bg
|
|
1920
|
-
--text
|
|
1921
|
-
--
|
|
1922
|
-
--
|
|
1923
|
-
|
|
1924
|
-
|
|
2086
|
+
--bg:oklch(8% 0.02 270);--bg2:oklch(12% 0.02 270);--bg3:oklch(15% 0.02 270);--border:oklch(21% 0.02 270);
|
|
2087
|
+
--text:oklch(91% 0.01 270);--muted:oklch(56% 0.02 270);
|
|
2088
|
+
--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);
|
|
2089
|
+
--green:oklch(78% 0.2 155);--red:oklch(65% 0.24 25);--amber:oklch(85% 0.18 85);
|
|
2090
|
+
--brand-wash:oklch(55% 0.25 280 / 0.12);--brand-wash-soft:oklch(55% 0.25 280 / 0.06);
|
|
2091
|
+
--gradient:linear-gradient(135deg,var(--brand),var(--brand2),var(--lavender));
|
|
2092
|
+
--ease-out:cubic-bezier(0.16,1,0.3,1);
|
|
2093
|
+
--font-body:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;--font-mono:'JetBrains Mono','Fira Code','Consolas',monospace
|
|
2094
|
+
}
|
|
2095
|
+
html,body{height:100%;font-family:var(--font-body);background:var(--bg);color:var(--text);overflow:hidden}
|
|
1925
2096
|
.app{display:grid;grid-template-rows:auto 1fr;height:100%}
|
|
1926
|
-
header{display:flex;align-items:center;justify-content:space-between;padding:0.
|
|
1927
|
-
|
|
1928
|
-
|
|
2097
|
+
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)}
|
|
2098
|
+
.brand{display:flex;align-items:center;gap:0.6rem}
|
|
2099
|
+
.brand-logo{display:flex;line-height:0}
|
|
2100
|
+
.brand-logo svg{width:26px;height:26px}
|
|
2101
|
+
.brand-word{display:flex;line-height:0}
|
|
2102
|
+
.brand-word svg{height:20px;width:auto}
|
|
2103
|
+
header .meta{display:flex;gap:0.6rem;font-size:0.78rem;color:var(--muted);align-items:center}
|
|
1929
2104
|
header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
1930
2105
|
.main{display:grid;grid-template-columns:var(--sidebar-w,320px) 1fr;overflow:hidden;position:relative}
|
|
1931
|
-
.sidebar{display:flex;flex-direction:column;border-right:1px solid var(--border);overflow:hidden}
|
|
2106
|
+
.sidebar{display:flex;flex-direction:column;border-right:1px solid var(--border);overflow:hidden;background:oklch(10% 0.02 270 / 0.5)}
|
|
1932
2107
|
.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}
|
|
1933
2108
|
.sidebar-resizer:hover,.sidebar-resizer:active{background:var(--brand)}
|
|
1934
|
-
.sidebar-header{padding:0.75rem 1rem;border-bottom:1px solid var(--border);background:
|
|
2109
|
+
.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)}
|
|
1935
2110
|
.sidebar-header h2{font-size:0.85rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);margin-bottom:0.5rem}
|
|
1936
|
-
.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}
|
|
1937
|
-
.search-box:focus{border-color:var(--brand)}
|
|
2111
|
+
.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}
|
|
2112
|
+
.search-box:focus{border-color:var(--brand);box-shadow:0 0 0 3px oklch(55% 0.25 280 / 0.12)}
|
|
1938
2113
|
.filter-row{display:flex;gap:0.4rem;margin-top:0.5rem;flex-wrap:wrap}
|
|
1939
2114
|
.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}
|
|
1940
|
-
.filter-btn:hover,.filter-btn.active{border-color:var(--brand);color:var(--brand);background:
|
|
2115
|
+
.filter-btn:hover,.filter-btn.active{border-color:var(--brand);color:var(--brand);background:var(--brand-wash)}
|
|
1941
2116
|
.entries-list{flex:1;overflow-y:auto;padding:0.5rem}
|
|
1942
|
-
.entry-item{padding:0.6rem 0.75rem;border:1px solid var(--border);border-radius:
|
|
1943
|
-
.entry-item
|
|
1944
|
-
.entry-item
|
|
2117
|
+
.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)}
|
|
2118
|
+
.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}
|
|
2119
|
+
.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)}
|
|
2120
|
+
.entry-item:hover::before{opacity:1;transform:scaleX(1)}
|
|
2121
|
+
.entry-item.selected{border-color:var(--brand);background:var(--brand-wash)}
|
|
2122
|
+
.entry-item.selected::before{opacity:1;transform:scaleX(1)}
|
|
1945
2123
|
.entry-cat{font-size:0.65rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:0.2rem}
|
|
1946
|
-
.entry-cat.decision{color:var(--brand)}
|
|
1947
|
-
.entry-cat.bug{color:var(--red)}
|
|
1948
|
-
.entry-cat.pattern{color:var(--green)}
|
|
1949
|
-
.entry-cat.knowledge{color:var(--cyan)}
|
|
1950
|
-
.entry-cat.architecture{color:var(--amber)}
|
|
2124
|
+
.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)}
|
|
1951
2125
|
.entry-key{font-size:0.85rem;font-weight:600;margin-bottom:0.15rem}
|
|
1952
2126
|
.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}
|
|
1953
2127
|
.entry-tags{display:flex;gap:0.25rem;margin-top:0.3rem;flex-wrap:wrap}
|
|
1954
|
-
.entry-tag{font-size:0.6rem;padding:0.
|
|
2128
|
+
.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)}
|
|
1955
2129
|
.viewer-area{display:flex;flex-direction:column;overflow:hidden}
|
|
1956
|
-
.tabs{display:flex;border-bottom:1px solid var(--border);background:
|
|
1957
|
-
.tab{padding:0.
|
|
2130
|
+
.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}
|
|
2131
|
+
.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}
|
|
1958
2132
|
.tab:hover{color:var(--text)}
|
|
1959
|
-
.tab.active{color:var(--
|
|
2133
|
+
.tab.active{color:var(--text)}
|
|
2134
|
+
.tab.active::after{content:'';position:absolute;left:0.6rem;right:0.6rem;bottom:0;height:2px;border-radius:2px;background:var(--gradient)}
|
|
1960
2135
|
.tab-content{flex:1;overflow:hidden;position:relative}
|
|
1961
2136
|
.tab-panel{display:none;width:100%;height:100%;overflow:auto}
|
|
1962
2137
|
.tab-panel.active{display:block}
|
|
1963
2138
|
.graph-container{width:100%;height:100%;min-height:300px;background:var(--bg);position:relative}
|
|
1964
|
-
.graph-container::before{content:'';position:absolute;inset:0;background
|
|
2139
|
+
.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}
|
|
1965
2140
|
.graph-container svg{width:100%;height:100%;position:relative;z-index:1}
|
|
1966
|
-
.node-circle{cursor:pointer;transition:r 0.2s ease,opacity 0.2s ease,filter 0.2s ease,stroke 0.2s ease}
|
|
2141
|
+
.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)}
|
|
1967
2142
|
.node-circle:hover{filter:brightness(1.3) drop-shadow(0 0 6px color-mix(in srgb,currentColor 60%,transparent))}
|
|
1968
2143
|
.node-circle.glow{filter:drop-shadow(0 0 12px var(--brand)) brightness(1.5)}
|
|
1969
2144
|
.node-circle.selected{stroke:var(--brand);stroke-width:3;filter:drop-shadow(0 0 14px var(--brand)) brightness(1.3)}
|
|
1970
|
-
.node-label{font-size:9px;font-family:
|
|
1971
|
-
.link{stroke:var(--border);stroke-opacity:0.4;transition:all 0.2s ease;cursor:pointer}
|
|
2145
|
+
.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}
|
|
2146
|
+
.link{stroke:var(--border);stroke-opacity:0.4;transition:all 0.2s var(--ease-out);cursor:pointer}
|
|
1972
2147
|
.link:hover{stroke-opacity:0.9;stroke-width:3}
|
|
1973
2148
|
.link.highlighted{stroke:var(--brand);stroke-opacity:0.9;stroke-width:2.5}
|
|
1974
2149
|
.link.faded{stroke-opacity:0.04}
|
|
1975
2150
|
.node-ring{fill:none;stroke-width:2;opacity:0;transition:opacity 0.3s ease,r 0.3s ease}
|
|
1976
2151
|
.node-ring.visible{opacity:0.6}
|
|
1977
2152
|
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;padding:1.5rem}
|
|
1978
|
-
.stat-card{background:var(--bg2);border:1px solid var(--border);border-radius:
|
|
2153
|
+
.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}
|
|
2154
|
+
.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)}
|
|
2155
|
+
.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)}
|
|
2156
|
+
.stat-card:hover::before{opacity:1;transform:scaleX(1)}
|
|
1979
2157
|
.stat-card h3{font-size:0.8rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);margin-bottom:0.75rem}
|
|
1980
|
-
.stat-big{font-size:2rem;font-weight:800;background:
|
|
2158
|
+
.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}
|
|
1981
2159
|
.bar-chart{display:flex;flex-direction:column;gap:0.4rem}
|
|
1982
2160
|
.bar-row{display:flex;align-items:center;gap:0.5rem}
|
|
1983
2161
|
.bar-label{font-size:0.75rem;color:var(--muted);width:80px;text-align:right;flex-shrink:0}
|
|
1984
2162
|
.bar-track{flex:1;height:20px;background:var(--bg3);border-radius:4px;overflow:hidden}
|
|
1985
|
-
.bar-fill{height:100%;border-radius:4px;transition:width 0.
|
|
2163
|
+
.bar-fill{height:100%;border-radius:4px;width:0;transition:width 0.7s var(--ease-out)}
|
|
1986
2164
|
.bar-value{font-size:0.7rem;color:var(--muted);width:30px}
|
|
1987
2165
|
.tag-cloud{display:flex;flex-wrap:wrap;gap:0.4rem}
|
|
1988
|
-
.tag-pill{padding:0.25rem 0.6rem;border-radius:
|
|
2166
|
+
.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}
|
|
1989
2167
|
.tag-pill:hover{border-color:var(--brand);color:var(--brand)}
|
|
1990
2168
|
.detail-panel{padding:1.5rem;max-width:700px}
|
|
1991
|
-
.detail-panel h2{font-size:1.2rem;font-weight:
|
|
2169
|
+
.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}
|
|
1992
2170
|
.detail-panel .detail-cat{font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:1rem}
|
|
1993
2171
|
.detail-field{margin-bottom:1rem}
|
|
1994
2172
|
.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}
|
|
1995
2173
|
.detail-field .value{font-size:0.9rem;line-height:1.6}
|
|
1996
|
-
.detail-field .value.mono{font-family:
|
|
2174
|
+
.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}
|
|
1997
2175
|
.detail-links{display:flex;gap:0.4rem;flex-wrap:wrap}
|
|
1998
|
-
.detail-link{padding:0.2rem 0.5rem;border:1px solid var(--border);border-radius:
|
|
1999
|
-
.detail-link:hover{border-color:var(--brand);background:
|
|
2176
|
+
.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}
|
|
2177
|
+
.detail-link:hover{border-color:var(--brand);background:var(--brand-wash)}
|
|
2000
2178
|
.empty-detail{display:flex;align-items:center;justify-content:center;height:100%;color:var(--muted);font-size:0.9rem}
|
|
2001
|
-
.graph-legend{position:absolute;bottom:3.5rem;left:0.5rem;background:
|
|
2179
|
+
.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}
|
|
2002
2180
|
.legend-item{display:flex;align-items:center;gap:0.4rem;margin-bottom:0.25rem}
|
|
2003
2181
|
.legend-dot{width:10px;height:10px;border-radius:50%}
|
|
2004
2182
|
.graph-controls{position:absolute;top:1rem;right:1rem;display:flex;gap:0.4rem;z-index:10}
|
|
2005
|
-
.graph-btn{width:32px;height:32px;border:1px solid var(--border);border-radius:
|
|
2006
|
-
.graph-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
2007
|
-
.tooltip{position:fixed;pointer-events:none;background:
|
|
2183
|
+
.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}
|
|
2184
|
+
.graph-btn:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-wash)}
|
|
2185
|
+
.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)}
|
|
2008
2186
|
.tooltip .tt-cat{font-size:0.6rem;font-weight:600;text-transform:uppercase;margin-bottom:0.2rem}
|
|
2009
2187
|
.tooltip .tt-key{font-weight:600;margin-bottom:0.2rem}
|
|
2010
2188
|
.tooltip .tt-content{color:var(--muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
|
|
2011
2189
|
.tooltip .tt-score{margin-top:0.3rem;font-size:0.65rem;color:var(--brand)}
|
|
2012
2190
|
.tooltip .tt-edge{font-size:0.65rem;color:var(--muted);margin-top:0.3rem;padding-top:0.3rem;border-top:1px solid var(--border)}
|
|
2013
2191
|
.timeline-container{padding:1.5rem;overflow-y:auto;height:100%}
|
|
2014
|
-
.timeline-header{font-size:1rem;font-weight:
|
|
2192
|
+
.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}
|
|
2015
2193
|
.timeline-track{position:relative;padding-left:2rem}
|
|
2016
2194
|
.timeline-line{position:absolute;left:0.5rem;top:0;bottom:0;width:2px;background:var(--border)}
|
|
2017
|
-
.timeline-entry{position:relative;margin-bottom:1rem;padding:0.6rem 0.8rem;border:1px solid var(--border);border-radius:
|
|
2018
|
-
.timeline-entry:hover{border-color:var(--brand)}
|
|
2195
|
+
.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}
|
|
2196
|
+
.timeline-entry:hover{border-color:var(--brand);transform:translateY(-2px)}
|
|
2019
2197
|
.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)}
|
|
2020
2198
|
.timeline-entry .tl-date{font-size:0.65rem;color:var(--muted);margin-bottom:0.2rem}
|
|
2021
2199
|
.timeline-entry .tl-cat{font-size:0.6rem;font-weight:600;text-transform:uppercase}
|
|
2022
2200
|
.timeline-entry .tl-key{font-size:0.85rem;font-weight:600}
|
|
2023
2201
|
.timeline-entry .tl-content{font-size:0.75rem;color:var(--muted);margin-top:0.2rem}
|
|
2024
|
-
.export-btn{padding:0.3rem 0.6rem;border:1px solid var(--border);border-radius:
|
|
2202
|
+
.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}
|
|
2025
2203
|
.export-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
2026
2204
|
.export-bar{display:flex;gap:0.4rem}
|
|
2027
|
-
.theme-toggle{background:
|
|
2028
|
-
.theme-toggle:hover{border-color:var(--brand);color:var(--brand)}
|
|
2029
|
-
.reload-btn{
|
|
2030
|
-
.reload-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
2205
|
+
.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}
|
|
2206
|
+
.theme-toggle:hover,.reload-btn:hover{border-color:var(--brand);color:var(--brand)}
|
|
2207
|
+
.reload-btn{color:var(--muted);font-size:0.9rem}
|
|
2031
2208
|
.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}
|
|
2032
2209
|
.minimap svg{width:100%;height:100%;display:block}
|
|
2033
|
-
.minimap-viewport{fill:
|
|
2210
|
+
.minimap-viewport{fill:oklch(55% 0.25 280 / 0.15);stroke:oklch(55% 0.25 280);stroke-width:1.5}
|
|
2034
2211
|
.graph-right{position:absolute;bottom:1rem;right:1rem;z-index:10;display:flex;flex-direction:column;align-items:flex-end;gap:0.4rem}
|
|
2035
|
-
.physics-panel{position:absolute;top:2.8rem;left:0.5rem;background:
|
|
2212
|
+
.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}
|
|
2036
2213
|
.physics-panel h4{font-size:0.7rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--muted);margin-bottom:0.5rem}
|
|
2037
2214
|
.graph-toolbar{position:absolute;top:1rem;left:0.5rem;display:flex;gap:0.4rem;z-index:11}
|
|
2038
2215
|
.physics-row{display:flex;align-items:center;gap:0.5rem;margin-bottom:0.4rem}
|
|
@@ -2042,17 +2219,22 @@ header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
|
2042
2219
|
.physics-row .physics-val{font-size:0.6rem;color:var(--muted);width:30px;text-align:right}
|
|
2043
2220
|
.node-circle.search-match{filter:drop-shadow(0 0 10px var(--brand)) brightness(1.4);animation:searchPulse 1.5s ease-in-out infinite}
|
|
2044
2221
|
@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)}}
|
|
2045
|
-
.path-btn.active{background:var(--
|
|
2046
|
-
.path-info{position:absolute;bottom:0.5rem;left:0.5rem;background:
|
|
2222
|
+
.path-btn.active{background:var(--gradient);color:#fff;border-color:transparent;box-shadow:0 2px 14px -2px oklch(55% 0.25 280 / 0.5)}
|
|
2223
|
+
.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}
|
|
2047
2224
|
.node-circle.path-start{stroke:var(--green);stroke-width:3;filter:drop-shadow(0 0 12px var(--green))}
|
|
2048
2225
|
.node-circle.path-end{stroke:var(--red);stroke-width:3;filter:drop-shadow(0 0 12px var(--red))}
|
|
2049
2226
|
.node-circle.path-node{stroke:var(--brand);stroke-width:2.5;animation:pathNodePulse 1.2s ease-in-out infinite}
|
|
2050
2227
|
@keyframes pathNodePulse{0%,100%{filter:drop-shadow(0 0 6px var(--brand))}50%{filter:drop-shadow(0 0 14px var(--brand))}}
|
|
2051
2228
|
.link.path-edge{stroke:var(--brand);stroke-opacity:0.9;stroke-width:3}
|
|
2052
|
-
|
|
2053
|
-
.
|
|
2054
|
-
.
|
|
2055
|
-
.
|
|
2229
|
+
@keyframes riseIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
|
|
2230
|
+
.app{animation:riseIn 0.6s var(--ease-out) both}
|
|
2231
|
+
.reveal{opacity:0;transform:translateY(14px);animation:riseIn 0.6s var(--ease-out) forwards}
|
|
2232
|
+
@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}}
|
|
2233
|
+
.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)}
|
|
2234
|
+
.light header,.light .sidebar-header,.light .tabs{background:rgba(255,255,255,0.85)}
|
|
2235
|
+
.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)}
|
|
2236
|
+
.light .timeline-entry{background:var(--bg2)}
|
|
2237
|
+
.light .graph-btn,.light .export-btn,.light .theme-toggle,.light .reload-btn{background:var(--bg2)}
|
|
2056
2238
|
.light .minimap{box-shadow:0 4px 16px rgba(0,0,0,0.08)}
|
|
2057
2239
|
@media(max-width:768px){.main{grid-template-columns:1fr}.sidebar{display:none}}
|
|
2058
2240
|
</style>
|
|
@@ -2060,7 +2242,10 @@ header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
|
2060
2242
|
<body>
|
|
2061
2243
|
<div class="app">
|
|
2062
2244
|
<header>
|
|
2063
|
-
<
|
|
2245
|
+
<div class="brand">
|
|
2246
|
+
<span class="brand-logo">${logoSrc}</span>
|
|
2247
|
+
<span class="brand-word">${isologoSrc}</span>
|
|
2248
|
+
</div>
|
|
2064
2249
|
<div class="meta">
|
|
2065
2250
|
<span id="totalCount"></span>
|
|
2066
2251
|
<span id="edgeCount"></span>
|
|
@@ -2134,10 +2319,7 @@ header .meta span{display:flex;align-items:center;gap:0.3rem}
|
|
|
2134
2319
|
<script>
|
|
2135
2320
|
const DATA = ${jsonData};
|
|
2136
2321
|
|
|
2137
|
-
const COLORS = {
|
|
2138
|
-
decision: '#a78bfa', bug: '#ef4444', pattern: '#22c55e',
|
|
2139
|
-
knowledge: '#06b6d4', architecture: '#f59e0b'
|
|
2140
|
-
};
|
|
2322
|
+
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)' };
|
|
2141
2323
|
|
|
2142
2324
|
let selectedEntry = null;
|
|
2143
2325
|
let activeFilter = null;
|
|
@@ -2236,6 +2418,7 @@ document.getElementById('search').addEventListener('input', (e) => {
|
|
|
2236
2418
|
});
|
|
2237
2419
|
|
|
2238
2420
|
// --- Entries List ---
|
|
2421
|
+
let firstEntriesRender = true;
|
|
2239
2422
|
function renderEntries() {
|
|
2240
2423
|
const q = searchQuery;
|
|
2241
2424
|
const list = document.getElementById('entriesList');
|
|
@@ -2243,9 +2426,10 @@ function renderEntries() {
|
|
|
2243
2426
|
DATA.nodes
|
|
2244
2427
|
.filter(e => !activeFilter || e.category === activeFilter)
|
|
2245
2428
|
.filter(e => !q || e.id.toLowerCase().includes(q) || e.content.toLowerCase().includes(q) || e.tags.some(t => t.toLowerCase().includes(q)))
|
|
2246
|
-
.forEach(e => {
|
|
2429
|
+
.forEach((e, i) => {
|
|
2247
2430
|
const div = document.createElement('div');
|
|
2248
|
-
div.className = 'entry-item' + (selectedEntry && selectedEntry.id === e.id ? ' selected' : '');
|
|
2431
|
+
div.className = 'entry-item' + (selectedEntry && selectedEntry.id === e.id ? ' selected' : '') + (firstEntriesRender ? ' reveal' : '');
|
|
2432
|
+
if (firstEntriesRender) div.style.animationDelay = Math.min(i * 0.03, 0.6) + 's';
|
|
2249
2433
|
div.innerHTML =
|
|
2250
2434
|
'<div class="entry-cat ' + e.category + '">' + e.category + '</div>' +
|
|
2251
2435
|
'<div class="entry-key">' + escHtml(e.id) + '</div>' +
|
|
@@ -2254,6 +2438,7 @@ function renderEntries() {
|
|
|
2254
2438
|
div.onclick = () => selectEntry(e);
|
|
2255
2439
|
list.appendChild(div);
|
|
2256
2440
|
});
|
|
2441
|
+
firstEntriesRender = false;
|
|
2257
2442
|
}
|
|
2258
2443
|
|
|
2259
2444
|
function escHtml(s) { return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); }
|
|
@@ -2302,22 +2487,29 @@ function renderStats() {
|
|
|
2302
2487
|
const maxTag = Math.max(...topTags.map(t => t[1]));
|
|
2303
2488
|
const avgQuality = DATA.nodes.reduce((s, n) => s + (n.quality || 0), 0) / DATA.nodes.length;
|
|
2304
2489
|
const maxAccess = Math.max(...DATA.nodes.map(n => n.accessCount || 0));
|
|
2490
|
+
const card = (i, inner) => '<div class="stat-card reveal" style="animation-delay:' + (i * 0.07) + 's">' + inner + '</div>';
|
|
2305
2491
|
|
|
2306
2492
|
grid.innerHTML =
|
|
2307
|
-
'<
|
|
2308
|
-
'<
|
|
2309
|
-
'<
|
|
2310
|
-
'<
|
|
2311
|
-
'<
|
|
2493
|
+
card(0, '<h3>Total Entries</h3><div class="stat-big">' + DATA.totalEntries + '</div>') +
|
|
2494
|
+
card(1, '<h3>Graph Edges</h3><div class="stat-big">' + DATA.edges.length + '</div>') +
|
|
2495
|
+
card(2, '<h3>Avg Quality</h3><div class="stat-big">' + avgQuality.toFixed(2) + '</div>') +
|
|
2496
|
+
card(3, '<h3>Max Access</h3><div class="stat-big">' + maxAccess + '</div>') +
|
|
2497
|
+
card(4, '<h3>Categories</h3><div class="bar-chart">' +
|
|
2312
2498
|
catEntries.map(([cat, count]) =>
|
|
2313
|
-
'<div class="bar-row"><span class="bar-label">' + cat + '</span><div class="bar-track"><div class="bar-fill"
|
|
2499
|
+
'<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>'
|
|
2314
2500
|
).join('') +
|
|
2315
|
-
'</div
|
|
2316
|
-
'<
|
|
2501
|
+
'</div>') +
|
|
2502
|
+
card(5, '<h3>Top Tags</h3><div class="tag-cloud">' +
|
|
2317
2503
|
topTags.map(([tag, count]) =>
|
|
2318
2504
|
'<span class="tag-pill">' + escHtml(tag) + ' <small>(' + count + ')</small></span>'
|
|
2319
2505
|
).join('') +
|
|
2320
|
-
'</div
|
|
2506
|
+
'</div>');
|
|
2507
|
+
|
|
2508
|
+
requestAnimationFrame(() => {
|
|
2509
|
+
grid.querySelectorAll('.bar-fill').forEach(b => {
|
|
2510
|
+
b.style.width = b.getAttribute('data-w') + '%';
|
|
2511
|
+
});
|
|
2512
|
+
});
|
|
2321
2513
|
}
|
|
2322
2514
|
|
|
2323
2515
|
function renderTimeline() {
|
|
@@ -2331,14 +2523,16 @@ function renderTimeline() {
|
|
|
2331
2523
|
});
|
|
2332
2524
|
|
|
2333
2525
|
let html = '<div class="timeline-header">Timeline (' + DATA.totalEntries + ' entries)</div><div class="timeline-track"><div class="timeline-line"></div>';
|
|
2526
|
+
let idx = 0;
|
|
2334
2527
|
for (const [date, entries] of Object.entries(grouped)) {
|
|
2335
2528
|
for (const e of entries) {
|
|
2336
|
-
html += '<div class="timeline-entry
|
|
2529
|
+
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 + '\\')">' +
|
|
2337
2530
|
'<div class="tl-date">' + escHtml(date) + '</div>' +
|
|
2338
2531
|
'<div class="tl-cat" style="color:' + (COLORS[e.category] || 'var(--muted)') + '">' + e.category + '</div>' +
|
|
2339
2532
|
'<div class="tl-key">' + escHtml(e.id) + '</div>' +
|
|
2340
2533
|
'<div class="tl-content">' + escHtml(e.content.substring(0, 100)) + '</div>' +
|
|
2341
2534
|
'</div>';
|
|
2535
|
+
idx++;
|
|
2342
2536
|
}
|
|
2343
2537
|
}
|
|
2344
2538
|
html += '</div>';
|
|
@@ -2406,8 +2600,8 @@ const graph = (function() {
|
|
|
2406
2600
|
const node = g.append('g').selectAll('circle').data(DATA.nodes).join('circle')
|
|
2407
2601
|
.attr('class', 'node-circle')
|
|
2408
2602
|
.attr('r', d => nodeRadius(d))
|
|
2409
|
-
.attr('fill', d => COLORS[d.category] || '
|
|
2410
|
-
.attr('stroke', d => { const c = COLORS[d.category] || '
|
|
2603
|
+
.attr('fill', d => COLORS[d.category] || 'oklch(56% 0.02 270)')
|
|
2604
|
+
.attr('stroke', d => { const c = COLORS[d.category] || 'oklch(56% 0.02 270)'; return c; })
|
|
2411
2605
|
.attr('stroke-width', 1.5)
|
|
2412
2606
|
.attr('stroke-opacity', 0.6)
|
|
2413
2607
|
.call(d3.drag()
|
|
@@ -2595,7 +2789,7 @@ const graph = (function() {
|
|
|
2595
2789
|
const minimapG = minimapSvg.append('g');
|
|
2596
2790
|
minimapG.append('g').attr('class', 'minimap-links');
|
|
2597
2791
|
minimapG.append('g').attr('class', 'minimap-nodes');
|
|
2598
|
-
const minimapViewport = minimapSvg.append('rect').attr('class', 'minimap-viewport').attr('fill', '
|
|
2792
|
+
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);
|
|
2599
2793
|
|
|
2600
2794
|
function getGraphBounds() {
|
|
2601
2795
|
const allX = DATA.nodes.map(n => n.x || 0);
|
|
@@ -2612,11 +2806,11 @@ const graph = (function() {
|
|
|
2612
2806
|
.attr('y1', d => (d.source.y || 0) * minimapScale)
|
|
2613
2807
|
.attr('x2', d => (d.target.x || 0) * minimapScale)
|
|
2614
2808
|
.attr('y2', d => (d.target.y || 0) * minimapScale)
|
|
2615
|
-
.attr('stroke', '
|
|
2809
|
+
.attr('stroke', 'oklch(21% 0.02 270)').attr('stroke-width', 0.5).attr('stroke-opacity', 0.3);
|
|
2616
2810
|
|
|
2617
2811
|
minimapG.select('.minimap-nodes').selectAll('circle').data(DATA.nodes).join('circle')
|
|
2618
2812
|
.attr('cx', d => (d.x || 0) * minimapScale).attr('cy', d => (d.y || 0) * minimapScale)
|
|
2619
|
-
.attr('r', 1.8).attr('fill', d => COLORS[d.category] || '
|
|
2813
|
+
.attr('r', 1.8).attr('fill', d => COLORS[d.category] || 'oklch(56% 0.02 270)').attr('stroke', 'none');
|
|
2620
2814
|
|
|
2621
2815
|
const t = currentTransform;
|
|
2622
2816
|
const containerW = container.clientWidth;
|
|
@@ -2828,37 +3022,37 @@ function resolvePort(portArg) {
|
|
|
2828
3022
|
var MAX_PORT_ATTEMPTS = 20;
|
|
2829
3023
|
function viewer(portArg) {
|
|
2830
3024
|
const startPort = resolvePort(portArg);
|
|
2831
|
-
let port = startPort;
|
|
2832
3025
|
let currentHtml = generateHtml(buildViewerData());
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
3026
|
+
function serveOn(port, attempt) {
|
|
3027
|
+
const server = createServer((_req, res) => {
|
|
3028
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
3029
|
+
res.end(currentHtml);
|
|
3030
|
+
});
|
|
3031
|
+
server.on("error", (err) => {
|
|
3032
|
+
if (err.code === "EADDRINUSE" && attempt < MAX_PORT_ATTEMPTS) {
|
|
3033
|
+
console.log(`Port ${port} in use, trying ${port + 1}...`);
|
|
3034
|
+
serveOn(port + 1, attempt + 1);
|
|
3035
|
+
} else if (err.code === "EADDRINUSE") {
|
|
3036
|
+
console.error(`Port ${port} already in use. Try: toon-memory viewer --port ${port + 1} (or PORT=${port + 1} toon-memory viewer)`);
|
|
3037
|
+
process.exit(1);
|
|
3038
|
+
} else {
|
|
3039
|
+
console.error(`Server error: ${err.message}`);
|
|
3040
|
+
process.exit(1);
|
|
3041
|
+
}
|
|
3042
|
+
});
|
|
3043
|
+
server.listen(port, "127.0.0.1", () => {
|
|
3044
|
+
const url = `http://127.0.0.1:${port}`;
|
|
3045
|
+
const data = buildViewerData();
|
|
3046
|
+
console.log(`
|
|
2854
3047
|
toon-memory viewer`);
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
3048
|
+
console.log(` Entries: ${data.totalEntries} | Edges: ${data.edges.length}`);
|
|
3049
|
+
console.log(` Serving at: ${url}`);
|
|
3050
|
+
console.log(` Press 'r' in terminal to reload | Ctrl+C to stop
|
|
2858
3051
|
`);
|
|
2859
|
-
|
|
3052
|
+
openBrowser(url);
|
|
3053
|
+
});
|
|
2860
3054
|
}
|
|
2861
|
-
|
|
3055
|
+
serveOn(startPort, 1);
|
|
2862
3056
|
if (process.stdin.isTTY) {
|
|
2863
3057
|
process.stdin.setRawMode?.(true);
|
|
2864
3058
|
process.stdin.resume();
|