shieldcortex 2.1.0 → 2.1.2

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 (77) hide show
  1. package/README.md +1 -1
  2. package/hooks/clawdbot/cortex-memory/HOOK.md +2 -2
  3. package/package.json +32 -9
  4. package/dashboard/components.json +0 -22
  5. package/dashboard/eslint.config.mjs +0 -42
  6. package/dashboard/next.config.ts +0 -7
  7. package/dashboard/package-lock.json +0 -8053
  8. package/dashboard/package.json +0 -44
  9. package/dashboard/postcss.config.mjs +0 -7
  10. package/dashboard/public/file.svg +0 -1
  11. package/dashboard/public/globe.svg +0 -1
  12. package/dashboard/public/next.svg +0 -1
  13. package/dashboard/public/vercel.svg +0 -1
  14. package/dashboard/public/window.svg +0 -1
  15. package/dashboard/scripts/ensure-api.mjs +0 -76
  16. package/dashboard/src/app/error.tsx +0 -49
  17. package/dashboard/src/app/favicon.ico +0 -0
  18. package/dashboard/src/app/globals.css +0 -130
  19. package/dashboard/src/app/layout.tsx +0 -35
  20. package/dashboard/src/app/page.tsx +0 -364
  21. package/dashboard/src/components/Providers.tsx +0 -27
  22. package/dashboard/src/components/brain/ActivityPulseSystem.tsx +0 -229
  23. package/dashboard/src/components/brain/BrainMesh.tsx +0 -133
  24. package/dashboard/src/components/brain/BrainRegions.tsx +0 -254
  25. package/dashboard/src/components/brain/BrainScene.tsx +0 -255
  26. package/dashboard/src/components/brain/CategoryLabels.tsx +0 -103
  27. package/dashboard/src/components/brain/CoreSphere.tsx +0 -215
  28. package/dashboard/src/components/brain/DataFlowParticles.tsx +0 -123
  29. package/dashboard/src/components/brain/DataStreamRings.tsx +0 -161
  30. package/dashboard/src/components/brain/ElectronFlow.tsx +0 -323
  31. package/dashboard/src/components/brain/HolographicGrid.tsx +0 -235
  32. package/dashboard/src/components/brain/MemoryLinks.tsx +0 -271
  33. package/dashboard/src/components/brain/MemoryNode.tsx +0 -245
  34. package/dashboard/src/components/brain/NeuralPathways.tsx +0 -441
  35. package/dashboard/src/components/brain/SynapseNodes.tsx +0 -312
  36. package/dashboard/src/components/brain/TimelineControls.tsx +0 -205
  37. package/dashboard/src/components/chip/ChipScene.tsx +0 -497
  38. package/dashboard/src/components/chip/ChipSubstrate.tsx +0 -238
  39. package/dashboard/src/components/chip/CortexCore.tsx +0 -210
  40. package/dashboard/src/components/chip/DataBus.tsx +0 -416
  41. package/dashboard/src/components/chip/MemoryCell.tsx +0 -225
  42. package/dashboard/src/components/chip/MemoryGrid.tsx +0 -328
  43. package/dashboard/src/components/chip/QuantumCell.tsx +0 -316
  44. package/dashboard/src/components/chip/SectionLabel.tsx +0 -113
  45. package/dashboard/src/components/chip/index.ts +0 -14
  46. package/dashboard/src/components/controls/ControlPanel.tsx +0 -106
  47. package/dashboard/src/components/controls/VersionPanel.tsx +0 -185
  48. package/dashboard/src/components/dashboard/StatsPanel.tsx +0 -164
  49. package/dashboard/src/components/debug/ActivityLog.tsx +0 -250
  50. package/dashboard/src/components/debug/DebugPanel.tsx +0 -101
  51. package/dashboard/src/components/debug/QueryTester.tsx +0 -192
  52. package/dashboard/src/components/debug/RelationshipGraph.tsx +0 -403
  53. package/dashboard/src/components/debug/SqlConsole.tsx +0 -319
  54. package/dashboard/src/components/graph/KnowledgeGraph.tsx +0 -230
  55. package/dashboard/src/components/graph/OntologyGraph.tsx +0 -631
  56. package/dashboard/src/components/insights/ActivityHeatmap.tsx +0 -131
  57. package/dashboard/src/components/insights/InsightsView.tsx +0 -46
  58. package/dashboard/src/components/insights/KnowledgeMapPanel.tsx +0 -80
  59. package/dashboard/src/components/insights/QualityPanel.tsx +0 -116
  60. package/dashboard/src/components/memories/MemoriesView.tsx +0 -150
  61. package/dashboard/src/components/memories/MemoryCard.tsx +0 -103
  62. package/dashboard/src/components/memory/MemoryDetail.tsx +0 -325
  63. package/dashboard/src/components/nav/NavRail.tsx +0 -54
  64. package/dashboard/src/components/ui/button.tsx +0 -62
  65. package/dashboard/src/components/ui/card.tsx +0 -92
  66. package/dashboard/src/components/ui/input.tsx +0 -21
  67. package/dashboard/src/hooks/useDebouncedValue.ts +0 -24
  68. package/dashboard/src/hooks/useMemories.ts +0 -458
  69. package/dashboard/src/hooks/useSuggestions.ts +0 -46
  70. package/dashboard/src/lib/category-colors.ts +0 -84
  71. package/dashboard/src/lib/position-algorithm.ts +0 -177
  72. package/dashboard/src/lib/simplex-noise.ts +0 -217
  73. package/dashboard/src/lib/store.ts +0 -88
  74. package/dashboard/src/lib/utils.ts +0 -6
  75. package/dashboard/src/lib/websocket.ts +0 -249
  76. package/dashboard/src/types/memory.ts +0 -73
  77. package/dashboard/tsconfig.json +0 -34
