@rootnative/loupe 0.0.0-alpha.2 → 0.0.0-alpha.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/CHANGELOG.md +59 -1
- package/README.md +50 -38
- package/dist/bin.js +2 -2
- package/dist/{chunk-HWVQXYQ3.js → chunk-ROE4FVE2.js} +4382 -1923
- package/dist/index.d.ts +27 -0
- package/dist/index.js +1 -1
- package/dist/ios-runner/Debug-iphonesimulator/LoupeHost.app/Info.plist +0 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeHost.app/LoupeHost +0 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeHost.app/LoupeHost.debug.dylib +0 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeHost.app/PkgInfo +1 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeHost.app/__preview.dylib +0 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeRunner-Runner.app/Info.plist +239 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeRunner-Runner.app/LoupeRunner-Runner +0 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeRunner-Runner.app/PkgInfo +1 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeRunner-Runner.app/PlugIns/LoupeRunner.xctest/Info.plist +0 -0
- package/dist/ios-runner/Debug-iphonesimulator/LoupeRunner-Runner.app/PlugIns/LoupeRunner.xctest/LoupeRunner +0 -0
- package/dist/ios-runner/LoupeRunner.xctestrun +119 -0
- package/dist/{server-567FSCAH.js → server-VPDLHMTP.js} +4 -13
- package/package.json +1 -1
- package/skills/loupe/SKILL.md +21 -9
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,24 @@ interface ExecResult {
|
|
|
23
23
|
* the caller decides what it means.
|
|
24
24
|
*/
|
|
25
25
|
type Exec = (file: string, args: readonly string[], options?: ExecOptions) => Promise<ExecResult>;
|
|
26
|
+
/** A tool that keeps running after the command that started it. */
|
|
27
|
+
interface DetachedRun {
|
|
28
|
+
pid: number;
|
|
29
|
+
/** The exit code (null for a signal) when the tool ended; else undefined. */
|
|
30
|
+
exitCode(): number | null | undefined;
|
|
31
|
+
kill(): void;
|
|
32
|
+
}
|
|
33
|
+
interface DetachedOptions {
|
|
34
|
+
/** Added to the environment of this process. */
|
|
35
|
+
env: Readonly<Record<string, string>>;
|
|
36
|
+
/** The tool writes its output here. An old file is replaced. */
|
|
37
|
+
logFile: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Starts a tool with no shell that lives on when this process ends. It
|
|
41
|
+
* fails with `tool_missing` when the tool doesn't exist.
|
|
42
|
+
*/
|
|
43
|
+
type SpawnDetached = (file: string, args: readonly string[], options: DetachedOptions) => Promise<DetachedRun>;
|
|
26
44
|
|
|
27
45
|
/** How far a long command is. `progress` grows with each update. */
|
|
28
46
|
interface ProgressUpdate {
|
|
@@ -36,12 +54,16 @@ interface ProgressUpdate {
|
|
|
36
54
|
*/
|
|
37
55
|
interface CommandContext {
|
|
38
56
|
exec: Exec;
|
|
57
|
+
/** Starts a tool that stays after the command: the iOS runner. */
|
|
58
|
+
spawnDetached: SpawnDetached;
|
|
39
59
|
env: Readonly<Record<string, string | undefined>>;
|
|
40
60
|
/**
|
|
41
61
|
* HTTP to a server on this machine, such as Metro. `createContext` gives
|
|
42
62
|
* `localFetch`, which refuses every other host.
|
|
43
63
|
*/
|
|
44
64
|
fetch: typeof fetch;
|
|
65
|
+
/** The system of this machine, as `process.platform` gives it. */
|
|
66
|
+
hostPlatform: NodeJS.Platform;
|
|
45
67
|
/**
|
|
46
68
|
* Aborts when the caller cancels the call: Ctrl-C in the CLI, or a
|
|
47
69
|
* cancel from the MCP client. A long command stops at its next safe
|
|
@@ -102,14 +124,18 @@ declare function createRegistry(commands: readonly Command[]): Registry;
|
|
|
102
124
|
|
|
103
125
|
declare const deviceSchema: z.ZodObject<{
|
|
104
126
|
platform: z.ZodEnum<{
|
|
127
|
+
ios: "ios";
|
|
105
128
|
android: "android";
|
|
106
129
|
}>;
|
|
107
130
|
kind: z.ZodEnum<{
|
|
131
|
+
simulator: "simulator";
|
|
108
132
|
emulator: "emulator";
|
|
109
133
|
device: "device";
|
|
110
134
|
}>;
|
|
111
135
|
serial: z.ZodOptional<z.ZodString>;
|
|
112
136
|
avd: z.ZodOptional<z.ZodString>;
|
|
137
|
+
udid: z.ZodOptional<z.ZodString>;
|
|
138
|
+
name: z.ZodOptional<z.ZodString>;
|
|
113
139
|
model: z.ZodOptional<z.ZodString>;
|
|
114
140
|
state: z.ZodEnum<{
|
|
115
141
|
ready: "ready";
|
|
@@ -122,6 +148,7 @@ declare const deviceSchema: z.ZodObject<{
|
|
|
122
148
|
}>;
|
|
123
149
|
detail: z.ZodOptional<z.ZodString>;
|
|
124
150
|
apiLevel: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
os: z.ZodOptional<z.ZodString>;
|
|
125
152
|
}, z.core.$strip>;
|
|
126
153
|
type Device = z.infer<typeof deviceSchema>;
|
|
127
154
|
type DeviceState = Device['state'];
|
package/dist/index.js
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
APPL????
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>BuildMachineOSBuild</key>
|
|
6
|
+
<string>23A344011</string>
|
|
7
|
+
<key>CFBundleAllowMixedLocalizations</key>
|
|
8
|
+
<true/>
|
|
9
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
10
|
+
<string>en</string>
|
|
11
|
+
<key>CFBundleExecutable</key>
|
|
12
|
+
<string>LoupeRunner-Runner</string>
|
|
13
|
+
<key>CFBundleIdentifier</key>
|
|
14
|
+
<string>io.github.rootnative.loupe.LoupeRunner.xctrunner</string>
|
|
15
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
16
|
+
<string>6.0</string>
|
|
17
|
+
<key>CFBundleName</key>
|
|
18
|
+
<string>LoupeRunner-Runner</string>
|
|
19
|
+
<key>CFBundlePackageType</key>
|
|
20
|
+
<string>APPL</string>
|
|
21
|
+
<key>CFBundleShortVersionString</key>
|
|
22
|
+
<string>1.0</string>
|
|
23
|
+
<key>CFBundleSignature</key>
|
|
24
|
+
<string>????</string>
|
|
25
|
+
<key>CFBundleSupportedPlatforms</key>
|
|
26
|
+
<array>
|
|
27
|
+
<string>iPhoneSimulator</string>
|
|
28
|
+
</array>
|
|
29
|
+
<key>CFBundleVersion</key>
|
|
30
|
+
<string>1</string>
|
|
31
|
+
<key>DTCompiler</key>
|
|
32
|
+
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
33
|
+
<key>DTPlatformBuild</key>
|
|
34
|
+
<string>22E169</string>
|
|
35
|
+
<key>DTPlatformName</key>
|
|
36
|
+
<string>iphonesimulator</string>
|
|
37
|
+
<key>DTPlatformVersion</key>
|
|
38
|
+
<string>18.4</string>
|
|
39
|
+
<key>DTSDKBuild</key>
|
|
40
|
+
<string>22E169</string>
|
|
41
|
+
<key>DTSDKName</key>
|
|
42
|
+
<string>iphonesimulator18.4.internal</string>
|
|
43
|
+
<key>DTXcode</key>
|
|
44
|
+
<string>1640</string>
|
|
45
|
+
<key>DTXcodeBuild</key>
|
|
46
|
+
<string>16F1t</string>
|
|
47
|
+
<key>LSRequiresIPhoneOS</key>
|
|
48
|
+
<true/>
|
|
49
|
+
<key>MinimumOSVersion</key>
|
|
50
|
+
<string>13.0</string>
|
|
51
|
+
<key>NFCReaderUsageDescription</key>
|
|
52
|
+
<string>Access is necessary for automated testing.</string>
|
|
53
|
+
<key>NSAppTransportSecurity</key>
|
|
54
|
+
<dict>
|
|
55
|
+
<key>NSAllowsArbitraryLoads</key>
|
|
56
|
+
<true/>
|
|
57
|
+
</dict>
|
|
58
|
+
<key>NSAppleMusicUsageDescription</key>
|
|
59
|
+
<string>Access is necessary for automated testing.</string>
|
|
60
|
+
<key>NSBluetoothAlwaysUsageDescription</key>
|
|
61
|
+
<string>Access is necessary for automated testing.</string>
|
|
62
|
+
<key>NSBluetoothPeripheralUsageDescription</key>
|
|
63
|
+
<string>Access is necessary for automated testing.</string>
|
|
64
|
+
<key>NSCalendarsUsageDescription</key>
|
|
65
|
+
<string>Access is necessary for automated testing.</string>
|
|
66
|
+
<key>NSCameraUsageDescription</key>
|
|
67
|
+
<string>Access is necessary for automated testing.</string>
|
|
68
|
+
<key>NSContactsUsageDescription</key>
|
|
69
|
+
<string>Access is necessary for automated testing.</string>
|
|
70
|
+
<key>NSFaceIDUsageDescription</key>
|
|
71
|
+
<string>Access is necessary for automated testing.</string>
|
|
72
|
+
<key>NSHealthClinicalHealthRecordsShareUsageDescription</key>
|
|
73
|
+
<string>Access is necessary for automated testing.</string>
|
|
74
|
+
<key>NSHealthShareUsageDescription</key>
|
|
75
|
+
<string>Access is necessary for automated testing.</string>
|
|
76
|
+
<key>NSHealthUpdateUsageDescription</key>
|
|
77
|
+
<string>Access is necessary for automated testing.</string>
|
|
78
|
+
<key>NSHomeKitUsageDescription</key>
|
|
79
|
+
<string>Access is necessary for automated testing.</string>
|
|
80
|
+
<key>NSLocalNetworkUsageDescription</key>
|
|
81
|
+
<string>Access is necessary for automated testing.</string>
|
|
82
|
+
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
|
83
|
+
<string>Access is necessary for automated testing.</string>
|
|
84
|
+
<key>NSLocationDefaultAccuracyReduced</key>
|
|
85
|
+
<string>Access is necessary for automated testing.</string>
|
|
86
|
+
<key>NSLocationWhenInUseUsageDescription</key>
|
|
87
|
+
<string>Access is necessary for automated testing.</string>
|
|
88
|
+
<key>NSMicrophoneUsageDescription</key>
|
|
89
|
+
<string>Access is necessary for automated testing.</string>
|
|
90
|
+
<key>NSMotionUsageDescription</key>
|
|
91
|
+
<string>Access is necessary for automated testing.</string>
|
|
92
|
+
<key>NSPhotoLibraryUsageDescription</key>
|
|
93
|
+
<string>Access is necessary for automated testing.</string>
|
|
94
|
+
<key>NSRemindersUsageDescription</key>
|
|
95
|
+
<string>Access is necessary for automated testing.</string>
|
|
96
|
+
<key>NSSensorKitPrivacyPolicyURL</key>
|
|
97
|
+
<string>https:\/\/www.apple.com/legal/privacy/en-ww/</string>
|
|
98
|
+
<key>NSSensorKitUsageDescription</key>
|
|
99
|
+
<string>Access is necessary for automated testing.</string>
|
|
100
|
+
<key>NSSensorKitUsageDetail</key>
|
|
101
|
+
<dict>
|
|
102
|
+
<key>SRSensorUsageAmbientLightSensor</key>
|
|
103
|
+
<dict>
|
|
104
|
+
<key>Description</key>
|
|
105
|
+
<string>DESCRIPTION_SRSensorUsageAmbientLightSensor</string>
|
|
106
|
+
</dict>
|
|
107
|
+
<key>SRSensorUsageDeviceUsage</key>
|
|
108
|
+
<dict>
|
|
109
|
+
<key>Description</key>
|
|
110
|
+
<string>DESCRIPTION_SRSensorUsageDeviceUsage</string>
|
|
111
|
+
</dict>
|
|
112
|
+
<key>SRSensorUsageECG</key>
|
|
113
|
+
<dict>
|
|
114
|
+
<key>Description</key>
|
|
115
|
+
<string>DESCRIPTION_SRSensorUsageECG</string>
|
|
116
|
+
</dict>
|
|
117
|
+
<key>SRSensorUsageElevation</key>
|
|
118
|
+
<dict>
|
|
119
|
+
<key>Description</key>
|
|
120
|
+
<string>DESCRIPTION_SRSensorUsageElevation</string>
|
|
121
|
+
</dict>
|
|
122
|
+
<key>SRSensorUsageFacialMetrics</key>
|
|
123
|
+
<dict>
|
|
124
|
+
<key>Description</key>
|
|
125
|
+
<string>DESCRIPTION_SRSensorUsageFacialMetrics</string>
|
|
126
|
+
</dict>
|
|
127
|
+
<key>SRSensorUsageFallStatistics</key>
|
|
128
|
+
<dict>
|
|
129
|
+
<key>Description</key>
|
|
130
|
+
<string>DESCRIPTION_SRSensorUsageFallStatistics</string>
|
|
131
|
+
</dict>
|
|
132
|
+
<key>SRSensorUsageHeartRate</key>
|
|
133
|
+
<dict>
|
|
134
|
+
<key>Description</key>
|
|
135
|
+
<string>DESCRIPTION_SRSensorUsageHeartRate</string>
|
|
136
|
+
</dict>
|
|
137
|
+
<key>SRSensorUsageKeyboardMetrics</key>
|
|
138
|
+
<dict>
|
|
139
|
+
<key>Description</key>
|
|
140
|
+
<string>DESCRIPTION_SRSensorUsageKeyboardMetrics</string>
|
|
141
|
+
</dict>
|
|
142
|
+
<key>SRSensorUsageMessageUsage</key>
|
|
143
|
+
<dict>
|
|
144
|
+
<key>Description</key>
|
|
145
|
+
<string>DESCRIPTION_SRSensorUsageMessageUsage</string>
|
|
146
|
+
</dict>
|
|
147
|
+
<key>SRSensorUsageMotion</key>
|
|
148
|
+
<dict>
|
|
149
|
+
<key>Description</key>
|
|
150
|
+
<string>DESCRIPTION_SRSensorUsageMotion</string>
|
|
151
|
+
<key>Required</key>
|
|
152
|
+
<true/>
|
|
153
|
+
</dict>
|
|
154
|
+
<key>SRSensorUsageMotionAlarms</key>
|
|
155
|
+
<dict>
|
|
156
|
+
<key>Description</key>
|
|
157
|
+
<string>DESCRIPTION_SRSensorUsageMotionAlarms</string>
|
|
158
|
+
</dict>
|
|
159
|
+
<key>SRSensorUsageOdometer</key>
|
|
160
|
+
<dict>
|
|
161
|
+
<key>Description</key>
|
|
162
|
+
<string>DESCRIPTION_SRSensorUsageOdometer</string>
|
|
163
|
+
</dict>
|
|
164
|
+
<key>SRSensorUsageOnWristDetailedState</key>
|
|
165
|
+
<dict>
|
|
166
|
+
<key>Description</key>
|
|
167
|
+
<string>DESCRIPTION_SRSensorIdentifierOnWristDetailedState</string>
|
|
168
|
+
</dict>
|
|
169
|
+
<key>SRSensorUsagePedometer</key>
|
|
170
|
+
<dict>
|
|
171
|
+
<key>Description</key>
|
|
172
|
+
<string>DESCRIPTION_SRSensorUsagePedometer</string>
|
|
173
|
+
</dict>
|
|
174
|
+
<key>SRSensorUsagePhoneUsage</key>
|
|
175
|
+
<dict>
|
|
176
|
+
<key>Description</key>
|
|
177
|
+
<string>DESCRIPTION_SRSensorUsagePhoneUsage</string>
|
|
178
|
+
</dict>
|
|
179
|
+
<key>SRSensorUsageSpeechMetrics</key>
|
|
180
|
+
<dict>
|
|
181
|
+
<key>Description</key>
|
|
182
|
+
<string>DESCRIPTION_SRSensorUsageSpeechMetrics</string>
|
|
183
|
+
</dict>
|
|
184
|
+
<key>SRSensorUsageStrideCalibration</key>
|
|
185
|
+
<dict>
|
|
186
|
+
<key>Description</key>
|
|
187
|
+
<string>DESCRIPTION_SRSensorUsageStrideCalibration</string>
|
|
188
|
+
</dict>
|
|
189
|
+
<key>SRSensorUsageVisits</key>
|
|
190
|
+
<dict>
|
|
191
|
+
<key>Description</key>
|
|
192
|
+
<string>DESCRIPTION_SRSensorUsageVisits</string>
|
|
193
|
+
</dict>
|
|
194
|
+
<key>SRSensorUsageWristDetection</key>
|
|
195
|
+
<dict>
|
|
196
|
+
<key>Description</key>
|
|
197
|
+
<string>DESCRIPTION_SRSensorUsageWristDetection</string>
|
|
198
|
+
</dict>
|
|
199
|
+
</dict>
|
|
200
|
+
<key>NSSiriUsageDescription</key>
|
|
201
|
+
<string>Access is necessary for automated testing.</string>
|
|
202
|
+
<key>NSSpeechRecognitionUsageDescription</key>
|
|
203
|
+
<string>Access is necessary for automated testing.</string>
|
|
204
|
+
<key>NSUserTrackingUsageDescription</key>
|
|
205
|
+
<string>Access is necessary for automated testing.</string>
|
|
206
|
+
<key>NSVideoSubscriberAccountUsageDescription</key>
|
|
207
|
+
<string>Access is necessary for automated testing.</string>
|
|
208
|
+
<key>SBIsLaunchableDuringSetup</key>
|
|
209
|
+
<true/>
|
|
210
|
+
<key>UIBackgroundModes</key>
|
|
211
|
+
<array>
|
|
212
|
+
<string>continuous</string>
|
|
213
|
+
</array>
|
|
214
|
+
<key>UIDeviceFamily</key>
|
|
215
|
+
<array>
|
|
216
|
+
<integer>1</integer>
|
|
217
|
+
<integer>2</integer>
|
|
218
|
+
</array>
|
|
219
|
+
<key>UIRequiredDeviceCapabilities</key>
|
|
220
|
+
<array>
|
|
221
|
+
<string>armv7</string>
|
|
222
|
+
</array>
|
|
223
|
+
<key>UIRequiresFullScreen</key>
|
|
224
|
+
<true/>
|
|
225
|
+
<key>UISupportedInterfaceOrientations</key>
|
|
226
|
+
<array>
|
|
227
|
+
<string>UIInterfaceOrientationPortrait</string>
|
|
228
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
229
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
230
|
+
</array>
|
|
231
|
+
<key>UISupportedInterfaceOrientations~ipad</key>
|
|
232
|
+
<array>
|
|
233
|
+
<string>UIInterfaceOrientationPortrait</string>
|
|
234
|
+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
|
235
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
236
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
237
|
+
</array>
|
|
238
|
+
</dict>
|
|
239
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
APPL????
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>LoupeRunner</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>BlueprintName</key>
|
|
8
|
+
<string>LoupeRunner</string>
|
|
9
|
+
<key>BlueprintProviderName</key>
|
|
10
|
+
<string>LoupeRunner</string>
|
|
11
|
+
<key>BlueprintProviderRelativePath</key>
|
|
12
|
+
<string>LoupeRunner.xcodeproj</string>
|
|
13
|
+
<key>BundleIdentifiersForCrashReportEmphasis</key>
|
|
14
|
+
<array>
|
|
15
|
+
<string>io.github.rootnative.loupe.LoupeHost</string>
|
|
16
|
+
<string>io.github.rootnative.loupe.LoupeRunner</string>
|
|
17
|
+
</array>
|
|
18
|
+
<key>CommandLineArguments</key>
|
|
19
|
+
<array/>
|
|
20
|
+
<key>DefaultTestExecutionTimeAllowance</key>
|
|
21
|
+
<integer>600</integer>
|
|
22
|
+
<key>DependentProductPaths</key>
|
|
23
|
+
<array>
|
|
24
|
+
<string>__TESTROOT__/Debug-iphonesimulator/LoupeHost.app</string>
|
|
25
|
+
<string>__TESTROOT__/Debug-iphonesimulator/LoupeRunner-Runner.app</string>
|
|
26
|
+
<string>__TESTROOT__/Debug-iphonesimulator/LoupeRunner-Runner.app/PlugIns/LoupeRunner.xctest</string>
|
|
27
|
+
</array>
|
|
28
|
+
<key>DiagnosticCollectionPolicy</key>
|
|
29
|
+
<integer>1</integer>
|
|
30
|
+
<key>EnvironmentVariables</key>
|
|
31
|
+
<dict>
|
|
32
|
+
<key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
|
|
33
|
+
<string>com.apple.AppStore</string>
|
|
34
|
+
<key>OS_ACTIVITY_DT_MODE</key>
|
|
35
|
+
<string>YES</string>
|
|
36
|
+
<key>SQLITE_ENABLE_THREAD_ASSERTIONS</key>
|
|
37
|
+
<string>1</string>
|
|
38
|
+
<key>TERM</key>
|
|
39
|
+
<string>dumb</string>
|
|
40
|
+
</dict>
|
|
41
|
+
<key>IsUITestBundle</key>
|
|
42
|
+
<true/>
|
|
43
|
+
<key>IsXCTRunnerHostedTestBundle</key>
|
|
44
|
+
<true/>
|
|
45
|
+
<key>PreferredScreenCaptureFormat</key>
|
|
46
|
+
<string>screenRecording</string>
|
|
47
|
+
<key>ProductModuleName</key>
|
|
48
|
+
<string>LoupeRunner</string>
|
|
49
|
+
<key>RunOrder</key>
|
|
50
|
+
<integer>0</integer>
|
|
51
|
+
<key>SystemAttachmentLifetime</key>
|
|
52
|
+
<string>deleteOnSuccess</string>
|
|
53
|
+
<key>TestBundlePath</key>
|
|
54
|
+
<string>__TESTHOST__/PlugIns/LoupeRunner.xctest</string>
|
|
55
|
+
<key>TestHostBundleIdentifier</key>
|
|
56
|
+
<string>io.github.rootnative.loupe.LoupeRunner.xctrunner</string>
|
|
57
|
+
<key>TestHostPath</key>
|
|
58
|
+
<string>__TESTROOT__/Debug-iphonesimulator/LoupeRunner-Runner.app</string>
|
|
59
|
+
<key>TestLanguage</key>
|
|
60
|
+
<string></string>
|
|
61
|
+
<key>TestRegion</key>
|
|
62
|
+
<string></string>
|
|
63
|
+
<key>TestTimeoutsEnabled</key>
|
|
64
|
+
<false/>
|
|
65
|
+
<key>TestingEnvironmentVariables</key>
|
|
66
|
+
<dict>
|
|
67
|
+
<key>DYLD_FRAMEWORK_PATH</key>
|
|
68
|
+
<string>__TESTROOT__/Debug-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks</string>
|
|
69
|
+
<key>DYLD_LIBRARY_PATH</key>
|
|
70
|
+
<string>__TESTROOT__/Debug-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/usr/lib</string>
|
|
71
|
+
<key>XCODE_SCHEME_NAME</key>
|
|
72
|
+
<string>LoupeRunner</string>
|
|
73
|
+
<key>__XCODE_BUILT_PRODUCTS_DIR_PATHS</key>
|
|
74
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
75
|
+
<key>__XPC_DYLD_FRAMEWORK_PATH</key>
|
|
76
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
77
|
+
<key>__XPC_DYLD_LIBRARY_PATH</key>
|
|
78
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
79
|
+
</dict>
|
|
80
|
+
<key>ToolchainsSettingValue</key>
|
|
81
|
+
<array/>
|
|
82
|
+
<key>UITargetAppCommandLineArguments</key>
|
|
83
|
+
<array/>
|
|
84
|
+
<key>UITargetAppEnvironmentVariables</key>
|
|
85
|
+
<dict>
|
|
86
|
+
<key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
|
|
87
|
+
<string>com.apple.AppStore</string>
|
|
88
|
+
<key>DYLD_FRAMEWORK_PATH</key>
|
|
89
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
90
|
+
<key>DYLD_LIBRARY_PATH</key>
|
|
91
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
92
|
+
<key>XCODE_SCHEME_NAME</key>
|
|
93
|
+
<string>LoupeRunner</string>
|
|
94
|
+
<key>__XCODE_BUILT_PRODUCTS_DIR_PATHS</key>
|
|
95
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
96
|
+
<key>__XPC_DYLD_FRAMEWORK_PATH</key>
|
|
97
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
98
|
+
<key>__XPC_DYLD_LIBRARY_PATH</key>
|
|
99
|
+
<string>__TESTROOT__/Debug-iphonesimulator</string>
|
|
100
|
+
</dict>
|
|
101
|
+
<key>UITargetAppPath</key>
|
|
102
|
+
<string>__TESTROOT__/Debug-iphonesimulator/LoupeHost.app</string>
|
|
103
|
+
<key>UserAttachmentLifetime</key>
|
|
104
|
+
<string>deleteOnSuccess</string>
|
|
105
|
+
</dict>
|
|
106
|
+
<key>__xctestrun_metadata__</key>
|
|
107
|
+
<dict>
|
|
108
|
+
<key>ContainerInfo</key>
|
|
109
|
+
<dict>
|
|
110
|
+
<key>ContainerName</key>
|
|
111
|
+
<string>LoupeRunner</string>
|
|
112
|
+
<key>SchemeName</key>
|
|
113
|
+
<string>LoupeRunner</string>
|
|
114
|
+
</dict>
|
|
115
|
+
<key>FormatVersion</key>
|
|
116
|
+
<integer>1</integer>
|
|
117
|
+
</dict>
|
|
118
|
+
</dict>
|
|
119
|
+
</plist>
|
|
@@ -2,16 +2,15 @@ import {
|
|
|
2
2
|
createContext,
|
|
3
3
|
inputJsonSchema,
|
|
4
4
|
outputJsonSchema,
|
|
5
|
+
packageFolder,
|
|
5
6
|
registry,
|
|
6
7
|
round2,
|
|
7
8
|
runCommand,
|
|
8
9
|
version
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ROE4FVE2.js";
|
|
10
11
|
|
|
11
12
|
// src/mcp/server.ts
|
|
12
|
-
import { existsSync } from "fs";
|
|
13
13
|
import path from "path";
|
|
14
|
-
import { fileURLToPath } from "url";
|
|
15
14
|
import {
|
|
16
15
|
McpServer,
|
|
17
16
|
ProtocolError,
|
|
@@ -102,7 +101,7 @@ function toolResult(result) {
|
|
|
102
101
|
var INSTRUCTIONS = [
|
|
103
102
|
"loupe checks the layout of a mobile app on an Android emulator or device. Its tools give numbers in dp.",
|
|
104
103
|
"Ask the user before you start an emulator, and before you open an app or a link on a device.",
|
|
105
|
-
"On a real phone, give `app` in each call.",
|
|
104
|
+
"On a real phone and on an iOS simulator, give `app` in each call.",
|
|
106
105
|
"Put back what you change: the orientation, the theme, and RTL (`expo-rtl off`). A sweep puts back the orientation and the theme itself.",
|
|
107
106
|
"Decide pass or fail with `check` or `sweep`, not from a screenshot alone.",
|
|
108
107
|
"The loupe skill (skills/loupe/SKILL.md in the package) has the workflow, the rules, and what to do for each error code."
|
|
@@ -116,15 +115,7 @@ function serial() {
|
|
|
116
115
|
};
|
|
117
116
|
}
|
|
118
117
|
function skillsFolder() {
|
|
119
|
-
|
|
120
|
-
for (; ; ) {
|
|
121
|
-
if (existsSync(path.join(dir, "package.json"))) {
|
|
122
|
-
return path.join(dir, "skills");
|
|
123
|
-
}
|
|
124
|
-
const up = path.dirname(dir);
|
|
125
|
-
if (up === dir) throw new Error("loupe can't find its package folder.");
|
|
126
|
-
dir = up;
|
|
127
|
-
}
|
|
118
|
+
return path.join(packageFolder(), "skills");
|
|
128
119
|
}
|
|
129
120
|
function createMcpServer(registry2, context, { oneAtATime = serial(), skills } = {}) {
|
|
130
121
|
const tools = toolsOf(registry2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rootnative/loupe",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.4",
|
|
4
4
|
"description": "loupe by Root Native: layout checks for iOS and Android, built for AI agents. Drive simulators and emulators, and measure every screen to the point.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Root Native",
|
package/skills/loupe/SKILL.md
CHANGED
|
@@ -28,10 +28,21 @@ schema, so this skill doesn't repeat them. loupe works on Android 11
|
|
|
28
28
|
## Before the first check
|
|
29
29
|
|
|
30
30
|
1. Run `devices`. Only a device in the state `ready` takes commands.
|
|
31
|
-
2. When two or more devices are ready, give `device`
|
|
32
|
-
AVD name
|
|
31
|
+
2. When two or more devices are ready, give `device` in each call: the
|
|
32
|
+
serial or the AVD name of an Android device. On an iOS simulator (its
|
|
33
|
+
UDID or its name), each command works but `pinch` and `drag --shot`,
|
|
34
|
+
which give `unsupported`. The first command on a simulator starts
|
|
35
|
+
loupe's runner there, which can take more than 5 minutes on a busy Mac.
|
|
36
|
+
loupe waits up to 10 minutes for it. `insets` on iOS reads only the
|
|
37
|
+
app's probe. In the iOS tree, a static text has its words in `text`,
|
|
38
|
+
`id` is the testID, and a touchable view with no role (a plain
|
|
39
|
+
`Pressable`) isn't `clickable`. On iOS, `dismiss` closes an alert only
|
|
40
|
+
with a button that cancels it (Cancel, Close, Not Now, Don’t Allow), and
|
|
41
|
+
stops at the keyboard.
|
|
33
42
|
3. Give `app` in each call that reads or touches the screen. For Expo Go,
|
|
34
|
-
it's `host.exp.exponent
|
|
43
|
+
it's `host.exp.exponent` on Android and `host.exp.Exponent` on iOS. On
|
|
44
|
+
an iOS simulator, loupe needs it, and `com.apple.springboard` is the
|
|
45
|
+
home screen: loupe reads the orientation of the screen from that app.
|
|
35
46
|
4. Run one loupe call at a time on a device. Two touches at the same time
|
|
36
47
|
lose events. The MCP server already runs its calls one after the other.
|
|
37
48
|
|
|
@@ -43,10 +54,11 @@ schema, so this skill doesn't repeat them. loupe works on Android 11
|
|
|
43
54
|
warms the bundle, closes Expo Go's onboarding sheet and developer menu,
|
|
44
55
|
and waits until the app shows: on the route when the app has the probe,
|
|
45
56
|
else until the screen has text, a label or a touch and keeps still.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
On iOS it also answers the "Open in “Expo Go”?" of iOS with Open.
|
|
58
|
+
Then give `app` in each call: `host.exp.exponent` on Android,
|
|
59
|
+
`host.exp.Exponent` on iOS. An animation that never stops, or a long
|
|
60
|
+
one, hides a screen from loupe: `expo-open` then gives `not_idle`. A
|
|
61
|
+
link to the root can start the animation again, so open another route.
|
|
50
62
|
3. After an edit of the app's code, run `expo-warm`, and compare its
|
|
51
63
|
`sha256` with the one before the edit. The same hash means that Metro
|
|
52
64
|
didn't see the edit. Ask the user to restart Metro with
|
|
@@ -115,10 +127,10 @@ fewer.
|
|
|
115
127
|
|
|
116
128
|
| Rule | Fails when | What to look at |
|
|
117
129
|
|---|---|---|
|
|
118
|
-
| `inset` | An element with text, a label, or a touch sits under a system bar or the cutout, or outside the safe area. | The edge in the finding. In landscape, the left and the right insets can differ. A full-screen scrim doesn't count. |
|
|
130
|
+
| `inset` | An element with text, a label, or a touch sits under a system bar or the cutout, or outside the safe area. | The edge in the finding. In landscape, the left and the right insets can differ. A full-screen scrim doesn't count. On iOS it runs only with the probe: with none, it gives a warning and no findings. |
|
|
119
131
|
| `overflow` | An element at a screen edge is shorter than the elements like it in its row or column: the edge cuts it. | The row or the column of the element. Let it wrap or scroll, or make its items smaller. |
|
|
120
132
|
| `centred` | A text with an element on each side is more than 4 dp from the centre of its container. | Centre the text in the whole bar, not in the space between the side items. Name a text with `centred`, `centredLabel`, or `centredId` to check it. |
|
|
121
|
-
| `touch-target` | An element that you can press is smaller than 48 × 48 dp. | From 40 dp, loupe gives a warning, not a finding: the tree doesn't show `hitSlop`. Look in the code for a `hitSlop` that makes it 48 dp. |
|
|
133
|
+
| `touch-target` | An element that you can press is smaller than 48 × 48 dp (44 × 44 pt on iOS). | From 40 dp, loupe gives a warning, not a finding: the tree doesn't show `hitSlop`. Look in the code for a `hitSlop` that makes it 48 dp. |
|
|
122
134
|
| `mirrored` | In RTL, an element sits where LTR puts it. | It runs only with `mirrorOf` (see below). |
|
|
123
135
|
|
|
124
136
|
To check `mirrored`:
|