proagents 1.6.17 → 1.6.19
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/.claude/settings.local.json +169 -0
- package/.proagents/AGENTS.md +2 -0
- package/.proagents/AI_INSTRUCTIONS.md +13 -0
- package/.proagents/ANTIGRAVITY.md +2 -0
- package/.proagents/BOLT.md +2 -0
- package/.proagents/CHATGPT.md +2 -0
- package/.proagents/CLAUDE.md +2 -0
- package/.proagents/GEMINI.md +2 -0
- package/.proagents/GROQ.md +2 -0
- package/.proagents/KIRO.md +2 -0
- package/.proagents/LOVABLE.md +2 -0
- package/.proagents/PROAGENTS.md +2 -0
- package/.proagents/REPLIT.md +2 -0
- package/.proagents/prompts/00-project-setup.md +878 -0
- package/.proagents/prompts/04-planning.md +38 -0
- package/.proagents/prompts/12-rnd.md +957 -0
- package/.proagents/workflow-modes/entry-modes.md +27 -0
- package/.proagents/worklog/_context.template.md +47 -0
- package/COMMANDS.md +654 -0
- package/README.md +16 -24
- package/package.json +2 -7
- package/.proagents/ai-models/README.md +0 -141
- package/.proagents/ai-models/cost-management.md +0 -362
- package/.proagents/ai-models/fallbacks.md +0 -342
- package/.proagents/ai-models/model-config.md +0 -318
- package/.proagents/ai-models/task-routing.md +0 -503
- package/.proagents/ai-training/README.md +0 -155
- package/.proagents/ai-training/continuous-learning.md +0 -413
- package/.proagents/ai-training/domain-knowledge.md +0 -378
- package/.proagents/ai-training/pattern-learning.md +0 -455
- package/.proagents/ai-training/training-data.md +0 -337
- package/.proagents/ai-training/user-preferences.md +0 -346
- package/.proagents/approval-workflows/README.md +0 -146
- package/.proagents/approval-workflows/approval-config.md +0 -332
- package/.proagents/approval-workflows/approval-stages.md +0 -503
- package/.proagents/approval-workflows/emergency-bypass.md +0 -351
- package/.proagents/approval-workflows/examples.md +0 -859
- package/.proagents/approval-workflows/notifications.md +0 -320
- package/.proagents/compliance/README.md +0 -206
- package/.proagents/compliance/access-control.md +0 -310
- package/.proagents/compliance/audit-logging.md +0 -444
- package/.proagents/compliance/compliance-frameworks.md +0 -429
- package/.proagents/compliance/reports.md +0 -491
- package/.proagents/compliance/retention-policies.md +0 -454
- package/.proagents/config-versioning/README.md +0 -120
- package/.proagents/config-versioning/changelog.md +0 -300
- package/.proagents/config-versioning/rollback.md +0 -283
- package/.proagents/config-versioning/versioning.md +0 -330
- package/.proagents/contract-testing/README.md +0 -223
- package/.proagents/contract-testing/contract-testing.md +0 -614
- package/.proagents/contract-testing/pact-integration.md +0 -507
- package/.proagents/contract-testing/schema-validation.md +0 -565
- package/.proagents/dependency-management/README.md +0 -140
- package/.proagents/dependency-management/automation.md +0 -363
- package/.proagents/dependency-management/compatibility.md +0 -319
- package/.proagents/dependency-management/security-scanning.md +0 -413
- package/.proagents/dependency-management/update-policies.md +0 -374
- package/.proagents/disaster-recovery/README.md +0 -247
- package/.proagents/disaster-recovery/automation.md +0 -366
- package/.proagents/disaster-recovery/backup-recovery.md +0 -571
- package/.proagents/disaster-recovery/incident-response.md +0 -565
- package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
- package/.proagents/disaster-recovery/runbooks.md +0 -603
- package/.proagents/disaster-recovery/scenarios.md +0 -892
- package/.proagents/disaster-recovery/testing.md +0 -438
- package/.proagents/environments/README.md +0 -244
- package/.proagents/environments/configuration.md +0 -437
- package/.proagents/environments/promotion.md +0 -434
- package/.proagents/environments/setup.md +0 -420
- package/.proagents/examples/README.md +0 -55
- package/.proagents/examples/backend-nodejs/README.md +0 -188
- package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
- package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
- package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
- package/.proagents/examples/fullstack-nextjs/README.md +0 -155
- package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
- package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
- package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
- package/.proagents/examples/mobile-react-native/README.md +0 -171
- package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
- package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
- package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
- package/.proagents/examples/web-frontend-react/README.md +0 -125
- package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
- package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
- package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
- package/.proagents/existing-projects/README.md +0 -65
- package/.proagents/existing-projects/challenges.md +0 -861
- package/.proagents/existing-projects/coexistence-mode.md +0 -483
- package/.proagents/existing-projects/compatibility-assessment.md +0 -541
- package/.proagents/existing-projects/gradual-adoption.md +0 -515
- package/.proagents/existing-projects/migration-strategies.md +0 -788
- package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
- package/.proagents/existing-projects/team-onboarding.md +0 -617
- package/.proagents/existing-projects/technical-debt-handling.md +0 -644
- package/.proagents/feature-flags/README.md +0 -263
- package/.proagents/feature-flags/ab-testing.md +0 -413
- package/.proagents/feature-flags/configuration.md +0 -420
- package/.proagents/feature-flags/kill-switches.md +0 -444
- package/.proagents/feature-flags/rollout-strategies.md +0 -392
- package/.proagents/history.log +0 -12
- package/.proagents/i18n/README.md +0 -133
- package/.proagents/i18n/extraction.md +0 -433
- package/.proagents/i18n/tms-integration.md +0 -332
- package/.proagents/i18n/translation-workflow.md +0 -413
- package/.proagents/i18n/validation.md +0 -355
- package/.proagents/logging/README.md +0 -276
- package/.proagents/logging/aggregation.md +0 -475
- package/.proagents/logging/log-levels.md +0 -376
- package/.proagents/logging/sensitive-data.md +0 -423
- package/.proagents/logging/structured-logging.md +0 -406
- package/.proagents/metrics/README.md +0 -69
- package/.proagents/metrics/code-quality-kpis.md +0 -461
- package/.proagents/metrics/deployment-metrics.md +0 -517
- package/.proagents/metrics/developer-productivity.md +0 -368
- package/.proagents/metrics/learning-effectiveness.md +0 -478
- package/.proagents/migrations/README.md +0 -77
- package/.proagents/migrations/from-claude-projects.md +0 -313
- package/.proagents/migrations/from-cursor-rules.md +0 -345
- package/.proagents/migrations/from-custom-workflows.md +0 -410
- package/.proagents/monitoring/README.md +0 -308
- package/.proagents/monitoring/alerting.md +0 -449
- package/.proagents/monitoring/dashboards.md +0 -454
- package/.proagents/monitoring/health-checks.md +0 -436
- package/.proagents/monitoring/metrics.md +0 -434
- package/.proagents/multi-project/README.md +0 -170
- package/.proagents/multi-project/coordinated-deploy.md +0 -510
- package/.proagents/multi-project/cross-project-deps.md +0 -395
- package/.proagents/multi-project/unified-changelog.md +0 -477
- package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
- package/.proagents/multi-project/workspace-config.md +0 -408
- package/.proagents/notifications/README.md +0 -151
- package/.proagents/notifications/channels.md +0 -457
- package/.proagents/notifications/preferences.md +0 -415
- package/.proagents/notifications/routing.md +0 -449
- package/.proagents/notifications/scheduling.md +0 -425
- package/.proagents/notifications/templates.md +0 -446
- package/.proagents/offline-mode/README.md +0 -145
- package/.proagents/offline-mode/caching.md +0 -344
- package/.proagents/offline-mode/offline-operations.md +0 -312
- package/.proagents/offline-mode/queue-specifications.md +0 -679
- package/.proagents/offline-mode/sync.md +0 -475
- package/.proagents/parallel-features/README.md +0 -85
- package/.proagents/parallel-features/conflict-detection.md +0 -226
- package/.proagents/parallel-features/dependency-management.md +0 -392
- package/.proagents/parallel-features/merge-coordination.md +0 -506
- package/.proagents/parallel-features/tracking-system.md +0 -416
- package/.proagents/performance/README.md +0 -59
- package/.proagents/performance/bundle-analysis.md +0 -375
- package/.proagents/performance/load-testing.md +0 -563
- package/.proagents/performance/runtime-metrics.md +0 -489
- package/.proagents/performance/web-vitals.md +0 -425
- package/.proagents/plugins/README.md +0 -139
- package/.proagents/plugins/creating-plugins.md +0 -504
- package/.proagents/plugins/plugin-api.md +0 -467
- package/.proagents/plugins/plugin-registry.md +0 -276
- package/.proagents/reporting/README.md +0 -158
- package/.proagents/reporting/dashboards.md +0 -366
- package/.proagents/reporting/exports.md +0 -524
- package/.proagents/reporting/quality-metrics.md +0 -385
- package/.proagents/reporting/templates/README.md +0 -56
- package/.proagents/reporting/templates/dashboard-config.json +0 -187
- package/.proagents/reporting/templates/metrics-queries.md +0 -427
- package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
- package/.proagents/reporting/templates/widgets.md +0 -451
- package/.proagents/reporting/velocity-metrics.md +0 -340
- package/.proagents/reverse-engineering/README.md +0 -151
- package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
- package/.proagents/reverse-engineering/code-analysis.md +0 -377
- package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
- package/.proagents/reverse-engineering/diagram-generation.md +0 -586
- package/.proagents/reverse-engineering/documentation-generation.md +0 -468
- package/.proagents/reverse-engineering/pattern-detection.md +0 -569
- package/.proagents/reverse-engineering/quality-assessment.md +0 -733
- package/.proagents/secrets/README.md +0 -278
- package/.proagents/secrets/access-control.md +0 -443
- package/.proagents/secrets/rotation.md +0 -403
- package/.proagents/secrets/scanning.md +0 -487
- package/.proagents/secrets/storage.md +0 -394
- package/.proagents/webhooks/README.md +0 -126
- package/.proagents/webhooks/endpoints.md +0 -298
- package/.proagents/webhooks/events.md +0 -316
- package/.proagents/webhooks/payloads.md +0 -325
- package/.proagents/webhooks/reliability.md +0 -363
- package/.proagents/webhooks/security.md +0 -380
|
@@ -1,544 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ProAgents Dashboard Component
|
|
3
|
-
*
|
|
4
|
-
* A customizable dashboard for displaying development metrics.
|
|
5
|
-
* Uses the dashboard-config.json schema for configuration.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useEffect, useState, useMemo } from 'react';
|
|
9
|
-
|
|
10
|
-
// Types
|
|
11
|
-
interface DashboardConfig {
|
|
12
|
-
dashboard: {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
description: string;
|
|
16
|
-
refreshInterval: number;
|
|
17
|
-
theme: 'light' | 'dark' | 'auto';
|
|
18
|
-
};
|
|
19
|
-
layout: {
|
|
20
|
-
columns: number;
|
|
21
|
-
rowHeight: number;
|
|
22
|
-
margin: [number, number];
|
|
23
|
-
};
|
|
24
|
-
widgets: Widget[];
|
|
25
|
-
dataSources: Record<string, DataSource>;
|
|
26
|
-
filters: Filter[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface Widget {
|
|
30
|
-
id: string;
|
|
31
|
-
type: 'stat' | 'gauge' | 'line' | 'pie' | 'table' | 'timeline' | 'feed';
|
|
32
|
-
title: string;
|
|
33
|
-
position: { x: number; y: number; w: number; h: number };
|
|
34
|
-
config: Record<string, any>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface DataSource {
|
|
38
|
-
type: 'api' | 'websocket' | 'static';
|
|
39
|
-
endpoint: string;
|
|
40
|
-
method?: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface Filter {
|
|
44
|
-
id: string;
|
|
45
|
-
type: 'date-range' | 'select' | 'text';
|
|
46
|
-
label: string;
|
|
47
|
-
default?: string;
|
|
48
|
-
options?: string[];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Dashboard Component
|
|
52
|
-
export const ProAgentsDashboard: React.FC<{ config: DashboardConfig }> = ({
|
|
53
|
-
config,
|
|
54
|
-
}) => {
|
|
55
|
-
const [data, setData] = useState<Record<string, any>>({});
|
|
56
|
-
const [filters, setFilters] = useState<Record<string, any>>({});
|
|
57
|
-
const [loading, setLoading] = useState(true);
|
|
58
|
-
const [error, setError] = useState<string | null>(null);
|
|
59
|
-
|
|
60
|
-
// Initialize filters with defaults
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
const initialFilters: Record<string, any> = {};
|
|
63
|
-
config.filters.forEach((filter) => {
|
|
64
|
-
if (filter.default) {
|
|
65
|
-
initialFilters[filter.id] = filter.default;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
setFilters(initialFilters);
|
|
69
|
-
}, [config.filters]);
|
|
70
|
-
|
|
71
|
-
// Fetch data from data sources
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
const fetchData = async () => {
|
|
74
|
-
setLoading(true);
|
|
75
|
-
try {
|
|
76
|
-
const results: Record<string, any> = {};
|
|
77
|
-
|
|
78
|
-
for (const [key, source] of Object.entries(config.dataSources)) {
|
|
79
|
-
if (source.type === 'api') {
|
|
80
|
-
const response = await fetch(source.endpoint, {
|
|
81
|
-
method: source.method || 'GET',
|
|
82
|
-
headers: { 'Content-Type': 'application/json' },
|
|
83
|
-
});
|
|
84
|
-
results[key] = await response.json();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
setData(results);
|
|
89
|
-
setError(null);
|
|
90
|
-
} catch (err) {
|
|
91
|
-
setError('Failed to load dashboard data');
|
|
92
|
-
console.error('Dashboard fetch error:', err);
|
|
93
|
-
} finally {
|
|
94
|
-
setLoading(false);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
fetchData();
|
|
99
|
-
|
|
100
|
-
// Set up refresh interval
|
|
101
|
-
const interval = setInterval(fetchData, config.dashboard.refreshInterval * 1000);
|
|
102
|
-
return () => clearInterval(interval);
|
|
103
|
-
}, [config.dataSources, config.dashboard.refreshInterval, filters]);
|
|
104
|
-
|
|
105
|
-
// Calculate grid styles
|
|
106
|
-
const gridStyle = useMemo(() => ({
|
|
107
|
-
display: 'grid',
|
|
108
|
-
gridTemplateColumns: `repeat(${config.layout.columns}, 1fr)`,
|
|
109
|
-
gap: `${config.layout.margin[0]}px`,
|
|
110
|
-
padding: `${config.layout.margin[1]}px`,
|
|
111
|
-
}), [config.layout]);
|
|
112
|
-
|
|
113
|
-
if (loading && Object.keys(data).length === 0) {
|
|
114
|
-
return <DashboardSkeleton config={config} />;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (error) {
|
|
118
|
-
return <DashboardError message={error} onRetry={() => window.location.reload()} />;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<div className="proagents-dashboard">
|
|
123
|
-
{/* Header */}
|
|
124
|
-
<header className="dashboard-header">
|
|
125
|
-
<div className="dashboard-title">
|
|
126
|
-
<h1>{config.dashboard.name}</h1>
|
|
127
|
-
<p>{config.dashboard.description}</p>
|
|
128
|
-
</div>
|
|
129
|
-
<div className="dashboard-filters">
|
|
130
|
-
{config.filters.map((filter) => (
|
|
131
|
-
<FilterControl
|
|
132
|
-
key={filter.id}
|
|
133
|
-
filter={filter}
|
|
134
|
-
value={filters[filter.id]}
|
|
135
|
-
onChange={(value) => setFilters({ ...filters, [filter.id]: value })}
|
|
136
|
-
/>
|
|
137
|
-
))}
|
|
138
|
-
</div>
|
|
139
|
-
</header>
|
|
140
|
-
|
|
141
|
-
{/* Widget Grid */}
|
|
142
|
-
<div className="dashboard-grid" style={gridStyle}>
|
|
143
|
-
{config.widgets.map((widget) => (
|
|
144
|
-
<WidgetContainer
|
|
145
|
-
key={widget.id}
|
|
146
|
-
widget={widget}
|
|
147
|
-
data={data}
|
|
148
|
-
rowHeight={config.layout.rowHeight}
|
|
149
|
-
/>
|
|
150
|
-
))}
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
// Widget Container
|
|
157
|
-
const WidgetContainer: React.FC<{
|
|
158
|
-
widget: Widget;
|
|
159
|
-
data: Record<string, any>;
|
|
160
|
-
rowHeight: number;
|
|
161
|
-
}> = ({ widget, data, rowHeight }) => {
|
|
162
|
-
const style = {
|
|
163
|
-
gridColumn: `span ${widget.position.w}`,
|
|
164
|
-
gridRow: `span ${widget.position.h}`,
|
|
165
|
-
minHeight: `${widget.position.h * rowHeight}px`,
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const WidgetComponent = getWidgetComponent(widget.type);
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<div className="widget-container" style={style}>
|
|
172
|
-
<div className="widget-header">
|
|
173
|
-
<h3>{widget.title}</h3>
|
|
174
|
-
</div>
|
|
175
|
-
<div className="widget-content">
|
|
176
|
-
<WidgetComponent widget={widget} data={data} />
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
// Widget Components
|
|
183
|
-
const StatWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
184
|
-
widget,
|
|
185
|
-
data,
|
|
186
|
-
}) => {
|
|
187
|
-
const value = data[widget.config.metric]?.value ?? 0;
|
|
188
|
-
const change = data[widget.config.metric]?.change ?? 0;
|
|
189
|
-
|
|
190
|
-
return (
|
|
191
|
-
<div className="stat-widget">
|
|
192
|
-
<div className="stat-value" style={{ color: widget.config.color }}>
|
|
193
|
-
{formatValue(value, widget.config.format)}
|
|
194
|
-
</div>
|
|
195
|
-
{widget.config.comparison && (
|
|
196
|
-
<div className={`stat-change ${change >= 0 ? 'positive' : 'negative'}`}>
|
|
197
|
-
{change >= 0 ? '↑' : '↓'} {Math.abs(change)}% vs previous period
|
|
198
|
-
</div>
|
|
199
|
-
)}
|
|
200
|
-
</div>
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const GaugeWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
205
|
-
widget,
|
|
206
|
-
data,
|
|
207
|
-
}) => {
|
|
208
|
-
const value = data[widget.config.metric]?.value ?? 0;
|
|
209
|
-
const { min, max, thresholds } = widget.config;
|
|
210
|
-
const percentage = ((value - min) / (max - min)) * 100;
|
|
211
|
-
|
|
212
|
-
const color = thresholds.reduce((acc: string, t: { value: number; color: string }) => {
|
|
213
|
-
return value >= t.value ? t.color : acc;
|
|
214
|
-
}, thresholds[0].color);
|
|
215
|
-
|
|
216
|
-
return (
|
|
217
|
-
<div className="gauge-widget">
|
|
218
|
-
<svg viewBox="0 0 100 60" className="gauge-svg">
|
|
219
|
-
<path
|
|
220
|
-
d="M10 50 A40 40 0 0 1 90 50"
|
|
221
|
-
fill="none"
|
|
222
|
-
stroke="#e5e7eb"
|
|
223
|
-
strokeWidth="8"
|
|
224
|
-
/>
|
|
225
|
-
<path
|
|
226
|
-
d="M10 50 A40 40 0 0 1 90 50"
|
|
227
|
-
fill="none"
|
|
228
|
-
stroke={color}
|
|
229
|
-
strokeWidth="8"
|
|
230
|
-
strokeDasharray={`${percentage * 1.26} 126`}
|
|
231
|
-
/>
|
|
232
|
-
</svg>
|
|
233
|
-
<div className="gauge-value">{value}%</div>
|
|
234
|
-
</div>
|
|
235
|
-
);
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
const LineWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
239
|
-
widget,
|
|
240
|
-
data,
|
|
241
|
-
}) => {
|
|
242
|
-
// Simplified line chart - in production, use a library like Recharts
|
|
243
|
-
return (
|
|
244
|
-
<div className="line-widget">
|
|
245
|
-
<div className="chart-placeholder">
|
|
246
|
-
📈 Line Chart: {widget.config.metrics.map((m: any) => m.label).join(', ')}
|
|
247
|
-
</div>
|
|
248
|
-
<div className="chart-legend">
|
|
249
|
-
{widget.config.metrics.map((m: any) => (
|
|
250
|
-
<span key={m.id} style={{ color: m.color }}>
|
|
251
|
-
● {m.label}
|
|
252
|
-
</span>
|
|
253
|
-
))}
|
|
254
|
-
</div>
|
|
255
|
-
</div>
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
const PieWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
260
|
-
widget,
|
|
261
|
-
data,
|
|
262
|
-
}) => {
|
|
263
|
-
return (
|
|
264
|
-
<div className="pie-widget">
|
|
265
|
-
<div className="chart-placeholder">🥧 Pie Chart</div>
|
|
266
|
-
<div className="pie-legend">
|
|
267
|
-
{Object.entries(widget.config.colors || {}).map(([key, color]) => (
|
|
268
|
-
<span key={key} style={{ color: color as string }}>
|
|
269
|
-
● {key}
|
|
270
|
-
</span>
|
|
271
|
-
))}
|
|
272
|
-
</div>
|
|
273
|
-
</div>
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
const TableWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
278
|
-
widget,
|
|
279
|
-
data,
|
|
280
|
-
}) => {
|
|
281
|
-
const rows = data[widget.config.dataSource] ?? [];
|
|
282
|
-
|
|
283
|
-
return (
|
|
284
|
-
<div className="table-widget">
|
|
285
|
-
<table>
|
|
286
|
-
<thead>
|
|
287
|
-
<tr>
|
|
288
|
-
{widget.config.columns.map((col: any) => (
|
|
289
|
-
<th key={col.field} style={{ textAlign: col.align || 'left' }}>
|
|
290
|
-
{col.label}
|
|
291
|
-
</th>
|
|
292
|
-
))}
|
|
293
|
-
</tr>
|
|
294
|
-
</thead>
|
|
295
|
-
<tbody>
|
|
296
|
-
{rows.slice(0, widget.config.limit).map((row: any, i: number) => (
|
|
297
|
-
<tr key={i}>
|
|
298
|
-
{widget.config.columns.map((col: any) => (
|
|
299
|
-
<td key={col.field} style={{ textAlign: col.align || 'left' }}>
|
|
300
|
-
{row[col.field]}
|
|
301
|
-
</td>
|
|
302
|
-
))}
|
|
303
|
-
</tr>
|
|
304
|
-
))}
|
|
305
|
-
</tbody>
|
|
306
|
-
</table>
|
|
307
|
-
</div>
|
|
308
|
-
);
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
const TimelineWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
312
|
-
widget,
|
|
313
|
-
data,
|
|
314
|
-
}) => {
|
|
315
|
-
const items = data[widget.config.dataSource] ?? [];
|
|
316
|
-
|
|
317
|
-
return (
|
|
318
|
-
<div className="timeline-widget">
|
|
319
|
-
{items.map((item: any, i: number) => (
|
|
320
|
-
<div key={i} className="timeline-item">
|
|
321
|
-
<div className="timeline-marker" />
|
|
322
|
-
<div className="timeline-content">
|
|
323
|
-
<strong>{item.name}</strong>
|
|
324
|
-
<span className="timeline-phase">{item.phase}</span>
|
|
325
|
-
<div className="timeline-progress">
|
|
326
|
-
<div
|
|
327
|
-
className="progress-bar"
|
|
328
|
-
style={{ width: `${item.progress}%` }}
|
|
329
|
-
/>
|
|
330
|
-
</div>
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
))}
|
|
334
|
-
</div>
|
|
335
|
-
);
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
const FeedWidget: React.FC<{ widget: Widget; data: Record<string, any> }> = ({
|
|
339
|
-
widget,
|
|
340
|
-
data,
|
|
341
|
-
}) => {
|
|
342
|
-
const items = data[widget.config.dataSource] ?? [];
|
|
343
|
-
|
|
344
|
-
return (
|
|
345
|
-
<div className="feed-widget">
|
|
346
|
-
{items.slice(0, widget.config.limit).map((item: any, i: number) => (
|
|
347
|
-
<div key={i} className="feed-item">
|
|
348
|
-
<span className="feed-icon">{getEventIcon(item.type)}</span>
|
|
349
|
-
<span className="feed-message">{item.message}</span>
|
|
350
|
-
{widget.config.showTimestamp && (
|
|
351
|
-
<span className="feed-time">{formatRelativeTime(item.timestamp)}</span>
|
|
352
|
-
)}
|
|
353
|
-
</div>
|
|
354
|
-
))}
|
|
355
|
-
</div>
|
|
356
|
-
);
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
// Filter Control
|
|
360
|
-
const FilterControl: React.FC<{
|
|
361
|
-
filter: Filter;
|
|
362
|
-
value: any;
|
|
363
|
-
onChange: (value: any) => void;
|
|
364
|
-
}> = ({ filter, value, onChange }) => {
|
|
365
|
-
switch (filter.type) {
|
|
366
|
-
case 'date-range':
|
|
367
|
-
return (
|
|
368
|
-
<select
|
|
369
|
-
value={value}
|
|
370
|
-
onChange={(e) => onChange(e.target.value)}
|
|
371
|
-
className="filter-select"
|
|
372
|
-
>
|
|
373
|
-
{filter.options?.map((opt) => (
|
|
374
|
-
<option key={opt} value={opt}>
|
|
375
|
-
{opt}
|
|
376
|
-
</option>
|
|
377
|
-
))}
|
|
378
|
-
</select>
|
|
379
|
-
);
|
|
380
|
-
case 'select':
|
|
381
|
-
return (
|
|
382
|
-
<select
|
|
383
|
-
value={value}
|
|
384
|
-
onChange={(e) => onChange(e.target.value)}
|
|
385
|
-
className="filter-select"
|
|
386
|
-
>
|
|
387
|
-
<option value="">All {filter.label}</option>
|
|
388
|
-
{filter.options?.map((opt) => (
|
|
389
|
-
<option key={opt} value={opt}>
|
|
390
|
-
{opt}
|
|
391
|
-
</option>
|
|
392
|
-
))}
|
|
393
|
-
</select>
|
|
394
|
-
);
|
|
395
|
-
default:
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
// Helper Components
|
|
401
|
-
const DashboardSkeleton: React.FC<{ config: DashboardConfig }> = ({ config }) => (
|
|
402
|
-
<div className="dashboard-skeleton">
|
|
403
|
-
<div className="skeleton-header" />
|
|
404
|
-
<div className="skeleton-grid">
|
|
405
|
-
{config.widgets.map((w) => (
|
|
406
|
-
<div key={w.id} className="skeleton-widget" />
|
|
407
|
-
))}
|
|
408
|
-
</div>
|
|
409
|
-
</div>
|
|
410
|
-
);
|
|
411
|
-
|
|
412
|
-
const DashboardError: React.FC<{ message: string; onRetry: () => void }> = ({
|
|
413
|
-
message,
|
|
414
|
-
onRetry,
|
|
415
|
-
}) => (
|
|
416
|
-
<div className="dashboard-error">
|
|
417
|
-
<p>{message}</p>
|
|
418
|
-
<button onClick={onRetry}>Retry</button>
|
|
419
|
-
</div>
|
|
420
|
-
);
|
|
421
|
-
|
|
422
|
-
// Utilities
|
|
423
|
-
function getWidgetComponent(type: string) {
|
|
424
|
-
const components: Record<string, React.FC<any>> = {
|
|
425
|
-
stat: StatWidget,
|
|
426
|
-
gauge: GaugeWidget,
|
|
427
|
-
line: LineWidget,
|
|
428
|
-
pie: PieWidget,
|
|
429
|
-
table: TableWidget,
|
|
430
|
-
timeline: TimelineWidget,
|
|
431
|
-
feed: FeedWidget,
|
|
432
|
-
};
|
|
433
|
-
return components[type] || (() => <div>Unknown widget type</div>);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
function formatValue(value: number, format: string): string {
|
|
437
|
-
switch (format) {
|
|
438
|
-
case 'number':
|
|
439
|
-
return value.toLocaleString();
|
|
440
|
-
case 'duration':
|
|
441
|
-
return value.toFixed(1);
|
|
442
|
-
case 'percentage':
|
|
443
|
-
return `${value}%`;
|
|
444
|
-
default:
|
|
445
|
-
return String(value);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
function getEventIcon(type: string): string {
|
|
450
|
-
const icons: Record<string, string> = {
|
|
451
|
-
feature_complete: '✅',
|
|
452
|
-
deployment: '🚀',
|
|
453
|
-
pr_merged: '🔀',
|
|
454
|
-
bug_fixed: '🐛',
|
|
455
|
-
test_passed: '✓',
|
|
456
|
-
};
|
|
457
|
-
return icons[type] || '•';
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
function formatRelativeTime(timestamp: string): string {
|
|
461
|
-
const diff = Date.now() - new Date(timestamp).getTime();
|
|
462
|
-
const minutes = Math.floor(diff / 60000);
|
|
463
|
-
if (minutes < 60) return `${minutes}m ago`;
|
|
464
|
-
const hours = Math.floor(minutes / 60);
|
|
465
|
-
if (hours < 24) return `${hours}h ago`;
|
|
466
|
-
const days = Math.floor(hours / 24);
|
|
467
|
-
return `${days}d ago`;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// CSS (include in your stylesheet)
|
|
471
|
-
export const dashboardStyles = `
|
|
472
|
-
.proagents-dashboard {
|
|
473
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
474
|
-
background: var(--bg-primary, #f9fafb);
|
|
475
|
-
min-height: 100vh;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
.dashboard-header {
|
|
479
|
-
display: flex;
|
|
480
|
-
justify-content: space-between;
|
|
481
|
-
align-items: center;
|
|
482
|
-
padding: 24px;
|
|
483
|
-
background: var(--bg-secondary, white);
|
|
484
|
-
border-bottom: 1px solid var(--border, #e5e7eb);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.dashboard-title h1 {
|
|
488
|
-
margin: 0;
|
|
489
|
-
font-size: 24px;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
.dashboard-title p {
|
|
493
|
-
margin: 4px 0 0;
|
|
494
|
-
color: var(--text-secondary, #6b7280);
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.dashboard-filters {
|
|
498
|
-
display: flex;
|
|
499
|
-
gap: 12px;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.filter-select {
|
|
503
|
-
padding: 8px 12px;
|
|
504
|
-
border: 1px solid var(--border, #e5e7eb);
|
|
505
|
-
border-radius: 6px;
|
|
506
|
-
background: white;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
.widget-container {
|
|
510
|
-
background: white;
|
|
511
|
-
border-radius: 8px;
|
|
512
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
513
|
-
overflow: hidden;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
.widget-header {
|
|
517
|
-
padding: 16px;
|
|
518
|
-
border-bottom: 1px solid var(--border, #e5e7eb);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
.widget-header h3 {
|
|
522
|
-
margin: 0;
|
|
523
|
-
font-size: 14px;
|
|
524
|
-
font-weight: 600;
|
|
525
|
-
color: var(--text-secondary, #6b7280);
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.widget-content {
|
|
529
|
-
padding: 16px;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
.stat-value {
|
|
533
|
-
font-size: 36px;
|
|
534
|
-
font-weight: 700;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.stat-change {
|
|
538
|
-
font-size: 14px;
|
|
539
|
-
margin-top: 8px;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.stat-change.positive { color: #10b981; }
|
|
543
|
-
.stat-change.negative { color: #ef4444; }
|
|
544
|
-
`;
|