driftx 0.1.1 → 0.1.3

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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +216 -0
  3. package/dist/bin.js +834 -81
  4. package/dist/bin.js.map +1 -1
  5. package/driftx-plugin/skills/driftx/SKILL.md +281 -27
  6. package/ios-companion/DriftxCompanion/DriftxCompanionApp.swift +10 -0
  7. package/ios-companion/DriftxCompanion/Info.plist +22 -0
  8. package/ios-companion/DriftxCompanion.xcodeproj/project.pbxproj +376 -0
  9. package/ios-companion/DriftxCompanion.xcodeproj/xcshareddata/xcschemes/DriftxCompanionUITests.xcscheme +109 -0
  10. package/ios-companion/DriftxCompanionUITests/CompanionServer.swift +176 -0
  11. package/ios-companion/DriftxCompanionUITests/DriftxCompanionUITests.swift +15 -0
  12. package/ios-companion/DriftxCompanionUITests/HierarchyEndpoint.swift +140 -0
  13. package/ios-companion/DriftxCompanionUITests/Info.plist +22 -0
  14. package/ios-companion/DriftxCompanionUITests/InteractionEndpoint.swift +142 -0
  15. package/ios-companion/DriftxCompanionUITests/Router.swift +47 -0
  16. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanion.app/DriftxCompanion +0 -0
  17. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanion.app/DriftxCompanion.debug.dylib +0 -0
  18. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanion.app/Info.plist +0 -0
  19. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanion.app/PkgInfo +1 -0
  20. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanion.app/__preview.dylib +0 -0
  21. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/DriftxCompanionUITests-Runner +0 -0
  22. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/Testing.framework/Info.plist +0 -0
  23. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/Testing.framework/Testing +0 -0
  24. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/Testing.framework/_CodeSignature/CodeResources +168 -0
  25. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/Testing.framework/version.plist +18 -0
  26. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTAutomationSupport.framework/Info.plist +0 -0
  27. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTAutomationSupport.framework/XCTAutomationSupport +0 -0
  28. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTAutomationSupport.framework/_CodeSignature/CodeResources +113 -0
  29. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTAutomationSupport.framework/version.plist +18 -0
  30. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTest.framework/Info.plist +0 -0
  31. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTest.framework/XCTest +0 -0
  32. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTest.framework/_CodeSignature/CodeResources +817 -0
  33. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTest.framework/version.plist +18 -0
  34. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestCore.framework/Info.plist +0 -0
  35. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestCore.framework/XCTestCore +0 -0
  36. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestCore.framework/_CodeSignature/CodeResources +113 -0
  37. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestCore.framework/version.plist +18 -0
  38. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestSupport.framework/Info.plist +0 -0
  39. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestSupport.framework/XCTestSupport +0 -0
  40. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestSupport.framework/_CodeSignature/CodeResources +113 -0
  41. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCTestSupport.framework/version.plist +18 -0
  42. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUIAutomation.framework/Info.plist +0 -0
  43. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUIAutomation.framework/XCUIAutomation +0 -0
  44. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUIAutomation.framework/_CodeSignature/CodeResources +432 -0
  45. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUIAutomation.framework/version.plist +18 -0
  46. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUnit.framework/Info.plist +0 -0
  47. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUnit.framework/XCUnit +0 -0
  48. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUnit.framework/_CodeSignature/CodeResources +113 -0
  49. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/XCUnit.framework/version.plist +18 -0
  50. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Frameworks/libXCTestSwiftSupport.dylib +0 -0
  51. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/Info.plist +254 -0
  52. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/PkgInfo +1 -0
  53. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/PlugIns/DriftxCompanionUITests.xctest/DriftxCompanionUITests +0 -0
  54. package/ios-companion/prebuilt/Debug-iphonesimulator/DriftxCompanionUITests-Runner.app/PlugIns/DriftxCompanionUITests.xctest/Info.plist +0 -0
  55. package/ios-companion/prebuilt/DriftxCompanionUITests.xctestrun +135 -0
  56. package/ios-companion/prebuilt/build-info.json +6 -0
  57. package/package.json +14 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Noman R
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.
package/README.md ADDED
@@ -0,0 +1,216 @@
1
+ <p align="center">
2
+ <img src="assets/banner.svg" alt="driftx - Eyes and hands for agentic mobile development" width="800" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/driftx"><img src="https://img.shields.io/npm/v/driftx?style=flat-square&color=e8a23e&label=npm" alt="npm version" /></a>
7
+ &nbsp;
8
+ <a href="https://github.com/nomanr/driftx/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/driftx?style=flat-square&color=c49344" alt="license" /></a>
9
+ &nbsp;
10
+ <a href="https://www.npmjs.com/package/driftx"><img src="https://img.shields.io/npm/dm/driftx?style=flat-square&color=b8860b" alt="downloads" /></a>
11
+ &nbsp;
12
+ <img src="https://img.shields.io/badge/iOS%20%7C%20Android-e8a23e?style=flat-square&label=platform" alt="platform" />
13
+ </p>
14
+
15
+ <p align="center">
16
+ <b>Let AI agents see, tap, type, swipe, and visually diff your React Native app.</b><br/>
17
+ <sub>Works with Claude Code · Cursor · Gemini CLI · Codex · any agent that runs shell commands</sub>
18
+ </p>
19
+
20
+ ---
21
+
22
+ Install driftx, connect your agent, and it can see and interact with your running app on iOS simulators and Android emulators. Your agent discovers driftx automatically.
23
+
24
+ ## What you can do
25
+
26
+ Ask your agent things like:
27
+
28
+ - **"Make this screen match the Figma"** - compare a design mockup against the running app, then fix the differences
29
+ - **"The login button is cut off, why?"** - agent sees the issue, inspects the component tree, and fixes the layout
30
+ - **"What components are on this screen?"** - inspect the full hierarchy with testIDs, bounds, and props
31
+ - **"Run an accessibility check on this screen"** - audit for contrast, labels, and touch target sizes
32
+ - **"Walk through the onboarding flow and screenshot each step"** - navigate, interact, and capture along the way
33
+ - **"Compare this against yesterday's build"** - detect visual regressions between builds
34
+
35
+ ## Quick Start
36
+
37
+ ### 1. Install
38
+
39
+ ```bash
40
+ npm install -g driftx
41
+ ```
42
+
43
+ ### 2. Connect your agent
44
+
45
+ <details open>
46
+ <summary><strong>Claude Code</strong></summary>
47
+
48
+ ```bash
49
+ driftx setup-claude
50
+ ```
51
+
52
+ Restart Claude Code. The `driftx` skill is now available.
53
+
54
+ **Fallback** - if the command above doesn't work, tell Claude Code:
55
+
56
+ ```
57
+ Fetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.codex/INSTALL.md
58
+ ```
59
+
60
+ Verify with `driftx doctor`, then close and restart the chat.
61
+
62
+ </details>
63
+
64
+ <details>
65
+ <summary><strong>Cursor</strong></summary>
66
+
67
+ Tell Cursor:
68
+
69
+ ```
70
+ Fetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.cursor/INSTALL.md
71
+ ```
72
+
73
+ Verify with `driftx doctor`, then close and restart the chat.
74
+
75
+ </details>
76
+
77
+ <details>
78
+ <summary><strong>Gemini CLI</strong></summary>
79
+
80
+ Tell Gemini:
81
+
82
+ ```
83
+ Fetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.gemini/INSTALL.md
84
+ ```
85
+
86
+ Verify with `driftx doctor`, then close and restart the chat.
87
+
88
+ </details>
89
+
90
+ <details>
91
+ <summary><strong>Codex</strong></summary>
92
+
93
+ Tell Codex:
94
+
95
+ ```
96
+ Fetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.codex/INSTALL.md
97
+ ```
98
+
99
+ Verify with `driftx doctor`, then close and restart the chat.
100
+
101
+ </details>
102
+
103
+ <details>
104
+ <summary><strong>Other agents</strong></summary>
105
+
106
+ Any agent that runs shell commands can use driftx. Add this to your agent's system prompt:
107
+
108
+ ```
109
+ You have access to `driftx` for seeing and interacting with mobile apps:
110
+ - driftx capture -o screenshot.png # capture a screenshot
111
+ - driftx inspect --json # get the component tree
112
+ - driftx tap "Button Text" # tap by text, testID, or name
113
+ - driftx type input-id "text" # type into a field
114
+ - driftx swipe up # swipe gestures
115
+ - driftx compare --design design.png --format json # compare against a design
116
+ Always capture a screenshot after interactions to verify the result.
117
+ ```
118
+
119
+ </details>
120
+
121
+ ### 3. Verify
122
+
123
+ ```bash
124
+ driftx doctor
125
+ ```
126
+
127
+ Checks that Metro, adb, xcrun, and your simulators are ready.
128
+
129
+ ## Commands
130
+
131
+ ```bash
132
+ # See: capture screenshots and inspect the component tree
133
+ driftx capture -o screenshot.png
134
+ driftx inspect --json
135
+
136
+ # Interact: tap, type, swipe, navigate
137
+ driftx tap "Login" # by text
138
+ driftx tap login-btn # by testID
139
+ driftx tap 150,300 --xy # by coordinates
140
+ driftx type email-input "user@test.com"
141
+ driftx swipe up
142
+ driftx swipe down --distance 200
143
+ driftx go-back
144
+ driftx open-url "myapp://profile/123"
145
+
146
+ # Compare: diff against designs, audit accessibility, detect regressions
147
+ driftx compare --design mockup.png --format json
148
+ driftx compare --design mockup.png --with a11y --format json
149
+ driftx compare --baseline --format json
150
+
151
+ # Utilities
152
+ driftx devices
153
+ driftx doctor
154
+ driftx init
155
+ ```
156
+
157
+ ## Flags
158
+
159
+ | Flag | Description |
160
+ |------|-------------|
161
+ | `-d, --device <id>` | Device ID or name (picker shown if multiple) |
162
+ | `--bundle-id <id>` | iOS bundle identifier (auto-detected from Metro) |
163
+ | `--verbose` | Debug logging |
164
+ | `--format <type>` | `terminal`, `markdown`, or `json` |
165
+ | `--copy` | Copy output to clipboard |
166
+
167
+ ## Requirements
168
+
169
+ - **Metro bundler** running (`npx react-native start`)
170
+ - **Android**: `adb` available, emulator booted
171
+ - **iOS**: `xcrun simctl` available, simulator booted
172
+
173
+ ## How It Works
174
+
175
+ **Tap resolution** uses a 4-tier fallback: CDP fiber tree → XCUITest companion hierarchy → accessibility element query → fiber measurement via `measureInWindow()`.
176
+
177
+ **iOS companion** is a pre-built XCUITest server that auto-launches on the simulator. Ships in the npm package, no Xcode build step required.
178
+
179
+ **Visual analysis** compares screenshots pixel-by-pixel against design images, runs accessibility checks, and detects layout regressions between builds.
180
+
181
+ ## Platform Support
182
+
183
+ | Platform | Emulator/Simulator | Physical Device |
184
+ |----------|-------------------|-----------------|
185
+ | Android | Supported | Not yet |
186
+ | iOS | Supported | Not yet |
187
+
188
+ ## Configuration
189
+
190
+ ```bash
191
+ driftx init
192
+ ```
193
+
194
+ Creates `.driftxrc.json`:
195
+
196
+ ```json
197
+ {
198
+ "platform": "react-native",
199
+ "metroPort": 8081,
200
+ "threshold": 0.1,
201
+ "diffThreshold": 5
202
+ }
203
+ ```
204
+
205
+ ## Development
206
+
207
+ ```bash
208
+ npm install
209
+ npm run dev # watch mode
210
+ npm test # run tests
211
+ npm run build:ios # rebuild iOS companion
212
+ ```
213
+
214
+ ## License
215
+
216
+ [MIT](LICENSE)