@mastra/playground-ui 0.0.1-alpha.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 (85) hide show
  1. package/LICENSE +44 -0
  2. package/dist/chat-ui/chat-items.d.ts +52 -0
  3. package/dist/chat-ui/chat-message.d.ts +30 -0
  4. package/dist/chat-ui/chat.d.ts +3 -0
  5. package/dist/chat-ui/copy-button.d.ts +7 -0
  6. package/dist/chat-ui/file-preview.d.ts +8 -0
  7. package/dist/chat-ui/hooks/use-auto-scroll.d.ts +7 -0
  8. package/dist/chat-ui/hooks/use-autosize-textarea.d.ts +8 -0
  9. package/dist/chat-ui/hooks/use-copy-to-clipboard.d.ts +10 -0
  10. package/dist/chat-ui/markdown-renderer.d.ts +88 -0
  11. package/dist/chat-ui/markdown.d.ts +4 -0
  12. package/dist/chat-ui/message-input.d.ts +22 -0
  13. package/dist/chat-ui/message-list.d.ts +11 -0
  14. package/dist/chat-ui/prompt-suggestions.d.ts +11 -0
  15. package/dist/chat-ui/syntax-highlighter.d.ts +1 -0
  16. package/dist/chat-ui/types.d.ts +14 -0
  17. package/dist/chat-ui/typing-indicator.d.ts +1 -0
  18. package/dist/components/assistant-ui/assistant-message.d.ts +3 -0
  19. package/dist/components/assistant-ui/assistant-modal.d.ts +3 -0
  20. package/dist/components/assistant-ui/assistant-sidebar.d.ts +3 -0
  21. package/dist/components/assistant-ui/attachment.d.ts +5 -0
  22. package/dist/components/assistant-ui/markdown-text.d.ts +2 -0
  23. package/dist/components/assistant-ui/syntax-highlighter.d.ts +1 -0
  24. package/dist/components/assistant-ui/thread-list.d.ts +3 -0
  25. package/dist/components/assistant-ui/thread.d.ts +5 -0
  26. package/dist/components/assistant-ui/tooltip-icon-button.d.ts +10 -0
  27. package/dist/components/assistant-ui/user-message.d.ts +3 -0
  28. package/dist/components/icons/agent-icon.d.ts +3 -0
  29. package/dist/components/icons/automation-icon.d.ts +3 -0
  30. package/dist/components/syntax-highlighter.d.ts +4 -0
  31. package/dist/components/ui/avatar.d.ts +6 -0
  32. package/dist/components/ui/badge.d.ts +10 -0
  33. package/dist/components/ui/button.d.ts +12 -0
  34. package/dist/components/ui/copyable-content.d.ts +7 -0
  35. package/dist/components/ui/data-table.d.ts +72 -0
  36. package/dist/components/ui/dialog.d.ts +19 -0
  37. package/dist/components/ui/formatted-date.d.ts +3 -0
  38. package/dist/components/ui/input.d.ts +12 -0
  39. package/dist/components/ui/resizable.d.ts +23 -0
  40. package/dist/components/ui/score-indicator.d.ts +3 -0
  41. package/dist/components/ui/scroll-area.d.ts +5 -0
  42. package/dist/components/ui/skeleton.d.ts +2 -0
  43. package/dist/components/ui/syntax-highlighter.d.ts +4 -0
  44. package/dist/components/ui/table.d.ts +10 -0
  45. package/dist/components/ui/tabs.d.ts +7 -0
  46. package/dist/components/ui/text.d.ts +13 -0
  47. package/dist/components/ui/tooltip.d.ts +7 -0
  48. package/dist/domains/agents/agent/agent-chat.d.ts +3 -0
  49. package/dist/domains/agents/agent/agent-evals.d.ts +4 -0
  50. package/dist/domains/agents/agent/agent-traces.d.ts +7 -0
  51. package/dist/domains/agents/agents-table.d.ts +8 -0
  52. package/dist/domains/agents/index.d.ts +4 -0
  53. package/dist/domains/traces/context/trace-context.d.ts +24 -0
  54. package/dist/domains/traces/index.d.ts +5 -0
  55. package/dist/domains/traces/mock-data.d.ts +1356 -0
  56. package/dist/domains/traces/trace-details.d.ts +1 -0
  57. package/dist/domains/traces/trace-span-details.d.ts +1 -0
  58. package/dist/domains/traces/trace-span-view.d.ts +8 -0
  59. package/dist/domains/traces/trace-tree-view.d.ts +6 -0
  60. package/dist/domains/traces/types.d.ts +49 -0
  61. package/dist/domains/traces/utils.d.ts +15 -0
  62. package/dist/domains/workflows/index.d.ts +3 -0
  63. package/dist/domains/workflows/workflow/utils.d.ts +22 -0
  64. package/dist/domains/workflows/workflow/workflow-condition-node.d.ts +7 -0
  65. package/dist/domains/workflows/workflow/workflow-default-node.d.ts +9 -0
  66. package/dist/domains/workflows/workflow/workflow-graph-inner.d.ts +5 -0
  67. package/dist/domains/workflows/workflow/workflow-graph.d.ts +4 -0
  68. package/dist/domains/workflows/workflow/workflow-traces.d.ts +7 -0
  69. package/dist/domains/workflows/workflows-table.d.ts +8 -0
  70. package/dist/hooks/use-evals.d.ts +19 -0
  71. package/dist/hooks/use-resize-column.d.ts +12 -0
  72. package/dist/hooks/use-traces.d.ts +9 -0
  73. package/dist/hooks/use-workflows.d.ts +6 -0
  74. package/dist/index.css +7 -0
  75. package/dist/index.d.ts +4 -0
  76. package/dist/index.es.js +6480 -0
  77. package/dist/index.es.js.map +1 -0
  78. package/dist/lib/pagination/types.d.ts +11 -0
  79. package/dist/lib/polls.d.ts +32 -0
  80. package/dist/lib/string.d.ts +1 -0
  81. package/dist/lib/utils.d.ts +3 -0
  82. package/dist/main.d.ts +1 -0
  83. package/dist/services/mastra-runtime-provider.d.ts +6 -0
  84. package/dist/types.d.ts +58 -0
  85. package/package.json +94 -0
