devlens-mcp 0.3.0 → 0.3.1

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 (162) hide show
  1. package/README.md +10 -21
  2. package/docs/setup-guide.md +11 -31
  3. package/package.json +1 -1
  4. package/.claude/settings.json +0 -12
  5. package/.claude/settings.local.json +0 -17
  6. package/bin/cli.ts +0 -22
  7. package/bin/register.ts +0 -96
  8. package/dist/src/config/devlens-config.d.ts +0 -92
  9. package/dist/src/config/devlens-config.d.ts.map +0 -1
  10. package/dist/src/config/devlens-config.js +0 -70
  11. package/dist/src/config/devlens-config.js.map +0 -1
  12. package/dist/src/index.d.ts +0 -35
  13. package/dist/src/index.d.ts.map +0 -1
  14. package/dist/src/index.js +0 -8
  15. package/dist/src/index.js.map +0 -1
  16. package/dist/src/metro/cdp-client.d.ts +0 -48
  17. package/dist/src/metro/cdp-client.d.ts.map +0 -1
  18. package/dist/src/metro/cdp-client.js +0 -127
  19. package/dist/src/metro/cdp-client.js.map +0 -1
  20. package/dist/src/metro/log-collector.d.ts +0 -30
  21. package/dist/src/metro/log-collector.d.ts.map +0 -1
  22. package/dist/src/metro/log-collector.js +0 -114
  23. package/dist/src/metro/log-collector.js.map +0 -1
  24. package/dist/src/metro/metro-bridge.d.ts +0 -56
  25. package/dist/src/metro/metro-bridge.d.ts.map +0 -1
  26. package/dist/src/metro/metro-bridge.js +0 -255
  27. package/dist/src/metro/metro-bridge.js.map +0 -1
  28. package/dist/src/metro/network-inspector.d.ts +0 -34
  29. package/dist/src/metro/network-inspector.d.ts.map +0 -1
  30. package/dist/src/metro/network-inspector.js +0 -100
  31. package/dist/src/metro/network-inspector.js.map +0 -1
  32. package/dist/src/platform/android/adb.d.ts +0 -50
  33. package/dist/src/platform/android/adb.d.ts.map +0 -1
  34. package/dist/src/platform/android/adb.js +0 -137
  35. package/dist/src/platform/android/adb.js.map +0 -1
  36. package/dist/src/platform/android/android-device.d.ts +0 -21
  37. package/dist/src/platform/android/android-device.d.ts.map +0 -1
  38. package/dist/src/platform/android/android-device.js +0 -94
  39. package/dist/src/platform/android/android-device.js.map +0 -1
  40. package/dist/src/platform/android/ui-automator.d.ts +0 -17
  41. package/dist/src/platform/android/ui-automator.d.ts.map +0 -1
  42. package/dist/src/platform/android/ui-automator.js +0 -126
  43. package/dist/src/platform/android/ui-automator.js.map +0 -1
  44. package/dist/src/platform/device-manager.d.ts +0 -28
  45. package/dist/src/platform/device-manager.d.ts.map +0 -1
  46. package/dist/src/platform/device-manager.js +0 -185
  47. package/dist/src/platform/device-manager.js.map +0 -1
  48. package/dist/src/platform/device.d.ts +0 -86
  49. package/dist/src/platform/device.d.ts.map +0 -1
  50. package/dist/src/platform/device.js +0 -7
  51. package/dist/src/platform/device.js.map +0 -1
  52. package/dist/src/platform/ios/accessibility.d.ts +0 -17
  53. package/dist/src/platform/ios/accessibility.d.ts.map +0 -1
  54. package/dist/src/platform/ios/accessibility.js +0 -159
  55. package/dist/src/platform/ios/accessibility.js.map +0 -1
  56. package/dist/src/platform/ios/ios-device.d.ts +0 -22
  57. package/dist/src/platform/ios/ios-device.d.ts.map +0 -1
  58. package/dist/src/platform/ios/ios-device.js +0 -97
  59. package/dist/src/platform/ios/ios-device.js.map +0 -1
  60. package/dist/src/platform/ios/simctl.d.ts +0 -54
  61. package/dist/src/platform/ios/simctl.d.ts.map +0 -1
  62. package/dist/src/platform/ios/simctl.js +0 -192
  63. package/dist/src/platform/ios/simctl.js.map +0 -1
  64. package/dist/src/server.d.ts +0 -3
  65. package/dist/src/server.d.ts.map +0 -1
  66. package/dist/src/server.js +0 -176
  67. package/dist/src/server.js.map +0 -1
  68. package/dist/src/snapshot/formatter.d.ts +0 -18
  69. package/dist/src/snapshot/formatter.d.ts.map +0 -1
  70. package/dist/src/snapshot/formatter.js +0 -86
  71. package/dist/src/snapshot/formatter.js.map +0 -1
  72. package/dist/src/snapshot/ref-registry.d.ts +0 -67
  73. package/dist/src/snapshot/ref-registry.d.ts.map +0 -1
  74. package/dist/src/snapshot/ref-registry.js +0 -169
  75. package/dist/src/snapshot/ref-registry.js.map +0 -1
  76. package/dist/src/snapshot/snapshot-differ.d.ts +0 -57
  77. package/dist/src/snapshot/snapshot-differ.d.ts.map +0 -1
  78. package/dist/src/snapshot/snapshot-differ.js +0 -153
  79. package/dist/src/snapshot/snapshot-differ.js.map +0 -1
  80. package/dist/src/tools/app-tools.d.ts +0 -71
  81. package/dist/src/tools/app-tools.d.ts.map +0 -1
  82. package/dist/src/tools/app-tools.js +0 -97
  83. package/dist/src/tools/app-tools.js.map +0 -1
  84. package/dist/src/tools/device-tools.d.ts +0 -53
  85. package/dist/src/tools/device-tools.d.ts.map +0 -1
  86. package/dist/src/tools/device-tools.js +0 -86
  87. package/dist/src/tools/device-tools.js.map +0 -1
  88. package/dist/src/tools/ds-tools.d.ts +0 -65
  89. package/dist/src/tools/ds-tools.d.ts.map +0 -1
  90. package/dist/src/tools/ds-tools.js +0 -314
  91. package/dist/src/tools/ds-tools.js.map +0 -1
  92. package/dist/src/tools/interaction-tools.d.ts +0 -248
  93. package/dist/src/tools/interaction-tools.d.ts.map +0 -1
  94. package/dist/src/tools/interaction-tools.js +0 -391
  95. package/dist/src/tools/interaction-tools.js.map +0 -1
  96. package/dist/src/tools/metro-tools.d.ts +0 -115
  97. package/dist/src/tools/metro-tools.d.ts.map +0 -1
  98. package/dist/src/tools/metro-tools.js +0 -270
  99. package/dist/src/tools/metro-tools.js.map +0 -1
  100. package/dist/src/tools/navigation-tools.d.ts +0 -36
  101. package/dist/src/tools/navigation-tools.d.ts.map +0 -1
  102. package/dist/src/tools/navigation-tools.js +0 -60
  103. package/dist/src/tools/navigation-tools.js.map +0 -1
  104. package/dist/src/tools/screenshot-tools.d.ts +0 -298
  105. package/dist/src/tools/screenshot-tools.d.ts.map +0 -1
  106. package/dist/src/tools/screenshot-tools.js +0 -565
  107. package/dist/src/tools/screenshot-tools.js.map +0 -1
  108. package/dist/src/tools/snapshot-tools.d.ts +0 -161
  109. package/dist/src/tools/snapshot-tools.d.ts.map +0 -1
  110. package/dist/src/tools/snapshot-tools.js +0 -479
  111. package/dist/src/tools/snapshot-tools.js.map +0 -1
  112. package/dist/src/utils/image-preprocess.d.ts +0 -49
  113. package/dist/src/utils/image-preprocess.d.ts.map +0 -1
  114. package/dist/src/utils/image-preprocess.js +0 -322
  115. package/dist/src/utils/image-preprocess.js.map +0 -1
  116. package/dist/src/utils/retry.d.ts +0 -21
  117. package/dist/src/utils/retry.d.ts.map +0 -1
  118. package/dist/src/utils/retry.js +0 -33
  119. package/dist/src/utils/retry.js.map +0 -1
  120. package/dist/src/visual/comparator.d.ts +0 -51
  121. package/dist/src/visual/comparator.d.ts.map +0 -1
  122. package/dist/src/visual/comparator.js +0 -119
  123. package/dist/src/visual/comparator.js.map +0 -1
  124. package/dist/src/visual/layout-analyzer.d.ts +0 -64
  125. package/dist/src/visual/layout-analyzer.d.ts.map +0 -1
  126. package/dist/src/visual/layout-analyzer.js +0 -198
  127. package/dist/src/visual/layout-analyzer.js.map +0 -1
  128. package/dist/src/visual/screenshot.d.ts +0 -17
  129. package/dist/src/visual/screenshot.d.ts.map +0 -1
  130. package/dist/src/visual/screenshot.js +0 -39
  131. package/dist/src/visual/screenshot.js.map +0 -1
  132. package/src/config/devlens-config.ts +0 -76
  133. package/src/index.ts +0 -5
  134. package/src/metro/cdp-client.ts +0 -160
  135. package/src/metro/log-collector.ts +0 -137
  136. package/src/metro/metro-bridge.ts +0 -307
  137. package/src/metro/network-inspector.ts +0 -134
  138. package/src/platform/android/adb.ts +0 -200
  139. package/src/platform/android/android-device.ts +0 -116
  140. package/src/platform/android/ui-automator.ts +0 -141
  141. package/src/platform/device-manager.ts +0 -229
  142. package/src/platform/device.ts +0 -110
  143. package/src/platform/ios/accessibility.ts +0 -189
  144. package/src/platform/ios/ios-device.ts +0 -116
  145. package/src/platform/ios/simctl.ts +0 -244
  146. package/src/server.ts +0 -228
  147. package/src/snapshot/formatter.ts +0 -102
  148. package/src/snapshot/ref-registry.ts +0 -230
  149. package/src/snapshot/snapshot-differ.ts +0 -220
  150. package/src/tools/app-tools.ts +0 -111
  151. package/src/tools/device-tools.ts +0 -96
  152. package/src/tools/ds-tools.ts +0 -395
  153. package/src/tools/interaction-tools.ts +0 -467
  154. package/src/tools/metro-tools.ts +0 -320
  155. package/src/tools/navigation-tools.ts +0 -71
  156. package/src/tools/screenshot-tools.ts +0 -698
  157. package/src/tools/snapshot-tools.ts +0 -585
  158. package/src/utils/image-preprocess.ts +0 -430
  159. package/src/utils/retry.ts +0 -51
  160. package/src/visual/comparator.ts +0 -191
  161. package/src/visual/layout-analyzer.ts +0 -283
  162. package/src/visual/screenshot.ts +0 -49
