@foisit/angular-wrapper 2.4.67 → 2.5.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,9 +27,12 @@ Transform your Angular app into an intelligent, voice-ready platform. Foisit pro
|
|
|
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
|
- **Angular Native** - Uses Dependency Injection, Signals, and RxJS
|
|
@@ -217,9 +220,34 @@ Collect files via the built-in form UI and receive them in your command `action`
|
|
|
217
220
|
}
|
|
218
221
|
```
|
|
219
222
|
|
|
220
|
-
`FileParameter` supports validations
|
|
223
|
+
`FileParameter` supports advanced validations:
|
|
221
224
|
|
|
222
|
-
|
|
225
|
+
- `maxFiles`: Maximum number of files allowed (default: 1 for single, 10 for multiple)
|
|
226
|
+
- `maxSizeBytes`: Maximum size per file in bytes
|
|
227
|
+
- `maxTotalBytes`: Maximum total size for all files combined
|
|
228
|
+
- `maxDurationSec`: Maximum duration for media files (audio/video) in seconds
|
|
229
|
+
- `maxWidth` / `maxHeight`: Maximum dimensions for images in pixels
|
|
230
|
+
- `accept`: Allowed MIME types or file extensions (e.g., `['image/*', '.pdf']`)
|
|
231
|
+
- `multiple`: Allow selecting multiple files
|
|
232
|
+
- `capture`: Hint for mobile devices (`'camera'` or `'microphone'`)
|
|
233
|
+
- `delivery`: How files are delivered to your action (`'file'` or `'base64'`)
|
|
234
|
+
|
|
235
|
+
Files are validated client-side before submission, with clear error messages for violations.
|
|
236
|
+
|
|
237
|
+
### 4. Rich Markdown Rendering
|
|
238
|
+
|
|
239
|
+
Assistant responses support rich markdown formatting for enhanced readability:
|
|
240
|
+
|
|
241
|
+
- **Headings**: `# H1` through `###### H6`
|
|
242
|
+
- **Text Formatting**: `**bold**`, `*italic*`, `~~strikethrough~~`
|
|
243
|
+
- **Code**: Inline `code` and code blocks with syntax highlighting
|
|
244
|
+
- **Links**: `[text](url)` with safe external linking
|
|
245
|
+
- **Lists**: Ordered and unordered lists
|
|
246
|
+
- **Line breaks** and paragraphs
|
|
247
|
+
|
|
248
|
+
Markdown is automatically rendered in AI responses, while user messages remain plain text.
|
|
249
|
+
|
|
250
|
+
### 5. Critical Actions
|
|
223
251
|
|
|
224
252
|
Protect dangerous operations with automatic confirmation dialogs:
|
|
225
253
|
|
|
@@ -235,7 +263,7 @@ Protect dangerous operations with automatic confirmation dialogs:
|
|
|
235
263
|
}
|
|
236
264
|
```
|
|
237
265
|
|
|
238
|
-
###
|
|
266
|
+
### 6. Select Parameters (Static)
|
|
239
267
|
|
|
240
268
|
Provide predefined options:
|
|
241
269
|
|
|
@@ -255,7 +283,7 @@ Provide predefined options:
|
|
|
255
283
|
}
|
|
256
284
|
```
|
|
257
285
|
|
|
258
|
-
###
|
|
286
|
+
### 7. Dynamic Select Parameters
|
|
259
287
|
|
|
260
288
|
Load options from APIs:
|
|
261
289
|
|
|
@@ -380,6 +408,36 @@ const commands = this.assistant.getCommands();
|
|
|
380
408
|
console.log('Available commands:', commands);
|
|
381
409
|
```
|
|
382
410
|
|
|
411
|
+
##### `runCommand(options)`
|
|
412
|
+
|
|
413
|
+
Programmatically trigger a command execution with optional parameters. This allows you to invoke commands directly from your code without user input.
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
// Basic usage - trigger a command by ID
|
|
417
|
+
this.assistant.runCommand({ commandId: 'refresh-data' });
|
|
418
|
+
|
|
419
|
+
// With parameters
|
|
420
|
+
this.assistant.runCommand({
|
|
421
|
+
commandId: 'create-user',
|
|
422
|
+
params: { name: 'John', email: 'john@example.com' },
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// Open overlay and show the command invocation
|
|
426
|
+
this.assistant.runCommand({
|
|
427
|
+
commandId: 'export-report',
|
|
428
|
+
params: { format: 'pdf' },
|
|
429
|
+
openOverlay: true,
|
|
430
|
+
showInvocation: true,
|
|
431
|
+
});
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**Options:**
|
|
435
|
+
|
|
436
|
+
- `commandId` (required): The ID of the command to run
|
|
437
|
+
- `params` (optional): Parameters to pass to the command action
|
|
438
|
+
- `openOverlay` (optional): Whether to open the assistant overlay (default: false)
|
|
439
|
+
- `showInvocation` (optional): Whether to display the command invocation in the chat (default: false)
|
|
440
|
+
|
|
383
441
|
---
|
|
384
442
|
|
|
385
443
|
## Configuration Options
|