@mastra/playground-ui 2.0.1-alpha.1 → 2.0.1

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.
@@ -67,6 +67,10 @@ interface DataTableProps<TData, TValue> {
67
67
  * loading state
68
68
  */
69
69
  isLoading?: boolean;
70
+ /**
71
+ * text to display when there are no results
72
+ */
73
+ emptyText?: string;
70
74
  }
71
- export declare const DataTable: <TData, TValue>({ title, icon, withoutBorder, columns, data, className, pagination, gotoNextPage, gotoPreviousPage, maxHeight, withoutRadius, disabledFlex, emptyStateHeight, getRowId, selectedRowId, isLoading, }: DataTableProps<TData, TValue>) => import("react/jsx-runtime").JSX.Element;
75
+ export declare const DataTable: <TData, TValue>({ title, icon, withoutBorder, columns, data, className, pagination, gotoNextPage, gotoPreviousPage, maxHeight, withoutRadius, disabledFlex, emptyStateHeight, getRowId, selectedRowId, isLoading, emptyText, }: DataTableProps<TData, TValue>) => import("react/jsx-runtime").JSX.Element;
72
76
  export {};
@@ -1,6 +1,6 @@
1
1
  import * as ResizablePrimitive from 'react-resizable-panels';
2
2
  declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
3
- declare const ResizablePanel: import('../../../node_modules/@types/react').ForwardRefExoticComponent<Omit<import('../../../node_modules/@types/react').HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLDivElement | HTMLImageElement | HTMLSpanElement | HTMLPreElement | HTMLObjectElement | HTMLLinkElement | HTMLFormElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLDialogElement | HTMLOptionElement | HTMLTableElement | HTMLMapElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOutputElement | HTMLParagraphElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
3
+ declare const ResizablePanel: import('../../../node_modules/@types/react').ForwardRefExoticComponent<Omit<import('../../../node_modules/@types/react').HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLLinkElement | HTMLFormElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLDialogElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLMapElement | HTMLAnchorElement | HTMLHeadingElement | HTMLInputElement | HTMLLabelElement | HTMLLIElement | HTMLOListElement | HTMLParagraphElement | HTMLSpanElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
4
4
  className?: string | undefined;
5
5
  collapsedSize?: number | undefined;
6
6
  collapsible?: boolean | undefined;
@@ -3,7 +3,7 @@ import { default as React } from '../../../node_modules/@types/react';
3
3
 
