@mastra/playground-ui 7.0.0-beta.24 → 7.0.0-beta.26

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 { useAssistantState, useMessage, MessagePrimitive, ActionBarPrimitive, useComposerRuntime, useAttachment, ComposerPrimitive, AttachmentPrimitive, useComposer, ThreadPrimitive, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechSynthesisAdapter, useExternalStoreRuntime, AssistantRuntimeProvider } from '@assistant-ui/react';
3
- import { CheckIcon as CheckIcon$1, CopyIcon, ShieldAlert, ChevronDown, ChevronRight, RefreshCw, Tag, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, ChevronUpIcon, CheckCircleIcon, X, Share2, Check, Clock as Clock$1, PlayCircle, Workflow, Layers, List, CalendarClock, Timer, CornerDownRight, GitBranch, Repeat, Repeat1, Network, TriangleAlertIcon, XIcon, CalendarIcon, CircleAlertIcon, Braces, ChevronDownIcon, Brackets, PlusIcon, TrashIcon, Plus, Loader2, Circle, EyeOffIcon, EyeIcon, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Maximize, AlertCircleIcon, CirclePause, StopCircle, Cpu, SearchIcon, ChevronsUpDown, Search, ArrowRight, ArrowLeft, BrainIcon, AudioLinesIcon, StopCircleIcon, FileText, CircleXIcon, Link, CloudUpload, Mic, ArrowUp, SaveIcon, Info, ExternalLink, ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, ChevronRightIcon, GaugeIcon, ChevronsLeftRightEllipsisIcon, CalculatorIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, RotateCcw, GripVertical, RefreshCcwIcon, AlertTriangleIcon, Copy, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, CircleChevronUpIcon, CircleChevronDownIcon, FileIcon, ChevronsUpIcon, ChevronsDownIcon, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, CircleDashedIcon, ArrowRightToLineIcon, CoinsIcon, BracesIcon, CircleGaugeIcon, PanelTopIcon, ListTreeIcon, PanelLeftIcon, PanelRightIcon, KeyboardIcon, CircleSlash, Trash, Link2, MoveRight } from 'lucide-react';
3
+ import { CheckIcon as CheckIcon$1, CopyIcon, ShieldAlert, ChevronDown, ChevronRight, RefreshCw, Tag, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, ChevronUpIcon, CheckCircleIcon, X, Share2, Check, Clock as Clock$1, PlayCircle, Workflow, Layers, List, CalendarClock, Timer, CornerDownRight, GitBranch, Repeat, Repeat1, Network, TriangleAlertIcon, XIcon, CalendarIcon, CircleAlertIcon, Braces, ChevronDownIcon, Brackets, PlusIcon, TrashIcon, Plus, Loader2, Circle, EyeOffIcon, EyeIcon, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Maximize, AlertCircleIcon, CirclePause, StopCircle, SearchIcon, Cpu, ChevronsUpDown, Search, ArrowRight, ArrowLeft, BrainIcon, AudioLinesIcon, StopCircleIcon, FileText, CircleXIcon, Link, CloudUpload, Mic, ArrowUp, SaveIcon, Info, ExternalLink, ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, ChevronRightIcon, GaugeIcon, ChevronsLeftRightEllipsisIcon, CalculatorIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, RotateCcw, GripVertical, RefreshCcwIcon, AlertTriangleIcon, Copy, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, CircleChevronUpIcon, CircleChevronDownIcon, FileIcon, ChevronsUpIcon, ChevronsDownIcon, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, CircleDashedIcon, ArrowRightToLineIcon, CoinsIcon, BracesIcon, CircleGaugeIcon, PanelTopIcon, ListTreeIcon, PanelLeftIcon, PanelRightIcon, KeyboardIcon, CircleSlash, Trash, Link2, MoveRight } from 'lucide-react';
4
4
  import * as React from 'react';
5
5
  import React__default, { forwardRef, memo, useState, useEffect, useRef, useCallback, useMemo, createContext, useContext, Fragment as Fragment$1, useId, useEffectEvent, Suspense, useLayoutEffect } from 'react';
6
6
  import { S as Shadows, G as Glows, B as BorderColors, C as Colors, a as Sizes, F as FontSizes, L as LineHeights, b as BorderRadius, c as Spacings } from './spacings-Ddc7umGk.js';
@@ -72,6 +72,7 @@ import { languages } from '@codemirror/language-data';
72
72
  import { githubDarkInit } from '@uiw/codemirror-theme-github';
73
73
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
74
74
  import { format as format$1 } from 'date-fns/format';
75
+ import { EntityType } from '@mastra/core/observability';
75
76
  import semver from 'semver';
76
77
 
77
78
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
@@ -4306,6 +4307,36 @@ const AgentNetworkCoinIcon = (props) => /* @__PURE__ */ jsxs("svg", { width: "12
4306
4307
  ) }) })
4307
4308
  ] });
4308
4309
 
