@mastra/playground-ui 5.1.4-alpha.4 → 5.1.4-alpha.5

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.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { createContext, useContext, forwardRef, useState, useEffect, memo, useRef, useCallback, useMemo, Suspense, Fragment as Fragment$1, useId } from 'react';
3
+ import React__default, { createContext, useContext, forwardRef, useState, useEffect, memo, useRef, useCallback, useMemo, Suspense, Fragment as Fragment$1 } from 'react';
4
4
  import { MastraClient } from '@mastra/client-js';
5
5
  import { useMessage, MessagePrimitive, ActionBarPrimitive, useComposerRuntime, ComposerPrimitive, useAttachment, AttachmentPrimitive, ThreadPrimitive, useExternalStoreRuntime, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, AssistantRuntimeProvider } from '@assistant-ui/react';
6
6
  import { CheckIcon as CheckIcon$1, CopyIcon, Check, Copy, ChevronUpIcon, X, FileText, FileIcon, CircleXIcon, Mic, PlusIcon, ArrowUp, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, ChevronUp, ChevronDown, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Network, PauseIcon, Loader2, CircleDashed, Footprints, CircleCheck, CircleX, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Braces, Brackets, TrashIcon, Plus, Minus, Maximize } from 'lucide-react';
@@ -9756,60 +9756,9 @@ function WorkflowTrigger({ workflowId, setRunId }) {
9756
9756
  ] });
9757
9757
  })
9758
9758
  ] }),
9759
- result && /* @__PURE__ */ jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsx(WorkflowJsonDialog, { result: restResult }) }),
9760
- result && /* @__PURE__ */ jsx(WorkflowResultSection, { result, workflow })
9759
+ result && /* @__PURE__ */ jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsx(WorkflowJsonDialog, { result: restResult }) })
9761
9760
  ] });
9762
9761
  }
9763
- const WorkflowResultSection = ({ result, workflow }) => {
9764
- const workflowState = result.payload.workflowState;
9765
- if (typeof workflowState.result === "string" || typeof workflowState.result === "number" || typeof workflowState.result === "boolean") {
9766
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 p-5", children: [
9767
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Txt, { as: "label", htmlFor: "string-result", variant: "ui-sm", className: "text-icon3", children: "Workflow Result" }) }),
9768
- /* @__PURE__ */ jsx(Input, { id: "string-result", defaultValue: String(workflowState.result) })
9769
- ] });
9770
- }
9771
- const hasResult = Object.keys(workflowState.result || {}).length > 0;
9772
- if (!hasResult) return null;
9773
- return /* @__PURE__ */ jsxs("div", { className: "p-5", children: [
9774
- /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Final Output" }),
9775
- /* @__PURE__ */ jsx("ul", { className: "pt-4", children: Object.entries(workflowState.result || {}).map(([stepId, stepResult]) => {
9776
- const stepDefinition = workflow.steps[stepId];
9777
- return /* @__PURE__ */ jsx(
9778
- "li",
9779
- {
9780
- className: "border-b-sm border-dashed border-border1 last:border-b-0 py-4 first:pt-0 last:pb-0",
9781
- children: /* @__PURE__ */ jsx(WorkflowResultFinishedStep, { stepResult, stepDefinition })
9782
- },
9783
- stepId
9784
- );
9785
- }) })
9786
- ] });
9787
- };
9788
- const WorkflowResultFinishedStep = ({ stepResult, stepDefinition }) => {
9789
- const id = useId();
9790
- try {
9791
- const zodObjectSchema = resolveSerializedZodOutput(jsonSchemaToZod(parse(stepDefinition.outputSchema)));
9792
- if (zodObjectSchema?._def?.typeName === "ZodString") {
9793
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
9794
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
9795
- /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Footprints, { className: "text-icon3" }) }),
9796
- /* @__PURE__ */ jsx(Txt, { as: "label", htmlFor: id, variant: "ui-sm", className: "text-icon3", children: stepDefinition.description })
9797
- ] }),
9798
- /* @__PURE__ */ jsx(Input, { id, defaultValue: stepResult })
9799
- ] });
9800
- }
9801
- return /* @__PURE__ */ jsxs("div", { children: [
9802
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
9803
- /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Footprints, { className: "text-icon3" }) }),
9804
- /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: stepDefinition.description })
9805
- ] }),
9806
- /* @__PURE__ */ jsx(DynamicForm, { schema: zodObjectSchema, defaultValues: stepResult })
9807
- ] });
9808
- } catch (err) {
9809
- console.error("Error parsing output schema", err);
9810
- return /* @__PURE__ */ jsx(Txt, { children: "An error occured. Please open an issue on GitHub." });
9811
- }
9812
- };
9813
9762
  const WorkflowJsonDialog = ({ result }) => {
9814
9763
  const [open, setOpen] = useState(false);
9815
9764
  return /* @__PURE__ */ jsxs(Fragment, { children: [