@mastra/playground-ui 53.0.0-alpha.2 → 53.0.0-alpha.3
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/dist/components/LogsDataList.cjs.js +1 -0
- package/dist/components/LogsDataList.cjs.js.map +1 -1
- package/dist/components/LogsDataList.es.js +1 -0
- package/dist/components/LogsDataList.es.js.map +1 -1
- package/dist/domains/traces/components/span-data-panel-view.cjs.js +4 -3
- package/dist/domains/traces/components/span-data-panel-view.cjs.js.map +1 -1
- package/dist/domains/traces/components/span-data-panel-view.es.js +4 -3
- package/dist/domains/traces/components/span-data-panel-view.es.js.map +1 -1
- package/dist/domains/traces/components/trace-data-panel-view.cjs.js +113 -83
- package/dist/domains/traces/components/trace-data-panel-view.cjs.js.map +1 -1
- package/dist/domains/traces/components/trace-data-panel-view.es.js +113 -83
- package/dist/domains/traces/components/trace-data-panel-view.es.js.map +1 -1
- package/dist/domains/traces/components/trace-timeline.cjs.js +14 -16
- package/dist/domains/traces/components/trace-timeline.cjs.js.map +1 -1
- package/dist/domains/traces/components/trace-timeline.es.js +14 -16
- package/dist/domains/traces/components/trace-timeline.es.js.map +1 -1
- package/dist/domains/traces/components/traces-layout.cjs.js +44 -30
- package/dist/domains/traces/components/traces-layout.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-layout.es.js +45 -31
- package/dist/domains/traces/components/traces-layout.es.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-spans.cjs.js +32 -15
- package/dist/domains/traces/hooks/use-trace-spans.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-spans.es.js +32 -17
- package/dist/domains/traces/hooks/use-trace-spans.es.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-url-state.cjs.js +31 -0
- package/dist/domains/traces/hooks/use-trace-url-state.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-trace-url-state.es.js +31 -0
- package/dist/domains/traces/hooks/use-trace-url-state.es.js.map +1 -1
- package/dist/ee/signals/components/entity-index-list.cjs.js +1 -0
- package/dist/ee/signals/components/entity-index-list.cjs.js.map +1 -1
- package/dist/ee/signals/components/entity-index-list.es.js +1 -0
- package/dist/ee/signals/components/entity-index-list.es.js.map +1 -1
- package/dist/src/domains/traces/components/trace-data-panel-view.d.ts +11 -8
- package/dist/src/domains/traces/components/trace-timeline.d.ts +1 -1
- package/dist/src/domains/traces/components/traces-layout.d.ts +19 -9
- package/dist/src/domains/traces/hooks/use-trace-spans.d.ts +204 -0
- package/dist/src/domains/traces/hooks/use-trace-url-state.d.ts +4 -0
- package/dist/style.css +29 -0
- package/package.json +7 -7
|
@@ -1,5 +1,203 @@
|
|
|
1
|
+
import { MastraClient } from '@mastra/client-js';
|
|
1
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
3
|
import { SearchableSpan } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Key, fetcher and stale policy of the `trace-spans` query. Every observer of this key must
|
|
6
|
+
* share these (rather than only the key) so one observer with a stricter `staleTime` does not
|
|
7
|
+
* refetch data another one considers fresh.
|
|
8
|
+
*/
|
|
9
|
+
export declare const traceSpansQueryOptions: (client: MastraClient, traceId: string | null | undefined) => import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<{
|
|
10
|
+
traceId: string;
|
|
11
|
+
spans: {
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date | null;
|
|
14
|
+
traceId: string;
|
|
15
|
+
spanId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
spanType: import('@mastra/core/observability').SpanType;
|
|
18
|
+
isEvent: boolean;
|
|
19
|
+
startedAt: Date;
|
|
20
|
+
entityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
21
|
+
entityId?: string | null | undefined;
|
|
22
|
+
entityName?: string | null | undefined;
|
|
23
|
+
parentEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
24
|
+
parentEntityId?: string | null | undefined;
|
|
25
|
+
parentEntityName?: string | null | undefined;
|
|
26
|
+
rootEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
27
|
+
rootEntityId?: string | null | undefined;
|
|
28
|
+
rootEntityName?: string | null | undefined;
|
|
29
|
+
userId?: string | null | undefined;
|
|
30
|
+
organizationId?: string | null | undefined;
|
|
31
|
+
resourceId?: string | null | undefined;
|
|
32
|
+
runId?: string | null | undefined;
|
|
33
|
+
sessionId?: string | null | undefined;
|
|
34
|
+
threadId?: string | null | undefined;
|
|
35
|
+
requestId?: string | null | undefined;
|
|
36
|
+
environment?: string | null | undefined;
|
|
37
|
+
serviceName?: string | null | undefined;
|
|
38
|
+
scope?: Record<string, unknown> | null | undefined;
|
|
39
|
+
entityVersionId?: string | null | undefined;
|
|
40
|
+
parentEntityVersionId?: string | null | undefined;
|
|
41
|
+
rootEntityVersionId?: string | null | undefined;
|
|
42
|
+
source?: string | null | undefined;
|
|
43
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
44
|
+
tags?: string[] | null | undefined;
|
|
45
|
+
parentSpanId?: string | null | undefined;
|
|
46
|
+
experimentId?: string | null | undefined;
|
|
47
|
+
attributes?: Record<string, unknown> | null | undefined;
|
|
48
|
+
links?: unknown[] | null | undefined;
|
|
49
|
+
input?: unknown;
|
|
50
|
+
output?: unknown;
|
|
51
|
+
error?: unknown;
|
|
52
|
+
endedAt?: Date | null | undefined;
|
|
53
|
+
requestContext?: Record<string, unknown> | null | undefined;
|
|
54
|
+
}[];
|
|
55
|
+
}, Error, {
|
|
56
|
+
traceId: string;
|
|
57
|
+
spans: {
|
|
58
|
+
createdAt: Date;
|
|
59
|
+
updatedAt: Date | null;
|
|
60
|
+
traceId: string;
|
|
61
|
+
spanId: string;
|
|
62
|
+
name: string;
|
|
63
|
+
spanType: import('@mastra/core/observability').SpanType;
|
|
64
|
+
isEvent: boolean;
|
|
65
|
+
startedAt: Date;
|
|
66
|
+
entityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
67
|
+
entityId?: string | null | undefined;
|
|
68
|
+
entityName?: string | null | undefined;
|
|
69
|
+
parentEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
70
|
+
parentEntityId?: string | null | undefined;
|
|
71
|
+
parentEntityName?: string | null | undefined;
|
|
72
|
+
rootEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
73
|
+
rootEntityId?: string | null | undefined;
|
|
74
|
+
rootEntityName?: string | null | undefined;
|
|
75
|
+
userId?: string | null | undefined;
|
|
76
|
+
organizationId?: string | null | undefined;
|
|
77
|
+
resourceId?: string | null | undefined;
|
|
78
|
+
runId?: string | null | undefined;
|
|
79
|
+
sessionId?: string | null | undefined;
|
|
80
|
+
threadId?: string | null | undefined;
|
|
81
|
+
requestId?: string | null | undefined;
|
|
82
|
+
environment?: string | null | undefined;
|
|
83
|
+
serviceName?: string | null | undefined;
|
|
84
|
+
scope?: Record<string, unknown> | null | undefined;
|
|
85
|
+
entityVersionId?: string | null | undefined;
|
|
86
|
+
parentEntityVersionId?: string | null | undefined;
|
|
87
|
+
rootEntityVersionId?: string | null | undefined;
|
|
88
|
+
source?: string | null | undefined;
|
|
89
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
90
|
+
tags?: string[] | null | undefined;
|
|
91
|
+
parentSpanId?: string | null | undefined;
|
|
92
|
+
experimentId?: string | null | undefined;
|
|
93
|
+
attributes?: Record<string, unknown> | null | undefined;
|
|
94
|
+
links?: unknown[] | null | undefined;
|
|
95
|
+
input?: unknown;
|
|
96
|
+
output?: unknown;
|
|
97
|
+
error?: unknown;
|
|
98
|
+
endedAt?: Date | null | undefined;
|
|
99
|
+
requestContext?: Record<string, unknown> | null | undefined;
|
|
100
|
+
}[];
|
|
101
|
+
}, (string | null | undefined)[]>, "queryFn"> & {
|
|
102
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<{
|
|
103
|
+
traceId: string;
|
|
104
|
+
spans: {
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
updatedAt: Date | null;
|
|
107
|
+
traceId: string;
|
|
108
|
+
spanId: string;
|
|
109
|
+
name: string;
|
|
110
|
+
spanType: import('@mastra/core/observability').SpanType;
|
|
111
|
+
isEvent: boolean;
|
|
112
|
+
startedAt: Date;
|
|
113
|
+
entityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
114
|
+
entityId?: string | null | undefined;
|
|
115
|
+
entityName?: string | null | undefined;
|
|
116
|
+
parentEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
117
|
+
parentEntityId?: string | null | undefined;
|
|
118
|
+
parentEntityName?: string | null | undefined;
|
|
119
|
+
rootEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
120
|
+
rootEntityId?: string | null | undefined;
|
|
121
|
+
rootEntityName?: string | null | undefined;
|
|
122
|
+
userId?: string | null | undefined;
|
|
123
|
+
organizationId?: string | null | undefined;
|
|
124
|
+
resourceId?: string | null | undefined;
|
|
125
|
+
runId?: string | null | undefined;
|
|
126
|
+
sessionId?: string | null | undefined;
|
|
127
|
+
threadId?: string | null | undefined;
|
|
128
|
+
requestId?: string | null | undefined;
|
|
129
|
+
environment?: string | null | undefined;
|
|
130
|
+
serviceName?: string | null | undefined;
|
|
131
|
+
scope?: Record<string, unknown> | null | undefined;
|
|
132
|
+
entityVersionId?: string | null | undefined;
|
|
133
|
+
parentEntityVersionId?: string | null | undefined;
|
|
134
|
+
rootEntityVersionId?: string | null | undefined;
|
|
135
|
+
source?: string | null | undefined;
|
|
136
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
137
|
+
tags?: string[] | null | undefined;
|
|
138
|
+
parentSpanId?: string | null | undefined;
|
|
139
|
+
experimentId?: string | null | undefined;
|
|
140
|
+
attributes?: Record<string, unknown> | null | undefined;
|
|
141
|
+
links?: unknown[] | null | undefined;
|
|
142
|
+
input?: unknown;
|
|
143
|
+
output?: unknown;
|
|
144
|
+
error?: unknown;
|
|
145
|
+
endedAt?: Date | null | undefined;
|
|
146
|
+
requestContext?: Record<string, unknown> | null | undefined;
|
|
147
|
+
}[];
|
|
148
|
+
}, (string | null | undefined)[], never> | undefined;
|
|
149
|
+
} & {
|
|
150
|
+
queryKey: (string | null | undefined)[] & {
|
|
151
|
+
[dataTagSymbol]: {
|
|
152
|
+
traceId: string;
|
|
153
|
+
spans: {
|
|
154
|
+
createdAt: Date;
|
|
155
|
+
updatedAt: Date | null;
|
|
156
|
+
traceId: string;
|
|
157
|
+
spanId: string;
|
|
158
|
+
name: string;
|
|
159
|
+
spanType: import('@mastra/core/observability').SpanType;
|
|
160
|
+
isEvent: boolean;
|
|
161
|
+
startedAt: Date;
|
|
162
|
+
entityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
163
|
+
entityId?: string | null | undefined;
|
|
164
|
+
entityName?: string | null | undefined;
|
|
165
|
+
parentEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
166
|
+
parentEntityId?: string | null | undefined;
|
|
167
|
+
parentEntityName?: string | null | undefined;
|
|
168
|
+
rootEntityType?: import('@mastra/core/observability').EntityType | null | undefined;
|
|
169
|
+
rootEntityId?: string | null | undefined;
|
|
170
|
+
rootEntityName?: string | null | undefined;
|
|
171
|
+
userId?: string | null | undefined;
|
|
172
|
+
organizationId?: string | null | undefined;
|
|
173
|
+
resourceId?: string | null | undefined;
|
|
174
|
+
runId?: string | null | undefined;
|
|
175
|
+
sessionId?: string | null | undefined;
|
|
176
|
+
threadId?: string | null | undefined;
|
|
177
|
+
requestId?: string | null | undefined;
|
|
178
|
+
environment?: string | null | undefined;
|
|
179
|
+
serviceName?: string | null | undefined;
|
|
180
|
+
scope?: Record<string, unknown> | null | undefined;
|
|
181
|
+
entityVersionId?: string | null | undefined;
|
|
182
|
+
parentEntityVersionId?: string | null | undefined;
|
|
183
|
+
rootEntityVersionId?: string | null | undefined;
|
|
184
|
+
source?: string | null | undefined;
|
|
185
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
186
|
+
tags?: string[] | null | undefined;
|
|
187
|
+
parentSpanId?: string | null | undefined;
|
|
188
|
+
experimentId?: string | null | undefined;
|
|
189
|
+
attributes?: Record<string, unknown> | null | undefined;
|
|
190
|
+
links?: unknown[] | null | undefined;
|
|
191
|
+
input?: unknown;
|
|
192
|
+
output?: unknown;
|
|
193
|
+
error?: unknown;
|
|
194
|
+
endedAt?: Date | null | undefined;
|
|
195
|
+
requestContext?: Record<string, unknown> | null | undefined;
|
|
196
|
+
}[];
|
|
197
|
+
};
|
|
198
|
+
[dataTagErrorSymbol]: Error;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
3
201
|
/**
|
|
4
202
|
* Every span of a single trace, with its full payload.
|
|
5
203
|
*
|
|
@@ -13,3 +211,9 @@ export declare function useTraceSpans(traceId: string | null | undefined): UseQu
|
|
|
13
211
|
traceId: string;
|
|
14
212
|
spans: SearchableSpan[];
|
|
15
213
|
} | null>;
|
|
214
|
+
export type TraceSpansData = Awaited<ReturnType<MastraClient['getTrace']>>;
|
|
215
|
+
/**
|
|
216
|
+
* Observes the `trace-spans` query of several traces at once and projects each one with `select`.
|
|
217
|
+
* Traces still loading (or failed) yield `fallback(traceId)` so the result always lines up with `traceIds`.
|
|
218
|
+
*/
|
|
219
|
+
export declare function useTraceSpansQueries<T>(traceIds: string[], select: (traceId: string, data: TraceSpansData) => T, fallback: (traceId: string) => T): T[];
|
|
@@ -28,6 +28,8 @@ export interface UseTraceUrlStateResult {
|
|
|
28
28
|
anchorSpanIdParam: string | undefined;
|
|
29
29
|
spanTabParam: SpanTab | undefined;
|
|
30
30
|
scoreIdParam: string | undefined;
|
|
31
|
+
/** Span ids featured in the timeline (e.g. the spans behind a reconstructed message). Empty when unset. */
|
|
32
|
+
highlightSpanIdsParam: string[];
|
|
31
33
|
listMode: TraceListMode;
|
|
32
34
|
selectedEntityOption: EntityOptions | undefined;
|
|
33
35
|
selectedStatus: TraceStatusFilter | undefined;
|
|
@@ -52,6 +54,8 @@ export interface UseTraceUrlStateResult {
|
|
|
52
54
|
* of the two changes is lost on the first click. */
|
|
53
55
|
handleSpanChangeWithTab: (spanId: string, tab: SpanTab) => void;
|
|
54
56
|
handleScoreChange: (scoreId: string | null) => void;
|
|
57
|
+
/** Features `spanIds` in the timeline and selects the first one. An empty array clears the highlight. */
|
|
58
|
+
handleHighlightSpans: (spanIds: string[]) => void;
|
|
55
59
|
/** Switches the list view between traces and branches. Clears the current selection. */
|
|
56
60
|
handleListModeChange: (mode: TraceListMode) => void;
|
|
57
61
|
handleFilterTokensChange: (nextTokens: PropertyFilterToken[]) => void;
|
package/dist/style.css
CHANGED
|
@@ -3134,6 +3134,14 @@
|
|
|
3134
3134
|
grid-template-columns: 0 repeat(9, 1fr);
|
|
3135
3135
|
}
|
|
3136
3136
|
|
|
3137
|
+
.grid-cols-\[0fr_1fr_0fr\] {
|
|
3138
|
+
grid-template-columns: 0fr 1fr 0fr;
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
.grid-cols-\[0fr_1fr_1fr\] {
|
|
3142
|
+
grid-template-columns: 0fr 1fr 1fr;
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3137
3145
|
.grid-cols-\[1\.625rem_1\.625rem_1\.625rem\] {
|
|
3138
3146
|
grid-template-columns: 1.625rem 1.625rem 1.625rem;
|
|
3139
3147
|
}
|
|
@@ -3146,6 +3154,14 @@
|
|
|
3146
3154
|
grid-template-columns: 1fr 1fr;
|
|
3147
3155
|
}
|
|
3148
3156
|
|
|
3157
|
+
.grid-cols-\[1fr_1fr_0fr\] {
|
|
3158
|
+
grid-template-columns: 1fr 1fr 0fr;
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
.grid-cols-\[1fr_1fr_1fr\] {
|
|
3162
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3149
3165
|
.grid-cols-\[1fr_2fr\] {
|
|
3150
3166
|
grid-template-columns: 1fr 2fr;
|
|
3151
3167
|
}
|
|
@@ -10405,6 +10421,14 @@
|
|
|
10405
10421
|
overflow: hidden;
|
|
10406
10422
|
}
|
|
10407
10423
|
|
|
10424
|
+
.\[\&\>\*\]\:rounded-lg > * {
|
|
10425
|
+
border-radius: var(--radius-lg);
|
|
10426
|
+
}
|
|
10427
|
+
|
|
10428
|
+
.\[\&\>\*\]\:bg-surface3 > * {
|
|
10429
|
+
background-color: var(--color-surface3);
|
|
10430
|
+
}
|
|
10431
|
+
|
|
10408
10432
|
.\[\&\>\*\]\:text-ellipsis > * {
|
|
10409
10433
|
text-overflow: ellipsis;
|
|
10410
10434
|
}
|
|
@@ -10413,6 +10437,11 @@
|
|
|
10413
10437
|
white-space: nowrap;
|
|
10414
10438
|
}
|
|
10415
10439
|
|
|
10440
|
+
.\[\&\>\*\]\:shadow-lg > * {
|
|
10441
|
+
--tw-shadow: 0 10px 15px var(--tw-shadow-color, oklch(0% 0 0 / .4));
|
|
10442
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
10443
|
+
}
|
|
10444
|
+
|
|
10416
10445
|
.\[\&\>\*\:focus-visible\]\:relative > :focus-visible {
|
|
10417
10446
|
position: relative;
|
|
10418
10447
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "53.0.0-alpha.
|
|
4
|
+
"version": "53.0.0-alpha.3",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css"
|
|
@@ -160,8 +160,8 @@
|
|
|
160
160
|
"react": ">=19.0.0",
|
|
161
161
|
"react-dom": ">=19.0.0",
|
|
162
162
|
"tailwindcss": "^4.0.0",
|
|
163
|
-
"@mastra/
|
|
164
|
-
"@mastra/
|
|
163
|
+
"@mastra/client-js": "^1.44.0-alpha.3",
|
|
164
|
+
"@mastra/react": "1.4.11-alpha.3"
|
|
165
165
|
},
|
|
166
166
|
"devDependencies": {
|
|
167
167
|
"@storybook/addon-a11y": "^10.4.1",
|
|
@@ -203,10 +203,10 @@
|
|
|
203
203
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
204
204
|
"vitest": "4.1.10",
|
|
205
205
|
"@internal/lint": "0.0.130",
|
|
206
|
-
"@mastra/client-js": "^1.44.0-alpha.
|
|
207
|
-
"@mastra/core": "1.65.0-alpha.
|
|
208
|
-
"@mastra/
|
|
209
|
-
"@mastra/
|
|
206
|
+
"@mastra/client-js": "^1.44.0-alpha.3",
|
|
207
|
+
"@mastra/core": "1.65.0-alpha.3",
|
|
208
|
+
"@mastra/react": "1.4.11-alpha.3",
|
|
209
|
+
"@mastra/memory": "1.28.3-alpha.1"
|
|
210
210
|
},
|
|
211
211
|
"homepage": "https://mastra.ai",
|
|
212
212
|
"repository": {
|