@mastra/playground-ui 7.0.0-beta.0 → 7.0.0-beta.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/index.cjs.js +357 -606
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +361 -600
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/components/syntax-highlighter.d.ts +2 -1
  7. package/dist/src/components/ui/elements/form-fields/index.d.ts +0 -4
  8. package/dist/src/components/ui/elements/headers/index.d.ts +0 -1
  9. package/dist/src/components/ui/elements/main-sidebar/main-sidebar.d.ts +1 -1
  10. package/dist/src/components/ui/input.d.ts +1 -1
  11. package/dist/src/components/ui/syntax-highlighter.d.ts +1 -1
  12. package/dist/src/components/ui/textarea.d.ts +1 -1
  13. package/dist/src/domains/agents/context/index.d.ts +0 -1
  14. package/dist/src/domains/agents/context/model-reset-context.d.ts +0 -4
  15. package/dist/src/domains/scores/hooks/use-scorers.d.ts +2 -6
  16. package/dist/src/domains/scores/index.d.ts +1 -1
  17. package/dist/src/domains/tools/components/ToolExecutor.d.ts +1 -1
  18. package/dist/src/domains/workflows/context/use-current-run.d.ts +2 -0
  19. package/dist/src/domains/workflows/workflow/workflow-default-node.d.ts +4 -0
  20. package/dist/src/domains/workflows/workflow/workflow-nested-node.d.ts +4 -0
  21. package/dist/src/domains/workflows/workflow/workflow-node-badges.d.ts +55 -0
  22. package/dist/src/domains/workflows/workflow/workflow-step-action-bar.d.ts +3 -1
  23. package/dist/src/ds/components/Table/Cells.d.ts +0 -3
  24. package/dist/src/index.d.ts +1 -2
  25. package/package.json +12 -10
  26. package/dist/src/components/assistant-ui/thread-list.d.ts +0 -2
  27. package/dist/src/components/assistant-ui/tools/tool-approval.d.ts +0 -8
  28. package/dist/src/components/icons/agent-icon.d.ts +0 -3
  29. package/dist/src/components/icons/automation-icon.d.ts +0 -3
  30. package/dist/src/components/ui/copyable-content.d.ts +0 -7
  31. package/dist/src/components/ui/dropdown-menu.d.ts +0 -42
  32. package/dist/src/components/ui/elements/entry-list/entry-list-toolbar.d.ts +0 -6
  33. package/dist/src/components/ui/elements/form-fields/form-actions.d.ts +0 -12
  34. package/dist/src/components/ui/elements/form-fields/radio-group-field.d.ts +0 -21
  35. package/dist/src/components/ui/elements/form-fields/slider-field.d.ts +0 -15
  36. package/dist/src/components/ui/elements/form-fields/textarea-field.d.ts +0 -11
  37. package/dist/src/components/ui/elements/headers/entity-main-header.d.ts +0 -11
  38. package/dist/src/components/ui/elements/side-dialog/side-dialog-footer.d.ts +0 -10
  39. package/dist/src/components/ui/formatted-date.d.ts +0 -3
  40. package/dist/src/components/ui/resizable.d.ts +0 -23
  41. package/dist/src/components/ui/score-indicator.d.ts +0 -3
  42. package/dist/src/components/ui/toggle.d.ts +0 -12
  43. package/dist/src/domains/agents/components/agent-metadata/connection-dot.d.ts +0 -6
  44. package/dist/src/domains/agents/components/agent-metadata/models.d.ts +0 -5
  45. package/dist/src/domains/agents/components/agent-metadata/provider-status-indicator.d.ts +0 -7
  46. package/dist/src/domains/resizable-panel.d.ts +0 -11
  47. package/dist/src/domains/scores/components/score-table.d.ts +0 -11
  48. package/dist/src/domains/tools/components/tool-table/types.d.ts +0 -2
  49. package/dist/src/domains/workflows/workflow/workflow-result.d.ts +0 -5
  50. package/dist/src/hooks/use-resize-column.d.ts +0 -12
  51. package/dist/src/lib/mastra-client.d.ts +0 -2
  52. package/dist/src/lib/pagination/types.d.ts +0 -11
  53. package/dist/src/lib/polls.d.ts +0 -36
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useMessagePart, 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, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, ChevronUpIcon, X, Share2, Check, Network, ChevronDown, PauseIcon, HourglassIcon, Loader2, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Plus, Maximize, Workflow, AlertCircleIcon, ChevronDownIcon, CirclePause, CalendarIcon, Braces, Brackets, PlusIcon, TrashIcon, Circle, StopCircle, SearchIcon, ChevronsUpDown, Search, BrainIcon, AudioLinesIcon, StopCircleIcon, FileText, CircleXIcon, Link, CloudUpload, Mic, ArrowUp, SaveIcon, RefreshCw, ExternalLink, TriangleAlertIcon, ChevronRightIcon, ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, CircleAlertIcon, XIcon, PanelRightIcon, GaugeIcon, EyeIcon, ChevronsLeftRightEllipsisIcon, CalculatorIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, Info, RotateCcw, GripVertical, RefreshCcwIcon, AlertTriangleIcon, ChevronRight, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, ChevronsLeftRight, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, ArrowRightToLineIcon, CoinsIcon, BracesIcon, CircleGaugeIcon, PanelTopIcon, ListTreeIcon, PanelLeftIcon, CircleSlash, Clock as Clock$1 } from 'lucide-react';
3
+ import { CheckIcon as CheckIcon$1, CopyIcon, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, ChevronUpIcon, X, Share2, Check, PlayCircle, Workflow, Layers, List, Clock as Clock$1, CalendarClock, Timer, CornerDownRight, GitBranch, RefreshCw, Repeat, Repeat1, Network, ChevronDown, PauseIcon, HourglassIcon, Loader2, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Plus, Maximize, AlertCircleIcon, ChevronDownIcon, CirclePause, CalendarIcon, Braces, Brackets, PlusIcon, TrashIcon, Circle, StopCircle, SearchIcon, ChevronsUpDown, Search, BrainIcon, AudioLinesIcon, StopCircleIcon, FileText, CircleXIcon, Link, CloudUpload, Mic, ArrowUp, SaveIcon, ExternalLink, TriangleAlertIcon, ChevronRightIcon, ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, CircleAlertIcon, XIcon, PanelRightIcon, KeyboardIcon, GaugeIcon, EyeIcon, ChevronsLeftRightEllipsisIcon, CalculatorIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, Info, RotateCcw, GripVertical, RefreshCcwIcon, AlertTriangleIcon, ChevronRight, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, ChevronsLeftRight, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, ArrowRightToLineIcon, CoinsIcon, BracesIcon, CircleGaugeIcon, PanelTopIcon, ListTreeIcon, PanelLeftIcon, CircleSlash } 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, Suspense } from 'react';
6
6
  import { Slot } from '@radix-ui/react-slot';
