memorix 1.1.9 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/TEAM.md +86 -86
  3. package/dist/cli/index.js +2452 -845
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/dashboard/static/app.js +29 -3
  6. package/dist/dashboard/static/index.html +201 -201
  7. package/dist/dashboard/static/style.css +3762 -3584
  8. package/dist/index.js +2790 -1310
  9. package/dist/index.js.map +1 -1
  10. package/dist/maintenance-runner.d.ts +40 -0
  11. package/dist/maintenance-runner.js +8193 -0
  12. package/dist/maintenance-runner.js.map +1 -0
  13. package/dist/memcode-runtime/CHANGELOG.md +28 -0
  14. package/dist/memcode-runtime/package.json +4 -4
  15. package/dist/sdk.js +2787 -1307
  16. package/dist/sdk.js.map +1 -1
  17. package/docs/CONFIGURATION.md +15 -4
  18. package/docs/DESIGN_DECISIONS.md +357 -357
  19. package/docs/GIT_MEMORY.md +2 -2
  20. package/docs/PERFORMANCE.md +23 -0
  21. package/docs/dev-log/progress.txt +54 -24
  22. package/package.json +1 -1
  23. package/src/audit/index.ts +156 -156
  24. package/src/cli/commands/audit-list.ts +89 -89
  25. package/src/cli/commands/background.ts +659 -659
  26. package/src/cli/commands/cleanup.ts +279 -255
  27. package/src/cli/commands/codegraph.ts +7 -5
  28. package/src/cli/commands/formation.ts +48 -48
  29. package/src/cli/commands/git-hook-install.ts +111 -111
  30. package/src/cli/commands/handoff.ts +66 -66
  31. package/src/cli/commands/hooks-status.ts +63 -63
  32. package/src/cli/commands/ingest-commit.ts +153 -153
  33. package/src/cli/commands/ingest-image.ts +73 -73
  34. package/src/cli/commands/ingest-log.ts +180 -180
  35. package/src/cli/commands/ingest.ts +44 -44
  36. package/src/cli/commands/integrate-shared.ts +15 -15
  37. package/src/cli/commands/lock.ts +96 -96
  38. package/src/cli/commands/message.ts +121 -121
  39. package/src/cli/commands/poll.ts +70 -70
  40. package/src/cli/commands/purge-all-memory.ts +85 -85
  41. package/src/cli/commands/purge-project-memory.ts +83 -83
  42. package/src/cli/commands/reasoning.ts +132 -132
  43. package/src/cli/commands/retention.ts +107 -108
  44. package/src/cli/commands/serve-http.ts +49 -22
  45. package/src/cli/commands/serve-shared.ts +118 -118
  46. package/src/cli/commands/skills.ts +123 -123
  47. package/src/cli/commands/task.ts +192 -192
  48. package/src/cli/commands/transfer.ts +73 -73
  49. package/src/cli/commands/uninstall-project-artifacts.ts +85 -85
  50. package/src/cli/tui/ChatView.tsx +234 -234
  51. package/src/cli/tui/CommandBar.tsx +312 -312
  52. package/src/cli/tui/ContextRail.tsx +118 -118
  53. package/src/cli/tui/HeaderBar.tsx +72 -72
  54. package/src/cli/tui/LogoBanner.tsx +51 -51
  55. package/src/cli/tui/Panels.tsx +632 -632
  56. package/src/cli/tui/Sidebar.tsx +179 -179
  57. package/src/cli/tui/chat-service.ts +742 -742
  58. package/src/cli/tui/data.ts +547 -547
  59. package/src/cli/tui/index.ts +41 -41
  60. package/src/cli/tui/markdown-render.tsx +371 -371
  61. package/src/cli/tui/theme.ts +178 -178
  62. package/src/cli/tui/use-mouse.ts +157 -157
  63. package/src/cli/tui/useNavigation.ts +56 -56
  64. package/src/cli/update-checker.ts +211 -211
  65. package/src/cli/version.ts +7 -7
  66. package/src/cli/workbench.ts +1 -1
  67. package/src/codegraph/auto-context.ts +50 -29
  68. package/src/codegraph/binder.ts +109 -16
  69. package/src/codegraph/exclude.ts +10 -0
  70. package/src/codegraph/lite-provider.ts +148 -18
  71. package/src/codegraph/project-context.ts +58 -12
  72. package/src/codegraph/store.ts +182 -0
  73. package/src/compact/token-budget.ts +74 -74
  74. package/src/config/behavior.ts +97 -59
  75. package/src/config/resolved-config.ts +4 -0
  76. package/src/config/toml-loader.ts +2 -0
  77. package/src/config/yaml-loader.ts +3 -1
  78. package/src/dashboard/project-classification.ts +64 -64
  79. package/src/dashboard/server.ts +31 -30
  80. package/src/dashboard/static/index.html +201 -201
  81. package/src/dashboard/static/style.css +3762 -3584
  82. package/src/embedding/fastembed-provider.ts +142 -142
  83. package/src/embedding/transformers-provider.ts +111 -111
  84. package/src/git/extractor.ts +209 -209
  85. package/src/git/hooks-path.ts +85 -85
  86. package/src/git/noise-filter.ts +226 -210
  87. package/src/hooks/handler.ts +10 -2
  88. package/src/hooks/pattern-detector.ts +173 -173
  89. package/src/hooks/significance-filter.ts +250 -250
  90. package/src/llm/memory-manager.ts +328 -328
  91. package/src/llm/provider.ts +885 -885
  92. package/src/llm/quality.ts +248 -248
  93. package/src/memory/attribution-guard.ts +249 -249
  94. package/src/memory/auto-relations.ts +107 -107
  95. package/src/memory/consolidation.ts +328 -302
  96. package/src/memory/disclosure-policy.ts +141 -141
  97. package/src/memory/entity-extractor.ts +197 -197
  98. package/src/memory/export-import.ts +3 -1
  99. package/src/memory/formation/evaluate.ts +217 -217
  100. package/src/memory/formation/extract.ts +361 -361
  101. package/src/memory/formation/index.ts +417 -417
  102. package/src/memory/formation/resolve.ts +344 -344
  103. package/src/memory/formation/types.ts +315 -315
  104. package/src/memory/freshness.ts +122 -122
  105. package/src/memory/graph.ts +197 -197
  106. package/src/memory/observations.ts +91 -27
  107. package/src/memory/refs.ts +94 -94
  108. package/src/memory/retention.ts +511 -433
  109. package/src/memory/secret-filter.ts +79 -79
  110. package/src/memory/session.ts +542 -523
  111. package/src/multimodal/image-loader.ts +143 -143
  112. package/src/orchestrate/adapters/claude-stream.ts +192 -192
  113. package/src/orchestrate/adapters/claude.ts +111 -111
  114. package/src/orchestrate/adapters/codex-stream.ts +134 -134
  115. package/src/orchestrate/adapters/codex.ts +41 -41
  116. package/src/orchestrate/adapters/gemini-stream.ts +166 -166
  117. package/src/orchestrate/adapters/gemini.ts +42 -42
  118. package/src/orchestrate/adapters/index.ts +73 -73
  119. package/src/orchestrate/adapters/opencode-stream.ts +143 -143
  120. package/src/orchestrate/adapters/opencode.ts +47 -47
  121. package/src/orchestrate/adapters/spawn-helper.ts +286 -286
  122. package/src/orchestrate/adapters/types.ts +77 -77
  123. package/src/orchestrate/capability-router.ts +284 -284
  124. package/src/orchestrate/context-compact.ts +188 -188
  125. package/src/orchestrate/cost-tracker.ts +219 -219
  126. package/src/orchestrate/error-recovery.ts +191 -191
  127. package/src/orchestrate/evidence.ts +140 -140
  128. package/src/orchestrate/ledger.ts +110 -110
  129. package/src/orchestrate/memorix-bridge.ts +380 -380
  130. package/src/orchestrate/output-budget.ts +80 -80
  131. package/src/orchestrate/permission.ts +152 -152
  132. package/src/orchestrate/pipeline-trace.ts +131 -131
  133. package/src/orchestrate/prompt-builder.ts +155 -155
  134. package/src/orchestrate/ring-buffer.ts +37 -37
  135. package/src/orchestrate/task-graph.ts +389 -389
  136. package/src/orchestrate/verify-gate.ts +219 -219
  137. package/src/orchestrate/worktree.ts +232 -232
  138. package/src/project/aliases.ts +374 -374
  139. package/src/project/detector.ts +268 -268
  140. package/src/rules/adapters/claude-code.ts +99 -99
  141. package/src/rules/adapters/codex.ts +97 -97
  142. package/src/rules/adapters/copilot.ts +124 -124
  143. package/src/rules/adapters/cursor.ts +114 -114
  144. package/src/rules/adapters/kiro.ts +126 -126
  145. package/src/rules/adapters/trae.ts +56 -56
  146. package/src/rules/adapters/windsurf.ts +83 -83
  147. package/src/rules/syncer.ts +235 -235
  148. package/src/runtime/control-plane-maintenance.ts +62 -0
  149. package/src/runtime/isolated-maintenance.ts +187 -0
  150. package/src/runtime/maintenance-jobs.ts +512 -0
  151. package/src/runtime/maintenance-runner.ts +96 -0
  152. package/src/runtime/maintenance-targets.ts +59 -0
  153. package/src/runtime/project-maintenance.ts +274 -0
  154. package/src/sdk.ts +327 -327
  155. package/src/search/intent-detector.ts +289 -289
  156. package/src/search/query-expansion.ts +52 -52
  157. package/src/server/formation-timeout.ts +27 -27
  158. package/src/server.ts +212 -224
  159. package/src/skills/mini-skills.ts +386 -386
  160. package/src/store/chat-store.ts +119 -119
  161. package/src/store/file-lock.ts +100 -100
  162. package/src/store/graph-store.ts +249 -249
  163. package/src/store/mini-skill-store.ts +349 -349
  164. package/src/store/obs-store.ts +293 -255
  165. package/src/store/persistence-json.ts +212 -212
  166. package/src/store/persistence.ts +291 -291
  167. package/src/store/project-affinity.ts +195 -195
  168. package/src/store/session-store.ts +268 -259
  169. package/src/store/sqlite-db.ts +40 -0
  170. package/src/store/sqlite-store.ts +429 -339
  171. package/src/team/event-bus.ts +76 -76
  172. package/src/team/file-locks.ts +173 -173
  173. package/src/team/handoff.ts +167 -167
  174. package/src/team/messages.ts +203 -203
  175. package/src/team/poll.ts +132 -132
  176. package/src/team/tasks.ts +211 -211
  177. package/src/wiki/generator.ts +237 -237
  178. package/src/wiki/knowledge-graph.ts +334 -334
  179. package/src/wiki/types.ts +85 -85
  180. package/src/workspace/mcp-adapters/codex.ts +191 -191
  181. package/src/workspace/mcp-adapters/copilot.ts +105 -105
  182. package/src/workspace/mcp-adapters/cursor.ts +53 -53
  183. package/src/workspace/mcp-adapters/kiro.ts +64 -64
  184. package/src/workspace/mcp-adapters/opencode.ts +123 -123
  185. package/src/workspace/mcp-adapters/trae.ts +134 -134
  186. package/src/workspace/mcp-adapters/windsurf.ts +91 -91
  187. package/src/workspace/sanitizer.ts +60 -60
  188. package/src/workspace/workflow-sync.ts +131 -131
