@gamaze/hicortex 0.17.2 → 0.17.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/assets/context.html +44 -0
- package/assets/dashboard.html +50 -0
- package/assets/viz.html +35 -4
- package/dist/mcp-server.js +5 -0
- package/package.json +1 -1
package/assets/context.html
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
--danger: #c0392b;
|
|
35
35
|
--ok: #2f8f4e;
|
|
36
36
|
--tab-active: #ffffff;
|
|
37
|
+
--nav-bg: #f6f7f9;
|
|
37
38
|
}
|
|
38
39
|
@media (prefers-color-scheme: dark) {
|
|
39
40
|
:root {
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
--danger: #e05555;
|
|
48
49
|
--ok: #5fbf77;
|
|
49
50
|
--tab-active: #0f1117;
|
|
51
|
+
--nav-bg: #010409;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
/* Explicit theme override wins over the media default in BOTH directions. */
|
|
@@ -54,11 +56,13 @@
|
|
|
54
56
|
--bg: #ffffff; --panel: #f6f7f9; --panel-border: #d9dce2;
|
|
55
57
|
--text: #1c1f26; --text-dim: #656d7a; --accent: #2f6fb0;
|
|
56
58
|
--accent-text: #ffffff; --danger: #c0392b; --ok: #2f8f4e; --tab-active: #ffffff;
|
|
59
|
+
--nav-bg: #f6f7f9;
|
|
57
60
|
}
|
|
58
61
|
:root[data-theme="dark"] {
|
|
59
62
|
--bg: #0f1117; --panel: #161a23; --panel-border: #262c3a;
|
|
60
63
|
--text: #d5dae4; --text-dim: #8b93a5; --accent: #5b9dd9;
|
|
61
64
|
--accent-text: #0b0d12; --danger: #e05555; --ok: #5fbf77; --tab-active: #0f1117;
|
|
65
|
+
--nav-bg: #010409;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
@@ -165,9 +169,33 @@
|
|
|
165
169
|
padding: 8px; font: inherit; margin-bottom: 10px;
|
|
166
170
|
}
|
|
167
171
|
#token-err { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
|
|
172
|
+
|
|
173
|
+
/* ---- shared console nav (#249) ---- */
|
|
174
|
+
.hc-nav {
|
|
175
|
+
display: flex; align-items: center; gap: 16px;
|
|
176
|
+
height: 48px; padding: 0 18px; flex: none;
|
|
177
|
+
background: var(--nav-bg);
|
|
178
|
+
border-bottom: 1px solid var(--panel-border);
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
}
|
|
181
|
+
.hc-nav-logo { color: var(--text); font-weight: 600; text-decoration: none; letter-spacing: 0.02em; }
|
|
182
|
+
.hc-nav-links { margin-left: auto; display: flex; align-items: center; gap: 16px; }
|
|
183
|
+
.hc-nav-links a { color: var(--text-dim); text-decoration: none; transition: color 0.12s; }
|
|
184
|
+
.hc-nav-links a:hover { color: var(--accent); }
|
|
185
|
+
.hc-nav-links a[data-nav-active] { color: var(--text); }
|
|
186
|
+
.hc-nav-disabled { color: var(--text-dim); opacity: 0.4; cursor: not-allowed; user-select: none; }
|
|
168
187
|
</style>
|
|
169
188
|
</head>
|
|
170
189
|
<body>
|
|
190
|
+
<nav class="hc-nav">
|
|
191
|
+
<a class="hc-nav-logo" href="/dashboard">Hicortex</a>
|
|
192
|
+
<div class="hc-nav-links">
|
|
193
|
+
<a href="/dashboard">Dashboard</a>
|
|
194
|
+
<a href="/viz">Graph</a>
|
|
195
|
+
<a href="/context/ui" data-nav-active>Context</a>
|
|
196
|
+
<span class="hc-nav-disabled" title="Coming soon — #250">Self-improvement</span>
|
|
197
|
+
</div>
|
|
198
|
+
</nav>
|
|
171
199
|
<header>
|
|
172
200
|
<h1>Hicortex — context</h1>
|
|
173
201
|
<label class="meta" for="scope">scope</label>
|
|
@@ -249,6 +277,22 @@
|
|
|
249
277
|
}
|
|
250
278
|
})();
|
|
251
279
|
|
|
280
|
+
// Shared console nav (#249): append ?token= to internal nav links on click
|
|
281
|
+
// so navigation between pages doesn't re-authenticate. Reads token from any
|
|
282
|
+
// page-scoped localStorage key (each page historically used its own).
|
|
283
|
+
document.querySelectorAll(".hc-nav-links a, .hc-nav-logo").forEach(function (a) {
|
|
284
|
+
a.addEventListener("click", function (e) {
|
|
285
|
+
var t = token
|
|
286
|
+
|| localStorage.getItem("hicortexToken")
|
|
287
|
+
|| localStorage.getItem("hicortex-dashboard-token");
|
|
288
|
+
if (!t) return;
|
|
289
|
+
e.preventDefault();
|
|
290
|
+
var u = new URL(a.getAttribute("href"), location.origin);
|
|
291
|
+
u.searchParams.set("token", t);
|
|
292
|
+
location.href = u.toString();
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
|
|
252
296
|
function authHeaders(extra) {
|
|
253
297
|
var h = extra ? Object.assign({}, extra) : {};
|
|
254
298
|
if (token) h["Authorization"] = "Bearer " + token;
|
package/assets/dashboard.html
CHANGED
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
--accent-2: #2f8f4e;
|
|
42
42
|
--warn: #b08030;
|
|
43
43
|
--danger: #c0392b;
|
|
44
|
+
--nav-bg: #f6f7f9;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
@@ -89,9 +90,42 @@
|
|
|
89
90
|
table.digest td.k { color: var(--text-dim); width: 180px; }
|
|
90
91
|
.stage-pill { display: inline-block; padding: 1px 6px; border-radius: 10px; background: rgba(128,128,128,0.18); font-size: 11px; color: var(--text-dim); margin-right: 4px; }
|
|
91
92
|
.empty { color: var(--text-dim); font-style: italic; padding: 12px 0; }
|
|
93
|
+
|
|
94
|
+
/* ---- shared console nav (#249) ---- */
|
|
95
|
+
.hc-nav {
|
|
96
|
+
position: sticky; top: 0; z-index: 50;
|
|
97
|
+
display: flex; align-items: center; gap: 16px;
|
|
98
|
+
height: 48px; padding: 0 20px;
|
|
99
|
+
margin: -20px -20px 20px;
|
|
100
|
+
background: var(--nav-bg, #010409);
|
|
101
|
+
border-bottom: 1px solid var(--panel-border);
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
}
|
|
104
|
+
.hc-nav-logo {
|
|
105
|
+
color: var(--text); font-weight: 600; text-decoration: none;
|
|
106
|
+
letter-spacing: 0.02em;
|
|
107
|
+
}
|
|
108
|
+
.hc-nav-links { margin-left: auto; display: flex; align-items: center; gap: 16px; }
|
|
109
|
+
.hc-nav-links a {
|
|
110
|
+
color: var(--text-dim); text-decoration: none; transition: color 0.12s;
|
|
111
|
+
}
|
|
112
|
+
.hc-nav-links a:hover { color: var(--accent); }
|
|
113
|
+
.hc-nav-links a[data-nav-active] { color: var(--text); }
|
|
114
|
+
.hc-nav-disabled {
|
|
115
|
+
color: var(--text-dim); opacity: 0.4; cursor: not-allowed; user-select: none;
|
|
116
|
+
}
|
|
92
117
|
</style>
|
|
93
118
|
</head>
|
|
94
119
|
<body>
|
|
120
|
+
<nav class="hc-nav">
|
|
121
|
+
<a class="hc-nav-logo" href="/dashboard">Hicortex</a>
|
|
122
|
+
<div class="hc-nav-links">
|
|
123
|
+
<a href="/dashboard" data-nav-active>Dashboard</a>
|
|
124
|
+
<a href="/viz">Graph</a>
|
|
125
|
+
<a href="/context/ui">Context</a>
|
|
126
|
+
<span class="hc-nav-disabled" title="Coming soon — #250">Self-improvement</span>
|
|
127
|
+
</div>
|
|
128
|
+
</nav>
|
|
95
129
|
<h1>Hicortex — memory dashboard</h1>
|
|
96
130
|
<div class="sub">View-only analytics. All metrics derived from the live corpus + nightly snapshots.</div>
|
|
97
131
|
|
|
@@ -506,6 +540,22 @@ async function load() {
|
|
|
506
540
|
}
|
|
507
541
|
|
|
508
542
|
document.addEventListener("DOMContentLoaded", () => {
|
|
543
|
+
// Shared console nav (#249): append ?token= to internal nav links on click
|
|
544
|
+
// so navigation between pages doesn't re-authenticate. Reads the token from
|
|
545
|
+
// any of the page-scoped localStorage keys (each page historically used its
|
|
546
|
+
// own key) — keeps the snippet identical across the three served pages.
|
|
547
|
+
document.querySelectorAll(".hc-nav-links a, .hc-nav-logo").forEach(function (a) {
|
|
548
|
+
a.addEventListener("click", function (e) {
|
|
549
|
+
var t = token
|
|
550
|
+
|| localStorage.getItem("hicortexToken")
|
|
551
|
+
|| localStorage.getItem("hicortex-dashboard-token");
|
|
552
|
+
if (!t) return;
|
|
553
|
+
e.preventDefault();
|
|
554
|
+
var u = new URL(a.getAttribute("href"), location.origin);
|
|
555
|
+
u.searchParams.set("token", t);
|
|
556
|
+
location.href = u.toString();
|
|
557
|
+
});
|
|
558
|
+
});
|
|
509
559
|
// Seed the date picker to the digest date from the first load (today).
|
|
510
560
|
$("reload").addEventListener("click", load);
|
|
511
561
|
$("range").addEventListener("change", load);
|
package/assets/viz.html
CHANGED
|
@@ -55,17 +55,26 @@
|
|
|
55
55
|
#topbar {
|
|
56
56
|
position: fixed; top: 0; left: 0; right: 0;
|
|
57
57
|
display: flex; align-items: center; gap: 10px;
|
|
58
|
-
|
|
58
|
+
height: 48px;
|
|
59
|
+
padding: 0 12px;
|
|
59
60
|
background: rgba(22, 26, 35, 0.94);
|
|
60
61
|
border-bottom: 1px solid var(--panel-border);
|
|
61
62
|
z-index: 10;
|
|
62
63
|
}
|
|
63
64
|
#topbar h1 { font-size: 14px; font-weight: 600; white-space: nowrap; }
|
|
64
|
-
#meta { color: var(--text-dim);
|
|
65
|
+
#meta { color: var(--text-dim); white-space: nowrap; margin-left: auto; }
|
|
66
|
+
|
|
67
|
+
/* ---- shared console nav links (#249), integrated into the viz topbar ---- */
|
|
68
|
+
.hc-nav-logo { color: var(--text); text-decoration: none; letter-spacing: 0.02em; }
|
|
69
|
+
.hc-nav-links { margin-left: 16px; display: flex; align-items: center; gap: 16px; font-size: 14px; }
|
|
70
|
+
.hc-nav-links a { color: var(--text-dim); text-decoration: none; transition: color 0.12s; }
|
|
71
|
+
.hc-nav-links a:hover { color: var(--accent); }
|
|
72
|
+
.hc-nav-links a[data-nav-active] { color: var(--text); }
|
|
73
|
+
.hc-nav-disabled { color: var(--text-dim); opacity: 0.4; cursor: not-allowed; user-select: none; }
|
|
65
74
|
|
|
66
75
|
/* ---- left control panel ---- */
|
|
67
76
|
#panel {
|
|
68
|
-
position: fixed; top:
|
|
77
|
+
position: fixed; top: 48px; left: 12px; width: 236px;
|
|
69
78
|
background: rgba(22, 26, 35, 0.94);
|
|
70
79
|
border: 1px solid var(--panel-border); border-radius: 8px;
|
|
71
80
|
padding: 12px; z-index: 10;
|
|
@@ -235,8 +244,14 @@
|
|
|
235
244
|
<div id="graph-2d"></div>
|
|
236
245
|
|
|
237
246
|
<div id="topbar">
|
|
238
|
-
<h1
|
|
247
|
+
<h1 class="hc-nav-logo"><a href="/dashboard" style="color:inherit;text-decoration:none">Hicortex</a></h1>
|
|
239
248
|
<span id="meta"></span>
|
|
249
|
+
<nav class="hc-nav-links">
|
|
250
|
+
<a href="/dashboard">Dashboard</a>
|
|
251
|
+
<a href="/viz" data-nav-active>Graph</a>
|
|
252
|
+
<a href="/context/ui">Context</a>
|
|
253
|
+
<span class="hc-nav-disabled" title="Coming soon — #250">Self-improvement</span>
|
|
254
|
+
</nav>
|
|
240
255
|
</div>
|
|
241
256
|
|
|
242
257
|
<div id="panel">
|
|
@@ -343,6 +358,22 @@
|
|
|
343
358
|
}
|
|
344
359
|
})();
|
|
345
360
|
|
|
361
|
+
// Shared console nav (#249): append ?token= to internal nav links on click
|
|
362
|
+
// so navigation between pages doesn't re-authenticate. Reads token from any
|
|
363
|
+
// page-scoped localStorage key (each page historically used its own).
|
|
364
|
+
document.querySelectorAll(".hc-nav-links a, .hc-nav-logo").forEach(function (a) {
|
|
365
|
+
a.addEventListener("click", function (e) {
|
|
366
|
+
var t = token
|
|
367
|
+
|| localStorage.getItem("hicortexToken")
|
|
368
|
+
|| localStorage.getItem("hicortex-dashboard-token");
|
|
369
|
+
if (!t) return;
|
|
370
|
+
e.preventDefault();
|
|
371
|
+
var u = new URL(a.getAttribute("href"), location.origin);
|
|
372
|
+
u.searchParams.set("token", t);
|
|
373
|
+
location.href = u.toString();
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
|
|
346
377
|
// =========================================================================
|
|
347
378
|
// DOM references
|
|
348
379
|
// =========================================================================
|
package/dist/mcp-server.js
CHANGED
|
@@ -546,6 +546,11 @@ async function startServer(options = {}) {
|
|
|
546
546
|
console.log(authToken
|
|
547
547
|
? `[hicortex] Bearer token auth enabled`
|
|
548
548
|
: `[hicortex] No auth token configured — remote access DISABLED (localhost only). Run init to generate a token.`);
|
|
549
|
+
// Root → dashboard redirect (#249). Registered BEFORE the auth middleware so
|
|
550
|
+
// the redirect itself is public — it carries no data; the destination
|
|
551
|
+
// /dashboard has its own shell-exemption pattern. Gives the console one entry
|
|
552
|
+
// point: http://<host>:8787/ → /dashboard.
|
|
553
|
+
app.get("/", (_req, res) => res.redirect("/dashboard"));
|
|
549
554
|
app.use((0, viz_js_1.createAuthMiddleware)(authToken));
|
|
550
555
|
// SSE transport management — each connection gets its own McpServer instance
|
|
551
556
|
const transports = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamaze/hicortex",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"description": "Self-learning memory for AI agents — experience captured automatically, distilled into lessons overnight, shared across your whole fleet. Works with Hermes, OpenClaw, Claude Code, and Pi.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|