4310
+ function ProcessorIcon(props) {
4311
+ return /* @__PURE__ */ jsxs(
4312
+ "svg",
4313
+ {
4314
+ width: "24",
4315
+ height: "24",
4316
+ viewBox: "0 0 24 24",
4317
+ fill: "none",
4318
+ stroke: "currentColor",
4319
+ strokeWidth: "2",
4320
+ strokeLinecap: "round",
4321
+ strokeLinejoin: "round",
4322
+ xmlns: "http://www.w3.org/2000/svg",
4323
+ ...props,
4324
+ children: [
4325
+ /* @__PURE__ */ jsx("rect", { width: "16", height: "16", x: "4", y: "4", rx: "2" }),
4326
+ /* @__PURE__ */ jsx("rect", { width: "6", height: "6", x: "9", y: "9", rx: "1" }),
4327
+ /* @__PURE__ */ jsx("path", { d: "M15 2v2" }),
4328
+ /* @__PURE__ */ jsx("path", { d: "M15 20v2" }),
4329
+ /* @__PURE__ */ jsx("path", { d: "M2 15h2" }),
4330
+ /* @__PURE__ */ jsx("path", { d: "M2 9h2" }),
4331
+ /* @__PURE__ */ jsx("path", { d: "M20 15h2" }),
4332
+ /* @__PURE__ */ jsx("path", { d: "M20 9h2" }),
4333
+ /* @__PURE__ */ jsx("path", { d: "M9 2v2" }),
4334
+ /* @__PURE__ */ jsx("path", { d: "M9 20v2" })
4335
+ ]
4336
+ }
4337
+ );
4338
+ }
4339
+
4309
4340
  const variantClasses$1 = {
4310
4341
  warning: "bg-accent6Darker border-accent6/30 text-accent6",
4311
4342
  destructive: "bg-accent2Darker border-accent2/30 text-accent2",
@@ -4726,6 +4757,8 @@ function ToolCallProvider({
4726
4757
  children,
4727
4758
  approveToolcall,
4728
4759
  declineToolcall,
4760
+ approveToolcallGenerate,
4761
+ declineToolcallGenerate,
4729
4762
  approveNetworkToolcall,
4730
4763
  declineNetworkToolcall,
4731
4764
  isRunning,
@@ -4738,6 +4771,8 @@ function ToolCallProvider({
4738
4771
  value: {
4739
4772
  approveToolcall,
4740
4773
  declineToolcall,
4774
+ approveToolcallGenerate,
4775
+ declineToolcallGenerate,
4741
4776
  approveNetworkToolcall,
4742
4777
  declineNetworkToolcall,
4743
4778
  isRunning,
@@ -4761,11 +4796,14 @@ const ToolApprovalButtons = ({
4761
4796
  toolCallId,
4762
4797
  toolApprovalMetadata,
4763
4798
  toolName,
4764
- isNetwork
4799
+ isNetwork,
4800
+ isGenerateMode
4765
4801
  }) => {
4766
4802
  const {
4767
4803
  approveToolcall,
4768
4804
  declineToolcall,
4805
+ approveToolcallGenerate,
4806
+ declineToolcallGenerate,
4769
4807
  isRunning,
4770
4808
  toolCallApprovals,
4771
4809
  approveNetworkToolcall,
@@ -4775,6 +4813,8 @@ const ToolApprovalButtons = ({
4775
4813
  const handleApprove = () => {
4776
4814
  if (isNetwork) {
4777
4815
  approveNetworkToolcall(toolName, toolApprovalMetadata?.runId);
4816
+ } else if (isGenerateMode) {
4817
+ approveToolcallGenerate(toolCallId);
4778
4818
  } else {
4779
4819
  approveToolcall(toolCallId);
4780
4820
  }
@@ -4782,6 +4822,8 @@ const ToolApprovalButtons = ({
4782
4822
  const handleDecline = () => {
4783
4823
  if (isNetwork) {
4784
4824
  declineNetworkToolcall(toolName, toolApprovalMetadata?.runId);
4825
+ } else if (isGenerateMode) {
4826
+ declineToolcallGenerate(toolCallId);
4785
4827
  } else {
4786
4828
  declineToolcall(toolCallId);
4787
4829
  }
@@ -4883,7 +4925,8 @@ const ToolBadge = ({
4883
4925
  toolCallId,
4884
4926
  toolApprovalMetadata,
4885
4927
  toolName,
4886
- isNetwork
4928
+ isNetwork,
4929
+ isGenerateMode: metadata?.mode === "generate"
4887
4930
  }
4888
4931
  )
4889
4932
  ] })
@@ -4961,7 +5004,10 @@ const useWorkflows = () => {
4961
5004
  const { requestContext } = usePlaygroundStore();
4962
5005
  return useQuery({
4963
5006
  queryKey: ["workflows", requestContext],
4964
- queryFn: () => client.listWorkflows(requestContext)
5007
+ queryFn: async () => {
5008
+ const workflows = await client.listWorkflows(requestContext);
5009
+ return Object.fromEntries(Object.entries(workflows).filter(([_, workflow]) => !workflow.isProcessorWorkflow));
5010
+ }
4965
5011
  });
4966
5012
  };
4967
5013
 
@@ -8137,9 +8183,10 @@ const WorkflowInputData = ({
8137
8183
  isSubmitLoading,
8138
8184
  submitButtonLabel,
8139
8185
  onSubmit,
8140
- children
8186
+ children,
8187
+ isProcessorWorkflow
8141
8188
  }) => {
8142
- const [type, setType] = useState("form");
8189
+ const [type, setType] = useState(isProcessorWorkflow ? "simple" : "form");
8143
8190
  return /* @__PURE__ */ jsxs("div", { children: [
8144
8191
  /* @__PURE__ */ jsx(
8145
8192
  RadioGroup,
@@ -8149,6 +8196,10 @@ const WorkflowInputData = ({
8149
8196
  onValueChange: (value) => setType(value),
8150
8197
  className: "pb-4",
8151
8198
  children: /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-4", children: [
8199
+ isProcessorWorkflow && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
8200
+ /* @__PURE__ */ jsx(RadioGroupItem, { value: "simple", id: "simple" }),
8201
+ /* @__PURE__ */ jsx(Label, { htmlFor: "simple", className: "!text-neutral3 text-ui-sm", children: "Simple" })
8202
+ ] }),
8152
8203
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
8153
8204
  /* @__PURE__ */ jsx(RadioGroupItem, { value: "form", id: "form" }),
8154
8205
  /* @__PURE__ */ jsx(Label, { htmlFor: "form", className: "!text-neutral3 text-ui-sm", children: "Form" })
@@ -8166,7 +8217,18 @@ const WorkflowInputData = ({
8166
8217
  className: cn({
8167
8218
  "opacity-50 pointer-events-none": isSubmitLoading
8168
8219
  }),
8169
- children: type === "form" ? /* @__PURE__ */ jsx(
8220
+ children: type === "simple" && isProcessorWorkflow ? /* @__PURE__ */ jsx(
8221
+ SimpleProcessorInput,
8222
+ {
8223
+ schema,
8224
+ defaultValues,
8225
+ isSubmitLoading,
8226
+ submitButtonLabel,
8227
+ onSubmit,
8228
+ withoutSubmit,
8229
+ children
8230
+ }
8231
+ ) : type === "form" ? /* @__PURE__ */ jsx(
8170
8232
  DynamicForm,
8171
8233
  {
8172
8234
  schema,
@@ -8235,6 +8297,87 @@ const JSONInput = ({
8235
8297
  withoutSubmit ? null : /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleSubmit, className: "w-full", size: "lg", children: isSubmitLoading ? /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) : submitButtonLabel })
8236
8298
  ] });
8237
8299
  };
8300
+ const PROCESSOR_PHASES = [
8301
+ { value: "input", label: "Input - Process input messages before LLM" },
8302
+ { value: "inputStep", label: "Input Step - Process at each agentic loop step" },
8303
+ { value: "outputStream", label: "Output Stream - Process streaming chunks" },
8304
+ { value: "outputResult", label: "Output Result - Process complete output" },
8305
+ { value: "outputStep", label: "Output Step - Process after each LLM response" }
8306
+ ];
8307
+ const SimpleProcessorInput = ({
8308
+ schema,
8309
+ defaultValues,
8310
+ isSubmitLoading,
8311
+ submitButtonLabel,
8312
+ onSubmit,
8313
+ withoutSubmit,
8314
+ children
8315
+ }) => {
8316
+ const [message, setMessage] = useState("Hello, this is a test message.");
8317
+ const [phase, setPhase] = useState("input");
8318
+ const [errors, setErrors] = useState([]);
8319
+ const handleSubmit = () => {
8320
+ setErrors([]);
8321
+ const isOutputPhase = phase === "outputStep" || phase === "outputResult";
8322
+ const messageRole = isOutputPhase ? "assistant" : "user";
8323
+ const data = {
8324
+ messages: [
8325
+ {
8326
+ id: crypto.randomUUID(),
8327
+ role: messageRole,
8328
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
8329
+ content: {
8330
+ format: 2,
8331
+ parts: [{ type: "text", text: message }]
8332
+ }
8333
+ }
8334
+ ],
8335
+ phase
8336
+ };
8337
+ try {
8338
+ const result = schema.safeParse(data);
8339
+ if (!result.success) {
8340
+ setErrors(result.error.issues.map((e) => `[${e.path.join(".")}] ${e.message}`));
8341
+ } else {
8342
+ onSubmit(result.data);
8343
+ }
8344
+ } catch (e) {
8345
+ setErrors(["Error processing input"]);
8346
+ }
8347
+ };
8348
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
8349
+ errors.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border border-accent2 rounded-lg p-2", children: [
8350
+ /* @__PURE__ */ jsxs(Txt, { as: "p", variant: "ui-md", className: "text-accent2 font-semibold", children: [
8351
+ errors.length,
8352
+ " errors found"
8353
+ ] }),
8354
+ /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside", children: errors.map((error, idx) => /* @__PURE__ */ jsx("li", { className: "text-ui-sm text-accent2", children: error }, idx)) })
8355
+ ] }),
8356
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
8357
+ /* @__PURE__ */ jsx(Txt, { as: "label", variant: "ui-sm", className: "text-neutral3", children: "Phase" }),
8358
+ /* @__PURE__ */ jsxs(Select, { value: phase, onValueChange: setPhase, children: [
8359
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select phase" }) }),
8360
+ /* @__PURE__ */ jsx(SelectContent, { children: PROCESSOR_PHASES.map((p) => /* @__PURE__ */ jsx(SelectItem, { value: p.value, children: p.value }, p.value)) })
8361
+ ] }),
8362
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-xs", className: "text-icon4", children: PROCESSOR_PHASES.find((p) => p.value === phase)?.label })
8363
+ ] }),
8364
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
8365
+ /* @__PURE__ */ jsx(Txt, { as: "label", variant: "ui-sm", className: "text-neutral3", children: "Test Message" }),
8366
+ /* @__PURE__ */ jsx(
8367
+ "textarea",
8368
+ {
8369
+ value: message,
8370
+ onChange: (e) => setMessage(e.target.value),
8371
+ placeholder: "Enter a test message...",
8372
+ rows: 4,
8373
+ className: "w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-none focus:ring-2 focus:ring-accent1"
8374
+ }
8375
+ )
8376
+ ] }),
8377
+ children,
8378
+ withoutSubmit ? null : /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleSubmit, className: "w-full", size: "lg", children: isSubmitLoading ? /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) : submitButtonLabel })
8379
+ ] });
8380
+ };
8238
8381
 