@@ -220,6 +220,11 @@ const i18n = {
220
220
  providerUnavailable: 'Unavailable',
221
221
  providerDisabled: 'Disabled (BM25 only)',
222
222
  degradedHint: 'Search is degraded — no vector similarity',
223
+ maintenance: 'Maintenance',
224
+ maintenanceIdle: 'No work queued',
225
+ maintenanceQueued: 'queued',
226
+ maintenanceRunning: 'running',
227
+ maintenanceNeedsAttention: 'needs attention',
223
228
 
224
229
  // Project states
225
230
  noProjects: 'No projects',
@@ -642,6 +647,11 @@ const i18n = {
642
647
  providerUnavailable: '不可用',
643
648
  providerDisabled: '已禁用 (仅 BM25)',
644
649
  degradedHint: '搜索已降级 — 无向量相似性',
650
+ maintenance: '维护任务',
651
+ maintenanceIdle: '无待处理任务',
652
+ maintenanceQueued: '项排队',
653
+ maintenanceRunning: '项运行中',
654
+ maintenanceNeedsAttention: '项需要处理',
645
655
 
646
656
  // Project states
647
657
  noProjects: '无项目',
@@ -1320,6 +1330,17 @@ async function loadDashboard() {
1320
1330
  const totalObs = stats.observations || 0;
1321
1331
  const gs = stats.gitSummary || { total: 0, recentWeek: 0, recentMemories: [] };
1322
1332
  const rs = stats.retentionSummary || { active: 0, stale: 0, archive: 0, immune: 0 };
1333
+ const maintenance = stats.maintenance || { pending: 0, running: 0, retrying: 0, failed: 0 };
1334
+ const queuedMaintenance = (maintenance.pending || 0) + (maintenance.retrying || 0);
1335
+ const activeMaintenance = maintenance.running || 0;
1336
+ const failedMaintenance = maintenance.failed || 0;
1337
+ const maintenanceState = failedMaintenance > 0
1338
+ ? { color: 'var(--accent-red)', text: `${failedMaintenance} ${t('maintenanceNeedsAttention')}` }
1339
+ : activeMaintenance > 0
1340
+ ? { color: 'var(--accent-blue)', text: `${activeMaintenance} ${t('maintenanceRunning')}` }
1341
+ : queuedMaintenance > 0
1342
+ ? { color: 'var(--accent-amber)', text: `${queuedMaintenance} ${t('maintenanceQueued')}` }
1343
+ : { color: 'var(--accent-green)', text: t('maintenanceIdle') };
1323
1344
 
1324
1345
  const typeIcons = {
1325
1346
  'session-request': '<span class="iconify" data-icon="lucide:target" style="color:#f87171;"></span>', gotcha: '<span class="iconify" data-icon="lucide:alert-octagon" style="color:#ef4444;"></span>', 'problem-solution': '<span class="iconify" data-icon="lucide:lightbulb" style="color:#fbbf24;"></span>',
@@ -1371,7 +1392,7 @@ async function loadDashboard() {
1371
1392
  <div class="panel" style="flex:1;">
1372
1393
  <div class="panel-header"><span class="panel-title">${t('systemStatus')}</span></div>
1373
1394
  <div class="panel-body">
1374
- <div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;">
1395
+ <div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:16px;">
1375
1396
  <div>
1376
1397
  <div style="font-size:11px;color:var(--text-muted);margin-bottom:4px;">${t('embeddingProvider')}</div>
1377
1398
  <div style="font-size:14px;font-weight:600;color:${stats.embedding?.enabled ? 'var(--accent-green)' : stats.embedding?.provider ? 'var(--accent-amber)' : 'var(--text-muted)'};">
@@ -1396,6 +1417,11 @@ async function loadDashboard() {
1396
1417
  </div>
1397
1418
  ${stats.embeddingProviderState === 'temporarily_unavailable' ? `<div style="font-size:11px;color:var(--accent-amber);margin-top:2px;">${t('degradedHint')}</div>` : ''}
1398
1419
  </div>
1420
+ <div>
1421
+ <div style="font-size:11px;color:var(--text-muted);margin-bottom:4px;">${t('maintenance')}</div>
1422
+ <div style="font-size:14px;font-weight:600;color:${maintenanceState.color};">${maintenanceState.text}</div>
1423
+ ${queuedMaintenance > 0 && activeMaintenance > 0 ? `<div style="font-size:11px;color:var(--text-secondary);margin-top:2px;">${queuedMaintenance} ${t('maintenanceQueued')}</div>` : ''}
1424
+ </div>
1399
1425
  </div>
1400
1426
  </div>
1401
1427
  </div>
@@ -1440,9 +1466,9 @@ async function loadDashboard() {
1440
1466
  <div class="panel-header"><span class="panel-title">${t('observationTypes')}</span></div>
1441
1467
  <div class="panel-body">
1442
1468
  ${typeEntries.length > 0 ? `
1443
- <div style="display: flex; gap: 20px; align-items: flex-start;">
1469
+ <div class="type-distribution" style="display: flex; gap: 20px; align-items: flex-start;">
1444
1470
  <canvas id="type-pie-chart" width="140" height="140" style="flex-shrink: 0;"></canvas>
1445
- <div style="flex: 1;">
1471
+ <div class="type-distribution-list" style="flex: 1;">
1446
1472
  ${typeEntries.map(([type, count]) => `
1447
1473
  <div style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px;">
1448
1474
  <span style="width: 18px; text-align: center; font-size: 13px;">${typeIcons[type] || '[UNKNOWN]'}</span>
@@ -1,201 +1,201 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
8
- <meta http-equiv="Pragma" content="no-cache">
9
- <meta http-equiv="Expires" content="0">
10
- <title>Memorix — Memory Control Plane</title>
11
- <link rel="stylesheet" href="/style.css">
12
- <script src="https://code.iconify.design/3/3.1.0/iconify.min.js"></script>
13
- <link rel="preconnect" href="https://fonts.googleapis.com">
14
- <link
15
- href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
16
- rel="stylesheet">
17
- </head>
18
-
19
- <body>
20
- <!-- Sidebar -->
21
- <nav id="sidebar">
22
- <div class="sidebar-brand">
23
- <img src="/logo.png" alt="Memorix" class="brand-logo" />
24
- <span class="brand-text">Memorix</span>
25
- </div>
26
-
27
- <!-- Mode Badge — shows standalone vs control-plane, port, MCP endpoint -->
28
- <div id="mode-badge" class="mode-badge" style="display:none;">
29
- <span id="mode-badge-label" class="mode-badge-label"></span>
30
- <span id="mode-badge-port" class="mode-badge-port"></span>
31
- <span id="mode-badge-mcp" class="mode-badge-mcp" style="display:none;"></span>
32
- </div>
33
-
34
- <!-- Project Switcher (custom dropdown) -->
35
- <div class="project-switcher" id="project-switcher">
36
- <button class="project-trigger" id="project-trigger" title="Switch project">
37
- <span class="project-dot"></span>
38
- <span class="project-name" id="project-name">Loading...</span>
39
- <span class="project-count" id="project-count"></span>
40
- <svg class="project-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
41
- <path d="M6 9l6 6 6-6"/>
42
- </svg>
43
- </button>
44
- <div class="project-dropdown" id="project-dropdown">
45
- <div class="project-dropdown-header">
46
- <input type="text" class="project-search" id="project-search" placeholder="Search projects..." autocomplete="off" />
47
- </div>
48
- <div class="project-dropdown-list" id="project-list"></div>
49
- </div>
50
- </div>
51
-
52
- <div class="sidebar-section-label" data-section="core">CORE</div>
53
- <div class="sidebar-nav">
54
- <button class="nav-btn active" data-page="dashboard">
55
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
56
- <rect x="3" y="3" width="7" height="7" rx="1"/>
57
- <rect x="14" y="3" width="7" height="7" rx="1"/>
58
- <rect x="3" y="14" width="7" height="7" rx="1"/>
59
- <rect x="14" y="14" width="7" height="7" rx="1"/>
60
- </svg>
61
- <span class="nav-label">Overview</span>
62
- </button>
63
- <button class="nav-btn" data-page="git-memory">
64
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
65
- <circle cx="12" cy="12" r="4"/>
66
- <line x1="1.05" y1="12" x2="7" y2="12"/>
67
- <line x1="17.01" y1="12" x2="22.96" y2="12"/>
68
- </svg>
69
- <span class="nav-label">Git Memory</span>
70
- </button>
71
- <button class="nav-btn" data-page="knowledge">
72
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
73
- <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
74
- <path d="M4 4.5A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z"/>
75
- </svg>
76
- <span class="nav-label">Knowledge</span>
77
- </button>
78
- <button class="nav-btn" data-page="graph">
79
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
80
- <circle cx="12" cy="5" r="3"/>
81
- <circle cx="5" cy="19" r="3"/>
82
- <circle cx="19" cy="19" r="3"/>
83
- <line x1="12" y1="8" x2="5" y2="16"/>
84
- <line x1="12" y1="8" x2="19" y2="16"/>
85
- </svg>
86
- <span class="nav-label">Graph</span>
87
- </button>
88
- <button class="nav-btn" data-page="observations">
89
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
90
- <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
91
- <circle cx="12" cy="12" r="3"/>
92
- </svg>
93
- <span class="nav-label">Observations</span>
94
- </button>
95
- </div>
96
- <div class="sidebar-section-label" data-section="health">HEALTH</div>
97
- <div class="sidebar-nav">
98
- <button class="nav-btn" data-page="retention">
99
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
100
- <polyline points="22,12 18,12 15,21 9,3 6,12 2,12"/>
101
- </svg>
102
- <span class="nav-label">Retention</span>
103
- </button>
104
- <button class="nav-btn" data-page="config">
105
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
106
- <circle cx="12" cy="12" r="3"/>
107
- <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>
108
- </svg>
109
- <span class="nav-label">Config</span>
110
- </button>
111
- <button class="nav-btn" data-page="identity">
112
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
113
- <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
114
- </svg>
115
- <span class="nav-label">Identity</span>
116
- </button>
117
- </div>
118
- <div class="sidebar-section-label" data-section="collaboration">AGENTS</div>
119
- <div class="sidebar-nav">
120
- <button class="nav-btn" data-page="sessions">
121
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
122
- <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
123
- <line x1="16" y1="2" x2="16" y2="6"/>
124
- <line x1="8" y1="2" x2="8" y2="6"/>
125
- <line x1="3" y1="10" x2="21" y2="10"/>
126
- </svg>
127
- <span class="nav-label">Sessions</span>
128
- </button>
129
- <button class="nav-btn" data-page="team">
130
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
131
- <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
132
- <circle cx="9" cy="7" r="4"/>
133
- <path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
134
- <path d="M16 3.13a4 4 0 0 1 0 7.75"/>
135
- </svg>
136
- <span class="nav-label">Team</span>
137
- </button>
138
- </div>
139
- <div class="sidebar-spacer"></div>
140
- <div class="sidebar-footer">
141
- <button class="sidebar-action-btn" id="theme-toggle" title="Toggle Theme">
142
- <svg id="theme-icon-sun" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
143
- stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:none;">
144
- <circle cx="12" cy="12" r="5"/>
145
- <line x1="12" y1="1" x2="12" y2="3"/>
146
- <line x1="12" y1="21" x2="12" y2="23"/>
147
- <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
148
- <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
149
- <line x1="1" y1="12" x2="3" y2="12"/>
150
- <line x1="21" y1="12" x2="23" y2="12"/>
151
- <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
152
- <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
153
- </svg>
154
- <svg id="theme-icon-moon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
155
- stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
156
- <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/>
157
- </svg>
158
- <span class="action-label" id="theme-label">Dark</span>
159
- </button>
160
- <button class="sidebar-action-btn" id="lang-toggle" title="Switch Language / 切换语言">
161
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
162
- <circle cx="12" cy="12" r="10"/>
163
- <line x1="2" y1="12" x2="22" y2="12"/>
164
- <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
165
- </svg>
166
- <span class="action-label" id="lang-label">EN</span>
167
- </button>
168
- </div>
169
- </nav>
170
-
171
- <!-- Main Content -->
172
- <main id="app">
173
- <div id="page-dashboard" class="page active"></div>
174
- <div id="page-git-memory" class="page"></div>
175
- <div id="page-knowledge" class="page"></div>
176
- <div id="page-graph" class="page"></div>
177
- <div id="page-observations" class="page"></div>
178
- <div id="page-retention" class="page"></div>
179
- <div id="page-config" class="page"></div>
180
- <div id="page-identity" class="page"></div>
181
- <div id="page-sessions" class="page"></div>
182
- <div id="page-team" class="page"></div>
183
- </main>
184
-
185
- <!-- Apache ECharts 5 — Knowledge Graph renderer -->
186
- <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
187
- <!-- Cytoscape.js + Dagre — legacy entity-graph fallback -->
188
- <script src="https://unpkg.com/cytoscape@3.30.4/dist/cytoscape.min.js"></script>
189
- <script src="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"></script>
190
- <script src="https://unpkg.com/cytoscape-dagre@2.5.0/cytoscape-dagre.js"></script>
191
- <script>
192
- // Cache-bust app.js by appending mtime-based version so edits always hit the browser.
193
- (function () {
194
- var s = document.createElement('script');
195
- s.src = '/app.js?v=' + Date.now();
196
- document.body.appendChild(s);
197
- })();
198
- </script>
199
- </body>
200
-
201
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
8
+ <meta http-equiv="Pragma" content="no-cache">
9
+ <meta http-equiv="Expires" content="0">
10
+ <title>Memorix — Memory Control Plane</title>
11
+ <link rel="stylesheet" href="/style.css">
12
+ <script src="https://code.iconify.design/3/3.1.0/iconify.min.js"></script>
13
+ <link rel="preconnect" href="https://fonts.googleapis.com">
14
+ <link
15
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
16
+ rel="stylesheet">
17
+ </head>
18
+
19
+ <body>
20
+ <!-- Sidebar -->
21
+ <nav id="sidebar">
22
+ <div class="sidebar-brand">
23
+ <img src="/logo.png" alt="Memorix" class="brand-logo" />
24
+ <span class="brand-text">Memorix</span>
25
+ </div>
26
+
27
+ <!-- Mode Badge — shows standalone vs control-plane, port, MCP endpoint -->
28
+ <div id="mode-badge" class="mode-badge" style="display:none;">
29
+ <span id="mode-badge-label" class="mode-badge-label"></span>
30
+ <span id="mode-badge-port" class="mode-badge-port"></span>
31
+ <span id="mode-badge-mcp" class="mode-badge-mcp" style="display:none;"></span>
32
+ </div>
33
+
34
+ <!-- Project Switcher (custom dropdown) -->
35
+ <div class="project-switcher" id="project-switcher">
36
+ <button class="project-trigger" id="project-trigger" title="Switch project">
37
+ <span class="project-dot"></span>
38
+ <span class="project-name" id="project-name">Loading...</span>
39
+ <span class="project-count" id="project-count"></span>
40
+ <svg class="project-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
41
+ <path d="M6 9l6 6 6-6"/>
42
+ </svg>
43
+ </button>
44
+ <div class="project-dropdown" id="project-dropdown">
45
+ <div class="project-dropdown-header">
46
+ <input type="text" class="project-search" id="project-search" placeholder="Search projects..." autocomplete="off" />
47
+ </div>
48
+ <div class="project-dropdown-list" id="project-list"></div>
49
+ </div>
50
+ </div>
51
+
52
+ <div class="sidebar-section-label" data-section="core">CORE</div>
53
+ <div class="sidebar-nav">
54
+ <button class="nav-btn active" data-page="dashboard" title="Overview" aria-label="Overview">
55
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
56
+ <rect x="3" y="3" width="7" height="7" rx="1"/>
57
+ <rect x="14" y="3" width="7" height="7" rx="1"/>
58
+ <rect x="3" y="14" width="7" height="7" rx="1"/>
59
+ <rect x="14" y="14" width="7" height="7" rx="1"/>
60
+ </svg>
61
+ <span class="nav-label">Overview</span>
62
+ </button>
63
+ <button class="nav-btn" data-page="git-memory" title="Git Memory" aria-label="Git Memory">
64
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
65
+ <circle cx="12" cy="12" r="4"/>
66
+ <line x1="1.05" y1="12" x2="7" y2="12"/>
67
+ <line x1="17.01" y1="12" x2="22.96" y2="12"/>
68
+ </svg>
69
+ <span class="nav-label">Git Memory</span>
70
+ </button>
71
+ <button class="nav-btn" data-page="knowledge" title="Knowledge" aria-label="Knowledge">
72
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
73
+ <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
74
+ <path d="M4 4.5A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z"/>
75
+ </svg>
76
+ <span class="nav-label">Knowledge</span>
77
+ </button>
78
+ <button class="nav-btn" data-page="graph" title="Graph" aria-label="Graph">
79
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
80
+ <circle cx="12" cy="5" r="3"/>
81
+ <circle cx="5" cy="19" r="3"/>
82
+ <circle cx="19" cy="19" r="3"/>
83
+ <line x1="12" y1="8" x2="5" y2="16"/>
84
+ <line x1="12" y1="8" x2="19" y2="16"/>
85
+ </svg>
86
+ <span class="nav-label">Graph</span>
87
+ </button>
88
+ <button class="nav-btn" data-page="observations" title="Observations" aria-label="Observations">
89
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
90
+ <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
91
+ <circle cx="12" cy="12" r="3"/>
92
+ </svg>
93
+ <span class="nav-label">Observations</span>
94
+ </button>
95
+ </div>
96
+ <div class="sidebar-section-label" data-section="health">HEALTH</div>
97
+ <div class="sidebar-nav">
98
+ <button class="nav-btn" data-page="retention" title="Retention" aria-label="Retention">
99
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
100
+ <polyline points="22,12 18,12 15,21 9,3 6,12 2,12"/>
101
+ </svg>
102
+ <span class="nav-label">Retention</span>
103
+ </button>
104
+ <button class="nav-btn" data-page="config" title="Config" aria-label="Config">
105
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
106
+ <circle cx="12" cy="12" r="3"/>
107
+ <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>
108
+ </svg>
109
+ <span class="nav-label">Config</span>
110
+ </button>
111
+ <button class="nav-btn" data-page="identity" title="Identity" aria-label="Identity">
112
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
113
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
114
+ </svg>
115
+ <span class="nav-label">Identity</span>
116
+ </button>
117
+ </div>
118
+ <div class="sidebar-section-label" data-section="collaboration">AGENTS</div>
119
+ <div class="sidebar-nav">
120
+ <button class="nav-btn" data-page="sessions" title="Sessions" aria-label="Sessions">
121
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
122
+ <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
123
+ <line x1="16" y1="2" x2="16" y2="6"/>
124
+ <line x1="8" y1="2" x2="8" y2="6"/>
125
+ <line x1="3" y1="10" x2="21" y2="10"/>
126
+ </svg>
127
+ <span class="nav-label">Sessions</span>
128
+ </button>
129
+ <button class="nav-btn" data-page="team" title="Coordination" aria-label="Coordination">
130
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
131
+ <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
132
+ <circle cx="9" cy="7" r="4"/>
133
+ <path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
134
+ <path d="M16 3.13a4 4 0 0 1 0 7.75"/>
135
+ </svg>
136
+ <span class="nav-label">Team</span>
137
+ </button>
138
+ </div>
139
+ <div class="sidebar-spacer"></div>
140
+ <div class="sidebar-footer">
141
+ <button class="sidebar-action-btn" id="theme-toggle" title="Toggle Theme">
142
+ <svg id="theme-icon-sun" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
143
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:none;">
144
+ <circle cx="12" cy="12" r="5"/>
145
+ <line x1="12" y1="1" x2="12" y2="3"/>
146
+ <line x1="12" y1="21" x2="12" y2="23"/>
147
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
148
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
149
+ <line x1="1" y1="12" x2="3" y2="12"/>
150
+ <line x1="21" y1="12" x2="23" y2="12"/>
151
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
152
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
153
+ </svg>
154
+ <svg id="theme-icon-moon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
155
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
156
+ <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/>
157
+ </svg>
158
+ <span class="action-label" id="theme-label">Dark</span>
159
+ </button>
160
+ <button class="sidebar-action-btn" id="lang-toggle" title="Switch Language / 切换语言">
161
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
162
+ <circle cx="12" cy="12" r="10"/>
163
+ <line x1="2" y1="12" x2="22" y2="12"/>
164
+ <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
165
+ </svg>
166
+ <span class="action-label" id="lang-label">EN</span>
167
+ </button>
168
+ </div>
169
+ </nav>
170
+
171
+ <!-- Main Content -->
172
+ <main id="app">
173
+ <div id="page-dashboard" class="page active"></div>
174
+ <div id="page-git-memory" class="page"></div>
175
+ <div id="page-knowledge" class="page"></div>
176
+ <div id="page-graph" class="page"></div>
177
+ <div id="page-observations" class="page"></div>
178
+ <div id="page-retention" class="page"></div>
179
+ <div id="page-config" class="page"></div>
180
+ <div id="page-identity" class="page"></div>
181
+ <div id="page-sessions" class="page"></div>
182
+ <div id="page-team" class="page"></div>
183
+ </main>
184
+
185
+ <!-- Apache ECharts 5 — Knowledge Graph renderer -->
186
+ <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
187
+ <!-- Cytoscape.js + Dagre — legacy entity-graph fallback -->
188
+ <script src="https://unpkg.com/cytoscape@3.30.4/dist/cytoscape.min.js"></script>
189
+ <script src="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"></script>
190
+ <script src="https://unpkg.com/cytoscape-dagre@2.5.0/cytoscape-dagre.js"></script>
191
+ <script>
192
+ // Cache-bust app.js by appending mtime-based version so edits always hit the browser.
193
+ (function () {
194
+ var s = document.createElement('script');
195
+ s.src = '/app.js?v=' + Date.now();
196
+ document.body.appendChild(s);
197
+ })();
198
+ </script>
199
+ </body>
200
+
201
+ </html>