@@ -1,238 +0,0 @@
1
- 'use client';
2
-
3
- /**
4
- * Chip Substrate
5
- * The base silicon die with grid texture, borders, and corner pins
6
- */
7
-
8
- import { useMemo, useRef } from 'react';
9
- import { useFrame } from '@react-three/fiber';
10
- import * as THREE from 'three';
11
-
12
- interface ChipSubstrateProps {
13
- width?: number;
14
- height?: number;
15
- position?: [number, number, number];
16
- }
17
-
18
- // Shared geometries for performance
19
- const PIN_GEOMETRY = new THREE.SphereGeometry(0.15, 8, 8);
20
- const PIN_MATERIAL = new THREE.MeshStandardMaterial({
21
- color: '#9ca3af',
22
- metalness: 0.8,
23
- roughness: 0.2,
24
- });
25
-
26
- export function ChipSubstrate({
27
- width = 16,
28
- height = 12,
29
- position = [0, 0, 0],
30
- }: ChipSubstrateProps) {
31
- const gridRef = useRef<THREE.LineSegments>(null);
32
-
33
- // Create substrate plane with grid texture
34
- const substrateMaterial = useMemo(() => {
35
- return new THREE.MeshStandardMaterial({
36
- color: '#1a1a2e',
37
- metalness: 0.1,
38
- roughness: 0.8,
39
- side: THREE.DoubleSide,
40
- });
41
- }, []);
42
-
43
- // Create grid lines
44
- const gridGeometry = useMemo(() => {
45
- const points: THREE.Vector3[] = [];
46
- const gridSpacing = 0.5;
47
- const halfWidth = width / 2;
48
- const halfHeight = height / 2;
49
-
50
- // Vertical lines
51
- for (let x = -halfWidth; x <= halfWidth; x += gridSpacing) {
52
- points.push(new THREE.Vector3(x, -halfHeight, 0.01));
53
- points.push(new THREE.Vector3(x, halfHeight, 0.01));
54
- }
55
-
56
- // Horizontal lines
57
- for (let y = -halfHeight; y <= halfHeight; y += gridSpacing) {
58
- points.push(new THREE.Vector3(-halfWidth, y, 0.01));
59
- points.push(new THREE.Vector3(halfWidth, y, 0.01));
60
- }
61
-
62
- const geometry = new THREE.BufferGeometry().setFromPoints(points);
63
- return geometry;
64
- }, [width, height]);
65
-
66
- // Create border lines
67
- const borderGeometry = useMemo(() => {
68
- const halfWidth = width / 2;
69
- const halfHeight = height / 2;
70
- const inset = 0.3;
71
-
72
- const points = [
73
- // Outer border
74
- new THREE.Vector3(-halfWidth, -halfHeight, 0.02),
75
- new THREE.Vector3(halfWidth, -halfHeight, 0.02),
76
- new THREE.Vector3(halfWidth, -halfHeight, 0.02),
77
- new THREE.Vector3(halfWidth, halfHeight, 0.02),
78
- new THREE.Vector3(halfWidth, halfHeight, 0.02),
79
- new THREE.Vector3(-halfWidth, halfHeight, 0.02),
80
- new THREE.Vector3(-halfWidth, halfHeight, 0.02),
81
- new THREE.Vector3(-halfWidth, -halfHeight, 0.02),
82
- // Inner border (etched)
83
- new THREE.Vector3(-halfWidth + inset, -halfHeight + inset, 0.02),
84
- new THREE.Vector3(halfWidth - inset, -halfHeight + inset, 0.02),
85
- new THREE.Vector3(halfWidth - inset, -halfHeight + inset, 0.02),
86
- new THREE.Vector3(halfWidth - inset, halfHeight - inset, 0.02),
87
- new THREE.Vector3(halfWidth - inset, halfHeight - inset, 0.02),
88
- new THREE.Vector3(-halfWidth + inset, halfHeight - inset, 0.02),
89
- new THREE.Vector3(-halfWidth + inset, halfHeight - inset, 0.02),
90
- new THREE.Vector3(-halfWidth + inset, -halfHeight + inset, 0.02),
91
- ];
92
-
93
- return new THREE.BufferGeometry().setFromPoints(points);
94
- }, [width, height]);
95
-
96
- // Section divider positions (for STM, Episodic, LTM sections)
97
- const sectionDividers = useMemo(() => {
98
- const halfWidth = width / 2;
99
- const sectionHeight = height / 3;
100
- const halfHeight = height / 2;
101
-
102
- return [
103
- // Top divider (between STM and Episodic)
104
- {
105
- y: halfHeight - sectionHeight,
106
- points: [
107
- new THREE.Vector3(-halfWidth + 0.3, halfHeight - sectionHeight, 0.02),
108
- new THREE.Vector3(halfWidth - 0.3, halfHeight - sectionHeight, 0.02),
109
- ],
110
- },
111
- // Bottom divider (between Episodic and LTM)
112
- {
113
- y: -halfHeight + sectionHeight,
114
- points: [
115
- new THREE.Vector3(-halfWidth + 0.3, -halfHeight + sectionHeight, 0.02),
116
- new THREE.Vector3(halfWidth - 0.3, -halfHeight + sectionHeight, 0.02),
117
- ],
118
- },
119
- ];
120
- }, [width, height]);
121
-
122
- // Corner pin positions
123
- const pinPositions = useMemo(() => {
124
- const halfWidth = width / 2;
125
- const halfHeight = height / 2;
126
- const offset = 0.5;
127
-
128
- return [
129
- [-halfWidth + offset, halfHeight - offset, 0.1],
130
- [halfWidth - offset, halfHeight - offset, 0.1],
131
- [-halfWidth + offset, -halfHeight + offset, 0.1],
132
- [halfWidth - offset, -halfHeight + offset, 0.1],
133
- ] as [number, number, number][];
134
- }, [width, height]);
135
-
136
- // Subtle grid pulse animation
137
- useFrame((state) => {
138
- if (gridRef.current) {
139
- const material = gridRef.current.material as THREE.LineBasicMaterial;
140
- material.opacity = 0.08 + Math.sin(state.clock.elapsedTime * 0.5) * 0.02;
141
- }
142
- });
143
-
144
- return (
145
- <group position={position}>
146
- {/* Main substrate plane */}
147
- <mesh rotation={[-Math.PI / 2, 0, 0]}>
148
- <planeGeometry args={[width, height]} />
149
- <primitive object={substrateMaterial} />
150
- </mesh>
151
-
152
- {/* Grid overlay */}
153
- <lineSegments ref={gridRef} rotation={[-Math.PI / 2, 0, 0]}>
154
- <primitive object={gridGeometry} />
155
- <lineBasicMaterial color="#2d3748" opacity={0.1} transparent />
156
- </lineSegments>
157
-
158
- {/* Border lines */}
159
- <lineSegments rotation={[-Math.PI / 2, 0, 0]}>
160
- <primitive object={borderGeometry} />
161
- <lineBasicMaterial color="#4a5568" linewidth={2} />
162
- </lineSegments>
163
-
164
- {/* Section dividers */}
165
- {sectionDividers.map((divider, i) => (
166
- <lineSegments key={i} rotation={[-Math.PI / 2, 0, 0]}>
167
- <bufferGeometry>
168
- <primitive
169
- object={
170
- new THREE.BufferAttribute(
171
- new Float32Array(divider.points.flatMap((p) => [p.x, p.y, p.z])),
172
- 3
173
- )
174
- }
175
- attach="attributes-position"
176
- />
177
- </bufferGeometry>
178
- <lineBasicMaterial color="#4a5568" opacity={0.6} transparent />
179
- </lineSegments>
180
- ))}
181
-
182
- {/* Corner pins */}
183
- {pinPositions.map((pos, i) => (
184
- <mesh key={i} position={pos} geometry={PIN_GEOMETRY} material={PIN_MATERIAL} />
185
- ))}
186
-
187
- {/* Decorative edge traces */}
188
- <EdgeTraces width={width} height={height} />
189
- </group>
190
- );
191
- }
192
-
193
- // Decorative circuit traces along edges
194
- function EdgeTraces({ width, height }: { width: number; height: number }) {
195
- const traces = useMemo(() => {
196
- const halfWidth = width / 2;
197
- const halfHeight = height / 2;
198
- const traceLength = 1.5;
199
- const points: THREE.Vector3[] = [];
200
-
201
- // Top edge traces
202
- for (let i = 0; i < 6; i++) {
203
- const x = -halfWidth + 2 + i * 2;
204
- points.push(new THREE.Vector3(x, halfHeight - 0.1, 0.02));
205
- points.push(new THREE.Vector3(x, halfHeight - 0.1 - traceLength * 0.3, 0.02));
206
- }
207
-
208
- // Bottom edge traces
209
- for (let i = 0; i < 6; i++) {
210
- const x = -halfWidth + 2 + i * 2;
211
- points.push(new THREE.Vector3(x, -halfHeight + 0.1, 0.02));
212
- points.push(new THREE.Vector3(x, -halfHeight + 0.1 + traceLength * 0.3, 0.02));
213
- }
214
-
215
- // Left edge traces
216
- for (let i = 0; i < 4; i++) {
217
- const y = -halfHeight + 2 + i * 2.5;
218
- points.push(new THREE.Vector3(-halfWidth + 0.1, y, 0.02));
219
- points.push(new THREE.Vector3(-halfWidth + 0.1 + traceLength * 0.3, y, 0.02));
220
- }
221
-
222
- // Right edge traces
223
- for (let i = 0; i < 4; i++) {
224
- const y = -halfHeight + 2 + i * 2.5;
225
- points.push(new THREE.Vector3(halfWidth - 0.1, y, 0.02));
226
- points.push(new THREE.Vector3(halfWidth - 0.1 - traceLength * 0.3, y, 0.02));
227
- }
228
-
229
- return new THREE.BufferGeometry().setFromPoints(points);
230
- }, [width, height]);
231
-
232
- return (
233
- <lineSegments rotation={[-Math.PI / 2, 0, 0]}>
234
- <primitive object={traces} />
235
- <lineBasicMaterial color="#FFB347" opacity={0.3} transparent />
236
- </lineSegments>
237
- );
238
- }
@@ -1,210 +0,0 @@
1
- 'use client';
2
-
3
- /**
4
- * Cortex Core
5
- * Central processing element with pulsing golden glow
6
- * The focal point of the memory chip
7
- */
8
-
9
- import { useRef, useMemo } from 'react';
10
- import { useFrame } from '@react-three/fiber';
11
- import { Html } from '@react-three/drei';
12
- import * as THREE from 'three';
13
-
14
- interface CortexCoreProps {
15
- position?: [number, number, number];
16
- size?: number;
17
- activity?: number; // 0-1, affects pulse intensity
18
- showLabel?: boolean;
19
- }
20
-
21
- export function CortexCore({
22
- position = [0, 0, 0],
23
- size = 2,
24
- activity = 0.5,
25
- showLabel = true,
26
- }: CortexCoreProps) {
27
- const coreRef = useRef<THREE.Mesh>(null);
28
- const glow1Ref = useRef<THREE.Mesh>(null);
29
- const glow2Ref = useRef<THREE.Mesh>(null);
30
- const glow3Ref = useRef<THREE.Mesh>(null);
31
-
32
- // Core material - bright gold center
33
- const coreMaterial = useMemo(() => {
34
- return new THREE.MeshStandardMaterial({
35
- color: '#FFD700',
36
- emissive: '#FFD700',
37
- emissiveIntensity: 0.8,
38
- metalness: 0.3,
39
- roughness: 0.4,
40
- });
41
- }, []);
42
-
43
- // Glow materials - progressively fainter
44
- const glowMaterials = useMemo(() => {
45
- return [
46
- new THREE.MeshBasicMaterial({
47
- color: '#FFD700',
48
- transparent: true,
49
- opacity: 0.4,
50
- side: THREE.BackSide,
51
- }),
52
- new THREE.MeshBasicMaterial({
53
- color: '#FFB347',
54
- transparent: true,
55
- opacity: 0.2,
56
- side: THREE.BackSide,
57
- }),
58
- new THREE.MeshBasicMaterial({
59
- color: '#FF8C00',
60
- transparent: true,
61
- opacity: 0.1,
62
- side: THREE.BackSide,
63
- }),
64
- ];
65
- }, []);
66
-
67
- // Animate pulse
68
- useFrame((state) => {
69
- const time = state.clock.elapsedTime;
70
- const basePulse = Math.sin(time * 2) * 0.5 + 0.5;
71
- const activityBoost = activity * 0.3;
72
-
73
- // Core pulse
74
- if (coreRef.current) {
75
- const material = coreRef.current.material as THREE.MeshStandardMaterial;
76
- material.emissiveIntensity = 0.6 + basePulse * 0.4 + activityBoost;
77
- }
78
-
79
- // Glow layers pulse with phase offset
80
- if (glow1Ref.current) {
81
- const mat = glow1Ref.current.material as THREE.MeshBasicMaterial;
82
- mat.opacity = 0.3 + basePulse * 0.2 + activityBoost * 0.5;
83
- glow1Ref.current.scale.setScalar(1 + basePulse * 0.05);
84
- }
85
-
86
- if (glow2Ref.current) {
87
- const phase2 = Math.sin(time * 2 + 0.5) * 0.5 + 0.5;
88
- const mat = glow2Ref.current.material as THREE.MeshBasicMaterial;
89
- mat.opacity = 0.15 + phase2 * 0.1 + activityBoost * 0.3;
90
- glow2Ref.current.scale.setScalar(1 + phase2 * 0.03);
91
- }
92
-
93
- if (glow3Ref.current) {
94
- const phase3 = Math.sin(time * 2 + 1) * 0.5 + 0.5;
95
- const mat = glow3Ref.current.material as THREE.MeshBasicMaterial;
96
- mat.opacity = 0.08 + phase3 * 0.05 + activityBoost * 0.2;
97
- glow3Ref.current.scale.setScalar(1 + phase3 * 0.02);
98
- }
99
- });
100
-
101
- return (
102
- <group position={position}>
103
- {/* Core block - rounded rectangle */}
104
- <mesh ref={coreRef} material={coreMaterial}>
105
- <boxGeometry args={[size, size * 0.6, 0.3]} />
106
- </mesh>
107
-
108
- {/* Inner detail - circuit pattern */}
109
- <CoreCircuitPattern size={size} />
110
-
111
- {/* Glow layer 1 */}
112
- <mesh ref={glow1Ref}>
113
- <boxGeometry args={[size * 1.1, size * 0.7, 0.4]} />
114
- <primitive object={glowMaterials[0]} />
115
- </mesh>
116
-
117
- {/* Glow layer 2 */}
118
- <mesh ref={glow2Ref}>
119
- <boxGeometry args={[size * 1.3, size * 0.85, 0.5]} />
120
- <primitive object={glowMaterials[1]} />
121
- </mesh>
122
-
123
- {/* Glow layer 3 */}
124
- <mesh ref={glow3Ref}>
125
- <boxGeometry args={[size * 1.5, size, 0.6]} />
126
- <primitive object={glowMaterials[2]} />
127
- </mesh>
128
-
129
- {/* Activity indicator dot */}
130
- <ActivityIndicator activity={activity} size={size} />
131
-
132
- {/* Label */}
133
- {showLabel && (
134
- <Html
135
- position={[0, -size * 0.45, 0.2]}
136
- center
137
- style={{
138
- pointerEvents: 'none',
139
- userSelect: 'none',
140
- }}
141
- >
142
- <div className="text-[10px] font-mono text-amber-400/80 whitespace-nowrap tracking-wider">
143
- CORTEX CORE
144
- </div>
145
- </Html>
146
- )}
147
- </group>
148
- );
149
- }
150
-
151
- // Circuit pattern on core surface
152
- function CoreCircuitPattern({ size }: { size: number }) {
153
- const linesGeometry = useMemo(() => {
154
- const points: THREE.Vector3[] = [];
155
- const halfSize = size / 2;
156
- const z = 0.16;
157
-
158
- // Horizontal lines
159
- for (let i = -2; i <= 2; i++) {
160
- const y = i * 0.12;
161
- points.push(new THREE.Vector3(-halfSize * 0.7, y, z));
162
- points.push(new THREE.Vector3(halfSize * 0.7, y, z));
163
- }
164
-
165
- // Vertical lines
166
- for (let i = -4; i <= 4; i++) {
167
- const x = i * 0.18;
168
- points.push(new THREE.Vector3(x, -size * 0.2, z));
169
- points.push(new THREE.Vector3(x, size * 0.2, z));
170
- }
171
-
172
- return new THREE.BufferGeometry().setFromPoints(points);
173
- }, [size]);
174
-
175
- return (
176
- <lineSegments>
177
- <primitive object={linesGeometry} />
178
- <lineBasicMaterial color="#8B6914" opacity={0.5} transparent />
179
- </lineSegments>
180
- );
181
- }
182
-
183
- // Pulsing activity indicator
184
- function ActivityIndicator({ activity, size }: { activity: number; size: number }) {
185
- const dotRef = useRef<THREE.Mesh>(null);
186
-
187
- useFrame((state) => {
188
- if (dotRef.current) {
189
- const pulse = Math.sin(state.clock.elapsedTime * 4) * 0.5 + 0.5;
190
- const scale = 0.8 + pulse * 0.4 + activity * 0.3;
191
- dotRef.current.scale.setScalar(scale);
192
-
193
- const material = dotRef.current.material as THREE.MeshBasicMaterial;
194
- material.opacity = 0.6 + pulse * 0.4;
195
- }
196
- });
197
-
198
- const isActive = activity > 0.1;
199
-
200
- return (
201
- <mesh ref={dotRef} position={[size * 0.35, size * 0.2, 0.2]}>
202
- <circleGeometry args={[0.08, 16]} />
203
- <meshBasicMaterial
204
- color={isActive ? '#22c55e' : '#6b7280'}
205
- transparent
206
- opacity={0.8}
207
- />
208
- </mesh>
209
- );
210
- }