prompttest-mobile 1.5.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 (64) hide show
  1. package/CONTRIBUTING.md +80 -0
  2. package/LICENSE +42 -0
  3. package/LICENSES.md +81 -0
  4. package/README.md +526 -0
  5. package/SECURITY.md +56 -0
  6. package/TERMS.md +138 -0
  7. package/dist/bin/prompttest.d.ts +2 -0
  8. package/dist/bin/prompttest.js +1418 -0
  9. package/dist/bin/server.d.ts +1 -0
  10. package/dist/constants/commands.d.ts +125 -0
  11. package/dist/engine.bundle.js +1039 -0
  12. package/dist/index.d.ts +143 -0
  13. package/dist/index.js +1039 -0
  14. package/dist/lib/adaptive-timing.d.ts +55 -0
  15. package/dist/lib/adb-provisioner.d.ts +55 -0
  16. package/dist/lib/adb.d.ts +448 -0
  17. package/dist/lib/ai/heuristic-resolver.d.ts +19 -0
  18. package/dist/lib/ai/index.d.ts +16 -0
  19. package/dist/lib/ai/llm-provider.d.ts +40 -0
  20. package/dist/lib/ai/types.d.ts +64 -0
  21. package/dist/lib/baseline.d.ts +159 -0
  22. package/dist/lib/benchmark.d.ts +100 -0
  23. package/dist/lib/checkpoint.d.ts +61 -0
  24. package/dist/lib/ci.d.ts +49 -0
  25. package/dist/lib/config-loader.d.ts +87 -0
  26. package/dist/lib/config.d.ts +136 -0
  27. package/dist/lib/crawler.d.ts +335 -0
  28. package/dist/lib/data-loader.d.ts +53 -0
  29. package/dist/lib/dfs-engine.d.ts +149 -0
  30. package/dist/lib/dictionary.d.ts +41 -0
  31. package/dist/lib/doctor.d.ts +45 -0
  32. package/dist/lib/driver-interface.d.ts +50 -0
  33. package/dist/lib/enterprise.d.ts +71 -0
  34. package/dist/lib/errors.d.ts +68 -0
  35. package/dist/lib/explorer.d.ts +165 -0
  36. package/dist/lib/feedback.d.ts +35 -0
  37. package/dist/lib/form-filler.d.ts +101 -0
  38. package/dist/lib/ios-driver.d.ts +38 -0
  39. package/dist/lib/jail-guard.d.ts +59 -0
  40. package/dist/lib/license.d.ts +51 -0
  41. package/dist/lib/live-server.d.ts +52 -0
  42. package/dist/lib/lock.d.ts +30 -0
  43. package/dist/lib/logger.d.ts +68 -0
  44. package/dist/lib/memory.d.ts +259 -0
  45. package/dist/lib/patterns.d.ts +202 -0
  46. package/dist/lib/profiler.d.ts +75 -0
  47. package/dist/lib/prompt-runner.d.ts +101 -0
  48. package/dist/lib/quiescence.d.ts +44 -0
  49. package/dist/lib/recorder.d.ts +155 -0
  50. package/dist/lib/repl.d.ts +29 -0
  51. package/dist/lib/reporter.d.ts +269 -0
  52. package/dist/lib/runner-utils.d.ts +316 -0
  53. package/dist/lib/scaffold.d.ts +53 -0
  54. package/dist/lib/step-handlers.d.ts +390 -0
  55. package/dist/lib/triage.d.ts +50 -0
  56. package/dist/lib/wizard.d.ts +42 -0
  57. package/dist/lib/zip-util.d.ts +36 -0
  58. package/docs/ARCHITECTURE.md +154 -0
  59. package/docs/CLI_CONTRACT.md +131 -0
  60. package/docs/CLI_STUDIO_CONTRACT.md +123 -0
  61. package/docs/PERFORMANCE_BASELINE.md +71 -0
  62. package/docs/PRODUCT_STATUS.md +56 -0
  63. package/docs/USER_MANUAL.md +764 -0
  64. package/package.json +66 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @module commands
