@kopai/ui 0.5.0 → 0.6.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/README.md +23 -0
- package/dist/index.cjs +1591 -231
- package/dist/index.d.cts +559 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +559 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1590 -207
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
- package/src/components/observability/DynamicDashboard/DynamicDashboard.test.tsx +234 -0
- package/src/components/observability/DynamicDashboard/index.tsx +64 -0
- package/src/components/observability/MetricHistogram/MetricHistogram.stories.tsx +10 -1
- package/src/components/observability/MetricHistogram/index.tsx +85 -19
- package/src/components/observability/MetricStat/MetricStat.stories.tsx +2 -1
- package/src/components/observability/MetricTimeSeries/MetricTimeSeries.stories.tsx +23 -1
- package/src/components/observability/MetricTimeSeries/index.tsx +70 -27
- package/src/components/observability/__fixtures__/metrics.ts +97 -0
- package/src/components/observability/index.ts +3 -0
- package/src/components/observability/renderers/OtelLogTimeline.tsx +28 -0
- package/src/components/observability/renderers/OtelMetricHistogram.tsx +2 -0
- package/src/components/observability/renderers/OtelMetricStat.tsx +1 -13
- package/src/components/observability/renderers/OtelMetricTimeSeries.tsx +2 -0
- package/src/components/observability/renderers/OtelTraceDetail.tsx +35 -0
- package/src/components/observability/renderers/index.ts +2 -0
- package/src/components/observability/utils/attributes.ts +7 -0
- package/src/components/observability/utils/units.test.ts +116 -0
- package/src/components/observability/utils/units.ts +132 -0
- package/src/index.ts +1 -0
- package/src/lib/__snapshots__/generate-prompt-instructions.test.ts.snap +7 -1
- package/src/lib/generate-prompt-instructions.test.ts +1 -1
- package/src/lib/generate-prompt-instructions.ts +18 -6
- package/src/lib/observability-catalog.ts +7 -1
- package/src/lib/renderer.tsx +1 -1
- package/src/pages/observability.test.tsx +124 -0
- package/src/pages/observability.tsx +60 -34
- package/src/lib/dashboard-datasource.ts +0 -76
package/README.md
CHANGED
|
@@ -100,6 +100,29 @@ function App() {
|
|
|
100
100
|
}
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
## AI Dashboard Generation
|
|
104
|
+
|
|
105
|
+
AI agents can generate valid `uiTree` structures using the schema endpoint:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Get component schema, props, and JSON schema for uiTree
|
|
109
|
+
npx @kopai/cli dashboards schema --url http://localhost:8000
|
|
110
|
+
|
|
111
|
+
# Or via API directly
|
|
112
|
+
curl http://localhost:8000/dashboards/schema
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Use the `/create-dashboard` skill in Claude Code for guided dashboard creation with live schema injection.
|
|
116
|
+
|
|
117
|
+
Install the skill via [skills.sh](https://skills.sh):
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx skills add https://github.com/kopai-app/kopai-mono/tree/main/skills/create-dashboard
|
|
121
|
+
|
|
122
|
+
# Or from a local checkout
|
|
123
|
+
npx skills add ./skills/create-dashboard
|
|
124
|
+
```
|
|
125
|
+
|
|
103
126
|
## Data Fetching
|
|
104
127
|
|
|
105
128
|
Components can receive data via `dataSource`. The renderer uses `useKopaiData` hook internally:
|