humanbehavior-js 0.4.7 → 0.4.8
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/dist/cjs/angular/index.cjs +5 -6
- package/dist/cjs/angular/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +5 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/install-wizard.cjs +4 -2
- package/dist/cjs/install-wizard.cjs.map +1 -1
- package/dist/cjs/react/index.cjs +5 -6
- package/dist/cjs/react/index.cjs.map +1 -1
- package/dist/cjs/remix/index.cjs +5 -6
- package/dist/cjs/remix/index.cjs.map +1 -1
- package/dist/cjs/svelte/index.cjs +5 -6
- package/dist/cjs/svelte/index.cjs.map +1 -1
- package/dist/cjs/vue/index.cjs +5 -6
- package/dist/cjs/vue/index.cjs.map +1 -1
- package/dist/cjs/wizard/index.cjs +3208 -0
- package/dist/cjs/wizard/index.cjs.map +1 -0
- package/dist/cli/ai-auto-install.js +2024 -0
- package/dist/cli/ai-auto-install.js.map +1 -0
- package/dist/cli/auto-install.js +4 -2
- package/dist/cli/auto-install.js.map +1 -1
- package/dist/esm/angular/index.js +5 -6
- package/dist/esm/angular/index.js.map +1 -1
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/install-wizard.js +4 -2
- package/dist/esm/install-wizard.js.map +1 -1
- package/dist/esm/react/index.js +5 -6
- package/dist/esm/react/index.js.map +1 -1
- package/dist/esm/remix/index.js +5 -6
- package/dist/esm/remix/index.js.map +1 -1
- package/dist/esm/svelte/index.js +5 -6
- package/dist/esm/svelte/index.js.map +1 -1
- package/dist/esm/vue/index.js +5 -6
- package/dist/esm/vue/index.js.map +1 -1
- package/dist/esm/wizard/index.js +3178 -0
- package/dist/esm/wizard/index.js.map +1 -0
- package/dist/index.min.js.map +1 -1
- package/dist/types/install-wizard.d.ts +8 -8
- package/dist/types/wizard/index.d.ts +489 -0
- package/package.json +14 -8
- package/rollup.config.js +65 -3
- package/src/react/AutoInstallWizard.tsx +1 -1
- package/src/tracker.ts +5 -6
- package/src/wizard/README.md +114 -0
- package/src/wizard/ai/ai-install-wizard.ts +894 -0
- package/src/wizard/ai/manual-framework-wizard.ts +236 -0
- package/src/wizard/cli/ai-auto-install.ts +369 -0
- package/src/{cli → wizard/cli}/auto-install.ts +1 -1
- package/src/{install-wizard.ts → wizard/core/install-wizard.ts} +12 -10
- package/src/wizard/index.ts +23 -0
- package/src/wizard/services/centralized-ai-service.ts +668 -0
- package/src/wizard/services/remote-ai-service.ts +224 -0
package/src/tracker.ts
CHANGED
|
@@ -229,7 +229,7 @@ export class HumanBehaviorTracker {
|
|
|
229
229
|
// Track navigation event
|
|
230
230
|
this.trackNavigationEvent('pushState', this.previousUrl, this.currentUrl);
|
|
231
231
|
|
|
232
|
-
// Take FullSnapshot on navigation
|
|
232
|
+
// Take FullSnapshot on navigation
|
|
233
233
|
this.takeFullSnapshot();
|
|
234
234
|
};
|
|
235
235
|
|
|
@@ -244,7 +244,7 @@ export class HumanBehaviorTracker {
|
|
|
244
244
|
// Track navigation event
|
|
245
245
|
this.trackNavigationEvent('replaceState', this.previousUrl, this.currentUrl);
|
|
246
246
|
|
|
247
|
-
// Take FullSnapshot on navigation
|
|
247
|
+
// Take FullSnapshot on navigation
|
|
248
248
|
this.takeFullSnapshot();
|
|
249
249
|
};
|
|
250
250
|
|
|
@@ -254,7 +254,7 @@ export class HumanBehaviorTracker {
|
|
|
254
254
|
this.currentUrl = window.location.href;
|
|
255
255
|
this.trackNavigationEvent('popstate', this.previousUrl, this.currentUrl);
|
|
256
256
|
|
|
257
|
-
// Take FullSnapshot on navigation
|
|
257
|
+
// Take FullSnapshot on navigation
|
|
258
258
|
this.takeFullSnapshot();
|
|
259
259
|
};
|
|
260
260
|
|
|
@@ -797,9 +797,8 @@ export class HumanBehaviorTracker {
|
|
|
797
797
|
// ✅ CANVAS RECORDING - Disabled to prevent large data URIs
|
|
798
798
|
recordCanvas: false, // Disabled to prevent large data URIs
|
|
799
799
|
|
|
800
|
-
// ✅ FULLSNAPSHOT GENERATION -
|
|
801
|
-
//
|
|
802
|
-
// They rely on initial FullSnapshot + navigation-triggered ones only
|
|
800
|
+
// ✅ FULLSNAPSHOT GENERATION - No periodic snapshots to avoid animation issues
|
|
801
|
+
// Rely on initial FullSnapshot + navigation-triggered ones only
|
|
803
802
|
});
|
|
804
803
|
|
|
805
804
|
// Store the record instance for cleanup
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# HumanBehavior SDK Wizard Module
|
|
2
|
+
|
|
3
|
+
This module provides AI-enhanced auto-installation capabilities for the HumanBehavior SDK.
|
|
4
|
+
|
|
5
|
+
## 📁 Directory Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/wizard/
|
|
9
|
+
├── core/ # Core installation wizard
|
|
10
|
+
│ └── install-wizard.ts
|
|
11
|
+
├── ai/ # AI-enhanced wizard components
|
|
12
|
+
│ └── ai-install-wizard.ts
|
|
13
|
+
├── cli/ # Command-line interfaces
|
|
14
|
+
│ ├── auto-install.ts
|
|
15
|
+
│ └── ai-auto-install.ts
|
|
16
|
+
├── services/ # AI service implementations
|
|
17
|
+
│ ├── remote-ai-service.ts
|
|
18
|
+
│ └── centralized-ai-service.ts
|
|
19
|
+
├── index.ts # Main exports
|
|
20
|
+
└── README.md # This file
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 🚀 Key Components
|
|
24
|
+
|
|
25
|
+
### Core (`core/`)
|
|
26
|
+
- **`install-wizard.ts`**: Traditional installation wizard
|
|
27
|
+
- Framework detection and code modification
|
|
28
|
+
- Environment variable management
|
|
29
|
+
- Package installation
|
|
30
|
+
|
|
31
|
+
### AI (`ai/`)
|
|
32
|
+
- **`ai-install-wizard.ts`**: AI-enhanced installation wizard
|
|
33
|
+
- AI-powered framework detection
|
|
34
|
+
- Intelligent code analysis
|
|
35
|
+
- Conflict resolution
|
|
36
|
+
- Learning system
|
|
37
|
+
|
|
38
|
+
### CLI (`cli/`)
|
|
39
|
+
- **`auto-install.ts`**: Traditional CLI interface
|
|
40
|
+
- **`ai-auto-install.ts`**: AI-enhanced CLI interface
|
|
41
|
+
- User interaction and command parsing
|
|
42
|
+
- Installation mode selection
|
|
43
|
+
|
|
44
|
+
### Services (`services/`)
|
|
45
|
+
- **`remote-ai-service.ts`**: Connects to deployed Lambda AI service
|
|
46
|
+
- **`centralized-ai-service.ts`**: Local AI service implementation
|
|
47
|
+
- Heuristic fallback when AI is unavailable
|
|
48
|
+
|
|
49
|
+
## 🔧 Usage
|
|
50
|
+
|
|
51
|
+
### Traditional Installation
|
|
52
|
+
```typescript
|
|
53
|
+
import { AutoInstallationWizard } from 'humanbehavior-js/wizard';
|
|
54
|
+
|
|
55
|
+
const wizard = new AutoInstallationWizard(apiKey, projectPath);
|
|
56
|
+
const result = await wizard.install();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### AI-Enhanced Installation
|
|
60
|
+
```typescript
|
|
61
|
+
import { AIEnhancedInstallationWizard, RemoteAIService } from 'humanbehavior-js/wizard';
|
|
62
|
+
|
|
63
|
+
const aiService = new RemoteAIService({
|
|
64
|
+
apiEndpoint: 'https://your-lambda-api.execute-api.region.amazonaws.com/prod'
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const wizard = new AIEnhancedInstallationWizard(apiKey, projectPath, aiService);
|
|
68
|
+
const result = await wizard.install();
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### CLI Usage
|
|
72
|
+
```bash
|
|
73
|
+
# Traditional installation
|
|
74
|
+
npx humanbehavior-js auto-install YOUR_API_KEY
|
|
75
|
+
|
|
76
|
+
# AI-enhanced installation
|
|
77
|
+
npx humanbehavior-js ai-auto-install YOUR_API_KEY --ai
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 🧠 AI Features
|
|
81
|
+
|
|
82
|
+
- **Intelligent Framework Detection**: Beyond package.json analysis
|
|
83
|
+
- **Code Pattern Analysis**: Understands project structure and patterns
|
|
84
|
+
- **Conflict Resolution**: Smart handling of existing integrations
|
|
85
|
+
- **Future-Proofing**: Adaptive strategies for new frameworks
|
|
86
|
+
- **Learning System**: Improves over time with usage patterns
|
|
87
|
+
|
|
88
|
+
## 🔄 Backward Compatibility
|
|
89
|
+
|
|
90
|
+
All existing imports continue to work:
|
|
91
|
+
- `humanbehavior-js/install-wizard` → `humanbehavior-js/wizard`
|
|
92
|
+
- Traditional wizard functionality unchanged
|
|
93
|
+
- AI features are additive, not breaking
|
|
94
|
+
|
|
95
|
+
## 🚀 Lambda Deployment
|
|
96
|
+
|
|
97
|
+
The `lambda-deployment/` directory contains the AI service for AWS Lambda deployment. This is separate from the client-side wizard code and should not be modified unless deploying AI service updates.
|
|
98
|
+
|
|
99
|
+
### 📁 Lambda Deployment Structure
|
|
100
|
+
```
|
|
101
|
+
lambda-deployment/
|
|
102
|
+
├── index.js # Lambda entry point
|
|
103
|
+
├── ai-install-wizard.ts # AI service implementation
|
|
104
|
+
├── install-wizard.ts # Core wizard logic
|
|
105
|
+
├── centralized-ai-service.ts # AI service interface
|
|
106
|
+
└── README.md # Deployment documentation
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 🔗 Client-Server Relationship
|
|
110
|
+
- **Client**: `src/wizard/` - User-facing installation wizard
|
|
111
|
+
- **Server**: `lambda-deployment/` - AI service backend
|
|
112
|
+
- **Connection**: `RemoteAIService` connects client to Lambda
|
|
113
|
+
|
|
114
|
+
See `lambda-deployment/README.md` for detailed deployment instructions.
|