@farmslot/recipe-runner 0.23.0
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 +255 -0
- package/LICENSE +21 -0
- package/README.md +274 -0
- package/bin/farmslot-visual-review.mjs +152 -0
- package/dist/adapters/app-lifecycle.d.ts +41 -0
- package/dist/adapters/app-lifecycle.d.ts.map +1 -0
- package/dist/adapters/app-lifecycle.js +224 -0
- package/dist/adapters/app-lifecycle.js.map +1 -0
- package/dist/adapters/core.d.ts +5 -0
- package/dist/adapters/core.d.ts.map +1 -0
- package/dist/adapters/core.js +433 -0
- package/dist/adapters/core.js.map +1 -0
- package/dist/adapters/gesture.d.ts +12 -0
- package/dist/adapters/gesture.d.ts.map +1 -0
- package/dist/adapters/gesture.js +76 -0
- package/dist/adapters/gesture.js.map +1 -0
- package/dist/adapters/ui.d.ts +33 -0
- package/dist/adapters/ui.d.ts.map +1 -0
- package/dist/adapters/ui.js +130 -0
- package/dist/adapters/ui.js.map +1 -0
- package/dist/cli/error-output.d.ts +6 -0
- package/dist/cli/error-output.d.ts.map +1 -0
- package/dist/cli/error-output.js +19 -0
- package/dist/cli/error-output.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +29 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/run-command.d.ts +8 -0
- package/dist/cli/run-command.d.ts.map +1 -0
- package/dist/cli/run-command.js +253 -0
- package/dist/cli/run-command.js.map +1 -0
- package/dist/cli/support.d.ts +31 -0
- package/dist/cli/support.d.ts.map +1 -0
- package/dist/cli/support.js +297 -0
- package/dist/cli/support.js.map +1 -0
- package/dist/cli/validate-command.d.ts +4 -0
- package/dist/cli/validate-command.d.ts.map +1 -0
- package/dist/cli/validate-command.js +52 -0
- package/dist/cli/validate-command.js.map +1 -0
- package/dist/core/compose.d.ts +23 -0
- package/dist/core/compose.d.ts.map +1 -0
- package/dist/core/compose.js +104 -0
- package/dist/core/compose.js.map +1 -0
- package/dist/core/execution.d.ts +44 -0
- package/dist/core/execution.d.ts.map +1 -0
- package/dist/core/execution.js +304 -0
- package/dist/core/execution.js.map +1 -0
- package/dist/core/failure.d.ts +23 -0
- package/dist/core/failure.d.ts.map +1 -0
- package/dist/core/failure.js +43 -0
- package/dist/core/failure.js.map +1 -0
- package/dist/core/graph.d.ts +12 -0
- package/dist/core/graph.d.ts.map +1 -0
- package/dist/core/graph.js +65 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/hud.d.ts +11 -0
- package/dist/core/hud.d.ts.map +1 -0
- package/dist/core/hud.js +120 -0
- package/dist/core/hud.js.map +1 -0
- package/dist/core/invocation.d.ts +13 -0
- package/dist/core/invocation.d.ts.map +1 -0
- package/dist/core/invocation.js +68 -0
- package/dist/core/invocation.js.map +1 -0
- package/dist/core/json.d.ts +9 -0
- package/dist/core/json.d.ts.map +1 -0
- package/dist/core/json.js +74 -0
- package/dist/core/json.js.map +1 -0
- package/dist/core/library-manifest.d.ts +53 -0
- package/dist/core/library-manifest.d.ts.map +1 -0
- package/dist/core/library-manifest.js +263 -0
- package/dist/core/library-manifest.js.map +1 -0
- package/dist/core/library.d.ts +80 -0
- package/dist/core/library.d.ts.map +1 -0
- package/dist/core/library.js +321 -0
- package/dist/core/library.js.map +1 -0
- package/dist/core/parameters.d.ts +5 -0
- package/dist/core/parameters.d.ts.map +1 -0
- package/dist/core/parameters.js +57 -0
- package/dist/core/parameters.js.map +1 -0
- package/dist/core/passive-observations.d.ts +25 -0
- package/dist/core/passive-observations.d.ts.map +1 -0
- package/dist/core/passive-observations.js +62 -0
- package/dist/core/passive-observations.js.map +1 -0
- package/dist/core/path.d.ts +7 -0
- package/dist/core/path.d.ts.map +1 -0
- package/dist/core/path.js +147 -0
- package/dist/core/path.js.map +1 -0
- package/dist/core/recording-cleanup.d.ts +10 -0
- package/dist/core/recording-cleanup.d.ts.map +1 -0
- package/dist/core/recording-cleanup.js +32 -0
- package/dist/core/recording-cleanup.js.map +1 -0
- package/dist/core/resolution-error.d.ts +7 -0
- package/dist/core/resolution-error.d.ts.map +1 -0
- package/dist/core/resolution-error.js +9 -0
- package/dist/core/resolution-error.js.map +1 -0
- package/dist/core/runner.d.ts +4 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/runner.js +738 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/core/scroll-to.d.ts +111 -0
- package/dist/core/scroll-to.d.ts.map +1 -0
- package/dist/core/scroll-to.js +353 -0
- package/dist/core/scroll-to.js.map +1 -0
- package/dist/core/suite.d.ts +25 -0
- package/dist/core/suite.d.ts.map +1 -0
- package/dist/core/suite.js +76 -0
- package/dist/core/suite.js.map +1 -0
- package/dist/core/trace.d.ts +5 -0
- package/dist/core/trace.d.ts.map +1 -0
- package/dist/core/trace.js +25 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/trust-error.d.ts +9 -0
- package/dist/core/trust-error.d.ts.map +1 -0
- package/dist/core/trust-error.js +18 -0
- package/dist/core/trust-error.js.map +1 -0
- package/dist/core/trust-input.d.ts +20 -0
- package/dist/core/trust-input.d.ts.map +1 -0
- package/dist/core/trust-input.js +68 -0
- package/dist/core/trust-input.js.map +1 -0
- package/dist/core/trust.d.ts +28 -0
- package/dist/core/trust.d.ts.map +1 -0
- package/dist/core/trust.js +284 -0
- package/dist/core/trust.js.map +1 -0
- package/dist/core/types.d.ts +319 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/validation.d.ts +4 -0
- package/dist/core/validation.d.ts.map +1 -0
- package/dist/core/validation.js +18 -0
- package/dist/core/validation.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/node/writers.d.ts +27 -0
- package/dist/node/writers.d.ts.map +1 -0
- package/dist/node/writers.js +99 -0
- package/dist/node/writers.js.map +1 -0
- package/dist/recording/android-mirror.d.ts +10 -0
- package/dist/recording/android-mirror.d.ts.map +1 -0
- package/dist/recording/android-mirror.js +180 -0
- package/dist/recording/android-mirror.js.map +1 -0
- package/dist/recording/capture-helper-timing.d.ts +4 -0
- package/dist/recording/capture-helper-timing.d.ts.map +1 -0
- package/dist/recording/capture-helper-timing.js +47 -0
- package/dist/recording/capture-helper-timing.js.map +1 -0
- package/dist/recording/capture-helper.d.ts +10 -0
- package/dist/recording/capture-helper.d.ts.map +1 -0
- package/dist/recording/capture-helper.js +335 -0
- package/dist/recording/capture-helper.js.map +1 -0
- package/dist/recording/cdp-video-recorder.d.ts +9 -0
- package/dist/recording/cdp-video-recorder.d.ts.map +1 -0
- package/dist/recording/cdp-video-recorder.js +319 -0
- package/dist/recording/cdp-video-recorder.js.map +1 -0
- package/dist/recording/frame-sampler.d.ts +19 -0
- package/dist/recording/frame-sampler.d.ts.map +1 -0
- package/dist/recording/frame-sampler.js +29 -0
- package/dist/recording/frame-sampler.js.map +1 -0
- package/dist/recording/timeline.d.ts +15 -0
- package/dist/recording/timeline.d.ts.map +1 -0
- package/dist/recording/timeline.js +88 -0
- package/dist/recording/timeline.js.map +1 -0
- package/dist/runtime/browser-extension.d.ts +17 -0
- package/dist/runtime/browser-extension.d.ts.map +1 -0
- package/dist/runtime/browser-extension.js +42 -0
- package/dist/runtime/browser-extension.js.map +1 -0
- package/dist/runtime/cdp.d.ts +138 -0
- package/dist/runtime/cdp.d.ts.map +1 -0
- package/dist/runtime/cdp.js +1429 -0
- package/dist/runtime/cdp.js.map +1 -0
- package/dist/runtime/decision-types.d.ts +23 -0
- package/dist/runtime/decision-types.d.ts.map +1 -0
- package/dist/runtime/decision-types.js +2 -0
- package/dist/runtime/decision-types.js.map +1 -0
- package/dist/runtime/deps-readiness.d.ts +21 -0
- package/dist/runtime/deps-readiness.d.ts.map +1 -0
- package/dist/runtime/deps-readiness.js +141 -0
- package/dist/runtime/deps-readiness.js.map +1 -0
- package/dist/runtime/log-analysis.d.ts +48 -0
- package/dist/runtime/log-analysis.d.ts.map +1 -0
- package/dist/runtime/log-analysis.js +128 -0
- package/dist/runtime/log-analysis.js.map +1 -0
- package/dist/runtime/metro-probe.d.ts +5 -0
- package/dist/runtime/metro-probe.d.ts.map +1 -0
- package/dist/runtime/metro-probe.js +24 -0
- package/dist/runtime/metro-probe.js.map +1 -0
- package/dist/runtime/operation.d.ts +32 -0
- package/dist/runtime/operation.d.ts.map +1 -0
- package/dist/runtime/operation.js +184 -0
- package/dist/runtime/operation.js.map +1 -0
- package/dist/runtime/orchestrate-up.d.ts +22 -0
- package/dist/runtime/orchestrate-up.d.ts.map +1 -0
- package/dist/runtime/orchestrate-up.js +35 -0
- package/dist/runtime/orchestrate-up.js.map +1 -0
- package/dist/runtime/react-native-bridge.d.ts +17 -0
- package/dist/runtime/react-native-bridge.d.ts.map +1 -0
- package/dist/runtime/react-native-bridge.js +57 -0
- package/dist/runtime/react-native-bridge.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +8 -0
- package/dist/version.js.map +1 -0
- package/package.json +163 -0
- package/test/fixtures/scroll-to-visible/README.md +39 -0
- package/visual-review/feedback-draft.mjs +82 -0
- package/visual-review/index.d.mts +41 -0
- package/visual-review/index.mjs +4 -0
- package/visual-review/recipe-board.mjs +142 -0
- package/visual-review/review-board.mjs +981 -0
- package/visual-review/server.mjs +69 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { copyFileSync, mkdirSync, readFileSync } from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
buildRecipeReviewBoard,
|
|
8
|
+
generateReviewBoard,
|
|
9
|
+
serveReviewBoard,
|
|
10
|
+
visualReviewFeedbackStorageKey,
|
|
11
|
+
} from '../visual-review/index.mjs';
|
|
12
|
+
|
|
13
|
+
function option(args, name, fallback) {
|
|
14
|
+
const index = args.indexOf(name);
|
|
15
|
+
if (index === -1) return fallback;
|
|
16
|
+
if (!args[index + 1]) throw new Error(`${name} requires a value.`);
|
|
17
|
+
const value = args[index + 1];
|
|
18
|
+
args.splice(index, 2);
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function options(args, name) {
|
|
23
|
+
const values = [];
|
|
24
|
+
let index = args.indexOf(name);
|
|
25
|
+
while (index !== -1) {
|
|
26
|
+
if (!args[index + 1]) throw new Error(`${name} requires a value.`);
|
|
27
|
+
values.push(args[index + 1]);
|
|
28
|
+
args.splice(index, 2);
|
|
29
|
+
index = args.indexOf(name);
|
|
30
|
+
}
|
|
31
|
+
return values;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function usage() {
|
|
35
|
+
return [
|
|
36
|
+
'Usage:',
|
|
37
|
+
' farmslot-visual-review <build|serve> <visual-review-source.json> [--surface <id>]… [--output <dir>] [--host <host>] [--port <port>]',
|
|
38
|
+
' farmslot-visual-review build-recipe <recipe.json> --artifacts <dir> --platform <name> --source-id <project:catalog> [--project <id>] [--title <title>] [--output <dir>]',
|
|
39
|
+
].join('\n');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function selectSourceSurfaces(source, surfaceIds) {
|
|
43
|
+
if (surfaceIds.length === 0) return source;
|
|
44
|
+
const selected = new Set(surfaceIds);
|
|
45
|
+
const missing = surfaceIds.filter((id) => !source.surfaces.some((surface) => surface.id === id));
|
|
46
|
+
if (missing.length > 0) throw new Error(`Unknown review surface: ${missing.join(', ')}`);
|
|
47
|
+
return {
|
|
48
|
+
...source,
|
|
49
|
+
surfaces: source.surfaces
|
|
50
|
+
.filter((surface) => selected.has(surface.id))
|
|
51
|
+
.map((surface) => ({
|
|
52
|
+
...surface,
|
|
53
|
+
...(surface.parentId && !selected.has(surface.parentId) ? { parentId: undefined } : {}),
|
|
54
|
+
...(surface.relatedSurfaceIds
|
|
55
|
+
? { relatedSurfaceIds: surface.relatedSurfaceIds.filter((id) => selected.has(id)) }
|
|
56
|
+
: {}),
|
|
57
|
+
})),
|
|
58
|
+
...(source.navigationEdges
|
|
59
|
+
? {
|
|
60
|
+
navigationEdges: source.navigationEdges.filter(
|
|
61
|
+
(edge) => selected.has(edge.fromSurfaceId) && selected.has(edge.toSurfaceId),
|
|
62
|
+
),
|
|
63
|
+
}
|
|
64
|
+
: {}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function resolveInside(root, relativePath, label) {
|
|
69
|
+
const resolvedRoot = path.resolve(root);
|
|
70
|
+
const resolvedPath = path.resolve(resolvedRoot, relativePath);
|
|
71
|
+
if (resolvedPath !== resolvedRoot && !resolvedPath.startsWith(`${resolvedRoot}${path.sep}`)) {
|
|
72
|
+
throw new Error(`${label} must stay inside ${resolvedRoot}.`);
|
|
73
|
+
}
|
|
74
|
+
return resolvedPath;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function copySourceImages(source, sourceDir, outputDir) {
|
|
78
|
+
if (path.resolve(sourceDir) === path.resolve(outputDir)) return;
|
|
79
|
+
for (const capture of source.surfaces.flatMap((surface) => surface.captures)) {
|
|
80
|
+
const sourceImage = resolveInside(sourceDir, capture.image.path, 'Review source image');
|
|
81
|
+
const outputImage = resolveInside(outputDir, capture.image.path, 'Review output image');
|
|
82
|
+
mkdirSync(path.dirname(outputImage), { recursive: true });
|
|
83
|
+
copyFileSync(sourceImage, outputImage);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function main() {
|
|
88
|
+
const args = process.argv.slice(2);
|
|
89
|
+
const command = args.shift();
|
|
90
|
+
const sourceArg = args.shift();
|
|
91
|
+
if (!['build', 'serve', 'build-recipe'].includes(command) || !sourceArg) {
|
|
92
|
+
throw new Error(usage());
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (command === 'build-recipe') {
|
|
96
|
+
const recipePath = path.resolve(sourceArg);
|
|
97
|
+
const artifactsDir = option(args, '--artifacts');
|
|
98
|
+
const platform = option(args, '--platform');
|
|
99
|
+
const sourceId = option(args, '--source-id');
|
|
100
|
+
if (!artifactsDir || !platform || !sourceId) throw new Error(usage());
|
|
101
|
+
const project = option(args, '--project');
|
|
102
|
+
const title = option(args, '--title');
|
|
103
|
+
const outputDir = path.resolve(
|
|
104
|
+
option(args, '--output', path.join(artifactsDir, 'visual-review')),
|
|
105
|
+
);
|
|
106
|
+
if (args.length > 0) throw new Error(`Unknown options: ${args.join(' ')}`);
|
|
107
|
+
buildRecipeReviewBoard({
|
|
108
|
+
artifactsDir: path.resolve(artifactsDir),
|
|
109
|
+
outputDir,
|
|
110
|
+
platform,
|
|
111
|
+
recipePath,
|
|
112
|
+
sourceId,
|
|
113
|
+
...(project ? { project } : {}),
|
|
114
|
+
...(title ? { title } : {}),
|
|
115
|
+
});
|
|
116
|
+
console.log(path.join(outputDir, 'index.html'));
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const sourcePath = path.resolve(sourceArg);
|
|
121
|
+
const surfaceIds = options(args, '--surface');
|
|
122
|
+
const outputDir = path.resolve(option(args, '--output', path.dirname(sourcePath)));
|
|
123
|
+
const host = option(args, '--host', '127.0.0.1');
|
|
124
|
+
const portValue = option(args, '--port', '0');
|
|
125
|
+
if (args.length > 0) throw new Error(`Unknown options: ${args.join(' ')}`);
|
|
126
|
+
const port = Number(portValue);
|
|
127
|
+
if (!Number.isInteger(port) || port < 0 || port > 65_535) {
|
|
128
|
+
throw new Error('--port must be an integer from 0 to 65535.');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const source = selectSourceSurfaces(JSON.parse(readFileSync(sourcePath, 'utf8')), surfaceIds);
|
|
132
|
+
copySourceImages(source, path.dirname(sourcePath), outputDir);
|
|
133
|
+
generateReviewBoard({
|
|
134
|
+
outputDir,
|
|
135
|
+
source,
|
|
136
|
+
storageKey: visualReviewFeedbackStorageKey(source),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
if (command === 'build') {
|
|
140
|
+
console.log(path.join(outputDir, 'index.html'));
|
|
141
|
+
} else {
|
|
142
|
+
const server = await serveReviewBoard({ directory: outputDir, host, port });
|
|
143
|
+
console.log(server.url);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
await main();
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
151
|
+
process.exitCode = 1;
|
|
152
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ActionAdapter, ActionExecutionContext } from '../core/types.js';
|
|
2
|
+
export type AppLifecyclePlatform = 'android' | 'ios-simulator';
|
|
3
|
+
export type AppLifecycleCommand = 'launch' | 'foreground' | 'background' | 'terminate' | 'restart';
|
|
4
|
+
export interface AppLifecycleTarget {
|
|
5
|
+
platform: AppLifecyclePlatform;
|
|
6
|
+
/** Android adb serial or iOS simulator UDID/name. */
|
|
7
|
+
deviceId?: string;
|
|
8
|
+
/** Android package name or iOS bundle id. */
|
|
9
|
+
appId: string;
|
|
10
|
+
/** Optional deep link used for Expo/dev-client launch and foreground. */
|
|
11
|
+
launchUrl?: string;
|
|
12
|
+
/** Optional Metro port to reverse on Android before opening Expo/dev-client. */
|
|
13
|
+
metroPort?: string | number;
|
|
14
|
+
/** Optional host-side calls to run immediately before launch/foreground. */
|
|
15
|
+
prelaunchCalls?: AppLifecycleCall[];
|
|
16
|
+
}
|
|
17
|
+
export interface AppLifecycleExecResult {
|
|
18
|
+
stdout?: string;
|
|
19
|
+
stderr?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AppLifecycleCommandRunner {
|
|
22
|
+
execFile(file: string, args: string[], options?: {
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
}): Promise<AppLifecycleExecResult>;
|
|
25
|
+
}
|
|
26
|
+
export interface AppLifecycleCall {
|
|
27
|
+
file: string;
|
|
28
|
+
args: string[];
|
|
29
|
+
ignoreFailureWhenOutputIncludes?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface AppLifecycleTargetProvider {
|
|
32
|
+
resolveTarget(node: Record<string, unknown>, context: ActionExecutionContext): Promise<AppLifecycleTarget> | AppLifecycleTarget;
|
|
33
|
+
}
|
|
34
|
+
export interface CreateAppLifecycleAdapterOptions {
|
|
35
|
+
actions?: Iterable<string>;
|
|
36
|
+
targetProvider: AppLifecycleTargetProvider;
|
|
37
|
+
commandRunner?: AppLifecycleCommandRunner;
|
|
38
|
+
}
|
|
39
|
+
export declare function createAppLifecycleAdapters(options: CreateAppLifecycleAdapterOptions): ActionAdapter[];
|
|
40
|
+
export declare function createAppLifecycleAdapter(options: CreateAppLifecycleAdapterOptions): ActionAdapter;
|
|
41
|
+
//# sourceMappingURL=app-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-lifecycle.d.ts","sourceRoot":"","sources":["../../src/adapters/app-lifecycle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI9E,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,eAAe,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEnG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CACN,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;CACrD;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,cAAc,EAAE,0BAA0B,CAAC;IAC3C,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC3C;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,gCAAgC,GACxC,aAAa,EAAE,CAGjB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gCAAgC,GACxC,aAAa,CAiDf"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { asNumber, asOptionalString } from '../core/json.js';
|
|
4
|
+
const execFileAsync = promisify(execFile);
|
|
5
|
+
export function createAppLifecycleAdapters(options) {
|
|
6
|
+
if (options.actions && !new Set(options.actions).has('app.lifecycle'))
|
|
7
|
+
return [];
|
|
8
|
+
return [createAppLifecycleAdapter(options)];
|
|
9
|
+
}
|
|
10
|
+
export function createAppLifecycleAdapter(options) {
|
|
11
|
+
const commandRunner = options.commandRunner ?? defaultCommandRunner();
|
|
12
|
+
return {
|
|
13
|
+
action: 'app.lifecycle',
|
|
14
|
+
source: {
|
|
15
|
+
kind: 'bundled',
|
|
16
|
+
trust: 'trusted',
|
|
17
|
+
name: '@farmslot/recipe-runner',
|
|
18
|
+
},
|
|
19
|
+
async execute(node, context) {
|
|
20
|
+
// Validate every node input before resolving the target or running any
|
|
21
|
+
// command, so a bad knob can never fail the action after side effects.
|
|
22
|
+
const command = parseLifecycleCommand(node);
|
|
23
|
+
const timeoutMs = optionalIntegerInRange(node.timeout_ms, 'app.lifecycle.timeout_ms', 0, Number.MAX_SAFE_INTEGER);
|
|
24
|
+
const settleMs = optionalIntegerInRange(node.settle_ms, 'app.lifecycle.settle_ms', 0, 60_000);
|
|
25
|
+
const target = await options.targetProvider.resolveTarget(node, context);
|
|
26
|
+
const calls = lifecycleCalls(command, target);
|
|
27
|
+
const results = [];
|
|
28
|
+
for (const call of calls) {
|
|
29
|
+
const result = await execLifecycleCall(commandRunner, call, timeoutMs);
|
|
30
|
+
results.push({
|
|
31
|
+
file: call.file,
|
|
32
|
+
args: call.args,
|
|
33
|
+
stdout: result.stdout ?? '',
|
|
34
|
+
stderr: result.stderr ?? '',
|
|
35
|
+
ignoredFailure: result.ignoredFailure ?? false,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (settleMs !== undefined) {
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, settleMs));
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
output: {
|
|
43
|
+
command,
|
|
44
|
+
platform: target.platform,
|
|
45
|
+
deviceId: target.deviceId ?? null,
|
|
46
|
+
appId: target.appId,
|
|
47
|
+
launchUrl: target.launchUrl ?? null,
|
|
48
|
+
calls: results,
|
|
49
|
+
settleMs: settleMs ?? 0,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function parseLifecycleCommand(node) {
|
|
56
|
+
// `event` and `state` are accepted as aliases for `command` so recipes can use
|
|
57
|
+
// the field name that reads best for their flow (e.g. state: background).
|
|
58
|
+
const raw = asOptionalString(node.command, 'app.lifecycle.command') ??
|
|
59
|
+
asOptionalString(node.event, 'app.lifecycle.event') ??
|
|
60
|
+
asOptionalString(node.state, 'app.lifecycle.state');
|
|
61
|
+
if (!raw) {
|
|
62
|
+
throw new Error('app.lifecycle.command must be explicit (aliases: event, state). Supported commands: launch, foreground, background, terminate, restart.');
|
|
63
|
+
}
|
|
64
|
+
const command = raw;
|
|
65
|
+
if (command === 'launch' ||
|
|
66
|
+
command === 'foreground' ||
|
|
67
|
+
command === 'background' ||
|
|
68
|
+
command === 'terminate' ||
|
|
69
|
+
command === 'restart') {
|
|
70
|
+
return command;
|
|
71
|
+
}
|
|
72
|
+
throw new Error(`Unsupported app.lifecycle command: ${command}. Supported commands: launch, foreground, background, terminate, restart.`);
|
|
73
|
+
}
|
|
74
|
+
function lifecycleCalls(command, target) {
|
|
75
|
+
if (!target.appId || !target.appId.trim()) {
|
|
76
|
+
throw new Error('app.lifecycle target requires appId.');
|
|
77
|
+
}
|
|
78
|
+
if (command === 'restart') {
|
|
79
|
+
return [...lifecycleCalls('terminate', target), ...lifecycleCalls('launch', target)];
|
|
80
|
+
}
|
|
81
|
+
if (command === 'launch' || command === 'foreground') {
|
|
82
|
+
return [...(target.prelaunchCalls ?? []), ...lifecyclePlatformCalls(command, target)];
|
|
83
|
+
}
|
|
84
|
+
return lifecyclePlatformCalls(command, target);
|
|
85
|
+
}
|
|
86
|
+
function lifecyclePlatformCalls(command, target) {
|
|
87
|
+
if (target.platform === 'android')
|
|
88
|
+
return androidLifecycleCalls(command, target);
|
|
89
|
+
if (target.platform === 'ios-simulator')
|
|
90
|
+
return iosSimulatorLifecycleCalls(command, target);
|
|
91
|
+
throw new Error(`Unsupported app.lifecycle platform: ${String(target.platform)}`);
|
|
92
|
+
}
|
|
93
|
+
function androidLifecycleCalls(command, target) {
|
|
94
|
+
const adb = 'adb';
|
|
95
|
+
const serialArgs = target.deviceId ? ['-s', target.deviceId] : [];
|
|
96
|
+
if (command === 'background') {
|
|
97
|
+
return [{ file: adb, args: [...serialArgs, 'shell', 'input', 'keyevent', 'HOME'] }];
|
|
98
|
+
}
|
|
99
|
+
if (command === 'terminate') {
|
|
100
|
+
return [{ file: adb, args: [...serialArgs, 'shell', 'am', 'force-stop', target.appId] }];
|
|
101
|
+
}
|
|
102
|
+
if (command === 'foreground') {
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
file: adb,
|
|
106
|
+
args: [
|
|
107
|
+
...serialArgs,
|
|
108
|
+
'shell',
|
|
109
|
+
'monkey',
|
|
110
|
+
'-p',
|
|
111
|
+
target.appId,
|
|
112
|
+
'-c',
|
|
113
|
+
'android.intent.category.LAUNCHER',
|
|
114
|
+
'1',
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
if (target.launchUrl) {
|
|
120
|
+
const calls = [];
|
|
121
|
+
if (target.metroPort !== undefined && target.metroPort !== '') {
|
|
122
|
+
const port = String(target.metroPort);
|
|
123
|
+
calls.push({
|
|
124
|
+
file: adb,
|
|
125
|
+
args: [...serialArgs, 'reverse', `tcp:${port}`, `tcp:${port}`],
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
calls.push({
|
|
129
|
+
file: adb,
|
|
130
|
+
args: [
|
|
131
|
+
...serialArgs,
|
|
132
|
+
'shell',
|
|
133
|
+
'am',
|
|
134
|
+
'start',
|
|
135
|
+
'-a',
|
|
136
|
+
'android.intent.action.VIEW',
|
|
137
|
+
'-d',
|
|
138
|
+
target.launchUrl,
|
|
139
|
+
],
|
|
140
|
+
});
|
|
141
|
+
return calls;
|
|
142
|
+
}
|
|
143
|
+
return [
|
|
144
|
+
{
|
|
145
|
+
file: adb,
|
|
146
|
+
args: [
|
|
147
|
+
...serialArgs,
|
|
148
|
+
'shell',
|
|
149
|
+
'monkey',
|
|
150
|
+
'-p',
|
|
151
|
+
target.appId,
|
|
152
|
+
'-c',
|
|
153
|
+
'android.intent.category.LAUNCHER',
|
|
154
|
+
'1',
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
function iosSimulatorLifecycleCalls(command, target) {
|
|
160
|
+
const device = target.deviceId ?? 'booted';
|
|
161
|
+
if (command === 'background') {
|
|
162
|
+
// iOS Simulator has no direct HOME equivalent; foreground Settings to background the app under test.
|
|
163
|
+
return [{ file: 'xcrun', args: ['simctl', 'launch', device, 'com.apple.Preferences'] }];
|
|
164
|
+
}
|
|
165
|
+
if (command === 'terminate') {
|
|
166
|
+
return [
|
|
167
|
+
{
|
|
168
|
+
file: 'xcrun',
|
|
169
|
+
args: ['simctl', 'terminate', device, target.appId],
|
|
170
|
+
// simctl exits non-zero when the app is already stopped; terminate and restart remain idempotent.
|
|
171
|
+
ignoreFailureWhenOutputIncludes: ['not running', 'found nothing to terminate'],
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
if (command === 'foreground') {
|
|
176
|
+
return [{ file: 'xcrun', args: ['simctl', 'launch', device, target.appId] }];
|
|
177
|
+
}
|
|
178
|
+
if (target.launchUrl) {
|
|
179
|
+
return [{ file: 'xcrun', args: ['simctl', 'openurl', device, target.launchUrl] }];
|
|
180
|
+
}
|
|
181
|
+
return [{ file: 'xcrun', args: ['simctl', 'launch', device, target.appId] }];
|
|
182
|
+
}
|
|
183
|
+
async function execLifecycleCall(commandRunner, call, timeoutMs) {
|
|
184
|
+
try {
|
|
185
|
+
return await commandRunner.execFile(call.file, call.args, { timeoutMs });
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
189
|
+
if (call.ignoreFailureWhenOutputIncludes?.some((needle) => text.includes(needle))) {
|
|
190
|
+
return { stderr: text, ignoredFailure: true };
|
|
191
|
+
}
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function optionalIntegerInRange(value, label, min, max) {
|
|
196
|
+
if (value == null)
|
|
197
|
+
return undefined;
|
|
198
|
+
const number = asNumber(value, label);
|
|
199
|
+
if (!Number.isInteger(number) || number < min || number > max) {
|
|
200
|
+
throw new Error(`${label} must be an integer from ${min} through ${max}.`);
|
|
201
|
+
}
|
|
202
|
+
return number;
|
|
203
|
+
}
|
|
204
|
+
function defaultCommandRunner() {
|
|
205
|
+
return {
|
|
206
|
+
async execFile(file, args, options) {
|
|
207
|
+
try {
|
|
208
|
+
return await execFileAsync(file, args, {
|
|
209
|
+
timeout: options?.timeoutMs,
|
|
210
|
+
encoding: 'utf8',
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
if (error instanceof Error) {
|
|
215
|
+
const output = error;
|
|
216
|
+
const details = [output.message, output.stderr, output.stdout].filter(Boolean).join('\n');
|
|
217
|
+
throw new Error(`${file} ${args.join(' ')} failed: ${details}`);
|
|
218
|
+
}
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=app-lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-lifecycle.js","sourceRoot":"","sources":["../../src/adapters/app-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAoD1C,MAAM,UAAU,0BAA0B,CACxC,OAAyC;IAEzC,IAAI,OAAO,CAA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