agent-scenario-loop 0.1.2 → 0.1.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/README.md +9 -9
- package/app/profile-session.ts +352 -12
- package/dist/core/agent-summary.d.ts +3 -2
- package/dist/core/agent-summary.js +44 -2
- package/dist/core/artifact-contract.d.ts +28 -8
- package/dist/core/artifact-contract.js +676 -26
- package/dist/core/comparison.d.ts +57 -3
- package/dist/core/comparison.js +113 -1
- package/dist/core/planner.d.ts +32 -1
- package/dist/core/planner.js +144 -0
- package/dist/core/run-index.d.ts +4 -0
- package/dist/core/run-index.js +55 -1
- package/dist/core/schema-validator.d.ts +2 -0
- package/dist/core/schema-validator.js +2 -0
- package/dist/runner/android-adb-driver.d.ts +7 -2
- package/dist/runner/android-adb-driver.js +7 -1
- package/dist/runner/android-adb.d.ts +40 -5
- package/dist/runner/android-adb.js +1046 -664
- package/dist/runner/compare-latest.d.ts +8 -4
- package/dist/runner/compare-latest.js +24 -5
- package/dist/runner/example-android-live.d.ts +10 -1
- package/dist/runner/example-android-live.js +55 -0
- package/dist/runner/example-ios-live.d.ts +10 -1
- package/dist/runner/example-ios-live.js +55 -0
- package/dist/runner/ios-simctl.d.ts +6 -0
- package/dist/runner/ios-simctl.js +7 -0
- package/dist/runner/live-comparison.d.ts +2 -2
- package/dist/runner/live-comparison.js +2 -1
- package/dist/runner/live-proof-summary.d.ts +5 -4
- package/dist/runner/live-proof-summary.js +12 -2
- package/dist/runner/live-proof.d.ts +3 -2
- package/dist/runner/live-proof.js +9 -2
- package/dist/runner/profile-android.d.ts +16 -1
- package/dist/runner/profile-android.js +364 -26
- package/dist/runner/profile-ios.d.ts +13 -2
- package/dist/runner/profile-ios.js +341 -19
- package/dist/runner/profile-mobile.d.ts +39 -3
- package/dist/runner/profile-mobile.js +1054 -42
- package/dist/runner/validate-project.js +3 -0
- package/dist/scripts/consumer-rehearsal.d.ts +119 -0
- package/dist/scripts/consumer-rehearsal.js +757 -0
- package/dist/scripts/downstream-local-package-gate.d.ts +2 -0
- package/dist/scripts/downstream-local-package-gate.js +264 -0
- package/dist/scripts/package-smoke.d.ts +96 -0
- package/dist/scripts/package-smoke.js +2282 -0
- package/dist/scripts/release-readiness.d.ts +2 -0
- package/dist/scripts/release-readiness.js +520 -0
- package/docs/adapters.md +7 -1
- package/docs/api.md +2 -2
- package/docs/architecture.md +90 -0
- package/docs/authoring.md +39 -3
- package/docs/concepts.md +3 -24
- package/docs/consumer-rehearsal.md +31 -1
- package/docs/contracts.md +45 -101
- package/docs/external-adapter-protocol.md +219 -0
- package/docs/live-proofs.md +86 -3
- package/docs/principles.md +9 -15
- package/examples/mobile-app/README.md +12 -0
- package/examples/mobile-app/runner-manifests/evidence-provider.json +3 -3
- package/examples/mobile-app/runner-manifests/primary-runner.json +1 -0
- package/examples/mobile-app/scripts/asl-capture-profiler-provider.mjs +25 -0
- package/examples/runners/README.md +4 -3
- package/examples/runners/adb-android.json +1 -0
- package/examples/runners/agent-device-android.json +1 -0
- package/examples/runners/agent-device-ios.json +1 -0
- package/examples/runners/argent-android.json +1 -0
- package/examples/runners/argent-ios.json +1 -0
- package/examples/runners/axe-accessibility-provider.json +2 -2
- package/examples/runners/script-accessibility-provider.json +2 -2
- package/examples/runners/script-memory-provider.json +2 -2
- package/examples/runners/script-network-provider.json +2 -2
- package/examples/runners/script-profiler-provider.json +2 -2
- package/examples/runners/xcodebuildmcp-ios.json +1 -0
- package/package.json +12 -3
- package/schemas/causal-run.schema.json +85 -2
- package/schemas/comparison.schema.json +130 -2
- package/schemas/external-adapter-message.schema.json +693 -0
- package/schemas/health.schema.json +72 -0
- package/schemas/live-proof-set.schema.json +1 -1
- package/schemas/live-proof.schema.json +14 -6
- package/schemas/manifest.schema.json +515 -4
- package/schemas/profiler.schema.json +243 -0
- package/schemas/runner-capabilities.schema.json +28 -2
- package/schemas/scenario.schema.json +34 -2
- package/templates/evidence-provider.json +3 -3
- package/templates/primary-runner.json +1 -0
- package/templates/scripts/asl-capture-profiler-provider.mjs +20 -0
|
@@ -7,6 +7,7 @@ type AndroidAdbCommandResult = {
|
|
|
7
7
|
rawFileName: string;
|
|
8
8
|
stderr: string;
|
|
9
9
|
stdout: string;
|
|
10
|
+
stdoutBuffer?: Uint8Array;
|
|
10
11
|
};
|
|
11
12
|
type AndroidAdbDriver = {
|
|
12
13
|
assertVisible: (options: AndroidAdbAssertVisibleOptions) => Promise<AndroidAdbCommandResult>;
|
|
@@ -31,12 +32,15 @@ type AndroidAdbDriverOptions = {
|
|
|
31
32
|
deviceSerial: string;
|
|
32
33
|
executor: AndroidAdbCommandExecutor;
|
|
33
34
|
};
|
|
34
|
-
type AndroidAdbCommandExecutor = (command: string, args: string[]
|
|
35
|
+
type AndroidAdbCommandExecutor = (command: string, args: string[], options?: {
|
|
36
|
+
encoding?: 'buffer' | 'utf8';
|
|
37
|
+
}) => Promise<{
|
|
35
38
|
args: string[];
|
|
36
39
|
command: string;
|
|
37
40
|
exitCode: number;
|
|
38
41
|
stderr: string;
|
|
39
42
|
stdout: string;
|
|
43
|
+
stdoutBuffer?: Uint8Array;
|
|
40
44
|
}>;
|
|
41
45
|
type AndroidAdbDeepLinkOptions = {
|
|
42
46
|
packageName?: string | null;
|
|
@@ -110,7 +114,8 @@ declare function quoteAndroidShellArg(value: string): string;
|
|
|
110
114
|
declare function formatAndroidAdbRawOutput(result: {
|
|
111
115
|
stdout: string;
|
|
112
116
|
stderr: string;
|
|
113
|
-
|
|
117
|
+
stdoutBuffer?: Uint8Array;
|
|
118
|
+
}): string | Uint8Array;
|
|
114
119
|
/**
|
|
115
120
|
* Joins command output from a multi-command adb driver action.
|
|
116
121
|
*
|
|
@@ -57,6 +57,7 @@ function buildDriverResult({ action, rawFileName, result, }) {
|
|
|
57
57
|
rawFileName,
|
|
58
58
|
stderr: result.stderr,
|
|
59
59
|
stdout: result.stdout,
|
|
60
|
+
...(result.stdoutBuffer ? { stdoutBuffer: result.stdoutBuffer } : {}),
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
@@ -66,6 +67,9 @@ function buildDriverResult({ action, rawFileName, result, }) {
|
|
|
66
67
|
* @returns {string}
|
|
67
68
|
*/
|
|
68
69
|
function formatAndroidAdbRawOutput(result) {
|
|
70
|
+
if (result.stdoutBuffer && !result.stderr) {
|
|
71
|
+
return result.stdoutBuffer;
|
|
72
|
+
}
|
|
69
73
|
return [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
70
74
|
}
|
|
71
75
|
/**
|
|
@@ -373,7 +377,9 @@ function createAndroidAdbDriver({ adbPath, deviceSerial, executor, }) {
|
|
|
373
377
|
};
|
|
374
378
|
},
|
|
375
379
|
async screenshot({ rawFileName = 'adb-screenshot.png', } = {}) {
|
|
376
|
-
const result = await executor(adbPath, ['-s', deviceSerial, 'exec-out', 'screencap', '-p']
|
|
380
|
+
const result = await executor(adbPath, ['-s', deviceSerial, 'exec-out', 'screencap', '-p'], {
|
|
381
|
+
encoding: 'buffer',
|
|
382
|
+
});
|
|
377
383
|
return buildDriverResult({ action: 'screenshot', rawFileName, result });
|
|
378
384
|
},
|
|
379
385
|
async scroll({ durationMs = 300, endX, endY, rawFileName = 'adb-scroll.txt', startX, startY, }) {
|
|
@@ -3,6 +3,7 @@ type CliArgs = {
|
|
|
3
3
|
adb?: string | boolean;
|
|
4
4
|
'capture-logcat'?: string | boolean;
|
|
5
5
|
'clear-logcat'?: string | boolean;
|
|
6
|
+
'command-timeout-ms'?: string | boolean;
|
|
6
7
|
launch?: string | boolean;
|
|
7
8
|
'android-dev-client-url'?: string | boolean;
|
|
8
9
|
'android-dev-client-wait-ms'?: string | boolean;
|
|
@@ -28,8 +29,12 @@ type CommandResult = {
|
|
|
28
29
|
exitCode: number;
|
|
29
30
|
stderr: string;
|
|
30
31
|
stdout: string;
|
|
32
|
+
stdoutBuffer?: Uint8Array;
|
|
31
33
|
};
|
|
32
|
-
type
|
|
34
|
+
type CommandExecutorOptions = {
|
|
35
|
+
encoding?: 'buffer' | 'utf8';
|
|
36
|
+
};
|
|
37
|
+
type CommandExecutor = (command: string, args: string[], options?: CommandExecutorOptions) => Promise<CommandResult>;
|
|
33
38
|
type AndroidDevice = {
|
|
34
39
|
serial: string;
|
|
35
40
|
state: string;
|
|
@@ -40,7 +45,7 @@ type AndroidPreflightResult = {
|
|
|
40
45
|
device: AndroidDevice | null;
|
|
41
46
|
health: Record<string, unknown>;
|
|
42
47
|
metadata: Record<string, unknown>;
|
|
43
|
-
raw: Record<string, string>;
|
|
48
|
+
raw: Record<string, string | Uint8Array>;
|
|
44
49
|
runDir: string;
|
|
45
50
|
verdict: Record<string, unknown>;
|
|
46
51
|
};
|
|
@@ -81,7 +86,9 @@ type AndroidAdbDriverStep = {
|
|
|
81
86
|
type AndroidPreflightOptions = {
|
|
82
87
|
adbPath?: string;
|
|
83
88
|
captureLogcat?: boolean;
|
|
89
|
+
captureWatchdogMs?: number;
|
|
84
90
|
clearLogcat?: boolean;
|
|
91
|
+
commandTimeoutMs?: number;
|
|
85
92
|
deepLinks?: AndroidDeepLinkCommand[];
|
|
86
93
|
delay?: (ms: number) => Promise<void>;
|
|
87
94
|
driverSteps?: AndroidAdbDriverStep[];
|
|
@@ -129,7 +136,16 @@ declare function parsePositiveInteger(value: string | boolean | undefined, fallb
|
|
|
129
136
|
* @param {string[]} args
|
|
130
137
|
* @returns {Promise<CommandResult>}
|
|
131
138
|
*/
|
|
132
|
-
declare function execFileCommand(command: string, args: string[]): Promise<CommandResult>;
|
|
139
|
+
declare function execFileCommand(command: string, args: string[], options?: CommandExecutorOptions): Promise<CommandResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Runs a command with a bounded timeout and captures stdout, stderr, and exit code without throwing.
|
|
142
|
+
*
|
|
143
|
+
* @param {string} command
|
|
144
|
+
* @param {string[]} args
|
|
145
|
+
* @param {number} timeoutMs
|
|
146
|
+
* @returns {Promise<CommandResult>}
|
|
147
|
+
*/
|
|
148
|
+
declare function execFileCommandWithTimeout(command: string, args: string[], timeoutMs?: number, options?: CommandExecutorOptions): Promise<CommandResult>;
|
|
133
149
|
/**
|
|
134
150
|
* Parses `adb devices -l` output into device rows.
|
|
135
151
|
*
|
|
@@ -189,6 +205,25 @@ declare function buildAndroidVerdict({ runId, health }: {
|
|
|
189
205
|
runId: string;
|
|
190
206
|
health: Record<string, unknown>;
|
|
191
207
|
}): Record<string, unknown>;
|
|
208
|
+
type AndroidAdbCaptureWatchdogBudget = {
|
|
209
|
+
ceilingMs: number;
|
|
210
|
+
commandBudgetMs: number;
|
|
211
|
+
commandUnits: number;
|
|
212
|
+
declaredWaitMs: number;
|
|
213
|
+
floorMs: number;
|
|
214
|
+
perCommandOverheadMs: number;
|
|
215
|
+
source: 'derived' | 'override';
|
|
216
|
+
timeoutMs: number;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Derives a whole-capture adb watchdog from declared runner waits and command bounds.
|
|
220
|
+
*
|
|
221
|
+
* @param {AndroidPreflightOptions & {commandTimeoutMs: number}} options
|
|
222
|
+
* @returns {AndroidAdbCaptureWatchdogBudget}
|
|
223
|
+
*/
|
|
224
|
+
declare function deriveAndroidAdbCaptureWatchdogBudget({ captureLogcat, captureWatchdogMs, clearLogcat, commandTimeoutMs, deepLinks, driverSteps, launch, launchWaitMs, packageName, reactNativeDebugHost, startupDeepLinks, storageWrites, waitMs, }: AndroidPreflightOptions & {
|
|
225
|
+
commandTimeoutMs: number;
|
|
226
|
+
}): AndroidAdbCaptureWatchdogBudget;
|
|
192
227
|
/**
|
|
193
228
|
* Builds the driver steps for this adb capture window.
|
|
194
229
|
*
|
|
@@ -243,12 +278,12 @@ declare function runAndroidAdbDriverStep({ capturesDir, driver, driverStep, logc
|
|
|
243
278
|
* @param {AndroidPreflightOptions} options
|
|
244
279
|
* @returns {Promise<AndroidPreflightResult>}
|
|
245
280
|
*/
|
|
246
|
-
declare function runAndroidAdbPreflight({ adbPath, captureLogcat, clearLogcat, deepLinks, delay: wait, driverSteps, executor, launch, launchWaitMs, logcatLines, outputDir, packageName, reactNativeDebugHost, runId, serial, startupDeepLinks, storageWrites, waitMs, }?: AndroidPreflightOptions): Promise<AndroidPreflightResult>;
|
|
281
|
+
declare function runAndroidAdbPreflight({ adbPath, captureLogcat, captureWatchdogMs: captureWatchdogMsOverride, clearLogcat, commandTimeoutMs, deepLinks, delay: wait, driverSteps, executor, launch, launchWaitMs, logcatLines, outputDir, packageName, reactNativeDebugHost, runId, serial, startupDeepLinks, storageWrites, waitMs, }?: AndroidPreflightOptions): Promise<AndroidPreflightResult>;
|
|
247
282
|
/**
|
|
248
283
|
* Runs the android-adb preflight CLI.
|
|
249
284
|
*
|
|
250
285
|
* @returns {Promise<void>}
|
|
251
286
|
*/
|
|
252
287
|
declare function main(): Promise<void>;
|
|
253
|
-
export { ANDROID_DEVICE_EPOCH_MS_PLACEHOLDER, buildAndroidHealth, buildAndroidVerdict, buildReactNativeDebugHostPreferenceCommand, escapeAndroidPreferenceXml, execFileCommand, main, parseAdbDevices, parseArgs, parsePositiveInteger, parseReactNativeDebugHostPort, resolveAndroidAdbDriverSteps, applyAndroidSelectorResolution, buildAndroidSelectorHealthMetadata, needsAndroidSelectorResolution, runAndroidAdbDriverStep, runAndroidAdbPreflight, selectDevice, usage, };
|
|
288
|
+
export { ANDROID_DEVICE_EPOCH_MS_PLACEHOLDER, buildAndroidHealth, buildAndroidVerdict, buildReactNativeDebugHostPreferenceCommand, deriveAndroidAdbCaptureWatchdogBudget, escapeAndroidPreferenceXml, execFileCommand, execFileCommandWithTimeout, main, parseAdbDevices, parseArgs, parsePositiveInteger, parseReactNativeDebugHostPort, resolveAndroidAdbDriverSteps, applyAndroidSelectorResolution, buildAndroidSelectorHealthMetadata, needsAndroidSelectorResolution, runAndroidAdbDriverStep, runAndroidAdbPreflight, selectDevice, usage, };
|
|
254
289
|
export type { AndroidDevice, AndroidAdbDriverStep, AndroidAsyncStorageWrite, AndroidDeepLinkCommand, AndroidPreflightOptions, AndroidPreflightResult, CliArgs, CommandExecutor, CommandResult, };
|