@veolab/discoverylab 0.1.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/.claude-plugin/marketplace.json +15 -0
- package/.claude-plugin/plugin.json +12 -0
- package/.mcp.json +6 -0
- package/README.md +214 -0
- package/assets/applab-discovery.jpeg +0 -0
- package/assets/backgrounds/abstract-colorful-gradient-orange-background.jpg +0 -0
- package/assets/backgrounds/blurred-colorful-luxury-gradient-rainbow-abstract.jpg +0 -0
- package/assets/backgrounds/glowing-neon-moving-continuously-looking-bright.jpg +0 -0
- package/assets/backgrounds/glowing-neon-moving-continuously-looking-bright2.jpg +0 -0
- package/assets/backgrounds/macos-big-sur-apple-layers-fluidic-colorful-wwdc-stock-4096x2304-1455.jpg +0 -0
- package/assets/backgrounds/macos-sierra-mountain-peak-sunset-evening-stock-5k-5120x3684-3987.jpg +0 -0
- package/assets/backgrounds/macos-tahoe-26-5120x2880-22674.jpg +0 -0
- package/assets/backgrounds/macos-tahoe-26-5120x2880-22675.jpg +0 -0
- package/assets/backgrounds/view-of-the-sea-from-the-window-of-an-airplane-2024-10-21-11-25-30-utc.jpg +0 -0
- package/assets/cursor/cursor-blue.png +0 -0
- package/assets/icons/android-head_3D.png +0 -0
- package/assets/icons/apple-logo.png +0 -0
- package/assets/icons/apple-logo.svg +4 -0
- package/assets/icons/claude-ai-icon.svg +1 -0
- package/assets/icons/icons8-apple-intelligence-48.png +0 -0
- package/assets/icons/icons8-apple-intelligence-96.png +0 -0
- package/dist/chunk-7IDQLLBW.js +311 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-MN6LCZHZ.js +1320 -0
- package/dist/chunk-PBHUHSC3.js +6002 -0
- package/dist/chunk-QJXXHOV7.js +205 -0
- package/dist/chunk-SSRXIO2V.js +6822 -0
- package/dist/chunk-VY3BLXBW.js +329 -0
- package/dist/chunk-W3WJGYR6.js +354 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +120 -0
- package/dist/db-IWIL65EX.js +33 -0
- package/dist/gridCompositor-ENKLFPWR.js +409 -0
- package/dist/index.d.ts +1648 -0
- package/dist/index.js +869 -0
- package/dist/ocr-UTWC7537.js +21 -0
- package/dist/server-3FBHBA7L.js +15 -0
- package/dist/server-NM5CKDUU.js +13 -0
- package/dist/setup-27CQAX6K.js +17 -0
- package/dist/tools-75BAPCUM.js +177 -0
- package/package.json +84 -0
- package/skills/generate-assets/SKILL.md +44 -0
- package/skills/mobile-test/SKILL.md +33 -0
- package/skills/open-ui/SKILL.md +24 -0
- package/skills/quick-capture/SKILL.md +28 -0
- package/skills/task-hub/SKILL.md +44 -0
- package/skills/web-test/SKILL.md +41 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "veolab-plugins",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Anderson Melo"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "discoverylab",
|
|
9
|
+
"source": ".",
|
|
10
|
+
"description": "AI-powered app testing & marketing asset generator",
|
|
11
|
+
"version": "0.1.0",
|
|
12
|
+
"keywords": ["app-testing", "maestro", "playwright", "mcp", "mobile", "web", "screenshots"]
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "discoverylab",
|
|
3
|
+
"description": "AI-powered app testing & marketing asset generator",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Anderson Melo"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/veolab/applab-discovery",
|
|
9
|
+
"repository": "https://github.com/veolab/applab-discovery",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": ["app-testing", "maestro", "playwright", "screenshots", "mcp", "mobile", "web"]
|
|
12
|
+
}
|
package/.mcp.json
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# AppLab Discovery
|
|
2
|
+
|
|
3
|
+
> AI-Powered App Testing & Marketing Asset Generator
|
|
4
|
+
|
|
5
|
+
A localhost-first tool for developers that combines automated testing, AI analysis, and marketing asset generation. Distributed as a Claude Code Plugin (MCP Server).
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
### Core Features
|
|
12
|
+
- **Video Analysis** - Extract frames, OCR text, detect features using Apple Intelligence
|
|
13
|
+
- **3D Mockups** - Professional device mockups (iPhone, Android, Browser)
|
|
14
|
+
- **Text Effects** - Behind-object, title, subtitle overlays
|
|
15
|
+
- **Screen Capture** - Record emulators, windows, or web apps
|
|
16
|
+
- **Maestro Integration** - Automated mobile app testing
|
|
17
|
+
- **Playwright Integration** - Automated web app testing with recording (uses user's Chrome)
|
|
18
|
+
- **Export** - PNG, MP4, GIF with professional quality
|
|
19
|
+
|
|
20
|
+
### Task Hub
|
|
21
|
+
Centralized task management with external tool integration:
|
|
22
|
+
- **Multiple Links** - Add multiple Jira, Notion, Figma, and GitHub links per project
|
|
23
|
+
- **MCP Metadata Fetch** - Automatically extract ticket keys, page IDs, file info from URLs
|
|
24
|
+
- **AI-Generated Requirements** - Auto-generate requirements from linked sources
|
|
25
|
+
- **Test Map** - AI-generated test checklist with progress tracking
|
|
26
|
+
- **Status Tracking** - Visual indicators for task progress
|
|
27
|
+
|
|
28
|
+
### LLM Provider Configuration
|
|
29
|
+
Flexible AI backend with multiple provider support:
|
|
30
|
+
- **Anthropic API** - Use your own API key for Claude models
|
|
31
|
+
- **OpenAI API** - GPT-4/5 models support
|
|
32
|
+
- **Ollama** - Local LLM support (llama3, mistral, etc.)
|
|
33
|
+
- **Claude CLI** - Automatic fallback with optimized settings
|
|
34
|
+
- **Model Selection** - Configure specific models per provider in Settings UI
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### Via Claude Code Plugin Marketplace (Recommended)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Add the marketplace
|
|
42
|
+
/plugin marketplace add veolab/applab-discovery
|
|
43
|
+
|
|
44
|
+
# Install the plugin
|
|
45
|
+
/plugin install discoverylab@veolab-applab-discovery
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The MCP server is automatically configured when you install via the marketplace.
|
|
49
|
+
|
|
50
|
+
### Via npm (Manual)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g @veolab/discoverylab
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then add to your `~/.claude.json`:
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"discoverylab": {
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"args": ["-y", "@veolab/discoverylab@latest", "mcp"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Via Bun (Faster)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
bun add -g @veolab/discoverylab
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Then add to your `~/.claude.json`:
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"discoverylab": {
|
|
79
|
+
"command": "bunx",
|
|
80
|
+
"args": ["@veolab/discoverylab", "mcp"]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
87
|
+
|
|
88
|
+
### Skills (Slash Commands)
|
|
89
|
+
|
|
90
|
+
After installing the plugin, use these skills in Claude Code:
|
|
91
|
+
|
|
92
|
+
| Skill | Description |
|
|
93
|
+
|-------|-------------|
|
|
94
|
+
| `/discoverylab:open-ui` | Open the DiscoveryLab web interface |
|
|
95
|
+
| `/discoverylab:quick-capture` | Quickly capture iOS/Android emulator screen |
|
|
96
|
+
| `/discoverylab:mobile-test` | Full mobile testing workflow with Maestro |
|
|
97
|
+
| `/discoverylab:web-test` | Web testing workflow with Playwright |
|
|
98
|
+
| `/discoverylab:generate-assets` | Generate marketing assets from screenshots |
|
|
99
|
+
| `/discoverylab:task-hub` | Manage links, requirements and test maps |
|
|
100
|
+
|
|
101
|
+
### CLI Usage
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Start localhost UI
|
|
105
|
+
discoverylab serve
|
|
106
|
+
|
|
107
|
+
# Analyze a video
|
|
108
|
+
discoverylab analyze video.mp4
|
|
109
|
+
|
|
110
|
+
# Capture emulator
|
|
111
|
+
discoverylab capture --emulator ios
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Natural Language with Claude
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
# Basic usage
|
|
118
|
+
Use applab to analyze my app recording and generate marketing screenshots
|
|
119
|
+
|
|
120
|
+
# Task Hub integration
|
|
121
|
+
Add this Jira ticket to my project: https://company.atlassian.net/browse/PROJ-123
|
|
122
|
+
Generate requirements and test map from all my project links
|
|
123
|
+
Show me my test progress for the current project
|
|
124
|
+
|
|
125
|
+
# Recording
|
|
126
|
+
Start recording my iOS simulator
|
|
127
|
+
Run Maestro tests on my app
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Available MCP Tools
|
|
131
|
+
- **Projects**: `dlab.project.*` - Create, list, manage projects
|
|
132
|
+
- **Task Hub**: `dlab.taskhub.*` - Links, requirements, test maps
|
|
133
|
+
- **Recording**: `dlab.capture.*`, `dlab.maestro.*`, `dlab.playwright.*`
|
|
134
|
+
- **Export**: `dlab.notion.*`, `dlab.drive.*`, `dlab.jira.*`
|
|
135
|
+
|
|
136
|
+
## Requirements
|
|
137
|
+
|
|
138
|
+
- **Node.js 20+**
|
|
139
|
+
- **FFmpeg** (for video export)
|
|
140
|
+
- **Maestro CLI** (optional, for mobile testing)
|
|
141
|
+
- **Playwright** (optional, for web testing)
|
|
142
|
+
|
|
143
|
+
## Platform Compatibility
|
|
144
|
+
|
|
145
|
+
| Feature | macOS | Windows | Linux |
|
|
146
|
+
|---------|-------|---------|-------|
|
|
147
|
+
| Web UI | Full | Full | Full |
|
|
148
|
+
| Video Upload & Analysis | Full | Full | Full |
|
|
149
|
+
| Grid Composer | Full | Full | Full |
|
|
150
|
+
| PNG/Image Export | Full | Full | Full |
|
|
151
|
+
| Vision OCR (Apple Intelligence) | Full | Fallback* | Fallback* |
|
|
152
|
+
| iOS Simulator Capture | Full | N/A | N/A |
|
|
153
|
+
| Android Emulator Capture | Full | Full | Full |
|
|
154
|
+
| Playwright Web Testing | Full | Full | Full |
|
|
155
|
+
| Maestro Mobile Testing | Full | Full | Full |
|
|
156
|
+
|
|
157
|
+
*Fallback: Uses Tesseract.js for OCR when Apple Vision is unavailable.
|
|
158
|
+
|
|
159
|
+
### macOS (Recommended)
|
|
160
|
+
Full functionality including iOS Simulator capture and Apple Intelligence Vision OCR.
|
|
161
|
+
|
|
162
|
+
### Windows / Linux
|
|
163
|
+
Most features work with some limitations:
|
|
164
|
+
- iOS Simulator capture requires macOS
|
|
165
|
+
- Vision OCR falls back to Tesseract.js
|
|
166
|
+
- Android Emulator and Playwright work normally
|
|
167
|
+
|
|
168
|
+
## API Endpoints
|
|
169
|
+
|
|
170
|
+
### Task Hub Endpoints
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
PUT /api/projects/:id/links - Update project links (legacy + taskHubLinks)
|
|
174
|
+
POST /api/mcp/fetch - Fetch metadata from a single URL
|
|
175
|
+
POST /api/mcp/fetch-batch - Fetch metadata from multiple URLs
|
|
176
|
+
POST /api/ai/generate-task-info - Generate requirements and test map from links
|
|
177
|
+
POST /api/projects/sync-orphans - Sync orphan directories from disk to database
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Recording Endpoints
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
POST /api/mobile/record/start - Start Maestro mobile recording
|
|
184
|
+
POST /api/mobile/record/stop - Stop and process mobile recording
|
|
185
|
+
POST /api/web/record/start - Start Playwright web recording (uses user's Chrome)
|
|
186
|
+
POST /api/web/record/stop - Stop and process web recording
|
|
187
|
+
DELETE /api/recordings/:id - Delete a recording with cascade cleanup
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### LLM Settings Endpoints
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
GET /api/settings/llm - Get LLM provider settings (API keys masked)
|
|
194
|
+
POST /api/settings/llm - Update LLM provider settings
|
|
195
|
+
GET /api/ollama/status - Check Ollama server status and available models
|
|
196
|
+
GET /api/mobile-chat/providers - Get available chat providers for mobile testing
|
|
197
|
+
POST /api/mobile-chat - Send chat message during mobile testing session
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Documentation
|
|
201
|
+
|
|
202
|
+
See [CLAUDE.md](./CLAUDE.md) for Claude Code specific instructions.
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
MIT - See LICENSE file
|
|
207
|
+
|
|
208
|
+
## Credits
|
|
209
|
+
|
|
210
|
+
Built with:
|
|
211
|
+
- Three.js (3D mockups)
|
|
212
|
+
- Remotion (video rendering)
|
|
213
|
+
- Apple Vision & NaturalLanguage frameworks
|
|
214
|
+
- Claude MCP SDK
|
|
Binary file
|
package/assets/backgrounds/macos-big-sur-apple-layers-fluidic-colorful-wwdc-stock-4096x2304-1455.jpg
ADDED
|
Binary file
|
package/assets/backgrounds/macos-sierra-mountain-peak-sunset-evening-stock-5k-5120x3684-3987.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M18.71 19.5C17.88 20.74 17 21.95 15.66 21.97C14.32 22 13.89 21.18 12.37 21.18C10.84 21.18 10.37 21.95 9.09997 22C7.78997 22.05 6.79997 20.68 5.95997 19.47C4.24997 17 2.93997 12.45 4.69997 9.39C5.56997 7.87 7.12997 6.91 8.81997 6.88C10.1 6.86 11.32 7.75 12.11 7.75C12.89 7.75 14.37 6.68 15.92 6.84C16.57 6.87 18.39 7.1 19.56 8.82C19.47 8.88 17.39 10.1 17.41 12.63C17.44 15.65 20.06 16.66 20.09 16.67C20.06 16.74 19.67 18.11 18.71 19.5ZM13 3.5C13.73 2.67 14.94 2.04 15.94 2C16.07 3.17 15.6 4.35 14.9 5.19C14.21 6.04 13.07 6.7 11.95 6.61C11.8 5.46 12.36 4.26 13 3.5Z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 512 509.64"><path fill="#D77655" d="M115.612 0h280.775C459.974 0 512 52.026 512 115.612v278.415c0 63.587-52.026 115.612-115.613 115.612H115.612C52.026 509.639 0 457.614 0 394.027V115.612C0 52.026 52.026 0 115.612 0z"/><path fill="#FCF2EE" fill-rule="nonzero" d="M142.27 316.619l73.655-41.326 1.238-3.589-1.238-1.996-3.589-.001-12.31-.759-42.084-1.138-36.498-1.516-35.361-1.896-8.897-1.895-8.34-10.995.859-5.484 7.482-5.03 10.717.935 23.683 1.617 35.537 2.452 25.782 1.517 38.193 3.968h6.064l.86-2.451-2.073-1.517-1.618-1.517-36.776-24.922-39.81-26.338-20.852-15.166-11.273-7.683-5.687-7.204-2.451-15.721 10.237-11.273 13.75.935 3.513.936 13.928 10.716 29.749 23.027 38.848 28.612 5.687 4.727 2.275-1.617.278-1.138-2.553-4.271-21.13-38.193-22.546-38.848-10.035-16.101-2.654-9.655c-.935-3.968-1.617-7.304-1.617-11.374l11.652-15.823 6.445-2.073 15.545 2.073 6.547 5.687 9.655 22.092 15.646 34.78 24.265 47.291 7.103 14.028 3.791 12.992 1.416 3.968 2.449-.001v-2.275l1.997-26.641 3.69-32.707 3.589-42.084 1.239-11.854 5.863-14.206 11.652-7.683 9.099 4.348 7.482 10.716-1.036 6.926-4.449 28.915-8.72 45.294-5.687 30.331h3.313l3.792-3.791 15.342-20.372 25.782-32.227 11.374-12.789 13.27-14.129 8.517-6.724 16.1-.001 11.854 17.617-5.307 18.199-16.581 21.029-13.75 17.819-19.716 26.54-12.309 21.231 1.138 1.694 2.932-.278 44.536-9.479 24.062-4.347 28.714-4.928 12.992 6.066 1.416 6.167-5.106 12.613-30.71 7.583-36.018 7.204-53.636 12.689-.657.48.758.935 24.164 2.275 10.337.556h25.301l47.114 3.514 12.309 8.139 7.381 9.959-1.238 7.583-18.957 9.655-25.579-6.066-59.702-14.205-20.474-5.106-2.83-.001v1.694l17.061 16.682 31.266 28.233 39.152 36.397 1.997 8.999-5.03 7.102-5.307-.758-34.401-25.883-13.27-11.651-30.053-25.302-1.996-.001v2.654l6.926 10.136 36.574 54.975 1.895 16.859-2.653 5.485-9.479 3.311-10.414-1.895-21.408-30.054-22.092-33.844-17.819-30.331-2.173 1.238-10.515 113.261-4.929 5.788-11.374 4.348-9.478-7.204-5.03-11.652 5.03-23.027 6.066-30.052 4.928-23.886 4.449-29.674 2.654-9.858-.177-.657-2.173.278-22.37 30.71-34.021 45.977-26.919 28.815-6.445 2.553-11.173-5.789 1.037-10.337 6.243-9.2 37.257-47.392 22.47-29.371 14.508-16.961-.101-2.451h-.859l-98.954 64.251-17.618 2.275-7.583-7.103.936-11.652 3.589-3.791 29.749-20.474-.101.102.024.101z"/></svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createJsonResult,
|
|
3
|
+
createTextResult
|
|
4
|
+
} from "./chunk-QJXXHOV7.js";
|
|
5
|
+
import {
|
|
6
|
+
DATA_DIR,
|
|
7
|
+
DB_PATH
|
|
8
|
+
} from "./chunk-VY3BLXBW.js";
|
|
9
|
+
|
|
10
|
+
// src/mcp/tools/setup.ts
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { execSync } from "child_process";
|
|
13
|
+
import { existsSync } from "fs";
|
|
14
|
+
import { platform, homedir } from "os";
|
|
15
|
+
var dependencies = [
|
|
16
|
+
{
|
|
17
|
+
name: "FFmpeg",
|
|
18
|
+
command: "ffmpeg -version",
|
|
19
|
+
versionPattern: /ffmpeg version (\d+\.\d+(?:\.\d+)?)/,
|
|
20
|
+
required: true,
|
|
21
|
+
description: "Video processing and export",
|
|
22
|
+
installHint: "brew install ffmpeg (macOS) or apt install ffmpeg (Linux)"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "Maestro CLI",
|
|
26
|
+
command: "",
|
|
27
|
+
// Special handling - check multiple paths
|
|
28
|
+
versionPattern: /(\d+\.\d+\.\d+)/,
|
|
29
|
+
required: false,
|
|
30
|
+
description: "Mobile app testing automation",
|
|
31
|
+
installHint: 'curl -Ls "https://get.maestro.mobile.dev" | bash'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Playwright",
|
|
35
|
+
command: "npx playwright --version",
|
|
36
|
+
versionPattern: /(\d+\.\d+\.\d+)/,
|
|
37
|
+
required: false,
|
|
38
|
+
description: "Web app testing and browser automation",
|
|
39
|
+
installHint: "npm install -g playwright"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "Xcode CLI Tools",
|
|
43
|
+
command: "xcode-select -p",
|
|
44
|
+
versionPattern: /.*/,
|
|
45
|
+
required: false,
|
|
46
|
+
description: "iOS Simulator access (macOS only)",
|
|
47
|
+
installHint: "xcode-select --install"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "ADB",
|
|
51
|
+
command: "adb version",
|
|
52
|
+
versionPattern: /Android Debug Bridge version (\d+\.\d+\.\d+)/,
|
|
53
|
+
required: false,
|
|
54
|
+
description: "Android Emulator access",
|
|
55
|
+
installHint: "Install Android Studio or: brew install android-platform-tools"
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
function checkDependency(dep) {
|
|
59
|
+
if (dep.name === "Maestro CLI") {
|
|
60
|
+
return checkMaestro(dep);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const output = execSync(dep.command, { encoding: "utf-8", timeout: 5e3 }).trim();
|
|
64
|
+
const match = output.match(dep.versionPattern);
|
|
65
|
+
return {
|
|
66
|
+
installed: true,
|
|
67
|
+
version: match ? match[1] || "installed" : "installed"
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
installed: false,
|
|
72
|
+
version: null,
|
|
73
|
+
error: error instanceof Error ? error.message : "Command failed"
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function checkMaestro(dep) {
|
|
78
|
+
const homeDir = homedir();
|
|
79
|
+
const maestroPaths = [
|
|
80
|
+
`${homeDir}/.maestro/bin/maestro`,
|
|
81
|
+
"/usr/local/bin/maestro",
|
|
82
|
+
"/opt/homebrew/bin/maestro"
|
|
83
|
+
];
|
|
84
|
+
try {
|
|
85
|
+
const output = execSync("maestro --version 2>/dev/null || maestro version 2>/dev/null", {
|
|
86
|
+
encoding: "utf-8",
|
|
87
|
+
timeout: 5e3,
|
|
88
|
+
shell: "/bin/bash"
|
|
89
|
+
}).trim();
|
|
90
|
+
const match = output.match(dep.versionPattern);
|
|
91
|
+
return {
|
|
92
|
+
installed: true,
|
|
93
|
+
version: match ? match[1] : "installed"
|
|
94
|
+
};
|
|
95
|
+
} catch {
|
|
96
|
+
}
|
|
97
|
+
for (const maestroPath of maestroPaths) {
|
|
98
|
+
if (existsSync(maestroPath)) {
|
|
99
|
+
try {
|
|
100
|
+
const output = execSync(`"${maestroPath}" --version 2>/dev/null || "${maestroPath}" version 2>/dev/null`, {
|
|
101
|
+
encoding: "utf-8",
|
|
102
|
+
timeout: 5e3,
|
|
103
|
+
shell: "/bin/bash"
|
|
104
|
+
}).trim();
|
|
105
|
+
const match = output.match(dep.versionPattern);
|
|
106
|
+
return {
|
|
107
|
+
installed: true,
|
|
108
|
+
version: match ? match[1] : "installed"
|
|
109
|
+
};
|
|
110
|
+
} catch {
|
|
111
|
+
return {
|
|
112
|
+
installed: true,
|
|
113
|
+
version: "installed"
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
installed: false,
|
|
120
|
+
version: null,
|
|
121
|
+
error: "Maestro not found in PATH or common installation directories"
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
var setupStatusTool = {
|
|
125
|
+
name: "dlab.setup.status",
|
|
126
|
+
description: "Check the status of DiscoveryLab setup and all dependencies.",
|
|
127
|
+
inputSchema: z.object({}),
|
|
128
|
+
handler: async () => {
|
|
129
|
+
const results = [];
|
|
130
|
+
let allRequiredInstalled = true;
|
|
131
|
+
for (const dep of dependencies) {
|
|
132
|
+
if (dep.name === "Xcode CLI Tools" && platform() !== "darwin") {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const status = checkDependency(dep);
|
|
136
|
+
results.push({
|
|
137
|
+
name: dep.name,
|
|
138
|
+
installed: status.installed,
|
|
139
|
+
version: status.version,
|
|
140
|
+
required: dep.required,
|
|
141
|
+
description: dep.description,
|
|
142
|
+
installHint: status.installed ? null : dep.installHint
|
|
143
|
+
});
|
|
144
|
+
if (dep.required && !status.installed) {
|
|
145
|
+
allRequiredInstalled = false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const dataReady = existsSync(DATA_DIR);
|
|
149
|
+
const dbReady = existsSync(DB_PATH);
|
|
150
|
+
return createJsonResult({
|
|
151
|
+
ready: allRequiredInstalled && dataReady,
|
|
152
|
+
platform: platform(),
|
|
153
|
+
dataDirectory: {
|
|
154
|
+
path: DATA_DIR,
|
|
155
|
+
exists: dataReady
|
|
156
|
+
},
|
|
157
|
+
database: {
|
|
158
|
+
path: DB_PATH,
|
|
159
|
+
exists: dbReady
|
|
160
|
+
},
|
|
161
|
+
dependencies: results,
|
|
162
|
+
summary: {
|
|
163
|
+
total: results.length,
|
|
164
|
+
installed: results.filter((r) => r.installed).length,
|
|
165
|
+
missing: results.filter((r) => !r.installed).length,
|
|
166
|
+
requiredMissing: results.filter((r) => r.required && !r.installed).map((r) => r.name)
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
var setupCheckTool = {
|
|
172
|
+
name: "dlab.setup.check",
|
|
173
|
+
description: "Quick check if a specific tool is installed.",
|
|
174
|
+
inputSchema: z.object({
|
|
175
|
+
tool: z.enum(["ffmpeg", "maestro", "playwright", "xcode", "adb"]).describe("Tool to check")
|
|
176
|
+
}),
|
|
177
|
+
handler: async (params) => {
|
|
178
|
+
const toolMap = {
|
|
179
|
+
ffmpeg: dependencies[0],
|
|
180
|
+
maestro: dependencies[1],
|
|
181
|
+
playwright: dependencies[2],
|
|
182
|
+
xcode: dependencies[3],
|
|
183
|
+
adb: dependencies[4]
|
|
184
|
+
};
|
|
185
|
+
const dep = toolMap[params.tool];
|
|
186
|
+
if (!dep) {
|
|
187
|
+
return createTextResult(`Unknown tool: ${params.tool}`);
|
|
188
|
+
}
|
|
189
|
+
const status = checkDependency(dep);
|
|
190
|
+
if (status.installed) {
|
|
191
|
+
return createTextResult(`${dep.name} is installed (version: ${status.version})`);
|
|
192
|
+
} else {
|
|
193
|
+
return createTextResult(`${dep.name} is NOT installed.
|
|
194
|
+
Install with: ${dep.installHint}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
var setupInitTool = {
|
|
199
|
+
name: "dlab.setup.init",
|
|
200
|
+
description: "Initialize DiscoveryLab data directories and database.",
|
|
201
|
+
inputSchema: z.object({}),
|
|
202
|
+
handler: async () => {
|
|
203
|
+
try {
|
|
204
|
+
const { getDatabase, DATA_DIR: DATA_DIR2, PROJECTS_DIR, EXPORTS_DIR, FRAMES_DIR } = await import("./db-IWIL65EX.js");
|
|
205
|
+
getDatabase();
|
|
206
|
+
return createJsonResult({
|
|
207
|
+
message: "DiscoveryLab initialized successfully",
|
|
208
|
+
directories: {
|
|
209
|
+
data: DATA_DIR2,
|
|
210
|
+
projects: PROJECTS_DIR,
|
|
211
|
+
exports: EXPORTS_DIR,
|
|
212
|
+
frames: FRAMES_DIR
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
} catch (error) {
|
|
216
|
+
const message = error instanceof Error ? error.message : "Initialization failed";
|
|
217
|
+
return createTextResult(`Error: ${message}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
var setupInstallTool = {
|
|
222
|
+
name: "dlab.setup.install",
|
|
223
|
+
description: "Get installation commands for missing DiscoveryLab dependencies. Claude should run these commands after user approval.",
|
|
224
|
+
inputSchema: z.object({
|
|
225
|
+
tool: z.enum(["all", "ffmpeg", "maestro", "playwright", "xcode", "adb"]).optional().describe("Specific tool to install (default: all missing)")
|
|
226
|
+
}),
|
|
227
|
+
handler: async (params) => {
|
|
228
|
+
const toolToInstall = params.tool || "all";
|
|
229
|
+
const installCommands = [];
|
|
230
|
+
const isMac = platform() === "darwin";
|
|
231
|
+
if (toolToInstall === "all" || toolToInstall === "ffmpeg") {
|
|
232
|
+
const status = checkDependency(dependencies[0]);
|
|
233
|
+
if (!status.installed) {
|
|
234
|
+
installCommands.push({
|
|
235
|
+
name: "FFmpeg",
|
|
236
|
+
command: isMac ? "brew install ffmpeg" : "sudo apt install -y ffmpeg",
|
|
237
|
+
description: "Required for video processing and export"
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (toolToInstall === "all" || toolToInstall === "maestro") {
|
|
242
|
+
const status = checkDependency(dependencies[1]);
|
|
243
|
+
if (!status.installed) {
|
|
244
|
+
installCommands.push({
|
|
245
|
+
name: "Maestro CLI",
|
|
246
|
+
command: 'curl -Ls "https://get.maestro.mobile.dev" | bash',
|
|
247
|
+
description: "Mobile app testing automation"
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (toolToInstall === "all" || toolToInstall === "playwright") {
|
|
252
|
+
const status = checkDependency(dependencies[2]);
|
|
253
|
+
if (!status.installed) {
|
|
254
|
+
installCommands.push({
|
|
255
|
+
name: "Playwright",
|
|
256
|
+
command: "npm install -g playwright && npx playwright install",
|
|
257
|
+
description: "Web app testing and browser automation"
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (isMac && (toolToInstall === "all" || toolToInstall === "xcode")) {
|
|
262
|
+
const status = checkDependency(dependencies[3]);
|
|
263
|
+
if (!status.installed) {
|
|
264
|
+
installCommands.push({
|
|
265
|
+
name: "Xcode CLI Tools",
|
|
266
|
+
command: "xcode-select --install",
|
|
267
|
+
description: "Required for iOS Simulator access"
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (toolToInstall === "all" || toolToInstall === "adb") {
|
|
272
|
+
const status = checkDependency(dependencies[4]);
|
|
273
|
+
if (!status.installed) {
|
|
274
|
+
installCommands.push({
|
|
275
|
+
name: "ADB (Android Debug Bridge)",
|
|
276
|
+
command: isMac ? "brew install android-platform-tools" : "sudo apt install -y adb",
|
|
277
|
+
description: "Required for Android Emulator access"
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (installCommands.length === 0) {
|
|
282
|
+
return createTextResult(
|
|
283
|
+
toolToInstall === "all" ? "\u2705 All dependencies are already installed!" : `\u2705 ${toolToInstall} is already installed!`
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
const instructions = installCommands.map(
|
|
287
|
+
(cmd, i) => `${i + 1}. **${cmd.name}** (${cmd.description})
|
|
288
|
+
\`\`\`bash
|
|
289
|
+
${cmd.command}
|
|
290
|
+
\`\`\``
|
|
291
|
+
).join("\n\n");
|
|
292
|
+
return createTextResult(
|
|
293
|
+
`## Missing Dependencies
|
|
294
|
+
|
|
295
|
+
Please run the following commands to install missing dependencies:
|
|
296
|
+
|
|
297
|
+
` + instructions + `
|
|
298
|
+
|
|
299
|
+
*Run these commands one at a time and verify each installation before proceeding.*`
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
var setupTools = [setupStatusTool, setupCheckTool, setupInitTool, setupInstallTool];
|
|
304
|
+
|
|
305
|
+
export {
|
|
306
|
+
setupStatusTool,
|
|
307
|
+
setupCheckTool,
|
|
308
|
+
setupInitTool,
|
|
309
|
+
setupInstallTool,
|
|
310
|
+
setupTools
|
|
311
|
+
};
|