@@ -15,7 +15,7 @@ import { coldarkDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
15
15
  import { jsonLanguage, json } from '@codemirror/lang-json';
16
16
  import { tags } from '@lezer/highlight';
17
17
  import { draculaInit } from '@uiw/codemirror-theme-dracula';
18
- import CodeMirror, { EditorView } from '@uiw/react-codemirror';
18
+ import CodeMirror, { EditorView as EditorView$1 } from '@uiw/react-codemirror';
19
19
  import { toast as toast$1 } from 'sonner';
20
20
  import './index.css';export { Toaster } from 'sonner';
21
21
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -25,6 +25,7 @@ import Dagre from '@dagrejs/dagre';
25
25
  import { Highlight, themes } from 'prism-react-renderer';
26
26
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
27
27
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
28
+ import { EditorView } from '@codemirror/view';
28
29
  import * as SliderPrimitive from '@radix-ui/react-slider';
29
30
  import jsonSchemaToZod from 'json-schema-to-zod';
30
31
  import { parse } from 'superjson';
@@ -4647,6 +4648,8 @@ function convertWorkflowRunStateToStreamResult(runState) {
4647
4648
  status: result.status,
4648
4649
  output: "output" in result ? result.output : void 0,
4649
4650
  payload: "payload" in result ? result.payload : void 0,
4651
+ suspendPayload: "suspendPayload" in result ? result.suspendPayload : void 0,
4652
+ suspendOutput: "suspendOutput" in result ? result.suspendOutput : void 0,
4650
4653
  resumePayload: "resumePayload" in result ? result.resumePayload : void 0,
4651
4654
  error: "error" in result ? result.error : void 0,
4652
4655
  startedAt: "startedAt" in result ? result.startedAt : Date.now(),
@@ -4725,6 +4728,26 @@ const lodashTitleCase = (str) => {
4725
4728
  return camelCased.replace(/([A-Z])/g, " $1").replace(/^./, (str2) => str2.toUpperCase()).trim();
4726
4729
  };
4727
4730
 
4731
+ const formatMappingLabel = (stepId, prevStepIds, nextStepIds) => {
4732
+ if (!stepId.startsWith("mapping_")) {
4733
+ return stepId;
4734
+ }
4735
+ const capitalizeWords = (str) => {
4736
+ return str.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
4737
+ };
4738
+ const formatStepName = (id) => {
4739
+ const cleaned = id.replace(/Step$/, "").replace(/[-_]/g, " ").trim();
4740
+ return capitalizeWords(cleaned);
4741
+ };
4742
+ const formatMultipleSteps = (ids, isTarget) => {
4743
+ if (ids.length === 0) return isTarget ? "End" : "Start";
4744
+ if (ids.length === 1) return formatStepName(ids[0]);
4745
+ return `${ids.length} Steps`;
4746
+ };
4747
+ const fromLabel = formatMultipleSteps(prevStepIds, false);
4748
+ const toLabel = formatMultipleSteps(nextStepIds, true);
4749
+ return `${fromLabel} → ${toLabel} Map`;
4750
+ };
4728
4751
  const getLayoutedElements = (nodes, edges) => {
4729
4752
  const g = new Dagre.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
4730
4753
  g.setGraph({ rankdir: "TB" });
@@ -4821,12 +4844,15 @@ const getStepNodeAndEdge = ({
4821
4844
  position: { x: xIndex * 300, y: (yIndex + (condition ? 1 : 0)) * 100 },
4822
4845
  type: hasGraph ? "nested-node" : "default-node",
4823
4846
  data: {
4824
- label: stepFlow.step.id,
4847
+ label: formatMappingLabel(stepFlow.step.id, prevStepIds, nextStepIds),
4848
+ stepId: stepFlow.step.id,
4825
4849
  description: stepFlow.step.description,
4826
4850
  withoutTopHandle: condition ? false : !prevNodeIds.length,
4827
4851
  withoutBottomHandle: !nextNodeIds.length,
4828
4852
  stepGraph: hasGraph ? stepFlow.step.serializedStepFlow : void 0,
4829
- mapConfig: stepFlow.step.mapConfig
4853
+ mapConfig: stepFlow.step.mapConfig,
4854
+ canSuspend: stepFlow.step.canSuspend,
4855
+ isForEach: stepFlow.type === "foreach"
4830
4856
  }
4831
4857
  }
4832
4858
  ];
@@ -4944,7 +4970,8 @@ const getStepNodeAndEdge = ({
4944
4970
  description: _step.description,
4945
4971
  withoutTopHandle: !prevNodeIds.length,
4946
4972
  withoutBottomHandle: false,
4947
- stepGraph: hasGraph ? _step.serializedStepFlow : void 0
4973
+ stepGraph: hasGraph ? _step.serializedStepFlow : void 0,
4974
+ canSuspend: _step.canSuspend
4948
4975
  }
4949
4976
  },
4950
4977
  {
@@ -5006,7 +5033,14 @@ const getStepNodeAndEdge = ({
5006
5033
  nextStepFlow,
5007
5034
  allPrevNodeIds
5008
5035
  });
5009
- nodes.push(..._nodes);
5036
+ const markedNodes = _nodes.map((node) => ({
5037
+ ...node,
5038
+ data: {
5039
+ ...node.data,
5040
+ isParallel: true
5041
+ }
5042
+ }));
5043
+ nodes.push(...markedNodes);
5010
5044
  edges.push(..._edges);
5011
5045
  nextPrevStepIds.push(..._nextPrevStepIds);
5012
5046
  });
@@ -5122,6 +5156,90 @@ const CollapsibleTrigger = (props) => {
5122
5156
  };
5123
5157
  const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
5124
5158
 
5159
+ const BADGE_COLORS = {
5160
+ sleep: "#A855F7",
5161
+ // Purple
5162
+ forEach: "#F97316",
5163
+ // Orange
5164
+ map: "#F97316",
5165
+ // Orange
5166
+ parallel: "#3B82F6",
5167
+ // Blue
5168
+ suspend: "#EC4899",
5169
+ // Pink
5170
+ after: "#14B8A6",
5171
+ // Teal
5172
+ workflow: "#8B5CF6",
5173
+ // Purple
5174
+ // Condition colors
5175
+ when: "#ECB047",
5176
+ // Orange
5177
+ dountil: "#8B5CF6",
5178
+ // Purple
5179
+ dowhile: "#06B6D4",
5180
+ // Cyan
5181
+ until: "#F59E0B",
5182
+ // Amber
5183
+ while: "#10B981",
5184
+ // Green
5185
+ if: "#3B82F6",
5186
+ // Blue
5187
+ else: "#6B7280"
5188
+ // Gray
5189
+ };
5190
+ const BADGE_ICONS = {
5191
+ sleep: Timer,
5192
+ sleepUntil: CalendarClock,
5193
+ forEach: List,
5194
+ map: List,
5195
+ parallel: Workflow,
5196
+ suspend: PlayCircle,
5197
+ after: Clock$1,
5198
+ workflow: Layers,
5199
+ // Condition icons
5200
+ when: Network,
5201
+ dountil: Repeat1,
5202
+ dowhile: Repeat,
5203
+ until: Timer,
5204
+ while: RefreshCw,
5205
+ if: GitBranch,
5206
+ else: CornerDownRight
5207
+ };
5208
+ const getConditionIconAndColor = (type) => {
5209
+ switch (type) {
5210
+ case "when":
5211
+ return { icon: BADGE_ICONS.when, color: BADGE_COLORS.when };
5212
+ case "dountil":
5213
+ return { icon: BADGE_ICONS.dountil, color: BADGE_COLORS.dountil };
5214
+ case "dowhile":
5215
+ return { icon: BADGE_ICONS.dowhile, color: BADGE_COLORS.dowhile };
5216
+ case "until":
5217
+ return { icon: BADGE_ICONS.until, color: BADGE_COLORS.until };
5218
+ case "while":
5219
+ return { icon: BADGE_ICONS.while, color: BADGE_COLORS.while };
5220
+ case "if":
5221
+ return { icon: BADGE_ICONS.if, color: BADGE_COLORS.if };
5222
+ case "else":
5223
+ return { icon: BADGE_ICONS.else, color: BADGE_COLORS.else };
5224
+ default:
5225
+ return { icon: void 0, color: void 0 };
5226
+ }
5227
+ };
5228
+ const getNodeBadgeInfo = (data) => {
5229
+ const isSleepNode = Boolean(data.duration || data.date);
5230
+ const isForEachNode = Boolean(data.isForEach);
5231
+ const isMapNode = Boolean(data.mapConfig && !data.isForEach);
5232
+ const isNestedWorkflow = Boolean(data.stepGraph);
5233
+ const hasSpecialBadge = isSleepNode || data.canSuspend || data.isParallel || isForEachNode || isMapNode || isNestedWorkflow;
5234
+ return {
5235
+ isSleepNode,
5236
+ isForEachNode,
5237
+ isMapNode,
5238
+ isNestedWorkflow,
5239
+ hasSpecialBadge
5240
+ };
5241
+ };
5242
+
5125
5243
  const useAutoscroll = (ref, { enabled = true }) => {
5126
5244
  const shouldScrollRef = useRef(enabled);
5127
5245
  React__default.useEffect(() => {
@@ -5210,7 +5328,9 @@ const useCurrentRun = () => {
5210
5328
  status: value.status,
5211
5329
  output: "output" in value ? value.output : void 0,
5212
5330
  input: value.payload,
5213
- resumeData: "resumePayload" in value ? value.resumePayload : void 0
5331
+ resumeData: "resumePayload" in value ? value.resumePayload : void 0,
5332
+ suspendOutput: "suspendOutput" in value ? value.suspendOutput : void 0,
5333
+ suspendPayload: "suspendPayload" in value ? value.suspendPayload : void 0
5214
5334
  }
5215
5335
  };
5216
5336
  }, {});
@@ -5218,8 +5338,8 @@ const useCurrentRun = () => {
5218
5338
  };
5219
5339
 
5220
5340
  const useCodemirrorTheme$1 = () => {
5221
- return useMemo(
5222
- () => draculaInit({
5341
+ return useMemo(() => {
5342
+ const baseTheme = draculaInit({
5223
5343
  settings: {
5224
5344
  fontFamily: "var(--geist-mono)",
5225
5345
  fontSize: "0.8rem",
@@ -5229,9 +5349,20 @@ const useCodemirrorTheme$1 = () => {
5229
5349
  background: "transparent"
5230
5350
  },
5231
5351
  styles: [{ tag: [tags.className, tags.propertyName] }]
5232
- }),
5233
- []
5234
- );
5352
+ });
5353
+ const customLineNumberTheme = EditorView.theme({
5354
+ ".cm-editor": {
5355
+ colorScheme: "dark",
5356
+ // ensures color scheme
5357
+ backgroundColor: "transparent"
5358
+ },
5359
+ ".cm-lineNumbers .cm-gutterElement": {
5360
+ color: "#939393"
5361
+ // ← custom line number color
5362
+ }
5363
+ });
5364
+ return [baseTheme, customLineNumberTheme];
5365
+ }, []);
5235
5366
  };
5236
5367
  const SyntaxHighlighter$1 = ({ data }) => {
5237
5368
  const formattedCode = JSON.stringify(data, null, 2);
@@ -5265,9 +5396,11 @@ const WorkflowStepActionBar = ({
5265
5396
  input,
5266
5397
  output,
5267
5398
  resumeData,
5399
+ suspendOutput,
5268
5400
  error,
5269
5401
  mapConfig,
5270
5402
  stepName,
5403
+ stepId,
5271
5404
  onShowNestedGraph,
5272
5405
  status
5273
5406
  }) => {
@@ -5294,10 +5427,13 @@ const WorkflowStepActionBar = ({
5294
5427
  mapConfig && /* @__PURE__ */ jsxs(Fragment, { children: [
5295
5428
  /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsMapConfigOpen(true), children: "Map config" }),
5296
5429
  /* @__PURE__ */ jsx(Dialog, { open: isMapConfigOpen, onOpenChange: setIsMapConfigOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
5297
- /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
5298
- stepName,
5299
- " map config"
5300
- ] }),
5430
+ /* @__PURE__ */ jsx(DialogTitle, { className: dialogTitleClass, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
5431
+ /* @__PURE__ */ jsxs("div", { children: [
5432
+ stepName,
5433
+ " Map Config"
5434
+ ] }),
5435
+ stepId && stepId !== stepName && /* @__PURE__ */ jsx("div", { className: "text-xs text-icon3 font-normal", children: stepId })
5436
+ ] }) }),
5301
5437
  /* @__PURE__ */ jsx("div", { className: "px-4 overflow-hidden", children: /* @__PURE__ */ jsx(CodeDialogContent, { data: mapConfig }) })
5302
5438
  ] }) })
