shieldcortex 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +1 -1
  2. package/dist/defence/firewall/encoding-detector.js +1 -1
  3. package/dist/defence/firewall/encoding-detector.js.map +1 -1
  4. package/dist/defence/firewall/index.js +22 -0
  5. package/dist/defence/firewall/index.js.map +1 -1
  6. package/dist/defence/firewall/instruction-detector.d.ts.map +1 -1
  7. package/dist/defence/firewall/instruction-detector.js +26 -0
  8. package/dist/defence/firewall/instruction-detector.js.map +1 -1
  9. package/dist/defence/pipeline.d.ts.map +1 -1
  10. package/dist/defence/pipeline.js +8 -0
  11. package/dist/defence/pipeline.js.map +1 -1
  12. package/hooks/clawdbot/cortex-memory/HOOK.md +2 -2
  13. package/package.json +13 -9
  14. package/dashboard/components.json +0 -22
  15. package/dashboard/eslint.config.mjs +0 -42
  16. package/dashboard/next.config.ts +0 -7
  17. package/dashboard/package-lock.json +0 -8053
  18. package/dashboard/package.json +0 -44
  19. package/dashboard/postcss.config.mjs +0 -7
  20. package/dashboard/public/file.svg +0 -1
  21. package/dashboard/public/globe.svg +0 -1
  22. package/dashboard/public/next.svg +0 -1
  23. package/dashboard/public/vercel.svg +0 -1
  24. package/dashboard/public/window.svg +0 -1
  25. package/dashboard/scripts/ensure-api.mjs +0 -76
  26. package/dashboard/src/app/error.tsx +0 -49
  27. package/dashboard/src/app/favicon.ico +0 -0
  28. package/dashboard/src/app/globals.css +0 -130
  29. package/dashboard/src/app/layout.tsx +0 -35
  30. package/dashboard/src/app/page.tsx +0 -364
  31. package/dashboard/src/components/Providers.tsx +0 -27
  32. package/dashboard/src/components/brain/ActivityPulseSystem.tsx +0 -229
  33. package/dashboard/src/components/brain/BrainMesh.tsx +0 -133
  34. package/dashboard/src/components/brain/BrainRegions.tsx +0 -254
  35. package/dashboard/src/components/brain/BrainScene.tsx +0 -255
  36. package/dashboard/src/components/brain/CategoryLabels.tsx +0 -103
  37. package/dashboard/src/components/brain/CoreSphere.tsx +0 -215
  38. package/dashboard/src/components/brain/DataFlowParticles.tsx +0 -123
  39. package/dashboard/src/components/brain/DataStreamRings.tsx +0 -161
  40. package/dashboard/src/components/brain/ElectronFlow.tsx +0 -323
  41. package/dashboard/src/components/brain/HolographicGrid.tsx +0 -235
  42. package/dashboard/src/components/brain/MemoryLinks.tsx +0 -271
  43. package/dashboard/src/components/brain/MemoryNode.tsx +0 -245
  44. package/dashboard/src/components/brain/NeuralPathways.tsx +0 -441
  45. package/dashboard/src/components/brain/SynapseNodes.tsx +0 -312
  46. package/dashboard/src/components/brain/TimelineControls.tsx +0 -205
  47. package/dashboard/src/components/chip/ChipScene.tsx +0 -497
  48. package/dashboard/src/components/chip/ChipSubstrate.tsx +0 -238
  49. package/dashboard/src/components/chip/CortexCore.tsx +0 -210
  50. package/dashboard/src/components/chip/DataBus.tsx +0 -416
  51. package/dashboard/src/components/chip/MemoryCell.tsx +0 -225
  52. package/dashboard/src/components/chip/MemoryGrid.tsx +0 -328
  53. package/dashboard/src/components/chip/QuantumCell.tsx +0 -316
  54. package/dashboard/src/components/chip/SectionLabel.tsx +0 -113
  55. package/dashboard/src/components/chip/index.ts +0 -14
  56. package/dashboard/src/components/controls/ControlPanel.tsx +0 -106
  57. package/dashboard/src/components/controls/VersionPanel.tsx +0 -185
  58. package/dashboard/src/components/dashboard/StatsPanel.tsx +0 -164
  59. package/dashboard/src/components/debug/ActivityLog.tsx +0 -250
  60. package/dashboard/src/components/debug/DebugPanel.tsx +0 -101
  61. package/dashboard/src/components/debug/QueryTester.tsx +0 -192
  62. package/dashboard/src/components/debug/RelationshipGraph.tsx +0 -403
  63. package/dashboard/src/components/debug/SqlConsole.tsx +0 -319
  64. package/dashboard/src/components/graph/KnowledgeGraph.tsx +0 -230
  65. package/dashboard/src/components/graph/OntologyGraph.tsx +0 -631
  66. package/dashboard/src/components/insights/ActivityHeatmap.tsx +0 -131
  67. package/dashboard/src/components/insights/InsightsView.tsx +0 -46
  68. package/dashboard/src/components/insights/KnowledgeMapPanel.tsx +0 -80
  69. package/dashboard/src/components/insights/QualityPanel.tsx +0 -116
  70. package/dashboard/src/components/memories/MemoriesView.tsx +0 -150
  71. package/dashboard/src/components/memories/MemoryCard.tsx +0 -103
  72. package/dashboard/src/components/memory/MemoryDetail.tsx +0 -325
  73. package/dashboard/src/components/nav/NavRail.tsx +0 -54
  74. package/dashboard/src/components/ui/button.tsx +0 -62
  75. package/dashboard/src/components/ui/card.tsx +0 -92
  76. package/dashboard/src/components/ui/input.tsx +0 -21
  77. package/dashboard/src/hooks/useDebouncedValue.ts +0 -24
  78. package/dashboard/src/hooks/useMemories.ts +0 -458
  79. package/dashboard/src/hooks/useSuggestions.ts +0 -46
  80. package/dashboard/src/lib/category-colors.ts +0 -84
  81. package/dashboard/src/lib/position-algorithm.ts +0 -177
  82. package/dashboard/src/lib/simplex-noise.ts +0 -217
  83. package/dashboard/src/lib/store.ts +0 -88
  84. package/dashboard/src/lib/utils.ts +0 -6
  85. package/dashboard/src/lib/websocket.ts +0 -249
  86. package/dashboard/src/types/memory.ts +0 -73
  87. package/dashboard/tsconfig.json +0 -34
