@mastra/playground-ui 6.9.1-alpha.0 → 6.9.2-alpha.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/CHANGELOG.md +20 -0
- package/dist/index.cjs.js +53 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +53 -10
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/ui/elements/notification/notification.d.ts +3 -1
- package/dist/src/domains/observability/components/span-scoring.d.ts +2 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @mastra/playground-ui
|
|
2
2
|
|
|
3
|
+
## 6.9.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix scorer filtering for SpanScoring, add error and info message for user ([#10164](https://github.com/mastra-ai/mastra/pull/10164))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`eebb7bb`](https://github.com/mastra-ai/mastra/commit/eebb7bb407c57342a3be3a2efbe68c696589feeb), [`c6e6d07`](https://github.com/mastra-ai/mastra/commit/c6e6d071ecf346a80dceab410af2c567c7e66a57), [`0e6df8f`](https://github.com/mastra-ai/mastra/commit/0e6df8f66340992cb1b319834657deb17368de52), [`6295fd7`](https://github.com/mastra-ai/mastra/commit/6295fd783d49075d5bf2c18ff9486e94d36aaa56), [`d813cf7`](https://github.com/mastra-ai/mastra/commit/d813cf7251695d85cc60469058384ffa74974484)]:
|
|
10
|
+
- @mastra/core@0.24.2-alpha.0
|
|
11
|
+
- @mastra/client-js@0.16.11-alpha.0
|
|
12
|
+
- @mastra/react@0.0.17-alpha.0
|
|
13
|
+
|
|
14
|
+
## 6.9.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`082393c`](https://github.com/mastra-ai/mastra/commit/082393c002f3751113a48da28e4c0ed3db9824d7), [`0a0aa87`](https://github.com/mastra-ai/mastra/commit/0a0aa87910dd9234ae11e8146fbf54d71f0b1516), [`56bbbd0`](https://github.com/mastra-ai/mastra/commit/56bbbd0eb4510455ff03d6bf2827fdbd307938be), [`d576fd8`](https://github.com/mastra-ai/mastra/commit/d576fd8f2a3c61bcf2f7d5d2bdfb496d442c46c2), [`5e48406`](https://github.com/mastra-ai/mastra/commit/5e48406766fa94e2b7c56b70fb7d6068cf7f3989), [`7fcce62`](https://github.com/mastra-ai/mastra/commit/7fcce62880c3525fbf752d59c0ac2c478cffe024), [`16a324f`](https://github.com/mastra-ai/mastra/commit/16a324f8c30a07d0d899bc2e4e7998c6b40a4cb6), [`26aee16`](https://github.com/mastra-ai/mastra/commit/26aee160149e7acb84a533bf45631aaed6dd7077), [`b063a81`](https://github.com/mastra-ai/mastra/commit/b063a8144176915a766ea15888e1e8a06a020776), [`5ff9462`](https://github.com/mastra-ai/mastra/commit/5ff9462691c80a6841b014bcc68f6a85c3fd3fbf)]:
|
|
19
|
+
- @mastra/client-js@0.16.10
|
|
20
|
+
- @mastra/core@0.24.1
|
|
21
|
+
- @mastra/react@0.0.16
|
|
22
|
+
|
|
3
23
|
## 6.9.1-alpha.0
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -13495,10 +13495,18 @@ function getShortId(id) {
|
|
|
13495
13495
|
return id.slice(0, 8);
|
|
13496
13496
|
}
|
|
13497
13497
|
|
|
13498
|
-
function Notification({
|
|
13498
|
+
function Notification({
|
|
13499
|
+
children,
|
|
13500
|
+
className,
|
|
13501
|
+
isVisible,
|
|
13502
|
+
autoDismiss = true,
|
|
13503
|
+
dismissTime = 5e3,
|
|
13504
|
+
dismissible = true,
|
|
13505
|
+
type = "info"
|
|
13506
|
+
}) {
|
|
13499
13507
|
const [localIsVisible, setLocalIsVisible] = React.useState(isVisible);
|
|
13500
13508
|
React.useEffect(() => {
|
|
13501
|
-
if (autoDismiss && isVisible) {
|
|
13509
|
+
if (dismissible && autoDismiss && isVisible) {
|
|
13502
13510
|
const timer = setTimeout(() => {
|
|
13503
13511
|
setLocalIsVisible(false);
|
|
13504
13512
|
}, dismissTime);
|
|
@@ -13513,13 +13521,27 @@ function Notification({ children, className, isVisible, autoDismiss = true, dism
|
|
|
13513
13521
|
"div",
|
|
13514
13522
|
{
|
|
13515
13523
|
className: cn(
|
|
13516
|
-
"grid grid-cols-[1fr_auto] gap-[0.5rem] rounded-
|
|
13517
|
-
|
|
13524
|
+
"grid grid-cols-[1fr_auto] gap-[0.5rem] rounded-lg bg-white/5 p-[1.5rem] py-[1rem] text-[0.875rem] text-icon3 items-center",
|
|
13525
|
+
{
|
|
13526
|
+
"bg-red-900/10 border border-red-900": type === "error"
|
|
13527
|
+
},
|
|
13518
13528
|
className
|
|
13519
13529
|
),
|
|
13520
13530
|
children: [
|
|
13521
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13522
|
-
|
|
13531
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13532
|
+
"div",
|
|
13533
|
+
{
|
|
13534
|
+
className: cn(
|
|
13535
|
+
"flex gap-[0.5rem] items-start",
|
|
13536
|
+
"[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:translate-y-[0.2em]",
|
|
13537
|
+
{
|
|
13538
|
+
"[&>svg]:text-red-400": type === "error"
|
|
13539
|
+
}
|
|
13540
|
+
),
|
|
13541
|
+
children
|
|
13542
|
+
}
|
|
13543
|
+
),
|
|
13544
|
+
dismissible && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", onClick: () => setLocalIsVisible(false), children: [
|
|
13523
13545
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
|
|
13524
13546
|
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children: "Dismiss" })
|
|
13525
13547
|
] })
|
|
@@ -19171,7 +19193,15 @@ function SpanTabs({
|
|
|
19171
19193
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleGaugeIcon, {}),
|
|
19172
19194
|
" Scoring"
|
|
19173
19195
|
] }) }),
|
|
19174
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19196
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19197
|
+
SpanScoring,
|
|
19198
|
+
{
|
|
19199
|
+
traceId: trace?.traceId,
|
|
19200
|
+
isTopLevelSpan: span?.parentSpanId === null,
|
|
19201
|
+
spanId: span?.spanId,
|
|
19202
|
+
entityType
|
|
19203
|
+
}
|
|
19204
|
+
)
|
|
19175
19205
|
] }),
|
|
19176
19206
|
/* @__PURE__ */ jsxRuntime.jsxs(Section, { children: [
|
|
19177
19207
|
/* @__PURE__ */ jsxRuntime.jsx(Section.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(Section.Heading, { children: [
|
|
@@ -19768,8 +19798,8 @@ const useTriggerScorer = () => {
|
|
|
19768
19798
|
});
|
|
19769
19799
|
};
|
|
19770
19800
|
|
|
19771
|
-
const SpanScoring = ({ traceId, spanId, entityType }) => {
|
|
19772
|
-
const { data: scorers = {}, isLoading } = useScorers();
|
|
19801
|
+
const SpanScoring = ({ traceId, spanId, entityType, isTopLevelSpan }) => {
|
|
19802
|
+
const { data: scorers = {}, isLoading, error } = useScorers();
|
|
19773
19803
|
const [selectedScorer, setSelectedScorer] = React.useState(null);
|
|
19774
19804
|
const { mutate: triggerScorer, isPending, isSuccess } = useTriggerScorer();
|
|
19775
19805
|
const [notificationIsVisible, setNotificationIsVisible] = React.useState(false);
|
|
@@ -19785,7 +19815,7 @@ const SpanScoring = ({ traceId, spanId, entityType }) => {
|
|
|
19785
19815
|
isRegistered: scorer.isRegistered,
|
|
19786
19816
|
type: scorer.scorer.config.type
|
|
19787
19817
|
})).filter((scorer) => scorer.isRegistered);
|
|
19788
|
-
if (entityType !== "Agent" ||
|
|
19818
|
+
if (entityType !== "Agent" || !isTopLevelSpan) {
|
|
19789
19819
|
scorerList = scorerList.filter((scorer) => scorer.type !== "agent");
|
|
19790
19820
|
}
|
|
19791
19821
|
const isWaiting = isPending || isLoading;
|
|
@@ -19804,6 +19834,19 @@ const SpanScoring = ({ traceId, spanId, entityType }) => {
|
|
|
19804
19834
|
setNotificationIsVisible(false);
|
|
19805
19835
|
};
|
|
19806
19836
|
const selectedScorerDescription = scorerList.find((s) => s.name === selectedScorer)?.description || "";
|
|
19837
|
+
if (error) {
|
|
19838
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Notification, { isVisible: true, autoDismiss: false, type: "error", children: [
|
|
19839
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, {}),
|
|
19840
|
+
" ",
|
|
19841
|
+
error?.message ? error.message : "Failed to load scorers."
|
|
19842
|
+
] });
|
|
19843
|
+
}
|
|
19844
|
+
if (scorerList.length === 0) {
|
|
19845
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Notification, { isVisible: true, dismissible: false, children: [
|
|
19846
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, {}),
|
|
19847
|
+
" No eligible scorers have been defined to run."
|
|
19848
|
+
] });
|
|
19849
|
+
}
|
|
19807
19850
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
19808
19851
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[3fr_1fr] gap-[1rem] items-start", children: [
|
|
19809
19852
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-[0.5rem]", children: [
|