5303
5439
  ] }),
@@ -5321,14 +5457,14 @@ const WorkflowStepActionBar = ({
5321
5457
  /* @__PURE__ */ jsx("div", { className: "px-4 overflow-hidden", children: /* @__PURE__ */ jsx(CodeDialogContent, { data: resumeData }) })
5322
5458
  ] }) })
5323
5459
  ] }),
5324
- output && /* @__PURE__ */ jsxs(Fragment, { children: [
5460
+ (output ?? suspendOutput) && /* @__PURE__ */ jsxs(Fragment, { children: [
5325
5461
  /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsOutputOpen(true), children: "Output" }),
5326
5462
  /* @__PURE__ */ jsx(Dialog, { open: isOutputOpen, onOpenChange: setIsOutputOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
5327
5463
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
5328
5464
  stepName,
5329
5465
  " output"
5330
5466
  ] }),
5331
- /* @__PURE__ */ jsx("div", { className: "px-4 overflow-hidden", children: /* @__PURE__ */ jsx(CodeDialogContent, { data: output }) })
5467
+ /* @__PURE__ */ jsx("div", { className: "px-4 overflow-hidden", children: /* @__PURE__ */ jsx(CodeDialogContent, { data: output ?? suspendOutput }) })
5332
5468
  ] }) })
5333
5469
  ] }),
5334
5470
  error && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -5355,6 +5491,7 @@ function WorkflowConditionNode({ data }) {
5355
5491
  const { steps } = useCurrentRun();
5356
5492
  const previousStep = steps[previousStepId];
5357
5493
  const nextStep = steps[nextStepId];
5494
+ const { icon: IconComponent, color } = getConditionIconAndColor(type);
5358
5495
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5359
5496
  !withoutTopHandle && /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style: { visibility: "hidden" } }),
5360
5497
  /* @__PURE__ */ jsxs(
@@ -5381,7 +5518,13 @@ function WorkflowConditionNode({ data }) {
5381
5518
  },
5382
5519
  children: [
5383
5520
  /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: "flex items-center justify-between w-full px-3 py-2", children: [
5384
- /* @__PURE__ */ jsx(Badge, { icon: type === "when" ? /* @__PURE__ */ jsx(Network, { className: "text-[#ECB047]" }) : null, children: type?.toUpperCase() }),
5521
+ /* @__PURE__ */ jsx(
5522
+ Badge,
5523
+ {
5524
+ icon: IconComponent ? /* @__PURE__ */ jsx(IconComponent, { className: "text-current", ...color ? { style: { color } } : {} }) : null,
5525
+ children: type?.toUpperCase()
5526
+ }
5527
+ ),
5385
5528
  isCollapsible && /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(
5386
5529
  ChevronDown,
5387
5530
  {
@@ -5392,6 +5535,21 @@ function WorkflowConditionNode({ data }) {
5392
5535
  ) })
5393
5536
  ] }),
5394
5537
  type === "else" ? null : /* @__PURE__ */ jsx(CollapsibleContent, { className: "flex flex-col gap-2 pb-2", children: conditions.map((condition, index) => {
5538
+ const conjType = condition.conj || type;
5539
+ const { icon: ConjIconComponent, color: conjColor } = getConditionIconAndColor(conjType);
5540
+ const conjBadge = index === 0 ? null : /* @__PURE__ */ jsx(
5541
+ Badge,
5542
+ {
5543
+ icon: ConjIconComponent ? /* @__PURE__ */ jsx(
5544
+ ConjIconComponent,
5545
+ {
5546
+ className: "text-current",
5547
+ ...conjColor ? { style: { color: conjColor } } : {}
5548
+ }
5549
+ ) : null,
5550
+ children: condition.conj?.toLocaleUpperCase() || "WHEN"
5551
+ }
5552
+ );
5395
5553
  return condition.fnString ? /* @__PURE__ */ jsxs("div", { className: "px-3", children: [
5396
5554
  /* @__PURE__ */ jsx(Highlight, { theme: themes.oneDark, code: String(condition.fnString).trim(), language: "javascript", children: ({ className, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ jsx(
5397
5555
  "pre",
@@ -5437,7 +5595,7 @@ function WorkflowConditionNode({ data }) {
5437
5595
  ) })
5438
5596
  ] }) })
5439
5597
  ] }, `${condition.fnString}-${index}`) : /* @__PURE__ */ jsx(Fragment$1, { children: condition.ref?.step ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
5440
- index === 0 ? null : /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(Network, { className: "text-[#ECB047]" }), children: condition.conj?.toLocaleUpperCase() || "WHEN" }),
5598
+ conjBadge,
5441
5599
  /* @__PURE__ */ jsxs(Text, { size: "xs", className: " text-mastra-el-3 flex-1", children: [
5442
5600
  condition.ref.step.id || condition.ref.step,
5443
5601
  "'s ",
@@ -5486,10 +5644,30 @@ const Clock = ({ startedAt, endedAt }) => {
5486
5644
  };
5487
5645
 
5488
5646
  function WorkflowDefaultNode({ data, parentWorkflowName }) {
5489
- const { steps, runId } = useCurrentRun();
5490
- const { label, description, withoutTopHandle, withoutBottomHandle, mapConfig, duration, date } = data;
5491
- const fullLabel = parentWorkflowName ? `${parentWorkflowName}.${label}` : label;
5492
- const step = steps[fullLabel];
5647
+ const { steps } = useCurrentRun();
5648
+ const {
5649
+ label,
5650
+ stepId,
5651
+ description,
5652
+ withoutTopHandle,
5653
+ withoutBottomHandle,
5654
+ mapConfig,
5655
+ duration,
5656
+ date,
5657
+ isParallel,
5658
+ canSuspend,
5659
+ isForEach
5660
+ } = data;
5661
+ const stepKey = parentWorkflowName ? `${parentWorkflowName}.${stepId || label}` : stepId || label;
5662
+ const step = steps[stepKey];
5663
+ const { isSleepNode, isForEachNode, isMapNode, hasSpecialBadge } = getNodeBadgeInfo({
5664
+ duration,
5665
+ date,
5666
+ isForEach,
5667
+ mapConfig,
5668
+ canSuspend,
5669
+ isParallel
5670
+ });
5493
5671
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5494
5672
  !withoutTopHandle && /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style: { visibility: "hidden" } }),
5495
5673
  /* @__PURE__ */ jsxs(
@@ -5499,7 +5677,8 @@ function WorkflowDefaultNode({ data, parentWorkflowName }) {
5499
5677
  "data-workflow-step-status": step?.status ?? "idle",
5500
5678
  "data-testid": "workflow-default-node",
5501
5679
  className: cn(
5502
- "bg-surface3 rounded-lg w-[274px] border-sm border-border1 pt-2",
5680
+ "bg-surface3 rounded-lg w-[274px] border-sm border-border1",
5681
+ hasSpecialBadge ? "pt-0" : "pt-2",
5503
5682
  step?.status === "success" && "bg-accent1Darker",
5504
5683
  step?.status === "failed" && "bg-accent2Darker",
5505
5684
  step?.status === "suspended" && "bg-accent3Darker",
@@ -5507,6 +5686,19 @@ function WorkflowDefaultNode({ data, parentWorkflowName }) {
5507
5686
  step?.status === "running" && "bg-accent6Darker"
5508
5687
  ),
5509
5688
  children: [
5689
+ hasSpecialBadge && /* @__PURE__ */ jsxs("div", { className: "px-3 pt-2 pb-1 flex gap-1.5 flex-wrap", children: [
5690
+ isSleepNode && /* @__PURE__ */ jsx(
5691
+ Badge,
5692
+ {
5693
+ icon: date ? /* @__PURE__ */ jsx(BADGE_ICONS.sleepUntil, { className: "text-current", style: { color: BADGE_COLORS.sleep } }) : /* @__PURE__ */ jsx(BADGE_ICONS.sleep, { className: "text-current", style: { color: BADGE_COLORS.sleep } }),
5694
+ children: date ? "SLEEP UNTIL" : "SLEEP"
5695
+ }
5696
+ ),
5697
+ canSuspend && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.suspend, { className: "text-current", style: { color: BADGE_COLORS.suspend } }), children: "SUSPEND/RESUME" }),
5698
+ isParallel && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.parallel, { className: "text-current", style: { color: BADGE_COLORS.parallel } }), children: "PARALLEL" }),
5699
+ isForEachNode && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.forEach, { className: "text-current", style: { color: BADGE_COLORS.forEach } }), children: "FOREACH" }),
5700
+ isMapNode && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.map, { className: "text-current", style: { color: BADGE_COLORS.map } }), children: "MAP" })
5701
+ ] }),
5510
5702
  /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2 px-3", !description && "pb-2"), children: [
