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.
- package/CONTRIBUTING.md +80 -0
- package/LICENSE +42 -0
- package/LICENSES.md +81 -0
- package/README.md +526 -0
- package/SECURITY.md +56 -0
- package/TERMS.md +138 -0
- package/dist/bin/prompttest.d.ts +2 -0
- package/dist/bin/prompttest.js +1418 -0
- package/dist/bin/server.d.ts +1 -0
- package/dist/constants/commands.d.ts +125 -0
- package/dist/engine.bundle.js +1039 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.js +1039 -0
- package/dist/lib/adaptive-timing.d.ts +55 -0
- package/dist/lib/adb-provisioner.d.ts +55 -0
- package/dist/lib/adb.d.ts +448 -0
- package/dist/lib/ai/heuristic-resolver.d.ts +19 -0
- package/dist/lib/ai/index.d.ts +16 -0
- package/dist/lib/ai/llm-provider.d.ts +40 -0
- package/dist/lib/ai/types.d.ts +64 -0
- package/dist/lib/baseline.d.ts +159 -0
- package/dist/lib/benchmark.d.ts +100 -0
- package/dist/lib/checkpoint.d.ts +61 -0
- package/dist/lib/ci.d.ts +49 -0
- package/dist/lib/config-loader.d.ts +87 -0
- package/dist/lib/config.d.ts +136 -0
- package/dist/lib/crawler.d.ts +335 -0
- package/dist/lib/data-loader.d.ts +53 -0
- package/dist/lib/dfs-engine.d.ts +149 -0
- package/dist/lib/dictionary.d.ts +41 -0
- package/dist/lib/doctor.d.ts +45 -0
- package/dist/lib/driver-interface.d.ts +50 -0
- package/dist/lib/enterprise.d.ts +71 -0
- package/dist/lib/errors.d.ts +68 -0
- package/dist/lib/explorer.d.ts +165 -0
- package/dist/lib/feedback.d.ts +35 -0
- package/dist/lib/form-filler.d.ts +101 -0
- package/dist/lib/ios-driver.d.ts +38 -0
- package/dist/lib/jail-guard.d.ts +59 -0
- package/dist/lib/license.d.ts +51 -0
- package/dist/lib/live-server.d.ts +52 -0
- package/dist/lib/lock.d.ts +30 -0
- package/dist/lib/logger.d.ts +68 -0
- package/dist/lib/memory.d.ts +259 -0
- package/dist/lib/patterns.d.ts +202 -0
- package/dist/lib/profiler.d.ts +75 -0
- package/dist/lib/prompt-runner.d.ts +101 -0
- package/dist/lib/quiescence.d.ts +44 -0
- package/dist/lib/recorder.d.ts +155 -0
- package/dist/lib/repl.d.ts +29 -0
- package/dist/lib/reporter.d.ts +269 -0
- package/dist/lib/runner-utils.d.ts +316 -0
- package/dist/lib/scaffold.d.ts +53 -0
- package/dist/lib/step-handlers.d.ts +390 -0
- package/dist/lib/triage.d.ts +50 -0
- package/dist/lib/wizard.d.ts +42 -0
- package/dist/lib/zip-util.d.ts +36 -0
- package/docs/ARCHITECTURE.md +154 -0
- package/docs/CLI_CONTRACT.md +131 -0
- package/docs/CLI_STUDIO_CONTRACT.md +123 -0
- package/docs/PERFORMANCE_BASELINE.md +71 -0
- package/docs/PRODUCT_STATUS.md +56 -0
- package/docs/USER_MANUAL.md +764 -0
- package/package.json +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PromptTest — Ultra-fast, zero-code autonomous mobile testing & visual QA brain for Android
|
|
3
|
+
*
|
|
4
|
+
* Programmatic SDK & Core Engine Exports
|
|
5
|
+
*
|
|
6
|
+
* Architecture Overview:
|
|
7
|
+
* This module serves as the primary public SDK entry point for the PromptTest framework.
|
|
8
|
+
* It provides the building blocks (classes, types, and factory functions) to embed, extend,
|
|
9
|
+
* or orchestrate the testing engine in a multi-instance, parallelizable manner.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: Singleton instances (promptRunner, androidDriver, etc.) are intentionally
|
|
12
|
+
* NOT exported from the public API. Use the factory functions below to create
|
|
13
|
+
* isolated instances with no shared state, which is required for parallel runs,
|
|
14
|
+
* programmatic embedding, and unit testing.
|
|
15
|
+
*/
|
|
16
|
+
import { PromptRunner } from './lib/prompt-runner.js';
|
|
17
|
+
import { AndroidDriver } from './lib/adb.js';
|
|
18
|
+
import { AutonomousExplorer } from './lib/explorer.js';
|
|
19
|
+
import { MemoryEngine } from './lib/memory.js';
|
|
20
|
+
import { QaReporter } from './lib/reporter.js';
|
|
21
|
+
import { AutonomousRecorder } from './lib/recorder.js';
|
|
22
|
+
import { SemanticFormFiller } from './lib/form-filler.js';
|
|
23
|
+
import { BaselineManager } from './lib/baseline.js';
|
|
24
|
+
/** Core engine classes and execution types for test runs. */
|
|
25
|
+
export { PromptRunner, type PromptStep, type RunOptions } from './lib/prompt-runner.js';
|
|
26
|
+
/** ADB wrapper for low-level Android device interaction. */
|
|
27
|
+
export { AndroidDriver, type AndroidDevice } from './lib/adb.js';
|
|
28
|
+
/** Autonomous crawler and UI discovery engine. */
|
|
29
|
+
export { AutonomousExplorer } from './lib/explorer.js';
|
|
30
|
+
/** Dynamic locator learning and UI mapping storage. */
|
|
31
|
+
export { MemoryEngine, type LearnedMapping } from './lib/memory.js';
|
|
32
|
+
/** Audit and visual report generation tools. */
|
|
33
|
+
export { QaReporter, type QaReportData, type AuditStep, type ReportFormat } from './lib/reporter.js';
|
|
34
|
+
/** Interactive test creation via manual recording. */
|
|
35
|
+
export { AutonomousRecorder, type RecordedEvent } from './lib/recorder.js';
|
|
36
|
+
/** AI-powered semantic data generation for form filling. */
|
|
37
|
+
export { SemanticFormFiller, type TestDataPool, type FormFillResult } from './lib/form-filler.js';
|
|
38
|
+
/** Framework logging utilities. */
|
|
39
|
+
export { Logger, logger, type LogLevel } from './lib/logger.js';
|
|
40
|
+
/** Concurrency management for device access. */
|
|
41
|
+
export { acquireDeviceLock, releaseDeviceLock, type DeviceLock } from './lib/lock.js';
|
|
42
|
+
/** Visual regression testing and baseline image management. */
|
|
43
|
+
export { BaselineManager, baselineManager, type BaselineDiffResult, type MaskRegion, type BaselineCompareOptions, } from './lib/baseline.js';
|
|
44
|
+
/** Standard error classes and CLI exit codes. */
|
|
45
|
+
export { ExitCode, PromptTestError, DeviceError, LocatorError, ConfigError, LockError, SpecRecursionError, } from './lib/errors.js';
|
|
46
|
+
/** Additional utility modules and types */
|
|
47
|
+
export * from './lib/crawler.js';
|
|
48
|
+
export * from './lib/patterns.js';
|
|
49
|
+
export * from './lib/dictionary.js';
|
|
50
|
+
export * from './lib/config.js';
|
|
51
|
+
export * from './lib/config-loader.js';
|
|
52
|
+
export * from './lib/step-handlers.js';
|
|
53
|
+
export * from './lib/data-loader.js';
|
|
54
|
+
export * from './lib/live-server.js';
|
|
55
|
+
export * from './lib/runner-utils.js';
|
|
56
|
+
export * from './lib/ai/index.js';
|
|
57
|
+
export * from './lib/benchmark.js';
|
|
58
|
+
export * from './lib/doctor.js';
|
|
59
|
+
export * from './lib/repl.js';
|
|
60
|
+
export * from './lib/driver-interface.js';
|
|
61
|
+
export * from './lib/ios-driver.js';
|
|
62
|
+
export * from './lib/enterprise.js';
|
|
63
|
+
export * from './lib/triage.js';
|
|
64
|
+
export * from './lib/wizard.js';
|
|
65
|
+
export * from './lib/feedback.js';
|
|
66
|
+
/**
|
|
67
|
+
* Factory functions to create isolated instances with no shared global state.
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Creates an isolated PromptRunner instance.
|
|
71
|
+
* @param driver - Optional custom AndroidDriver instance to use.
|
|
72
|
+
* @param memory - Optional MemoryEngine instance for locator resolution.
|
|
73
|
+
* @param reporter - Optional QaReporter instance to log test results.
|
|
74
|
+
* @returns A fresh PromptRunner instance.
|
|
75
|
+
* @example
|
|
76
|
+
* const driver = createAndroidDriver();
|
|
77
|
+
* const runner = createPromptRunner(driver);
|
|
78
|
+
* await runner.runFile('test.txt');
|
|
79
|
+
*/
|
|
80
|
+
export declare function createPromptRunner(driver?: AndroidDriver, memory?: MemoryEngine, reporter?: QaReporter): PromptRunner;
|
|
81
|
+
/**
|
|
82
|
+
* Creates an isolated AutonomousExplorer instance.
|
|
83
|
+
* @param driver - Optional custom AndroidDriver to control the device.
|
|
84
|
+
* @param formFiller - Optional SemanticFormFiller for input generation.
|
|
85
|
+
* @param reporter - Optional QaReporter for visual and audit logs.
|
|
86
|
+
* @returns A fresh AutonomousExplorer instance.
|
|
87
|
+
* @example
|
|
88
|
+
* const explorer = createAutonomousExplorer();
|
|
89
|
+
* await explorer.explore('com.example.app');
|
|
90
|
+
*/
|
|
91
|
+
export declare function createAutonomousExplorer(driver?: AndroidDriver, formFiller?: SemanticFormFiller, reporter?: QaReporter): AutonomousExplorer;
|
|
92
|
+
/**
|
|
93
|
+
* Creates an isolated AndroidDriver instance.
|
|
94
|
+
* @param serial - Optional device serial number to target a specific device.
|
|
95
|
+
* @returns A fresh AndroidDriver instance.
|
|
96
|
+
* @example
|
|
97
|
+
* const driver = createAndroidDriver('emulator-5554');
|
|
98
|
+
* await driver.init();
|
|
99
|
+
*/
|
|
100
|
+
export declare function createAndroidDriver(serial?: string): AndroidDriver;
|
|
101
|
+
/**
|
|
102
|
+
* Creates an isolated MemoryEngine instance.
|
|
103
|
+
* @returns A fresh MemoryEngine instance.
|
|
104
|
+
* @example
|
|
105
|
+
* const memory = createMemoryEngine();
|
|
106
|
+
* await memory.load();
|
|
107
|
+
*/
|
|
108
|
+
export declare function createMemoryEngine(): MemoryEngine;
|
|
109
|
+
/**
|
|
110
|
+
* Creates an isolated QaReporter instance.
|
|
111
|
+
* @param outputDir - Optional custom directory path to write reports.
|
|
112
|
+
* @returns A fresh QaReporter instance.
|
|
113
|
+
* @example
|
|
114
|
+
* const reporter = createQaReporter('./reports');
|
|
115
|
+
* reporter.logStep('Started run');
|
|
116
|
+
*/
|
|
117
|
+
export declare function createQaReporter(outputDir?: string): QaReporter;
|
|
118
|
+
/**
|
|
119
|
+
* Creates an isolated AutonomousRecorder instance.
|
|
120
|
+
* @param driver - Optional custom AndroidDriver for recording events.
|
|
121
|
+
* @returns A fresh AutonomousRecorder instance.
|
|
122
|
+
* @example
|
|
123
|
+
* const recorder = createAutonomousRecorder();
|
|
124
|
+
* await recorder.start();
|
|
125
|
+
*/
|
|
126
|
+
export declare function createAutonomousRecorder(driver?: AndroidDriver): AutonomousRecorder;
|
|
127
|
+
/**
|
|
128
|
+
* Creates an isolated SemanticFormFiller instance.
|
|
129
|
+
* @param customDataPath - Optional path to custom form data definitions.
|
|
130
|
+
* @param driver - Optional AndroidDriver instance.
|
|
131
|
+
* @returns A fresh SemanticFormFiller instance.
|
|
132
|
+
* @example
|
|
133
|
+
* const filler = createFormFiller('./custom-data.json');
|
|
134
|
+
* await filler.fillCurrentScreen();
|
|
135
|
+
*/
|
|
136
|
+
export declare function createFormFiller(customDataPath?: string, driver?: AndroidDriver): SemanticFormFiller;
|
|
137
|
+
/**
|
|
138
|
+
* Creates an isolated BaselineManager instance.
|
|
139
|
+
* @param baselineDir - Optional directory path to store baseline images.
|
|
140
|
+
* @param threshold - Optional default threshold ratio.
|
|
141
|
+
* @returns A fresh BaselineManager instance.
|
|
142
|
+
*/
|
|
143
|
+
export declare function createBaselineManager(baselineDir?: string, threshold?: number): BaselineManager;
|