@app-studio/web 0.9.39 → 0.9.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bot/Bot.d.ts +15 -0
- package/dist/bot/Cache.d.ts +13 -0
- package/dist/bot/Config.d.ts +13 -0
- package/dist/bot/ContentFetcher.d.ts +9 -0
- package/dist/bot/DocuCode.d.ts +19 -0
- package/dist/bot/FileHandler.d.ts +39 -0
- package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
- package/dist/bot/ai/GeminiConnector.d.ts +7 -0
- package/dist/bot/ai/GroqConnector.d.ts +7 -0
- package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
- package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
- package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
- package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
- package/dist/bot/ai/ai.config.d.ts +12 -0
- package/dist/bot/ai/ai.service.d.ts +36 -0
- package/dist/bot/data.d.ts +19 -0
- package/dist/bot/extractors.d.ts +8 -0
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/prompt/1-project.d.ts +1 -0
- package/dist/bot/prompt/2-response.d.ts +1 -0
- package/dist/bot/prompt/3-comment.d.ts +1 -0
- package/docs/components/Accordion.mdx +74 -121
- package/docs/components/Alert.mdx +18 -69
- package/docs/components/AspectRatio.mdx +11 -9
- package/docs/components/AudioInput.mdx +43 -0
- package/docs/components/Avatar.mdx +17 -42
- package/docs/components/Background.mdx +99 -491
- package/docs/components/Badge.mdx +37 -122
- package/docs/components/Button.mdx +71 -123
- package/docs/components/Calendar.mdx +7 -7
- package/docs/components/Card.mdx +238 -281
- package/docs/components/Carousel.mdx +88 -315
- package/docs/components/Center.mdx +22 -22
- package/docs/components/Chart.mdx +171 -26
- package/docs/components/ChatInput.mdx +327 -275
- package/docs/components/Checkbox.mdx +3 -5
- package/docs/components/ColorInput.mdx +10 -10
- package/docs/components/ColorPicker.mdx +452 -0
- package/docs/components/ComboBox.mdx +14 -14
- package/docs/components/Command.mdx +140 -188
- package/docs/components/ContextMenu.mdx +47 -171
- package/docs/components/CookieConsent.mdx +53 -0
- package/docs/components/CountryPicker.mdx +10 -10
- package/docs/components/DatePicker.mdx +4 -4
- package/docs/components/DragAndDrop.mdx +279 -463
- package/docs/components/Drawer.mdx +401 -100
- package/docs/components/DropdownMenu.mdx +37 -155
- package/docs/components/EmojiPicker.mdx +84 -0
- package/docs/components/File.mdx +130 -4
- package/docs/components/Flow.mdx +3 -3
- package/docs/components/Form.mdx +4 -4
- package/docs/components/Formik.mdx +41 -41
- package/docs/components/Gradient.mdx +355 -178
- package/docs/components/Horizontal.mdx +1 -2
- package/docs/components/HoverCard.mdx +57 -125
- package/docs/components/Icon.mdx +10 -10
- package/docs/components/KanbanBoard.mdx +12 -12
- package/docs/components/Label.mdx +8 -8
- package/docs/components/Link.mdx +19 -27
- package/docs/components/Loader.mdx +224 -407
- package/docs/components/Menubar.mdx +71 -67
- package/docs/components/Message.mdx +211 -526
- package/docs/components/Modal.mdx +351 -475
- package/docs/components/NavigationMenu.mdx +8 -8
- package/docs/components/OTPInput.mdx +194 -0
- package/docs/components/Pagination.mdx +451 -107
- package/docs/components/Password.mdx +8 -8
- package/docs/components/ProgressBar.mdx +460 -0
- package/docs/components/Resizable.mdx +103 -102
- package/docs/components/Select.mdx +5 -5
- package/docs/components/Separator.mdx +11 -98
- package/docs/components/ShareButton.mdx +29 -0
- package/docs/components/Sidebar.mdx +70 -131
- package/docs/components/Slider.mdx +99 -185
- package/docs/components/StatusIndicator.mdx +373 -0
- package/docs/components/Switch.mdx +3 -3
- package/docs/components/Table.mdx +25 -105
- package/docs/components/Tabs.mdx +40 -143
- package/docs/components/TagInput.mdx +32 -32
- package/docs/components/Text.mdx +3 -3
- package/docs/components/TextArea.mdx +9 -9
- package/docs/components/TextField.mdx +17 -17
- package/docs/components/Title.mdx +267 -525
- package/docs/components/Toast.mdx +65 -142
- package/docs/components/Toggle.mdx +34 -46
- package/docs/components/ToggleGroup.mdx +29 -50
- package/docs/components/Tooltip.mdx +500 -137
- package/docs/components/Tree.mdx +4 -4
- package/docs/components/Uploader.mdx +205 -351
- package/docs/components/Vertical.mdx +22 -22
- package/package.json +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
- package/dist/components/AuthGuard/index.d.ts +0 -1
- package/docs/adk-components.md +0 -319
- package/docs/adk-quick-start.md +0 -268
|
@@ -6,14 +6,14 @@ A flexible layout component that arranges its children in a vertical stack using
|
|
|
6
6
|
```tsx
|
|
7
7
|
import { Vertical } from '@app-studio/web';
|
|
8
8
|
// or from app-studio
|
|
9
|
-
import { Vertical } from 'app-studio';
|
|
9
|
+
import { Vertical } from '@app-studio/web';
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
### **Basic Usage**
|
|
13
13
|
```tsx
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import { Vertical } from 'app-studio';
|
|
16
|
-
import { View, Text } from 'app-studio';
|
|
15
|
+
import { Vertical } from '@app-studio/web';
|
|
16
|
+
import { View, Text } from '@app-studio/web';
|
|
17
17
|
|
|
18
18
|
export const BasicVertical = () => (
|
|
19
19
|
<Vertical>
|
|
@@ -27,8 +27,8 @@ export const BasicVertical = () => (
|
|
|
27
27
|
### **With Gap Spacing**
|
|
28
28
|
```tsx
|
|
29
29
|
import React from 'react';
|
|
30
|
-
import { Vertical } from 'app-studio';
|
|
31
|
-
import { View, Text } from 'app-studio';
|
|
30
|
+
import { Vertical } from '@app-studio/web';
|
|
31
|
+
import { View, Text } from '@app-studio/web';
|
|
32
32
|
|
|
33
33
|
export const VerticalWithGap = () => (
|
|
34
34
|
<Vertical gap={16}>
|
|
@@ -48,8 +48,8 @@ export const VerticalWithGap = () => (
|
|
|
48
48
|
### **Alignment Options**
|
|
49
49
|
```tsx
|
|
50
50
|
import React from 'react';
|
|
51
|
-
import { Vertical } from 'app-studio';
|
|
52
|
-
import { View, Text } from 'app-studio';
|
|
51
|
+
import { Vertical } from '@app-studio/web';
|
|
52
|
+
import { View, Text } from '@app-studio/web';
|
|
53
53
|
|
|
54
54
|
export const VerticalAlignment = () => (
|
|
55
55
|
<Vertical gap={20}>
|
|
@@ -91,8 +91,8 @@ export const VerticalAlignment = () => (
|
|
|
91
91
|
### **Justification Options**
|
|
92
92
|
```tsx
|
|
93
93
|
import React from 'react';
|
|
94
|
-
import { Vertical } from 'app-studio';
|
|
95
|
-
import { View, Text } from 'app-studio';
|
|
94
|
+
import { Vertical } from '@app-studio/web';
|
|
95
|
+
import { View, Text } from '@app-studio/web';
|
|
96
96
|
|
|
97
97
|
export const VerticalJustification = () => (
|
|
98
98
|
<Vertical gap={20}>
|
|
@@ -138,9 +138,9 @@ export const VerticalJustification = () => (
|
|
|
138
138
|
### **Form Layout Example**
|
|
139
139
|
```tsx
|
|
140
140
|
import React from 'react';
|
|
141
|
-
import { Vertical } from 'app-studio';
|
|
141
|
+
import { Vertical } from '@app-studio/web';
|
|
142
142
|
import { TextField, Button, Checkbox } from '@app-studio/web';
|
|
143
|
-
import { Text } from 'app-studio';
|
|
143
|
+
import { Text } from '@app-studio/web';
|
|
144
144
|
|
|
145
145
|
export const FormLayout = () => (
|
|
146
146
|
<Vertical gap={20} width="100%" maxWidth={400} padding={24}>
|
|
@@ -188,8 +188,8 @@ export const FormLayout = () => (
|
|
|
188
188
|
### **Navigation Menu Example**
|
|
189
189
|
```tsx
|
|
190
190
|
import React from 'react';
|
|
191
|
-
import { Vertical } from 'app-studio';
|
|
192
|
-
import { View, Text, Horizontal } from 'app-studio';
|
|
191
|
+
import { Vertical } from '@app-studio/web';
|
|
192
|
+
import { View, Text, Horizontal } from '@app-studio/web';
|
|
193
193
|
import { HomeIcon, UserIcon, SettingsIcon, LogoutIcon } from '@app-studio/web';
|
|
194
194
|
|
|
195
195
|
export const NavigationMenu = () => (
|
|
@@ -261,8 +261,8 @@ export const NavigationMenu = () => (
|
|
|
261
261
|
### **Card Layout Example**
|
|
262
262
|
```tsx
|
|
263
263
|
import React from 'react';
|
|
264
|
-
import { Vertical } from 'app-studio';
|
|
265
|
-
import { View, Text, Horizontal } from 'app-studio';
|
|
264
|
+
import { Vertical } from '@app-studio/web';
|
|
265
|
+
import { View, Text, Horizontal } from '@app-studio/web';
|
|
266
266
|
import { Button } from '@app-studio/web';
|
|
267
267
|
import { StarIcon, HeartIcon, ShareIcon } from '@app-studio/web';
|
|
268
268
|
|
|
@@ -344,8 +344,8 @@ The Vertical component extends ViewProps from app-studio, inheriting all standar
|
|
|
344
344
|
### **Responsive Design**
|
|
345
345
|
```tsx
|
|
346
346
|
import React from 'react';
|
|
347
|
-
import { Vertical } from 'app-studio';
|
|
348
|
-
import { View, Text } from 'app-studio';
|
|
347
|
+
import { Vertical } from '@app-studio/web';
|
|
348
|
+
import { View, Text } from '@app-studio/web';
|
|
349
349
|
|
|
350
350
|
export const ResponsiveVertical = () => (
|
|
351
351
|
<Vertical
|
|
@@ -377,8 +377,8 @@ export const ResponsiveVertical = () => (
|
|
|
377
377
|
**Sticky Header with Scrollable Content:**
|
|
378
378
|
```tsx
|
|
379
379
|
import React from 'react';
|
|
380
|
-
import { Vertical } from 'app-studio';
|
|
381
|
-
import { View, Text } from 'app-studio';
|
|
380
|
+
import { Vertical } from '@app-studio/web';
|
|
381
|
+
import { View, Text } from '@app-studio/web';
|
|
382
382
|
|
|
383
383
|
export const StickyHeaderLayout = () => (
|
|
384
384
|
<Vertical height="100vh">
|
|
@@ -417,8 +417,8 @@ export const StickyHeaderLayout = () => (
|
|
|
417
417
|
**Split Layout:**
|
|
418
418
|
```tsx
|
|
419
419
|
import React from 'react';
|
|
420
|
-
import { Vertical, Horizontal } from 'app-studio';
|
|
421
|
-
import { View, Text } from 'app-studio';
|
|
420
|
+
import { Vertical, Horizontal } from '@app-studio/web';
|
|
421
|
+
import { View, Text } from '@app-studio/web';
|
|
422
422
|
|
|
423
423
|
export const SplitLayout = () => (
|
|
424
424
|
<Horizontal height="100vh">
|
|
@@ -544,7 +544,7 @@ export const SplitLayout = () => (
|
|
|
544
544
|
The Vertical component works seamlessly with other layout components:
|
|
545
545
|
|
|
546
546
|
```tsx
|
|
547
|
-
import { Vertical, Horizontal, Center } from 'app-studio';
|
|
547
|
+
import { Vertical, Horizontal, Center } from '@app-studio/web';
|
|
548
548
|
|
|
549
549
|
// Nested layouts
|
|
550
550
|
<Vertical gap={20}>
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Authentication guard props
|
|
4
|
-
*/
|
|
5
|
-
interface AuthGuardProps {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
fallback?: ReactNode;
|
|
8
|
-
requireAuth?: boolean;
|
|
9
|
-
autoLogin?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Authentication guard component
|
|
13
|
-
*
|
|
14
|
-
* Protects routes by checking authentication status and auto-logging in for ADK pages
|
|
15
|
-
*/
|
|
16
|
-
export declare const AuthGuard: React.FC<AuthGuardProps>;
|
|
17
|
-
/**
|
|
18
|
-
* HOC for protecting components with authentication
|
|
19
|
-
*/
|
|
20
|
-
export declare const withAuthGuard: <P extends object>(Component: React.ComponentType<P>, options?: {
|
|
21
|
-
requireAuth?: boolean | undefined;
|
|
22
|
-
fallback?: ReactNode;
|
|
23
|
-
} | undefined) => React.FC<P>;
|
|
24
|
-
/**
|
|
25
|
-
* Route-based authentication guard
|
|
26
|
-
* Automatically determines if auth is required based on the current path
|
|
27
|
-
*/
|
|
28
|
-
export declare const RouteAuthGuard: React.FC<{
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* Authentication status indicator component
|
|
33
|
-
*/
|
|
34
|
-
export declare const AuthStatus: React.FC;
|
|
35
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AuthGuard, withAuthGuard, RouteAuthGuard, AuthStatus, } from './AuthGuard';
|
package/docs/adk-components.md
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
# ADK Agent Components
|
|
2
|
-
|
|
3
|
-
This document provides an overview of the React components created for compatibility with the ADK (Agent Development Kit) system.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The ADK Agent Components are a collection of React components designed to work seamlessly with ADK agents. These components are self-contained, handling their own state and API communications, providing a complete interface for agent interaction, session management, and more.
|
|
8
|
-
|
|
9
|
-
## Components
|
|
10
|
-
|
|
11
|
-
### 1. AgentChat Component
|
|
12
|
-
|
|
13
|
-
**Location**: `src/components/adk/AgentChat/`
|
|
14
|
-
|
|
15
|
-
A comprehensive chat interface for interacting with ADK agents.
|
|
16
|
-
|
|
17
|
-
#### Key Features:
|
|
18
|
-
- ✅ Real-time messaging via Server-Sent Events (SSE)
|
|
19
|
-
- ✅ File upload support (images, videos, audio, documents)
|
|
20
|
-
- ✅ Audio recording with live waveform visualization
|
|
21
|
-
- ✅ Function call visualization and execution
|
|
22
|
-
- ✅ Code execution and result display
|
|
23
|
-
- ✅ Agent thought process visualization
|
|
24
|
-
- ✅ Evaluation and scoring support
|
|
25
|
-
- ✅ Streaming and non-streaming responses
|
|
26
|
-
- ✅ Fully customizable styling and theming
|
|
27
|
-
- ✅ Accessibility-first design
|
|
28
|
-
|
|
29
|
-
#### Usage:
|
|
30
|
-
```tsx
|
|
31
|
-
import { AgentChat } from '@app-studio/web';
|
|
32
|
-
|
|
33
|
-
<AgentChat
|
|
34
|
-
appName="my-agent"
|
|
35
|
-
userId="user123"
|
|
36
|
-
apiBaseUrl="https://your-adk-api.com"
|
|
37
|
-
enableFileUpload={true}
|
|
38
|
-
enableAudioRecording={true}
|
|
39
|
-
enableStreaming={true}
|
|
40
|
-
enableThoughts={true}
|
|
41
|
-
onSessionCreate={(session) => console.log('Session created:', session)}
|
|
42
|
-
onMessageSent={(message) => console.log('Message sent:', message)}
|
|
43
|
-
/>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
#### Props:
|
|
47
|
-
- `appName` (required): Name of the ADK agent application.
|
|
48
|
-
- `userId` (required): Unique identifier for the user.
|
|
49
|
-
- `sessionId`: Existing session ID to resume.
|
|
50
|
-
- `apiBaseUrl`: Base URL for ADK API endpoints.
|
|
51
|
-
- `enableFileUpload`: Enable file attachment functionality.
|
|
52
|
-
- `enableAudioRecording`: Enable audio recording from the microphone.
|
|
53
|
-
- `enableStreaming`: Enable real-time streaming responses.
|
|
54
|
-
- `enableThoughts`: Show agent thought processes.
|
|
55
|
-
- `views`: Custom styling options.
|
|
56
|
-
|
|
57
|
-
### 2. AgentSession Component
|
|
58
|
-
|
|
59
|
-
**Location**: `src/components/adk/AgentSession/`
|
|
60
|
-
|
|
61
|
-
A comprehensive session management component for ADK agents.
|
|
62
|
-
|
|
63
|
-
#### Key Features:
|
|
64
|
-
- ✅ Session creation, listing, and selection
|
|
65
|
-
- ✅ Session deletion and management
|
|
66
|
-
- ✅ Import/export functionality
|
|
67
|
-
- ✅ Search and filtering capabilities
|
|
68
|
-
- ✅ Auto-refresh and real-time updates
|
|
69
|
-
- ✅ Session metadata and tagging
|
|
70
|
-
- ✅ Compact and full display modes
|
|
71
|
-
- ✅ Bulk operations support
|
|
72
|
-
|
|
73
|
-
#### Usage:
|
|
74
|
-
```tsx
|
|
75
|
-
import { AgentSession } from '@app-studio/web';
|
|
76
|
-
|
|
77
|
-
<AgentSession
|
|
78
|
-
appName="my-agent"
|
|
79
|
-
userId="user123"
|
|
80
|
-
apiBaseUrl="https://your-adk-api.com"
|
|
81
|
-
showSessionHistory={true}
|
|
82
|
-
enableSessionImport={true}
|
|
83
|
-
enableSessionExport={true}
|
|
84
|
-
onSessionSelect={(session) => console.log('Selected:', session)}
|
|
85
|
-
onSessionCreate={(session) => console.log('Created:', session)}
|
|
86
|
-
/>
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
#### Props:
|
|
90
|
-
- `appName` (required): Name of the ADK agent application.
|
|
91
|
-
- `userId` (required): Unique identifier for the user.
|
|
92
|
-
- `apiBaseUrl`: Base URL for ADK API endpoints.
|
|
93
|
-
- `showSessionHistory`: Show session history list.
|
|
94
|
-
- `enableSessionImport`: Enable session import from JSON.
|
|
95
|
-
- `enableSessionExport`: Enable session export to JSON.
|
|
96
|
-
- `enableSessionSearch`: Enable search functionality.
|
|
97
|
-
- `maxSessions`: Maximum number of sessions to display.
|
|
98
|
-
- `views`: Custom styling options.
|
|
99
|
-
|
|
100
|
-
## Architecture
|
|
101
|
-
|
|
102
|
-
### Component Structure
|
|
103
|
-
|
|
104
|
-
Each component follows the established app-studio pattern:
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
ComponentName/
|
|
108
|
-
├── ComponentName.tsx # Main component file
|
|
109
|
-
├── ComponentName/ # Inner folder for core files
|
|
110
|
-
│ ├── ComponentName.props.ts # Props interface definitions
|
|
111
|
-
│ ├── ComponentName.state.ts # Custom state hook
|
|
112
|
-
│ ├── ComponentName.view.tsx # Presentational component
|
|
113
|
-
│ ├── ComponentName.style.ts # Style constants
|
|
114
|
-
│ └── [SupportingComponents].tsx # Additional components
|
|
115
|
-
└── examples/ # Usage examples
|
|
116
|
-
└── default.tsx # Default usage examples
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### ADK Integration
|
|
120
|
-
|
|
121
|
-
The components are self-contained and integrate directly with an ADK backend using `fetch`. You can specify the backend URL via the `apiBaseUrl` prop.
|
|
122
|
-
|
|
123
|
-
#### Required Backend Endpoints:
|
|
124
|
-
- `POST /sessions` - Create new agent session
|
|
125
|
-
- `POST /run_sse` - Send message with streaming response
|
|
126
|
-
- `POST /run` - Send message with regular response
|
|
127
|
-
- `GET /sessions/:id` - Get session details
|
|
128
|
-
- `DELETE /sessions/:id` - Delete session
|
|
129
|
-
- `POST /sessions/import` - Import session
|
|
130
|
-
|
|
131
|
-
#### Message Format:
|
|
132
|
-
The components use the same message format as the original ADK system:
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
interface AgentRunRequest {
|
|
136
|
-
appName: string;
|
|
137
|
-
userId: string;
|
|
138
|
-
sessionId: string;
|
|
139
|
-
newMessage: {
|
|
140
|
-
role: string;
|
|
141
|
-
parts: MessagePart[];
|
|
142
|
-
};
|
|
143
|
-
streaming?: boolean;
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Direct API Interaction (`useAdk` Hook)
|
|
148
|
-
For developers who need to interact with the ADK API without using the pre-built UI components, a `useAdk` hook is available. This hook provides functions for all core ADK operations like creating sessions, running agents, and managing responses.
|
|
149
|
-
|
|
150
|
-
**Location**: `src/components/adk/useAdk.ts`
|
|
151
|
-
|
|
152
|
-
```tsx
|
|
153
|
-
import { useAdk } from '@app-studio/web';
|
|
154
|
-
|
|
155
|
-
const { createSession, runAgent, sessions, isLoadingSessions } = useAdk();
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Design System Compliance
|
|
159
|
-
|
|
160
|
-
All components follow the app-studio design system:
|
|
161
|
-
|
|
162
|
-
- **Typography**: Inter/Geist font family with standardized sizes (xs:10, sm:12, md:14, lg:16, xl:20)
|
|
163
|
-
- **Spacing**: 4px grid system for consistent spacing
|
|
164
|
-
- **Colors**: app-studio color system (color.[color].[number]) instead of hardcoded values
|
|
165
|
-
- **Shapes**: Consistent border radius and rounded corners
|
|
166
|
-
- **Animations**: Using app-studio Animation object with proper duration and timing
|
|
167
|
-
|
|
168
|
-
### Reusability
|
|
169
|
-
|
|
170
|
-
The components are designed to be:
|
|
171
|
-
|
|
172
|
-
- **Modular**: Each component can be used independently
|
|
173
|
-
- **Customizable**: Extensive styling options via the `views` prop
|
|
174
|
-
- **Accessible**: ARIA labels, keyboard navigation, and screen reader support
|
|
175
|
-
- **Responsive**: Works across mobile, tablet, and desktop breakpoints
|
|
176
|
-
- **Themeable**: Support for light/dark themes and custom color schemes
|
|
177
|
-
|
|
178
|
-
## Examples and Documentation
|
|
179
|
-
|
|
180
|
-
### Demo Pages
|
|
181
|
-
|
|
182
|
-
- **AgentChat Demo**: `src/pages/agentChat.page.tsx`
|
|
183
|
-
- **Component Examples**: Available in each component's `examples/` directory
|
|
184
|
-
|
|
185
|
-
### Usage Examples
|
|
186
|
-
|
|
187
|
-
Each component includes multiple usage examples:
|
|
188
|
-
|
|
189
|
-
1. **Default Usage**: Basic implementation with minimal configuration
|
|
190
|
-
2. **Minimal Usage**: Simplest possible setup
|
|
191
|
-
3. **Customized Usage**: Advanced styling and configuration options
|
|
192
|
-
4. **Feature Demos**: Showcasing specific features like function calls, file uploads, etc.
|
|
193
|
-
|
|
194
|
-
## Integration Guide
|
|
195
|
-
|
|
196
|
-
### 1. Installation
|
|
197
|
-
|
|
198
|
-
The components are part of the app-studio component library and can be imported directly:
|
|
199
|
-
|
|
200
|
-
```tsx
|
|
201
|
-
import { AgentChat, AgentSession } from '@app-studio/web';
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### 2. Backend Setup
|
|
205
|
-
|
|
206
|
-
Ensure your ADK backend provides the required endpoints and follows the expected API format.
|
|
207
|
-
|
|
208
|
-
### 3. Basic Implementation
|
|
209
|
-
|
|
210
|
-
```tsx
|
|
211
|
-
import React from 'react';
|
|
212
|
-
import { AgentChat, AgentSession } from '@app-studio/web';
|
|
213
|
-
import { View, Horizontal } from 'app-studio';
|
|
214
|
-
|
|
215
|
-
const MyAgentApp = () => {
|
|
216
|
-
return (
|
|
217
|
-
<View height="100vh" padding={20}>
|
|
218
|
-
<Horizontal gap={20} height="100%">
|
|
219
|
-
{/* Session Management */}
|
|
220
|
-
<View width="300px">
|
|
221
|
-
<AgentSession
|
|
222
|
-
appName="my-agent"
|
|
223
|
-
userId="user123"
|
|
224
|
-
apiBaseUrl="https://api.example.com"
|
|
225
|
-
/>
|
|
226
|
-
</View>
|
|
227
|
-
|
|
228
|
-
{/* Chat Interface */}
|
|
229
|
-
<View flex={1}>
|
|
230
|
-
<AgentChat
|
|
231
|
-
appName="my-agent"
|
|
232
|
-
userId="user123"
|
|
233
|
-
apiBaseUrl="https://api.example.com"
|
|
234
|
-
/>
|
|
235
|
-
</View>
|
|
236
|
-
</Horizontal>
|
|
237
|
-
</View>
|
|
238
|
-
);
|
|
239
|
-
};
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
### 4. Advanced Configuration
|
|
243
|
-
|
|
244
|
-
```tsx
|
|
245
|
-
<AgentChat
|
|
246
|
-
appName="my-agent"
|
|
247
|
-
userId="user123"
|
|
248
|
-
apiBaseUrl="https://api.example.com"
|
|
249
|
-
enableFileUpload={true}
|
|
250
|
-
enableStreaming={true}
|
|
251
|
-
enableThoughts={true}
|
|
252
|
-
maxFileSize={10 * 1024 * 1024}
|
|
253
|
-
allowedFileTypes={['image/*', 'video/*', 'application/pdf']}
|
|
254
|
-
onSessionCreate={(session) => {
|
|
255
|
-
console.log('New session:', session);
|
|
256
|
-
}}
|
|
257
|
-
onMessageSent={(message) => {
|
|
258
|
-
console.log('Message sent:', message);
|
|
259
|
-
}}
|
|
260
|
-
onError={(error) => {
|
|
261
|
-
console.error('Chat error:', error);
|
|
262
|
-
}}
|
|
263
|
-
views={{
|
|
264
|
-
container: { backgroundColor: 'color.gray.50' },
|
|
265
|
-
userMessage: { backgroundColor: 'color.blue.500' },
|
|
266
|
-
botMessage: { backgroundColor: 'color.green.100' },
|
|
267
|
-
}}
|
|
268
|
-
/>
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
## Complete Component Library
|
|
272
|
-
|
|
273
|
-
All planned components have been successfully implemented:
|
|
274
|
-
|
|
275
|
-
### ✅ **AgentTrace Component**
|
|
276
|
-
- **Timeline visualization** of agent execution traces
|
|
277
|
-
- **Event filtering and search** capabilities
|
|
278
|
-
- **Performance metrics** and analytics
|
|
279
|
-
- **Real-time trace updates** via WebSocket
|
|
280
|
-
- **Multiple visualization types** (timeline, tree, table, flamegraph)
|
|
281
|
-
- **Export functionality** (JSON, CSV, SVG)
|
|
282
|
-
|
|
283
|
-
### ✅ **AgentEval Component**
|
|
284
|
-
- **Evaluation creation and management** interface
|
|
285
|
-
- **Test case execution** and monitoring
|
|
286
|
-
- **Results analysis** and comparison
|
|
287
|
-
- **Metrics calculation** and visualization
|
|
288
|
-
- **Batch evaluation** support
|
|
289
|
-
- **Template system** for reusable evaluations
|
|
290
|
-
|
|
291
|
-
### ✅ **Agent Service Integration**
|
|
292
|
-
- **Enhanced service layer** for backend communication
|
|
293
|
-
- **React Provider pattern** for service management
|
|
294
|
-
- **Utility functions** for common operations
|
|
295
|
-
- **Real-time updates** via WebSocket and SSE
|
|
296
|
-
- **Error handling and retry logic**
|
|
297
|
-
- **Connection status monitoring**
|
|
298
|
-
|
|
299
|
-
## Demo Page
|
|
300
|
-
|
|
301
|
-
A comprehensive demo page showcasing all components is available at:
|
|
302
|
-
- **File**: `src/pages/adkComponents.page.tsx`
|
|
303
|
-
- **Features**: Interactive demos, customization examples, integration guides
|
|
304
|
-
|
|
305
|
-
## Support
|
|
306
|
-
|
|
307
|
-
For questions, issues, or contributions related to the ADK Agent Components, please refer to the main app-studio documentation or create an issue in the repository.
|
|
308
|
-
|
|
309
|
-
## Production Ready
|
|
310
|
-
|
|
311
|
-
All ADK Agent Components are **production-ready** and provide:
|
|
312
|
-
- ✅ Full ADK backend compatibility
|
|
313
|
-
- ✅ TypeScript support with comprehensive type definitions
|
|
314
|
-
- ✅ Accessibility compliance (ARIA labels, keyboard navigation)
|
|
315
|
-
- ✅ Responsive design for mobile, tablet, and desktop
|
|
316
|
-
- ✅ Comprehensive error handling and loading states
|
|
317
|
-
- ✅ Real-time updates and streaming support
|
|
318
|
-
- ✅ Extensive customization options
|
|
319
|
-
- ✅ Complete documentation and examples
|