@mastra/playground-ui 8.0.0-alpha.0 → 8.0.0-alpha.2
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 +36 -0
- package/dist/index.cjs.js +46 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +46 -23
- package/dist/index.es.js.map +1 -1
- package/dist/src/domains/workspace/components/skill-detail.d.ts +3 -1
- package/dist/src/domains/workspace/types.d.ts +2 -2
- package/package.json +9 -9
package/dist/index.es.js
CHANGED
|
@@ -16637,24 +16637,21 @@ const AgentMetadataSkillList = ({ skills, agentId, workspaceId }) => {
|
|
|
16637
16637
|
}
|
|
16638
16638
|
return /* @__PURE__ */ jsx(AgentMetadataList, { children: skills.map((skill) => {
|
|
16639
16639
|
const isActivated = isSkillActivated(skill.name);
|
|
16640
|
-
|
|
16641
|
-
|
|
16640
|
+
const badge = /* @__PURE__ */ jsxs(
|
|
16641
|
+
Badge,
|
|
16642
16642
|
{
|
|
16643
|
-
|
|
16644
|
-
|
|
16645
|
-
|
|
16646
|
-
|
|
16647
|
-
|
|
16648
|
-
|
|
16649
|
-
|
|
16650
|
-
children: skill.name
|
|
16651
|
-
}
|
|
16652
|
-
) }),
|
|
16653
|
-
isActivated && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-green-400 font-medium", children: "Active" })
|
|
16654
|
-
] })
|
|
16655
|
-
},
|
|
16656
|
-
skill.name
|
|
16643
|
+
icon: /* @__PURE__ */ jsx(SkillIcon, { className: isActivated ? "text-green-400" : "text-accent2" }),
|
|
16644
|
+
variant: isActivated ? "success" : "default",
|
|
16645
|
+
children: [
|
|
16646
|
+
skill.name,
|
|
16647
|
+
isActivated && /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Active" })
|
|
16648
|
+
]
|
|
16649
|
+
}
|
|
16657
16650
|
);
|
|
16651
|
+
return /* @__PURE__ */ jsx(AgentMetadataListItem, { children: isActivated ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
16652
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: paths.agentSkillLink(agentId, skill.name, workspaceId), "data-testid": "skill-badge", children: badge }) }),
|
|
16653
|
+
/* @__PURE__ */ jsx(TooltipContent, { className: "bg-surface3 text-icon6 border border-border1", children: "Active" })
|
|
16654
|
+
] }) }) : /* @__PURE__ */ jsx(Link, { href: paths.agentSkillLink(agentId, skill.name, workspaceId), "data-testid": "skill-badge", children: badge }) }, skill.name);
|
|
16658
16655
|
}) });
|
|
16659
16656
|
};
|
|
16660
16657
|
function formatWorkspaceToolName(toolName) {
|
|
@@ -18474,7 +18471,7 @@ function EditAgentDialog({ agentId, open, onOpenChange, onSuccess, onDelete }) {
|
|
|
18474
18471
|
integrationTools: integrationToolIds,
|
|
18475
18472
|
workflows: values.workflows,
|
|
18476
18473
|
agents: values.agents,
|
|
18477
|
-
memory: values.memory,
|
|
18474
|
+
memory: values.memory ? { key: values.memory } : void 0,
|
|
18478
18475
|
scorers: values.scorers
|
|
18479
18476
|
});
|
|
18480
18477
|
toast.success("Agent updated successfully");
|
|
@@ -18517,7 +18514,7 @@ function EditAgentDialog({ agentId, open, onOpenChange, onSuccess, onDelete }) {
|
|
|
18517
18514
|
tools: allTools,
|
|
18518
18515
|
workflows: agent.workflows || [],
|
|
18519
18516
|
agents: agent.agents || [],
|
|
18520
|
-
memory: agent.memory
|
|
18517
|
+
memory: agent.memory && typeof agent.memory === "object" && "key" in agent.memory ? String(agent.memory.key) : typeof agent.memory === "string" ? agent.memory : "",
|
|
18521
18518
|
scorers: agent.scorers || {}
|
|
18522
18519
|
};
|
|
18523
18520
|
}, [agent]);
|
|
@@ -19814,7 +19811,7 @@ function CreateAgentDialog({ open, onOpenChange, onSuccess }) {
|
|
|
19814
19811
|
tools: values.tools && values.tools.length > 0 ? values.tools : void 0,
|
|
19815
19812
|
workflows: values.workflows,
|
|
19816
19813
|
agents: values.agents,
|
|
19817
|
-
memory: values.memory,
|
|
19814
|
+
memory: values.memory ? { key: values.memory } : void 0,
|
|
19818
19815
|
scorers: values.scorers
|
|
19819
19816
|
};
|
|
19820
19817
|
await createStoredAgent.mutateAsync(createParams);
|
|
@@ -25163,7 +25160,7 @@ function getSourceInfo(source) {
|
|
|
25163
25160
|
};
|
|
25164
25161
|
}
|
|
25165
25162
|
}
|
|
25166
|
-
function SkillDetail({ skill, onReferenceClick }) {
|
|
25163
|
+
function SkillDetail({ skill, rawSkillMd, onReferenceClick }) {
|
|
25167
25164
|
const [expandedSections, setExpandedSections] = useState(/* @__PURE__ */ new Set(["instructions"]));
|
|
25168
25165
|
const [showRawInstructions, setShowRawInstructions] = useState(false);
|
|
25169
25166
|
const sourceInfo = getSourceInfo(skill.source);
|
|
@@ -25189,7 +25186,7 @@ function SkillDetail({ skill, onReferenceClick }) {
|
|
|
25189
25186
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
|
|
25190
25187
|
/* @__PURE__ */ jsx(MetadataCard, { label: "Source", value: sourceInfo.label, icon: sourceInfo.icon }),
|
|
25191
25188
|
skill.license && /* @__PURE__ */ jsx(MetadataCard, { label: "License", value: skill.license }),
|
|
25192
|
-
skill.compatibility && /* @__PURE__ */ jsx(MetadataCard, { label: "Compatibility", value: skill.compatibility }),
|
|
25189
|
+
skill.compatibility != null && /* @__PURE__ */ jsx(MetadataCard, { label: "Compatibility", value: skill.compatibility }),
|
|
25193
25190
|
/* @__PURE__ */ jsx(
|
|
25194
25191
|
MetadataCard,
|
|
25195
25192
|
{
|
|
@@ -25231,7 +25228,7 @@ function SkillDetail({ skill, onReferenceClick }) {
|
|
|
25231
25228
|
backgroundColor: "transparent",
|
|
25232
25229
|
fontSize: "0.875rem"
|
|
25233
25230
|
},
|
|
25234
|
-
children: skill.instructions
|
|
25231
|
+
children: rawSkillMd ?? skill.instructions
|
|
25235
25232
|
}
|
|
25236
25233
|
) }) : /* @__PURE__ */ jsx(MarkdownRenderer, { children: skill.instructions })
|
|
25237
25234
|
}
|
|
@@ -25286,12 +25283,38 @@ function SkillDetail({ skill, onReferenceClick }) {
|
|
|
25286
25283
|
] }) })
|
|
25287
25284
|
] });
|
|
25288
25285
|
}
|
|
25286
|
+
function formatDisplayValue(value) {
|
|
25287
|
+
if (typeof value === "string") {
|
|
25288
|
+
return value;
|
|
25289
|
+
}
|
|
25290
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
25291
|
+
return String(value);
|
|
25292
|
+
}
|
|
25293
|
+
if (Array.isArray(value)) {
|
|
25294
|
+
return value.map((v) => typeof v === "string" ? v : JSON.stringify(v)).join(", ");
|
|
25295
|
+
}
|
|
25296
|
+
if (typeof value === "object" && value !== null) {
|
|
25297
|
+
const keys = Object.keys(value);
|
|
25298
|
+
if (keys.length === 0) return "{}";
|
|
25299
|
+
if (keys.length === 1) {
|
|
25300
|
+
const key = keys[0];
|
|
25301
|
+
const val = value[key];
|
|
25302
|
+
if (Array.isArray(val)) {
|
|
25303
|
+
return `${key}: ${val.join(", ")}`;
|
|
25304
|
+
}
|
|
25305
|
+
return `${key}: ${formatDisplayValue(val)}`;
|
|
25306
|
+
}
|
|
25307
|
+
return `{${keys.join(", ")}}`;
|
|
25308
|
+
}
|
|
25309
|
+
return String(value);
|
|
25310
|
+
}
|
|
25289
25311
|
function MetadataCard({ label, value, icon }) {
|
|
25312
|
+
const displayValue = formatDisplayValue(value);
|
|
25290
25313
|
return /* @__PURE__ */ jsxs("div", { className: "p-3 rounded-lg bg-surface3", children: [
|
|
25291
25314
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-icon3 mb-1", children: label }),
|
|
25292
25315
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
25293
25316
|
icon && /* @__PURE__ */ jsx("span", { className: "text-icon4", children: icon }),
|
|
25294
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-icon5", children:
|
|
25317
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-icon5 truncate", title: displayValue, children: displayValue })
|
|
25295
25318
|
] })
|
|
25296
25319
|
] });
|
|
25297
25320
|
}
|