@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.
Files changed (36) hide show
  1. package/README.md +23 -0
  2. package/dist/index.cjs +1591 -231
  3. package/dist/index.d.cts +559 -2
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.mts +559 -2
  6. package/dist/index.d.mts.map +1 -1
  7. package/dist/index.mjs +1590 -207
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +12 -11
  10. package/src/components/observability/DynamicDashboard/DynamicDashboard.test.tsx +234 -0
  11. package/src/components/observability/DynamicDashboard/index.tsx +64 -0
  12. package/src/components/observability/MetricHistogram/MetricHistogram.stories.tsx +10 -1
  13. package/src/components/observability/MetricHistogram/index.tsx +85 -19
  14. package/src/components/observability/MetricStat/MetricStat.stories.tsx +2 -1
  15. package/src/components/observability/MetricTimeSeries/MetricTimeSeries.stories.tsx +23 -1
  16. package/src/components/observability/MetricTimeSeries/index.tsx +70 -27
  17. package/src/components/observability/__fixtures__/metrics.ts +97 -0
  18. package/src/components/observability/index.ts +3 -0
  19. package/src/components/observability/renderers/OtelLogTimeline.tsx +28 -0
  20. package/src/components/observability/renderers/OtelMetricHistogram.tsx +2 -0
  21. package/src/components/observability/renderers/OtelMetricStat.tsx +1 -13
  22. package/src/components/observability/renderers/OtelMetricTimeSeries.tsx +2 -0
  23. package/src/components/observability/renderers/OtelTraceDetail.tsx +35 -0
  24. package/src/components/observability/renderers/index.ts +2 -0
  25. package/src/components/observability/utils/attributes.ts +7 -0
  26. package/src/components/observability/utils/units.test.ts +116 -0
  27. package/src/components/observability/utils/units.ts +132 -0
  28. package/src/index.ts +1 -0
  29. package/src/lib/__snapshots__/generate-prompt-instructions.test.ts.snap +7 -1
  30. package/src/lib/generate-prompt-instructions.test.ts +1 -1
  31. package/src/lib/generate-prompt-instructions.ts +18 -6
  32. package/src/lib/observability-catalog.ts +7 -1
  33. package/src/lib/renderer.tsx +1 -1
  34. package/src/pages/observability.test.tsx +124 -0
  35. package/src/pages/observability.tsx +60 -34
  36. 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: