shieldcortex 2.0.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.
- package/LICENSE +21 -0
- package/README.md +282 -0
- package/dashboard/components.json +22 -0
- package/dashboard/eslint.config.mjs +42 -0
- package/dashboard/next.config.ts +7 -0
- package/dashboard/package-lock.json +8053 -0
- package/dashboard/package.json +44 -0
- package/dashboard/postcss.config.mjs +7 -0
- package/dashboard/public/file.svg +1 -0
- package/dashboard/public/globe.svg +1 -0
- package/dashboard/public/next.svg +1 -0
- package/dashboard/public/vercel.svg +1 -0
- package/dashboard/public/window.svg +1 -0
- package/dashboard/scripts/ensure-api.mjs +76 -0
- package/dashboard/src/app/error.tsx +49 -0
- package/dashboard/src/app/favicon.ico +0 -0
- package/dashboard/src/app/globals.css +130 -0
- package/dashboard/src/app/layout.tsx +35 -0
- package/dashboard/src/app/page.tsx +364 -0
- package/dashboard/src/components/Providers.tsx +27 -0
- package/dashboard/src/components/brain/ActivityPulseSystem.tsx +229 -0
- package/dashboard/src/components/brain/BrainMesh.tsx +133 -0
- package/dashboard/src/components/brain/BrainRegions.tsx +254 -0
- package/dashboard/src/components/brain/BrainScene.tsx +255 -0
- package/dashboard/src/components/brain/CategoryLabels.tsx +103 -0
- package/dashboard/src/components/brain/CoreSphere.tsx +215 -0
- package/dashboard/src/components/brain/DataFlowParticles.tsx +123 -0
- package/dashboard/src/components/brain/DataStreamRings.tsx +161 -0
- package/dashboard/src/components/brain/ElectronFlow.tsx +323 -0
- package/dashboard/src/components/brain/HolographicGrid.tsx +235 -0
- package/dashboard/src/components/brain/MemoryLinks.tsx +271 -0
- package/dashboard/src/components/brain/MemoryNode.tsx +245 -0
- package/dashboard/src/components/brain/NeuralPathways.tsx +441 -0
- package/dashboard/src/components/brain/SynapseNodes.tsx +312 -0
- package/dashboard/src/components/brain/TimelineControls.tsx +205 -0
- package/dashboard/src/components/chip/ChipScene.tsx +497 -0
- package/dashboard/src/components/chip/ChipSubstrate.tsx +238 -0
- package/dashboard/src/components/chip/CortexCore.tsx +210 -0
- package/dashboard/src/components/chip/DataBus.tsx +416 -0
- package/dashboard/src/components/chip/MemoryCell.tsx +225 -0
- package/dashboard/src/components/chip/MemoryGrid.tsx +328 -0
- package/dashboard/src/components/chip/QuantumCell.tsx +316 -0
- package/dashboard/src/components/chip/SectionLabel.tsx +113 -0
- package/dashboard/src/components/chip/index.ts +14 -0
- package/dashboard/src/components/controls/ControlPanel.tsx +106 -0
- package/dashboard/src/components/controls/VersionPanel.tsx +185 -0
- package/dashboard/src/components/dashboard/StatsPanel.tsx +164 -0
- package/dashboard/src/components/debug/ActivityLog.tsx +250 -0
- package/dashboard/src/components/debug/DebugPanel.tsx +101 -0
- package/dashboard/src/components/debug/QueryTester.tsx +192 -0
- package/dashboard/src/components/debug/RelationshipGraph.tsx +403 -0
- package/dashboard/src/components/debug/SqlConsole.tsx +319 -0
- package/dashboard/src/components/graph/KnowledgeGraph.tsx +230 -0
- package/dashboard/src/components/graph/OntologyGraph.tsx +631 -0
- package/dashboard/src/components/insights/ActivityHeatmap.tsx +131 -0
- package/dashboard/src/components/insights/InsightsView.tsx +46 -0
- package/dashboard/src/components/insights/KnowledgeMapPanel.tsx +80 -0
- package/dashboard/src/components/insights/QualityPanel.tsx +116 -0
- package/dashboard/src/components/memories/MemoriesView.tsx +150 -0
- package/dashboard/src/components/memories/MemoryCard.tsx +103 -0
- package/dashboard/src/components/memory/MemoryDetail.tsx +325 -0
- package/dashboard/src/components/nav/NavRail.tsx +54 -0
- package/dashboard/src/components/ui/button.tsx +62 -0
- package/dashboard/src/components/ui/card.tsx +92 -0
- package/dashboard/src/components/ui/input.tsx +21 -0
- package/dashboard/src/hooks/useDebouncedValue.ts +24 -0
- package/dashboard/src/hooks/useMemories.ts +458 -0
- package/dashboard/src/hooks/useSuggestions.ts +46 -0
- package/dashboard/src/lib/category-colors.ts +84 -0
- package/dashboard/src/lib/position-algorithm.ts +177 -0
- package/dashboard/src/lib/simplex-noise.ts +217 -0
- package/dashboard/src/lib/store.ts +88 -0
- package/dashboard/src/lib/utils.ts +6 -0
- package/dashboard/src/lib/websocket.ts +249 -0
- package/dashboard/src/types/memory.ts +73 -0
- package/dashboard/tsconfig.json +34 -0
- package/dist/__tests__/consolidation-merge.test.d.ts +9 -0
- package/dist/__tests__/consolidation-merge.test.d.ts.map +1 -0
- package/dist/__tests__/consolidation-merge.test.js +137 -0
- package/dist/__tests__/consolidation-merge.test.js.map +1 -0
- package/dist/__tests__/contradictions.test.d.ts +8 -0
- package/dist/__tests__/contradictions.test.d.ts.map +1 -0
- package/dist/__tests__/contradictions.test.js +78 -0
- package/dist/__tests__/contradictions.test.js.map +1 -0
- package/dist/__tests__/salience-evolution.test.d.ts +7 -0
- package/dist/__tests__/salience-evolution.test.d.ts.map +1 -0
- package/dist/__tests__/salience-evolution.test.js +151 -0
- package/dist/__tests__/salience-evolution.test.js.map +1 -0
- package/dist/__tests__/store.test.d.ts +7 -0
- package/dist/__tests__/store.test.d.ts.map +1 -0
- package/dist/__tests__/store.test.js +582 -0
- package/dist/__tests__/store.test.js.map +1 -0
- package/dist/api/control.d.ts +27 -0
- package/dist/api/control.d.ts.map +1 -0
- package/dist/api/control.js +60 -0
- package/dist/api/control.js.map +1 -0
- package/dist/api/events.d.ts +159 -0
- package/dist/api/events.d.ts.map +1 -0
- package/dist/api/events.js +155 -0
- package/dist/api/events.js.map +1 -0
- package/dist/api/version.d.ts +36 -0
- package/dist/api/version.d.ts.map +1 -0
- package/dist/api/version.js +146 -0
- package/dist/api/version.js.map +1 -0
- package/dist/api/visualization-server.d.ts +11 -0
- package/dist/api/visualization-server.d.ts.map +1 -0
- package/dist/api/visualization-server.js +1186 -0
- package/dist/api/visualization-server.js.map +1 -0
- package/dist/context/project-context.d.ts +57 -0
- package/dist/context/project-context.d.ts.map +1 -0
- package/dist/context/project-context.js +135 -0
- package/dist/context/project-context.js.map +1 -0
- package/dist/database/init.d.ts +49 -0
- package/dist/database/init.d.ts.map +1 -0
- package/dist/database/init.js +567 -0
- package/dist/database/init.js.map +1 -0
- package/dist/defence/__tests__/firewall.test.d.ts +8 -0
- package/dist/defence/__tests__/firewall.test.d.ts.map +1 -0
- package/dist/defence/__tests__/firewall.test.js +123 -0
- package/dist/defence/__tests__/firewall.test.js.map +1 -0
- package/dist/defence/__tests__/fragmentation.test.d.ts +7 -0
- package/dist/defence/__tests__/fragmentation.test.d.ts.map +1 -0
- package/dist/defence/__tests__/fragmentation.test.js +51 -0
- package/dist/defence/__tests__/fragmentation.test.js.map +1 -0
- package/dist/defence/__tests__/pipeline.test.d.ts +8 -0
- package/dist/defence/__tests__/pipeline.test.d.ts.map +1 -0
- package/dist/defence/__tests__/pipeline.test.js +61 -0
- package/dist/defence/__tests__/pipeline.test.js.map +1 -0
- package/dist/defence/__tests__/sensitivity.test.d.ts +7 -0
- package/dist/defence/__tests__/sensitivity.test.d.ts.map +1 -0
- package/dist/defence/__tests__/sensitivity.test.js +61 -0
- package/dist/defence/__tests__/sensitivity.test.js.map +1 -0
- package/dist/defence/__tests__/trust.test.d.ts +7 -0
- package/dist/defence/__tests__/trust.test.d.ts.map +1 -0
- package/dist/defence/__tests__/trust.test.js +49 -0
- package/dist/defence/__tests__/trust.test.js.map +1 -0
- package/dist/defence/audit/index.d.ts +4 -0
- package/dist/defence/audit/index.d.ts.map +1 -0
- package/dist/defence/audit/index.js +3 -0
- package/dist/defence/audit/index.js.map +1 -0
- package/dist/defence/audit/logger.d.ts +14 -0
- package/dist/defence/audit/logger.d.ts.map +1 -0
- package/dist/defence/audit/logger.js +54 -0
- package/dist/defence/audit/logger.js.map +1 -0
- package/dist/defence/audit/queries.d.ts +33 -0
- package/dist/defence/audit/queries.d.ts.map +1 -0
- package/dist/defence/audit/queries.js +103 -0
- package/dist/defence/audit/queries.js.map +1 -0
- package/dist/defence/firewall/anomaly-scorer.d.ts +8 -0
- package/dist/defence/firewall/anomaly-scorer.d.ts.map +1 -0
- package/dist/defence/firewall/anomaly-scorer.js +58 -0
- package/dist/defence/firewall/anomaly-scorer.js.map +1 -0
- package/dist/defence/firewall/encoding-detector.d.ts +13 -0
- package/dist/defence/firewall/encoding-detector.d.ts.map +1 -0
- package/dist/defence/firewall/encoding-detector.js +120 -0
- package/dist/defence/firewall/encoding-detector.js.map +1 -0
- package/dist/defence/firewall/index.d.ts +21 -0
- package/dist/defence/firewall/index.d.ts.map +1 -0
- package/dist/defence/firewall/index.js +133 -0
- package/dist/defence/firewall/index.js.map +1 -0
- package/dist/defence/firewall/instruction-detector.d.ts +12 -0
- package/dist/defence/firewall/instruction-detector.d.ts.map +1 -0
- package/dist/defence/firewall/instruction-detector.js +99 -0
- package/dist/defence/firewall/instruction-detector.js.map +1 -0
- package/dist/defence/firewall/privilege-detector.d.ts +13 -0
- package/dist/defence/firewall/privilege-detector.d.ts.map +1 -0
- package/dist/defence/firewall/privilege-detector.js +89 -0
- package/dist/defence/firewall/privilege-detector.js.map +1 -0
- package/dist/defence/fragmentation/assembly-detector.d.ts +18 -0
- package/dist/defence/fragmentation/assembly-detector.d.ts.map +1 -0
- package/dist/defence/fragmentation/assembly-detector.js +72 -0
- package/dist/defence/fragmentation/assembly-detector.js.map +1 -0
- package/dist/defence/fragmentation/entity-extractor.d.ts +19 -0
- package/dist/defence/fragmentation/entity-extractor.d.ts.map +1 -0
- package/dist/defence/fragmentation/entity-extractor.js +86 -0
- package/dist/defence/fragmentation/entity-extractor.js.map +1 -0
- package/dist/defence/fragmentation/index.d.ts +23 -0
- package/dist/defence/fragmentation/index.d.ts.map +1 -0
- package/dist/defence/fragmentation/index.js +49 -0
- package/dist/defence/fragmentation/index.js.map +1 -0
- package/dist/defence/fragmentation/temporal-analyzer.d.ts +28 -0
- package/dist/defence/fragmentation/temporal-analyzer.d.ts.map +1 -0
- package/dist/defence/fragmentation/temporal-analyzer.js +41 -0
- package/dist/defence/fragmentation/temporal-analyzer.js.map +1 -0
- package/dist/defence/index.d.ts +12 -0
- package/dist/defence/index.d.ts.map +1 -0
- package/dist/defence/index.js +18 -0
- package/dist/defence/index.js.map +1 -0
- package/dist/defence/pipeline.d.ts +9 -0
- package/dist/defence/pipeline.d.ts.map +1 -0
- package/dist/defence/pipeline.js +115 -0
- package/dist/defence/pipeline.js.map +1 -0
- package/dist/defence/scanner/index.d.ts +5 -0
- package/dist/defence/scanner/index.d.ts.map +1 -0
- package/dist/defence/scanner/index.js +5 -0
- package/dist/defence/scanner/index.js.map +1 -0
- package/dist/defence/scanner/scan-existing.d.ts +34 -0
- package/dist/defence/scanner/scan-existing.d.ts.map +1 -0
- package/dist/defence/scanner/scan-existing.js +136 -0
- package/dist/defence/scanner/scan-existing.js.map +1 -0
- package/dist/defence/sensitivity/classifier.d.ts +6 -0
- package/dist/defence/sensitivity/classifier.d.ts.map +1 -0
- package/dist/defence/sensitivity/classifier.js +50 -0
- package/dist/defence/sensitivity/classifier.js.map +1 -0
- package/dist/defence/sensitivity/index.d.ts +11 -0
- package/dist/defence/sensitivity/index.d.ts.map +1 -0
- package/dist/defence/sensitivity/index.js +13 -0
- package/dist/defence/sensitivity/index.js.map +1 -0
- package/dist/defence/sensitivity/patterns.d.ts +14 -0
- package/dist/defence/sensitivity/patterns.d.ts.map +1 -0
- package/dist/defence/sensitivity/patterns.js +67 -0
- package/dist/defence/sensitivity/patterns.js.map +1 -0
- package/dist/defence/sensitivity/redaction.d.ts +17 -0
- package/dist/defence/sensitivity/redaction.d.ts.map +1 -0
- package/dist/defence/sensitivity/redaction.js +47 -0
- package/dist/defence/sensitivity/redaction.js.map +1 -0
- package/dist/defence/trust/index.d.ts +3 -0
- package/dist/defence/trust/index.d.ts.map +1 -0
- package/dist/defence/trust/index.js +3 -0
- package/dist/defence/trust/index.js.map +1 -0
- package/dist/defence/trust/recall-filter.d.ts +10 -0
- package/dist/defence/trust/recall-filter.d.ts.map +1 -0
- package/dist/defence/trust/recall-filter.js +38 -0
- package/dist/defence/trust/recall-filter.js.map +1 -0
- package/dist/defence/trust/source-scorer.d.ts +6 -0
- package/dist/defence/trust/source-scorer.d.ts.map +1 -0
- package/dist/defence/trust/source-scorer.js +34 -0
- package/dist/defence/trust/source-scorer.js.map +1 -0
- package/dist/defence/types.d.ts +88 -0
- package/dist/defence/types.d.ts.map +1 -0
- package/dist/defence/types.js +15 -0
- package/dist/defence/types.js.map +1 -0
- package/dist/embeddings/generator.d.ts +20 -0
- package/dist/embeddings/generator.d.ts.map +1 -0
- package/dist/embeddings/generator.js +83 -0
- package/dist/embeddings/generator.js.map +1 -0
- package/dist/embeddings/index.d.ts +2 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +2 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/errors.d.ts +74 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +131 -0
- package/dist/errors.js.map +1 -0
- package/dist/graph/backfill.d.ts +6 -0
- package/dist/graph/backfill.d.ts.map +1 -0
- package/dist/graph/backfill.js +33 -0
- package/dist/graph/backfill.js.map +1 -0
- package/dist/graph/extract.d.ts +21 -0
- package/dist/graph/extract.d.ts.map +1 -0
- package/dist/graph/extract.js +231 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/resolve.d.ts +6 -0
- package/dist/graph/resolve.d.ts.map +1 -0
- package/dist/graph/resolve.js +126 -0
- package/dist/graph/resolve.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +248 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/activation.d.ts +69 -0
- package/dist/memory/activation.d.ts.map +1 -0
- package/dist/memory/activation.js +168 -0
- package/dist/memory/activation.js.map +1 -0
- package/dist/memory/consolidate.d.ts +98 -0
- package/dist/memory/consolidate.d.ts.map +1 -0
- package/dist/memory/consolidate.js +511 -0
- package/dist/memory/consolidate.js.map +1 -0
- package/dist/memory/contradiction.d.ts +69 -0
- package/dist/memory/contradiction.d.ts.map +1 -0
- package/dist/memory/contradiction.js +286 -0
- package/dist/memory/contradiction.js.map +1 -0
- package/dist/memory/decay.d.ts +62 -0
- package/dist/memory/decay.d.ts.map +1 -0
- package/dist/memory/decay.js +184 -0
- package/dist/memory/decay.js.map +1 -0
- package/dist/memory/salience.d.ts +36 -0
- package/dist/memory/salience.d.ts.map +1 -0
- package/dist/memory/salience.js +216 -0
- package/dist/memory/salience.js.map +1 -0
- package/dist/memory/similarity.d.ts +57 -0
- package/dist/memory/similarity.d.ts.map +1 -0
- package/dist/memory/similarity.js +114 -0
- package/dist/memory/similarity.js.map +1 -0
- package/dist/memory/store.d.ts +179 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +1184 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/memory/types.d.ts +97 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +30 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +568 -0
- package/dist/server.js.map +1 -0
- package/dist/service/install.d.ts +15 -0
- package/dist/service/install.d.ts.map +1 -0
- package/dist/service/install.js +178 -0
- package/dist/service/install.js.map +1 -0
- package/dist/service/templates.d.ts +13 -0
- package/dist/service/templates.d.ts.map +1 -0
- package/dist/service/templates.js +58 -0
- package/dist/service/templates.js.map +1 -0
- package/dist/setup/claude-md.d.ts +12 -0
- package/dist/setup/claude-md.d.ts.map +1 -0
- package/dist/setup/claude-md.js +68 -0
- package/dist/setup/claude-md.js.map +1 -0
- package/dist/setup/clawdbot.d.ts +15 -0
- package/dist/setup/clawdbot.d.ts.map +1 -0
- package/dist/setup/clawdbot.js +118 -0
- package/dist/setup/clawdbot.js.map +1 -0
- package/dist/setup/doctor.d.ts +5 -0
- package/dist/setup/doctor.d.ts.map +1 -0
- package/dist/setup/doctor.js +141 -0
- package/dist/setup/doctor.js.map +1 -0
- package/dist/setup/hooks.d.ts +6 -0
- package/dist/setup/hooks.d.ts.map +1 -0
- package/dist/setup/hooks.js +36 -0
- package/dist/setup/hooks.js.map +1 -0
- package/dist/setup/migrate.d.ts +16 -0
- package/dist/setup/migrate.d.ts.map +1 -0
- package/dist/setup/migrate.js +164 -0
- package/dist/setup/migrate.js.map +1 -0
- package/dist/setup/settings-hooks.d.ts +7 -0
- package/dist/setup/settings-hooks.d.ts.map +1 -0
- package/dist/setup/settings-hooks.js +83 -0
- package/dist/setup/settings-hooks.js.map +1 -0
- package/dist/setup/uninstall.d.ts +12 -0
- package/dist/setup/uninstall.d.ts.map +1 -0
- package/dist/setup/uninstall.js +125 -0
- package/dist/setup/uninstall.js.map +1 -0
- package/dist/tools/context.d.ts +135 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +273 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/forget.d.ts +53 -0
- package/dist/tools/forget.d.ts.map +1 -0
- package/dist/tools/forget.js +179 -0
- package/dist/tools/forget.js.map +1 -0
- package/dist/tools/graph.d.ts +46 -0
- package/dist/tools/graph.d.ts.map +1 -0
- package/dist/tools/graph.js +206 -0
- package/dist/tools/graph.js.map +1 -0
- package/dist/tools/recall.d.ts +79 -0
- package/dist/tools/recall.d.ts.map +1 -0
- package/dist/tools/recall.js +156 -0
- package/dist/tools/recall.js.map +1 -0
- package/dist/tools/remember.d.ts +83 -0
- package/dist/tools/remember.d.ts.map +1 -0
- package/dist/tools/remember.js +151 -0
- package/dist/tools/remember.js.map +1 -0
- package/dist/worker/brain-worker.d.ts +100 -0
- package/dist/worker/brain-worker.d.ts.map +1 -0
- package/dist/worker/brain-worker.js +283 -0
- package/dist/worker/brain-worker.js.map +1 -0
- package/dist/worker/link-discovery.d.ts +47 -0
- package/dist/worker/link-discovery.d.ts.map +1 -0
- package/dist/worker/link-discovery.js +103 -0
- package/dist/worker/link-discovery.js.map +1 -0
- package/dist/worker/predictive-consolidation.d.ts +46 -0
- package/dist/worker/predictive-consolidation.d.ts.map +1 -0
- package/dist/worker/predictive-consolidation.js +110 -0
- package/dist/worker/predictive-consolidation.js.map +1 -0
- package/dist/worker/types.d.ts +91 -0
- package/dist/worker/types.d.ts.map +1 -0
- package/dist/worker/types.js +22 -0
- package/dist/worker/types.js.map +1 -0
- package/hooks/clawdbot/cortex-memory/HOOK.md +71 -0
- package/hooks/clawdbot/cortex-memory/handler.js +279 -0
- package/package.json +73 -0
- package/scripts/pre-compact-hook.mjs +716 -0
- package/scripts/session-end-hook.mjs +548 -0
- package/scripts/session-start-hook.mjs +221 -0
- package/scripts/start-dashboard.sh +41 -0
- package/scripts/stop-dashboard.sh +21 -0
- package/scripts/stop-hook.mjs +163 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Section Label
|
|
5
|
+
* Labels for memory bank sections (STM, Episodic, LTM)
|
|
6
|
+
* Includes count display
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Html } from '@react-three/drei';
|
|
10
|
+
import { MemoryType } from '@/types/memory';
|
|
11
|
+
|
|
12
|
+
interface SectionLabelProps {
|
|
13
|
+
type: MemoryType;
|
|
14
|
+
count: number;
|
|
15
|
+
maxCount: number;
|
|
16
|
+
position: [number, number, number];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const SECTION_CONFIG: Record<MemoryType, { label: string; color: string; bgColor: string }> = {
|
|
20
|
+
short_term: {
|
|
21
|
+
label: 'STM BANK',
|
|
22
|
+
color: '#f97316', // orange
|
|
23
|
+
bgColor: 'rgba(249, 115, 22, 0.1)',
|
|
24
|
+
},
|
|
25
|
+
episodic: {
|
|
26
|
+
label: 'EPISODIC BANK',
|
|
27
|
+
color: '#a855f7', // purple
|
|
28
|
+
bgColor: 'rgba(168, 85, 247, 0.1)',
|
|
29
|
+
},
|
|
30
|
+
long_term: {
|
|
31
|
+
label: 'LONG-TERM BANK',
|
|
32
|
+
color: '#3b82f6', // blue
|
|
33
|
+
bgColor: 'rgba(59, 130, 246, 0.1)',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export function SectionLabel({ type, count, maxCount, position }: SectionLabelProps) {
|
|
38
|
+
const config = SECTION_CONFIG[type];
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Html
|
|
42
|
+
position={position}
|
|
43
|
+
center
|
|
44
|
+
style={{
|
|
45
|
+
pointerEvents: 'none',
|
|
46
|
+
userSelect: 'none',
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
className="flex items-center gap-3 px-3 py-1.5 rounded border font-mono text-xs tracking-wider"
|
|
51
|
+
style={{
|
|
52
|
+
backgroundColor: config.bgColor,
|
|
53
|
+
borderColor: `${config.color}40`,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<span style={{ color: config.color }}>{config.label}</span>
|
|
57
|
+
<span className="text-slate-500">|</span>
|
|
58
|
+
<span className="text-slate-400">
|
|
59
|
+
{count}/{maxCount}
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
</Html>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// All section labels together
|
|
67
|
+
interface AllSectionLabelsProps {
|
|
68
|
+
stmCount: number;
|
|
69
|
+
episodicCount: number;
|
|
70
|
+
ltmCount: number;
|
|
71
|
+
chipWidth: number;
|
|
72
|
+
chipHeight: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function AllSectionLabels({
|
|
76
|
+
stmCount,
|
|
77
|
+
episodicCount,
|
|
78
|
+
ltmCount,
|
|
79
|
+
chipWidth,
|
|
80
|
+
chipHeight,
|
|
81
|
+
}: AllSectionLabelsProps) {
|
|
82
|
+
const sectionHeight = chipHeight / 3;
|
|
83
|
+
const halfChipHeight = chipHeight / 2;
|
|
84
|
+
const halfChipWidth = chipWidth / 2;
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<group>
|
|
88
|
+
{/* STM label (top) */}
|
|
89
|
+
<SectionLabel
|
|
90
|
+
type="short_term"
|
|
91
|
+
count={stmCount}
|
|
92
|
+
maxCount={100}
|
|
93
|
+
position={[-halfChipWidth + 1.5, halfChipHeight - 0.3, 0.3]}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
{/* Episodic label (middle left) */}
|
|
97
|
+
<SectionLabel
|
|
98
|
+
type="episodic"
|
|
99
|
+
count={episodicCount}
|
|
100
|
+
maxCount={500}
|
|
101
|
+
position={[-halfChipWidth + 1.5, 0, 0.3]}
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
{/* LTM label (bottom) */}
|
|
105
|
+
<SectionLabel
|
|
106
|
+
type="long_term"
|
|
107
|
+
count={ltmCount}
|
|
108
|
+
maxCount={1000}
|
|
109
|
+
position={[-halfChipWidth + 1.5, -halfChipHeight + sectionHeight - 0.3, 0.3]}
|
|
110
|
+
/>
|
|
111
|
+
</group>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chip Components
|
|
3
|
+
* Export all chip visualization components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { ChipScene } from './ChipScene';
|
|
7
|
+
export { ChipSubstrate } from './ChipSubstrate';
|
|
8
|
+
export { CortexCore } from './CortexCore';
|
|
9
|
+
export { DataBus, DataBusPulse } from './DataBus';
|
|
10
|
+
export type { AccessPulseData } from './DataBus';
|
|
11
|
+
export { MemoryCell, MemoryCellFlash } from './MemoryCell';
|
|
12
|
+
export { QuantumCell } from './QuantumCell';
|
|
13
|
+
export { MemoryGrid, EpisodicMemoryGrid, getMemoryGridPosition } from './MemoryGrid';
|
|
14
|
+
export { SectionLabel, AllSectionLabels } from './SectionLabel';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Control Panel Component
|
|
5
|
+
*
|
|
6
|
+
* Provides controls for pausing/resuming memory creation
|
|
7
|
+
* and displays server status including uptime.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useControlStatus, usePauseMemory, useResumeMemory, useConsolidate } from '@/hooks/useMemories';
|
|
11
|
+
import { Button } from '@/components/ui/button';
|
|
12
|
+
import { VersionPanel } from './VersionPanel';
|
|
13
|
+
|
|
14
|
+
export function ControlPanel() {
|
|
15
|
+
const { data: status, isLoading } = useControlStatus();
|
|
16
|
+
const pauseMutation = usePauseMemory();
|
|
17
|
+
const resumeMutation = useResumeMemory();
|
|
18
|
+
const consolidateMutation = useConsolidate();
|
|
19
|
+
|
|
20
|
+
const isPaused = status?.paused ?? false;
|
|
21
|
+
const isToggling = pauseMutation.isPending || resumeMutation.isPending;
|
|
22
|
+
|
|
23
|
+
const handleTogglePause = () => {
|
|
24
|
+
if (isPaused) {
|
|
25
|
+
resumeMutation.mutate();
|
|
26
|
+
} else {
|
|
27
|
+
pauseMutation.mutate();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const handleConsolidate = () => {
|
|
32
|
+
consolidateMutation.mutate();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
if (isLoading) {
|
|
36
|
+
return (
|
|
37
|
+
<div className="p-3 rounded-lg bg-slate-800/50 border border-slate-700 animate-pulse">
|
|
38
|
+
<div className="h-4 bg-slate-700 rounded w-24 mb-2"></div>
|
|
39
|
+
<div className="h-8 bg-slate-700 rounded w-full"></div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="space-y-3">
|
|
46
|
+
{/* Status Banner (only when paused) */}
|
|
47
|
+
{isPaused && (
|
|
48
|
+
<div className="px-3 py-2 rounded-lg bg-orange-500/20 border border-orange-500/50 text-orange-300 text-sm flex items-center gap-2">
|
|
49
|
+
<span className="text-lg">⏸</span>
|
|
50
|
+
<span>Memory creation paused</span>
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
|
|
54
|
+
{/* Server Status */}
|
|
55
|
+
<div className="p-3 rounded-lg bg-slate-800/50 border border-slate-700">
|
|
56
|
+
<div className="flex items-center justify-between mb-3">
|
|
57
|
+
<span className="text-sm text-slate-400">Server Status</span>
|
|
58
|
+
<div className="flex items-center gap-2">
|
|
59
|
+
<span
|
|
60
|
+
className={`w-2 h-2 rounded-full ${isPaused ? 'bg-orange-500' : 'bg-green-500'}`}
|
|
61
|
+
/>
|
|
62
|
+
<span className="text-xs text-slate-300">
|
|
63
|
+
{isPaused ? 'Paused' : 'Active'}
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div className="text-xs text-slate-500 mb-3">
|
|
69
|
+
Uptime: {status?.uptimeFormatted || '—'}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
{/* Control Buttons */}
|
|
73
|
+
<div className="grid grid-cols-2 gap-2">
|
|
74
|
+
<Button
|
|
75
|
+
variant="outline"
|
|
76
|
+
size="sm"
|
|
77
|
+
onClick={handleTogglePause}
|
|
78
|
+
disabled={isToggling}
|
|
79
|
+
className={`text-xs ${
|
|
80
|
+
isPaused
|
|
81
|
+
? 'border-green-600 text-green-400 hover:bg-green-600/20 hover:text-green-300'
|
|
82
|
+
: 'border-orange-600 text-orange-400 hover:bg-orange-600/20 hover:text-orange-300'
|
|
83
|
+
}`}
|
|
84
|
+
title={isPaused ? 'Resume memory creation' : 'Pause memory creation'}
|
|
85
|
+
>
|
|
86
|
+
{isToggling ? '...' : isPaused ? '▶ Resume' : '⏸ Pause'}
|
|
87
|
+
</Button>
|
|
88
|
+
|
|
89
|
+
<Button
|
|
90
|
+
variant="outline"
|
|
91
|
+
size="sm"
|
|
92
|
+
onClick={handleConsolidate}
|
|
93
|
+
disabled={consolidateMutation.isPending}
|
|
94
|
+
className="text-xs border-slate-600 text-slate-300 hover:bg-slate-600/20"
|
|
95
|
+
title="Consolidate memories (promote STM to LTM)"
|
|
96
|
+
>
|
|
97
|
+
{consolidateMutation.isPending ? '...' : '🔄 Sync'}
|
|
98
|
+
</Button>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{/* Version Panel */}
|
|
103
|
+
<VersionPanel />
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Version Panel Component
|
|
5
|
+
*
|
|
6
|
+
* Displays current version, checks for updates, and allows
|
|
7
|
+
* updating and restarting the server.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import {
|
|
12
|
+
useVersion,
|
|
13
|
+
useForceCheckForUpdates,
|
|
14
|
+
usePerformUpdate,
|
|
15
|
+
useRestartServer,
|
|
16
|
+
VersionInfo,
|
|
17
|
+
} from '@/hooks/useMemories';
|
|
18
|
+
import { Button } from '@/components/ui/button';
|
|
19
|
+
|
|
20
|
+
type UpdateState = 'idle' | 'checking' | 'updating' | 'restarting' | 'success' | 'error';
|
|
21
|
+
|
|
22
|
+
export function VersionPanel() {
|
|
23
|
+
const [updateState, setUpdateState] = useState<UpdateState>('idle');
|
|
24
|
+
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
|
25
|
+
const [showRestartPrompt, setShowRestartPrompt] = useState(false);
|
|
26
|
+
const [updateInfo, setUpdateInfo] = useState<VersionInfo | null>(null);
|
|
27
|
+
|
|
28
|
+
const { data: versionData, isLoading: versionLoading } = useVersion();
|
|
29
|
+
const checkMutation = useForceCheckForUpdates();
|
|
30
|
+
const updateMutation = usePerformUpdate();
|
|
31
|
+
const restartMutation = useRestartServer();
|
|
32
|
+
|
|
33
|
+
const handleCheckUpdates = async () => {
|
|
34
|
+
setUpdateState('checking');
|
|
35
|
+
setErrorMessage(null);
|
|
36
|
+
try {
|
|
37
|
+
const result = await checkMutation.mutateAsync();
|
|
38
|
+
setUpdateInfo(result);
|
|
39
|
+
setUpdateState('idle');
|
|
40
|
+
} catch {
|
|
41
|
+
setErrorMessage('Failed to check for updates');
|
|
42
|
+
setUpdateState('error');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const handleUpdate = async () => {
|
|
47
|
+
setUpdateState('updating');
|
|
48
|
+
setErrorMessage(null);
|
|
49
|
+
try {
|
|
50
|
+
const result = await updateMutation.mutateAsync();
|
|
51
|
+
if (result.success) {
|
|
52
|
+
setUpdateState('success');
|
|
53
|
+
if (result.requiresRestart) {
|
|
54
|
+
setShowRestartPrompt(true);
|
|
55
|
+
}
|
|
56
|
+
// Clear update info since we just updated
|
|
57
|
+
setUpdateInfo(null);
|
|
58
|
+
} else {
|
|
59
|
+
setErrorMessage(result.error || 'Update failed');
|
|
60
|
+
setUpdateState('error');
|
|
61
|
+
}
|
|
62
|
+
} catch (err) {
|
|
63
|
+
setErrorMessage('Update failed: ' + (err as Error).message);
|
|
64
|
+
setUpdateState('error');
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const handleRestart = async () => {
|
|
69
|
+
if (
|
|
70
|
+
!confirm(
|
|
71
|
+
'This will restart the server. The page will need to be refreshed after restart. Continue?'
|
|
72
|
+
)
|
|
73
|
+
) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
setUpdateState('restarting');
|
|
78
|
+
try {
|
|
79
|
+
await restartMutation.mutateAsync();
|
|
80
|
+
// Show message to refresh page - server will disconnect
|
|
81
|
+
setErrorMessage(null);
|
|
82
|
+
} catch {
|
|
83
|
+
setErrorMessage('Failed to restart server');
|
|
84
|
+
setUpdateState('error');
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
if (versionLoading) {
|
|
89
|
+
return (
|
|
90
|
+
<div className="p-3 rounded-lg bg-slate-800/50 border border-slate-700 animate-pulse">
|
|
91
|
+
<div className="h-4 bg-slate-700 rounded w-24"></div>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const hasUpdate = updateInfo?.updateAvailable;
|
|
97
|
+
const currentVersion = versionData?.version || 'unknown';
|
|
98
|
+
const latestVersion = updateInfo?.latestVersion;
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className="p-3 rounded-lg bg-slate-800/50 border border-slate-700">
|
|
102
|
+
{/* Version Display */}
|
|
103
|
+
<div className="flex items-center justify-between mb-3">
|
|
104
|
+
<span className="text-sm text-slate-400">Version</span>
|
|
105
|
+
<div className="flex items-center gap-2">
|
|
106
|
+
<span className="text-sm font-mono text-slate-300">v{currentVersion}</span>
|
|
107
|
+
{hasUpdate && (
|
|
108
|
+
<span className="px-1.5 py-0.5 text-xs rounded bg-green-500/20 text-green-400 border border-green-500/30">
|
|
109
|
+
Update available
|
|
110
|
+
</span>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
{/* Update Info */}
|
|
116
|
+
{updateInfo && latestVersion && currentVersion !== latestVersion && (
|
|
117
|
+
<div className="text-xs text-slate-500 mb-3">
|
|
118
|
+
Latest: v{latestVersion}
|
|
119
|
+
{updateInfo.cacheHit && <span className="text-slate-600"> (cached)</span>}
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
|
|
123
|
+
{/* Error Message */}
|
|
124
|
+
{errorMessage && (
|
|
125
|
+
<div className="px-2 py-1.5 mb-3 rounded text-xs bg-red-500/20 border border-red-500/30 text-red-300">
|
|
126
|
+
{errorMessage}
|
|
127
|
+
</div>
|
|
128
|
+
)}
|
|
129
|
+
|
|
130
|
+
{/* Success Message with Restart Prompt */}
|
|
131
|
+
{updateState === 'success' && showRestartPrompt && (
|
|
132
|
+
<div className="px-2 py-1.5 mb-3 rounded text-xs bg-green-500/20 border border-green-500/30 text-green-300">
|
|
133
|
+
Update complete! Restart the server to apply changes.
|
|
134
|
+
</div>
|
|
135
|
+
)}
|
|
136
|
+
|
|
137
|
+
{/* Restarting Message */}
|
|
138
|
+
{updateState === 'restarting' && (
|
|
139
|
+
<div className="px-2 py-1.5 mb-3 rounded text-xs bg-orange-500/20 border border-orange-500/30 text-orange-300">
|
|
140
|
+
Restarting server... Refresh the page in a few seconds.
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
{/* Action Buttons */}
|
|
145
|
+
<div className="flex gap-2">
|
|
146
|
+
<Button
|
|
147
|
+
variant="outline"
|
|
148
|
+
size="sm"
|
|
149
|
+
onClick={handleCheckUpdates}
|
|
150
|
+
disabled={checkMutation.isPending || updateState === 'updating'}
|
|
151
|
+
className="flex-1 border-slate-600 text-slate-300 hover:bg-slate-600/20"
|
|
152
|
+
title="Check npm for newer versions"
|
|
153
|
+
>
|
|
154
|
+
{checkMutation.isPending || updateState === 'checking' ? '...' : 'Check Updates'}
|
|
155
|
+
</Button>
|
|
156
|
+
|
|
157
|
+
{hasUpdate && (
|
|
158
|
+
<Button
|
|
159
|
+
variant="outline"
|
|
160
|
+
size="sm"
|
|
161
|
+
onClick={handleUpdate}
|
|
162
|
+
disabled={updateState === 'updating' || updateState === 'restarting'}
|
|
163
|
+
className="flex-1 border-green-600 text-green-400 hover:bg-green-600/20 hover:text-green-300"
|
|
164
|
+
title="Update to latest version via npm"
|
|
165
|
+
>
|
|
166
|
+
{updateState === 'updating' ? '...' : 'Update'}
|
|
167
|
+
</Button>
|
|
168
|
+
)}
|
|
169
|
+
|
|
170
|
+
{showRestartPrompt && (
|
|
171
|
+
<Button
|
|
172
|
+
variant="outline"
|
|
173
|
+
size="sm"
|
|
174
|
+
onClick={handleRestart}
|
|
175
|
+
disabled={updateState === 'restarting'}
|
|
176
|
+
className="flex-1 border-orange-600 text-orange-400 hover:bg-orange-600/20 hover:text-orange-300"
|
|
177
|
+
title="Restart the server to apply updates"
|
|
178
|
+
>
|
|
179
|
+
{updateState === 'restarting' ? '...' : 'Restart'}
|
|
180
|
+
</Button>
|
|
181
|
+
)}
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stats Panel
|
|
5
|
+
* Displays memory statistics and health metrics
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
9
|
+
import { MemoryStats } from '@/types/memory';
|
|
10
|
+
import { CATEGORY_COLORS } from '@/lib/category-colors';
|
|
11
|
+
|
|
12
|
+
interface StatsPanelProps {
|
|
13
|
+
stats: MemoryStats | undefined;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function StatsPanel({ stats, isLoading }: StatsPanelProps) {
|
|
18
|
+
if (isLoading) {
|
|
19
|
+
return (
|
|
20
|
+
<div className="space-y-4 animate-pulse">
|
|
21
|
+
<div className="h-32 bg-slate-800 rounded-lg" />
|
|
22
|
+
<div className="h-48 bg-slate-800 rounded-lg" />
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!stats) {
|
|
28
|
+
return (
|
|
29
|
+
<Card className="bg-slate-900 border-slate-700">
|
|
30
|
+
<CardContent className="p-4 text-slate-400 text-center">
|
|
31
|
+
No data available
|
|
32
|
+
</CardContent>
|
|
33
|
+
</Card>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const healthPercentage = stats.decayDistribution
|
|
38
|
+
? Math.round(
|
|
39
|
+
(stats.decayDistribution.healthy /
|
|
40
|
+
(stats.decayDistribution.healthy +
|
|
41
|
+
stats.decayDistribution.fading +
|
|
42
|
+
stats.decayDistribution.critical)) *
|
|
43
|
+
100
|
|
44
|
+
) || 0
|
|
45
|
+
: 0;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="space-y-4">
|
|
49
|
+
{/* Health Indicator */}
|
|
50
|
+
<Card className="bg-slate-900 border-slate-700">
|
|
51
|
+
<CardHeader className="pb-2">
|
|
52
|
+
<CardTitle className="text-sm font-medium text-slate-300">
|
|
53
|
+
System Health
|
|
54
|
+
</CardTitle>
|
|
55
|
+
</CardHeader>
|
|
56
|
+
<CardContent className="space-y-3">
|
|
57
|
+
<div className="flex items-center gap-3">
|
|
58
|
+
<div
|
|
59
|
+
className={`w-3 h-3 rounded-full ${
|
|
60
|
+
healthPercentage > 70
|
|
61
|
+
? 'bg-green-500'
|
|
62
|
+
: healthPercentage > 40
|
|
63
|
+
? 'bg-yellow-500'
|
|
64
|
+
: 'bg-red-500'
|
|
65
|
+
}`}
|
|
66
|
+
/>
|
|
67
|
+
<span className="text-white font-medium">{healthPercentage}% Healthy</span>
|
|
68
|
+
</div>
|
|
69
|
+
{stats.decayDistribution && (
|
|
70
|
+
<div className="flex gap-1 h-2 rounded-full overflow-hidden">
|
|
71
|
+
<div
|
|
72
|
+
className="bg-green-500 transition-all"
|
|
73
|
+
style={{
|
|
74
|
+
width: `${
|
|
75
|
+
(stats.decayDistribution.healthy / stats.total) * 100
|
|
76
|
+
}%`,
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
<div
|
|
80
|
+
className="bg-yellow-500 transition-all"
|
|
81
|
+
style={{
|
|
82
|
+
width: `${
|
|
83
|
+
(stats.decayDistribution.fading / stats.total) * 100
|
|
84
|
+
}%`,
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
<div
|
|
88
|
+
className="bg-red-500 transition-all"
|
|
89
|
+
style={{
|
|
90
|
+
width: `${
|
|
91
|
+
(stats.decayDistribution.critical / stats.total) * 100
|
|
92
|
+
}%`,
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
<div className="text-xs text-slate-400">
|
|
98
|
+
Avg Salience: {(stats.averageSalience * 100).toFixed(0)}%
|
|
99
|
+
</div>
|
|
100
|
+
</CardContent>
|
|
101
|
+
</Card>
|
|
102
|
+
|
|
103
|
+
{/* Memory Counts */}
|
|
104
|
+
<Card className="bg-slate-900 border-slate-700">
|
|
105
|
+
<CardHeader className="pb-2">
|
|
106
|
+
<CardTitle className="text-sm font-medium text-slate-300">
|
|
107
|
+
Memory Stats
|
|
108
|
+
</CardTitle>
|
|
109
|
+
</CardHeader>
|
|
110
|
+
<CardContent className="space-y-2">
|
|
111
|
+
<div className="flex justify-between items-center">
|
|
112
|
+
<span className="text-slate-400">Total</span>
|
|
113
|
+
<span className="text-white font-mono">{stats.total}</span>
|
|
114
|
+
</div>
|
|
115
|
+
<div className="flex justify-between items-center">
|
|
116
|
+
<span className="text-orange-400">Short-Term</span>
|
|
117
|
+
<span className="text-white font-mono">{stats.shortTerm}</span>
|
|
118
|
+
</div>
|
|
119
|
+
<div className="flex justify-between items-center">
|
|
120
|
+
<span className="text-blue-400">Long-Term</span>
|
|
121
|
+
<span className="text-white font-mono">{stats.longTerm}</span>
|
|
122
|
+
</div>
|
|
123
|
+
<div className="flex justify-between items-center">
|
|
124
|
+
<span className="text-purple-400">Episodic</span>
|
|
125
|
+
<span className="text-white font-mono">{stats.episodic}</span>
|
|
126
|
+
</div>
|
|
127
|
+
</CardContent>
|
|
128
|
+
</Card>
|
|
129
|
+
|
|
130
|
+
{/* Categories */}
|
|
131
|
+
<Card className="bg-slate-900 border-slate-700">
|
|
132
|
+
<CardHeader className="pb-2">
|
|
133
|
+
<CardTitle className="text-sm font-medium text-slate-300">
|
|
134
|
+
By Category
|
|
135
|
+
</CardTitle>
|
|
136
|
+
</CardHeader>
|
|
137
|
+
<CardContent className="space-y-2">
|
|
138
|
+
{Object.entries(stats.byCategory)
|
|
139
|
+
.sort(([, a], [, b]) => b - a)
|
|
140
|
+
.slice(0, 6)
|
|
141
|
+
.map(([category, count]) => (
|
|
142
|
+
<div key={category} className="space-y-1">
|
|
143
|
+
<div className="flex justify-between items-center text-xs">
|
|
144
|
+
<span className="text-slate-400 capitalize">{category}</span>
|
|
145
|
+
<span className="text-white font-mono">{count}</span>
|
|
146
|
+
</div>
|
|
147
|
+
<div className="h-1.5 bg-slate-800 rounded-full overflow-hidden">
|
|
148
|
+
<div
|
|
149
|
+
className="h-full rounded-full transition-all"
|
|
150
|
+
style={{
|
|
151
|
+
width: `${(count / stats.total) * 100}%`,
|
|
152
|
+
backgroundColor:
|
|
153
|
+
CATEGORY_COLORS[category as keyof typeof CATEGORY_COLORS] ||
|
|
154
|
+
'#6B7280',
|
|
155
|
+
}}
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
))}
|
|
160
|
+
</CardContent>
|
|
161
|
+
</Card>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
}
|