@@ -1,248 +0,0 @@
1
- import { z } from "zod";
2
- import type { DeviceManager } from "../platform/device-manager.js";
3
- import { RefRegistry } from "../snapshot/ref-registry.js";
4
- export declare const interactionToolSchemas: {
5
- devlens_tap: {
6
- description: string;
7
- parameters: z.ZodObject<{
8
- ref: z.ZodString;
9
- element: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- ref: string;
12
- element: string;
13
- }, {
14
- ref: string;
15
- element: string;
16
- }>;
17
- };
18
- devlens_type: {
19
- description: string;
20
- parameters: z.ZodObject<{
21
- ref: z.ZodString;
22
- text: z.ZodString;
23
- submit: z.ZodDefault<z.ZodBoolean>;
24
- }, "strip", z.ZodTypeAny, {
25
- text: string;
26
- ref: string;
27
- submit: boolean;
28
- }, {
29
- text: string;
30
- ref: string;
31
- submit?: boolean | undefined;
32
- }>;
33
- };
34
- devlens_swipe: {
35
- description: string;
36
- parameters: z.ZodObject<{
37
- direction: z.ZodEnum<["up", "down", "left", "right"]>;
38
- ref: z.ZodOptional<z.ZodString>;
39
- distance: z.ZodDefault<z.ZodNumber>;
40
- }, "strip", z.ZodTypeAny, {
41
- direction: "up" | "down" | "left" | "right";
42
- distance: number;
43
- ref?: string | undefined;
44
- }, {
45
- direction: "up" | "down" | "left" | "right";
46
- ref?: string | undefined;
47
- distance?: number | undefined;
48
- }>;
49
- };
50
- devlens_scroll: {
51
- description: string;
52
- parameters: z.ZodObject<{
53
- ref: z.ZodString;
54
- direction: z.ZodEnum<["up", "down"]>;
55
- }, "strip", z.ZodTypeAny, {
56
- ref: string;
57
- direction: "up" | "down";
58
- }, {
59
- ref: string;
60
- direction: "up" | "down";
61
- }>;
62
- };
63
- devlens_long_press: {
64
- description: string;
65
- parameters: z.ZodObject<{
66
- ref: z.ZodString;
67
- duration: z.ZodDefault<z.ZodNumber>;
68
- }, "strip", z.ZodTypeAny, {
69
- ref: string;
70
- duration: number;
71
- }, {
72
- ref: string;
73
- duration?: number | undefined;
74
- }>;
75
- };
76
- devlens_press_button: {
77
- description: string;
78
- parameters: z.ZodObject<{
79
- button: z.ZodEnum<["home", "back", "enter"]>;
80
- }, "strip", z.ZodTypeAny, {
81
- button: "home" | "back" | "enter";
82
- }, {
83
- button: "home" | "back" | "enter";
84
- }>;
85
- };
86
- devlens_fill_form: {
87
- description: string;
88
- parameters: z.ZodObject<{
89
- fields: z.ZodArray<z.ZodObject<{
90
- ref: z.ZodString;
91
- value: z.ZodString;
92
- }, "strip", z.ZodTypeAny, {
93
- value: string;
94
- ref: string;
95
- }, {
96
- value: string;
97
- ref: string;
98
- }>, "many">;
99
- }, "strip", z.ZodTypeAny, {
100
- fields: {
101
- value: string;
102
- ref: string;
103
- }[];
104
- }, {
105
- fields: {
106
- value: string;
107
- ref: string;
108
- }[];
109
- }>;
110
- };
111
- devlens_capture_flow: {
112
- description: string;
113
- parameters: z.ZodObject<{
114
- steps: z.ZodArray<z.ZodObject<{
115
- action: z.ZodEnum<["tap", "screenshot", "go_back", "swipe", "wait", "press_button"]>;
116
- ref: z.ZodOptional<z.ZodString>;
117
- element: z.ZodOptional<z.ZodString>;
118
- label: z.ZodOptional<z.ZodString>;
119
- direction: z.ZodOptional<z.ZodEnum<["up", "down", "left", "right"]>>;
120
- button: z.ZodOptional<z.ZodEnum<["home", "back", "enter"]>>;
121
- ms: z.ZodOptional<z.ZodNumber>;
122
- }, "strip", z.ZodTypeAny, {
123
- action: "screenshot" | "tap" | "swipe" | "go_back" | "wait" | "press_button";
124
- button?: "home" | "back" | "enter" | undefined;
125
- label?: string | undefined;
126
- ref?: string | undefined;
127
- element?: string | undefined;
128
- direction?: "up" | "down" | "left" | "right" | undefined;
129
- ms?: number | undefined;
130
- }, {
131
- action: "screenshot" | "tap" | "swipe" | "go_back" | "wait" | "press_button";
132
- button?: "home" | "back" | "enter" | undefined;
133
- label?: string | undefined;
134
- ref?: string | undefined;
135
- element?: string | undefined;
136
- direction?: "up" | "down" | "left" | "right" | undefined;
137
- ms?: number | undefined;
138
- }>, "many">;
139
- }, "strip", z.ZodTypeAny, {
140
- steps: {
141
- action: "screenshot" | "tap" | "swipe" | "go_back" | "wait" | "press_button";
142
- button?: "home" | "back" | "enter" | undefined;
143
- label?: string | undefined;
144
- ref?: string | undefined;
145
- element?: string | undefined;
146
- direction?: "up" | "down" | "left" | "right" | undefined;
147
- ms?: number | undefined;
148
- }[];
149
- }, {
150
- steps: {
151
- action: "screenshot" | "tap" | "swipe" | "go_back" | "wait" | "press_button";
152
- button?: "home" | "back" | "enter" | undefined;
153
- label?: string | undefined;
154
- ref?: string | undefined;
155
- element?: string | undefined;
156
- direction?: "up" | "down" | "left" | "right" | undefined;
157
- ms?: number | undefined;
158
- }[];
159
- }>;
160
- };
161
- };
162
- export declare function createInteractionToolHandlers(deviceManager: DeviceManager, refRegistry: RefRegistry, onNavigate?: () => void): {
163
- devlens_tap: (params: {
164
- ref: string;
165
- element: string;
166
- }) => Promise<{
167
- content: {
168
- type: "text";
169
- text: string;
170
- }[];
171
- }>;
172
- devlens_type: (params: {
173
- ref: string;
174
- text: string;
175
- submit: boolean;
176
- }) => Promise<{
177
- content: {
178
- type: "text";
179
- text: string;
180
- }[];
181
- }>;
182
- devlens_swipe: (params: {
183
- direction: "up" | "down" | "left" | "right";
184
- ref?: string;
185
- distance: number;
186
- }) => Promise<{
187
- content: {
188
- type: "text";
189
- text: string;
190
- }[];
191
- }>;
192
- devlens_scroll: (params: {
193
- ref: string;
194
- direction: "up" | "down";
195
- }) => Promise<{
196
- content: {
197
- type: "text";
198
- text: string;
199
- }[];
200
- }>;
201
- devlens_long_press: (params: {
202
- ref: string;
203
- duration: number;
204
- }) => Promise<{
205
- content: {
206
- type: "text";
207
- text: string;
208
- }[];
209
- }>;
210
- devlens_press_button: (params: {
211
- button: "home" | "back" | "enter";
212
- }) => Promise<{
213
- content: {
214
- type: "text";
215
- text: string;
216
- }[];
217
- }>;
218
- devlens_fill_form: (params: {
219
- fields: Array<{
220
- ref: string;
221
- value: string;
222
- }>;
223
- }) => Promise<{
224
- content: {
225
- type: "text";
226
- text: string;
227
- }[];
228
- }>;
229
- devlens_capture_flow: (params: {
230
- steps: Array<{
231
- action: "tap" | "screenshot" | "go_back" | "swipe" | "wait" | "press_button";
232
- ref?: string;
233
- element?: string;
234
- label?: string;
235
- direction?: "up" | "down" | "left" | "right";
236
- button?: "home" | "back" | "enter";
237
- ms?: number;
238
- }>;
239
- }) => Promise<{
240
- content: {
241
- type: "text" | "image";
242
- text?: string;
243
- data?: string;
244
- mimeType?: string;
245
- }[];
246
- }>;
247
- };
248
- //# sourceMappingURL=interaction-tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interaction-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/interaction-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;YACnC,EAAE,CAAC,EAAE,MAAM,CAAC;SACb,CAAC,CAAC;KACJ;;kBAuF8B,MAAM,GAAG,OAAO;mBAAS,MAAM;mBAAS,MAAM;uBAAa,MAAM;;;EA2BnG"}
@@ -1,391 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.interactionToolSchemas = void 0;
4
- exports.createInteractionToolHandlers = createInteractionToolHandlers;
5
- const zod_1 = require("zod");
6
- const formatter_js_1 = require("../snapshot/formatter.js");
7
- const screenshot_js_1 = require("../visual/screenshot.js");
8
- exports.interactionToolSchemas = {
9
- devlens_tap: {
10
- description: "Tap an element on screen by its ref ID. Like Playwright's browser_click. Always provide the element description alongside the ref for safety.",
11
- parameters: zod_1.z.object({
12
- ref: zod_1.z
13
- .string()
14
- .describe("Element ref from devlens_snapshot (e.g., e1, e5)"),
15
- element: zod_1.z
16
- .string()
17
- .describe("Human-readable description of what you're tapping (e.g., 'Submit button')"),
18
- }),
19
- },
20
- devlens_type: {
21
- description: "Type text into the currently focused input element. Use devlens_tap first to focus an input, then devlens_type to enter text.",
22
- parameters: zod_1.z.object({
23
- ref: zod_1.z.string().describe("Ref of the input element to type into"),
24
- text: zod_1.z.string().describe("Text to type"),
25
- submit: zod_1.z
26
- .boolean()
27
- .default(false)
28
- .describe("Press Enter/Return after typing (default: false)"),
29
- }),
30
- },
31
- devlens_swipe: {
32
- description: "Perform a swipe gesture on the screen. If ref is provided, swipes from that element's center. Otherwise swipes from screen center.",
33
- parameters: zod_1.z.object({
34
- direction: zod_1.z
35
- .enum(["up", "down", "left", "right"])
36
- .describe("Swipe direction"),
37
- ref: zod_1.z
38
- .string()
39
- .optional()
40
- .describe("Optional ref to swipe from (swipes from element center)"),
41
- distance: zod_1.z
42
- .number()
43
- .default(500)
44
- .describe("Swipe distance in pixels (default: 500)"),
45
- }),
46
- },
47
- devlens_scroll: {
48
- description: "Scroll a scrollable container up or down. Provide the ref of the scrollable element (like a ScrollView or FlatList).",
49
- parameters: zod_1.z.object({
50
- ref: zod_1.z.string().describe("Ref of the scrollable container"),
51
- direction: zod_1.z.enum(["up", "down"]).describe("Scroll direction"),
52
- }),
53
- },
54
- devlens_long_press: {
55
- description: "Long press an element by ref. Useful for context menus and drag initiation.",
56
- parameters: zod_1.z.object({
57
- ref: zod_1.z.string().describe("Element ref to long press"),
58
- duration: zod_1.z
59
- .number()
60
- .default(1000)
61
- .describe("Press duration in milliseconds (default: 1000)"),
62
- }),
63
- },
64
- devlens_press_button: {
65
- description: 'Press a hardware/system button. "home" goes to home screen, "back" navigates back, "enter" confirms input.',
66
- parameters: zod_1.z.object({
67
- button: zod_1.z
68
- .enum(["home", "back", "enter"])
69
- .describe("Button to press"),
70
- }),
71
- },
72
- devlens_fill_form: {
73
- description: "Fill multiple form fields at once. Taps each field and types the value. More efficient than individual tap+type calls.",
74
- parameters: zod_1.z.object({
75
- fields: zod_1.z
76
- .array(zod_1.z.object({
77
- ref: zod_1.z.string().describe("Ref of the input field"),
78
- value: zod_1.z.string().describe("Value to type into the field"),
79
- }))
80
- .describe("Array of {ref, value} pairs to fill"),
81
- }),
82
- },
83
- devlens_capture_flow: {
84
- description: "Execute a sequence of actions and capture labeled screenshots along the way. Useful for batch-verifying multiple screens in a single tool call (e.g., tap tab 1 → screenshot → tap tab 2 → screenshot → go back). Returns all labeled screenshots and a final snapshot.",
85
- parameters: zod_1.z.object({
86
- steps: zod_1.z
87
- .array(zod_1.z.object({
88
- action: zod_1.z
89
- .enum([
90
- "tap",
91
- "screenshot",
92
- "go_back",
93
- "swipe",
94
- "wait",
95
- "press_button",
96
- ])
97
- .describe("Action to perform"),
98
- ref: zod_1.z
99
- .string()
100
- .optional()
101
- .describe("Element ref for tap/swipe actions"),
102
- element: zod_1.z
103
- .string()
104
- .optional()
105
- .describe("Human description for tap action"),
106
- label: zod_1.z
107
- .string()
108
- .optional()
109
- .describe("Label for screenshots taken in this step. Only used with action='screenshot'."),
110
- direction: zod_1.z
111
- .enum(["up", "down", "left", "right"])
112
- .optional()
113
- .describe("Direction for swipe action"),
114
- button: zod_1.z
115
- .enum(["home", "back", "enter"])
116
- .optional()
117
- .describe("Button for press_button action"),
118
- ms: zod_1.z
119
- .number()
120
- .optional()
121
- .describe("Milliseconds to wait (for wait action, default: 1000)"),
122
- }))
123
- .describe("Sequence of actions to execute"),
124
- }),
125
- },
126
- };
127
- function createInteractionToolHandlers(deviceManager, refRegistry, onNavigate) {
128
- /** Helper: resolve ref to coordinates, throw clear error if not found */
129
- function resolveRef(ref) {
130
- const entry = refRegistry.resolve(ref);
131
- if (!entry) {
132
- throw new Error(`Ref "${ref}" not found. Run devlens_snapshot first to get current element refs.`);
133
- }
134
- return { x: entry.centerX, y: entry.centerY };
135
- }
136
- /** Helper: take a new snapshot and return formatted text */
137
- async function getUpdatedSnapshot() {
138
- const device = await deviceManager.getDevice();
139
- // Small delay for UI to settle after interaction
140
- await sleep(300);
141
- const snapshot = await device.getSnapshot();
142
- const nodeToRef = refRegistry.assignRefs(snapshot);
143
- return (0, formatter_js_1.formatSnapshot)(snapshot, nodeToRef);
144
- }
145
- return {
146
- devlens_tap: async (params) => {
147
- const { x, y } = resolveRef(params.ref);
148
- const device = await deviceManager.getDevice();
149
- await device.tap(x, y);
150
- onNavigate?.();
151
- const snapshot = await getUpdatedSnapshot();
152
- return {
153
- content: [
154
- {
155
- type: "text",
156
- text: `Tapped "${params.element}" [${params.ref}] at (${Math.round(x)}, ${Math.round(y)})\n\n${snapshot}`,
157
- },
158
- ],
159
- };
160
- },
161
- devlens_type: async (params) => {
162
- const { x, y } = resolveRef(params.ref);
163
- const device = await deviceManager.getDevice();
164
- // Tap to focus the input first
165
- await device.tap(x, y);
166
- await sleep(200);
167
- // Type the text
168
- await device.typeText(params.text);
169
- if (params.submit) {
170
- await device.pressButton("enter");
171
- }
172
- const snapshot = await getUpdatedSnapshot();
173
- return {
174
- content: [
175
- {
176
- type: "text",
177
- text: `Typed "${params.text}" into [${params.ref}]${params.submit ? " and submitted" : ""}\n\n${snapshot}`,
178
- },
179
- ],
180
- };
181
- },
182
- devlens_swipe: async (params) => {
183
- const device = await deviceManager.getDevice();
184
- const info = await device.getInfo();
185
- let startX, startY;
186
- if (params.ref) {
187
- const coords = resolveRef(params.ref);
188
- startX = coords.x;
189
- startY = coords.y;
190
- }
191
- else {
192
- startX = info.screenWidth / 2;
193
- startY = info.screenHeight / 2;
194
- }
195
- const directionMap = {
196
- up: { endX: startX, endY: startY - params.distance },
197
- down: { endX: startX, endY: startY + params.distance },
198
- left: { endX: startX - params.distance, endY: startY },
199
- right: { endX: startX + params.distance, endY: startY },
200
- };
201
- const { endX, endY } = directionMap[params.direction];
202
- await device.swipe(startX, startY, endX, endY);
203
- onNavigate?.();
204
- const snapshot = await getUpdatedSnapshot();
205
- return {
206
- content: [
207
- {
208
- type: "text",
209
- text: `Swiped ${params.direction}${params.ref ? ` from [${params.ref}]` : ""}\n\n${snapshot}`,
210
- },
211
- ],
212
- };
213
- },
214
- devlens_scroll: async (params) => {
215
- const { x, y } = resolveRef(params.ref);
216
- const device = await deviceManager.getDevice();
217
- const scrollDistance = 400;
218
- if (params.direction === "down") {
219
- await device.swipe(x, y, x, y - scrollDistance, 300);
220
- }
221
- else {
222
- await device.swipe(x, y, x, y + scrollDistance, 300);
223
- }
224
- const snapshot = await getUpdatedSnapshot();
225
- return {
226
- content: [
227
- {
228
- type: "text",
229
- text: `Scrolled ${params.direction} in [${params.ref}]\n\n${snapshot}`,
230
- },
231
- ],
232
- };
233
- },
234
- devlens_long_press: async (params) => {
235
- const { x, y } = resolveRef(params.ref);
236
- const device = await deviceManager.getDevice();
237
- await device.longPress(x, y, params.duration);
238
- const snapshot = await getUpdatedSnapshot();
239
- return {
240
- content: [
241
- {
242
- type: "text",
243
- text: `Long pressed [${params.ref}] for ${params.duration}ms\n\n${snapshot}`,
244
- },
245
- ],
246
- };
247
- },
248
- devlens_press_button: async (params) => {
249
- const device = await deviceManager.getDevice();
250
- await device.pressButton(params.button);
251
- onNavigate?.();
252
- const snapshot = await getUpdatedSnapshot();
253
- return {
254
- content: [
255
- {
256
- type: "text",
257
- text: `Pressed ${params.button} button\n\n${snapshot}`,
258
- },
259
- ],
260
- };
261
- },
262
- devlens_fill_form: async (params) => {
263
- const device = await deviceManager.getDevice();
264
- for (const field of params.fields) {
265
- const { x, y } = resolveRef(field.ref);
266
- await device.tap(x, y);
267
- await sleep(200);
268
- await device.typeText(field.value);
269
- await sleep(100);
270
- }
271
- const snapshot = await getUpdatedSnapshot();
272
- return {
273
- content: [
274
- {
275
- type: "text",
276
- text: `Filled ${params.fields.length} form field(s):\n${params.fields.map((f) => ` [${f.ref}] = "${f.value}"`).join("\n")}\n\n${snapshot}`,
277
- },
278
- ],
279
- };
280
- },
281
- devlens_capture_flow: async (params) => {
282
- const device = await deviceManager.getDevice();
283
- const screenshots = [];
284
- const log = [];
285
- for (let i = 0; i < params.steps.length; i++) {
286
- const step = params.steps[i];
287
- const stepNum = i + 1;
288
- switch (step.action) {
289
- case "tap": {
290
- if (!step.ref) {
291
- log.push(`Step ${stepNum}: tap — SKIPPED (no ref provided)`);
292
- break;
293
- }
294
- const { x, y } = resolveRef(step.ref);
295
- await device.tap(x, y);
296
- onNavigate?.();
297
- await sleep(300);
298
- log.push(`Step ${stepNum}: tap [${step.ref}]${step.element ? ` "${step.element}"` : ""} at (${Math.round(x)}, ${Math.round(y)})`);
299
- break;
300
- }
301
- case "screenshot": {
302
- const { base64 } = await (0, screenshot_js_1.captureScreenshot)(device);
303
- const label = step.label || `screenshot-${screenshots.length + 1}`;
304
- screenshots.push({ label, base64 });
305
- log.push(`Step ${stepNum}: screenshot "${label}"`);
306
- break;
307
- }
308
- case "go_back": {
309
- await device.pressButton("back");
310
- onNavigate?.();
311
- await sleep(500);
312
- log.push(`Step ${stepNum}: go_back`);
313
- break;
314
- }
315
- case "swipe": {
316
- const dir = step.direction || "up";
317
- const info = await device.getInfo();
318
- let startX, startY;
319
- if (step.ref) {
320
- const coords = resolveRef(step.ref);
321
- startX = coords.x;
322
- startY = coords.y;
323
- }
324
- else {
325
- startX = info.screenWidth / 2;
326
- startY = info.screenHeight / 2;
327
- }
328
- const dist = 500;
329
- const dirMap = {
330
- up: { endX: startX, endY: startY - dist },
331
- down: { endX: startX, endY: startY + dist },
332
- left: { endX: startX - dist, endY: startY },
333
- right: { endX: startX + dist, endY: startY },
334
- };
335
- const { endX, endY } = dirMap[dir];
336
- await device.swipe(startX, startY, endX, endY);
337
- onNavigate?.();
338
- await sleep(300);
339
- log.push(`Step ${stepNum}: swipe ${dir}${step.ref ? ` from [${step.ref}]` : ""}`);
340
- break;
341
- }
342
- case "wait": {
343
- const waitMs = step.ms || 1000;
344
- await sleep(waitMs);
345
- log.push(`Step ${stepNum}: wait ${waitMs}ms`);
346
- break;
347
- }
348
- case "press_button": {
349
- const btn = step.button || "back";
350
- await device.pressButton(btn);
351
- onNavigate?.();
352
- await sleep(300);
353
- log.push(`Step ${stepNum}: press_button "${btn}"`);
354
- break;
355
- }
356
- }
357
- }
358
- // Take final snapshot
359
- const finalSnapshot = await device.getSnapshot();
360
- const nodeToRef = refRegistry.assignRefs(finalSnapshot);
361
- const formattedSnapshot = (0, formatter_js_1.formatSnapshot)(finalSnapshot, nodeToRef);
362
- // Build content blocks
363
- const content = [
364
- {
365
- type: "text",
366
- text: `Flow completed (${params.steps.length} steps, ${screenshots.length} screenshots):\n\n${log.join("\n")}`,
367
- },
368
- ];
369
- for (const ss of screenshots) {
370
- content.push({
371
- type: "text",
372
- text: `--- ${ss.label} ---`,
373
- });
374
- content.push({
375
- type: "image",
376
- data: ss.base64,
377
- mimeType: "image/png",
378
- });
379
- }
380
- content.push({
381
- type: "text",
382
- text: `\n--- Final Snapshot ---\n${formattedSnapshot}\n\n${refRegistry.size} elements with refs.`,
383
- });
384
- return { content };
385
- },
386
- };
387
- }
388
- function sleep(ms) {
389
- return new Promise((resolve) => setTimeout(resolve, ms));
390
- }
391
- //# sourceMappingURL=interaction-tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interaction-tools.js","sourceRoot":"","sources":["../../../src/tools/interaction-tools.ts"],"names":[],"mappings":";;;AA4IA,sEAkUC;AA9cD,6BAAwB;AAGxB,2DAA0D;AAC1D,2DAA4D;AAE/C,QAAA,sBAAsB,GAAG;IACpC,WAAW,EAAE;QACX,WAAW,EACT,+IAA+I;QACjJ,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,GAAG,EAAE,OAAC;iBACH,MAAM,EAAE;iBACR,QAAQ,CAAC,kDAAkD,CAAC;YAC/D,OAAO,EAAE,OAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,CAAC,2EAA2E,CAAC;SACzF,CAAC;KACH;IACD,YAAY,EAAE;QACZ,WAAW,EACT,+HAA+H;QACjI,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;YACjE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YACzC,MAAM,EAAE,OAAC;iBACN,OAAO,EAAE;iBACT,OAAO,CAAC,KAAK,CAAC;iBACd,QAAQ,CAAC,kDAAkD,CAAC;SAChE,CAAC;KACH;IACD,aAAa,EAAE;QACb,WAAW,EACT,oIAAoI;QACtI,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,SAAS,EAAE,OAAC;iBACT,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;iBACrC,QAAQ,CAAC,iBAAiB,CAAC;YAC9B,GAAG,EAAE,OAAC;iBACH,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,yDAAyD,CAAC;YACtE,QAAQ,EAAE,OAAC;iBACR,MAAM,EAAE;iBACR,OAAO,CAAC,GAA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