@mastra/playground-ui 5.1.7-alpha.5 → 5.1.7-alpha.6
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 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -56
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
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
|
|
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, Minus, Plus, Maximize, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Braces, Brackets, TrashIcon } from 'lucide-react';
|
|
@@ -10457,63 +10457,9 @@ function WorkflowTrigger({
|
|
|
10457
10457
|
] });
|
|
10458
10458
|
})
|
|
10459
10459
|
] }),
|
|
10460
|
-
result && /* @__PURE__ */ jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsx(WorkflowJsonDialog, { result: restResult }) })
|
|
10461
|
-
result && /* @__PURE__ */ jsx(WorkflowResultSection, { result, workflow })
|
|
10460
|
+
result && /* @__PURE__ */ jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsx(WorkflowJsonDialog, { result: restResult }) })
|
|
10462
10461
|
] });
|
|
10463
10462
|
}
|
|
10464
|
-
const WorkflowResultSection = ({ result, workflow }) => {
|
|
10465
|
-
const workflowState = result.payload.workflowState;
|
|
10466
|
-
const hasResult = Object.keys(workflowState.steps || {}).length > 0;
|
|
10467
|
-
if (!hasResult) return null;
|
|
10468
|
-
return /* @__PURE__ */ jsxs("div", { className: "p-5", children: [
|
|
10469
|
-
/* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Final Output" }),
|
|
10470
|
-
/* @__PURE__ */ jsx("ul", { className: "pt-4", children: Object.entries(workflowState.steps || {}).map(([stepId, stepResult]) => {
|
|
10471
|
-
const stepDefinition = workflow.steps[stepId];
|
|
10472
|
-
if (!stepDefinition) return null;
|
|
10473
|
-
return /* @__PURE__ */ jsx(
|
|
10474
|
-
"li",
|
|
10475
|
-
{
|
|
10476
|
-
className: "border-b-sm border-dashed border-border1 last:border-b-0 py-4 first:pt-0 last:pb-0",
|
|
10477
|
-
children: /* @__PURE__ */ jsx(WorkflowResultFinishedStep, { stepResult: stepResult.output, stepDefinition })
|
|
10478
|
-
},
|
|
10479
|
-
stepId
|
|
10480
|
-
);
|
|
10481
|
-
}) })
|
|
10482
|
-
] });
|
|
10483
|
-
};
|
|
10484
|
-
const WorkflowResultFinishedStep = ({ stepResult, stepDefinition }) => {
|
|
10485
|
-
const id = useId();
|
|
10486
|
-
try {
|
|
10487
|
-
const zodObjectSchema = resolveSerializedZodOutput(jsonSchemaToZod(parse(stepDefinition.outputSchema)));
|
|
10488
|
-
if (zodObjectSchema?._def?.typeName === "ZodString") {
|
|
10489
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
10490
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10491
|
-
/* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Footprints, { className: "text-icon3" }) }),
|
|
10492
|
-
/* @__PURE__ */ jsx(Txt, { as: "label", htmlFor: id, variant: "ui-sm", className: "text-icon3", children: stepDefinition.description || stepDefinition.id })
|
|
10493
|
-
] }),
|
|
10494
|
-
/* @__PURE__ */ jsx(Input, { id, defaultValue: stepResult, readOnly: true })
|
|
10495
|
-
] });
|
|
10496
|
-
}
|
|
10497
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
10498
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
|
|
10499
|
-
/* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Footprints, { className: "text-icon3" }) }),
|
|
10500
|
-
/* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: stepDefinition.description || stepDefinition.id })
|
|
10501
|
-
] }),
|
|
10502
|
-
/* @__PURE__ */ jsx(
|
|
10503
|
-
DynamicForm,
|
|
10504
|
-
{
|
|
10505
|
-
schema: zodObjectSchema,
|
|
10506
|
-
defaultValues: stepResult,
|
|
10507
|
-
readOnly: true
|
|
10508
|
-
},
|
|
10509
|
-
JSON.stringify(stepResult)
|
|
10510
|
-
)
|
|
10511
|
-
] });
|
|
10512
|
-
} catch (err) {
|
|
10513
|
-
console.error("Error parsing output schema", err);
|
|
10514
|
-
return /* @__PURE__ */ jsx(Txt, { children: "An error occured. Please open an issue on GitHub." });
|
|
10515
|
-
}
|
|
10516
|
-
};
|
|
10517
10463
|
const WorkflowJsonDialog = ({ result }) => {
|
|
10518
10464
|
const [open, setOpen] = useState(false);
|
|
10519
10465
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|