@app-studio/web 0.9.21 → 0.9.22

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 (68) hide show
  1. package/README.md +17 -1
  2. package/dist/components/ChatInput/ChatInput/ChatInput.props.d.ts +9 -0
  3. package/dist/components/ChatInput/EditableInput.d.ts +1 -1
  4. package/dist/services/api/index.d.ts +6 -17
  5. package/dist/services/api/models/ActionListParam.d.ts +18 -0
  6. package/dist/services/api/models/CheckRatingParams.d.ts +1 -1
  7. package/dist/services/api/models/CreateActionParams.d.ts +1 -13
  8. package/dist/services/api/models/CreateAnalyticParams.d.ts +1 -1
  9. package/dist/services/api/models/CreateCommentAnswerParams.d.ts +1 -1
  10. package/dist/services/api/models/CreateCommentParams.d.ts +1 -1
  11. package/dist/services/api/models/CreateRatingParams.d.ts +1 -1
  12. package/dist/services/api/models/CreateReportParams.d.ts +1 -1
  13. package/dist/services/api/models/EditLogoParams.d.ts +22 -0
  14. package/dist/services/api/models/EditPageStreamParams.d.ts +6 -0
  15. package/dist/services/api/models/FindCommentParams.d.ts +1 -1
  16. package/dist/services/api/models/FindReportParams.d.ts +1 -1
  17. package/dist/services/api/models/FindUserParams.d.ts +1 -1
  18. package/dist/services/api/models/GenerateProjectParams.d.ts +0 -4
  19. package/dist/services/api/models/GetAnalyticViewParams.d.ts +1 -1
  20. package/dist/services/api/models/ListCommentParams.d.ts +1 -1
  21. package/dist/services/api/models/SetAnalyticViewParams.d.ts +1 -1
  22. package/dist/services/api/models/UpdateActionParams.d.ts +2 -2
  23. package/dist/services/api/models/UpdateObjectDto.d.ts +1 -0
  24. package/dist/services/api/models/UpdateUserParams.d.ts +14 -6
  25. package/dist/services/api/services/ActionService.d.ts +90 -30
  26. package/dist/services/api/services/AssistantService.d.ts +12 -0
  27. package/dist/services/api/services/ComponentService.d.ts +22 -38
  28. package/dist/services/api/services/FieldService.d.ts +2 -2
  29. package/dist/services/api/services/ItemService.d.ts +13 -0
  30. package/dist/services/api/services/NewsletterService.d.ts +2 -2
  31. package/dist/services/api/services/ObjectService.d.ts +74 -0
  32. package/dist/services/api/services/PageService.d.ts +0 -60
  33. package/dist/services/api/services/SeedService.d.ts +4 -4
  34. package/dist/services/api/services/UploadService.d.ts +55 -0
  35. package/dist/services/api/services/WorkflowService.d.ts +24 -25
  36. package/dist/utils/apiConfig.d.ts +24 -0
  37. package/dist/web.cjs.development.js +4 -7
  38. package/dist/web.cjs.development.js.map +1 -1
  39. package/dist/web.cjs.production.min.js +1 -1
  40. package/dist/web.cjs.production.min.js.map +1 -1
  41. package/dist/web.esm.js +4 -7
  42. package/dist/web.esm.js.map +1 -1
  43. package/dist/web.umd.development.js +4 -7
  44. package/dist/web.umd.development.js.map +1 -1
  45. package/dist/web.umd.production.min.js +1 -1
  46. package/dist/web.umd.production.min.js.map +1 -1
  47. package/docs/README.md +21 -14
  48. package/docs/documentation-system.md +90 -0
  49. package/package.json +2 -1
  50. package/dist/services/api/models/CreateApplicationParams.d.ts +0 -10
  51. package/dist/services/api/models/CreateGrantParams.d.ts +0 -10
  52. package/dist/services/api/models/CreateProjectParams.d.ts +0 -10
  53. package/dist/services/api/models/FindApplicationParams.d.ts +0 -19
  54. package/dist/services/api/models/FindPageParams.d.ts +0 -22
  55. package/dist/services/api/models/FixPageParams.d.ts +0 -10
  56. package/dist/services/api/models/UpdateApplicationParams.d.ts +0 -6
  57. package/dist/services/api/models/UpdateComponentPropsParams.d.ts +0 -10
  58. package/dist/services/api/models/UpdateGrantParams.d.ts +0 -6
  59. package/dist/services/api/models/UpdatePageParams.d.ts +0 -14
  60. package/dist/services/api/models/UpdateProjectParams.d.ts +0 -10
  61. package/dist/services/api/services/ApplicationService.d.ts +0 -83
  62. package/dist/services/api/services/ComponentRevisionService.d.ts +0 -25
  63. package/dist/services/api/services/FileService.d.ts +0 -30
  64. package/dist/services/api/services/GrantService.d.ts +0 -100
  65. package/dist/services/api/services/ProjectService.d.ts +0 -59
  66. package/dist/services/api/services/PromptService.d.ts +0 -18
  67. package/docs/guide.md +0 -550
  68. package/docs/integration-guide.md +0 -449