@@ -1,441 +0,0 @@
1
- 'use client';
2
-
3
- /**
4
- * Neural Pathways
5
- * Visualizes the main axon tracts and dendrite networks in the brain
6
- * - Major pathways: Glowing tubes connecting brain regions
7
- * - Dendrite network: Fine branching connections
8
- * - Electron flow along pathways
9
- */
10
-
11
- import { useMemo, useRef } from 'react';
12
- import { useFrame } from '@react-three/fiber';
13
- import { Line } from '@react-three/drei';
14
- import * as THREE from 'three';
15
-
16
- // Jarvis-style golden/orange color palette
17
- const JARVIS_GOLD = '#FFD700';
18
- const JARVIS_ORANGE = '#FF8C00';
19
- const JARVIS_AMBER = '#FFB347';
20
- const JARVIS_LIGHT_AMBER = '#FFCC66';
21
- const JARVIS_CYAN = '#00D4FF'; // Accent color for contrast
22
-
23
- // Major pathway definitions - Jarvis golden theme
24
- const MAJOR_PATHWAYS = [
25
- // Central axis: STM → Episodic → LTM
26
- {
27
- id: 'central-forward',
28
- points: [[0, 0, 3.5], [0, 0.5, 1.5], [0, 0.3, 0]],
29
- color: JARVIS_GOLD,
30
- intensity: 1.0,
31
- label: 'STM → Episodic',
32
- },
33
- {
34
- id: 'central-back',
35
- points: [[0, 0.3, 0], [0, 0.5, -1.5], [0, 0, -3.5]],
36
- color: JARVIS_ORANGE,
37
- intensity: 0.9,
38
- label: 'Episodic → LTM',
39
- },
40
- // Left hemisphere tract
41
- {
42
- id: 'left-tract',
43
- points: [[-2, 0, 2.5], [-2.5, 0.3, 0], [-2, 0, -2.5]],
44
- color: JARVIS_AMBER,
45
- intensity: 0.7,
46
- label: 'Left Hemisphere',
47
- },
48
- // Right hemisphere tract
49
- {
50
- id: 'right-tract',
51
- points: [[2, 0, 2.5], [2.5, 0.3, 0], [2, 0, -2.5]],
52
- color: JARVIS_AMBER,
53
- intensity: 0.7,
54
- label: 'Right Hemisphere',
55
- },
56
- // Corpus callosum (cross-hemisphere) - cyan accent for visual interest
57
- {
58
- id: 'corpus-callosum',
59
- points: [[-2.5, 0.2, 0], [0, 0.8, 0], [2.5, 0.2, 0]],
60
- color: JARVIS_CYAN,
61
- intensity: 0.8,
62
- label: 'Cross-Hemisphere',
63
- },
64
- // Diagonal connections
65
- {
66
- id: 'left-frontal',
67
- points: [[-1.5, 0.5, 2.5], [-2, 0.3, 0.5]],
68
- color: JARVIS_LIGHT_AMBER,
69
- intensity: 0.5,
70
- label: 'Left Frontal',
71
- },
72
- {
73
- id: 'right-frontal',
74
- points: [[1.5, 0.5, 2.5], [2, 0.3, 0.5]],
75
- color: JARVIS_LIGHT_AMBER,
76
- intensity: 0.5,
77
- label: 'Right Frontal',
78
- },
79
- {
80
- id: 'left-occipital',
81
- points: [[-1.5, 0.3, -2.5], [-2, 0.2, -0.5]],
82
- color: JARVIS_ORANGE,
83
- intensity: 0.5,
84
- label: 'Left Occipital',
85
- },
86
- {
87
- id: 'right-occipital',
88
- points: [[1.5, 0.3, -2.5], [2, 0.2, -0.5]],
89
- color: JARVIS_ORANGE,
90
- intensity: 0.5,
91
- label: 'Right Occipital',
92
- },
93
- ];
94
-
95
- interface PathwayProps {
96
- points: number[][];
97
- color: string;
98
- intensity: number;
99
- electronCount?: number;
100
- }
101
-
102
- /**
103
- * Electron particle traveling along a pathway
104
- */
105
- function PathwayElectron({
106
- curve,
107
- color,
108
- speed,
109
- delay,
110
- }: {
111
- curve: THREE.CatmullRomCurve3;
112
- color: string;
113
- speed: number;
114
- delay: number;
115
- }) {
116
- const meshRef = useRef<THREE.Mesh>(null);
117
- const glowRef = useRef<THREE.Mesh>(null);
118
- const progressRef = useRef(delay);
119
-
120
- useFrame((_, delta) => {
121
- if (!meshRef.current) return;
122
-
123
- progressRef.current += delta * speed * 0.3;
124
- if (progressRef.current > 1) {
125
- progressRef.current = 0;
126
- }
127
-
128
- const point = curve.getPoint(progressRef.current);
129
- meshRef.current.position.copy(point);
130
-
131
- // Fade at endpoints
132
- const fadeIn = Math.min(progressRef.current * 5, 1);
133
- const fadeOut = Math.min((1 - progressRef.current) * 5, 1);
134
- const opacity = fadeIn * fadeOut;
135
-
136
- (meshRef.current.material as THREE.MeshBasicMaterial).opacity = opacity * 0.95;
137
-
138
- if (glowRef.current) {
139
- glowRef.current.position.copy(point);
140
- (glowRef.current.material as THREE.MeshBasicMaterial).opacity = opacity * 0.4;
141
- }
142
- });
143
-
144
- return (
145
- <>
146
- {/* Electron core */}
147
- <mesh ref={meshRef}>
148
- <sphereGeometry args={[0.06, 8, 8]} />
149
- <meshBasicMaterial color={color} transparent opacity={0.9} />
150
- </mesh>
151
- {/* Glow */}
152
- <mesh ref={glowRef}>
153
- <sphereGeometry args={[0.12, 6, 6]} />
154
- <meshBasicMaterial
155
- color={color}
156
- transparent
157
- opacity={0.4}
158
- depthWrite={false}
159
- />
160
- </mesh>
161
- </>
162
- );
163
- }
164
-
165
- /**
166
- * Single major pathway with tube geometry and electrons
167
- */
168
- function MajorPathway({ points, color, intensity, electronCount = 3 }: PathwayProps) {
169
- const tubeRef = useRef<THREE.Mesh>(null);
170
-
171
- // Create smooth curve through points
172
- const { curve, tubeGeometry } = useMemo(() => {
173
- const vectors = points.map((p) => new THREE.Vector3(p[0], p[1], p[2]));
174
- const curve = new THREE.CatmullRomCurve3(vectors);
175
- const tubeGeometry = new THREE.TubeGeometry(curve, 32, 0.08, 8, false);
176
- return { curve, tubeGeometry };
177
- }, [points]);
178
-
179
- // Pulsing glow
180
- useFrame((state) => {
181
- if (!tubeRef.current) return;
182
- const pulse = Math.sin(state.clock.elapsedTime * 2) * 0.2 + 0.8;
183
- (tubeRef.current.material as THREE.MeshStandardMaterial).emissiveIntensity =
184
- intensity * pulse * 0.6;
185
- });
186
-
187
- // Generate electron delays
188
- const electrons = useMemo(
189
- () =>
190
- Array.from({ length: electronCount }, (_, i) => ({
191
- delay: i / electronCount,
192
- speed: 0.8 + Math.random() * 0.4,
193
- })),
194
- [electronCount]
195
- );
196
-
197
- return (
198
- <group>
199
- {/* Tube pathway */}
200
- <mesh ref={tubeRef} geometry={tubeGeometry}>
201
- <meshStandardMaterial
202
- color={color}
203
- emissive={color}
204
- emissiveIntensity={intensity * 0.5}
205
- transparent
206
- opacity={0.35}
207
- metalness={0.5}
208
- roughness={0.3}
209
- />
210
- </mesh>
211
-
212
- {/* Electrons along pathway */}
213
- {electrons.map((e, i) => (
214
- <PathwayElectron
215
- key={i}
216
- curve={curve}
217
- color={color}
218
- speed={e.speed}
219
- delay={e.delay}
220
- />
221
- ))}
222
- </group>
223
- );
224
- }
225
-
226
- /**
227
- * Helper to convert spherical to cartesian coordinates
228
- */
229
- function sphericalToCartesian(
230
- r: number,
231
- theta: number,
232
- phi: number
233
- ): [number, number, number] {
234
- return [
235
- r * Math.sin(phi) * Math.cos(theta),
236
- r * Math.cos(phi),
237
- r * Math.sin(phi) * Math.sin(theta),
238
- ];
239
- }
240
-
241
- /**
242
- * Dendrite network - fine branching connections
243
- */
244
- function DendriteNetwork({ count = 60 }: { count?: number }) {
245
- const dendrites = useMemo(() => {
246
- return Array.from({ length: count }, (_, i) => {
247
- const theta = Math.random() * Math.PI * 2;
248
- const phi = Math.PI * 0.2 + Math.random() * Math.PI * 0.6; // Avoid poles
249
- const r = 2.2 + Math.random() * 1.3;
250
-
251
- const start = sphericalToCartesian(r, theta, phi);
252
- const end = sphericalToCartesian(
253
- r + 0.3 + Math.random() * 0.5,
254
- theta + (Math.random() - 0.5) * 0.4,
255
- phi + (Math.random() - 0.5) * 0.3
256
- );
257
-
258
- // Color based on position (depth) - Jarvis golden variants
259
- const normalizedZ = (start[2] + 3.5) / 7;
260
- const color = normalizedZ > 0.6
261
- ? JARVIS_GOLD // Front - bright gold
262
- : normalizedZ > 0.4
263
- ? JARVIS_AMBER // Middle - warm gold
264
- : JARVIS_ORANGE; // Back - deep orange
265
-
266
- return { start, end, color, opacity: 0.15 + Math.random() * 0.15 };
267
- });
268
- }, [count]);
269
-
270
- return (
271
- <group>
272
- {dendrites.map((d, i) => (
273
- <Line
274
- key={i}
275
- points={[d.start, d.end]}
276
- color={d.color}
277
- lineWidth={0.8}
278
- transparent
279
- opacity={d.opacity}
280
- />
281
- ))}
282
- </group>
283
- );
284
- }
285
-
286
- /**
287
- * Junction nodes where pathways meet
288
- */
289
- function PathwayJunction({
290
- position,
291
- color,
292
- size = 0.15,
293
- }: {
294
- position: [number, number, number];
295
- color: string;
296
- size?: number;
297
- }) {
298
- const meshRef = useRef<THREE.Mesh>(null);
299
- const glowRef = useRef<THREE.Mesh>(null);
300
-
301
- useFrame((state) => {
302
- if (!meshRef.current) return;
303
- const pulse = Math.sin(state.clock.elapsedTime * 3) * 0.3 + 0.7;
304
- meshRef.current.scale.setScalar(size * (1 + pulse * 0.2));
305
- (meshRef.current.material as THREE.MeshBasicMaterial).opacity = pulse * 0.9;
306
-
307
- if (glowRef.current) {
308
- glowRef.current.scale.setScalar(size * 2.5 * (1 + pulse * 0.3));
309
- (glowRef.current.material as THREE.MeshBasicMaterial).opacity = pulse * 0.3;
310
- }
311
- });
312
-
313
- return (
314
- <group position={position}>
315
- <mesh ref={glowRef}>
316
- <sphereGeometry args={[1, 8, 8]} />
317
- <meshBasicMaterial
318
- color={color}
319
- transparent
320
- opacity={0.3}
321
- depthWrite={false}
322
- />
323
- </mesh>
324
- <mesh ref={meshRef}>
325
- <sphereGeometry args={[1, 12, 12]} />
326
- <meshBasicMaterial color={color} transparent opacity={0.9} />
327
- </mesh>
328
- </group>
329
- );
330
- }
331
-
332
- // Junction positions where pathways meet - Jarvis golden theme
333
- const JUNCTIONS = [
334
- { position: [0, 0.5, 1.5] as [number, number, number], color: JARVIS_GOLD },
335
- { position: [0, 0.3, 0] as [number, number, number], color: JARVIS_AMBER },
336
- { position: [0, 0.5, -1.5] as [number, number, number], color: JARVIS_ORANGE },
337
- { position: [-2.5, 0.3, 0] as [number, number, number], color: JARVIS_AMBER },
338
- { position: [2.5, 0.3, 0] as [number, number, number], color: JARVIS_AMBER },
339
- { position: [0, 0.8, 0] as [number, number, number], color: JARVIS_CYAN },
340
- ];
341
-
342
- /**
343
- * Main neural pathways component
344
- */
345
- export function NeuralPathways() {
346
- return (
347
- <group name="neural-pathways">
348
- {/* Major axon tracts */}
349
- {MAJOR_PATHWAYS.map((pathway) => (
350
- <MajorPathway
351
- key={pathway.id}
352
- points={pathway.points}
353
- color={pathway.color}
354
- intensity={pathway.intensity}
355
- electronCount={pathway.intensity > 0.7 ? 4 : 2}
356
- />
357
- ))}
358
-
359
- {/* Junction nodes */}
360
- {JUNCTIONS.map((junction, i) => (
361
- <PathwayJunction
362
- key={i}
363
- position={junction.position}
364
- color={junction.color}
365
- size={0.12}
366
- />
367
- ))}
368
-
369
- {/* Fine dendrite network */}
370
- <DendriteNetwork count={80} />
371
- </group>
372
- );
373
- }
374
-
375
- /**
376
- * Dynamic pathway that connects two memory nodes
377
- */
378
- export function MemoryConnection({
379
- startPos,
380
- endPos,
381
- strength = 0.5,
382
- relationship,
383
- }: {
384
- startPos: { x: number; y: number; z: number };
385
- endPos: { x: number; y: number; z: number };
386
- strength: number;
387
- relationship: string;
388
- }) {
389
- // Jarvis-style golden theme with cyan accent
390
- const COLORS: Record<string, string> = {
391
- references: JARVIS_CYAN, // Cyan accent for contrast
392
- extends: JARVIS_GOLD,
393
- contradicts: '#FF6B6B', // Keep error red
394
- related: JARVIS_AMBER,
395
- };
396
-
397
- const color = COLORS[relationship] || COLORS.related;
398
-
399
- const { curve, points } = useMemo(() => {
400
- const start = new THREE.Vector3(startPos.x, startPos.y, startPos.z);
401
- const end = new THREE.Vector3(endPos.x, endPos.y, endPos.z);
402
-
403
- // Create organic curve
404
- const mid = new THREE.Vector3().lerpVectors(start, end, 0.5);
405
- const direction = new THREE.Vector3().subVectors(end, start);
406
- const perpendicular = new THREE.Vector3(
407
- -direction.y,
408
- direction.x,
409
- direction.z * 0.3
410
- ).normalize();
411
-
412
- const curveAmount = direction.length() * 0.2 * strength;
413
- mid.add(perpendicular.multiplyScalar(curveAmount));
414
-
415
- const curve = new THREE.CatmullRomCurve3([start, mid, end]);
416
- return { curve, points: curve.getPoints(24) };
417
- }, [startPos, endPos, strength]);
418
-
419
- const electronCount = strength > 0.7 ? 3 : strength > 0.4 ? 2 : 1;
420
-
421
- return (
422
- <group>
423
- <Line
424
- points={points}
425
- color={color}
426
- lineWidth={1 + strength * 2}
427
- transparent
428
- opacity={0.4 + strength * 0.4}
429
- />
430
- {Array.from({ length: electronCount }).map((_, i) => (
431
- <PathwayElectron
432
- key={i}
433
- curve={curve}
434
- color={color}
435
- speed={0.8 + strength * 0.5}
436
- delay={i / electronCount}
437
- />
438
- ))}
439
- </group>
440
- );
441
- }