@mastra/playground-ui 5.1.4-alpha.4 → 5.1.4
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/index.cjs.js +1 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -53
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -9788,60 +9788,9 @@ function WorkflowTrigger({ workflowId, setRunId }) {
|
|
|
9788
9788
|
] });
|
|
9789
9789
|
})
|
|
9790
9790
|
] }),
|
|
9791
|
-
result && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowJsonDialog, { result: restResult }) })
|
|
9792
|
-
result && /* @__PURE__ */ jsxRuntime.jsx(WorkflowResultSection, { result, workflow })
|
|
9791
|
+
result && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowJsonDialog, { result: restResult }) })
|
|
9793
9792
|
] });
|
|
9794
9793
|
}
|
|
9795
|
-
const WorkflowResultSection = ({ result, workflow }) => {
|
|
9796
|
-
const workflowState = result.payload.workflowState;
|
|
9797
|
-
if (typeof workflowState.result === "string" || typeof workflowState.result === "number" || typeof workflowState.result === "boolean") {
|
|
9798
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 p-5", children: [
|
|
9799
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "label", htmlFor: "string-result", variant: "ui-sm", className: "text-icon3", children: "Workflow Result" }) }),
|
|
9800
|
-
/* @__PURE__ */ jsxRuntime.jsx(Input, { id: "string-result", defaultValue: String(workflowState.result) })
|
|
9801
|
-
] });
|
|
9802
|
-
}
|
|
9803
|
-
const hasResult = Object.keys(workflowState.result || {}).length > 0;
|
|
9804
|
-
if (!hasResult) return null;
|
|
9805
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-5", children: [
|
|
9806
|
-
/* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Final Output" }),
|
|
9807
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "pt-4", children: Object.entries(workflowState.result || {}).map(([stepId, stepResult]) => {
|
|
9808
|
-
const stepDefinition = workflow.steps[stepId];
|
|
9809
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9810
|
-
"li",
|
|
9811
|
-
{
|
|
9812
|
-
className: "border-b-sm border-dashed border-border1 last:border-b-0 py-4 first:pt-0 last:pb-0",
|
|
9813
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowResultFinishedStep, { stepResult, stepDefinition })
|
|
9814
|
-
},
|
|
9815
|
-
stepId
|
|
9816
|
-
);
|
|
9817
|
-
}) })
|
|
9818
|
-
] });
|
|
9819
|
-
};
|
|
9820
|
-
const WorkflowResultFinishedStep = ({ stepResult, stepDefinition }) => {
|
|
9821
|
-
const id = React.useId();
|
|
9822
|
-
try {
|
|
9823
|
-
const zodObjectSchema = resolveSerializedZodOutput(jsonSchemaToZod(superjson.parse(stepDefinition.outputSchema)));
|
|
9824
|
-
if (zodObjectSchema?._def?.typeName === "ZodString") {
|
|
9825
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
9826
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9827
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Footprints, { className: "text-icon3" }) }),
|
|
9828
|
-
/* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "label", htmlFor: id, variant: "ui-sm", className: "text-icon3", children: stepDefinition.description })
|
|
9829
|
-
] }),
|
|
9830
|
-
/* @__PURE__ */ jsxRuntime.jsx(Input, { id, defaultValue: stepResult })
|
|
9831
|
-
] });
|
|
9832
|
-
}
|
|
9833
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
9834
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
|
|
9835
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Footprints, { className: "text-icon3" }) }),
|
|
9836
|
-
/* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: stepDefinition.description })
|
|
9837
|
-
] }),
|
|
9838
|
-
/* @__PURE__ */ jsxRuntime.jsx(DynamicForm, { schema: zodObjectSchema, defaultValues: stepResult })
|
|
9839
|
-
] });
|
|
9840
|
-
} catch (err) {
|
|
9841
|
-
console.error("Error parsing output schema", err);
|
|
9842
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Txt, { children: "An error occured. Please open an issue on GitHub." });
|
|
9843
|
-
}
|
|
9844
|
-
};
|
|
9845
9794
|
const WorkflowJsonDialog = ({ result }) => {
|
|
9846
9795
|
const [open, setOpen] = React.useState(false);
|
|
9847
9796
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|