@assistant-ui/react-o11y 0.0.13 → 0.0.14
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 +36 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `@assistant-ui/react-o11y`
|
|
2
|
+
|
|
3
|
+
Headless React primitives for rendering span and trace UIs (waterfalls, timelines, run inspectors) on top of `@assistant-ui/store`. Ships a tap-based `SpanResource` that owns the data and a set of unstyled `SpanPrimitive.*` components for laying it out.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @assistant-ui/react-o11y
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
"use client";
|
|
15
|
+
|
|
16
|
+
import { AuiProvider, useAui } from "@assistant-ui/store";
|
|
17
|
+
import { SpanResource } from "@assistant-ui/react-o11y";
|
|
18
|
+
|
|
19
|
+
const spans = [
|
|
20
|
+
{ id: "a", parentSpanId: null, name: "request", type: "http", status: "completed", startedAt: 0, endedAt: 120, latencyMs: 120 },
|
|
21
|
+
{ id: "b", parentSpanId: "a", name: "db query", type: "db", status: "completed", startedAt: 10, endedAt: 80, latencyMs: 70 },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export function Waterfall() {
|
|
25
|
+
const aui = useAui({ span: SpanResource({ spans }) });
|
|
26
|
+
return (
|
|
27
|
+
<AuiProvider value={aui}>
|
|
28
|
+
{/* compose SpanPrimitive.* components here — see examples/waterfall for a full layout */}
|
|
29
|
+
</AuiProvider>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`SpanPrimitive.*` components rendered inside `<AuiProvider>` cover rows, indentation, names, status, and the collapse toggle.
|
|
35
|
+
|
|
36
|
+
See [`examples/waterfall`](https://github.com/assistant-ui/assistant-ui/tree/main/examples/waterfall) for a complete waterfall implementation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-o11y",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Observability primitives for @assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@radix-ui/react-primitive": "^2.1.4",
|
|
32
|
-
"@assistant-ui/store": "0.2.
|
|
32
|
+
"@assistant-ui/store": "0.2.11",
|
|
33
33
|
"@assistant-ui/tap": "0.5.11"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "^19.2.14",
|
|
46
46
|
"react": "^19.2.5",
|
|
47
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
47
|
+
"@assistant-ui/x-buildutils": "0.0.8"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public",
|