@@ -0,0 +1 @@
1
+ export declare function TraceDetails(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function SpanDetail(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Span, SpanNode } from './types';
2
+
3
+ export declare function TreeView({ tree }: {
4
+ tree: SpanNode[];
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export default function SpanView({ trace }: {
7
+ trace: Span[];
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { SpanNode } from './types';
2
+
3
+ export declare function TreeNode({ node, depth }: {
4
+ node: SpanNode;
5
+ depth?: number;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,49 @@
1
+ export type SpanStatus = {
2
+ code: number;
3
+ };
4
+ export type SpanOther = {
5
+ droppedAttributesCount: number;
6
+ droppedEventsCount: number;
7
+ droppedLinksCount: number;
8
+ };
9
+ export type SpanEventAttributes = {
10
+ key: string;
11
+ value: {
12
+ [key: string]: string | number | boolean | null;
13
+ };
14
+ };
15
+ export type SpanEvent = {
16
+ attributes: SpanEventAttributes[];
17
+ name: string;
18
+ timeUnixNano: string;
19
+ droppedAttributesCount: number;
20
+ };
21
+ export type Span = {
22
+ id: string;
23
+ parentSpanId: string | null;
24
+ traceId: string;
25
+ name: string;
26
+ scope: string;
27
+ kind: number;
28
+ status: SpanStatus;
29
+ events: SpanEvent[];
30
+ links: any[];
31
+ attributes: Record<string, string | number | boolean | null>;
32
+ startTime: number;
33
+ endTime: number;
34
+ duration: number;
35
+ other: SpanOther;
36
+ createdAt: string;
37
+ };
38
+ export type SpanNode = Span & {
39
+ children: SpanNode[];
40
+ relativePercentage?: number;
41
+ };
42
+ export type RefinedTrace = {
43
+ traceId: string;
44
+ serviceName: string;
45
+ duration: number;
46
+ started: number;
47
+ status: SpanStatus;
48
+ trace: Span[];
49
+ };
@@ -0,0 +1,15 @@
1
+ import { RefinedTrace, Span } from './types';
2
+
3
+ /**
4
+ *
5
+ * @param duration duration of the span
6
+ * @param fixedPoint how many fixed point
7
+ * @returns duration in milliseconds in fixed points
8
+ */
9
+ export declare function formatDuration(duration: number, fixedPoint?: number): string;
10
+ export declare function formatOtelTimestamp(otelTimestamp: number): string;
11
+ export declare function formatOtelTimestamp2(otelTimestamp: number): string;
12
+ export declare function transformKey(key: string): string[] | "Input" | "Output";
13
+ export declare function cleanString(string: string): string;
14
+ export declare const refineTraces: (traces: Span[], isWorkflow?: boolean) => RefinedTrace[];
15
+ export declare const allowedAiSpanAttributes: string[];
@@ -0,0 +1,3 @@
1
+ export * from './workflow/workflow-traces';
2
+ export * from './workflow/workflow-graph';
3
+ export * from './workflows-table';
@@ -0,0 +1,22 @@
1
+ import { StepCondition } from '@mastra/core/workflows';
2
+ import { Node, Edge } from '@xyflow/react';
3
+
4
+ export type Condition = {
5
+ ref: {
6
+ step: {
7
+ id: string;
8
+ } | 'trigger';
9
+ path: string;
10
+ };
11
+ query: Record<string, any>;
12
+ conj?: 'and' | 'or';
13
+ };
14
+ export declare const pathAlphabet: string[];
15
+ export declare function extractConditions(group?: StepCondition<any, any>): Condition[];
16
+ export declare const contructNodesAndEdges: ({ stepGraph, stepSubscriberGraph, }: {
17
+ stepGraph: any;
18
+ stepSubscriberGraph: any;
19
+ }) => {
20
+ nodes: Node[];
21
+ edges: Edge[];
22
+ };
@@ -0,0 +1,7 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+ import { Condition } from './utils';
3
+
4
+ export type ConditionNode = Node<{
5
+ conditions: Condition[];
6
+ }, 'condition-node'>;
7
+ export declare function WorkflowConditionNode({ data }: NodeProps<ConditionNode>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+
3
+ export type DefaultNode = Node<{
4
+ label: string;
5
+ description?: string;
6
+ withoutTopHandle?: boolean;
7
+ withoutBottomHandle?: boolean;
8
+ }, 'default-node'>;
9
+ export declare function WorkflowDefaultNode({ data }: NodeProps<DefaultNode>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Workflow } from '@mastra/core/workflows';
2
+
3
+ export declare function WorkflowGraphInner({ workflow }: {
4
+ workflow: Workflow;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function WorkflowGraph({ workflowId, baseUrl }: {
2
+ workflowId: string;
3
+ baseUrl: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from '../../../../node_modules/@types/react';
2
+
3
+ export declare function WorkflowTraces({ workflowName, baseUrl, sidebarChild, }: {
4
+ workflowName: string;
5
+ baseUrl: string;
6
+ sidebarChild: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+
3
+ export declare const WorkflowsTable: ({ title, workflowsList, columns, isLoading, }: {
4
+ title?: React.ReactNode;
5
+ workflowsList: any[];
6
+ columns: ColumnDef<any>[];
7
+ isLoading?: boolean;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { TestInfo, MetricResult } from '@mastra/core/eval';
2
+
3
+ export type Evals = {
4
+ input: string;
5
+ output: string;
6
+ result: MetricResult;
7
+ agentName: string;
8
+ createdAt: string;
9
+ metricName: string;
10
+ instructions: string;
11
+ runId: string;
12
+ globalRunId: string;
13
+ testInfo?: TestInfo;
14
+ };
15
+ export declare const useEvalsByAgentId: (agentId: string, type: "ci" | "live", baseUrl?: string) => {
16
+ evals: Evals[];
17
+ isLoading: boolean;
18
+ refetchEvals: (_agentId?: string) => Promise<void>;
19
+ };
@@ -0,0 +1,12 @@
1
+ import { MouseEvent as ReactMouseEvent } from '../../node_modules/@types/react';
2
+
3
+ export declare const useResizeColumn: ({ defaultWidth, minimumWidth, maximumWidth, }: {
4
+ defaultWidth: number;
5
+ minimumWidth: number;
6
+ maximumWidth: number;
7
+ }) => {
8
+ sidebarWidth: number;
9
+ isDragging: boolean;
10
+ handleMouseDown: (e: ReactMouseEvent) => void;
11
+ containerRef: import('../../node_modules/@types/react').RefObject<HTMLDivElement | null>;
12
+ };
@@ -0,0 +1,9 @@
1
+ import { RefinedTrace } from '../domains/traces/types';
2
+
3
+ export declare const useTraces: (componentName: string, baseUrl: string, isWorkflow?: boolean) => {
4
+ traces: RefinedTrace[] | null;
5
+ firstCallLoading: boolean;
6
+ error: {
7
+ message: string;
8
+ } | null;
9
+ };
@@ -0,0 +1,6 @@
1
+ import { Workflow } from '@mastra/core/workflows';
2
+
3
+ export declare const useWorkflow: (workflowId: string, baseUrl: string) => {
4
+ workflow: Workflow<any, any> | null;
5
+ isLoading: boolean;
6
+ };
package/dist/index.css ADDED
@@ -0,0 +1,7 @@
1
+ .thread-viewport > [data-radix-scroll-area-content] {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ align-self: stretch;
6
+ background-color: inherit
7
+ }
@@ -0,0 +1,4 @@
1
+
2
+ export * from './chat-ui/chat';
3
+ export * from './domains/agents/index';
4
+ export * from './domains/workflows/index';