8239
8382
  const formatJSON = async (code) => {
8240
8383
  const formatted = await prettier.format(code, {
@@ -9615,7 +9758,8 @@ function WorkflowTrigger({
9615
9758
  setPayload(data);
9616
9759
  handleExecuteWorkflow(data);
9617
9760
  },
9618
- withoutSubmit: !!paramsRunId
9761
+ withoutSubmit: !!paramsRunId,
9762
+ isProcessorWorkflow: workflow?.isProcessorWorkflow
9619
9763
  }
9620
9764
  ) : !!paramsRunId ? null : /* @__PURE__ */ jsx(
9621
9765
  Button,
@@ -10046,6 +10190,8 @@ const LinkComponentContext = createContext({
10046
10190
  networkThreadLink: () => "",
10047
10191
  scorerLink: () => "",
10048
10192
  toolLink: () => "",
10193
+ processorsLink: () => "",
10194
+ processorLink: () => "",
10049
10195
  mcpServerLink: () => "",
10050
10196
  mcpServerToolLink: () => "",
10051
10197
  workflowRunLink: () => ""
@@ -10062,7 +10208,7 @@ const useLinkComponent = () => {
10062
10208
  return ctx;
10063
10209
  };
10064
10210
 
10065
- const columns$4 = [
10211
+ const columns$5 = [
10066
10212
  {
10067
10213
  id: "name",
10068
10214
  header: "Name",
@@ -10072,10 +10218,7 @@ const columns$4 = [
10072
10218
  return /* @__PURE__ */ jsx(
10073
10219
  EntryCell,
10074
10220
  {
10075
- name: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
10076
- /* @__PURE__ */ jsx(Link, { href: paths.workflowLink(row.original.id), children: row.original.name }),
10077
- workflow.isProcessorWorkflow && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(Cpu, { className: "h-3 w-3" }), className: "!h-badge-sm bg-violet-500/20 text-violet-400", children: "Processor" })
10078
- ] }),
10221
+ name: /* @__PURE__ */ jsx(Link, { href: paths.workflowLink(row.original.id), children: row.original.name }),
10079
10222
  description: workflow.description,
10080
10223
  meta: void 0
10081
10224
  }
@@ -10188,7 +10331,7 @@ function WorkflowTable({ workflows, isLoading }) {
10188
10331
  }, [workflows]);
10189
10332
  const table = useReactTable({
10190
10333
  data: workflowData,
10191
- columns: columns$4,
10334
+ columns: columns$5,
10192
10335
  getCoreRowModel: getCoreRowModel()
10193
10336
  });
10194
10337
  const ths = table.getHeaderGroups()[0];
@@ -11081,7 +11224,8 @@ const WorkflowBadge = ({
11081
11224
  toolCallId,
11082
11225
  toolApprovalMetadata,
11083
11226
  toolName,
11084
- isNetwork
11227
+ isNetwork,
11228
+ isGenerateMode: metadata?.mode === "generate"
11085
11229
  }
11086
11230
  )
11087
11231
  ]
@@ -11185,7 +11329,8 @@ const AgentBadge = ({
11185
11329
  toolCallId,
11186
11330
  toolApprovalMetadata,
11187
11331
  toolName,
11188
- isNetwork
11332
+ isNetwork,
11333
+ isGenerateMode: metadata?.mode === "generate"
11189
11334
  }
11190
11335
  )
11191
11336
  ]
@@ -11253,8 +11398,8 @@ const ToolFallbackInner = ({ toolName, result, args, metadata, toolCallId, ...pr
11253
11398
  const isNetwork = metadata?.mode === "network";
11254
11399
  const agentToolName = toolName.startsWith("agent-") ? toolName.substring("agent-".length) : toolName;
11255
11400
  const workflowToolName = toolName.startsWith("workflow-") ? toolName.substring("workflow-".length) : toolName;
11256
- const requireApprovalMetadata = (metadata?.mode === "stream" || metadata?.mode === "network") && metadata?.requireApprovalMetadata;
11257
- const suspendedTools = (metadata?.mode === "stream" || metadata?.mode === "network") && metadata?.suspendedTools;
11401
+ const requireApprovalMetadata = (metadata?.mode === "stream" || metadata?.mode === "network" || metadata?.mode === "generate") && metadata?.requireApprovalMetadata;
11402
+ const suspendedTools = (metadata?.mode === "stream" || metadata?.mode === "network" || metadata?.mode === "generate") && metadata?.suspendedTools;
11258
11403
  const toolApprovalMetadata = requireApprovalMetadata ? requireApprovalMetadata?.[toolName] ?? requireApprovalMetadata?.[toolCallId] : void 0;
11259
11404
  const suspendedToolMetadata = suspendedTools ? suspendedTools?.[toolName] : void 0;
11260
11405
  const toolCalled = metadata?.mode === "network" && metadata?.hasMoreMessages ? true : void 0;
@@ -13000,6 +13145,8 @@ function MastraRuntimeProvider({
13000
13145
  setMessages,
13001
13146
  approveToolCall,
13002
13147
  declineToolCall,
13148
+ approveToolCallGenerate,
13149
+ declineToolCallGenerate,
13003
13150
  toolCallApprovals,
13004
13151
  approveNetworkToolCall,
13005
13152
  declineNetworkToolCall,
@@ -13451,6 +13598,8 @@ function MastraRuntimeProvider({
13451
13598
  {
13452
13599
  approveToolcall: approveToolCall,
13453
13600
  declineToolcall: declineToolCall,
13601
+ approveToolcallGenerate: approveToolCallGenerate,
13602
+ declineToolcallGenerate: declineToolCallGenerate,
13454
13603
  isRunning: isRunningStream,
13455
13604
  toolCallApprovals,
13456
13605
  approveNetworkToolcall: approveNetworkToolCall,
@@ -14054,7 +14203,7 @@ const AgentSettings = ({ agentId }) => {
14054
14203
  ] });
14055
14204
  };
14056
14205
 
14057
- const NameCell$3 = ({ row }) => {
14206
+ const NameCell$4 = ({ row }) => {
14058
14207
  const { Link, paths } = useLinkComponent();
14059
14208
  return /* @__PURE__ */ jsx(
14060
14209
  EntryCell,
@@ -14064,11 +14213,11 @@ const NameCell$3 = ({ row }) => {
14064
14213
  }
14065
14214
  );
14066
14215
  };
14067
- const columns$3 = [
14216
+ const columns$4 = [
14068
14217
  {
14069
14218
  header: "Name",
14070
14219
  accessorKey: "name",
14071
- cell: NameCell$3
14220
+ cell: NameCell$4
14072
14221
  },
14073
14222
  {
14074
14223
  header: "Model",
@@ -14110,7 +14259,9 @@ const columns$3 = [
14110
14259
  const agentsCount = Object.keys(agent.agents || {}).length;
14111
14260
  const toolsCount = Object.keys(agent.tools || {}).length;
14112
14261
  const workflowsCount = Object.keys(agent.workflows || {}).length;
14113
- return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsxs("span", { className: "flex flex-row gap-2 w-full items-center", children: [
14262
+ const inputProcessorsCount = (agent.inputProcessors || []).length;
14263
+ const outputProcessorsCount = (agent.outputProcessors || []).length;
14264
+ return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsxs("span", { className: "flex flex-row gap-2 w-full items-center flex-wrap", children: [
14114
14265
  /* @__PURE__ */ jsxs(Badge, { variant: "default", icon: /* @__PURE__ */ jsx(AgentIcon, { className: "text-accent1" }), children: [
14115
14266
  agentsCount,
14116
14267
  " agent",
@@ -14125,6 +14276,22 @@ const columns$3 = [
14125
14276
  workflowsCount,
14126
14277
  " workflow",
14127
14278
  workflowsCount > 1 ? "s" : ""
14279
+ ] }),
14280
+ (inputProcessorsCount > 0 || outputProcessorsCount > 0) && /* @__PURE__ */ jsxs(Tooltip, { children: [
14281
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Badge, { variant: "default", icon: /* @__PURE__ */ jsx(ProcessorIcon, { className: "text-accent4" }) }) }),
14282
+ /* @__PURE__ */ jsxs(TooltipContent, { className: "flex flex-col gap-1", children: [
14283
+ /* @__PURE__ */ jsx(
14284
+ "a",
14285
+ {
14286
+ href: "https://mastra.ai/docs/agents/processors",
14287
+ target: "_blank",
14288
+ rel: "noopener noreferrer",
14289
+ className: "text-accent1 hover:underline",
14290
+ children: "Processors"
14291
+ }
14292
+ ),
14293
+ /* @__PURE__ */ jsx("span", { className: "text-icon3", children: [inputProcessorsCount > 0 && "input", outputProcessorsCount > 0 && "output"].filter(Boolean).join(", ") })
14294
+ ] })
14128
14295
  ] })
14129
14296
  ] }) });
14130
14297
  }
@@ -14137,7 +14304,7 @@ function AgentsTable({ agents, isLoading }) {
14137
14304
  const projectData = useMemo(() => Object.values(agents), [agents]);
14138
14305
  const table = useReactTable({
14139
14306
  data: projectData,
14140
- columns: columns$3,
14307
+ columns: columns$4,
14141
14308
  getCoreRowModel: getCoreRowModel()
14142
14309
  });
14143
14310
  const ths = table.getHeaderGroups()[0];
@@ -15183,7 +15350,7 @@ function ScorerCombobox({
15183
15350
  );
15184
15351
  }
15185
15352
 
15186
- const NameCell$2 = ({ row }) => {
15353
+ const NameCell$3 = ({ row }) => {
15187
15354
  const { Link, paths } = useLinkComponent();
15188
15355
  const scorer = row.original;
15189
15356
  return /* @__PURE__ */ jsx(
@@ -15194,11 +15361,11 @@ const NameCell$2 = ({ row }) => {
15194
15361
  }
15195
15362
  );
15196
15363
  };
15197
- const columns$2 = [
15364
+ const columns$3 = [
15198
15365
  {
15199
15366
  header: "Name",
15200
15367
  accessorKey: "name",
15201
- cell: NameCell$2
15368
+ cell: NameCell$3
15202
15369
  }
15203
15370
  ];
15204
15371
 
@@ -15217,7 +15384,7 @@ function ScorersTable({ scorers, isLoading }) {
15217
15384
  );
15218
15385
  const table = useReactTable({
15219
15386
  data: scorersData,
15220
- columns: columns$2,
15387
+ columns: columns$3,
15221
15388
  getCoreRowModel: getCoreRowModel()
15222
15389
  });
15223
15390
  const ths = table.getHeaderGroups()[0];
@@ -16157,6 +16324,8 @@ const AgentMetadata = ({ agentId }) => {
16157
16324
  const tools = Object.keys(agentTools).map((key) => agentTools[key]);
16158
16325
  const agentWorkflows = agent.workflows ?? {};
16159
16326
  const workflows = Object.keys(agentWorkflows).map((key) => ({ id: key, ...agentWorkflows[key] }));
16327
+ const inputProcessors = agent.inputProcessors ?? [];
16328
+ const outputProcessors = agent.outputProcessors ?? [];
16160
16329
  return /* @__PURE__ */ jsxs(AgentMetadataWrapper, { children: [
16161
16330
  agent?.description && /* @__PURE__ */ jsx(AgentMetadataSection, { title: "Description", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-neutral6", children: agent.description }) }),
16162
16331
  agent.modelList ? /* @__PURE__ */ jsx(AgentMetadataSection, { title: "Models", children: /* @__PURE__ */ jsx(
@@ -16250,6 +16419,17 @@ const AgentMetadata = ({ agentId }) => {
16250
16419
  children: /* @__PURE__ */ jsx(AgentMetadataWorkflowList, { workflows })
16251
16420
  }
16252
16421
  ),
16422
+ (inputProcessors.length > 0 || outputProcessors.length > 0) && /* @__PURE__ */ jsx(
16423
+ AgentMetadataSection,
16424
+ {
16425
+ title: "Processors",
16426
+ hint: {
16427
+ link: "https://mastra.ai/docs/agents/processors",
16428
+ title: "Processors documentation"
16429
+ },
16430
+ children: /* @__PURE__ */ jsx(AgentMetadataCombinedProcessorList, { inputProcessors, outputProcessors })
16431
+ }
16432
+ ),
16253
16433
  /* @__PURE__ */ jsx(AgentMetadataSection, { title: "Scorers", children: /* @__PURE__ */ jsx(AgentMetadataScorerList, { entityId: agent.name, entityType: "AGENT" }) }),
16254
16434
  /* @__PURE__ */ jsx(AgentMetadataSection, { title: "System Prompt", children: /* @__PURE__ */ jsx(PromptEnhancer, { agentId }) })
16255
16435
  ] });
@@ -16286,6 +16466,21 @@ const AgentMetadataScorerList = ({ entityId, entityType }) => {
16286
16466
  }
16287
16467
  return /* @__PURE__ */ jsx(AgentMetadataList, { children: scorerList.map((scorer) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: paths.scorerLink(scorer.id), "data-testid": "scorer-badge", children: /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(GaugeIcon, { className: "text-neutral3" }), children: scorer.scorer.config.name }) }) }, scorer.id)) });
16288
16468
  };
16469
+ const AgentMetadataCombinedProcessorList = ({
16470
+ inputProcessors,
16471
+ outputProcessors
16472
+ }) => {
16473
+ const { Link, paths } = useLinkComponent();
16474
+ if (inputProcessors.length === 0 && outputProcessors.length === 0) {
16475
+ return /* @__PURE__ */ jsx(AgentMetadataListEmpty, { children: "No processors" });
16476
+ }
16477
+ const inputProcessorId = inputProcessors[0]?.id;
16478
+ const outputProcessorId = outputProcessors[0]?.id;
16479
+ return /* @__PURE__ */ jsxs(AgentMetadataList, { children: [
16480
+ inputProcessors.length > 0 && inputProcessorId && /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: `${paths.workflowLink(inputProcessorId)}/graph`, "data-testid": "processor-badge", children: /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(ProcessorIcon, { className: "text-accent4" }), children: "input" }) }) }),
16481
+ outputProcessors.length > 0 && outputProcessorId && /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: `${paths.workflowLink(outputProcessorId)}/graph`, "data-testid": "processor-badge", children: /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(ProcessorIcon, { className: "text-accent5" }), children: "output" }) }) })
16482
+ ] });
16483
+ };
16289
16484
 
