@foisit/vue-wrapper 2.4.4 → 2.4.5
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 +63 -5
- package/index.mjs +1002 -786
- package/lib/services/AssistantService.d.ts +10 -0
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -27,9 +27,12 @@ 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
|
|
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
|
+
- **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
|
|
33
36
|
- **Premium UI** - Glassmorphic overlay 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
|
|
@@ -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
|
|
202
|
+
`FileParameter` supports advanced validations:
|
|
200
203
|
|
|
201
|
-
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|