5511
5703
  /* @__PURE__ */ jsxs(Icon, { children: [
5512
5704
  step?.status === "failed" && /* @__PURE__ */ jsx(CrossIcon, { className: "text-accent2" }),
@@ -5538,9 +5730,11 @@ function WorkflowDefaultNode({ data, parentWorkflowName }) {
5538
5730
  WorkflowStepActionBar,
5539
5731
  {
5540
5732
  stepName: label,
5733
+ stepId,
5541
5734
  input: step?.input,
5542
5735
  resumeData: step?.resumeData,
5543
5736
  output: step?.output,
5737
+ suspendOutput: step?.suspendOutput,
5544
5738
  error: step?.error,
5545
5739
  mapConfig,
5546
5740
  status: step?.status
@@ -5565,23 +5759,15 @@ function WorkflowAfterNode({ data }) {
5565
5759
  children: [
5566
5760
  /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style: { visibility: "hidden" } }),
5567
5761
  /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: "flex items-center justify-between w-full", children: [
5568
- /* @__PURE__ */ jsx(
5569
- Text,
5570
- {
5571
- size: "xs",
5572
- weight: "medium",
5573
- className: "text-mastra-el-3 bg-mastra-bg-11 my-auto block rounded-[0.125rem] px-2 py-1 text-[10px] w-fit",
5574
- children: "AFTER"
5575
- }
5576
- ),
5577
- /* @__PURE__ */ jsx(
5762
+ /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.after, { className: "text-current", style: { color: BADGE_COLORS.after } }), children: "AFTER" }),
5763
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(
5578
5764
  ChevronDown,
5579
5765
  {
5580
- className: cn("w-4 h-4 transition-transform", {
5766
+ className: cn("transition-transform text-icon3", {
5581
5767
  "transform rotate-180": open
5582
5768
  })
5583
5769
  }
5584
- )
5770
+ ) })
5585
5771
  ] }),
5586
5772
  /* @__PURE__ */ jsx(CollapsibleContent, { className: "flex flex-col gap-2", children: steps.map((step) => /* @__PURE__ */ jsxs("div", { className: "text-sm bg-mastra-bg-9 flex items-center gap-[6px] rounded-sm p-2", children: [
5587
5773
  /* @__PURE__ */ jsx(Footprints, { className: "text-current w-4 h-4" }),
@@ -5787,9 +5973,28 @@ function WorkflowNestedGraphProvider({ children }) {
5787
5973
  function WorkflowNestedNode({ data, parentWorkflowName }) {
5788
5974
  const { steps } = useCurrentRun();
5789
5975
  const { showNestedGraph } = useContext(WorkflowNestedGraphContext);
5790
- const { label, description, withoutTopHandle, withoutBottomHandle, stepGraph, mapConfig } = data;
5976
+ const {
5977
+ label,
5978
+ stepId,
5979
+ description,
5980
+ withoutTopHandle,
5981
+ withoutBottomHandle,
5982
+ stepGraph,
5983
+ mapConfig,
5984
+ isParallel,
5985
+ canSuspend,
5986
+ isForEach
5987
+ } = data;
5791
5988
  const fullLabel = parentWorkflowName ? `${parentWorkflowName}.${label}` : label;
5792
- const step = steps[fullLabel];
5989
+ const stepKey = parentWorkflowName ? `${parentWorkflowName}.${stepId || label}` : stepId || label;
5990
+ const step = steps[stepKey];
5991
+ const { isForEachNode, isMapNode, isNestedWorkflow, hasSpecialBadge } = getNodeBadgeInfo({
5992
+ isForEach,
5993
+ mapConfig,
5994
+ canSuspend,
5995
+ isParallel,
5996
+ stepGraph
5997
+ });
5793
5998
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5794
5999
  !withoutTopHandle && /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style: { visibility: "hidden" } }),
5795
6000
  /* @__PURE__ */ jsxs(
@@ -5799,7 +6004,8 @@ function WorkflowNestedNode({ data, parentWorkflowName }) {
5799
6004
  "data-workflow-node": true,
5800
6005
  "data-workflow-step-status": step?.status,
5801
6006
  className: cn(
5802
- "bg-surface3 rounded-lg w-[274px] border-sm border-border1 pt-2",
6007
+ "bg-surface3 rounded-lg w-[274px] border-sm border-border1",
6008
+ hasSpecialBadge ? "pt-0" : "pt-2",
5803
6009
  step?.status === "success" && "bg-accent1Darker",
5804
6010
  step?.status === "failed" && "bg-accent2Darker",
5805
6011
  step?.status === "suspended" && "bg-accent3Darker",
@@ -5807,6 +6013,13 @@ function WorkflowNestedNode({ data, parentWorkflowName }) {
5807
6013
  step?.status === "running" && "bg-accent6Darker"
5808
6014
  ),
5809
6015
  children: [
6016
+ hasSpecialBadge && /* @__PURE__ */ jsxs("div", { className: "px-3 pt-2 pb-1 flex gap-1.5 flex-wrap", children: [
6017
+ canSuspend && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.suspend, { className: "text-current", style: { color: BADGE_COLORS.suspend } }), children: "SUSPEND/RESUME" }),
6018
+ isParallel && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.parallel, { className: "text-current", style: { color: BADGE_COLORS.parallel } }), children: "PARALLEL" }),
6019
+ isNestedWorkflow && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.workflow, { className: "text-current", style: { color: BADGE_COLORS.workflow } }), children: "WORKFLOW" }),
6020
+ isForEachNode && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.forEach, { className: "text-current", style: { color: BADGE_COLORS.forEach } }), children: "FOREACH" }),
6021
+ isMapNode && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(BADGE_ICONS.map, { className: "text-current", style: { color: BADGE_COLORS.map } }), children: "MAP" })
6022
+ ] }),
5810
6023
  /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2 px-3", !description && "pb-2"), children: [