4
4
  declare const textVariants: (props?: ({
5
5
  variant?: "secondary" | "primary" | null | undefined;
6
- size?: "default" | "sm" | "lg" | "md" | "xs" | "xl" | "2xl" | null | undefined;
6
+ size?: "default" | "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | null | undefined;
7
7
  weight?: "bold" | "medium" | "normal" | "semibold" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
9
  export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement | HTMLSpanElement | HTMLDivElement>, VariantProps<typeof textVariants> {
@@ -1,5 +1,7 @@
1
+ import { WorkflowRunResult } from '@mastra/client-js';
2
+
1
3
  type WorkflowRunContextType = {
2
- result: any;
4
+ result: WorkflowRunResult | null;
3
5
  setResult: React.Dispatch<React.SetStateAction<any>>;
4
6
  payload: any;
5
7
  setPayload: React.Dispatch<React.SetStateAction<any>>;
@@ -1,8 +1,9 @@
1
1
  import { StepCondition } from '@mastra/core/workflows';
2
2
  import { Node, Edge } from '@xyflow/react';
3
3
 
4
+ export type ConditionConditionType = 'if' | 'else' | 'when' | 'until' | 'while';
4
5
  export type Condition = {
5
- type: 'if' | 'else' | 'when';
6
+ type: ConditionConditionType;
6
7
  ref: {
7
8
  step: {
8
9
  id: string;
@@ -10,17 +11,17 @@ export type Condition = {
10
11
  path: string;
11
12
  };
12
13
  query: Record<string, any>;
13
- conj?: 'and' | 'or';
14
+ conj?: 'and' | 'or' | 'not';
14
15
  fnString?: never;
15
16
  } | {
16
- type: 'if' | 'else' | 'when';
17
+ type: ConditionConditionType;
17
18
  fnString: string;
18
19
  ref?: never;
19
20
  query?: never;
20
21
  conj?: never;
21
22
  };
22
23
  export declare const pathAlphabet: string[];
23
- export declare function extractConditions(group: StepCondition<any, any>, type: 'if' | 'else' | 'when'): Condition[];
24
+ export declare function extractConditions(group: StepCondition<any, any>, type: ConditionConditionType): Condition[];
24
25
  export declare const contructNodesAndEdges: ({ stepGraph, stepSubscriberGraph, }: {
25
26
  stepGraph: any;
26
27
  stepSubscriberGraph: any;
@@ -0,0 +1,6 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+
3
+ export type AfterNode = Node<{
4
+ steps: string[];
5
+ }, 'after-node'>;
6
+ export declare function WorkflowAfterNode({ data }: NodeProps<AfterNode>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+
3
+ export type LoopResultNode = Node<{
4
+ result: boolean;
5
+ }, 'loop-result-node'>;
6
+ export declare function WorkflowLoopResultNode({ data }: NodeProps<LoopResultNode>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { RefinedTrace } from '../domains/traces/types';
2
2
 
3
3
  export declare const useTraces: (componentName: string, baseUrl: string, isWorkflow?: boolean) => {
4
- traces: RefinedTrace[] | null;
4
+ traces: RefinedTrace[];
5
5
  firstCallLoading: boolean;
6
6
  error: {
7
7
  message: string;
@@ -2,7 +2,7 @@ import { Workflow } from '@mastra/core/workflows';
2
2
  import { WorkflowRunResult } from '@mastra/client-js';
3
3
 
4
4
  export declare const useWorkflow: (workflowId: string, baseUrl: string) => {
5
- workflow: Workflow<import('@mastra/core').Step<string, any, any, import('@mastra/core').StepExecutionContext<any, import('@mastra/core').WorkflowContext<any, import('@mastra/core').Step<string, any, any, any>[]>>>[], any> | null;
5
+ workflow: Workflow<import('@mastra/core').Step<string, any, any, import('@mastra/core').StepExecutionContext<any, import('@mastra/core').WorkflowContext<any, import('@mastra/core').Step<string, any, any, any>[], Record<string, any>>>>[], any> | null;
6
6
  isLoading: boolean;
7
7
  };
8
8
  export declare const useExecuteWorkflow: (baseUrl: string) => {
@@ -10,9 +10,14 @@ export declare const useExecuteWorkflow: (baseUrl: string) => {
10
10
  workflowId: string;
11
11
  input: any;
12
12
  }) => Promise<WorkflowRunResult>;
13
- createWorkflowRun: ({ workflowId, input }: {
13
+ startWorkflowRun: ({ workflowId, runId, input }: {
14
14
  workflowId: string;
15
+ runId: string;
15
16
  input: any;
17
+ }) => Promise<void>;
18
+ createWorkflowRun: ({ workflowId, prevRunId }: {
19
+ workflowId: string;
20
+ prevRunId?: string;
16
21
  }) => Promise<{
17
22
  runId: string;
18
23
  }>;
@@ -32,6 +37,8 @@ export declare const useResumeWorkflow: (baseUrl: string) => {
32
37
  stepId: string;
33
38
  runId: string;
34
39
  context: any;
35
- }) => Promise<Record<string, any>>;
40
+ }) => Promise<{
41
+ message: string;
42
+ }>;
36
43
  isResumingWorkflow: boolean;
37
44
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
 
2
- export * from './chat-ui/chat';
3
2
  export * from './domains/agents/index';
4
3
  export * from './domains/workflows/index';
5
4
  export * from './domains/resizable-panel';