cortico-world-memory-core 0.25.0 → 0.27.0

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.
@@ -0,0 +1,116 @@
1
+ .atlas-app { --k-episode:#92bafa; --k-note:#e3a2ba; --k-promise:#e9c388; }
2
+ .atlas-app .next-app { height:100dvh; grid-template-rows:auto auto minmax(0,1fr) auto; }
3
+ .atlas-app .rail-sign,.atlas-app .next-metrics,.atlas-app .node-status,.atlas-app #tab-graph,.atlas-app #tab-table,.atlas-app #tab-timeline,.atlas-app #btn-filters { display:none; }
4
+ .atlas-app .next-topbar { padding:12px clamp(12px,2vw,32px); gap:16px; background:var(--paper); }
5
+ .atlas-app .next-search { flex:1 1 230px; max-width:500px; }
6
+ .atlas-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:10px clamp(12px,2vw,32px); border-bottom:1px solid var(--line); background:var(--paper-2); }
7
+ .atlas-toolbar strong { font-size:16px; } .atlas-toolbar select,.atlas-zoom button { color:var(--ink); background:var(--sheet); border:1px solid var(--line-2); border-radius:6px; padding:5px 9px; }
8
+ #atlas-kinds { display:flex; gap:3px; flex-wrap:wrap; } #atlas-kinds button { display:flex; align-items:center; gap:5px; padding:5px 9px; color:var(--ink-soft); border:1px solid transparent; background:none; border-radius:6px; } #atlas-kinds i { width:6px; height:6px; border-radius:50%; background:var(--dot); } #atlas-kinds [aria-pressed="true"] { color:var(--ink); border-color:var(--line-2); background:var(--sheet-2); } #atlas-filter { margin-inline-start:auto; }
9
+ .atlas-app .next-workspace { grid-template-columns:minmax(0,1fr) minmax(300px,clamp(300px,26vw,395px)); padding:14px clamp(12px,2vw,32px); gap:14px; background:var(--paper); }
10
+ .atlas-app[data-insp="off"] .next-workspace { grid-template-columns:minmax(0,1fr) 46px; }
11
+ .atlas-app .next-stage,.atlas-app .next-inspector { border:1px solid var(--line); border-radius:12px; background:var(--sheet); }
12
+ .atlas-app .next-stage { min-width:0; min-height:0; overflow:hidden; }
13
+ .atlas-app .next-rail { display:none; position:fixed; inset:0 auto 0 0; width:min(320px,86vw); overflow:auto; z-index:45; background:var(--paper); padding:16px; box-shadow:0 6px 24px #0006; }
14
+ .atlas-app[data-filters="open"] .next-rail { display:block; visibility:visible; transform:none; } .atlas-app[data-filters="open"] .drawer-backdrop { display:block; }
15
+ .atlas-app:not([data-area="library"]) .atlas-toolbar { display:none; }
16
+ .atlas-app:not([data-area="library"]) .next-app { grid-template-rows:auto minmax(0,1fr) auto; }
17
+ .atlas-app:is([data-area="turns"],[data-area="health"]) .next-workspace { grid-template-columns:minmax(0,1fr); }
18
+ .atlas-app:is([data-area="turns"],[data-area="health"]) :is(.next-inspector,#btn-details),.atlas-app[data-area="health"] .next-search { display:none; }
19
+ .atlas-app #view-galaxy:not([hidden]) { display:grid; grid-template-rows:minmax(0,1fr) auto; padding:0; height:100%; }
20
+ .atlas-field {
21
+ position:relative; min-height:0; overflow:hidden; isolation:isolate;
22
+ background:
23
+ radial-gradient(ellipse 48% 32% at 23% 40%,#4a69736e,transparent 88%),
24
+ radial-gradient(ellipse 46% 37% at 68% 62%,#426a7873,transparent 90%),
25
+ radial-gradient(ellipse 25% 33% at 83% 25%,#635b763d,transparent 93%),
26
+ radial-gradient(ellipse 32% 46% at 34% 76%,#3a644c35,transparent 95%),
27
+ linear-gradient(151deg,#131f30,#1e3044 54%,#101c2b);
28
+ }
29
+ .atlas-title { position:absolute; left:20px; top:16px; color:#edf5ff; pointer-events:none; } .atlas-title small,.atlas-read-head small,.atlas-source>small { letter-spacing:.16em; color:var(--accent); font:11px/1.4 var(--mono); } .atlas-title small { color:#abdcf6; letter-spacing:.18em; } .atlas-title h1 { font-size:clamp(18px,2.1vw,31px); margin:3px 0 0; font-weight:600; letter-spacing:.06em; }
30
+ .atlas-foot,.atlas-zoom { display:flex; gap:8px; align-items:center; } .atlas-foot { justify-content:space-between; padding:9px 16px; border-top:1px solid var(--line); } .atlas-foot small { display:block; color:var(--ink-soft); } .atlas-zoom output { font:12px var(--mono); } .atlas-zoom button { min-height:32px; }
31
+ .atlas-app .insp-body { padding:16px; } .atlas-read-head { position:relative; border-bottom:1px solid var(--line); padding-bottom:12px; } .atlas-read-head h2 { margin:4px 0 0; font-size:21px; } .atlas-read-head button { position:absolute; right:0; top:0; }
32
+ .atlas-group { margin:17px 0; } .atlas-group h3 { font-size:13px; color:var(--ink-soft); margin:0 0 6px; } .atlas-group button { display:block; width:100%; padding:8px 0; border:none; border-bottom:1px solid var(--line); background:none; text-align:left; } .atlas-group button:hover span { color:var(--accent); } .atlas-group small,.atlas-quote small { color:var(--ink-soft); } .atlas-group span { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:14px; }
33
+ .atlas-return { background:none; color:var(--accent); border:0; padding:0 0 10px; } .atlas-source,.atlas-quote { padding:12px; border:1px solid var(--line); border-radius:8px; margin:12px 0; } .atlas-source blockquote,.atlas-quote p { margin:6px 0; white-space:pre-wrap; overflow-wrap:anywhere; } .atlas-quote.anchor { border-color:var(--accent); }
34
+ @media(max-width:899px){ .atlas-app .next-topbar { display:flex; flex-wrap:wrap; gap:6px 10px; } .atlas-app .next-brand-copy { display:block; } .atlas-app .next-brand-copy span { display:none; } .atlas-app .next-search { order:3; flex:1 1 180px; max-width:none; } .atlas-app .next-actions { order:4; width:auto; } .atlas-app .next-tabs { order:2; margin-left:auto; } .atlas-app .next-tabs .next-tab span { display:inline; } .atlas-app .next-tabs .next-tab::after { display:none; }
35
+ .atlas-app .next-workspace,.atlas-app[data-insp="off"] .next-workspace { grid-template-columns:minmax(0,1fr); padding:8px; gap:0; } .atlas-app .next-inspector { display:none; } .atlas-app[data-insp="on"]:not([data-area="turns"]):not([data-area="health"]) .next-inspector { display:flex; position:fixed; inset:auto 0 0; z-index:43; width:100%; max-width:100%; height:min(68dvh,640px); background:var(--sheet); visibility:visible; transform:none; border-radius:14px 14px 0 0; box-shadow:0 -8px 28px #0006; } .atlas-app[data-insp="on"]:is([data-area="library"],[data-area="docs"]) .drawer-backdrop { display:block; } .atlas-app #btn-details { display:inline-flex; } .atlas-app .insp-stub { display:none !important; } .atlas-toolbar { gap:7px; } #atlas-kinds button,.atlas-zoom button { min-height:40px; }
36
+ }
37
+ @media(max-width:600px){ .atlas-toolbar strong { display:none; } #atlas-kinds { order:3; flex-basis:100%; } .atlas-foot small { display:none; } .atlas-foot { flex-wrap:wrap; } .atlas-title { top:10px; left:12px; } .atlas-app .next-topbar { padding:7px 10px; } .atlas-app .next-statusbar { font-size:10px; } }
38
+
39
+ .atlas-app { --acid:var(--accent); }
40
+ .atlas-app::before,.atlas-app::after,.atlas-app .next-stage::before,.atlas-app .next-stage::after,.atlas-app .next-topbar::after { display:none; }
41
+ .atlas-app .next-brand-copy strong,.atlas-app .atlas-read-head h2 { text-shadow:none; }
42
+ .atlas-app .next-btn.primary { background:var(--accent); color:var(--on-accent); border:0; border-radius:6px; box-shadow:none; clip-path:none; }
43
+ .atlas-app .next-tab.active { color:var(--accent); box-shadow:inset 0 -2px var(--accent); background:var(--sheet-2); text-shadow:none; }
44
+ .atlas-app.cg-glitch .next-stage { animation:none; }
45
+ .atlas-app .next-search [hidden] { display:none; }
46
+ .atlas-app .next-inspector .atlas-group h3::before { content:none; }
47
+ .atlas-app .atlas-group h3 { border-left:2px solid var(--accent); padding-left:8px; }
48
+ .atlas-more { color:var(--ink-soft); }
49
+ .atlas-more summary { cursor:pointer; padding:4px 6px; }
50
+ .atlas-more[open] .btn { margin:4px 0; }
51
+ .atlas-app :focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
52
+ .atlas-actions { display:flex; align-items:center; gap:8px; margin-inline-start:auto; }
53
+ .story-legend { display:flex; flex-wrap:wrap; gap:2px 14px; color:var(--ink-soft); font-size:12px; }
54
+ .story-legend span::before { content:''; display:inline-block; width:16px; margin-inline-end:6px; border-top:1px solid currentColor; vertical-align:middle; }
55
+ .story-legend span + span::before { border-top-style:dashed; }
56
+ .atlas-field #orbit-galaxy { position:absolute; inset:0; width:100%; height:100%; touch-action:none; cursor:grab; }
57
+ .orbit-sector { position:absolute; top:0; left:0; margin:8px 0 0 11px; padding:2px 6px; border:1px solid color-mix(in srgb,var(--signal) 44%,transparent); border-radius:4px; background:#121d2cdb; color:var(--signal); font-size:12px; line-height:1.4; white-space:nowrap; pointer-events:none; }
58
+ .orbit-sector::before { content:''; position:absolute; top:-4px; left:-9px; width:9px; border-top:1px solid var(--signal); transform:rotate(35deg); opacity:.7; }
59
+ #orbit-label { position:absolute; top:0; left:0; width:max-content; max-width:min(175px,45%); margin:-30px 0 0 10px; padding:4px 8px; border-left:1px solid var(--signal); background:#0a1320ee; color:#eef4ff; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; pointer-events:none; }
60
+ #orbit-label.label-left { left:auto; right:100%; margin:-30px 10px 0 0; border:0; border-right:1px solid var(--signal); }
61
+ @media(max-width:520px){ [data-immersive] .atlas-title small { display:none; } }
62
+
63
+ #story-inspector-close,#story-inspector-name { display:none; }
64
+ .atlas-app[data-immersive] { overflow:hidden; --edge:clamp(10px,2vw,26px); }
65
+ [data-immersive] .next-app { grid-template-rows:auto auto minmax(0,1fr); }
66
+ .atlas-app[data-immersive] :is(.next-topbar,.atlas-toolbar) { position:relative; z-index:2; padding:8px var(--edge) 0; gap:8px; border:0; box-shadow:none; background:none; backdrop-filter:none; pointer-events:none; }
67
+ [data-immersive] :is(.next-search,.next-tabs,.next-actions button,.atlas-toolbar select,#atlas-kinds,.atlas-actions) { pointer-events:auto; }
68
+ [data-immersive] .next-brand { color:#edf4ff; min-width:max-content; }
69
+ [data-immersive] #brand-sub,[data-immersive] .atlas-toolbar strong,[data-immersive] .next-statusbar,[data-immersive] .classic-inspector-name { display:none; }
70
+ [data-immersive] .next-search { flex:1 1 180px; max-width:360px; }
71
+ [data-immersive] .next-actions { width:auto; margin-inline-start:auto; }
72
+ [data-immersive] .next-tabs { margin:0; }
73
+ [data-immersive] :is(.next-search,.next-tabs,.next-actions button:not(.primary),#atlas-kinds,.atlas-zoom,#atlas-mode,#atlas-filter) { color:var(--ink); background:color-mix(in srgb,var(--paper-2) 92%,transparent); border:1px solid var(--line-2); border-radius:7px; }
74
+ [data-immersive] :is(.next-search,.next-tabs,#atlas-kinds,.atlas-zoom,#atlas-mode,#atlas-filter) { backdrop-filter:blur(8px); }
75
+ [data-immersive] .next-actions button:hover:not(.primary) { background:var(--sheet-3); }
76
+ [data-immersive] .next-actions #btn-details { display:inline-flex; width:auto; height:34px; padding:0 9px; font-size:12px; white-space:nowrap; }
77
+ [data-immersive] #story-inspector-name { display:inline; }
78
+ [data-immersive] #atlas-kinds { padding:2px 4px; flex:0 1 auto; order:initial; }
79
+ .atlas-app[data-immersive] .next-workspace { position:absolute; inset:0; display:block; padding:0; background:#131f30; }
80
+ .atlas-app[data-immersive] .next-stage { position:absolute; inset:0; border:0; border-radius:0; }
81
+ .atlas-app[data-immersive] #view-galaxy:not([hidden]) { display:block; }
82
+ [data-immersive] .atlas-field { position:absolute; inset:0; }
83
+ [data-immersive] #orbit-galaxy:focus-visible { outline-offset:-3px; }
84
+ [data-immersive] .atlas-title { inset:auto auto 68px var(--edge); }
85
+ [data-immersive] .atlas-title h1 { font-size:23px; letter-spacing:0; }
86
+ [data-immersive] .atlas-foot { position:absolute; inset:auto var(--edge) 14px; align-items:flex-end; padding:0; border:0; pointer-events:none; color:#c7d4e6; }
87
+ [data-immersive] .atlas-foot :is(small,.story-legend) { color:#aab8ce; }
88
+ [data-immersive] .atlas-zoom { pointer-events:auto; padding:4px; gap:4px; }
89
+ [data-immersive] .atlas-zoom output { min-width:43px; text-align:center; }
90
+ .atlas-app[data-immersive] .next-inspector { display:none; }
91
+ .atlas-app[data-immersive][data-insp="on"] .next-inspector {
92
+ --ink:#edf4ff; --ink-soft:#b8c7db; --ink-dim:#a1b3cb; --accent:#83dfd0; --sheet:#101a2a; --sheet-2:#172337; --sheet-3:#1b2d47; --line:#b2c9e32b; --line-2:#b2c9e34d;
93
+ display:flex; position:absolute; inset:104px var(--edge) auto auto; z-index:43; width:min(410px,calc(100% - 2 * var(--edge))); max-width:none; height:auto; max-height:min(85dvh,calc(100dvh - 120px));
94
+ visibility:visible; transform:none; border:1px solid var(--line-2); border-radius:8px; background:rgb(10 17 29 / .88); color:var(--ink); color-scheme:dark; backdrop-filter:blur(9px); box-shadow:0 14px 44px #0008;
95
+ }
96
+ [data-immersive] .insp-body { padding:16px; overscroll-behavior:contain; }
97
+ [data-immersive] .insp-body > :first-child { margin-inline-end:42px; }
98
+ [data-immersive] .insp-body :is(#btn-insp-collapse,.atlas-read-head button) { display:none; }
99
+ [data-immersive] #story-inspector-close { display:grid; place-items:center; position:absolute; inset:7px 9px auto auto; z-index:1; width:38px; height:38px; background:#101a2a; border:1px solid var(--line-2); color:var(--ink); font-size:23px; }
100
+ .atlas-app[data-immersive][data-filters="closed"] .drawer-backdrop { display:none; }
101
+ @media(max-width:980px) {
102
+ [data-immersive] .next-search { order:3; max-width:none; }
103
+ [data-immersive] .next-actions { order:4; }
104
+ }
105
+ @media(max-width:740px) {
106
+ .atlas-app[data-immersive][data-insp="on"] .next-inspector { inset:auto 0 0; width:100%; height:auto; max-height:55dvh; border-radius:8px 8px 0 0; }
107
+ [data-immersive] .next-brand { flex:1; }
108
+ [data-immersive] .next-search { flex:1 1 100%; order:4; }
109
+ [data-immersive] .next-actions { order:3; }
110
+ [data-immersive] .atlas-title { bottom:46px; }
111
+ [data-immersive] .atlas-title h1 { font-size:19px; }
112
+ [data-immersive] .atlas-foot { bottom:9px; flex-wrap:nowrap; align-items:center; }
113
+ [data-immersive] .atlas-foot :is(small,.story-legend) { display:none; }
114
+ [data-immersive] .atlas-foot b { font-size:11px; font-weight:500; }
115
+ [data-immersive] #atlas-kinds { order:3; }
116
+ }
package/webui/index.html CHANGED
@@ -5,8 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>记忆地图 · 记忆核心</title>
7
7
  <link rel="stylesheet" href="/style.css" />
8
+ <link rel="stylesheet" href="/turns.css" />
8
9
  </head>
9
- <body>
10
+ <body data-filters="closed" data-insp="off">
11
+ <a class="skip-link" href="#main-content">跳到主内容</a>
10
12
  <div class="app">
11
13
  <header class="topbar">
12
14
  <div class="brand">
@@ -19,21 +21,23 @@
19
21
 
20
22
  <div class="searchbox" role="search">
21
23
  <svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="9" cy="9" r="6"></circle><path d="M13.5 13.5 17 17"></path></svg>
22
- <input id="search" type="search" placeholder="搜记忆、对话、文件…(/ 或 ⌘K)" autocomplete="off" spellcheck="false" />
24
+ <input id="search" type="search" placeholder="搜记忆、对话、文件…(/ 或 ⌘K)" autocomplete="off" spellcheck="false" aria-label="搜索记忆、对话、文件" />
23
25
  <button id="search-clear" class="icon-btn tiny" title="清空 (Esc)" aria-label="清空搜索" hidden>×</button>
24
26
  </div>
25
27
 
26
28
  <nav class="tabs" id="tabs" role="tablist" aria-label="视图">
27
- <button role="tab" data-view="galaxy" data-letter="星" class="tab active" title="星图 (1)"><span>星图</span></button>
28
- <button role="tab" data-view="graph" data-letter="图" class="tab" title="图谱 (2)"><span>图谱</span></button>
29
- <button role="tab" data-view="timeline" data-letter="线" class="tab" title="时间线 (3)"><span>时间线</span></button>
30
- <button role="tab" data-view="table" data-letter="表" class="tab" title="列表 (4)"><span>列表</span></button>
31
- <button role="tab" data-view="turns" data-letter="文" class="tab" title="对话原文 (5)"><span>原文</span></button>
32
- <button role="tab" data-view="docs" data-letter="件" class="tab" title="工作区文件 (6)"><span>文件</span></button>
33
- <button role="tab" data-view="health" data-letter="检" class="tab" title="体检 (7)"><span>体检</span></button>
29
+ <button role="tab" id="tab-galaxy" aria-controls="view-galaxy" aria-selected="true" tabindex="0" data-view="galaxy" data-letter="星" class="tab active" title="星图 (1)"><span>星图</span></button>
30
+ <button role="tab" id="tab-graph" aria-controls="view-graph" aria-selected="false" tabindex="-1" data-view="graph" data-letter="图" class="tab" title="图谱 (2)"><span>图谱</span></button>
31
+ <button role="tab" id="tab-timeline" aria-controls="view-timeline" aria-selected="false" tabindex="-1" data-view="timeline" data-letter="线" class="tab" title="时间线 (3)"><span>时间线</span></button>
32
+ <button role="tab" id="tab-table" aria-controls="view-table" aria-selected="false" tabindex="-1" data-view="table" data-letter="表" class="tab" title="列表 (4)"><span>列表</span></button>
33
+ <button role="tab" id="tab-turns" aria-controls="view-turns" aria-selected="false" tabindex="-1" data-view="turns" data-letter="文" class="tab" title="对话原文 (5)"><span>原文</span></button>
34
+ <button role="tab" id="tab-docs" aria-controls="view-docs" aria-selected="false" tabindex="-1" data-view="docs" data-letter="件" class="tab" title="工作区文件 (6)"><span>文件</span></button>
35
+ <button role="tab" id="tab-health" aria-controls="view-health" aria-selected="false" tabindex="-1" data-view="health" data-letter="检" class="tab" title="体检 (7)"><span>体检</span></button>
34
36
  </nav>
35
37
 
36
38
  <div class="top-actions">
39
+ <button id="btn-filters" class="icon-btn mobile-only" title="筛选" aria-label="打开筛选" aria-controls="rail" aria-expanded="false">筛</button>
40
+ <button id="btn-details" class="icon-btn mobile-only" title="详情" aria-label="打开详情" aria-controls="inspector" aria-expanded="false">详</button>
37
41
  <button id="btn-new" class="btn primary" title="新建记忆 (n)">+ 记忆</button>
38
42
  <button id="btn-refresh" class="icon-btn" title="刷新 (r)" aria-label="刷新">
39
43
  <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M16 10a6 6 0 1 1-1.8-4.3"></path><path d="M16 3.5V7h-3.5"></path></svg>
@@ -45,10 +49,10 @@
45
49
 
46
50
  <section class="metrics" id="metrics" aria-label="概览"></section>
47
51
 
48
- <main class="workspace">
52
+ <main class="workspace" id="main-content" tabindex="-1">
49
53
  <aside class="rail" id="rail" aria-label="筛选"></aside>
50
54
  <section class="stage" id="stage">
51
- <div class="view" id="view-graph">
55
+ <div class="view" id="view-graph" role="tabpanel" aria-labelledby="tab-graph" tabindex="0">
52
56
  <canvas id="graph"></canvas>
53
57
  <div class="graph-hud">
54
58
  <div class="legend" id="graph-legend"></div>
@@ -64,12 +68,12 @@
64
68
  <p class="dim">聊几句,或者点右上角「+ 记忆」。</p>
65
69
  </div>
66
70
  </div>
67
- <div class="view" id="view-timeline" hidden></div>
68
- <div class="view" id="view-table" hidden></div>
69
- <div class="view" id="view-turns" hidden></div>
70
- <div class="view" id="view-docs" hidden></div>
71
- <div class="view" id="view-health" hidden></div>
72
- <div class="view" id="view-galaxy" hidden>
71
+ <div class="view" id="view-timeline" role="tabpanel" aria-labelledby="tab-timeline" tabindex="0" hidden></div>
72
+ <div class="view" id="view-table" role="tabpanel" aria-labelledby="tab-table" tabindex="0" hidden></div>
73
+ <div class="view" id="view-turns" role="tabpanel" aria-labelledby="tab-turns" tabindex="0" hidden></div>
74
+ <div class="view" id="view-docs" role="tabpanel" aria-labelledby="tab-docs" tabindex="0" hidden></div>
75
+ <div class="view" id="view-health" role="tabpanel" aria-labelledby="tab-health" tabindex="0" hidden></div>
76
+ <div class="view" id="view-galaxy" role="tabpanel" aria-labelledby="tab-galaxy" tabindex="0" hidden>
73
77
  <div class="galaxy-wrap">
74
78
  <canvas id="galaxy"></canvas>
75
79
  <div class="galaxy-scan"></div>
@@ -105,6 +109,8 @@
105
109
  </footer>
106
110
  </div>
107
111
 
112
+ <div class="drawer-backdrop" id="drawer-backdrop" aria-hidden="true"></div>
113
+
108
114
  <div class="modal" id="modal" hidden>
109
115
  <div class="modal-panel" role="dialog" aria-modal="true" aria-labelledby="modal-title">
110
116
  <header><h2 id="modal-title">新建记忆</h2><button class="icon-btn" id="modal-close" aria-label="关闭">×</button></header>
@@ -113,7 +119,7 @@
113
119
  </div>
114
120
  </div>
115
121
 
116
- <div class="toast" id="toast" hidden></div>
122
+ <div class="toast" id="toast" role="status" aria-live="polite" aria-atomic="true" hidden></div>
117
123
  <div class="menu" id="menu" hidden></div>
118
124
  <script src="/app.js" type="module"></script>
119
125
  </body>
package/webui/next.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /* 记忆核心新版:保留旧页面功能,换成神经记忆星系的视觉皮肤。 */
2
2
  :root {
3
3
  --paper: #070b14; --paper-2: #0b1220; --sheet: #101a2a; --sheet-2: #142238; --sheet-3: #1b2d47;
4
- --ink: #edf4ff; --ink-soft: #aab8ce; --ink-dim: #667791; --line: rgba(143, 182, 224, .16); --line-2: rgba(143, 182, 224, .28); --line-strong: rgba(143, 182, 224, .5);
4
+ --ink: #edf4ff; --ink-soft: #aab8ce; --ink-dim: #667791; --faint: #71849f; --line: rgba(143, 182, 224, .16); --line-2: rgba(143, 182, 224, .28); --line-strong: rgba(143, 182, 224, .5);
5
5
  --accent: #61e3cf; --accent-2: #9ae9de; --on-accent: #071c1b; --ok: #61e3cf; --warn: #f2c978; --danger: #ff9eaa;
6
6
  --chart-1: #61e3cf; --chart-2: #c9a2ff; --chart-3: #78c8ff; --chart-4: #77d8c3; --chart-5: #f2c978; --chart-6: #e69ac7; --chart-7: #9ab8da; --chart-8: #b6a6ff;
7
7
  --k-fact: #61e3cf; --k-self: #c9a2ff; --k-episode: #78c8ff; --k-promise: #f2c978; --k-note: #9ab8da;
@@ -9,8 +9,8 @@
9
9
  }
10
10
  html[data-mode="light"] {
11
11
  --paper: #eef3f6; --paper-2: #e5edf2; --sheet: #f8fbfc; --sheet-2: #edf4f7; --sheet-3: #dbe8ee;
12
- --ink: #172532; --ink-soft: #536a79; --ink-dim: #78909f; --line: rgba(56, 98, 119, .2); --line-2: rgba(56, 98, 119, .34); --line-strong: rgba(36, 117, 125, .58);
13
- --accent: #168f83; --accent-2: #237e79; --on-accent: #f3fffd; --ok: #168f83; --warn: #a56f19; --danger: #ba4d59;
12
+ --ink: #172532; --ink-soft: #536a79; --ink-dim: #566c7a; --faint: #5a6f83; --line: rgba(56, 98, 119, .2); --line-2: rgba(56, 98, 119, .34); --line-strong: rgba(36, 117, 125, .58);
13
+ --accent: #0b6f66; --accent-2: #237e79; --on-accent: #f3fffd; --ok: #0b6f66; --warn: #8a5a0f; --danger: #a63a46;
14
14
  --chart-1: #168f83; --chart-2: #8054b5; --chart-3: #287eae; --chart-4: #278d79; --chart-5: #a56f19; --chart-6: #ac4e85; --chart-7: #587d9a; --chart-8: #7159b5;
15
15
  --k-fact: #168f83; --k-self: #8054b5; --k-episode: #287eae; --k-promise: #a56f19; --k-note: #587d9a;
16
16
  color-scheme: light;
@@ -290,6 +290,9 @@ body::after {
290
290
  .maint-main { display: grid; gap: 3px; min-width: 0; }
291
291
  .maint-text { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
292
292
  .maint-meta { font: 10px var(--mono); color: var(--faint); }
293
+ .maint-row.keep-suggestion { grid-template-columns: minmax(0, 1fr); }
294
+ .keep-suggestion .maint-act { display: flex; flex-wrap: wrap; gap: 6px; }
295
+ .keep-suggestion-copy { overflow-wrap: anywhere; }
293
296
  .maint-empty { margin: 6px 0; font-size: 12px; color: var(--ink-dim); }
294
297
  .due-input {
295
298
  width: 186px;
@@ -364,8 +367,8 @@ body::after {
364
367
 
365
368
  /* 浅色主题:酸黄在白底上读不清,换成深金;面板改成浅玻璃 */
366
369
  html[data-mode="light"] .h-card { background: linear-gradient(160deg, #ffffff, #edf4f8); }
367
- html[data-mode="light"] .h-value { color: #8a6a00; text-shadow: none; }
368
- html[data-mode="light"] .h-card.warn .h-value { color: #8a5a00; }
370
+ html[data-mode="light"] .h-value { color: #7a5a00; text-shadow: none; }
371
+ html[data-mode="light"] .h-card.warn .h-value { color: #7a5a00; }
369
372
  html[data-mode="light"] .h-block { background: rgba(255, 255, 255, .7); }
370
373
  html[data-mode="light"] .h-block::before { background: rgba(22, 143, 131, .45); }
371
374
  html[data-mode="light"] .h-bar i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
@@ -624,7 +627,7 @@ html[data-mode="light"] .bg-layer:not(.has-image) { background-image: none !impo
624
627
  html[data-mode="light"] .metric .value { color: #12313d; text-shadow: none; }
625
628
  html[data-mode="light"] .metric .label { color: #a8336a; }
626
629
  html[data-mode="light"] .metric.ok .value { color: #168f83; }
627
- html[data-mode="light"] .metric.warn .value { color: #8a6a00; }
630
+ html[data-mode="light"] .metric.warn .value { color: #7a5a00; }
628
631
  html[data-mode="light"] .spark i { background: linear-gradient(180deg, #c2185b, rgba(194, 24, 91, .22)); }
629
632
 
630
633
  /* 浅色:背景层直接不参与渲染,顶部/底部条改不透明,避免透出深色 */
@@ -640,7 +643,7 @@ html[data-mode="light"] body { background-color: #eef3f6; }
640
643
  html[data-mode="light"] .next-brand-copy strong { color: #172532; text-shadow: 1px 0 rgba(194, 24, 91, .35), -1px 0 rgba(22, 143, 131, .3); }
641
644
  html[data-mode="light"] .next-rail h3::before,
642
645
  html[data-mode="light"] #insp-body h3::before,
643
- html[data-mode="light"] .h-block h3::before { color: #8a6a00; }
646
+ html[data-mode="light"] .h-block h3::before { color: #7a5a00; }
644
647
 
645
648
  /* 浅色:侧栏筛选块、状态卡、HUD、搜索聚焦、次级按钮原来都是硬编码深底 */
646
649
  html[data-mode="light"] .chip { background: #fff; border-color: var(--line-2); }
@@ -661,4 +664,151 @@ html[data-mode="light"] .card-text { background: #fff; }
661
664
  .due-late { flex: none; color: var(--acid); font: 10px var(--mono); letter-spacing: .04em; }
662
665
  .due-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
663
666
  .due-count { flex: none; color: var(--faint); font: 10px var(--mono); }
664
- html[data-mode="light"] .due-late { color: #8a6a00; }
667
+ html[data-mode="light"] .due-late { color: #7a5a00; }
668
+
669
+ /* ── 基础无障碍与窄屏抽屉 ───────────────────────────── */
670
+
671
+ .skip-link {
672
+ position: fixed;
673
+ left: 12px;
674
+ top: 10px;
675
+ z-index: 100;
676
+ padding: 7px 11px;
677
+ border: 1px solid var(--accent);
678
+ border-radius: 2px;
679
+ background: var(--sheet);
680
+ color: var(--ink);
681
+ transform: translateY(-160%);
682
+ transition: transform .15s ease;
683
+ }
684
+ .skip-link:focus {
685
+ transform: translateY(0);
686
+ }
687
+
688
+ button:focus-visible,
689
+ a:focus-visible,
690
+ input:focus-visible,
691
+ textarea:focus-visible,
692
+ select:focus-visible,
693
+ [tabindex]:focus-visible {
694
+ outline: 2px solid var(--accent);
695
+ outline-offset: 2px;
696
+ }
697
+
698
+ .mobile-only {
699
+ display: none;
700
+ }
701
+
702
+ .drawer-backdrop {
703
+ position: fixed;
704
+ inset: 0;
705
+ z-index: 42;
706
+ display: none;
707
+ background: rgb(0 0 0 / .5);
708
+ cursor: pointer;
709
+ }
710
+
711
+ @media (max-width: 980px) {
712
+ .mobile-only {
713
+ display: inline-flex;
714
+ }
715
+ #btn-details {
716
+ display: none;
717
+ }
718
+ .next-workspace {
719
+ grid-template-columns: minmax(0, 1fr) var(--insp-w);
720
+ }
721
+ .next-topbar {
722
+ flex-wrap: wrap;
723
+ gap: 8px;
724
+ }
725
+ .next-search {
726
+ order: 3;
727
+ flex: 1 1 100%;
728
+ max-width: none;
729
+ }
730
+ .next-tabs {
731
+ order: 2;
732
+ margin-left: auto;
733
+ }
734
+ .next-actions {
735
+ order: 4;
736
+ width: 100%;
737
+ margin-left: 0;
738
+ }
739
+ .next-rail {
740
+ position: fixed;
741
+ inset: 0 auto 0 0;
742
+ z-index: 43;
743
+ display: block;
744
+ width: min(320px, 86vw);
745
+ max-width: 100%;
746
+ border-right: 1px solid var(--line-2);
747
+ background: var(--paper);
748
+ box-shadow: 12px 0 30px rgb(0 0 0 / .35);
749
+ visibility: hidden;
750
+ transform: translateX(-105%);
751
+ transition: transform .18s ease, visibility .18s ease;
752
+ }
753
+ body[data-filters="open"] .next-rail {
754
+ visibility: visible;
755
+ transform: translateX(0);
756
+ }
757
+ body[data-filters="open"] .drawer-backdrop {
758
+ display: block;
759
+ }
760
+ }
761
+
762
+ @media (max-width: 760px) {
763
+ #btn-details {
764
+ display: inline-flex;
765
+ }
766
+ .next-workspace {
767
+ --insp-w: 0px;
768
+ grid-template-columns: minmax(0, 1fr);
769
+ }
770
+ .next-inspector {
771
+ position: fixed;
772
+ inset: 0 0 0 auto;
773
+ z-index: 43;
774
+ display: flex;
775
+ width: min(390px, 92vw);
776
+ max-width: 100%;
777
+ border-left: 1px solid var(--line-2);
778
+ background: var(--paper);
779
+ box-shadow: -12px 0 30px rgb(0 0 0 / .35);
780
+ visibility: hidden;
781
+ transform: translateX(105%);
782
+ transition: transform .18s ease, visibility .18s ease;
783
+ }
784
+ body[data-insp="on"] .next-inspector {
785
+ visibility: visible;
786
+ transform: translateX(0);
787
+ }
788
+ body[data-insp="on"] .drawer-backdrop {
789
+ display: block;
790
+ }
791
+ .insp-stub {
792
+ display: none !important;
793
+ }
794
+ .next-actions {
795
+ width: 100%;
796
+ margin-left: 0;
797
+ }
798
+ }
799
+
800
+ html[data-mode="light"] tr.retired td,
801
+ html[data-mode="light"] .tl-item.retired {
802
+ opacity: .72;
803
+ }
804
+
805
+ @media (prefers-reduced-motion: reduce) {
806
+ *,
807
+ *::before,
808
+ *::after {
809
+ animation-duration: .01ms !important;
810
+ animation-iteration-count: 1 !important;
811
+ scroll-behavior: auto !important;
812
+ transition-duration: .01ms !important;
813
+ }
814
+ }
package/webui/next.html CHANGED
@@ -3,10 +3,13 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>记忆核心 · 新版星系</title>
6
+ <title>记忆核心 · 记忆星图</title>
7
7
  <link rel="stylesheet" href="/next.css" />
8
+ <link rel="stylesheet" href="/turns.css" />
9
+ <link rel="stylesheet" href="/atlas.css" />
8
10
  </head>
9
- <body>
11
+ <body class="atlas-app" data-area="library" data-filters="closed" data-insp="off">
12
+ <a class="skip-link" href="#main-content">跳到主内容</a>
10
13
  <div class="rail-sign" aria-hidden="true">NEURAL ARCHIVE</div>
11
14
  <div class="next-app">
12
15
  <header class="next-topbar">
@@ -16,20 +19,22 @@
16
19
  </div>
17
20
  <div class="next-search" role="search">
18
21
  <span class="search-icon">⌕</span>
19
- <input id="search" type="search" placeholder="搜索记忆、对话、文件…" autocomplete="off" spellcheck="false" />
22
+ <input id="search" type="search" placeholder="搜索记忆、对话、文件…" autocomplete="off" spellcheck="false" aria-label="搜索记忆、对话、文件" />
20
23
  <span class="search-key">/</span>
21
24
  <button id="search-clear" class="next-icon" title="清空搜索" aria-label="清空搜索" hidden>×</button>
22
25
  </div>
23
26
  <nav class="tab next-tabs" id="tabs" role="tablist" aria-label="视图">
24
- <button role="tab" data-view="galaxy" data-letter="星" class="tab next-tab active" title="星图"><span>星图</span></button>
25
- <button role="tab" data-view="graph" data-letter="图" class="tab next-tab" title="图谱"><span>图谱</span></button>
26
- <button role="tab" data-view="timeline" data-letter="线" class="tab next-tab" title="时间线"><span>时间线</span></button>
27
- <button role="tab" data-view="table" data-letter="表" class="tab next-tab" title="列表"><span>列表</span></button>
28
- <button role="tab" data-view="turns" data-letter="文" class="tab next-tab" title="对话原文"><span>原文</span></button>
29
- <button role="tab" data-view="docs" data-letter="件" class="tab next-tab" title="工作区文件"><span>文件</span></button>
30
- <button role="tab" data-view="health" data-letter="检" class="tab next-tab" title="体检"><span>体检</span></button>
27
+ <button role="tab" id="tab-galaxy" aria-controls="view-galaxy" aria-selected="true" tabindex="0" data-view="galaxy" data-letter="库" class="tab next-tab active" title="记忆库"><span>记忆库</span></button>
28
+ <button role="tab" id="tab-graph" aria-controls="view-graph" aria-selected="false" tabindex="-1" data-view="graph" data-letter="图" class="tab next-tab" title="图谱"><span>图谱</span></button>
29
+ <button role="tab" id="tab-timeline" aria-controls="view-timeline" aria-selected="false" tabindex="-1" data-view="timeline" data-letter="线" class="tab next-tab" title="时间线"><span>时间线</span></button>
30
+ <button role="tab" id="tab-table" aria-controls="view-table" aria-selected="false" tabindex="-1" data-view="table" data-letter="表" class="tab next-tab" title="列表"><span>列表</span></button>
31
+ <button role="tab" id="tab-turns" aria-controls="view-turns" aria-selected="false" tabindex="-1" data-view="turns" data-letter="文" class="tab next-tab" title="对话原文"><span>对话原文</span></button>
32
+ <button role="tab" id="tab-docs" aria-controls="view-docs" aria-selected="false" tabindex="-1" data-view="docs" data-letter="件" class="tab next-tab" title="工作区文件"><span>文件</span></button>
33
+ <button role="tab" id="tab-health" aria-controls="view-health" aria-selected="false" tabindex="-1" data-view="health" data-letter="检" class="tab next-tab" title="体检"><span>记忆体检</span></button>
31
34
  </nav>
32
35
  <div class="next-actions">
36
+ <button id="btn-filters" class="next-icon mobile-only" title="筛选" aria-label="打开筛选" aria-controls="rail" aria-expanded="false">筛</button>
37
+ <button id="btn-details" class="next-icon mobile-only" title="详情" aria-label="打开详情" aria-controls="inspector" aria-expanded="false"><span class="classic-inspector-name">详</span><span id="story-inspector-name">观察记录</span></button>
33
38
  <span class="node-status"><i></i><span>CORE ONLINE</span></span>
34
39
  <button id="btn-new" class="next-btn primary">+ 新记忆</button>
35
40
  <button id="btn-refresh" class="next-icon" title="刷新" aria-label="刷新">↻</button>
@@ -39,12 +44,13 @@
39
44
  </div>
40
45
  </header>
41
46
 
42
- <section class="next-metrics" id="metrics" aria-label="记忆核心概览"></section>
47
+ <section class="atlas-toolbar" aria-label="记忆库工具"><strong>记忆库</strong><select aria-label="展示方式" id="atlas-mode"><option value="galaxy">星图</option><option value="table">列表</option><option value="timeline">按时间</option><option value="graph">关系图谱</option></select><div id="atlas-kinds" aria-label="记忆类型"></div><div class="atlas-actions"><button id="atlas-filter" class="btn tiny" aria-controls="rail" aria-expanded="false">筛选</button></div></section>
48
+ <section hidden class="next-metrics" id="metrics" aria-label="记忆核心概览"></section>
43
49
 
44
- <main class="next-workspace">
50
+ <main class="next-workspace" id="main-content" tabindex="-1">
45
51
  <aside class="next-rail" id="rail" aria-label="记忆索引"></aside>
46
52
  <section class="next-stage" id="stage">
47
- <div class="view" id="view-graph">
53
+ <div class="view" id="view-graph" role="tabpanel" aria-labelledby="tab-graph" tabindex="0">
48
54
  <canvas id="graph"></canvas>
49
55
  <div class="graph-hud">
50
56
  <div class="legend" id="graph-legend"></div>
@@ -57,25 +63,20 @@
57
63
  </div>
58
64
  <div class="empty" id="graph-empty" hidden><p>还没有记忆。</p><p class="dim">聊几句,或者点右上角「+ 新记忆」。</p></div>
59
65
  </div>
60
- <div class="view" id="view-timeline" hidden></div>
61
- <div class="view" id="view-table" hidden></div>
62
- <div class="view" id="view-turns" hidden></div>
63
- <div class="view" id="view-docs" hidden></div>
64
- <div class="view" id="view-health" hidden></div>
65
- <div class="view" id="view-galaxy" hidden>
66
- <div class="galaxy-wrap">
67
- <canvas id="galaxy"></canvas>
68
- <div class="galaxy-scan"></div>
69
- <div class="galaxy-hud"><b>记忆星图</b><span>亮度 = 最近被想起 大小 = 权重 光团 = 主题</span></div>
70
- <div class="galaxy-telemetry" id="galaxy-telemetry">ROT 000° · PITCH 0° · ZOOM 1.00×</div>
71
- <div class="galaxy-legend" id="galaxy-legend"></div>
72
- <div class="galaxy-hint">拖动旋转 · 滚轮缩放 · 双击复位</div>
73
- <div class="galaxy-empty" id="galaxy-empty" hidden>还没有记忆,聊几句再回来。</div>
74
- </div>
66
+ <div class="view" id="view-timeline" role="tabpanel" aria-labelledby="tab-timeline" tabindex="0" hidden></div>
67
+ <div class="view" id="view-table" role="tabpanel" aria-labelledby="tab-table" tabindex="0" hidden></div>
68
+ <div class="view" id="view-turns" role="tabpanel" aria-labelledby="tab-turns" tabindex="0" hidden></div>
69
+ <div class="view" id="view-docs" role="tabpanel" aria-labelledby="tab-docs" tabindex="0" hidden></div>
70
+ <div class="view" id="view-health" role="tabpanel" aria-labelledby="tab-health" tabindex="0" hidden></div>
71
+ <div class="view" id="view-galaxy" role="tabpanel" aria-labelledby="tab-galaxy" tabindex="0" hidden>
72
+ <div class="atlas-field"><canvas id="orbit-galaxy" tabindex="0" aria-label="动态记忆星河,亦可通过观察记录或搜索结果选择记忆" hidden></canvas><span id="orbit-label" aria-hidden="true" hidden></span>
73
+ <div class="atlas-title field-marker"><small>DEEP SPACE / MEMORY ATLAS</small><h1 id="atlas-title">记忆星河</h1></div><div class="galaxy-empty" id="galaxy-empty" role="status" hidden></div></div>
74
+ <div class="atlas-foot"><div><b id="atlas-count"></b><small>星体大小=权重 · 亮度=最近被想起</small><div class="story-legend"><span>实线:版本或摘要</span><span>虚线:共同标签</span></div></div><div class="atlas-zoom"><button data-zoom="out" aria-label="缩小星图">−</button><output id="atlas-scale">1.00×</output><button data-zoom="in" aria-label="放大星图">+</button><button data-zoom="reset">复位</button></div></div>
75
75
  </div>
76
76
  </section>
77
77
  <aside class="next-inspector" id="inspector" aria-label="记忆详情">
78
78
  <button class="insp-stub" id="insp-stub" title="展开右栏" aria-label="展开右栏"><span class="stub-chev">‹</span><span class="stub-label">概览</span><span class="stub-count" id="stub-count">0</span></button>
79
+ <button type="button" class="icon-btn" id="story-inspector-close" title="关闭(Esc)" aria-label="关闭浮层">×</button>
79
80
  <div class="insp-body" id="insp-body"></div>
80
81
  </aside>
81
82
  </main>
@@ -85,9 +86,10 @@
85
86
  <span class="next-caption">MEMORY CORE / 记忆正在沉淀、连接、被唤醒</span>
86
87
  <span class="kbd-hints"><kbd>/</kbd> 搜 <kbd>J</kbd><kbd>K</kbd> 移动 <kbd>Enter</kbd> 打开 <kbd>I</kbd> 右栏</span>
87
88
  </footer>
89
+ <div class="drawer-backdrop" id="drawer-backdrop" aria-hidden="true"></div>
88
90
  </div>
89
91
  <div class="modal" id="modal" hidden><div class="modal-panel" role="dialog" aria-modal="true" aria-labelledby="modal-title"><header><h2 id="modal-title">新建记忆</h2><button class="next-icon" id="modal-close" aria-label="关闭">×</button></header><div class="modal-body" id="modal-body"></div><footer id="modal-foot"></footer></div></div>
90
- <div class="toast" id="toast" hidden></div><div class="menu" id="menu" hidden></div>
92
+ <div class="toast" id="toast" role="status" aria-live="polite" aria-atomic="true" hidden></div><div class="menu" id="menu" hidden></div>
91
93
  <script src="/app.js" type="module"></script>
92
94
  <script src="/next.js" type="module"></script>
93
95
  </body>
package/webui/next.js CHANGED
@@ -259,18 +259,10 @@ function flash() {
259
259
  flashTimer = setTimeout(() => document.body.classList.remove('cg-glitch'), 700);
260
260
  }
261
261
 
262
- async function watch() {
263
- if (document.hidden) return;
264
- try {
265
- const rsp = await fetch('/api/snapshot', { cache: 'no-store' });
266
- if (!rsp.ok) return;
267
- const snap = await rsp.json();
268
- const cards = Array.isArray(snap.cards) ? snap.cards : [];
269
- if (prevCount !== null && cards.length > prevCount) flash();
270
- prevCount = cards.length;
271
- } catch {
272
- // 读不到就算了,纯装饰
273
- }
262
+ function onSnapshot(event) {
263
+ const cards = Array.isArray(event.detail?.cards) ? event.detail.cards : [];
264
+ if (prevCount !== null && cards.length > prevCount) flash();
265
+ prevCount = cards.length;
274
266
  }
275
267
 
276
268
  /* ── 启动 ───────────────────────────────────────────── */
@@ -287,5 +279,4 @@ mountLayer();
287
279
  document.getElementById('btn-bg')?.addEventListener('click', openPanel);
288
280
  // 地址带 #bg 直接打开面板:省得每次点,也方便截图核对
289
281
  if (location.hash === '#bg') openPanel();
290
- watch();
291
- setInterval(() => void watch(), 20_000);
282
+ window.addEventListener('mcore:snapshot', onSnapshot);