5811
6024
  /* @__PURE__ */ jsxs(Icon, { children: [
5812
6025
  step?.status === "failed" && /* @__PURE__ */ jsx(CrossIcon, { className: "text-accent2" }),
@@ -5827,9 +6040,11 @@ function WorkflowNestedNode({ data, parentWorkflowName }) {
5827
6040
  WorkflowStepActionBar,
5828
6041
  {
5829
6042
  stepName: label,
6043
+ stepId,
5830
6044
  input: step?.input,
5831
6045
  resumeData: step?.resumeData,
5832
6046
  output: step?.output,
6047
+ suspendOutput: step?.suspendOutput,
5833
6048
  error: step?.error,
5834
6049
  mapConfig,
5835
6050
  onShowNestedGraph: () => showNestedGraph({ label, fullStep: fullLabel, stepGraph }),
@@ -7259,10 +7474,10 @@ function WorkflowTrigger({
7259
7474
  setCancelResponse(response);
7260
7475
  };
7261
7476
  const streamResultToUse = result ?? streamResult;
7262
- const suspendedSteps = Object.entries(streamResultToUse?.steps || {}).filter(([_, { status }]) => status === "suspended").map(([stepId, { payload: payload2 }]) => ({
7477
+ const suspendedSteps = Object.entries(streamResultToUse?.steps || {}).filter(([_, { status }]) => status === "suspended").map(([stepId, { suspendPayload }]) => ({
7263
7478
  stepId,
7264
7479
  runId: innerRunId,
7265
- suspendPayload: payload2,
7480
+ suspendPayload,
7266
7481
  isLoading: false
7267
7482
  }));
7268
7483
  useEffect(() => {
@@ -7373,11 +7588,23 @@ function WorkflowTrigger({
7373
7588
  /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "px-4 text-mastra-el-3", size: "xs", children: "Status" }),
7374
7589
  /* @__PURE__ */ jsx("div", { className: "px-4 flex flex-col gap-4", children: Object.entries(workflowActivePaths).filter(([key, _]) => key !== "input" && !key.endsWith(".input")).map(([stepId, step]) => {
7375
7590
  const { status } = step;
7376
- let output = {};
7591
+ let output = void 0;
7592
+ let suspendOutput = void 0;
7593
+ if (step.status === "suspended") {
7594
+ suspendOutput = step.suspendOutput;
7595
+ }
7377
7596
  if (step.status === "success") {
7378
7597
  output = step.output;
7379
7598
  }
7380
- return /* @__PURE__ */ jsx(WorkflowStatus, { stepId, status, result: output }, stepId);
7599
+ return /* @__PURE__ */ jsx(
7600
+ WorkflowStatus,
7601
+ {
7602
+ stepId,
7603
+ status,
7604
+ result: output ?? suspendOutput ?? {}
7605
+ },
7606
+ stepId
7607
+ );
7381
7608
  }) })
7382
7609
  ] })
7383
7610
  ] })
@@ -7549,12 +7776,6 @@ const Cell = ({ className, children, ...props }) => {
7549
7776
  const TxtCell = ({ className, children }) => {
7550
7777
  return /* @__PURE__ */ jsx(Cell, { className, children: /* @__PURE__ */ jsx(Txt, { as: "span", variant: "ui-md", className: "w-full truncate", children }) });
7551
7778
  };
7552
- const UnitCell = ({ className, children, unit }) => {
7553
- return /* @__PURE__ */ jsx(Cell, { className, children: /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center", children: [
7554
- /* @__PURE__ */ jsx(Txt, { as: "span", variant: "ui-md", className: "shrink-0", children }),
7555
- /* @__PURE__ */ jsx(Txt, { as: "span", variant: "ui-sm", className: "text-icon3 w-full truncate", children: unit })
7556
- ] }) });
7557
- };
7558
7779
  const DateTimeCell = ({ dateTime, ...props }) => {
7559
7780
  const { day, time } = formatDateCell(dateTime);
7560
7781
  return /* @__PURE__ */ jsx(Cell, { ...props, children: /* @__PURE__ */ jsxs("div", { className: "shrink-0", children: [
@@ -10440,32 +10661,6 @@ const useAgentSettings = () => {
10440
10661
  return useContext(AgentSettingsContext);
10441
10662
  };
10442
10663
 
10443
- const ModelResetContext = createContext(null);
10444
- function ModelResetProvider({ children }) {
10445
- const resetFnRef = useRef(null);
10446
- const registerResetFn = useCallback((fn) => {
10447
- resetFnRef.current = fn;
10448
- }, []);
10449
- const triggerReset = useCallback(() => {
10450
- if (resetFnRef.current) {
10451
- resetFnRef.current();
10452
- }
10453
- }, []);
10454
- return /* @__PURE__ */ jsx(ModelResetContext.Provider, { value: { registerResetFn, triggerReset }, children });
10455
- }
10456
- function useModelReset() {
10457
- const context = useContext(ModelResetContext);
10458
- if (!context) {
10459
- return {
10460
- registerResetFn: () => {
10461
- },
10462
- triggerReset: () => {
10463
- }
10464
- };
10465
- }
10466
- return context;
10467
- }
10468
-
10469
10664
  const resolveInstructionPart = (part) => {
10470
10665
  if (typeof part === "string") {
10471
10666
  return part.trim();
@@ -11826,104 +12021,6 @@ function InputField({
11826
12021
  );
11827
12022
  }
11828
12023
 
11829
- function TextareaField({
11830
- value,
11831
- label,
11832
- helpText,
11833
- className,
11834
- testId,
11835
- type,
11836
- disabled,
11837
- ...props
11838
- }) {
11839
- return /* @__PURE__ */ jsxs(
11840
- "div",
11841
- {
11842
- className: cn(
11843
- "grid gap-[.5rem] grid-rows-[auto_1fr]",
11844
- {
11845
- "grid-rows-[auto_1fr_auto]": helpText
11846
- },
11847
- className
11848
- ),
11849
- children: [
11850
- label && /* @__PURE__ */ jsx("label", { className: cn("text-[0.8125rem] text-icon3 flex justify-between items-center"), children: label }),
11851
- /* @__PURE__ */ jsx(
11852
- "textarea",
11853
- {
11854
- className: cn(
11855
- "flex w-full items-center leading-[1.6] text-[0.875rem] text-[rgba(255,255,255,0.7)] border border-[rgba(255,255,255,0.15)] rounded-lg bg-transparent py-[0.5rem] px-[0.75rem] min-h-[6rem]",
11856
- "focus:outline-none focus:shadow-[inset_0_0_0_1px_#18fb6f]",
11857
- { "cursor-not-allowed opacity-50": disabled }
11858
- ),
11859
- "data-testid": testId,
11860
- ...props,
11861
- children: value
11862
- }
11863
- ),
11864
- helpText && /* @__PURE__ */ jsx("p", { className: "text-icon3 text-[0.75rem]", children: helpText })
11865
- ]
11866
- }
11867
- );
11868
- }
11869
-
11870
- const Button = React__default.forwardRef(
11871
- ({ className, variant = "outline", ...props }, ref) => {
11872
- return /* @__PURE__ */ jsx(
11873
- "button",
11874
- {
11875
- ref,
11876
- className: cn(
11877
- "text-[.875rem] inline-flex items-center justify-center rounded-lg px-[1rem] gap-[.75rem] leading-0 border bg-transparent text-[rgba(255,255,255,0.7)] whitespace-nowrap",
11878
- "[&:not(:disabled):hover]:border-[rgba(255,255,255,0.25)] [&:not(:disabled):hover]:text-[rgba(255,255,255,0.9)]",
11879
- "[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:mx-[-0.3em] [&>svg]:opacity-70 [&>svg]:shrink-0",
11880
- "focus:outline-none focus:shadow-[inset_0_0_0_1px_rgba(24,251,111,0.75)]",
11881
- className,
11882
- {
11883
- "cursor-not-allowed opacity-50": props.disabled,
11884
- "bg-ui-primaryBtnBg text-ui-primaryBtnText hover:bg-surface6 leading-[0] font-semibold": variant === "primary",
11885
- "min-h-[2rem]": variant === "ghost",
11886
- "min-h-[2.5rem]": variant !== "ghost",
11887
- "border-[rgba(255,255,255,0.15)]": variant === "outline"
11888
- }
11889
- ),
11890
- ...props
11891
- }
11892
- );
11893
- }
11894
- );
11895
- Button.displayName = "Button";
11896
-
11897
- function FormActions({
11898
- children,
11899
- onSubmit,
11900
- onCancel,
11901
- className,
11902
- submitLabel,
11903
- cancelLabel,
11904
- isSubmitting,
11905
- variant = "toLeft"
11906
- }) {
11907
- if (!children && (!onSubmit || !onCancel)) {
11908
- console.warn("FormActions requires either children or onSubmit and onCancel props");
11909
- return null;
11910
- }
11911
- return /* @__PURE__ */ jsx(
11912
- "div",
11913
- {
11914
- className: cn(
11915
- "flex gap-[1rem] items-center justify-start",
11916
- { "justify-end": variant === "toRight", "grid w-full grid-cols-[1fr_auto]": variant === "stretch" },
11917
- className
11918
- ),
11919
- children: children ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
11920
- /* @__PURE__ */ jsx(Button, { onClick: onSubmit, className: "min-w-[12rem]", disabled: isSubmitting, variant: "primary", children: submitLabel || "Submit" }),
11921
- /* @__PURE__ */ jsx(Button, { onClick: onCancel, children: cancelLabel || "Cancel" })
11922
- ] })
11923
- }
11924
- );
11925
- }
11926
-
11927
12024
  function SelectField({
11928
12025
  name,
11929
12026
  value,
@@ -11972,158 +12069,6 @@ function SelectField({
11972
12069
  );
11973
12070
  }
11974
12071
 
11975
- function SliderField({
11976
- name,
11977
- value,
11978
- label,
11979
- className,
11980
- testId,
11981
- required,
11982
- disabled,
11983
- helpMsg,
11984
- errorMsg,
11985
- onChange,
11986
- ...props
11987
- }) {
11988
- return /* @__PURE__ */ jsxs(
11989
- "div",
11990
- {
11991
- className: cn(
11992
- "grid gap-[.5rem] grid-rows-[auto_1fr]",
11993
- {
11994
- "grid-rows-[auto_1fr_auto]": helpMsg
11995
- },
11996
- className
11997
- ),
11998
- children: [
11999
- /* @__PURE__ */ jsxs("label", { className: cn("text-[0.8125rem] text-icon3 flex justify-between items-center"), children: [
12000
- label,
12001
- required && /* @__PURE__ */ jsx("i", { className: "text-icon2", children: "(required)" })
12002
- ] }),
12003
- /* @__PURE__ */ jsxs("div", { className: cn("grid w-full items-center gap-[1rem] grid-cols-[1fr_auto]"), children: [
12004
- /* @__PURE__ */ jsxs(
12005
- SliderPrimitive.Root,
12006
- {
12007
- name,
12008
- className: cn("relative flex w-full touch-none select-none items-center ", className),
12009
- value,
12010
- disabled,
12011
- ...props,
12012
- children: [
12013
- /* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-[4px] w-full grow overflow-hidden rounded-full bg-gray-600", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-gray-400" }) }),
12014
- /* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: "block h-4 w-4 rounded-full bg-gray-400 shadow transition-colors focus:outline-none focus:bg-[#18fb6f] disabled:pointer-events-none disabled:opacity-50" })
12015
- ]
12016
- }
12017
- ),
12018
- /* @__PURE__ */ jsx("span", { className: "text-icon4 text-[0.875rem] flex justify-end", children: value })
12019
- ] }),
12020
- helpMsg && /* @__PURE__ */ jsx("p", { className: "text-icon3 text-[0.75rem]", children: helpMsg }),
12021
- errorMsg && /* @__PURE__ */ jsxs(
12022
- "p",
12023
- {
12024
- className: cn(
12025
- "text-[0.75rem] text-red-500 flex items-center gap-[.5rem]",
12026
- "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-70"
12027
- ),
12028
- children: [
12029
- /* @__PURE__ */ jsx(TriangleAlertIcon, {}),
12030
- " ",
12031
- errorMsg
12032
- ]
12033
- }
12034
- )
12035
- ]
12036
- }
12037
- );
12038
- }
12039
-
12040
- function RadioGroupField({
12041
- name,
12042
- value,
12043
- label,
12044
- className,
12045
- testId,
12046
- required,
12047
- disabled,
12048
- helpMsg,
12049
- errorMsg,
12050
- onChange,
12051
- options = [],
12052
- layout = "vertical",
12053
- onValueChange,
12054
- ...props
12055
- }) {
12056
- const Wrapper = layout === "horizontal" ? "div" : "fieldset";
12057
- return /* @__PURE__ */ jsxs(
12058
- Wrapper,
12059
- {
12060
- className: cn(
12061
- "w-full",
12062
- {
12063
- "flex items-center gap-[2rem]": layout === "horizontal"
12064
- },
12065
- className
12066
- ),
12067
- role: layout === "horizontal" ? "radiogroup" : void 0,
12068
- "aria-labelledby": layout === "horizontal" ? void 0 : `${name}-legend`,
12069
- children: [
12070
- /* @__PURE__ */ jsx("legend", { id: `${name}-legend`, className: cn("text-[0.8125rem] text-icon3"), children: label }),
12071
- /* @__PURE__ */ jsxs(
12072
- "div",
12073
- {
12074
- className: cn("grid gap-[2.5rem]", {
12075
- "mt-[0.5rem]": layout === "vertical",
12076
- "grid-rows-[1fr_auto]": helpMsg
12077
- }),
12078
- children: [
12079
- /* @__PURE__ */ jsx(
12080
- RadioGroupPrimitive.Root,
12081
- {
12082
- value,
12083
- onValueChange,
12084
- ...props,
12085
- className: cn({
12086
- "grid gap-[0.5rem]": layout === "vertical",
12087
- "flex gap-[1rem]": layout === "horizontal"
12088
- }),
12089
- children: options.map((option) => {
12090
- return /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-[0.5rem] text-[0.875rem] text-icon4 ", children: [
12091
- /* @__PURE__ */ jsx(
12092
- RadioGroupPrimitive.Item,
12093
- {
12094
- className: "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ",
12095
- value: option.value,
12096
- children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
12097
- }
12098
- ),
12099
- option.label
12100
- ] }, option.value);
12101
- })
12102
- }
12103
- ),
12104
- helpMsg && /* @__PURE__ */ jsx("p", { className: "text-icon3 text-[0.75rem]", children: helpMsg }),
12105
- errorMsg && /* @__PURE__ */ jsxs(
12106
- "p",
12107
- {
12108
- className: cn(
12109
- "text-[0.75rem] text-red-500 flex items-center gap-[.5rem]",
12110
- "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-70"
12111
- ),
12112
- children: [
12113
- /* @__PURE__ */ jsx(TriangleAlertIcon, {}),
12114
- " ",
12115
- errorMsg
12116
- ]
12117
- }
12118
- )
12119
- ]
12120
- }
12121
- )
12122
- ]
12123
- }
12124
- );
12125
- }
12126
-
12127
12072
  function KeyValueList({ data, LinkComponent, className, labelsAreHidden, isLoading }) {
12128
12073
  const { Link } = useLinkComponent();
12129
12074
  const LabelWrapper = ({ children }) => {
@@ -12483,6 +12428,33 @@ function SideDialogRoot({
12483
12428
  ] }) });
12484
12429
  }
12485
12430
 
12431
+ const Button = React__default.forwardRef(
12432
+ ({ className, variant = "outline", ...props }, ref) => {
12433
+ return /* @__PURE__ */ jsx(
12434
+ "button",
12435
+ {
12436
+ ref,
12437
+ className: cn(
12438
+ "text-[.875rem] inline-flex items-center justify-center rounded-lg px-[1rem] gap-[.75rem] leading-0 border bg-transparent text-[rgba(255,255,255,0.7)] whitespace-nowrap",
12439
+ "[&:not(:disabled):hover]:border-[rgba(255,255,255,0.25)] [&:not(:disabled):hover]:text-[rgba(255,255,255,0.9)]",
12440
+ "[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:mx-[-0.3em] [&>svg]:opacity-70 [&>svg]:shrink-0",
12441
+ "focus:outline-none focus:shadow-[inset_0_0_0_1px_rgba(24,251,111,0.75)]",
12442
+ className,
12443
+ {
12444
+ "cursor-not-allowed opacity-50": props.disabled,
12445
+ "bg-ui-primaryBtnBg text-ui-primaryBtnText hover:bg-surface6 leading-[0] font-semibold": variant === "primary",
12446
+ "min-h-[2rem]": variant === "ghost",
12447
+ "min-h-[2.5rem]": variant !== "ghost",
12448
+ "border-[rgba(255,255,255,0.15)]": variant === "outline"
12449
+ }
12450
+ ),
12451
+ ...props
12452
+ }
12453
+ );
12454
+ }
12455
+ );
12456
+ Button.displayName = "Button";
12457
+
12486
12458
  function MainContentLayout({
12487
12459
  children,
12488
12460
  className,
@@ -12614,7 +12586,7 @@ function SideDialogCodeSection({ codeStr = "", title, icon, simplified = false }
12614
12586
  hasMultilineText && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setShowAsMultilineText(!showAsMultilineText), children: showAsMultilineText ? /* @__PURE__ */ jsx(AlignLeftIcon, {}) : /* @__PURE__ */ jsx(AlignJustifyIcon, {}) })
12615
12587
  ] })
12616
12588
  ] }),
12617
- codeStr && /* @__PURE__ */ jsx("div", { className: "bg-black/20 p-[1rem] overflow-hidden rounded-xl border border-white/10 text-icon4 text-[0.875rem] break-all", children: simplified ? /* @__PURE__ */ jsx("div", { className: "text-icon4 font-mono break-all px-[0.5rem]", children: /* @__PURE__ */ jsx("pre", { className: "text-wrap", children: codeStr }) }) : /* @__PURE__ */ jsx(CodeMirror, { extensions: [json(), EditorView.lineWrapping], theme, value: finalCodeStr }) })
12589
+ codeStr && /* @__PURE__ */ jsx("div", { className: "bg-black/20 p-[1rem] overflow-hidden rounded-xl border border-white/10 text-icon4 text-[0.875rem] break-all", children: simplified ? /* @__PURE__ */ jsx("div", { className: "text-icon4 font-mono break-all px-[0.5rem]", children: /* @__PURE__ */ jsx("pre", { className: "text-wrap", children: codeStr }) }) : /* @__PURE__ */ jsx(CodeMirror, { extensions: [json(), EditorView$1.lineWrapping], theme, value: finalCodeStr }) })
12618
12590
  ] });
