preflite 1.1.3 → 1.1.4
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/mcp/setup.js +131 -1
- package/package.json +1 -1
package/dist/mcp/setup.js
CHANGED
|
@@ -20,6 +20,8 @@ export async function setupLocalMcp(options) {
|
|
|
20
20
|
const skillPath = join(options.projectRoot, ".preflight", "skills", "preflight.md");
|
|
21
21
|
const codexSkillPath = join(homedir(), ".codex", "skills", "preflight", "SKILL.md");
|
|
22
22
|
const agentsSkillPath = join(homedir(), ".agents", "skills", "preflight", "SKILL.md");
|
|
23
|
+
const claudeSkillPath = join(homedir(), ".claude", "skills", "preflight", "SKILL.md");
|
|
24
|
+
const androidEmulatorSetupSkillPath = join(homedir(), ".claude", "skills", "android-emulator-setup", "SKILL.md");
|
|
23
25
|
const userConfigExamplePath = join(homedir(), ".preflight", "config.example.json");
|
|
24
26
|
const codexConfigPath = join(homedir(), ".codex", "config.toml");
|
|
25
27
|
await writeCursorMcpConfig(cursorConfigPath, options.projectRoot, agentBaseUrl, livePort, isRuntime, runtimeRoot);
|
|
@@ -27,9 +29,11 @@ export async function setupLocalMcp(options) {
|
|
|
27
29
|
await writeTextFile(skillPath, skillText());
|
|
28
30
|
await writeTextFile(codexSkillPath, skillText());
|
|
29
31
|
await writeTextFile(agentsSkillPath, skillText());
|
|
32
|
+
await writeTextFile(claudeSkillPath, skillText());
|
|
33
|
+
await writeTextFile(androidEmulatorSetupSkillPath, androidEmulatorSetupSkillText());
|
|
30
34
|
await writeTextFile(userConfigExamplePath, userConfigExampleText());
|
|
31
35
|
await upsertCodexMcpConfig(codexConfigPath, options.projectRoot, agentBaseUrl, livePort, isRuntime, runtimeRoot);
|
|
32
|
-
return { cursorConfigPath, cursorRulePath, codexConfigPath, skillPath, codexSkillPath, agentsSkillPath, runtimeRoot, userConfigExamplePath };
|
|
36
|
+
return { cursorConfigPath, cursorRulePath, codexConfigPath, skillPath, codexSkillPath, agentsSkillPath, claudeSkillPath, androidEmulatorSetupSkillPath, runtimeRoot, userConfigExamplePath };
|
|
33
37
|
}
|
|
34
38
|
async function writeCursorMcpConfig(path, projectRoot, agentBaseUrl, livePort, isRuntime, runtimeRoot) {
|
|
35
39
|
let existing = {};
|
|
@@ -187,3 +191,129 @@ function userConfigExampleText() {
|
|
|
187
191
|
}
|
|
188
192
|
`;
|
|
189
193
|
}
|
|
194
|
+
function androidEmulatorSetupSkillText() {
|
|
195
|
+
return `---
|
|
196
|
+
name: android-emulator-setup
|
|
197
|
+
description: Use when setting up an Android emulator from scratch, installing Android SDK command-line tools, creating AVDs, or when emulator/adb/avdmanager commands are not found. Also use when the user asks to install, configure, or bootstrap an Android development environment.
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
# Android Emulator Setup
|
|
201
|
+
|
|
202
|
+
Install the Android SDK command-line tools, create AVDs, and start emulators — the prerequisite step before Argent or Preflight can interact with a device.
|
|
203
|
+
|
|
204
|
+
## Quick Detection
|
|
205
|
+
|
|
206
|
+
Run these before doing any work. Skip sections whose tools already work.
|
|
207
|
+
|
|
208
|
+
\`\`\`bash
|
|
209
|
+
adb --version 2>/dev/null && echo "ADB OK" || echo "ADB MISSING"
|
|
210
|
+
emulator -list-avds 2>/dev/null && echo "EMULATOR OK" || echo "EMULATOR MISSING"
|
|
211
|
+
echo "ANDROID_HOME=\${ANDROID_HOME:-UNSET}"
|
|
212
|
+
\`\`\`
|
|
213
|
+
|
|
214
|
+
| Result | Action |
|
|
215
|
+
|--------|--------|
|
|
216
|
+
| ADB MISSING | Start from § Install SDK |
|
|
217
|
+
| EMULATOR MISSING, ADB OK | Jump to § Install SDK Components |
|
|
218
|
+
| Both OK, no AVDs | Jump to § Create AVD |
|
|
219
|
+
| Both OK, AVD exists | Jump to § Start Emulator |
|
|
220
|
+
|
|
221
|
+
## Install SDK
|
|
222
|
+
|
|
223
|
+
**macOS with Homebrew (recommended):**
|
|
224
|
+
|
|
225
|
+
\`\`\`bash
|
|
226
|
+
brew install android-commandlinetools
|
|
227
|
+
\`\`\`
|
|
228
|
+
|
|
229
|
+
**Manual install (macOS/Linux):**
|
|
230
|
+
|
|
231
|
+
\`\`\`bash
|
|
232
|
+
# 1. Download from https://developer.android.com/studio#command-line-tools-only
|
|
233
|
+
# 2. Unzip to the correct path:
|
|
234
|
+
mkdir -p ~/Library/Android/sdk/cmdline-tools/latest
|
|
235
|
+
cd ~/Library/Android/sdk/cmdline-tools/latest
|
|
236
|
+
unzip ~/Downloads/commandlinetools-mac-*.zip
|
|
237
|
+
\`\`\`
|
|
238
|
+
|
|
239
|
+
## Configure Environment
|
|
240
|
+
|
|
241
|
+
Add to \`~/.zshrc\` (or \`~/.bashrc\`):
|
|
242
|
+
|
|
243
|
+
\`\`\`bash
|
|
244
|
+
# With brew:
|
|
245
|
+
export ANDROID_HOME=/opt/homebrew/share/android-commandlinetools
|
|
246
|
+
# With manual install:
|
|
247
|
+
# export ANDROID_HOME=$HOME/Library/Android/sdk
|
|
248
|
+
|
|
249
|
+
export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
|
|
250
|
+
\`\`\`
|
|
251
|
+
|
|
252
|
+
Then \`source ~/.zshrc\` and verify:
|
|
253
|
+
|
|
254
|
+
\`\`\`bash
|
|
255
|
+
sdkmanager --version # should print a version
|
|
256
|
+
\`\`\`
|
|
257
|
+
|
|
258
|
+
## Install SDK Components
|
|
259
|
+
|
|
260
|
+
\`\`\`bash
|
|
261
|
+
# Accept licenses (non-interactive)
|
|
262
|
+
yes | sdkmanager --licenses
|
|
263
|
+
|
|
264
|
+
# Install core components
|
|
265
|
+
sdkmanager "platform-tools" "emulator" "platforms;android-34"
|
|
266
|
+
|
|
267
|
+
# Install a system image (ARM Mac → arm64-v8a, Intel → x86_64)
|
|
268
|
+
sdkmanager "system-images;android-34;google_apis;arm64-v8a"
|
|
269
|
+
\`\`\`
|
|
270
|
+
|
|
271
|
+
> **Pick the right system image:** \`sdkmanager --list | grep system-images\` to see available images. API 34 is a safe default; adjust based on the app's \`minSdk\`.
|
|
272
|
+
|
|
273
|
+
## Create AVD
|
|
274
|
+
|
|
275
|
+
\`\`\`bash
|
|
276
|
+
avdmanager create avd \\
|
|
277
|
+
-n test_device \\
|
|
278
|
+
-k "system-images;android-34;google_apis;arm64-v8a" \\
|
|
279
|
+
-d "pixel_6"
|
|
280
|
+
\`\`\`
|
|
281
|
+
|
|
282
|
+
Verify: \`emulator -list-avds\` should show \`test_device\`.
|
|
283
|
+
|
|
284
|
+
## Start Emulator
|
|
285
|
+
|
|
286
|
+
\`\`\`bash
|
|
287
|
+
emulator -avd test_device &
|
|
288
|
+
\`\`\`
|
|
289
|
+
|
|
290
|
+
Wait for boot (1-2 min), then verify:
|
|
291
|
+
|
|
292
|
+
\`\`\`bash
|
|
293
|
+
adb devices
|
|
294
|
+
# List of devices attached
|
|
295
|
+
# emulator-5554 device
|
|
296
|
+
\`\`\`
|
|
297
|
+
|
|
298
|
+
## Common Issues
|
|
299
|
+
|
|
300
|
+
| Symptom | Fix |
|
|
301
|
+
|---------|-----|
|
|
302
|
+
| \`sdkmanager: command not found\` | \`cmdline-tools/latest/bin\` not in PATH; check § Configure Environment |
|
|
303
|
+
| \`avdmanager: command not found\` | Same as above — part of cmdline-tools |
|
|
304
|
+
| Emulator black screen on Apple Silicon | Ensure system image is \`arm64-v8a\`, not \`x86_64\` |
|
|
305
|
+
| \`adb devices\` shows \`unauthorized\` | Wait 30s for emulator to finish booting |
|
|
306
|
+
| \`The emulator process has terminated\` | Try \`emulator -avd test_device -wipe-data\` |
|
|
307
|
+
| \`ANDROID_HOME\` not set after brew install | Brew's path is \`/opt/homebrew/share/android-commandlinetools\` |
|
|
308
|
+
| \`PANIC: Missing emulator engine\` | Run \`sdkmanager "emulator"\` to install the emulator binary |
|
|
309
|
+
| No space left on device | System images are ~1-2 GB; \`sdkmanager --uninstall\` unused images |
|
|
310
|
+
|
|
311
|
+
## Post-Setup
|
|
312
|
+
|
|
313
|
+
Once the emulator is running, it's ready for:
|
|
314
|
+
- **Argent:** \`argent-android-emulator-setup\` skill (boot, connect, interact)
|
|
315
|
+
- **Preflight:** \`preflight\` skill (visual-flow tests via MCP)
|
|
316
|
+
|
|
317
|
+
To kill: \`adb -s emulator-5554 emu kill\`
|
|
318
|
+
`;
|
|
319
|
+
}
|