3
+ * @description Defines standard ADB (Android Debug Bridge) command arrays used throughout PromptTest.
4
+ * This centralizes all shell syntax, flags, and arguments required to control Android devices,
5
+ * preventing scattered string-building logic in the driver classes.
6
+ */
7
+ /**
8
+ * A collection of constants and factory functions for constructing ADB commands.
9
+ * All commands are represented as string arrays compatible with child_process.spawn.
10
+ */
11
+ export declare const ADB_COMMANDS: {
12
+ /** Command to list all attached devices and emulators. */
13
+ readonly DEVICES: readonly ["devices", "-l"];
14
+ /** Command to capture a raw PNG screenshot directly to standard output. */
15
+ readonly SCREENCAP: readonly ["exec-out", "screencap", "-p"];
16
+ /** Command to dump window manager state (used to extract screen dimensions and density). */
17
+ readonly FOREGROUND_APP: readonly ["shell", "dumpsys", "window"];
18
+ /** Command to dump activity state (used to identify the currently focused app package). */
19
+ readonly CURRENT_FOCUS: readonly ["shell", "dumpsys", "activity", "activities"];
20
+ /**
21
+ * Generates a command to forcefully terminate an application.
22
+ * @param pkg The Android package name to stop.
23
+ * @returns Array of ADB command arguments.
24
+ */
25
+ readonly FORCE_STOP: (pkg: string) => readonly string[];
26
+ /**
27
+ * Generates a command to clear all application data and cache.
28
+ * @param pkg The Android package name to clear.
29
+ * @returns Array of ADB command arguments.
30
+ */
31
+ readonly CLEAR_APP: (pkg: string) => readonly string[];
32
+ /**
33
+ * Generates a command to launch the main launcher activity of an app.
34
+ * @param pkg The Android package name to launch.
35
+ * @returns Array of ADB command arguments.
36
+ */
37
+ readonly LAUNCH_APP: (pkg: string) => readonly string[];
38
+ /** Command to dump the current UI Automator hierarchy as compressed XML to standard output. */
39
+ readonly UIAUTOMATOR_DUMP: readonly ["exec-out", "uiautomator", "dump", "--compressed", "/dev/tty"];
40
+ /**
41
+ * Generates a command to simulate a single tap event.
42
+ * @param x The X coordinate on the screen.
43
+ * @param y The Y coordinate on the screen.
44
+ * @returns Array of ADB command arguments.
45
+ */
46
+ readonly INPUT_TAP: (x: number, y: number) => readonly string[];
47
+ /**
48
+ * Generates a command to input text via the keyboard. Note: spaces and special chars must be escaped.
49
+ * @param escapedText The text to input, properly escaped for the Android shell.
50
+ * @returns Array of ADB command arguments.
51
+ */
52
+ readonly INPUT_TEXT: (escapedText: string) => readonly string[];
53
+ /**
54
+ * Generates a command to simulate a physical or logical key press (e.g., BACK=4, ENTER=66).
55
+ * @param keyCode The Android KeyEvent code number or name.
56
+ * @returns Array of ADB command arguments.
57
+ */
58
+ readonly INPUT_KEY: (keyCode: number | string) => readonly string[];
59
+ /**
60
+ * Generates a command to simulate a swipe gesture across the screen.
61
+ * @param x1 The starting X coordinate.
62
+ * @param y1 The starting Y coordinate.
63
+ * @param x2 The ending X coordinate.
64
+ * @param y2 The ending Y coordinate.
65
+ * @param durationMs The duration of the swipe in milliseconds (default: 300).
66
+ * @returns Array of ADB command arguments.
67
+ */
68
+ readonly INPUT_SWIPE: (x1: number, y1: number, x2: number, y2: number, durationMs?: number) => readonly string[];
69
+ /**
70
+ * Generates a command to extract the most recent AndroidRuntime crash logs for a package.
71
+ * @param pkg The Android package name (used by callers to filter the output if needed).
72
+ * @returns Array of ADB command arguments.
73
+ */
74
+ readonly LOGCAT_CRASH: (_pkg: string) => readonly string[];
75
+ /**
76
+ * Generates a command to clear the AndroidRuntime crash log buffer.
77
+ * @returns Array of ADB command arguments.
78
+ */
79
+ readonly CLEAR_CRASH_LOGS: () => readonly string[];
80
+ /**
81
+ * Generates a command to grant a runtime permission to an application.
82
+ * @param pkg The Android package name.
83
+ * @param perm The permission name (will automatically prepend 'android.permission.' if omitted).
84
+ * @returns Array of ADB command arguments.
85
+ */
86
+ readonly GRANT_PERMISSION: (pkg: string, perm: string) => readonly string[];
87
+ /**
88
+ * Generates a command to install an APK file on the device, replacing any existing version.
89
+ * @param path The path to the APK file on the host machine.
90
+ * @returns Array of ADB command arguments.
91
+ */
92
+ readonly INSTALL_APK: (path: string) => readonly string[];
93
+ /**
94
+ * Generates a command to completely uninstall an application from the device.
95
+ * @param pkg The Android package name to uninstall.
96
+ * @returns Array of ADB command arguments.
97
+ */
98
+ readonly UNINSTALL_APP: (pkg: string) => readonly string[];
99
+ /**
100
+ * Generates a command to trigger a specific URI intent (deep link) on the device.
101
+ * @param uri The deep link URI (e.g., 'myapp://settings').
102
+ * @returns Array of ADB command arguments.
103
+ */
104
+ readonly DEEP_LINK: (uri: string) => readonly string[];
105
+ /**
106
+ * Generates a command to restart the adbd daemon listening on TCP for wireless debugging.
107
+ * @param port The TCP port to listen on (default: 5555).
108
+ * @returns Array of ADB command arguments.
109
+ */
110
+ readonly TCPIP: (port?: number) => readonly string[];
111
+ /**
112
+ * Generates a command to connect to a device over TCP/IP.
113
+ * @param target The target IP and optional port (e.g., '192.168.1.100:5555').
114
+ * @returns Array of ADB command arguments.
115
+ */
116
+ readonly CONNECT: (target: string) => readonly string[];
117
+ /**
118
+ * Generates a command to disconnect from a specific TCP/IP device or all devices.
119
+ * @param target The optional target IP to disconnect from.
120
+ * @returns Array of ADB command arguments.
121
+ */
122
+ readonly DISCONNECT: (target?: string) => readonly string[];
123
+ /** Command to retrieve the device's WLAN IP address. */
124
+ readonly GET_WLAN_IP: readonly ["shell", "ip", "-f", "inet", "addr", "show", "wlan0"];
125
+ };