12619
12591
  }
12620
12592
  function containsInnerNewline(obj) {
@@ -12711,39 +12683,6 @@ const SideDialog = Object.assign(SideDialogRoot, {
12711
12683
  Nav: SideDialogNav
12712
12684
  });
12713
12685
 
12714
- function EntityMainHeader({
12715
- title,
12716
- description,
12717
- icon,
12718
- children,
12719
- isLoading,
12720
- className,
12721
- placement = "page"
12722
- }) {
12723
- return /* @__PURE__ */ jsxs(
12724
- "header",
12725
- {
12726
- className: cn(
12727
- "grid gap-[.5rem]",
12728
- "[&>h1]:text-icon6 [&>h1]:text-[1.25rem] [&>h1]:font-normal [&>h1]:flex [&>h1]:items-center [&>h1]:gap-[0.5rem]",
12729
- "[&_svg]:w-[1.4rem] [&_svg]:h-[1.4rem] [&_svg]:text-icon3",
12730
- "[&>p]:text-icon4 [&>p]:text-[0.875rem] [&>p]:m-0",
12731
- { "pt-[2rem] pb-[2rem]": placement === "page" },
12732
- { "pt-[1.5em] pb-[1rem]": placement === "sidebar" },
12733
- className
12734
- ),
12735
- children: [
12736
- /* @__PURE__ */ jsxs("h1", { children: [
12737
- icon && icon,
12738
- " ",
12739
- title
12740
- ] }),
12741
- description && /* @__PURE__ */ jsx("p", { children: description })
12742
- ]
12743
- }
12744
- );
12745
- }
12746
-
12747
12686
  function PageHeader({ title, description, icon, className }) {
12748
12687
  const titleIsLoading = title === "loading";
12749
12688
  const descriptionIsLoading = description === "loading";
@@ -13187,11 +13126,23 @@ function MainSidebarNavSeparator({ className }) {
13187
13126
  function MainSidebarRoot({ children, className }) {
13188
13127
  const { state, toggleSidebar } = useMainSidebar();
13189
13128
  const isCollapsed = state === "collapsed";
13129
+ useEffect(() => {
13130
+ const handleKeyDown = (event) => {
13131
+ if (event.ctrlKey && event.key === "b") {
13132
+ event.preventDefault();
13133
+ toggleSidebar();
13134
+ }
13135
+ };
13136
+ document.addEventListener("keydown", handleKeyDown);
13137
+ return () => {
13138
+ document.removeEventListener("keydown", handleKeyDown);
13139
+ };
13140
+ }, [toggleSidebar]);
13190
13141
  return /* @__PURE__ */ jsxs(
13191
13142
  "div",
13192
13143
  {
13193
13144
  className: cn(
13194
- "flex flex-col h-full px-[1rem] pb-[1rem] relative overflow-y-auto",
13145
+ "flex flex-col h-full px-[1rem] relative overflow-y-auto",
13195
13146
  {
13196
13147
  "lg:min-w-[13rem] xl:min-w-[14rem] 2xl:min-w-[15rem] 3xl:min-w-[16rem] 4xl:min-w-[17rem]": !isCollapsed
13197
13148
  },
@@ -13199,30 +13150,41 @@ function MainSidebarRoot({ children, className }) {
13199
13150
  ),
13200
13151
  children: [
13201
13152
  children,
13202
- /* @__PURE__ */ jsx(MainSidebarNavSeparator, {}),
13203
- /* @__PURE__ */ jsx(
13204
- "button",
13205
- {
13206
- onClick: toggleSidebar,
13207
- className: cn(
13208
- "inline-flex w-auto items-center text-icon3 h-[2rem] px-[0.75rem] rounded-md",
13209
- "hover:bg-surface4",
13210
- "[&_svg]:w-[1rem] [&_svg]:h-[1rem] [&_svg]:text-icon3",
13211
- {
13212
- "ml-auto": !isCollapsed
13213
- }
13214
- ),
13215
- "aria-label": "Toggle sidebar",
13216
- children: /* @__PURE__ */ jsx(
13217
- PanelRightIcon,
13153
+ /* @__PURE__ */ jsxs("div", { className: "bg-surface1 grid sticky bottom-0 pb-[.75rem] ", children: [
13154
+ /* @__PURE__ */ jsx(MainSidebarNavSeparator, {}),
13155
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
13156
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
13157
+ "button",
13218
13158
  {
13219
- className: cn({
13220
- "rotate-180": isCollapsed
13221
- })
13159
+ onClick: toggleSidebar,
13160
+ className: cn(
13161
+ "inline-flex w-auto items-center text-icon3 h-[2rem] px-[0.75rem] rounded-md ml-auto",
13162
+ "hover:bg-surface4",
13163
+ "[&_svg]:w-[1rem] [&_svg]:h-[1rem] [&_svg]:text-icon3",
13164
+ {
13165
+ "ml-auto": !isCollapsed
13166
+ }
13167
+ ),
13168
+ "aria-label": "Toggle sidebar",
13169
+ children: /* @__PURE__ */ jsx(
13170
+ PanelRightIcon,
13171
+ {
13172
+ className: cn({
13173
+ "rotate-180": isCollapsed
13174
+ })
13175
+ }
13176
+ )
13222
13177
  }
13223
- )
13224
- }
13225
- ),
13178
+ ) }),
13179
+ /* @__PURE__ */ jsxs(TooltipContent, { children: [
13180
+ "Toggle Sidebar",
13181
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]", children: [
13182
+ /* @__PURE__ */ jsx(KeyboardIcon, {}),
13183
+ " Ctrl+B"
13184
+ ] })
13185
+ ] })
13186
+ ] })
13187
+ ] }),
13226
13188
  /* @__PURE__ */ jsx(
13227
13189
  "button",
13228
13190
  {
@@ -13626,31 +13588,6 @@ function ScoresTools({ onEntityChange, onReset, selectedEntity, entityOptions, i
13626
13588
  ] });
13627
13589
  }