16290
16485
  const AgentEntityHeader = ({ agentId }) => {
16291
16486
  const { data: agent, isLoading } = useAgent(agentId);
@@ -17485,6 +17680,320 @@ const AgentLayout = ({ agentId, children, leftSlot, rightSlot }) => {
17485
17680
  ] });
17486
17681
  };
17487
17682
 
17683
+ const NameCell$2 = ({ row }) => {
17684
+ const { Link, paths } = useLinkComponent();
17685
+ const processor = row.original;
17686
+ return /* @__PURE__ */ jsx(
17687
+ EntryCell,
17688
+ {
17689
+ name: /* @__PURE__ */ jsx(Link, { className: "w-full space-y-0", href: paths.processorLink(processor.id), children: processor.name || processor.id }),
17690
+ description: processor.description
17691
+ }
17692
+ );
17693
+ };
17694
+ const PhasesCell = ({ row }) => {
17695
+ const processor = row.original;
17696
+ const phases = processor.phases || [];
17697
+ const phaseLabels = {
17698
+ input: "Input",
17699
+ inputStep: "Input Step",
17700
+ outputStream: "Output Stream",
17701
+ outputResult: "Output Result",
17702
+ outputStep: "Output Step"
17703
+ };
17704
+ return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: phases.map((phase) => /* @__PURE__ */ jsx(Badge, { variant: "default", children: phaseLabels[phase] || phase }, phase)) }) });
17705
+ };
17706
+ const AgentsCell = ({ row }) => {
17707
+ const processor = row.original;
17708
+ const agentsCount = processor.agentIds?.length || 0;
17709
+ return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsxs(Badge, { variant: "default", icon: /* @__PURE__ */ jsx(AgentIcon, { className: "text-accent1" }), children: [
17710
+ agentsCount,
17711
+ " agent",
17712
+ agentsCount !== 1 ? "s" : ""
17713
+ ] }) });
17714
+ };
17715
+ const columns$2 = [
17716
+ {
17717
+ header: "Name",
17718
+ accessorKey: "name",
17719
+ cell: NameCell$2
17720
+ },
17721
+ {
17722
+ header: "Phases",
17723
+ accessorKey: "phases",
17724
+ cell: PhasesCell
17725
+ },
17726
+ {
17727
+ header: "Used by",
17728
+ accessorKey: "agentIds",
17729
+ cell: AgentsCell
17730
+ }
17731
+ ];
17732
+
17733
+ function ProcessorTable({ processors, isLoading }) {
17734
+ const [search, setSearch] = useState("");
17735
+ const { navigate, paths } = useLinkComponent();
17736
+ const processorData = useMemo(() => {
17737
+ return Object.values(processors ?? {}).filter((p) => p.phases && p.phases.length > 0);
17738
+ }, [processors]);
17739
+ const table = useReactTable({
17740
+ data: processorData,
17741
+ columns: columns$2,
17742
+ getCoreRowModel: getCoreRowModel()
17743
+ });
17744
+ const ths = table.getHeaderGroups()[0];
17745
+ const rows = table.getRowModel().rows.concat();
17746
+ if (rows.length === 0 && !isLoading) {
17747
+ return /* @__PURE__ */ jsx(EmptyProcessorsTable, {});
17748
+ }
17749
+ const filteredRows = rows.filter((row) => {
17750
+ const id = row.original.id.toLowerCase();
17751
+ const name = (row.original.name || "").toLowerCase();
17752
+ const searchLower = search.toLowerCase();
17753
+ return id.includes(searchLower) || name.includes(searchLower);
17754
+ });
17755
+ return /* @__PURE__ */ jsxs("div", { children: [
17756
+ /* @__PURE__ */ jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsx(Searchbar, { onSearch: setSearch, label: "Search processors", placeholder: "Search processors" }) }),
17757
+ isLoading ? /* @__PURE__ */ jsx(ProcessorTableSkeleton, {}) : /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Table, { children: [
17758
+ /* @__PURE__ */ jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsx(Th, { style: { width: header.column.getSize() ?? "auto" }, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
17759
+ /* @__PURE__ */ jsx(Tbody, { children: filteredRows.map((row) => {
17760
+ return /* @__PURE__ */ jsx(
17761
+ Row,
17762
+ {
17763
+ onClick: () => {
17764
+ if (row.original.isWorkflow) {
17765
+ navigate(paths.workflowLink(row.original.id) + "/graph");
17766
+ } else {
17767
+ navigate(paths.processorLink(row.original.id));
17768
+ }
17769
+ },
17770
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
17771
+ },
17772
+ row.id
17773
+ );
17774
+ }) })
17775
+ ] }) }) })
17776
+ ] });
17777
+ }
17778
+ const ProcessorTableSkeleton = () => /* @__PURE__ */ jsxs(Table, { children: [
17779
+ /* @__PURE__ */ jsxs(Thead, { children: [
17780
+ /* @__PURE__ */ jsx(Th, { children: "Name" }),
17781
+ /* @__PURE__ */ jsx(Th, { children: "Phases" }),
17782
+ /* @__PURE__ */ jsx(Th, { children: "Used by" })
17783
+ ] }),
17784
+ /* @__PURE__ */ jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxs(Row, { children: [
17785
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
17786
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
17787
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) })
17788
+ ] }, index)) })
17789
+ ] });
17790
+ const EmptyProcessorsTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(
17791
+ EmptyState,
17792
+ {
17793
+ iconSlot: /* @__PURE__ */ jsx(Cpu, {}),
17794
+ titleSlot: "Configure Processors",
17795
+ descriptionSlot: "No processors are configured yet. Add input or output processors to your agents to transform messages.",
17796
+ actionSlot: /* @__PURE__ */ jsxs(
17797
+ Button,
17798
+ {
17799
+ size: "lg",
17800
+ className: "w-full",
17801
+ variant: "light",
17802
+ as: "a",
17803
+ href: "https://mastra.ai/en/docs/processors",
17804
+ target: "_blank",
17805
+ children: [
17806
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Cpu, {}) }),
17807
+ "Docs"
17808
+ ]
17809
+ }
17810
+ )
17811
+ }
17812
+ ) });
17813
+
17814
+ const useProcessors = () => {
17815
+ const { requestContext } = usePlaygroundStore();
17816
+ const client = useMastraClient();
17817
+ return useQuery({
17818
+ queryKey: ["processors"],
17819
+ queryFn: () => client.listProcessors(requestContext)
17820
+ });
17821
+ };
17822
+ const useProcessor = (processorId, options) => {
17823
+ const client = useMastraClient();
17824
+ const { requestContext } = usePlaygroundStore();
17825
+ return useQuery({
17826
+ queryKey: ["processor", processorId],
17827
+ queryFn: () => client.getProcessor(processorId).details(requestContext),
17828
+ enabled: options?.enabled !== false && !!processorId
17829
+ });
17830
+ };
17831
+ const useExecuteProcessor = () => {
17832
+ const client = useMastraClient();
17833
+ const { requestContext } = usePlaygroundStore();
17834
+ return useMutation({
17835
+ mutationFn: async ({
17836
+ processorId,
17837
+ phase,
17838
+ messages,
17839
+ agentId
17840
+ }) => {
17841
+ return client.getProcessor(processorId).execute({
17842
+ phase,
17843
+ messages,
17844
+ agentId,
17845
+ requestContext
17846
+ });
17847
+ }
17848
+ });
17849
+ };
17850
+
17851
+ const PHASE_LABELS = {
17852
+ input: "Input - Process input messages before LLM (once at start)",
17853
+ inputStep: "Input Step - Process at each agentic loop step",
17854
+ outputStream: "Output Stream - Process streaming chunks",
17855
+ outputResult: "Output Result - Process complete output after streaming",
17856
+ outputStep: "Output Step - Process after each LLM response (before tools)"
17857
+ };
17858
+ function ProcessorPanel({ processorId }) {
17859
+ const { data: processor, isLoading, error } = useProcessor(processorId);
17860
+ useEffect(() => {
17861
+ if (error) {
17862
+ const errorMessage = error instanceof Error ? error.message : "Failed to load processor";
17863
+ toast.error(`Error loading processor: ${errorMessage}`);
17864
+ }
17865
+ }, [error]);
17866
+ if (isLoading) {
17867
+ return /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
17868
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48 mb-4" }),
17869
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" })
17870
+ ] });
17871
+ }
17872
+ if (error) return null;
17873
+ if (!processor)
17874
+ return /* @__PURE__ */ jsx("div", { className: "py-12 text-center px-6", children: /* @__PURE__ */ jsx(Txt, { variant: "header-md", className: "text-neutral3", children: "Processor not found" }) });
17875
+ return /* @__PURE__ */ jsx(ProcessorDetailPanel, { processor });
17876
+ }
17877
+ function ProcessorDetailPanel({ processor }) {
17878
+ const theme = useCodemirrorTheme$1();
17879
+ const formId = useId();
17880
+ const [selectedPhase, setSelectedPhase] = useState(processor.phases[0] || "input");
17881
+ const [selectedAgentId, setSelectedAgentId] = useState(processor.configurations[0]?.agentId || "");
17882
+ const [testMessage, setTestMessage] = useState("Hello, this is a test message.");
17883
+ const [result, setResult] = useState(null);
17884
+ const [errorString, setErrorString] = useState();
17885
+ const executeProcessor = useExecuteProcessor();
17886
+ const handleExecute = async () => {
17887
+ setErrorString(void 0);
17888
+ setResult(null);
17889
+ const isOutputPhase = selectedPhase === "outputStep" || selectedPhase === "outputResult";
17890
+ const messageRole = isOutputPhase ? "assistant" : "user";
17891
+ const messages = [
17892
+ {
17893
+ id: crypto.randomUUID(),
17894
+ role: messageRole,
17895
+ createdAt: /* @__PURE__ */ new Date(),
17896
+ content: {
17897
+ format: 2,
17898
+ parts: [{ type: "text", text: testMessage }]
17899
+ }
17900
+ }
17901
+ ];
17902
+ try {
17903
+ const response = await executeProcessor.mutateAsync({
17904
+ processorId: processor.id,
17905
+ phase: selectedPhase,
17906
+ messages,
17907
+ agentId: selectedAgentId || void 0
17908
+ });
17909
+ setResult(response);
17910
+ if (!response.success && response.error) {
17911
+ setErrorString(response.error);
17912
+ }
17913
+ } catch (error) {
17914
+ setErrorString(error.message || "An error occurred");
17915
+ }
17916
+ };
17917
+ const resultCode = result ? JSON.stringify(result, null, 2) : "{}";
17918
+ return /* @__PURE__ */ jsxs(MainContentContent, { hasLeftServiceColumn: true, className: "relative", children: [
17919
+ /* @__PURE__ */ jsxs("div", { className: "bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto", children: [
17920
+ /* @__PURE__ */ jsx(ProcessorInformation, { processor }),
17921
+ /* @__PURE__ */ jsxs("div", { className: "p-5 space-y-5", children: [
17922
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
17923
+ /* @__PURE__ */ jsx(Txt, { as: "label", variant: "ui-sm", className: "text-icon3", children: "Phase" }),
17924
+ /* @__PURE__ */ jsxs(Select, { value: selectedPhase, onValueChange: (v) => setSelectedPhase(v), children: [
17925
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select phase" }) }),
17926
+ /* @__PURE__ */ jsx(SelectContent, { children: processor.phases.map((phase) => /* @__PURE__ */ jsx(SelectItem, { value: phase, children: phase }, phase)) })
17927
+ ] }),
17928
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-xs", className: "text-icon4", children: PHASE_LABELS[selectedPhase] })
17929
+ ] }),
17930
+ processor.configurations.length > 1 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
17931
+ /* @__PURE__ */ jsx(Txt, { as: "label", variant: "ui-sm", className: "text-icon3", children: "Agent Configuration" }),
17932
+ /* @__PURE__ */ jsxs(Select, { value: selectedAgentId, onValueChange: setSelectedAgentId, children: [
17933
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select agent" }) }),
17934
+ /* @__PURE__ */ jsx(SelectContent, { children: processor.configurations.map((config) => /* @__PURE__ */ jsxs(SelectItem, { value: config.agentId, children: [
17935
+ config.agentName,
17936
+ " (",
17937
+ config.type,
17938
+ ")"
17939
+ ] }, config.agentId)) })
17940
+ ] })
17941
+ ] }),
17942
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
17943
+ /* @__PURE__ */ jsx(Txt, { as: "label", htmlFor: formId, variant: "ui-sm", className: "text-icon3", children: "Test Message" }),
17944
+ /* @__PURE__ */ jsx(
17945
+ "textarea",
17946
+ {
17947
+ id: formId,
17948
+ value: testMessage,
17949
+ onChange: (e) => setTestMessage(e.target.value),
17950
+ placeholder: "Enter a test message...",
17951
+ rows: 4,
17952
+ className: "w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-none focus:ring-2 focus:ring-accent1"
17953
+ }
17954
+ )
17955
+ ] }),
17956
+ /* @__PURE__ */ jsx(
17957
+ Button,
17958
+ {
17959
+ onClick: handleExecute,
17960
+ disabled: executeProcessor.isPending || selectedPhase === "outputStream",
17961
+ className: "w-full",
17962
+ children: executeProcessor.isPending ? "Running..." : "Run Processor"
17963
+ }
17964
+ ),
17965
+ selectedPhase === "outputStream" && /* @__PURE__ */ jsx(Txt, { variant: "ui-xs", className: "text-accent6", children: "Output Stream phase cannot be executed directly. Use streaming instead." }),
17966
+ result && /* @__PURE__ */ jsxs("div", { className: "space-y-2 pt-4 border-t border-border1", children: [
17967
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Status" }),
17968
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
17969
+ /* @__PURE__ */ jsx(Badge, { variant: result.success ? "success" : "error", children: result.success ? "Success" : "Failed" }),
17970
+ result.tripwire?.triggered && /* @__PURE__ */ jsx(Badge, { variant: "info", children: "Tripwire Triggered" })
17971
+ ] }),
17972
+ result.tripwire?.triggered && result.tripwire.reason && /* @__PURE__ */ jsxs("div", { className: "mt-2 p-3 bg-accent6Dark rounded-md border border-accent6/20", children: [
17973
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-accent6 font-medium", children: "Tripwire Reason" }),
17974
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3 mt-1", children: result.tripwire.reason })
17975
+ ] })
17976
+ ] })
17977
+ ] })
17978
+ ] }),
17979
+ /* @__PURE__ */ jsx("div", { className: "absolute top-4 right-4 z-10", children: /* @__PURE__ */ jsx(CopyButton, { content: resultCode, tooltip: "Copy JSON result to clipboard" }) }),
17980
+ /* @__PURE__ */ jsx("div", { className: "p-5 h-full relative overflow-x-auto overflow-y-auto", children: /* @__PURE__ */ jsx(CodeMirror, { value: errorString || resultCode, editable: true, theme, extensions: [jsonLanguage] }) })
17981
+ ] });
17982
+ }
17983
+ function ProcessorInformation({ processor }) {
17984
+ return /* @__PURE__ */ jsxs("div", { className: "px-5 pt-5 pb-4 border-b border-border1", children: [
17985
+ /* @__PURE__ */ jsx(Txt, { variant: "header-md", className: "text-icon1 mb-2", children: processor.name || processor.id }),
17986
+ processor.name && processor.name !== processor.id && /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon4 mb-3", children: processor.id }),
17987
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-3", children: processor.phases.map((phase) => /* @__PURE__ */ jsx(Badge, { variant: "default", children: phase }, phase)) }),
17988
+ /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxs(Txt, { variant: "ui-xs", className: "text-icon4", children: [
17989
+ "Attached to ",
17990
+ processor.configurations.length,
17991
+ " agent",
17992
+ processor.configurations.length !== 1 ? "s" : ""
17993
+ ] }) })
17994
+ ] });
17995
+ }
17996
+
17488
17997
  const NameCell$1 = ({ row }) => {
17489
17998
  const { Link, paths } = useLinkComponent();
17490
17999
  const tool = row.original;
@@ -19433,9 +19942,9 @@ function SpanTabs({
19433
19942
  }) {
19434
19943
  const { Link } = useLinkComponent();
19435
19944
  let entityType;
19436
- if (span?.attributes?.agentId) {
19945
+ if (span?.attributes?.agentId || span?.entityType === EntityType.AGENT) {
19437
19946
  entityType = "Agent";
19438
- } else if (span?.attributes?.workflowId) {
19947
+ } else if (span?.attributes?.workflowId || span?.entityType === EntityType.WORKFLOW_RUN) {
19439
19948
  entityType = "Workflow";
19440
19949
  }
19441
19950
  return /* @__PURE__ */ jsxs(Tabs, { defaultTab: defaultActiveTab, children: [
@@ -21589,5 +22098,5 @@ const useMastraPlatform = () => {
21589
22098
  return { isMastraPlatform, mastraPlatformEndpoint };
21590
22099
  };
21591
22100
 
21592
- export { AgentChat, AgentCoinIcon, AgentCombobox, AgentEntityHeader, AgentIcon, AgentInformation, AgentInformationLayout, AgentInformationTabLayout, AgentLayout, AgentMemory, AgentMetadata, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPromptExperimentProvider, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentsTable, AiIcon, Alert, AlertDescription, AlertDialog, AlertTitle, ApiIcon, AutoForm, Avatar, Badge, BranchIcon, Breadcrumb, Button, ButtonsGroup, Cell, ChatThreads, CheckIcon, Checkbox, ChevronIcon, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, CombinedButtons, Combobox, CommitIcon, CopyButton, CrossIcon, Crumb, DatePicker, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeploymentIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DividerIcon, DocsIcon, DynamicForm, ElementSelect, EmptyState, Entity, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, Input, InputField, JudgeIcon, Kbd, KeyValueList, Label, LatencyIcon, LinkComponentProvider, LogoWithoutText, LogsIcon, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainSidebar, MainSidebarProvider, MarkdownRenderer, MastraPackagesInfo, MastraVersionFooter, McpCoinIcon, McpServerIcon, MemoryIcon, MemorySearch, Notification, OpenAIIcon, PageHeader, PlaygroundConfigGuard, PlaygroundQueryClient, Popover, PopoverContent, PopoverTrigger, ProcessStepList, ProcessStepListItem, ProcessStepProgressBar, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, RequestContext, RequestContextWrapper, Row, ScoreDialog, ScorerCombobox, ScorersTable, ScoresList, ScoresTools, ScrollArea, ScrollBar, SearchField, Searchbar, SearchbarWrapper, Section, Sections, Select, SelectContent, SelectField$1 as SelectField, SelectGroup, SelectItem, SelectTrigger, SelectValue, SettingsIcon, ShadcnAutoFormFieldComponents, SideDialog, Skeleton, SlashIcon, Slider, SpanScoreList, SpanScoring, SpanTabs, Spinner, StudioConfigContext, StudioConfigForm, StudioConfigProvider, Switch, Tab, TabContent, TabList, Table, Tabs, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, TimePicker, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolPanel, ToolTable, ToolsIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineSpan, TraceTimelineTools, TracesList, TracesTools, TracingSettingsContext, TracingSettingsProvider, TsIcon, Txt, TxtCell, VariablesIcon, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowLayout, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowStepDetailContext, WorkflowStepDetailProvider, WorkflowTable, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, buttonVariants, cn, convertWorkflowRunStateToStreamResult, extractPrompt, fieldConfig, formatHierarchicalSpans, getColumnTemplate, getMainContentContentClassName, getShortId, getSpanTypeUi, getStatusIcon, getToNextEntryFn, getToPreviousEntryFn, highlight, inputVariants, parseError, providerMapToIcon, removeEmptyValues, resolveSerializedZodOutput, scoresListColumns, spanTypePrefixes, toast, traceScoresListColumns, tracesListColumns, useAgent, useAgentInformationSettings, useAgentInformationTab, useAgentPromptExperiment, useAgentSettings, useAgents, useCancelWorkflowRun, useCloneThread, useCodemirrorTheme$1 as useCodemirrorTheme, useCurrentRun, useDeleteThread, useDeleteWorkflowRun, useExecuteAgentTool, useExecuteMCPTool, useExecuteTool, useExecuteWorkflow, useInView, useLinkComponent, useMCPServerTool, useMCPServerTools, useMCPServers, useMainSidebar, useMastraPackages, useMastraPlatform, useMemory, useMemoryConfig, useMemorySearch, usePackageUpdates, usePlaygroundStore, useReorderModelList, useResetAgentModel, useScorer, useScorers, useScoresByScorerId, useSpeechRecognition, useStreamWorkflow, useStudioConfig, useThreadInput, useThreads, useTool, useTools, useTraceSpanScores, useTracingSettings, useUpdateAgentModel, useUpdateModelInModelList, useWorkflow, useWorkflowRun, useWorkflowRuns, useWorkflowStepDetail, useWorkflows, useWorkingMemory };
22101
+ export { AgentChat, AgentCoinIcon, AgentCombobox, AgentEntityHeader, AgentIcon, AgentInformation, AgentInformationLayout, AgentInformationTabLayout, AgentLayout, AgentMemory, AgentMetadata, AgentMetadataCombinedProcessorList, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPromptExperimentProvider, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentsTable, AiIcon, Alert, AlertDescription, AlertDialog, AlertTitle, ApiIcon, AutoForm, Avatar, Badge, BranchIcon, Breadcrumb, Button, ButtonsGroup, Cell, ChatThreads, CheckIcon, Checkbox, ChevronIcon, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, CombinedButtons, Combobox, CommitIcon, CopyButton, CrossIcon, Crumb, DatePicker, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeploymentIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DividerIcon, DocsIcon, DynamicForm, ElementSelect, EmptyState, Entity, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, Input, InputField, JudgeIcon, Kbd, KeyValueList, Label, LatencyIcon, LinkComponentProvider, LogoWithoutText, LogsIcon, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainSidebar, MainSidebarProvider, MarkdownRenderer, MastraPackagesInfo, MastraVersionFooter, McpCoinIcon, McpServerIcon, MemoryIcon, MemorySearch, Notification, OpenAIIcon, PageHeader, PlaygroundConfigGuard, PlaygroundQueryClient, Popover, PopoverContent, PopoverTrigger, ProcessStepList, ProcessStepListItem, ProcessStepProgressBar, ProcessorIcon, ProcessorPanel, ProcessorTable, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, RequestContext, RequestContextWrapper, Row, ScoreDialog, ScorerCombobox, ScorersTable, ScoresList, ScoresTools, ScrollArea, ScrollBar, SearchField, Searchbar, SearchbarWrapper, Section, Sections, Select, SelectContent, SelectField$1 as SelectField, SelectGroup, SelectItem, SelectTrigger, SelectValue, SettingsIcon, ShadcnAutoFormFieldComponents, SideDialog, Skeleton, SlashIcon, Slider, SpanScoreList, SpanScoring, SpanTabs, Spinner, StudioConfigContext, StudioConfigForm, StudioConfigProvider, Switch, Tab, TabContent, TabList, Table, Tabs, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, TimePicker, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolPanel, ToolTable, ToolsIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineSpan, TraceTimelineTools, TracesList, TracesTools, TracingSettingsContext, TracingSettingsProvider, TsIcon, Txt, TxtCell, VariablesIcon, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowLayout, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowStepDetailContext, WorkflowStepDetailProvider, WorkflowTable, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, buttonVariants, cn, columns$2 as columns, convertWorkflowRunStateToStreamResult, extractPrompt, fieldConfig, formatHierarchicalSpans, getColumnTemplate, getMainContentContentClassName, getShortId, getSpanTypeUi, getStatusIcon, getToNextEntryFn, getToPreviousEntryFn, highlight, inputVariants, parseError, providerMapToIcon, removeEmptyValues, resolveSerializedZodOutput, scoresListColumns, spanTypePrefixes, toast, traceScoresListColumns, tracesListColumns, useAgent, useAgentInformationSettings, useAgentInformationTab, useAgentPromptExperiment, useAgentSettings, useAgents, useCancelWorkflowRun, useCloneThread, useCodemirrorTheme$1 as useCodemirrorTheme, useCurrentRun, useDeleteThread, useDeleteWorkflowRun, useExecuteAgentTool, useExecuteMCPTool, useExecuteProcessor, useExecuteTool, useExecuteWorkflow, useInView, useLinkComponent, useMCPServerTool, useMCPServerTools, useMCPServers, useMainSidebar, useMastraPackages, useMastraPlatform, useMemory, useMemoryConfig, useMemorySearch, usePackageUpdates, usePlaygroundStore, useProcessor, useProcessors, useReorderModelList, useResetAgentModel, useScorer, useScorers, useScoresByScorerId, useSpeechRecognition, useStreamWorkflow, useStudioConfig, useThreadInput, useThreads, useTool, useTools, useTraceSpanScores, useTracingSettings, useUpdateAgentModel, useUpdateModelInModelList, useWorkflow, useWorkflowRun, useWorkflowRuns, useWorkflowStepDetail, useWorkflows, useWorkingMemory };
21593
22102
  //# sourceMappingURL=index.es.js.map