@foisit/vue-wrapper 2.4.4 → 3.0.0

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/README.md CHANGED
@@ -27,10 +27,13 @@ Transform your Vue app into an intelligent, voice-ready platform. Foisit provide
27
27
 
28
28
  ## Features
29
29
 
30
- - **Natural Language Understanding** - AI-powered intent matching using GPT-4o mini (proxied securely)
30
+ - **Natural Language Understanding** - AI-powered intent matching (proxied securely)
31
31
  - **Smart Slot Filling** - Auto-generates forms for missing parameters
32
32
  - **Critical Action Protection** - Built-in confirmation dialogs for dangerous operations
33
- - **Premium UI** - Glassmorphic overlay with dark/light mode support
33
+ - **Programmatic UI Triggers** - Direct command execution via `runCommand()`
34
+ - **Rich Markdown Rendering** - Enhanced response formatting with headings, code, and links
35
+ - **Advanced File Validations** - Comprehensive client-side file validation with size, type, and dimension checks
36
+ - **Premium UI** - Glass or solid theme with dark/light mode support
34
37
  - **Zero Backend Required** - Secure proxy architecture keeps API keys server-side
35
38
  - **Vue Native** - Uses Composition API, `provide/inject`, and Vue 3 patterns
36
39
  - **Type-Safe** - Full TypeScript support with comprehensive types
@@ -196,9 +199,34 @@ Collect files via the built-in form UI and receive them in your command `action`
196
199
  }
197
200
  ```
198
201
 
199
- `FileParameter` supports validations like `maxFiles`, `maxSizeBytes`, `maxTotalBytes`, and media/image constraints like `maxDurationSec`, `maxWidth`, and `maxHeight`.
202
+ `FileParameter` supports advanced validations:
200
203
 
201
- ### 4. Critical Actions
204
+ - `maxFiles`: Maximum number of files allowed (default: 1 for single, 10 for multiple)
205
+ - `maxSizeBytes`: Maximum size per file in bytes
206
+ - `maxTotalBytes`: Maximum total size for all files combined
207
+ - `maxDurationSec`: Maximum duration for media files (audio/video) in seconds
208
+ - `maxWidth` / `maxHeight`: Maximum dimensions for images in pixels
209
+ - `accept`: Allowed MIME types or file extensions (e.g., `['image/*', '.pdf']`)
210
+ - `multiple`: Allow selecting multiple files
211
+ - `capture`: Hint for mobile devices (`'camera'` or `'microphone'`)
212
+ - `delivery`: How files are delivered to your action (`'file'` or `'base64'`)
213
+
214
+ Files are validated client-side before submission, with clear error messages for violations.
215
+
216
+ ### 4. Rich Markdown Rendering
217
+
218
+ Assistant responses support rich markdown formatting for enhanced readability:
219
+
220
+ - **Headings**: `# H1` through `###### H6`
221
+ - **Text Formatting**: `**bold**`, `*italic*`, `~~strikethrough~~`
222
+ - **Code**: Inline `code` and code blocks with syntax highlighting
223
+ - **Links**: `[text](url)` with safe external linking
224
+ - **Lists**: Ordered and unordered lists
225
+ - **Line breaks** and paragraphs
226
+
227
+ Markdown is automatically rendered in AI responses, while user messages remain plain text.
228
+
229
+ ### 5. Critical Actions
202
230
 
203
231
  Protect dangerous operations with automatic confirmation dialogs:
204
232
 
@@ -214,7 +242,7 @@ Protect dangerous operations with automatic confirmation dialogs:
214
242
  }
215
243
  ```
216
244
 
217
- ### 5. Select Parameters (Static)
245
+ ### 6. Select Parameters (Static)
218
246
 
219
247
  Provide predefined options:
220
248
 
@@ -234,7 +262,7 @@ Provide predefined options:
234
262
  }
235
263
  ```
236
264
 