13628
13590
 
13629
- const useScoresByEntityId = (entityId, entityType, page = 0) => {
13630
- const client = useMastraClient();
13631
- const [scores, setScores] = useState(null);
13632
- const [isLoading, setIsLoading] = useState(true);
13633
- useEffect(() => {
13634
- const fetchScores = async () => {
13635
- setIsLoading(true);
13636
- try {
13637
- const res = await client.listScoresByEntityId({
13638
- entityId,
13639
- entityType,
13640
- page: page || 0,
13641
- perPage: 10
13642
- });
13643
- setScores(res);
13644
- setIsLoading(false);
13645
- } catch (error) {
13646
- setScores(null);
13647
- setIsLoading(false);
13648
- }
13649
- };
13650
- fetchScores();
13651
- }, [entityId, entityType, page]);
13652
- return { scores, isLoading };
13653
- };
13654
13591
  const useScoresByScorerId = ({ scorerId, page = 0, entityId, entityType }) => {
13655
13592
  const client = useMastraClient();
13656
13593
  return useQuery({
@@ -13835,6 +13772,20 @@ const useTraceSpanScores = ({ traceId = "", spanId = "", page }) => {
13835
13772
  });
13836
13773
  };
13837
13774
 
13775
+ const ModelResetContext = createContext(null);
13776
+ function useModelReset() {
13777
+ const context = useContext(ModelResetContext);
13778
+ if (!context) {
13779
+ return {
13780
+ registerResetFn: () => {
13781
+ },
13782
+ triggerReset: () => {
13783
+ }
13784
+ };
13785
+ }
13786
+ return context;
13787
+ }
13788
+
13838
13789
  const useAgentsModelProviders = () => {
13839
13790
  const client = useMastraClient();
13840
13791
  return useQuery({
@@ -14521,7 +14472,7 @@ const PromptEnhancer = ({ agentId }) => {
14521
14472
  {
14522
14473
  value: prompt,
14523
14474
  editable: true,
14524
- extensions: [markdown({ base: markdownLanguage, codeLanguages: languages }), EditorView.lineWrapping],
14475
+ extensions: [markdown({ base: markdownLanguage, codeLanguages: languages }), EditorView$1.lineWrapping],
14525
14476
  onChange: setPrompt,
14526
14477
  theme: githubDarkInit({
14527
14478
  settings: {
@@ -18418,89 +18369,6 @@ const SpanScoring = ({ traceId, spanId, entityType }) => {
18418
18369
  ] });
18419
18370
  };
18420
18371
 
18421
- const useResizeColumn = ({
18422
- defaultWidth,
18423
- minimumWidth,
18424
- maximumWidth,
18425
- setCurrentWidth
18426
- }) => {
18427
- const [isDragging, setIsDragging] = useState(false);
18428
- const [sidebarWidth, setSidebarWidth] = useState(defaultWidth);
18429
- const containerRef = useRef(null);
18430
- const dragStartXRef = useRef(0);
18431
- const initialWidthRef = useRef(0);
18432
- const handleMouseDown = (e) => {
18433
- e.preventDefault();
18434
- setIsDragging(true);
18435
- dragStartXRef.current = e.clientX;
18436
- initialWidthRef.current = sidebarWidth;
18437
- };
18438
- useEffect(() => {
18439
- setSidebarWidth(defaultWidth);
18440
- setCurrentWidth?.(defaultWidth);
18441
- }, [defaultWidth]);
18442
- useEffect(() => {
18443
- const handleMouseMove = (e) => {
18444
- if (!isDragging || !containerRef.current) return;
18445
- const containerWidth = containerRef.current.offsetWidth;
18446
- const deltaX = dragStartXRef.current - e.clientX;
18447
- const deltaPercentage = deltaX / containerWidth * 100;
18448
- const newWidth = Math.min(Math.max(initialWidthRef.current + deltaPercentage, minimumWidth), maximumWidth);
18449
- setSidebarWidth(newWidth);
18450
- setCurrentWidth?.(newWidth);
18451
- };
18452
- const handleMouseUp = () => {
18453
- setIsDragging(false);
18454
- };
18455
- if (isDragging) {
18456
- window.addEventListener("mousemove", handleMouseMove);
18457
- window.addEventListener("mouseup", handleMouseUp);
18458
- }
18459
- return () => {
18460
- window.removeEventListener("mousemove", handleMouseMove);
18461
- window.removeEventListener("mouseup", handleMouseUp);
18462
- };
18463
- }, [isDragging]);
18464
- return { sidebarWidth, isDragging, handleMouseDown, containerRef };
18465
- };
18466
-
18467
- const MastraResizablePanel = ({
18468
- children,
18469
- defaultWidth,
18470
- minimumWidth,
18471
- maximumWidth,
18472
- className,
18473
- disabled = false,
18474
- setCurrentWidth,
18475
- dividerPosition = "left"
18476
- }) => {
18477
- const { sidebarWidth, isDragging, handleMouseDown, containerRef } = useResizeColumn({
18478
- defaultWidth: disabled ? 100 : defaultWidth,
18479
- minimumWidth,
18480
- maximumWidth,
18481
- setCurrentWidth
18482
- });
18483
- return /* @__PURE__ */ jsxs("div", { className: cn("w-full h-full relative", className), ref: containerRef, style: { width: `${sidebarWidth}%` }, children: [
18484
- !disabled && dividerPosition === "left" ? /* @__PURE__ */ jsx(
18485
- "div",
18486
- {
18487
- className: `w-px bg-border1 h-full cursor-col-resize hover:w-1.5 hover:bg-mastra-border-2 hover:bg-[#424242] active:bg-mastra-border-3 active:bg-[#3e3e3e] transition-colors absolute inset-y-0 z-10
18488
- ${isDragging ? "bg-border2 w-1.5 cursor- col-resize" : ""}`,
18489
- onMouseDown: handleMouseDown
18490
- }
18491
- ) : null,
18492
- children,
18493
- !disabled && dividerPosition === "right" ? /* @__PURE__ */ jsx(
18494
- "div",
18495
- {
18496
- className: `w-px bg-border1 h-full cursor-col-resize hover:w-1.5 hover:bg-border2 active:bg-border3 transition-colors absolute inset-y-0 z-10
18497
- ${isDragging ? "bg-border2 w-1.5 cursor- col-resize" : ""}`,
18498
- onMouseDown: handleMouseDown
18499
- }
18500
- ) : null
18501
- ] });
18502
- };
18503
-
18504
18372
  const Breadcrumb = ({ children, label }) => {
18505
18373
  return /* @__PURE__ */ jsx("nav", { "aria-label": label, children: /* @__PURE__ */ jsx("ol", { className: "gap-sm flex items-center", children }) });
18506
18374
  };
@@ -18590,113 +18458,6 @@ const EntityContent = ({ children, className }) => {
18590
18458
  return /* @__PURE__ */ jsx("div", { className, children });
18591
18459
  };
18592
18460
 
18593
- function usePolling({
18594
- fetchFn,
18595
- interval = 3e3,
18596
- enabled = false,
18597
- onSuccess,
18598
- onError,
18599
- shouldContinue = () => true,
18600
- restartPolling = false
18601
- }) {
18602
- const [isPolling, setIsPolling] = useState(enabled);
18603
- const [error, setError] = useState(null);
18604
- const [data, setData] = useState(null);
18605
- const [isLoading, setIsLoading] = useState(false);
18606
- const [firstCallLoading, setFirstCallLoading] = useState(false);
18607
- const timeoutRef = useRef(null);
18608
- const mountedRef = useRef(true);
18609
- const [restart, setRestart] = useState(restartPolling);
18610
- const cleanup = useCallback(() => {
18611
- console.log("cleanup");
18612
- if (timeoutRef.current) {
18613
- clearTimeout(timeoutRef.current);
18614
- timeoutRef.current = null;
18615
- }
18616
- }, []);
18617
- const stopPolling = useCallback(() => {
18618
- console.log("stopPolling");
18619
- setIsPolling(false);
18620
- cleanup();
18621
- }, [cleanup]);
18622
- const startPolling = useCallback(() => {
18623
- console.log("startPolling");
18624
- setIsPolling(true);
18625
- setError(null);
18626
- }, []);
18627
- const executePoll = useCallback(
18628
- async (refetch2 = true) => {
18629
- if (!mountedRef.current) return;
18630
- setIsLoading(true);
18631
- try {
18632
- const result = await fetchFn();
18633
- setData(result);
18634
- setError(null);
18635
- onSuccess?.(result);
18636
- if (shouldContinue(result) && refetch2) {
18637
- timeoutRef.current = setTimeout(executePoll, interval);
18638
- } else {
18639
- stopPolling();
18640
- }
18641
- } catch (err) {
18642
- if (!mountedRef.current) return;
18643
- setError(err);
18644
- onError?.(err);
18645
- stopPolling();
18646
- } finally {
18647
- if (mountedRef.current) {
18648
- setFirstCallLoading(false);
18649
- setIsLoading(false);
18650
- }
18651
- }
18652
- },
18653
- [fetchFn, interval, onSuccess, onError, shouldContinue, stopPolling]
18654
- );
18655
- const refetch = useCallback(
18656
- (withPolling = false) => {
18657
- console.log("refetch", { withPolling });
18658
- if (withPolling) {
18659
- setIsPolling(true);
18660
- } else {
18661
- executePoll(false);
18662
- }
18663
- setError(null);
18664
- },
18665
- [executePoll]
18666
- );
18667
- useEffect(() => {
18668
- mountedRef.current = true;
18669
- if (enabled && isPolling) {
18670
- executePoll(true);
18671
- }
18672
- return () => {
18673
- console.log("cleanup poll");
18674
- mountedRef.current = false;
18675
- cleanup();
18676
- };
18677
- }, [enabled, isPolling, executePoll, cleanup]);
18678
- useEffect(() => {
18679
- setRestart(restartPolling);
18680
- }, [restartPolling]);
18681
- useEffect(() => {
18682
- if (restart && !isPolling) {
18683
- setIsPolling(true);
18684
- executePoll();
18685
- setRestart(false);
18686
- }
18687
- }, [restart]);
18688
- return {
18689
- isPolling,
18690
- isLoading,
18691
- error,
18692
- data,
18693
- startPolling,
18694
- stopPolling,
18695
- firstCallLoading,
18696
- refetch
18697
- };
18698
- }
18699
-
18700
18461
  const PlaygroundQueryClient = ({ children }) => {
18701
18462
  const queryClient = new QueryClient();
18702
18463
  return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
@@ -19171,5 +18932,5 @@ function MCPServerCombobox({
19171
18932
  );
19172
18933
  }
19173
18934
 
19174
- export { AgentChat, AgentCoinIcon, AgentCombobox, AgentEntityHeader, AgentIcon, AgentInformation, AgentMetadata, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPromptExperimentProvider, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentsTable, AiIcon, Alert$1 as Alert, AlertDescription$1 as AlertDescription, AlertDialog, AlertTitle$1 as AlertTitle, ApiIcon, Badge, BranchIcon, Breadcrumb, Button$1 as Button, ButtonsGroup, Cell, ChatThreads, CheckIcon, ChevronIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, CommitIcon, CrossIcon, Crumb, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityMainHeader, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, FiltersIcon, FolderIcon, FormActions, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, InputField, JudgeIcon, Kbd, KeyValueList, LatencyIcon, LinkComponentProvider, LogoWithoutText, LogsIcon, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainSidebar, MainSidebarProvider, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, MemorySearch, ModelResetProvider, Notification, OpenAIIcon, PageHeader, PlaygroundQueryClient, PlaygroundTabs, PromptIcon, RadioGroup, RadioGroupField, RadioGroupItem, RepoIcon, RequestContext, RequestContextWrapper, Row, ScoreDialog, ScorerCombobox, ScorersTable, ScoresList, ScoresTools, SearchField, Searchbar, SearchbarWrapper, Section, Sections, SelectField, SettingsIcon, SideDialog, SlashIcon, SliderField, SpanScoreList, SpanScoring, SpanTabs, Tab$1 as Tab, TabContent$1 as TabContent, TabList$1 as TabList, Table, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, TextareaField, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolPanel, ToolTable, ToolsIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineLegend, TraceTimelineSpan, TracesList, TracesTools, TsIcon, Txt, TxtCell, UnitCell, VariablesIcon, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowTable, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, convertWorkflowRunStateToStreamResult, extractPrompt, formatHierarchicalSpans, getColumnTemplate, getShortId, getSpanTypeUi, getToNextEntryFn, getToPreviousEntryFn, parseError, providerMapToIcon, scoresListColumns, spanTypePrefixes, toast, traceScoresListColumns, tracesListColumns, useAgent, useAgentPromptExperiment, useAgentSettings, useAgents, useCancelWorkflowRun, useCurrentRun, useDeleteThread, useExecuteAgentTool, useExecuteMCPTool, useExecuteTool, useExecuteWorkflow, useInView, useLinkComponent, useMCPServerTool, useMCPServerTools, useMCPServers, useMainSidebar, useMemory, useMemoryConfig, useMemorySearch, useModelReset, usePlaygroundStore, usePolling, useReorderModelList, useResetAgentModel, useScorer, useScorers, useScoresByEntityId, useScoresByScorerId, useSpeechRecognition, useStreamWorkflow, useThreadInput, useThreads, useTool, useTools, useTraceSpanScores, useUpdateAgentModel, useUpdateModelInModelList, useWorkflow, useWorkflowRunExecutionResult, useWorkflowRuns, useWorkflows, useWorkingMemory };
18935
+ export { AgentChat, AgentCoinIcon, AgentCombobox, AgentEntityHeader, AgentIcon, AgentInformation, AgentMetadata, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPromptExperimentProvider, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentsTable, AiIcon, Alert$1 as Alert, AlertDescription$1 as AlertDescription, AlertDialog, AlertTitle$1 as AlertTitle, ApiIcon, Badge, BranchIcon, Breadcrumb, Button$1 as Button, ButtonsGroup, Cell, ChatThreads, CheckIcon, ChevronIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, CommitIcon, CrossIcon, Crumb, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, InputField, JudgeIcon, Kbd, KeyValueList, LatencyIcon, LinkComponentProvider, LogoWithoutText, LogsIcon, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainSidebar, MainSidebarProvider, McpCoinIcon, McpServerIcon, MemoryIcon, MemorySearch, Notification, OpenAIIcon, PageHeader, PlaygroundQueryClient, PlaygroundTabs, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, RequestContext, RequestContextWrapper, Row, ScoreDialog, ScorerCombobox, ScorersTable, ScoresList, ScoresTools, SearchField, Searchbar, SearchbarWrapper, Section, Sections, SelectField, SettingsIcon, SideDialog, Skeleton, SlashIcon, SpanScoreList, SpanScoring, SpanTabs, Tab$1 as Tab, TabContent$1 as TabContent, TabList$1 as TabList, Table, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolPanel, ToolTable, ToolsIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineLegend, TraceTimelineSpan, TracesList, TracesTools, TsIcon, Txt, TxtCell, VariablesIcon, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowTable, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, convertWorkflowRunStateToStreamResult, extractPrompt, formatHierarchicalSpans, getColumnTemplate, getShortId, getSpanTypeUi, getToNextEntryFn, getToPreviousEntryFn, parseError, providerMapToIcon, scoresListColumns, spanTypePrefixes, toast, traceScoresListColumns, tracesListColumns, useAgent, useAgentPromptExperiment, useAgentSettings, useAgents, useCancelWorkflowRun, useCurrentRun, useDeleteThread, useExecuteAgentTool, useExecuteMCPTool, useExecuteTool, useExecuteWorkflow, useInView, useLinkComponent, useMCPServerTool, useMCPServerTools, useMCPServers, useMainSidebar, useMemory, useMemoryConfig, useMemorySearch, usePlaygroundStore, useReorderModelList, useResetAgentModel, useScorer, useScorers, useScoresByScorerId, useSpeechRecognition, useStreamWorkflow, useThreadInput, useThreads, useTool, useTools, useTraceSpanScores, useUpdateAgentModel, useUpdateModelInModelList, useWorkflow, useWorkflowRunExecutionResult, useWorkflowRuns, useWorkflows, useWorkingMemory };
19175
18936
  //# sourceMappingURL=index.es.js.map