@foisit/angular-wrapper 0.0.1 → 2.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 +95 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,98 @@
|
|
|
1
|
-
# angular-wrapper
|
|
1
|
+
# @foisit/angular-wrapper
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Power your Angular apps with an AI-driven text assistant.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> [!NOTE]
|
|
6
|
+
> 🎙️ **Coming Soon**: Voice recognition and responses are planned for a future release. Current support is focused on text-based interactions and AI intent matching.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🚀 Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @foisit/angular-wrapper
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🔧 Basic Setup
|
|
19
|
+
|
|
20
|
+
### 1. Import `AssistantModule`
|
|
21
|
+
|
|
22
|
+
Add `AssistantModule.forRoot()` to your `app.config.ts` (for Standalone) or `app.module.ts`.
|
|
23
|
+
|
|
24
|
+
#### `app.config.ts` (Standalone)
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { AssistantModule } from '@foisit/angular-wrapper';
|
|
28
|
+
|
|
29
|
+
export const appConfig: ApplicationConfig = {
|
|
30
|
+
providers: [
|
|
31
|
+
importProvidersFrom(
|
|
32
|
+
AssistantModule.forRoot({
|
|
33
|
+
enableSmartIntent: true,
|
|
34
|
+
introMessage: 'Welcome! How can I help?',
|
|
35
|
+
commands: [
|
|
36
|
+
{
|
|
37
|
+
command: 'profile',
|
|
38
|
+
action: () => router.navigate(['/profile']),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
})
|
|
42
|
+
),
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🛡️ Critical Actions
|
|
50
|
+
|
|
51
|
+
Commands marked as `critical` will automatically trigger a confirmation flow in the UI.
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
const config = {
|
|
55
|
+
commands: [
|
|
56
|
+
{
|
|
57
|
+
command: 'delete post',
|
|
58
|
+
critical: true,
|
|
59
|
+
description: 'permanently delete this post',
|
|
60
|
+
action: () => this.postService.delete(),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 🧠 AI Intent Matching
|
|
69
|
+
|
|
70
|
+
Enable `enableSmartIntent: true` to allow the assistant to understand natural language.
|
|
71
|
+
|
|
72
|
+
**User says:** _"Go to my profile"_
|
|
73
|
+
**Matched Command:** `{ command: 'profile', keywords: ['account', 'user settings'], ... }`
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🛠️ Service Usage: `AssistantService`
|
|
78
|
+
|
|
79
|
+
Interact with the assistant dynamically from your components.
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { AssistantService } from '@foisit/angular-wrapper';
|
|
83
|
+
|
|
84
|
+
@Component({...})
|
|
85
|
+
export class MyComponent {
|
|
86
|
+
constructor(private assistant: AssistantService) {}
|
|
87
|
+
|
|
88
|
+
addCommand() {
|
|
89
|
+
this.assistant.addCommand('clear', () => this.clearAll());
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 👋 Gesture Activation
|
|
97
|
+
|
|
98
|
+
Once integrated, a subtle **"Powered by Foisit"** watermark appears. **Double-click** it to open the chat overlay.
|