This is a VSCode web extension that allows users to edit ImmyBot scripts directly from VS Code. The extension provides:
- Authentication with ImmyBot instances via Microsoft OAuth
- Tree view for browsing local and global script repositories
- In-memory file system for editing scripts using
immyfs://scheme - PowerShell language server integration
- Script management capabilities (create, edit, save, delete)
src/web/extension.ts- Main extension entry point and orchestratorsrc/web/authentication.ts- Microsoft OAuth authentication and JWT handlingsrc/web/immyBotFileSystemProvider.ts- Virtual file system providersrc/web/treeProvider.ts- Tree view providers for script repositoriessrc/web/scriptManager.ts- Script fetching and managementsrc/web/commands.ts- Command handlers and registrationssrc/web/immyBotClient.ts- HTTP client for ImmyBot APIsrc/web/languageServer.ts- PowerShell language server integration
- Node.js >= 20.0.0
- npm
- VSCode
- PowerShell
npm install- Build:
npm run compile-web- Compiles TypeScript to JavaScript - Package:
npm run package-web- Production build - Lint:
npm run lint- Runs oxlint + eslint - Test:
npm run test- Runs web extension tests
IMPORTANT: Always use Test-ImmyBotExtension.ps1 to test code changes instead of manually running individual commands or attempting to gather logs yourself.
# Test with default 15-second timeout
./Test-ImmyBotExtension.ps1
# Test with custom timeout
./Test-ImmyBotExtension.ps1 -TimeoutSeconds 30The script automatically:
- Builds the extension and exits on failure
- Creates an isolated VSCode environment with fresh logs
- Launches VSCode with the extension loaded
- Waits for extension activation and operation
- Analyzes logs for extension activity and errors
- Cleans up processes and temporary files
This provides a complete test cycle in one command with proper log analysis, eliminating the need for manual build commands, log hunting, or process management.
The extension integrates with the ImmyBot REST API:
- Scripts:
/api/v1/scripts/local,/api/v1/scripts/global - Authentication: Microsoft OAuth with JWT tokens
- Categories: Software Detection (0), Software Version Action (2), Function (7), Module (11), Integration (13)
- Contexts: Metascript (2), CloudScript (4), System (0), User (1)
immybot-vscode/
├── src/web/ # Extension source code
│ ├── extension.ts # Main entry point
│ ├── authentication.ts # OAuth authentication
│ ├── immyBotFileSystemProvider.ts # Virtual file system
│ ├── treeProvider.ts # Tree view providers
│ ├── scriptManager.ts # Script management
│ ├── commands.ts # Command handlers
│ ├── immyBotClient.ts # API client
│ ├── languageServer.ts # Language server setup
│ └── types.ts # TypeScript definitions
├── Test-ImmyBotExtension.ps1 # Testing script
├── package.json # Extension manifest
└── README.md # Basic documentation
- Code Style: Uses oxlint + eslint for linting
- Testing: Always use
Test-ImmyBotExtension.ps1for testing changes - Architecture: Follow single responsibility principle
- State Management: Centralized state through
ExtensionStateinterface
- OAuth tokens stored securely in VSCode's secret storage
- API keys never logged or exposed in plain text
- Instance URLs validated against HTTPS pattern
- User data isolated per VSCode instance
This extension enables seamless ImmyBot script development directly within VSCode, providing a familiar development environment for PowerShell automation scripts.