@elizaos/client 1.6.1-alpha.6 → 1.6.1-beta.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/dist/assets/{main-CQAV8tyh.js → main-CLvs0bX8.js} +3 -3
- package/dist/assets/{main-CQAV8tyh.js.map → main-CLvs0bX8.js.map} +1 -1
- package/dist/assets/{main-BM2lpId8.js → main-llvbgk6E.js} +52 -52
- package/dist/assets/{main-BM2lpId8.js.map → main-llvbgk6E.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/src/components/agent-prism/Avatar.tsx +56 -68
- package/src/components/agent-prism/Badge.tsx +22 -29
- package/src/components/agent-prism/Button.tsx +39 -51
- package/src/components/agent-prism/CollapseAndExpandControls.tsx +9 -25
- package/src/components/agent-prism/CollapsibleSection.tsx +18 -18
- package/src/components/agent-prism/DetailsView/DetailsView.tsx +25 -30
- package/src/components/agent-prism/DetailsView/DetailsViewAttributesTab.tsx +6 -12
- package/src/components/agent-prism/DetailsView/DetailsViewHeader.tsx +9 -13
- package/src/components/agent-prism/DetailsView/DetailsViewHeaderActions.tsx +2 -2
- package/src/components/agent-prism/DetailsView/DetailsViewInputOutputTab.tsx +30 -60
- package/src/components/agent-prism/DetailsView/DetailsViewMetrics.tsx +10 -18
- package/src/components/agent-prism/DetailsView/DetailsViewRawDataTab.tsx +3 -3
- package/src/components/agent-prism/IconButton.tsx +25 -28
- package/src/components/agent-prism/PriceBadge.tsx +4 -4
- package/src/components/agent-prism/SearchInput.tsx +3 -9
- package/src/components/agent-prism/SpanCard/SpanCard.tsx +74 -104
- package/src/components/agent-prism/SpanCard/SpanCardBadges.tsx +7 -13
- package/src/components/agent-prism/SpanCard/SpanCardConnector.tsx +9 -9
- package/src/components/agent-prism/SpanCard/SpanCardTimeline.tsx +15 -20
- package/src/components/agent-prism/SpanCard/SpanCardToggle.tsx +5 -9
- package/src/components/agent-prism/SpanStatus.tsx +24 -30
- package/src/components/agent-prism/Tabs.tsx +16 -19
- package/src/components/agent-prism/TextInput.tsx +18 -21
- package/src/components/agent-prism/TimestampBadge.tsx +5 -9
- package/src/components/agent-prism/TokensBadge.tsx +6 -10
- package/src/components/agent-prism/TraceList/TraceList.tsx +11 -17
- package/src/components/agent-prism/TraceList/TraceListItem.tsx +18 -24
- package/src/components/agent-prism/TraceList/TraceListItemHeader.tsx +8 -20
- package/src/components/agent-prism/TraceViewer.tsx +36 -53
- package/src/components/agent-prism/TreeView.tsx +7 -7
- package/src/components/agent-prism/shared.ts +81 -93
- package/src/components/agent-runs/AgentRunTimeline.tsx +3 -5
- package/src/components/chat.tsx +7 -7
- package/src/lib/agent-prism-utils.ts +29 -32
- package/src/lib/eliza-span-adapter.ts +438 -440
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TraceSpanCategory } from
|
|
1
|
+
import type { TraceSpanCategory } from '@evilmartians/agent-prism-types';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Zap,
|
|
@@ -13,42 +13,32 @@ import {
|
|
|
13
13
|
type LucideIcon,
|
|
14
14
|
CircleDot,
|
|
15
15
|
ShieldCheck,
|
|
16
|
-
} from
|
|
16
|
+
} from 'lucide-react';
|
|
17
17
|
|
|
18
18
|
// TYPES
|
|
19
19
|
|
|
20
20
|
export type ColorVariant =
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
21
|
+
| 'purple'
|
|
22
|
+
| 'indigo'
|
|
23
|
+
| 'orange'
|
|
24
|
+
| 'teal'
|
|
25
|
+
| 'cyan'
|
|
26
|
+
| 'sky'
|
|
27
|
+
| 'yellow'
|
|
28
|
+
| 'emerald'
|
|
29
|
+
| 'red'
|
|
30
|
+
| 'gray';
|
|
31
31
|
|
|
32
|
-
export type ComponentSize =
|
|
33
|
-
| "4"
|
|
34
|
-
| "5"
|
|
35
|
-
| "6"
|
|
36
|
-
| "7"
|
|
37
|
-
| "8"
|
|
38
|
-
| "9"
|
|
39
|
-
| "10"
|
|
40
|
-
| "11"
|
|
41
|
-
| "12"
|
|
42
|
-
| "16";
|
|
32
|
+
export type ComponentSize = '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '16';
|
|
43
33
|
|
|
44
34
|
// CONSTANTS
|
|
45
35
|
|
|
46
36
|
export const ROUNDED_CLASSES = {
|
|
47
|
-
none:
|
|
48
|
-
sm:
|
|
49
|
-
md:
|
|
50
|
-
lg:
|
|
51
|
-
full:
|
|
37
|
+
none: 'rounded-none',
|
|
38
|
+
sm: 'rounded-sm',
|
|
39
|
+
md: 'rounded-md',
|
|
40
|
+
lg: 'rounded-lg',
|
|
41
|
+
full: 'rounded-full',
|
|
52
42
|
};
|
|
53
43
|
|
|
54
44
|
/**
|
|
@@ -64,64 +54,64 @@ export const COLOR_THEME_CLASSES: Record<
|
|
|
64
54
|
}
|
|
65
55
|
> = {
|
|
66
56
|
purple: {
|
|
67
|
-
bg:
|
|
68
|
-
darkBg:
|
|
69
|
-
text:
|
|
70
|
-
darkText:
|
|
57
|
+
bg: 'bg-purple-100',
|
|
58
|
+
darkBg: 'dark:bg-purple-950/60',
|
|
59
|
+
text: 'text-purple-500',
|
|
60
|
+
darkText: 'dark:text-purple-300',
|
|
71
61
|
},
|
|
72
62
|
indigo: {
|
|
73
|
-
bg:
|
|
74
|
-
darkBg:
|
|
75
|
-
text:
|
|
76
|
-
darkText:
|
|
63
|
+
bg: 'bg-indigo-100',
|
|
64
|
+
darkBg: 'dark:bg-indigo-950/60',
|
|
65
|
+
text: 'text-indigo-500',
|
|
66
|
+
darkText: 'dark:text-indigo-300',
|
|
77
67
|
},
|
|
78
68
|
orange: {
|
|
79
|
-
bg:
|
|
80
|
-
darkBg:
|
|
81
|
-
text:
|
|
82
|
-
darkText:
|
|
69
|
+
bg: 'bg-orange-100',
|
|
70
|
+
darkBg: 'dark:bg-orange-950/60',
|
|
71
|
+
text: 'text-orange-600',
|
|
72
|
+
darkText: 'dark:text-orange-300',
|
|
83
73
|
},
|
|
84
74
|
teal: {
|
|
85
|
-
bg:
|
|
86
|
-
darkBg:
|
|
87
|
-
text:
|
|
88
|
-
darkText:
|
|
75
|
+
bg: 'bg-teal-100',
|
|
76
|
+
darkBg: 'dark:bg-teal-950/60',
|
|
77
|
+
text: 'text-teal-600',
|
|
78
|
+
darkText: 'dark:text-teal-300',
|
|
89
79
|
},
|
|
90
80
|
cyan: {
|
|
91
|
-
bg:
|
|
92
|
-
darkBg:
|
|
93
|
-
text:
|
|
94
|
-
darkText:
|
|
81
|
+
bg: 'bg-cyan-100',
|
|
82
|
+
darkBg: 'dark:bg-cyan-950/60',
|
|
83
|
+
text: 'text-cyan-600',
|
|
84
|
+
darkText: 'dark:text-cyan-300',
|
|
95
85
|
},
|
|
96
86
|
sky: {
|
|
97
|
-
bg:
|
|
98
|
-
darkBg:
|
|
99
|
-
text:
|
|
100
|
-
darkText:
|
|
87
|
+
bg: 'bg-sky-100',
|
|
88
|
+
darkBg: 'dark:bg-sky-950/60',
|
|
89
|
+
text: 'text-sky-600',
|
|
90
|
+
darkText: 'dark:text-sky-300',
|
|
101
91
|
},
|
|
102
92
|
yellow: {
|
|
103
|
-
bg:
|
|
104
|
-
darkBg:
|
|
105
|
-
text:
|
|
106
|
-
darkText:
|
|
93
|
+
bg: 'bg-yellow-100',
|
|
94
|
+
darkBg: 'dark:bg-yellow-950/60',
|
|
95
|
+
text: 'text-yellow-700',
|
|
96
|
+
darkText: 'dark:text-yellow-300',
|
|
107
97
|
},
|
|
108
98
|
emerald: {
|
|
109
|
-
bg:
|
|
110
|
-
darkBg:
|
|
111
|
-
text:
|
|
112
|
-
darkText:
|
|
99
|
+
bg: 'bg-emerald-100',
|
|
100
|
+
darkBg: 'dark:bg-emerald-950/60',
|
|
101
|
+
text: 'text-emerald-600',
|
|
102
|
+
darkText: 'dark:text-emerald-300',
|
|
113
103
|
},
|
|
114
104
|
red: {
|
|
115
|
-
bg:
|
|
116
|
-
darkBg:
|
|
117
|
-
text:
|
|
118
|
-
darkText:
|
|
105
|
+
bg: 'bg-red-100',
|
|
106
|
+
darkBg: 'dark:bg-red-950/60',
|
|
107
|
+
text: 'text-red-600',
|
|
108
|
+
darkText: 'dark:text-red-300',
|
|
119
109
|
},
|
|
120
110
|
gray: {
|
|
121
|
-
bg:
|
|
122
|
-
darkBg:
|
|
123
|
-
text:
|
|
124
|
-
darkText:
|
|
111
|
+
bg: 'bg-gray-100',
|
|
112
|
+
darkBg: 'dark:bg-gray-900',
|
|
113
|
+
text: 'text-gray-600',
|
|
114
|
+
darkText: 'dark:text-gray-300',
|
|
125
115
|
},
|
|
126
116
|
};
|
|
127
117
|
|
|
@@ -137,67 +127,65 @@ export const SPAN_CATEGORY_CONFIG: Record<
|
|
|
137
127
|
}
|
|
138
128
|
> = {
|
|
139
129
|
llm_call: {
|
|
140
|
-
label:
|
|
141
|
-
theme:
|
|
130
|
+
label: 'LLM',
|
|
131
|
+
theme: 'purple',
|
|
142
132
|
icon: Zap,
|
|
143
133
|
},
|
|
144
134
|
tool_execution: {
|
|
145
|
-
label:
|
|
146
|
-
theme:
|
|
135
|
+
label: 'TOOL',
|
|
136
|
+
theme: 'orange',
|
|
147
137
|
icon: Wrench,
|
|
148
138
|
},
|
|
149
139
|
agent_invocation: {
|
|
150
|
-
label:
|
|
151
|
-
theme:
|
|
140
|
+
label: 'AGENT INVOCATION',
|
|
141
|
+
theme: 'indigo',
|
|
152
142
|
icon: Bot,
|
|
153
143
|
},
|
|
154
144
|
chain_operation: {
|
|
155
|
-
label:
|
|
156
|
-
theme:
|
|
145
|
+
label: 'CHAIN',
|
|
146
|
+
theme: 'teal',
|
|
157
147
|
icon: Link,
|
|
158
148
|
},
|
|
159
149
|
retrieval: {
|
|
160
|
-
label:
|
|
161
|
-
theme:
|
|
150
|
+
label: 'RETRIEVAL',
|
|
151
|
+
theme: 'cyan',
|
|
162
152
|
icon: Search,
|
|
163
153
|
},
|
|
164
154
|
embedding: {
|
|
165
|
-
label:
|
|
166
|
-
theme:
|
|
155
|
+
label: 'EMBEDDING',
|
|
156
|
+
theme: 'emerald',
|
|
167
157
|
icon: BarChart2,
|
|
168
158
|
},
|
|
169
159
|
create_agent: {
|
|
170
|
-
label:
|
|
171
|
-
theme:
|
|
160
|
+
label: 'CREATE AGENT',
|
|
161
|
+
theme: 'sky',
|
|
172
162
|
icon: Plus,
|
|
173
163
|
},
|
|
174
164
|
span: {
|
|
175
|
-
label:
|
|
176
|
-
theme:
|
|
165
|
+
label: 'SPAN',
|
|
166
|
+
theme: 'cyan',
|
|
177
167
|
icon: MoveHorizontal,
|
|
178
168
|
},
|
|
179
169
|
event: {
|
|
180
|
-
label:
|
|
181
|
-
theme:
|
|
170
|
+
label: 'EVENT',
|
|
171
|
+
theme: 'emerald',
|
|
182
172
|
icon: CircleDot,
|
|
183
173
|
},
|
|
184
174
|
guardrail: {
|
|
185
|
-
label:
|
|
186
|
-
theme:
|
|
175
|
+
label: 'GUARDRAIL',
|
|
176
|
+
theme: 'red',
|
|
187
177
|
icon: ShieldCheck,
|
|
188
178
|
},
|
|
189
179
|
unknown: {
|
|
190
|
-
label:
|
|
191
|
-
theme:
|
|
180
|
+
label: 'UNKNOWN',
|
|
181
|
+
theme: 'gray',
|
|
192
182
|
icon: HelpCircle,
|
|
193
183
|
},
|
|
194
184
|
};
|
|
195
185
|
|
|
196
186
|
// UTILS
|
|
197
187
|
|
|
198
|
-
export function getSpanCategoryTheme(
|
|
199
|
-
category: TraceSpanCategory,
|
|
200
|
-
): ColorVariant {
|
|
188
|
+
export function getSpanCategoryTheme(category: TraceSpanCategory): ColorVariant {
|
|
201
189
|
return SPAN_CATEGORY_CONFIG[category].theme;
|
|
202
190
|
}
|
|
203
191
|
|
|
@@ -41,7 +41,7 @@ export const AgentRunTimeline: React.FC<AgentRunTimelineProps> = ({ agentId }) =
|
|
|
41
41
|
};
|
|
42
42
|
})
|
|
43
43
|
.filter((item): item is TraceViewerData => item !== null);
|
|
44
|
-
}, [runs, ...runDetailQueries.map(q => q.data)]);
|
|
44
|
+
}, [runs, ...runDetailQueries.map((q) => q.data)]);
|
|
45
45
|
|
|
46
46
|
const isLoading = runsQuery.isLoading;
|
|
47
47
|
const errorMessage = runsQuery.error ? (runsQuery.error as Error).message : undefined;
|
|
@@ -58,9 +58,7 @@ export const AgentRunTimeline: React.FC<AgentRunTimelineProps> = ({ agentId }) =
|
|
|
58
58
|
|
|
59
59
|
if (errorMessage) {
|
|
60
60
|
return (
|
|
61
|
-
<div className="px-4 py-3 text-sm text-destructive">
|
|
62
|
-
Failed to load runs: {errorMessage}
|
|
63
|
-
</div>
|
|
61
|
+
<div className="px-4 py-3 text-sm text-destructive">Failed to load runs: {errorMessage}</div>
|
|
64
62
|
);
|
|
65
63
|
}
|
|
66
64
|
|
|
@@ -88,4 +86,4 @@ export const AgentRunTimeline: React.FC<AgentRunTimelineProps> = ({ agentId }) =
|
|
|
88
86
|
);
|
|
89
87
|
};
|
|
90
88
|
|
|
91
|
-
export default AgentRunTimeline;
|
|
89
|
+
export default AgentRunTimeline;
|
package/src/components/chat.tsx
CHANGED
|
@@ -372,10 +372,10 @@ export default function Chat({
|
|
|
372
372
|
// Convert AgentWithStatus to Agent, ensuring required fields have defaults
|
|
373
373
|
const targetAgentData: Agent | undefined = agentDataResponse?.data
|
|
374
374
|
? ({
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
375
|
+
...agentDataResponse.data,
|
|
376
|
+
createdAt: agentDataResponse.data.createdAt || Date.now(),
|
|
377
|
+
updatedAt: agentDataResponse.data.updatedAt || Date.now(),
|
|
378
|
+
} as Agent)
|
|
379
379
|
: undefined;
|
|
380
380
|
|
|
381
381
|
const { handleDelete: handleDeleteAgent, isDeleting: isDeletingAgent } = useDeleteAgent(
|
|
@@ -1360,11 +1360,11 @@ export default function Chat({
|
|
|
1360
1360
|
<span className="text-xs text-muted-foreground">
|
|
1361
1361
|
{moment(
|
|
1362
1362
|
(typeof channel.metadata?.createdAt === 'string' ||
|
|
1363
|
-
|
|
1363
|
+
typeof channel.metadata?.createdAt === 'number'
|
|
1364
1364
|
? channel.metadata.createdAt
|
|
1365
1365
|
: null) ||
|
|
1366
|
-
|
|
1367
|
-
|
|
1366
|
+
channel.updatedAt ||
|
|
1367
|
+
channel.createdAt
|
|
1368
1368
|
).fromNow()}
|
|
1369
1369
|
</span>
|
|
1370
1370
|
</div>
|
|
@@ -4,43 +4,40 @@ import type { TraceSpan } from '@evilmartians/agent-prism-types';
|
|
|
4
4
|
* Recursively filter spans based on a search query
|
|
5
5
|
* Matches against span title, type, and attributes
|
|
6
6
|
*/
|
|
7
|
-
export function filterSpansRecursively(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!query) {
|
|
13
|
-
return spans;
|
|
14
|
-
}
|
|
7
|
+
export function filterSpansRecursively(spans: TraceSpan[], searchQuery: string): TraceSpan[] {
|
|
8
|
+
const query = searchQuery.toLowerCase().trim();
|
|
9
|
+
if (!query) {
|
|
10
|
+
return spans;
|
|
11
|
+
}
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
const filtered: TraceSpan[] = [];
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
for (const span of spans) {
|
|
16
|
+
// Check if current span matches
|
|
17
|
+
const titleMatch = span.title.toLowerCase().includes(query);
|
|
18
|
+
const typeMatch = span.type.toLowerCase().includes(query);
|
|
19
|
+
const attributeMatch = span.attributes?.some(
|
|
20
|
+
(attr) =>
|
|
21
|
+
attr.key.toLowerCase().includes(query) ||
|
|
22
|
+
attr.value.stringValue?.toLowerCase().includes(query) ||
|
|
23
|
+
attr.value.intValue?.toLowerCase().includes(query)
|
|
24
|
+
);
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
const matchesQuery = titleMatch || typeMatch || attributeMatch;
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
// Recursively filter children
|
|
29
|
+
const filteredChildren = span.children
|
|
30
|
+
? filterSpansRecursively(span.children, searchQuery)
|
|
31
|
+
: [];
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
33
|
+
// Include span if it matches or if any of its children match
|
|
34
|
+
if (matchesQuery || filteredChildren.length > 0) {
|
|
35
|
+
filtered.push({
|
|
36
|
+
...span,
|
|
37
|
+
children: filteredChildren.length > 0 ? filteredChildren : span.children,
|
|
38
|
+
});
|
|
43
39
|
}
|
|
40
|
+
}
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
return filtered;
|
|
46
43
|
}
|