@@ -1,449 +0,0 @@
1
- # ADK Components Integration Guide
2
-
3
- This guide provides step-by-step instructions for integrating ADK Agent Components into your React application.
4
-
5
- ## Table of Contents
6
-
7
- 1. [Prerequisites](#prerequisites)
8
- 2. [Installation](#installation)
9
- 3. [Basic Setup](#basic-setup)
10
- 4. [Component Integration](#component-integration)
11
- 5. [Service Configuration](#service-configuration)
12
- 6. [Advanced Features](#advanced-features)
13
- 7. [Production Deployment](#production-deployment)
14
- 8. [Troubleshooting](#troubleshooting)
15
-
16
- ## Prerequisites
17
-
18
- - React 18+
19
- - TypeScript 4.5+ (recommended)
20
- - ADK backend service running
21
- - Node.js 16+
22
-
23
- ## Installation
24
-
25
- ### 1. Install the Package
26
-
27
- ```bash
28
- npm install @app-studio/web
29
- ```
30
-
31
- ### 2. Install Peer Dependencies
32
-
33
- ```bash
34
- npm install react react-dom
35
- ```
36
-
37
- ### 3. TypeScript Setup (Optional but Recommended)
38
-
39
- ```bash
40
- npm install -D typescript @types/react @types/react-dom
41
- ```
42
-
43
- ## Basic Setup
44
-
45
- ### 1. Environment Configuration
46
-
47
- Create a `.env` file in your project root:
48
-
49
- ```bash
50
- # .env
51
- REACT_APP_ADK_API_URL=https://your-adk-api.com
52
- REACT_APP_ADK_API_KEY=your-api-key-here
53
- REACT_APP_AGENT_NAME=my-agent
54
- ```
55
-
56
- ### 2. Service Provider Setup
57
-
58
- Wrap your application with the `AgentServiceProvider`:
59
-
60
- ```tsx
61
- // src/App.tsx
62
- import React from 'react';
63
- import { AgentServiceProvider } from '@app-studio/web';
64
- import { YourMainComponent } from './components/YourMainComponent';
65
-
66
- function App() {
67
- return (
68
- <AgentServiceProvider
69
- config={{
70
- baseUrl: process.env.REACT_APP_ADK_API_URL!,
71
- apiKey: process.env.REACT_APP_ADK_API_KEY,
72
- timeout: 30000,
73
- retryCount: 3,
74
- enableLogging: process.env.NODE_ENV === 'development',
75
- }}
76
- onConnectionChange={(isConnected) => {
77
- console.log('ADK Service connection:', isConnected);
78
- }}
79
- onError={(error) => {
80
- console.error('ADK Service error:', error);
81
- }}
82
- >
83
- <YourMainComponent />
84
- </AgentServiceProvider>
85
- );
86
- }
87
-
88
- export default App;
89
- ```
90
-
91
- ## Component Integration
92
-
93
- ### 1. Simple Chat Interface
94
-
95
- ```tsx
96
- // src/components/SimpleChatInterface.tsx
97
- import React from 'react';
98
- import { AgentChat } from '@app-studio/web';
99
-
100
- export const SimpleChatInterface = () => {
101
- return (
102
- <div style={{ height: '100vh' }}>
103
- <AgentChat
104
- appName={process.env.REACT_APP_AGENT_NAME!}
105
- userId="user123"
106
- enableFileUpload={true}
107
- enableStreaming={true}
108
- onMessageSent={(message) => {
109
- console.log('Message sent:', message);
110
- }}
111
- onSessionCreate={(sessionId) => {
112
- console.log('Session created:', sessionId);
113
- }}
114
- />
115
- </div>
116
- );
117
- };
118
- ```
119
-
120
- ### 2. Complete Agent Interface
121
-
122
- ```tsx
123
- // src/components/AgentInterface.tsx
124
- import React, { useState } from 'react';
125
- import {
126
- AgentChat,
127
- AgentSession,
128
- AgentTrace,
129
- AgentEval
130
- } from '@app-studio/web';
131
-
132
- export const AgentInterface = () => {
133
- const [currentSessionId, setCurrentSessionId] = useState<string | null>(null);
134
- const [activeView, setActiveView] = useState<'chat' | 'trace' | 'eval'>('chat');
135
-
136
- return (
137
- <div style={{ display: 'flex', height: '100vh' }}>
138
- {/* Session Sidebar */}
139
- <div style={{ width: '300px', borderRight: '1px solid #e5e7eb' }}>
140
- <AgentSession
141
- appName={process.env.REACT_APP_AGENT_NAME!}
142
- userId="user123"
143
- onSessionSelect={setCurrentSessionId}
144
- selectedSessionId={currentSessionId}
145
- />
146
- </div>
147
-
148
- {/* Main Content */}
149
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>
150
- {/* Navigation */}
151
- <div style={{ padding: '16px', borderBottom: '1px solid #e5e7eb' }}>
152
- <button onClick={() => setActiveView('chat')}>Chat</button>
153
- <button onClick={() => setActiveView('trace')}>Trace</button>
154
- <button onClick={() => setActiveView('eval')}>Evaluation</button>
155
- </div>
156
-
157
- {/* Content */}
158
- <div style={{ flex: 1 }}>
159
- {activeView === 'chat' && (
160
- <AgentChat
161
- appName={process.env.REACT_APP_AGENT_NAME!}
162
- userId="user123"
163
- sessionId={currentSessionId}
164
- enableFileUpload={true}
165
- enableStreaming={true}
166
- />
167
- )}
168
-
169
- {activeView === 'trace' && currentSessionId && (
170
- <AgentTrace
171
- sessionId={currentSessionId}
172
- userId="user123"
173
- appName={process.env.REACT_APP_AGENT_NAME!}
174
- showTimeline={true}
175
- showMetrics={true}
176
- />
177
- )}
178
-
179
- {activeView === 'eval' && (
180
- <AgentEval
181
- appName={process.env.REACT_APP_AGENT_NAME!}
182
- userId="user123"
183
- enableBatchEvaluation={true}
184
- enableResultExport={true}
185
- />
186
- )}
187
- </div>
188
- </div>
189
- </div>
190
- );
191
- };
192
- ```
193
-
194
- ## Service Configuration
195
-
196
- ### 1. Development Configuration
197
-
198
- ```tsx
199
- const developmentConfig = {
200
- baseUrl: 'http://localhost:8000',
201
- timeout: 30000,
202
- retryCount: 3,
203
- enableLogging: true,
204
- };
205
- ```
206
-
207
- ### 2. Production Configuration
208
-
209
- ```tsx
210
- const productionConfig = {
211
- baseUrl: process.env.REACT_APP_ADK_API_URL!,
212
- apiKey: process.env.REACT_APP_ADK_API_KEY,
213
- timeout: 30000,
214
- retryCount: 3,
215
- enableLogging: false,
216
- headers: {
217
- 'X-App-Version': process.env.REACT_APP_VERSION || '1.0.0',
218
- },
219
- };
220
- ```
221
-
222
- ### 3. Custom Service Hooks
223
-
224
- ```tsx
225
- // src/hooks/useAgentOperations.ts
226
- import { useAgentOperations } from '@app-studio/web';
227
-
228
- export const useCustomAgentOperations = () => {
229
- const operations = useAgentOperations();
230
-
231
- const sendMessageWithLogging = async (message: string) => {
232
- console.log('Sending message:', message);
233
- const result = await operations.messages.send({
234
- appName: process.env.REACT_APP_AGENT_NAME!,
235
- userId: 'user123',
236
- newMessage: {
237
- role: 'user',
238
- parts: [{ type: 'text', text: message }],
239
- },
240
- });
241
- console.log('Message result:', result);
242
- return result;
243
- };
244
-
245
- return {
246
- ...operations,
247
- sendMessageWithLogging,
248
- };
249
- };
250
- ```
251
-
252
- ## Advanced Features
253
-
254
- ### 1. Custom Styling
255
-
256
- ```tsx
257
- const customViews = {
258
- container: {
259
- backgroundColor: 'color.blue.50',
260
- borderRadius: '12px',
261
- },
262
- userMessage: {
263
- backgroundColor: 'color.blue.500',
264
- color: 'white',
265
- },
266
- botMessage: {
267
- backgroundColor: 'color.green.100',
268
- borderColor: 'color.green.300',
269
- },
270
- };
271
-
272
- <AgentChat
273
- appName="my-agent"
274
- userId="user123"
275
- views={customViews}
276
- />
277
- ```
278
-
279
- ### 2. Event Handling
280
-
281
- ```tsx
282
- const handleAgentEvents = {
283
- onMessageSent: (message) => {
284
- // Analytics tracking
285
- analytics.track('message_sent', { messageLength: message.text?.length });
286
- },
287
- onSessionCreate: (sessionId) => {
288
- // Session tracking
289
- analytics.track('session_created', { sessionId });
290
- },
291
- onError: (error) => {
292
- // Error reporting
293
- errorReporting.captureException(error);
294
- },
295
- };
296
-
297
- <AgentChat
298
- appName="my-agent"
299
- userId="user123"
300
- {...handleAgentEvents}
301
- />
302
- ```
303
-
304
- ### 3. Real-time Updates
305
-
306
- ```tsx
307
- // Enable real-time features
308
- <AgentTrace
309
- sessionId="session-123"
310
- userId="user123"
311
- appName="my-agent"
312
- enableRealTimeUpdates={true}
313
- enableAutoRefresh={true}
314
- refreshInterval={5000}
315
- />
316
- ```
317
-
318
- ## Production Deployment
319
-
320
- ### 1. Environment Variables
321
-
322
- ```bash
323
- # Production .env
324
- REACT_APP_ADK_API_URL=https://api.yourdomain.com
325
- REACT_APP_ADK_API_KEY=prod-api-key-here
326
- REACT_APP_AGENT_NAME=production-agent
327
- REACT_APP_VERSION=1.0.0
328
- ```
329
-
330
- ### 2. Build Configuration
331
-
332
- ```json
333
- // package.json
334
- {
335
- "scripts": {
336
- "build:prod": "REACT_APP_ENV=production npm run build",
337
- "build:staging": "REACT_APP_ENV=staging npm run build"
338
- }
339
- }
340
- ```
341
-
342
- ### 3. Error Boundaries
343
-
344
- ```tsx
345
- // src/components/ErrorBoundary.tsx
346
- import React from 'react';
347
-
348
- class ADKErrorBoundary extends React.Component {
349
- constructor(props) {
350
- super(props);
351
- this.state = { hasError: false };
352
- }
353
-
354
- static getDerivedStateFromError(error) {
355
- return { hasError: true };
356
- }
357
-
358
- componentDidCatch(error, errorInfo) {
359
- console.error('ADK Component Error:', error, errorInfo);
360
- // Report to error tracking service
361
- }
362
-
363
- render() {
364
- if (this.state.hasError) {
365
- return (
366
- <div style={{ padding: '20px', textAlign: 'center' }}>
367
- <h2>Something went wrong with the ADK components.</h2>
368
- <button onClick={() => this.setState({ hasError: false })}>
369
- Try again
370
- </button>
371
- </div>
372
- );
373
- }
374
-
375
- return this.props.children;
376
- }
377
- }
378
-
379
- // Wrap your components
380
- <ADKErrorBoundary>
381
- <AgentChat appName="my-agent" userId="user123" />
382
- </ADKErrorBoundary>
383
- ```
384
-
385
- ## Troubleshooting
386
-
387
- ### Common Issues
388
-
389
- 1. **Components not rendering**
390
- - Ensure `AgentServiceProvider` wraps your app
391
- - Check console for JavaScript errors
392
- - Verify environment variables are set
393
-
394
- 2. **API connection errors**
395
- - Verify backend URL is correct and accessible
396
- - Check CORS configuration on your backend
397
- - Ensure API key is valid
398
-
399
- 3. **Styling issues**
400
- - Import app-studio CSS if needed
401
- - Check for conflicting CSS rules
402
- - Verify color system usage
403
-
404
- 4. **TypeScript errors**
405
- - Ensure all required props are provided
406
- - Check type imports from the correct package
407
- - Update TypeScript to latest version
408
-
409
- ### Debug Mode
410
-
411
- Enable debug logging:
412
-
413
- ```tsx
414
- <AgentServiceProvider
415
- config={{
416
- baseUrl: 'https://api.example.com',
417
- enableLogging: true, // Enable debug logs
418
- }}
419
- >
420
- <App />
421
- </AgentServiceProvider>
422
- ```
423
-
424
- ### Performance Optimization
425
-
426
- ```tsx
427
- // Lazy load components for better performance
428
- const AgentTrace = React.lazy(() => import('@app-studio/web').then(m => ({ default: m.AgentTrace })));
429
- const AgentEval = React.lazy(() => import('@app-studio/web').then(m => ({ default: m.AgentEval })));
430
-
431
- // Use with Suspense
432
- <React.Suspense fallback={<div>Loading...</div>}>
433
- <AgentTrace sessionId="session-123" userId="user123" appName="my-agent" />
434
- </React.Suspense>
435
- ```
436
-
437
- ## Next Steps
438
-
439
- 1. Explore the [complete example](../src/examples/CompleteAgentApp.tsx)
440
- 2. Check out individual component examples in the `examples/` directories
441
- 3. Read the [full documentation](./adk-components.md)
442
- 4. Join our community for support and updates
443
-
444
- ## Support
445
-
446
- - 📚 [Documentation](./adk-components.md)
447
- - 🚀 [Quick Start](./adk-quick-start.md)
448
- - 💻 [Complete Example](../src/examples/CompleteAgentApp.tsx)
449
- - 🐛 [Issue Tracker](https://github.com/your-org/adk-components/issues)