@foisit/angular-wrapper 2.1.1 → 2.4.2

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
@@ -7,39 +7,38 @@
7
7
 
8
8
  Transform your Angular app into an intelligent, voice-ready platform. Foisit provides a drop-in AI layer that understands natural language, manages multi-step workflows, and executes actions—all with zero backend required.
9
9
 
10
- > [!NOTE]
11
- > 🎙️ **Voice Support Status**: Voice recognition and responses are currently in development and will be released in a future update. The current version focuses on high-performance text-based interactions and AI intent matching.
10
+ > [!NOTE] > **Voice Support Status**: Voice recognition and responses are currently in development and will be released in a future update. The current version focuses on high-performance text-based interactions and AI intent matching.
12
11
 
13
12
  ---
14
13
 
15
- ## 📋 Table of Contents
14
+ ## Table of Contents
16
15
 
17
- - [Features](#-features)
18
- - [Installation](#-installation)
19
- - [Quick Start](#-quick-start)
20
- - [Core Concepts](#-core-concepts)
21
- - [API Reference](#-api-reference)
22
- - [Advanced Usage](#-advanced-usage)
23
- - [Examples](#-examples)
24
- - [TypeScript Support](#-typescript-support)
25
- - [Best Practices](#-best-practices)
16
+ - [Features](#features)
17
+ - [Installation](#installation)
18
+ - [Quick Start](#quick-start)
19
+ - [Core Concepts](#core-concepts)
20
+ - [API Reference](#api-reference)
21
+ - [Advanced Usage](#advanced-usage)
22
+ - [Examples](#examples)
23
+ - [TypeScript Support](#typescript-support)
24
+ - [Best Practices](#best-practices)
26
25
 
27
26
  ---
28
27
 
29
- ## Features
28
+ ## Features
30
29
 
31
- - **🧠 Natural Language Understanding** - AI-powered intent matching using GPT-4o mini (proxied securely)
32
- - **📝 Smart Slot Filling** - Auto-generates forms for missing parameters
33
- - **⚠️ Critical Action Protection** - Built-in confirmation dialogs for dangerous operations
34
- - **🎨 Premium UI** - Glassmorphic overlay with dark/light mode support
35
- - **🔒 Zero Backend Required** - Secure proxy architecture keeps API keys server-side
36
- - **⚡ Angular Native** - Uses Dependency Injection, Signals, and RxJS
37
- - **🎯 Type-Safe** - Full TypeScript support with comprehensive types
38
- - **📱 Responsive** - Works flawlessly on desktop and mobile
30
+ - **Natural Language Understanding** - AI-powered intent matching using GPT-4o mini (proxied securely)
31
+ - **Smart Slot Filling** - Auto-generates forms for missing parameters
32
+ - **Critical Action Protection** - Built-in confirmation dialogs for dangerous operations
33
+ - **Premium UI** - Glassmorphic overlay with dark/light mode support
34
+ - **Zero Backend Required** - Secure proxy architecture keeps API keys server-side
35
+ - **Angular Native** - Uses Dependency Injection, Signals, and RxJS
36
+ - **Type-Safe** - Full TypeScript support with comprehensive types
37
+ - **Responsive** - Works flawlessly on desktop and mobile
39
38
 
40
39
  ---
41
40
 
42
- ## 🚀 Installation
41
+ ## Installation
43
42
 
44
43
  ```bash
45
44
  npm install @foisit/angular-wrapper
@@ -56,7 +55,7 @@ npm install @foisit/angular-wrapper
56
55
 
57
56
  ---
58
57
 
59
- ## 🏁 Quick Start
58
+ ## Quick Start
60
59
 
61
60
  ### Step 1: Import the Module
62
61
 
@@ -127,7 +126,7 @@ export class MyComponent {
127
126
 
128
127
  ---
129
128
 
130
- ## 🎯 Core Concepts
129
+ ## Core Concepts
131
130
 
132
131
  ### 1. Commands
133
132
 
@@ -158,30 +157,85 @@ Define parameters and Foisit will automatically generate forms to collect them:
158
157
  }
159
158
  ```
160
159
 
160
+ **Enterprise-safe param collection controls**
161
+
162
+ - `collectRequiredViaForm` (default: true): when enabled, any missing/invalid required params are collected via a form—no conversational guessing.
163
+ - `allowAiParamExtraction` (default: true): when false, AI-extracted params are ignored; the assistant will always prompt the user for required fields.
164
+
165
+ Example:
166
+
167
+ ```typescript
168
+ {
169
+ command: 'secure create user',
170
+ description: 'No AI guessing, form-only',
171
+ collectRequiredViaForm: true,
172
+ allowAiParamExtraction: false,
173
+ parameters: [
174
+ { name: 'fullName', type: 'string', required: true },
175
+ { name: 'email', type: 'string', required: true },
176
+ { name: 'age', type: 'number', required: true, min: 18 },
177
+ ],
178
+ action: (params) => this.userService.create(params),
179
+ }
180
+ ```
181
+
161
182
  **Supported Parameter Types:**
162
183
 
163
184
  - `string` - Text input
164
185
  - `number` - Numeric input
165
186
  - `date` - Date picker
166
187
  - `select` - Dropdown (static or async options)
188
+ - `file` - File upload input
167
189
 
168
- ### 3. Critical Actions
190
+ ### 3. File Parameters
191
+
192
+ Collect files via the built-in form UI and receive them in your command `action`.
193
+
194
+ ```typescript
195
+ {
196
+ command: 'upload file',
197
+ description: 'Pick a file and return it to the action',
198
+ parameters: [
199
+ {
200
+ name: 'attachment',
201
+ type: 'file',
202
+ required: true,
203
+ accept: ['image/*', 'audio/*', 'video/*'],
204
+ multiple: false,
205
+ // delivery: 'file' | 'base64' (default: 'file')
206
+ delivery: 'file',
207
+ },
208
+ ],
209
+ action: async (params) => {
210
+ const file = params?.attachment as File | undefined;
211
+ if (!file) return { type: 'error', message: 'No file provided.' };
212
+ return {
213
+ type: 'success',
214
+ message: `File received. Name: ${file.name}, Type: ${file.type || 'unknown'}, Size: ${file.size} bytes`,
215
+ };
216
+ },
217
+ }
218
+ ```
219
+
220
+ `FileParameter` supports validations like `maxFiles`, `maxSizeBytes`, `maxTotalBytes`, and media/image constraints like `maxDurationSec`, `maxWidth`, and `maxHeight`.
221
+
222
+ ### 4. Critical Actions
169
223
 
170
224
  Protect dangerous operations with automatic confirmation dialogs:
171
225
 
172
226
  ```typescript
173
227
  {
174
228
  command: 'delete all data',
175
- critical: true, // 🔒 Requires confirmation
229
+ critical: true, // Requires confirmation
176
230
  description: 'Permanently delete all application data',
177
231
  action: async () => {
178
232
  await this.dataService.deleteAll();
179
- return 'All data deleted successfully.';
233
+ return 'All data deleted successfully.';
180
234
  }
181
235
  }
182
236
  ```
183
237
 
184
- ### 4. Select Parameters (Static)
238
+ ### 5. Select Parameters (Static)
185
239
 
186
240
  Provide predefined options:
187
241
 
@@ -201,7 +255,7 @@ Provide predefined options:
201
255
  }
202
256
  ```
203
257
 
204
- ### 5. Dynamic Select Parameters
258
+ ### 6. Dynamic Select Parameters
205
259
 
206
260
  Load options from APIs:
207
261
 
@@ -225,7 +279,7 @@ Load options from APIs:
225
279
 
226
280
  ---
227
281
 
228
- ## 📘 API Reference
282
+ ## API Reference
229
283
 
230
284
  ### `AssistantService`
231
285
 
@@ -250,7 +304,7 @@ this.assistant.toggle(
250
304
 
251
305
  ##### `addCommand(command, action?)`
252
306
 
253
- Dynamically add a command at runtime.
307
+ Dynamically add or update a command at runtime. Commands added via `addCommand` take effect immediately in the running application; they are stored in memory for the current session (they are not persisted after a page reload unless you re-register them during app startup).
254
308
 
255
309
  ```typescript
256
310
  // Add a simple command
@@ -280,6 +334,35 @@ this.assistant.addCommand({
280
334
  });
281
335
  ```
282
336
 
337
+ ### Dynamic Updates (Add / Remove / Update commands at runtime) ✅
338
+
339
+ - Use `addCommand` to register a new command or to replace an existing command's behavior (remove first if you want a clean replacement).
340
+ - Use `removeCommand(commandPhrase)` to unregister a command. This is useful for temporary or context-specific commands.
341
+ - Commands are in-memory only; to persist them across reloads, re-register on app startup (e.g., in an initialization hook).
342
+
343
+ Example — register a temporary command and clean it up in `ngOnDestroy`:
344
+
345
+ ```typescript
346
+ // component.ts
347
+ import { OnDestroy } from '@angular/core';
348
+
349
+ export class MyComponent implements OnDestroy {
350
+ constructor(private assistant: AssistantService) {
351
+ this.assistant.addCommand('temp action', () => 'Temporary action executed');
352
+ }
353
+
354
+ ngOnDestroy() {
355
+ // Remove the temporary command when component unmounts
356
+ this.assistant.removeCommand('temp action');
357
+ }
358
+ }
359
+ ```
360
+
361
+ Notes:
362
+
363
+ - If a command has only optional params, consider returning a `form` InteractiveResponse to prompt the user when no params are provided.
364
+ - Always remove transient commands in your cleanup lifecycle to avoid leaks and confusing UX.
365
+
283
366
  ##### `removeCommand(commandPhrase)`
284
367
 
285
368
  Remove a registered command.
@@ -299,7 +382,7 @@ console.log('Available commands:', commands);
299
382
 
300
383
  ---
301
384
 
302
- ## 🔧 Configuration Options
385
+ ## Configuration Options
303
386
 
304
387
  ### `AssistantConfig`
305
388
 
@@ -335,7 +418,7 @@ interface AssistantConfig {
335
418
 
336
419
  ---
337
420
 
338
- ## 🎨 Advanced Usage
421
+ ## Advanced Usage
339
422
 
340
423
  ### Example 1: Multi-Step Booking System
341
424
 
@@ -471,7 +554,7 @@ this.assistant.addCommand({
471
554
 
472
555
  ---
473
556
 
474
- ## 📝 TypeScript Support
557
+ ## TypeScript Support
475
558
 
476
559
  ### Full Type Definitions
477
560
 
@@ -505,7 +588,7 @@ const myCommand: AssistantCommand = {
505
588
 
506
589
  ---
507
590
 
508
- ## 🎯 Best Practices
591
+ ## Best Practices
509
592
 
510
593
  ### 1. Command Naming
511
594
 
@@ -571,7 +654,7 @@ export class MyComponent {
571
654
 
572
655
  ---
573
656
 
574
- ## 🧪 Testing
657
+ ## Testing
575
658
 
576
659
  ### Unit Testing Commands
577
660
 
@@ -606,7 +689,7 @@ describe('AssistantService', () => {
606
689
 
607
690
  ---
608
691
 
609
- ## Related Packages
692
+ ## Related Packages
610
693
 
611
694
  - **[@foisit/core](../core)** - Core engine (auto-installed)
612
695
  - **[@foisit/react-wrapper](../react-wrapper)** - React integration
@@ -614,7 +697,7 @@ describe('AssistantService', () => {
614
697
 
615
698
  ---
616
699
 
617
- ## 🐛 Troubleshooting
700
+ ## Troubleshooting
618
701
 
619
702
  ### Assistant not appearing
620
703
 
@@ -630,24 +713,24 @@ Make sure you're using Angular 17+ and have `@angular/core` installed.
630
713
 
631
714
  ---
632
715
 
633
- ## 📄 License
716
+ ## License
634
717
 
635
718
  MIT © [Foisit](https://github.com/boluwatifee4/foisit)
636
719
 
637
720
  ---
638
721
 
639
- ## 🤝 Contributing
722
+ ## Contributing
640
723
 
641
724
  Contributions are welcome! Please read our [Contributing Guide](../../CONTRIBUTING.md) first.
642
725
 
643
726
  ---
644
727
 
645
- ## 📬 Support
728
+ ## Support
646
729
 
647
- - 📧 Email: support@foisit.com
648
- - 💬 Discord: [Join our community](https://discord.gg/foisit)
649
- - 🐛 Issues: [GitHub Issues](https://github.com/boluwatifee4/foisit/issues)
730
+ - Email: support@foisit.com
731
+ - Discord: [Join our community](https://discord.gg/foisit)
732
+ - Issues: [GitHub Issues](https://github.com/boluwatifee4/foisit/issues)
650
733
 
651
734
  ---
652
735
 
653
- **Made with ❤️ by the Foisit Team**
736
+ **Made by the Foisit Team**
@@ -0,0 +1,288 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Inject, Injectable, NgModule } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import { CommandHandler, FallbackHandler, VoiceProcessor, TextToSpeech, StateManager, GestureHandler, OverlayManager } from '@foisit/core';
5
+
6
+ class AngularWrapperComponent {
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AngularWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: AngularWrapperComponent, isStandalone: true, selector: "lib-angular-wrapper", ngImport: i0, template: "<p>AngularWrapper works!</p>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
9
+ }
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AngularWrapperComponent, decorators: [{
11
+ type: Component,
12
+ args: [{ selector: 'lib-angular-wrapper', imports: [CommonModule], template: "<p>AngularWrapper works!</p>\n" }]
13
+ }] });
14
+
15
+ class AssistantService {
16
+ config;
17
+ commandHandler;
18
+ fallbackHandler;
19
+ voiceProcessor;
20
+ textToSpeech;
21
+ stateManager;
22
+ lastProcessedInput = '';
23
+ processingLock = false;
24
+ isActivated = false; // Tracks activation status
25
+ gestureHandler;
26
+ overlayManager;
27
+ defaultIntroMessage = 'How can I help you?';
28
+ constructor(config) {
29
+ this.config = config;
30
+ // Pass enableSmartIntent (default true) and potential apiKey (if we add it to config later)
31
+ this.commandHandler = new CommandHandler({
32
+ enableSmartIntent: this.config.enableSmartIntent !== false,
33
+ intentEndpoint: this.config.intentEndpoint,
34
+ });
35
+ this.fallbackHandler = new FallbackHandler();
36
+ this.voiceProcessor = new VoiceProcessor();
37
+ this.textToSpeech = new TextToSpeech();
38
+ this.stateManager = new StateManager();
39
+ this.gestureHandler = new GestureHandler();
40
+ this.overlayManager = new OverlayManager({
41
+ floatingButton: this.config.floatingButton,
42
+ inputPlaceholder: this.config.inputPlaceholder,
43
+ });
44
+ // Setup commands from config
45
+ this.config.commands.forEach((cmd) => this.commandHandler.addCommand(cmd));
46
+ // Setup fallback response
47
+ if (this.config.fallbackResponse) {
48
+ this.fallbackHandler.setFallbackMessage(this.config.fallbackResponse);
49
+ }
50
+ // Voice disabled for text-first pivot
51
+ // this.startListening();
52
+ // Setup double-tap/double-click listener
53
+ this.gestureHandler.setupDoubleTapListener(() => this.toggle());
54
+ // Register global callbacks for floating button
55
+ this.overlayManager.registerCallbacks(async (input) => {
56
+ if (typeof input === 'string') {
57
+ this.overlayManager.addMessage(input, 'user');
58
+ }
59
+ else if (input && typeof input === 'object') {
60
+ const label = this.extractUserLabel(input);
61
+ if (label) {
62
+ this.overlayManager.addMessage(label, 'user');
63
+ }
64
+ }
65
+ await this.handleCommand(input);
66
+ }, () => console.log('AssistantService: Overlay closed.'));
67
+ }
68
+ /** Start listening for activation and commands */
69
+ startListening() {
70
+ // Voice is currently disabled (text-only mode)
71
+ console.log('AssistantService: Voice is disabled; startListening() is a no-op.');
72
+ return;
73
+ /*
74
+ this.voiceProcessor.startListening(async (transcript: string) => {
75
+ if (this.processingLock) return;
76
+
77
+ const normalizedTranscript = transcript.toLowerCase().trim();
78
+
79
+ // Skip repeated or irrelevant inputs
80
+ if (
81
+ !normalizedTranscript ||
82
+ normalizedTranscript.length < 3 ||
83
+ normalizedTranscript === this.lastProcessedInput
84
+ ) {
85
+ console.log('AssistantService: Ignoring irrelevant input.');
86
+ return;
87
+ }
88
+
89
+ this.lastProcessedInput = normalizedTranscript;
90
+
91
+ if (!this.isActivated) {
92
+ await this.processActivation(normalizedTranscript);
93
+ return;
94
+ }
95
+
96
+ const isFallbackOrIntroMessage =
97
+ normalizedTranscript === this.config.fallbackResponse?.toLowerCase() ||
98
+ normalizedTranscript === this.config.introMessage?.toLowerCase() ||
99
+ normalizedTranscript === this.defaultIntroMessage.toLowerCase();
100
+
101
+ if (!isFallbackOrIntroMessage) {
102
+ await this.handleCommand(normalizedTranscript);
103
+ } else {
104
+ console.log('AssistantService: Ignoring fallback or intro message.');
105
+ }
106
+
107
+ // Throttle input processing to prevent rapid feedback
108
+ this.processingLock = true;
109
+ setTimeout(() => (this.processingLock = false), 1000);
110
+ });
111
+ */
112
+ }
113
+ /** Stop listening for voice input */
114
+ stopListening() {
115
+ // Voice is currently disabled (text-only mode)
116
+ console.log('AssistantService: Voice is disabled; stopListening() is a no-op.');
117
+ this.isActivated = false;
118
+ }
119
+ /** Reset activation state so the next activation flow can occur. */
120
+ reactivate() {
121
+ console.log('AssistantService: Reactivating assistant...');
122
+ this.isActivated = false;
123
+ try {
124
+ this.startListening();
125
+ }
126
+ catch {
127
+ // no-op
128
+ }
129
+ }
130
+ /** Process activation command */
131
+ async processActivation(transcript) {
132
+ const activationCmd = this.config.activationCommand?.toLowerCase();
133
+ // If no activation command is set, we can't activate via voice
134
+ if (!activationCmd)
135
+ return;
136
+ if (transcript === activationCmd) {
137
+ console.log('AssistantService: Activation matched.');
138
+ this.isActivated = true;
139
+ this.textToSpeech.speak(this.config.introMessage || this.defaultIntroMessage);
140
+ // this.stateManager.setState('listening'); // DISABLED - no gradient animation
141
+ }
142
+ else {
143
+ console.log('AssistantService: Activation command not recognized.');
144
+ }
145
+ }
146
+ /** Handle recognized commands */
147
+ async handleCommand(input) {
148
+ this.overlayManager.showLoading();
149
+ let response;
150
+ try {
151
+ response = await this.commandHandler.executeCommand(input);
152
+ }
153
+ finally {
154
+ this.overlayManager.hideLoading();
155
+ }
156
+ const originalText = typeof input === 'string' ? input : undefined;
157
+ this.processResponse(response, originalText);
158
+ }
159
+ /**
160
+ * Cleanup resources
161
+ */
162
+ destroy() {
163
+ this.voiceProcessor.stopListening();
164
+ this.gestureHandler.destroy();
165
+ this.overlayManager.destroy();
166
+ }
167
+ /** Unified response processing */
168
+ processResponse(response, originalText) {
169
+ if (response.type === 'error' && originalText) {
170
+ this.fallbackHandler.handleFallback(originalText);
171
+ this.overlayManager.addMessage(this.fallbackHandler.getFallbackMessage(), 'system');
172
+ return;
173
+ }
174
+ if (response.type === 'form' && response.fields) {
175
+ this.overlayManager.addForm(response.message, response.fields, async (data) => {
176
+ this.overlayManager.showLoading();
177
+ let nextReponse;
178
+ try {
179
+ nextReponse = await this.commandHandler.executeCommand(data);
180
+ }
181
+ finally {
182
+ this.overlayManager.hideLoading();
183
+ }
184
+ this.processResponse(nextReponse);
185
+ });
186
+ return;
187
+ }
188
+ if ((response.type === 'ambiguous' || response.type === 'confirm') && response.options) {
189
+ if (response.message) {
190
+ this.overlayManager.addMessage(response.message, 'system');
191
+ }
192
+ this.overlayManager.addOptions(response.options);
193
+ return;
194
+ }
195
+ if (response.message) {
196
+ this.overlayManager.addMessage(response.message, 'system');
197
+ }
198
+ }
199
+ /** Add a command dynamically (supports string or rich object) */
200
+ addCommand(commandOrObj, action) {
201
+ if (typeof commandOrObj === 'string') {
202
+ console.log(`AssistantService: Adding command "${commandOrObj}".`);
203
+ }
204
+ else {
205
+ console.log(`AssistantService: Adding rich command "${commandOrObj.command}".`);
206
+ }
207
+ this.commandHandler.addCommand(commandOrObj, action);
208
+ }
209
+ /** Remove a command dynamically */
210
+ removeCommand(command) {
211
+ console.log(`AssistantService: Removing command "${command}".`);
212
+ this.commandHandler.removeCommand(command);
213
+ }
214
+ /** Get all registered commands */
215
+ getCommands() {
216
+ return this.commandHandler.getCommands();
217
+ }
218
+ /** Toggle the assistant overlay */
219
+ toggle(onSubmit, onClose) {
220
+ console.log('AssistantService: Toggling overlay...');
221
+ this.overlayManager.toggle(async (input) => {
222
+ if (typeof input === 'string') {
223
+ this.overlayManager.addMessage(input, 'user');
224
+ }
225
+ else if (input && typeof input === 'object') {
226
+ const label = this.extractUserLabel(input);
227
+ if (label) {
228
+ this.overlayManager.addMessage(label, 'user');
229
+ }
230
+ }
231
+ if (onSubmit)
232
+ onSubmit(input);
233
+ await this.handleCommand(input);
234
+ }, () => {
235
+ console.log('AssistantService: Overlay closed.');
236
+ if (onClose)
237
+ onClose();
238
+ });
239
+ }
240
+ extractUserLabel(payload) {
241
+ const label = payload['label'];
242
+ if (typeof label === 'string' && label.trim()) {
243
+ return label.trim();
244
+ }
245
+ const commandId = payload['commandId'];
246
+ if (typeof commandId === 'string' && commandId.trim()) {
247
+ return commandId.trim();
248
+ }
249
+ return null;
250
+ }
251
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AssistantService, deps: [{ token: 'ASSISTANT_CONFIG' }], target: i0.ɵɵFactoryTarget.Injectable });
252
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AssistantService, providedIn: 'root' });
253
+ }
254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AssistantService, decorators: [{
255
+ type: Injectable,
256
+ args: [{
257
+ providedIn: 'root',
258
+ }]
259
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
260
+ type: Inject,
261
+ args: ['ASSISTANT_CONFIG']
262
+ }] }] });
263
+
264
+ class AssistantModule {
265
+ static forRoot(config) {
266
+ return {
267
+ ngModule: AssistantModule,
268
+ providers: [
269
+ { provide: 'ASSISTANT_CONFIG', useValue: config },
270
+ AssistantService,
271
+ ],
272
+ };
273
+ }
274
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AssistantModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
275
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: AssistantModule });
276
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AssistantModule });
277
+ }
278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: AssistantModule, decorators: [{
279
+ type: NgModule,
280
+ args: [{}]
281
+ }] });
282
+
283
+ /**
284
+ * Generated bundle index. Do not edit.
285
+ */
286
+
287
+ export { AngularWrapperComponent, AssistantModule, AssistantService };
288
+ //# sourceMappingURL=foisit-angular-wrapper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foisit-angular-wrapper.mjs","sources":["../../../../libs/angular-wrapper/src/lib/angular-wrapper/angular-wrapper.component.ts","../../../../libs/angular-wrapper/src/lib/angular-wrapper/angular-wrapper.component.html","../../../../libs/angular-wrapper/src/lib/service/assistant.service.ts","../../../../libs/angular-wrapper/src/lib/assistant.module.ts","../../../../libs/angular-wrapper/src/foisit-angular-wrapper.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'lib-angular-wrapper',\n imports: [CommonModule],\n templateUrl: './angular-wrapper.component.html',\n styleUrl: './angular-wrapper.component.css',\n})\nexport class AngularWrapperComponent {}\n","<p>AngularWrapper works!</p>\n","import { Injectable, Inject } from '@angular/core';\nimport {\n CommandHandler,\n FallbackHandler,\n VoiceProcessor,\n StateManager,\n AssistantConfig,\n TextToSpeech,\n GestureHandler,\n OverlayManager,\n AssistantCommand,\n AssistantCommandParams,\n InteractiveResponse,\n} from '@foisit/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AssistantService {\n private commandHandler: CommandHandler;\n private fallbackHandler: FallbackHandler;\n private voiceProcessor: VoiceProcessor;\n private textToSpeech: TextToSpeech;\n private stateManager: StateManager;\n private lastProcessedInput = '';\n private processingLock = false;\n private isActivated = false; // Tracks activation status\n private gestureHandler: GestureHandler;\n private overlayManager: OverlayManager;\n private defaultIntroMessage = 'How can I help you?';\n\n constructor(@Inject('ASSISTANT_CONFIG') private config: AssistantConfig) {\n // Pass enableSmartIntent (default true) and potential apiKey (if we add it to config later)\n this.commandHandler = new CommandHandler({\n enableSmartIntent: this.config.enableSmartIntent !== false,\n intentEndpoint: this.config.intentEndpoint,\n });\n this.fallbackHandler = new FallbackHandler();\n this.voiceProcessor = new VoiceProcessor();\n this.textToSpeech = new TextToSpeech();\n this.stateManager = new StateManager();\n this.gestureHandler = new GestureHandler();\n this.overlayManager = new OverlayManager({\n floatingButton: this.config.floatingButton,\n inputPlaceholder: this.config.inputPlaceholder,\n });\n\n // Setup commands from config\n this.config.commands.forEach((cmd) => this.commandHandler.addCommand(cmd));\n\n // Setup fallback response\n if (this.config.fallbackResponse) {\n this.fallbackHandler.setFallbackMessage(this.config.fallbackResponse);\n }\n\n // Voice disabled for text-first pivot\n // this.startListening();\n\n // Setup double-tap/double-click listener\n this.gestureHandler.setupDoubleTapListener(() => this.toggle());\n\n // Register global callbacks for floating button\n this.overlayManager.registerCallbacks(\n async (input) => {\n if (typeof input === 'string') {\n this.overlayManager.addMessage(input, 'user');\n } else if (input && typeof input === 'object') {\n const label = this.extractUserLabel(input as Record<string, unknown>);\n if (label) {\n this.overlayManager.addMessage(label, 'user');\n }\n }\n\n await this.handleCommand(input);\n },\n () => console.log('AssistantService: Overlay closed.')\n );\n }\n\n /** Start listening for activation and commands */\n startListening(): void {\n // Voice is currently disabled (text-only mode)\n console.log('AssistantService: Voice is disabled; startListening() is a no-op.');\n return;\n\n /*\n this.voiceProcessor.startListening(async (transcript: string) => {\n if (this.processingLock) return;\n\n const normalizedTranscript = transcript.toLowerCase().trim();\n\n // Skip repeated or irrelevant inputs\n if (\n !normalizedTranscript ||\n normalizedTranscript.length < 3 ||\n normalizedTranscript === this.lastProcessedInput\n ) {\n console.log('AssistantService: Ignoring irrelevant input.');\n return;\n }\n\n this.lastProcessedInput = normalizedTranscript;\n\n if (!this.isActivated) {\n await this.processActivation(normalizedTranscript);\n return;\n }\n\n const isFallbackOrIntroMessage =\n normalizedTranscript === this.config.fallbackResponse?.toLowerCase() ||\n normalizedTranscript === this.config.introMessage?.toLowerCase() ||\n normalizedTranscript === this.defaultIntroMessage.toLowerCase();\n\n if (!isFallbackOrIntroMessage) {\n await this.handleCommand(normalizedTranscript);\n } else {\n console.log('AssistantService: Ignoring fallback or intro message.');\n }\n\n // Throttle input processing to prevent rapid feedback\n this.processingLock = true;\n setTimeout(() => (this.processingLock = false), 1000);\n });\n */\n }\n\n /** Stop listening for voice input */\n stopListening(): void {\n // Voice is currently disabled (text-only mode)\n console.log('AssistantService: Voice is disabled; stopListening() is a no-op.');\n this.isActivated = false;\n }\n\n /** Reset activation state so the next activation flow can occur. */\n reactivate(): void {\n console.log('AssistantService: Reactivating assistant...');\n this.isActivated = false;\n try {\n this.startListening();\n } catch {\n // no-op\n }\n }\n\n /** Process activation command */\n private async processActivation(transcript: string): Promise<void> {\n const activationCmd = this.config.activationCommand?.toLowerCase();\n\n // If no activation command is set, we can't activate via voice\n if (!activationCmd) return;\n\n if (transcript === activationCmd) {\n console.log('AssistantService: Activation matched.');\n this.isActivated = true;\n this.textToSpeech.speak(\n this.config.introMessage || this.defaultIntroMessage\n );\n // this.stateManager.setState('listening'); // DISABLED - no gradient animation\n } else {\n console.log('AssistantService: Activation command not recognized.');\n }\n }\n\n /** Handle recognized commands */\n private async handleCommand(\n input: string | Record<string, unknown>\n ): Promise<void> {\n this.overlayManager.showLoading();\n let response: InteractiveResponse;\n try {\n response = await this.commandHandler.executeCommand(input);\n } finally {\n this.overlayManager.hideLoading();\n }\n\n const originalText = typeof input === 'string' ? input : undefined;\n this.processResponse(response, originalText);\n }\n\n /**\n * Cleanup resources\n */\n destroy(): void {\n this.voiceProcessor.stopListening();\n this.gestureHandler.destroy();\n this.overlayManager.destroy();\n }\n\n /** Unified response processing */\n private processResponse(\n response: InteractiveResponse,\n originalText?: string\n ): void {\n if (response.type === 'error' && originalText) {\n this.fallbackHandler.handleFallback(originalText);\n this.overlayManager.addMessage(this.fallbackHandler.getFallbackMessage(), 'system');\n return;\n }\n\n if (response.type === 'form' && response.fields) {\n this.overlayManager.addForm(\n response.message,\n response.fields,\n async (data: Record<string, unknown>) => {\n this.overlayManager.showLoading();\n let nextReponse: InteractiveResponse;\n try {\n nextReponse = await this.commandHandler.executeCommand(data);\n } finally {\n this.overlayManager.hideLoading();\n }\n this.processResponse(nextReponse);\n }\n );\n return;\n }\n\n if ((response.type === 'ambiguous' || response.type === 'confirm') && response.options) {\n if (response.message) {\n this.overlayManager.addMessage(response.message, 'system');\n }\n this.overlayManager.addOptions(response.options);\n return;\n }\n\n if (response.message) {\n this.overlayManager.addMessage(response.message, 'system');\n }\n }\n\n /** Add a command dynamically (supports string or rich object) */\n addCommand(\n commandOrObj: string | AssistantCommand,\n action?: (\n params?: AssistantCommandParams\n ) => Promise<string | InteractiveResponse | void> | void\n ): void {\n if (typeof commandOrObj === 'string') {\n console.log(`AssistantService: Adding command \"${commandOrObj}\".`);\n } else {\n console.log(\n `AssistantService: Adding rich command \"${commandOrObj.command}\".`\n );\n }\n this.commandHandler.addCommand(commandOrObj, action);\n }\n\n /** Remove a command dynamically */\n removeCommand(command: string): void {\n console.log(`AssistantService: Removing command \"${command}\".`);\n this.commandHandler.removeCommand(command);\n }\n\n /** Get all registered commands */\n getCommands(): string[] {\n return this.commandHandler.getCommands();\n }\n\n /** Toggle the assistant overlay */\n toggle(\n onSubmit?: (input: string | Record<string, unknown>) => void,\n onClose?: () => void\n ): void {\n console.log('AssistantService: Toggling overlay...');\n this.overlayManager.toggle(\n async (input) => {\n if (typeof input === 'string') {\n this.overlayManager.addMessage(input, 'user');\n } else if (input && typeof input === 'object') {\n const label = this.extractUserLabel(input);\n if (label) {\n this.overlayManager.addMessage(label, 'user');\n }\n }\n\n if (onSubmit) onSubmit(input);\n await this.handleCommand(input);\n },\n () => {\n console.log('AssistantService: Overlay closed.');\n if (onClose) onClose();\n }\n );\n }\n\n private extractUserLabel(payload: Record<string, unknown>): string | null {\n const label = payload['label'];\n if (typeof label === 'string' && label.trim()) {\n return label.trim();\n }\n\n const commandId = payload['commandId'];\n if (typeof commandId === 'string' && commandId.trim()) {\n return commandId.trim();\n }\n\n return null;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { AssistantService } from './service/assistant.service';\nimport { AssistantConfig } from '@foisit/core';\n\n@NgModule({})\nexport class AssistantModule {\n static forRoot(config: AssistantConfig): ModuleWithProviders<AssistantModule> {\n return {\n ngModule: AssistantModule,\n providers: [\n { provide: 'ASSISTANT_CONFIG', useValue: config },\n AssistantService,\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MASa,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECTpC,gCACA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIY,YAAY,EAAA,CAAA,EAAA,CAAA;;2FAIX,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;+BACE,qBAAqB,EAAA,OAAA,EACtB,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,gCAAA,EAAA;;;MEaZ,gBAAgB,CAAA;AAaqB,IAAA,MAAA;AAZxC,IAAA,cAAc;AACd,IAAA,eAAe;AACf,IAAA,cAAc;AACd,IAAA,YAAY;AACZ,IAAA,YAAY;IACZ,kBAAkB,GAAG,EAAE;IACvB,cAAc,GAAG,KAAK;AACtB,IAAA,WAAW,GAAG,KAAK,CAAC;AACpB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ED
@@ -0,0 +1,3 @@
1
+ export * from './lib/angular-wrapper/angular-wrapper.component';
2
+ export * from './lib/service/assistant.service';
3
+ export * from './lib/assistant.module';
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@foisit/angular-wrapper",
3
- "version": "2.1.1",
3
+ "version": "2.4.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
7
7
  },
8
8
  "sideEffects": false,
9
9
  "files": [
10
- "dist",
10
+ "fesm2022",
11
+ "esm2022",
12
+ "index.d.ts",
11
13
  "README.md"
12
14
  ],
13
15
  "description": "Foisit: Speak, and its done. A voice assistant library for angular apps",