@neuralforge/dashboard 0.9.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/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@neuralforge/dashboard",
3
+ "version": "0.9.0",
4
+ "description": "Training visualization dashboard",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "test": "vitest",
10
+ "lint": "eslint src/"
11
+ },
12
+ "dependencies": {
13
+ "typescript": "^5.4.0",
14
+ "express": "^4.18.0",
15
+ "ws": "^8.16.0",
16
+ "react": "^18.2.0"
17
+ },
18
+ "devDependencies": {
19
+ "vitest": "^1.6.0",
20
+ "eslint": "^8.57.0"
21
+ }
22
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Experiments API
3
+ */
4
+
5
+ export interface Experiment { id: string; name: string; status: 'running' | 'completed' | 'failed'; }
6
+ export function listExperiments(): Experiment[] { return []; }
7
+
@@ -0,0 +1,6 @@
1
+ /**
2
+ * API module
3
+ */
4
+
5
+ export { setupRoutes } from './routes';
6
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Metrics API
3
+ */
4
+
5
+ export interface Metric { name: string; value: number; step: number; timestamp: number; }
6
+ export function aggregateMetrics(metrics: Metric[]): Record<string, number> { return {}; }
7
+
@@ -0,0 +1,14 @@
1
+ /**
2
+ * API routes
3
+ */
4
+
5
+ import { Router, Application } from 'express';
6
+
7
+ export function setupRoutes(app: Application): void {
8
+ const router = Router();
9
+ router.get('/api/metrics', (req, res) => res.json({ metrics: [] }));
10
+ router.get('/api/experiments', (req, res) => res.json({ experiments: [] }));
11
+ router.get('/api/health', (req, res) => res.json({ status: 'ok' }));
12
+ app.use(router);
13
+ }
14
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Experiment list
3
+ */
4
+
5
+ import React from 'react';
6
+ export const ExperimentList: React.FC = () => { return null; };
7
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Hyperparameter table
3
+ */
4
+
5
+ import React from 'react';
6
+ export const HyperparamTable: React.FC<{params: Record<string, any>}> = ({params}) => { return null; };
7
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Metric display panel
3
+ */
4
+
5
+ import React from 'react';
6
+ export const MetricPanel: React.FC<{metrics: any}> = ({metrics}) => { return null; };
7
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Model graph visualization
3
+ */
4
+
5
+ import React from 'react';
6
+ export const ModelGraph: React.FC<{model: any}> = ({model}) => { return null; };
7
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Training chart component
3
+ */
4
+
5
+ import React from 'react';
6
+ export const TrainingChart: React.FC<{data: any[]}> = ({data}) => { return null; };
7
+
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Experiment hook
3
+ */
4
+
5
+ export function useExperiment(id: string) { return { experiment: null, loading: true }; }
6
+
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Metrics hook
3
+ */
4
+
5
+ export function useMetrics(experimentId: string) { return { data: [], loading: true }; }
6
+
@@ -0,0 +1,6 @@
1
+ /**
2
+ * WebSocket hook
3
+ */
4
+
5
+ export function useWebSocket(url: string) { return { connected: false, send: (_: any) => {} }; }
6
+
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Dashboard entry
3
+ */
4
+
5
+ export { createServer } from './server';
6
+ export { setupRoutes } from './api';
7
+
package/src/server.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Dashboard HTTP server
3
+ */
4
+
5
+ import express from 'express';
6
+ import { setupRoutes } from './api';
7
+
8
+ export interface ServerConfig {
9
+ port: number;
10
+ host?: string;
11
+ }
12
+
13
+ export function createServer(config: ServerConfig) {
14
+ const app = express();
15
+ app.use(express.json());
16
+ setupRoutes(app);
17
+ return app.listen(config.port, config.host || '0.0.0.0');
18
+ }
19
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Color palette
3
+ */
4
+
5
+ export const COLORS = ['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f'];
6
+ export function getColor(index: number): string { return COLORS[index % COLORS.length]; }
7
+
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Formatting utils
3
+ */
4
+
5
+ export function formatNumber(n: number, decimals = 2): string { return n.toFixed(decimals); }
6
+ export function formatDuration(ms: number): string { return `${(ms / 1000).toFixed(1)}s`; }
7
+
@@ -0,0 +1,6 @@
1
+ /**
2
+ * WebSocket utilities
3
+ */
4
+
5
+ export function createWSConnection(url: string): WebSocket { return new WebSocket(url); }
6
+
@@ -0,0 +1,13 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { setupRoutes } from '../src';
3
+
4
+ describe('setupRoutes', () => {
5
+ it('should be defined', () => {
6
+ expect(setupRoutes).toBeDefined();
7
+ });
8
+
9
+ it('should initialize correctly', () => {
10
+ const instance = new setupRoutes();
11
+ expect(instance).toBeInstanceOf(setupRoutes);
12
+ });
13
+ });
@@ -0,0 +1,13 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { createServer } from '../src';
3
+
4
+ describe('createServer', () => {
5
+ it('should be defined', () => {
6
+ expect(createServer).toBeDefined();
7
+ });
8
+
9
+ it('should initialize correctly', () => {
10
+ const instance = new createServer();
11
+ expect(instance).toBeInstanceOf(createServer);
12
+ });
13
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ }
7
+ }