@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,11 @@
1
+ export type PaginationParams = {
2
+ limit?: number;
3
+ offset?: number;
4
+ duration?: number;
5
+ };
6
+ export type PaginationResult = {
7
+ total: number;
8
+ offset: number;
9
+ limit: number;
10
+ hasMore: boolean;
11
+ };
@@ -0,0 +1,32 @@
1
+ export interface PollingOptions<TData, TError = Error> {
2
+ /** Async function that fetches the data */
3
+ fetchFn: () => Promise<TData>;
4
+ /** Polling interval in milliseconds */
5
+ interval?: number;
6
+ /** Whether polling is enabled initially */
7
+ enabled?: boolean;
8
+ /** Callback function called with new data */
9
+ onSuccess?: (data: TData) => void;
10
+ /** Callback function called on error */
11
+ onError?: (error: TError) => void;
12
+ /** Function to determine if polling should continue */
13
+ shouldContinue?: (data: TData) => boolean;
14
+ }
15
+ export interface PollingResult<TData, TError> {
16
+ /** Current polling status */
17
+ isPolling: boolean;
18
+ /** Loading state for current request */
19
+ isLoading: boolean;
20
+ /** Loading state for first call */
21
+ firstCallLoading: boolean;
22
+ /** Current error state */
23
+ error: TError | null;
24
+ /** Latest data received */
25
+ data: TData | null;
26
+ /** Function to start polling */
27
+ startPolling: () => void;
28
+ /** Function to stop polling */
29
+ stopPolling: () => void;
30
+ }
31
+ export declare function usePolling<TData, TError = Error>({ fetchFn, interval, enabled, onSuccess, onError, shouldContinue, }: PollingOptions<TData, TError>): PollingResult<TData, TError>;
32
+ export default usePolling;
@@ -0,0 +1 @@
1
+ export declare const lodashTitleCase: (str: string) => string;
@@ -0,0 +1,3 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ export declare function cn(...inputs: ClassValue[]): string;
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from '../../node_modules/@types/react';
2
+ import { ChatProps } from '../types';
3
+
4
+ export declare function MastraRuntimeProvider({ children, agentId, initialMessages, agentName, memory, threadId, baseUrl, refreshThreadList, }: Readonly<{
5
+ children: ReactNode;
6
+ }> & ChatProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,58 @@
1
+ export interface Message {
2
+ id: string;
3
+ role: 'user' | 'assistant';
4
+ content: any;
5
+ isError?: boolean;
6
+ }
7
+ export interface ChatProps {
8
+ agentId: string;
9
+ agentName?: string;
10
+ threadId?: string;
11
+ initialMessages?: Message[];
12
+ memory?: boolean;
13
+ baseUrl?: string;
14
+ refreshThreadList?: () => void;
15
+ }
16
+ export type SpanStatus = {
17
+ code: number;
18
+ };
19
+ export type SpanOther = {
20
+ droppedAttributesCount: number;
21
+ droppedEventsCount: number;
22
+ droppedLinksCount: number;
23
+ };
24
+ export type SpanEvent = {
25
+ attributes: Record<string, string | number | boolean | null>[];
26
+ name: string;
27
+ timeUnixNano: string;
28
+ droppedAttributesCount: number;
29
+ };
30
+ export type Span = {
31
+ id: string;
32
+ parentSpanId: string | null;
33
+ traceId: string;
34
+ name: string;
35
+ scope: string;
36
+ kind: number;
37
+ status: SpanStatus;
38
+ events: SpanEvent[];
39
+ links: any[];
40
+ attributes: Record<string, string | number | boolean | null>;
41
+ startTime: number;
42
+ endTime: number;
43
+ duration: number;
44
+ other: SpanOther;
45
+ createdAt: string;
46
+ };
47
+ export type SpanNode = Span & {
48
+ children: SpanNode[];
49
+ relativePercentage?: number;
50
+ };
51
+ export type RefinedTrace = {
52
+ traceId: string;
53
+ serviceName: string;
54
+ duration: number;
55
+ started: number;
56
+ status: SpanStatus;
57
+ trace: Span[];
58
+ };
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "@mastra/playground-ui",
3
+ "type": "module",
4
+ "version": "0.0.1-alpha.2",
5
+ "description": "Mastra Playground components",
6
+ "main": "dist/index.umd.js",
7
+ "module": "dist/index.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.es.js"
16
+ },
17
+ "./style.css": "./dist/style.css"
18
+ },
19
+ "keywords": [
20
+ "mastra",
21
+ "playground",
22
+ "components"
23
+ ],
24
+ "author": "Mastra",
25
+ "license": "ISC",
26
+ "dependencies": {
27
+ "@assistant-ui/react": "^0.7.90",
28
+ "@assistant-ui/react-markdown": "^0.7.21",
29
+ "@assistant-ui/react-syntax-highlighter": "^0.7.10",
30
+ "@codemirror/lang-json": "^6.0.1",
31
+ "@dagrejs/dagre": "^1.1.4",
32
+ "@lezer/highlight": "^1.2.1",
33
+ "@radix-ui/react-avatar": "^1.1.3",
34
+ "@radix-ui/react-dialog": "^1.1.2",
35
+ "@radix-ui/react-scroll-area": "^1.2.3",
36
+ "@radix-ui/react-slot": "^1.1.2",
37
+ "@radix-ui/react-tabs": "^1.1.2",
38
+ "@radix-ui/react-tooltip": "^1.1.8",
39
+ "@tanstack/react-table": "^8.21.2",
40
+ "@types/react-syntax-highlighter": "^15.5.13",
41
+ "@uiw/codemirror-theme-github": "^4.23.8",
42
+ "@uiw/react-codemirror": "^4.23.8",
43
+ "@xyflow/react": "^12.3.6",
44
+ "date-fns": "^4.1.0",
45
+ "motion": "^12.4.2",
46
+ "prism-react-renderer": "^2.4.0",
47
+ "rehype-stringify": "^10.0.1",
48
+ "remark-gfm": "^4.0.1",
49
+ "remark-parse": "^11.0.0",
50
+ "remark-rehype": "^11.1.1",
51
+ "react-markdown": "^9.0.1",
52
+ "react-resizable-panels": "^2.1.7",
53
+ "react-syntax-highlighter": "^15.6.1",
54
+ "remeda": "^2.20.1",
55
+ "shiki": "^1.24.2",
56
+ "sonner": "^2.0.1",
57
+ "swr": "^2.2.5",
58
+ "tailwindcss-animate": "^1.0.7",
59
+ "unified": "^11.0.5",
60
+ "zustand": "^5.0.3",
61
+ "@mastra/client-js": "^0.1.5-alpha.3"
62
+ },
63
+ "peerDependencies": {
64
+ "lucide-react": "^0.474.0",
65
+ "react": ">=19.0.0",
66
+ "react-dom": ">=19.0.0",
67
+ "tailwindcss": "^3.0.0",
68
+ "@mastra/core": "^0.4.3-alpha.3"
69
+ },
70
+ "devDependencies": {
71
+ "@types/node": "^22.13.1",
72
+ "@types/react": "^19",
73
+ "@types/react-dom": "^19",
74
+ "@vitejs/plugin-react": "^4.2.1",
75
+ "autoprefixer": "^10.4.20",
76
+ "class-variance-authority": "^0.7.1",
77
+ "clsx": "^2.1.1",
78
+ "postcss": "^8.0.0",
79
+ "rollup-plugin-node-externals": "^8.0.0",
80
+ "tailwind-merge": "^3.0.1",
81
+ "tailwindcss": "^3.0.0",
82
+ "typescript": "^5.7.3",
83
+ "vite": "^5.0.0",
84
+ "vite-plugin-dts": "^3.7.0",
85
+ "vite-plugin-lib-inject-css": "^2.2.1"
86
+ },
87
+ "scripts": {
88
+ "dev": "vite",
89
+ "build": "tsc && vite build",
90
+ "build:watch": "vite build --watch",
91
+ "build:publish": "pnpm build && yalc push",
92
+ "preview": "vite preview"
93
+ }
94
+ }