mcp-maestro-mobile-ai 1.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/CHANGELOG.md ADDED
@@ -0,0 +1,114 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Planned
11
+ - Security boundaries (Safe Mode)
12
+ - JUnit XML report generation
13
+ - CI headless mode
14
+ - iOS support
15
+
16
+ ---
17
+
18
+ ## [1.1.0] - 2025-01-06
19
+
20
+ ### Changed
21
+ - **Package Renamed**: Changed from `@krunal.mahera/maestro-mcp` to `mcp-maestro-mobile-ai` for easier configuration
22
+ - **YAML Storage**: Temp YAML files now stored in hidden system directory (`~/.maestro-mcp/`) instead of project folder
23
+ - Test results and screenshots now stored in `~/.maestro-mcp/output/`
24
+
25
+ ### Added
26
+ - **App Context Training System**: New tools to teach the AI about your app's UI
27
+ - `register_elements` - Register testIDs, accessibilityLabels for app elements
28
+ - `register_screen` - Define screen structures and available actions
29
+ - `save_successful_flow` - Save working test patterns for AI reference
30
+ - `get_saved_flows` - Retrieve saved flow patterns
31
+ - `delete_flow` - Remove saved patterns
32
+ - `get_ai_context` - Get formatted context for AI (call before generating tests!)
33
+ - `get_full_context` - Get complete raw context data
34
+ - `clear_app_context` - Clear all context for an app
35
+ - `list_app_contexts` - List all apps with saved context
36
+
37
+ ### Improved
38
+ - AI test generation accuracy when context is provided
39
+ - Cleaner project directory (no temp files visible)
40
+
41
+ ---
42
+
43
+ ## [1.0.0] - 2025-01-05
44
+
45
+ ### Added
46
+ - Initial public release on npm as `mcp-maestro-mobile-ai`
47
+ - MCP server implementation with stdio transport
48
+ - 14 MCP tools for mobile test automation:
49
+ - `read_prompt_file` - Read test prompts from files
50
+ - `list_prompt_files` - List available prompt files
51
+ - `list_devices` - List connected Android devices
52
+ - `select_device` - Select specific device for testing
53
+ - `clear_device` - Clear device selection
54
+ - `check_device` - Verify device connection
55
+ - `check_app` - Verify app installation
56
+ - `get_app_config` - Get server configuration
57
+ - `validate_maestro_yaml` - Validate YAML syntax
58
+ - `run_test` - Execute single test
59
+ - `run_test_suite` - Execute multiple tests
60
+ - `get_test_results` - Retrieve test results
61
+ - `take_screenshot` - Capture device screen
62
+ - `cleanup_results` - Clean up old results
63
+ - Automatic retry mechanism for failed tests
64
+ - Pre-flight checks (device, app) before test execution
65
+ - Screenshot capture on test failure
66
+ - Auto-cleanup of old results based on `MAX_RESULTS`
67
+ - Improved error messages with hints
68
+ - Support for physical devices via USB
69
+ - Device selection for multi-device environments
70
+ - Winston-based logging
71
+ - Environment variable configuration
72
+ - Example prompt files
73
+
74
+ ### Documentation
75
+ - Comprehensive README with setup guides
76
+ - MCP client configuration examples (Cursor, VS Code, Claude Desktop)
77
+ - Template configuration files
78
+ - React Native automation guidelines
79
+
80
+ ---
81
+
82
+ ## [0.1.0] - 2025-01-01
83
+
84
+ ### Added
85
+ - Initial proof of concept
86
+ - Basic Maestro CLI integration
87
+ - Simple test execution
88
+
89
+ ---
90
+
91
+ ## Release Notes Format
92
+
93
+ ### Version Numbering
94
+
95
+ - **MAJOR** (X.0.0): Breaking API changes
96
+ - **MINOR** (0.X.0): New features, backward compatible
97
+ - **PATCH** (0.0.X): Bug fixes, backward compatible
98
+
99
+ ### Change Categories
100
+
101
+ - **Added**: New features
102
+ - **Changed**: Changes in existing functionality
103
+ - **Deprecated**: Features to be removed in future
104
+ - **Removed**: Removed features
105
+ - **Fixed**: Bug fixes
106
+ - **Security**: Security-related changes
107
+
108
+ ---
109
+
110
+ [Unreleased]: https://github.com/krunal-mahera/mcp-maestro-mobile-ai/compare/v1.1.0...HEAD
111
+ [1.1.0]: https://github.com/krunal-mahera/mcp-maestro-mobile-ai/releases/tag/v1.1.0
112
+ [1.0.0]: https://github.com/krunal-mahera/mcp-maestro-mobile-ai/releases/tag/v1.0.0
113
+ [0.1.0]: https://github.com/krunal-mahera/mcp-maestro-mobile-ai/releases/tag/v0.1.0
114
+
@@ -0,0 +1,417 @@
1
+ # Contributing to Maestro MCP
2
+
3
+ Thank you for your interest in contributing to Maestro MCP! This document provides guidelines and information for contributors.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Code of Conduct](#code-of-conduct)
10
+ 2. [Getting Started](#getting-started)
11
+ 3. [Development Setup](#development-setup)
12
+ 4. [Making Changes](#making-changes)
13
+ 5. [Pull Request Process](#pull-request-process)
14
+ 6. [Coding Standards](#coding-standards)
15
+ 7. [Testing](#testing)
16
+ 8. [Documentation](#documentation)
17
+ 9. [Release Process](#release-process)
18
+
19
+ ---
20
+
21
+ ## Code of Conduct
22
+
23
+ ### Our Pledge
24
+
25
+ We are committed to providing a welcoming and inclusive environment. All contributors are expected to:
26
+
27
+ - Be respectful and constructive
28
+ - Focus on the issue, not the person
29
+ - Accept constructive criticism gracefully
30
+ - Help others learn and grow
31
+
32
+ ### Unacceptable Behavior
33
+
34
+ - Harassment, discrimination, or personal attacks
35
+ - Trolling or inflammatory comments
36
+ - Publishing others' private information
37
+ - Any conduct inappropriate in a professional setting
38
+
39
+ ---
40
+
41
+ ## Getting Started
42
+
43
+ ### Prerequisites
44
+
45
+ Before contributing, ensure you have:
46
+
47
+ - **Node.js 18+**
48
+ - **Java 17+** (for Maestro)
49
+ - **Maestro CLI** installed
50
+ - **Android Emulator** or physical device
51
+ - **Git** for version control
52
+
53
+ ### Finding Work
54
+
55
+ 1. **Good First Issues**: Look for `good first issue` label
56
+ 2. **Help Wanted**: Issues labeled `help wanted`
57
+ 3. **Roadmap Items**: Check [ROADMAP.md](./ROADMAP.md)
58
+ 4. **Bug Reports**: Fix reported issues
59
+ 5. **Feature Requests**: Implement requested features
60
+
61
+ ---
62
+
63
+ ## Development Setup
64
+
65
+ ### 1. Fork and Clone
66
+
67
+ ```bash
68
+ # Fork the repository on GitHub, then:
69
+ git clone https://github.com/YOUR-USERNAME/maestro-mcp.git
70
+ cd maestro-mcp
71
+ ```
72
+
73
+ ### 2. Install Dependencies
74
+
75
+ ```bash
76
+ npm install
77
+ ```
78
+
79
+ ### 3. Create Environment File
80
+
81
+ ```bash
82
+ cp env.example .env
83
+ # Edit .env with your settings
84
+ ```
85
+
86
+ ### 4. Run in Development Mode
87
+
88
+ ```bash
89
+ npm run dev
90
+ ```
91
+
92
+ ### 5. Link for Local Testing
93
+
94
+ ```bash
95
+ npm link
96
+ # Now 'maestro-mcp' command is available globally
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Making Changes
102
+
103
+ ### Branch Naming
104
+
105
+ ```
106
+ feature/description - New features
107
+ fix/description - Bug fixes
108
+ docs/description - Documentation
109
+ refactor/description - Code refactoring
110
+ test/description - Test additions
111
+ ```
112
+
113
+ Examples:
114
+ - `feature/ios-support`
115
+ - `fix/device-detection`
116
+ - `docs/security-update`
117
+
118
+ ### Commit Messages
119
+
120
+ Follow [Conventional Commits](https://www.conventionalcommits.org/):
121
+
122
+ ```
123
+ type(scope): description
124
+
125
+ [optional body]
126
+
127
+ [optional footer]
128
+ ```
129
+
130
+ Types:
131
+ - `feat`: New feature
132
+ - `fix`: Bug fix
133
+ - `docs`: Documentation
134
+ - `style`: Formatting, no code change
135
+ - `refactor`: Code restructuring
136
+ - `test`: Adding tests
137
+ - `chore`: Maintenance tasks
138
+
139
+ Examples:
140
+ ```
141
+ feat(tools): add iOS device detection
142
+
143
+ fix(maestro): handle timeout errors gracefully
144
+
145
+ docs(security): update threat model
146
+ ```
147
+
148
+ ### Keep Commits Focused
149
+
150
+ - One logical change per commit
151
+ - Separate refactoring from feature changes
152
+ - Include tests with feature commits
153
+
154
+ ---
155
+
156
+ ## Pull Request Process
157
+
158
+ ### Before Submitting
159
+
160
+ 1. **Sync with main**:
161
+ ```bash
162
+ git fetch origin
163
+ git rebase origin/main
164
+ ```
165
+
166
+ 2. **Run checks**:
167
+ ```bash
168
+ npm run lint
169
+ npm test
170
+ ```
171
+
172
+ 3. **Update documentation** if needed
173
+
174
+ ### PR Template
175
+
176
+ ```markdown
177
+ ## Description
178
+ [What does this PR do?]
179
+
180
+ ## Motivation
181
+ [Why is this change needed?]
182
+
183
+ ## Changes
184
+ - [List of changes]
185
+
186
+ ## Testing
187
+ - [ ] Unit tests added/updated
188
+ - [ ] Manual testing performed
189
+ - [ ] Documentation updated
190
+
191
+ ## Screenshots (if applicable)
192
+ [Add screenshots]
193
+
194
+ ## Related Issues
195
+ Closes #[issue number]
196
+ ```
197
+
198
+ ### Review Process
199
+
200
+ 1. **Automated Checks**: Must pass CI
201
+ 2. **Code Review**: At least one approval required
202
+ 3. **Discussion**: Address all comments
203
+ 4. **Merge**: Squash and merge preferred
204
+
205
+ ---
206
+
207
+ ## Coding Standards
208
+
209
+ ### JavaScript/Node.js
210
+
211
+ ```javascript
212
+ // Use ESM imports
213
+ import { something } from 'module';
214
+
215
+ // Use async/await over callbacks
216
+ async function doSomething() {
217
+ const result = await fetchData();
218
+ return result;
219
+ }
220
+
221
+ // Use descriptive names
222
+ const deviceConnectionStatus = await checkDeviceConnection();
223
+
224
+ // Handle errors explicitly
225
+ try {
226
+ await riskyOperation();
227
+ } catch (error) {
228
+ logger.error('Operation failed', { error: error.message });
229
+ throw new Error('Clear error message');
230
+ }
231
+ ```
232
+
233
+ ### Code Style
234
+
235
+ - **ESLint**: Run `npm run lint` before committing
236
+ - **Indentation**: 2 spaces
237
+ - **Quotes**: Single quotes for strings
238
+ - **Semicolons**: Required
239
+ - **Line Length**: 100 characters max
240
+
241
+ ### Naming Conventions
242
+
243
+ | Type | Convention | Example |
244
+ |------|------------|---------|
245
+ | Variables | camelCase | `deviceId` |
246
+ | Constants | UPPER_SNAKE | `MAX_RETRIES` |
247
+ | Functions | camelCase | `runTest()` |
248
+ | Classes | PascalCase | `TestRunner` |
249
+ | Files | kebab-case | `run-tools.js` |
250
+
251
+ ### Error Handling
252
+
253
+ ```javascript
254
+ // Provide actionable error messages
255
+ throw new Error(
256
+ `App "${appId}" not installed. ` +
257
+ `Hint: Install the app before running tests.`
258
+ );
259
+
260
+ // Log with context
261
+ logger.error('Test failed', {
262
+ testName,
263
+ error: error.message,
264
+ device: deviceId,
265
+ });
266
+ ```
267
+
268
+ ---
269
+
270
+ ## Testing
271
+
272
+ ### Running Tests
273
+
274
+ ```bash
275
+ # All tests
276
+ npm test
277
+
278
+ # With coverage
279
+ npm run test:coverage
280
+
281
+ # Watch mode
282
+ npm run test:watch
283
+ ```
284
+
285
+ ### Test Structure
286
+
287
+ ```
288
+ tests/
289
+ ├── unit/ # Unit tests
290
+ │ ├── tools/
291
+ │ └── utils/
292
+ ├── integration/ # Integration tests
293
+ └── e2e/ # End-to-end tests
294
+ ```
295
+
296
+ ### Writing Tests
297
+
298
+ ```javascript
299
+ import { describe, it, expect } from 'vitest';
300
+ import { validateMaestroYaml } from '../src/tools/validateTools.js';
301
+
302
+ describe('validateMaestroYaml', () => {
303
+ it('should accept valid YAML', async () => {
304
+ const yaml = `
305
+ appId: com.example.app
306
+ ---
307
+ - launchApp
308
+ `;
309
+
310
+ const result = await validateMaestroYaml(yaml);
311
+ expect(result.valid).toBe(true);
312
+ });
313
+
314
+ it('should reject invalid YAML', async () => {
315
+ const yaml = 'invalid: [';
316
+
317
+ const result = await validateMaestroYaml(yaml);
318
+ expect(result.valid).toBe(false);
319
+ expect(result.errors).toContain('syntax');
320
+ });
321
+ });
322
+ ```
323
+
324
+ ### Test Requirements
325
+
326
+ - Unit tests for all new functions
327
+ - Integration tests for tool interactions
328
+ - No decrease in coverage percentage
329
+ - Tests must be deterministic
330
+
331
+ ---
332
+
333
+ ## Documentation
334
+
335
+ ### When to Update Docs
336
+
337
+ - Adding new features
338
+ - Changing existing behavior
339
+ - Adding configuration options
340
+ - Fixing user-facing bugs
341
+ - Security-related changes
342
+
343
+ ### Documentation Files
344
+
345
+ | File | Purpose |
346
+ |------|---------|
347
+ | README.md | Quick start, overview |
348
+ | CHANGELOG.md | Version history |
349
+ | ROADMAP.md | Future plans |
350
+ | docs/ENTERPRISE_READINESS.md | Enterprise guide |
351
+ | docs/SECURITY.md | Security model |
352
+ | docs/PRIVACY.md | Privacy policy |
353
+
354
+ ### Documentation Style
355
+
356
+ - Use clear, simple language
357
+ - Include code examples
358
+ - Keep examples working and tested
359
+ - Use tables for comparisons
360
+ - Add diagrams for complex concepts
361
+
362
+ ---
363
+
364
+ ## Release Process
365
+
366
+ ### Version Bumping
367
+
368
+ ```bash
369
+ # Patch release (bug fixes)
370
+ npm version patch
371
+
372
+ # Minor release (new features)
373
+ npm version minor
374
+
375
+ # Major release (breaking changes)
376
+ npm version major
377
+ ```
378
+
379
+ ### Release Checklist
380
+
381
+ - [ ] All tests passing
382
+ - [ ] CHANGELOG.md updated
383
+ - [ ] Documentation updated
384
+ - [ ] Version bumped in package.json
385
+ - [ ] Git tag created
386
+ - [ ] npm publish successful
387
+
388
+ ### Publishing
389
+
390
+ ```bash
391
+ # Ensure logged in
392
+ npm whoami
393
+
394
+ # Publish (handled by maintainers)
395
+ npm publish --access public
396
+ ```
397
+
398
+ ---
399
+
400
+ ## Questions?
401
+
402
+ - **GitHub Issues**: For bugs and features
403
+ - **Discussions**: For questions and ideas
404
+ - **Email**: For private matters
405
+
406
+ ---
407
+
408
+ ## Recognition
409
+
410
+ Contributors are recognized in:
411
+
412
+ - GitHub contributors list
413
+ - CHANGELOG.md for significant contributions
414
+ - README.md for major contributors
415
+
416
+ Thank you for contributing! 🎉
417
+
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+