237
- ### 6. Dynamic Select Parameters
265
+ ### 7. Dynamic Select Parameters
238
266
 
239
267
  Load options from APIs:
240
268
 
@@ -363,6 +391,36 @@ const commands = assistant.getCommands();
363
391
  console.log('Available commands:', commands);
364
392
  ```
365
393
 
394
+ ##### `runCommand(options)`
395
+
396
+ Programmatically trigger a command execution with optional parameters. This allows you to invoke commands directly from your code without user input.
397
+
398
+ ```javascript
399
+ // Basic usage - trigger a command by ID
400
+ assistant.runCommand({ commandId: 'refresh-data' });
401
+
402
+ // With parameters
403
+ assistant.runCommand({
404
+ commandId: 'create-user',
405
+ params: { name: 'John', email: 'john@example.com' },
406
+ });
407
+
408
+ // Open overlay and show the command invocation
409
+ assistant.runCommand({
410
+ commandId: 'export-report',
411
+ params: { format: 'pdf' },
412
+ openOverlay: true,
413
+ showInvocation: true,
414
+ });
415
+ ```
416
+
417
+ **Options:**
418
+
419
+ - `commandId` (required): The ID of the command to run
420
+ - `params` (optional): Parameters to pass to the command action
421
+ - `openOverlay` (optional): Whether to open the assistant overlay (default: false)
422
+ - `showInvocation` (optional): Whether to display the command invocation in the chat (default: false)
423
+
366
424
  ---
367
425
 
368
426
  ## Configuration Options
@@ -396,9 +454,57 @@ interface AssistantConfig {
396
454
  customHtml?: string;
397
455
  position?: { bottom: string; right: string };
398
456
  };
457
+
458
+ // Theme mode: 'glass' (default) or 'solid'
459
+ theme?: 'glass' | 'solid';
460
+
461
+ // Custom colors for solid theme (ignored in glass mode)
462
+ themeColors?: ThemeColors;
463
+ }
464
+ ```
465
+
466
+ ### `ThemeColors`
467
+
468
+ Custom colors for solid theme mode:
469
+
470
+ ```typescript
471
+ interface ThemeColors {
472
+ background?: string; // Background color (e.g., '#1e1e2e')
473
+ text?: string; // Primary text color (e.g., '#ffffff')
474
+ accent?: string; // Accent color for highlights (e.g., '#89b4fa' or a gradient)
475
+ userBubbleBg?: string; // User message bubble background
476
+ systemBubbleBg?: string; // System message bubble background
477
+ border?: string; // Border color
399
478
  }
400
479
  ```
401
480
 
481
+ ### Theme Customization Example
482
+
483
+ ```vue
484
+ <script setup>
485
+ const config = {
486
+ commands: [...],
487
+ // Use solid theme with custom colors
488
+ theme: 'solid',
489
+ themeColors: {
490
+ background: '#1e1e2e',
491
+ text: '#cdd6f4',
492
+ accent: '#89b4fa',
493
+ userBubbleBg: 'rgba(137, 180, 250, 0.2)',
494
+ systemBubbleBg: 'rgba(255, 255, 255, 0.05)',
495
+ },
496
+ };
497
+ </script>
498
+
499
+ <template>
500
+ <AssistantProvider :config="config">
501
+ <App />
502
+ </AssistantProvider>
503
+ </template>
504
+ ```
505
+
506
+ > **Note**: Glass theme (default) uses glassmorphism with blur effects and adapts to light/dark mode via `prefers-color-scheme`. Solid theme ignores system preferences and uses configured colors.
507
+
402
508
  ---
403
509
 
404
510
  ## Advanced Usage
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default as AssistantProvider } from './lib/components/AssistantProvider.vue';
2
2
  export { useAssistant } from './lib/composables/useAssistant';
3
3
  export { AssistantService } from './lib/services/AssistantService';
4
+ export type { ThemeColors } from '../../core/src/index.ts';