UNPKG

humanbehavior-js

Version:

SDK for HumanBehavior session and event recording

114 lines (89 loc) • 3.74 kB
# HumanBehavior SDK Wizard Module This module provides AI-enhanced auto-installation capabilities for the HumanBehavior SDK. ## šŸ“ Directory Structure ``` src/wizard/ ā”œā”€ā”€ core/ # Core installation wizard │ └── install-wizard.ts ā”œā”€ā”€ ai/ # AI-enhanced wizard components │ └── ai-install-wizard.ts ā”œā”€ā”€ cli/ # Command-line interfaces │ ā”œā”€ā”€ auto-install.ts │ └── ai-auto-install.ts ā”œā”€ā”€ services/ # AI service implementations │ ā”œā”€ā”€ remote-ai-service.ts │ └── centralized-ai-service.ts ā”œā”€ā”€ index.ts # Main exports └── README.md # This file ``` ## šŸš€ Key Components ### Core (`core/`) - **`install-wizard.ts`**: Traditional installation wizard - Framework detection and code modification - Environment variable management - Package installation ### AI (`ai/`) - **`ai-install-wizard.ts`**: AI-enhanced installation wizard - AI-powered framework detection - Intelligent code analysis - Conflict resolution - Learning system ### CLI (`cli/`) - **`auto-install.ts`**: Traditional CLI interface - **`ai-auto-install.ts`**: AI-enhanced CLI interface - User interaction and command parsing - Installation mode selection ### Services (`services/`) - **`remote-ai-service.ts`**: Connects to deployed Lambda AI service - **`centralized-ai-service.ts`**: Local AI service implementation - Heuristic fallback when AI is unavailable ## šŸ”§ Usage ### Traditional Installation ```typescript import { AutoInstallationWizard } from 'humanbehavior-js/wizard'; const wizard = new AutoInstallationWizard(apiKey, projectPath); const result = await wizard.install(); ``` ### AI-Enhanced Installation ```typescript import { AIEnhancedInstallationWizard, RemoteAIService } from 'humanbehavior-js/wizard'; const aiService = new RemoteAIService({ apiEndpoint: 'https://your-lambda-api.execute-api.region.amazonaws.com/prod' }); const wizard = new AIEnhancedInstallationWizard(apiKey, projectPath, aiService); const result = await wizard.install(); ``` ### CLI Usage ```bash # Traditional installation npx humanbehavior-js auto-install YOUR_API_KEY # AI-enhanced installation npx humanbehavior-js ai-auto-install YOUR_API_KEY --ai ``` ## 🧠 AI Features - **Intelligent Framework Detection**: Beyond package.json analysis - **Code Pattern Analysis**: Understands project structure and patterns - **Conflict Resolution**: Smart handling of existing integrations - **Future-Proofing**: Adaptive strategies for new frameworks - **Learning System**: Improves over time with usage patterns ## šŸ”„ Backward Compatibility All existing imports continue to work: - `humanbehavior-js/install-wizard` → `humanbehavior-js/wizard` - Traditional wizard functionality unchanged - AI features are additive, not breaking ## šŸš€ Lambda Deployment 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. ### šŸ“ Lambda Deployment Structure ``` lambda-deployment/ ā”œā”€ā”€ index.js # Lambda entry point ā”œā”€ā”€ ai-install-wizard.ts # AI service implementation ā”œā”€ā”€ install-wizard.ts # Core wizard logic ā”œā”€ā”€ centralized-ai-service.ts # AI service interface └── README.md # Deployment documentation ``` ### šŸ”— Client-Server Relationship - **Client**: `src/wizard/` - User-facing installation wizard - **Server**: `lambda-deployment/` - AI service backend - **Connection**: `RemoteAIService` connects client to Lambda See `lambda-deployment/README.md` for detailed deployment instructions.