@fliwright/cli 0.0.0-stage → 0.1.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.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/dist/ArtifactReferences.d.ts +7 -0
  4. package/dist/ArtifactReferences.js +82 -0
  5. package/dist/CommandRegistry.d.ts +40 -0
  6. package/dist/CommandRegistry.js +177 -0
  7. package/dist/InspectionOutput.d.ts +5 -0
  8. package/dist/InspectionOutput.js +11 -0
  9. package/dist/RecordingReplay.d.ts +24 -0
  10. package/dist/RecordingReplay.js +79 -0
  11. package/dist/WorkflowContext.d.ts +20 -0
  12. package/dist/WorkflowContext.js +1 -0
  13. package/dist/capabilities/form.d.ts +13 -0
  14. package/dist/capabilities/form.js +9 -0
  15. package/dist/capabilities/interaction.d.ts +226 -0
  16. package/dist/capabilities/interaction.js +447 -0
  17. package/dist/capabilities/session.d.ts +18 -0
  18. package/dist/capabilities/session.js +55 -0
  19. package/dist/catalog.d.ts +36 -0
  20. package/dist/catalog.js +69 -0
  21. package/dist/commands/app-inspect.d.ts +96 -0
  22. package/dist/commands/app-inspect.js +70 -0
  23. package/dist/commands/app.d.ts +53 -0
  24. package/dist/commands/app.js +104 -0
  25. package/dist/commands/artifact-query.d.ts +138 -0
  26. package/dist/commands/artifact-query.js +81 -0
  27. package/dist/commands/artifacts.d.ts +40 -0
  28. package/dist/commands/artifacts.js +311 -0
  29. package/dist/commands/doctor.d.ts +11 -0
  30. package/dist/commands/doctor.js +285 -0
  31. package/dist/commands/flow-runtime.d.ts +40 -0
  32. package/dist/commands/flow-runtime.js +37 -0
  33. package/dist/commands/flow.d.ts +122 -0
  34. package/dist/commands/flow.js +236 -0
  35. package/dist/commands/generate-test.d.ts +46 -0
  36. package/dist/commands/generate-test.js +233 -0
  37. package/dist/commands/init.d.ts +22 -0
  38. package/dist/commands/init.js +262 -0
  39. package/dist/commands/mock-management.d.ts +53 -0
  40. package/dist/commands/mock-management.js +65 -0
  41. package/dist/commands/mock.d.ts +8 -0
  42. package/dist/commands/mock.js +27 -0
  43. package/dist/commands/record.d.ts +55 -0
  44. package/dist/commands/record.js +216 -0
  45. package/dist/commands/run.d.ts +93 -0
  46. package/dist/commands/run.js +707 -0
  47. package/dist/commands/scenario.d.ts +26 -0
  48. package/dist/commands/scenario.js +39 -0
  49. package/dist/commands/tdd.d.ts +72 -0
  50. package/dist/commands/tdd.js +218 -0
  51. package/dist/config.d.ts +20 -0
  52. package/dist/config.js +40 -0
  53. package/dist/index.d.ts +10 -0
  54. package/dist/index.js +139 -0
  55. package/dist/registry/devices.d.ts +2 -0
  56. package/dist/registry/devices.js +12 -0
  57. package/dist/registry/finite.d.ts +38 -0
  58. package/dist/registry/finite.js +121 -0
  59. package/dist/registry/flow-schemas.d.ts +405 -0
  60. package/dist/registry/flow-schemas.js +98 -0
  61. package/dist/registry/flow.d.ts +3 -0
  62. package/dist/registry/flow.js +56 -0
  63. package/dist/registry/generation-schema.d.ts +112 -0
  64. package/dist/registry/generation-schema.js +36 -0
  65. package/dist/registry/session.d.ts +2 -0
  66. package/dist/registry/session.js +24 -0
  67. package/dist/registry/tdd.d.ts +3 -0
  68. package/dist/registry/tdd.js +118 -0
  69. package/dist/reporter.d.ts +95 -0
  70. package/dist/reporter.js +61 -0
  71. package/dist/run.d.ts +6 -0
  72. package/dist/run.js +5 -0
  73. package/dist/session/ConnectionHost.d.ts +43 -0
  74. package/dist/session/ConnectionHost.js +129 -0
  75. package/dist/session/client.d.ts +38 -0
  76. package/dist/session/client.js +120 -0
  77. package/dist/session/worker.d.ts +1 -0
  78. package/dist/session/worker.js +161 -0
  79. package/dist/vm-discovery.d.ts +14 -0
  80. package/dist/vm-discovery.js +85 -0
  81. package/package.json +78 -3
@@ -0,0 +1,262 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { mkdir, readFile, stat, writeFile } from 'node:fs/promises';
3
+ import { basename, join } from 'node:path';
4
+ const NODE_DEV_DEPENDENCIES = {
5
+ '@fliwright/cli': '^0.1.0',
6
+ '@fliwright/vitest': '^0.1.0',
7
+ '@types/node': '^22.0.0',
8
+ typescript: '^5.5.0',
9
+ vitest: '5.0.5',
10
+ };
11
+ const DEFAULT_SCRIPTS = {
12
+ 'test:fliwright': 'fliwright run',
13
+ 'doctor:fliwright': 'fliwright doctor',
14
+ 'record:fliwright': 'fliwright record',
15
+ };
16
+ const CONFIG_TEMPLATE = `import { defineConfig } from '@fliwright/cli';
17
+
18
+ export default defineConfig({
19
+ runsRoot: '.fliwright/runs',
20
+ cacheRoot: '.fliwright/cache',
21
+ // vmServiceUrl: 'ws://127.0.0.1:8181/ws',
22
+ timeout: 30000,
23
+ screenshot: 'file',
24
+ recording: { mode: 'standard' },
25
+ paths: {
26
+ tests: '.fliwright/tests', scripts: '.fliwright/scripts',
27
+ recordings: '.fliwright/recordings', flows: '.fliwright/flows',
28
+ },
29
+ reporter: 'pretty',
30
+ });
31
+ `;
32
+ const VITEST_CONFIG_TEMPLATE = `import { defineConfig } from 'vitest/config';
33
+ import { fliwrightPreset } from '@fliwright/vitest/preset';
34
+ import projectConfig from './fliwright.config.js';
35
+
36
+ export default defineConfig({
37
+ ...fliwrightPreset(projectConfig),
38
+ });
39
+ `;
40
+ const EXAMPLE_TEST_TEMPLATE = `import { test, expect } from '@fliwright/vitest';
41
+
42
+ test('counter increments', async ({ page }) => {
43
+ // Replace with your app's actual widgets.
44
+ await expect(page.locator('text=Counter')).toBeVisible();
45
+
46
+ await page.locator('text=Increment').click();
47
+
48
+ await expect(page.locator('text=Count: 1')).toBeVisible();
49
+ });
50
+ `;
51
+ const EXAMPLE_SCRIPT_TEMPLATE = `import { script, expect } from '@fliwright/vitest';
52
+
53
+ script('counter smoke script', async ({ page }) => {
54
+ await expect(page.locator('text=Counter')).toBeVisible();
55
+ await page.locator('text=Increment').click();
56
+ });
57
+ `;
58
+ const TSCONFIG_TEMPLATE = `{
59
+ "compilerOptions": {
60
+ "target": "ES2022",
61
+ "module": "Node16",
62
+ "moduleResolution": "Node16",
63
+ "strict": true,
64
+ "esModuleInterop": true,
65
+ "skipLibCheck": true,
66
+ "types": ["node", "vitest"]
67
+ },
68
+ "include": ["fliwright.config.ts", "vitest.config.ts", ".fliwright/tests/**/*.ts", ".fliwright/scripts/**/*.ts"]
69
+ }
70
+ `;
71
+ const GITIGNORE_LINES = [
72
+ '.fliwright/runs/',
73
+ '.fliwright/cache/',
74
+ '.fliwright/ai/',
75
+ '.fliwright/failures/',
76
+ ];
77
+ export async function initCommand(projectDir, options = {}, deps = {}) {
78
+ const log = deps.log ?? console.log;
79
+ const result = { created: [], updated: [], skipped: [], commands: [] };
80
+ const install = options.install ?? true;
81
+ const setupNode = options.node ?? true;
82
+ const setupFlutter = options.flutter ?? true;
83
+ await writeIfAbsent(join(projectDir, 'fliwright.config.ts'), CONFIG_TEMPLATE, result, log);
84
+ await writeIfAbsent(join(projectDir, 'vitest.config.ts'), VITEST_CONFIG_TEMPLATE, result, log);
85
+ await mkdir(join(projectDir, '.fliwright', 'tests'), { recursive: true });
86
+ await writeIfAbsent(join(projectDir, '.fliwright', 'tests', 'example.test.ts'), EXAMPLE_TEST_TEMPLATE, result, log);
87
+ await mkdir(join(projectDir, '.fliwright', 'scripts'), { recursive: true });
88
+ await writeIfAbsent(join(projectDir, '.fliwright', 'scripts', 'example.script.ts'), EXAMPLE_SCRIPT_TEMPLATE, result, log);
89
+ await writeIfAbsent(join(projectDir, 'tsconfig.json'), TSCONFIG_TEMPLATE, result, log);
90
+ await ensureGitignore(projectDir, result, log);
91
+ if (setupNode) {
92
+ await ensurePackageJson(projectDir, result, log);
93
+ }
94
+ const hasFlutterProject = await fileExists(join(projectDir, 'pubspec.yaml'));
95
+ if (setupFlutter && hasFlutterProject) {
96
+ await ensureFlutterEntry(projectDir, result, log);
97
+ }
98
+ else if (setupFlutter) {
99
+ result.skipped.push('Flutter setup');
100
+ log('No pubspec.yaml found - skipping Flutter bridge setup.');
101
+ }
102
+ if (install) {
103
+ if (setupNode) {
104
+ const packageManager = options.packageManager ?? await detectPackageManager(projectDir);
105
+ await runAndTrack(packageManager, ['install'], projectDir, result, deps);
106
+ }
107
+ if (setupFlutter && hasFlutterProject) {
108
+ await runAndTrack('flutter', ['pub', 'add', 'fliwright_bridge'], projectDir, result, deps);
109
+ }
110
+ }
111
+ else {
112
+ result.skipped.push('Dependency install');
113
+ log('Dependency installation skipped.');
114
+ }
115
+ printNextSteps(log, hasFlutterProject);
116
+ return result;
117
+ }
118
+ async function writeIfAbsent(path, content, result, log) {
119
+ if (await fileExists(path)) {
120
+ result.skipped.push(path);
121
+ log(`${basename(path)} already exists - skipping.`);
122
+ return;
123
+ }
124
+ await writeFile(path, content, 'utf8');
125
+ result.created.push(path);
126
+ log(`Created ${path}`);
127
+ }
128
+ async function ensurePackageJson(projectDir, result, log) {
129
+ const path = join(projectDir, 'package.json');
130
+ const existed = await fileExists(path);
131
+ const pkg = existed ? JSON.parse(await readFile(path, 'utf8')) : defaultPackageJson(projectDir);
132
+ pkg.type ??= 'module';
133
+ pkg.scripts = { ...DEFAULT_SCRIPTS, ...(pkg.scripts ?? {}) };
134
+ pkg.devDependencies = { ...(pkg.devDependencies ?? {}) };
135
+ for (const [name, version] of Object.entries(NODE_DEV_DEPENDENCIES)) {
136
+ pkg.devDependencies[name] ??= version;
137
+ }
138
+ await writeFile(path, `${JSON.stringify(pkg, null, 2)}\n`, 'utf8');
139
+ (existed ? result.updated : result.created).push(path);
140
+ log(`${existed ? 'Updated' : 'Created'} package.json`);
141
+ }
142
+ function defaultPackageJson(projectDir) {
143
+ return {
144
+ name: safePackageName(basename(projectDir)),
145
+ private: true,
146
+ type: 'module',
147
+ scripts: {},
148
+ devDependencies: {},
149
+ };
150
+ }
151
+ async function ensureGitignore(projectDir, result, log) {
152
+ const path = join(projectDir, '.gitignore');
153
+ const existing = await readTextIfExists(path);
154
+ const currentLines = new Set(existing.split(/\r?\n/).map((line) => line.trim()).filter(Boolean));
155
+ const missing = GITIGNORE_LINES.filter((line) => !currentLines.has(line));
156
+ if (missing.length === 0) {
157
+ result.skipped.push(path);
158
+ log('.gitignore already covers Fliwright artifacts - skipping.');
159
+ return;
160
+ }
161
+ const next = [existing.trimEnd(), ...missing].filter(Boolean).join('\n');
162
+ await writeFile(path, `${next}\n`, 'utf8');
163
+ (existing ? result.updated : result.created).push(path);
164
+ log(`${existing ? 'Updated' : 'Created'} .gitignore`);
165
+ }
166
+ async function ensureFlutterEntry(projectDir, result, log) {
167
+ const pubspec = await readFile(join(projectDir, 'pubspec.yaml'), 'utf8');
168
+ const packageName = parsePubspecName(pubspec) ?? safePackageName(basename(projectDir));
169
+ await mkdir(join(projectDir, 'test_driver'), { recursive: true });
170
+ await writeIfAbsent(join(projectDir, 'test_driver', 'fliwright_app.dart'), flutterEntryTemplate(packageName), result, log);
171
+ }
172
+ function flutterEntryTemplate(packageName) {
173
+ return `import 'package:fliwright_bridge/fliwright_bridge.dart';
174
+ import 'package:${packageName}/main.dart' as app;
175
+
176
+ Future<void> main() async {
177
+ FliwrightRecordingBinding.ensureInitialized();
178
+ await FliwrightBridge.init();
179
+ app.main();
180
+ }
181
+ `;
182
+ }
183
+ async function detectPackageManager(projectDir) {
184
+ const packageJson = await readPackageManagerField(projectDir);
185
+ if (packageJson)
186
+ return packageJson;
187
+ if (await fileExists(join(projectDir, 'pnpm-lock.yaml')))
188
+ return 'pnpm';
189
+ if (await fileExists(join(projectDir, 'yarn.lock')))
190
+ return 'yarn';
191
+ if (await fileExists(join(projectDir, 'bun.lock')) || await fileExists(join(projectDir, 'bun.lockb')))
192
+ return 'bun';
193
+ if (await fileExists(join(projectDir, 'package-lock.json')))
194
+ return 'npm';
195
+ return 'npm';
196
+ }
197
+ async function readPackageManagerField(projectDir) {
198
+ try {
199
+ const pkg = JSON.parse(await readFile(join(projectDir, 'package.json'), 'utf8'));
200
+ const name = pkg.packageManager?.split('@')[0];
201
+ return name === 'pnpm' || name === 'yarn' || name === 'bun' || name === 'npm' ? name : undefined;
202
+ }
203
+ catch {
204
+ return undefined;
205
+ }
206
+ }
207
+ async function runAndTrack(command, args, cwd, result, deps) {
208
+ result.commands.push({ command, args, cwd });
209
+ await (deps.runCommand ?? runCommand)(command, args, cwd);
210
+ }
211
+ function runCommand(command, args, cwd) {
212
+ return new Promise((resolve, reject) => {
213
+ const child = spawn(command, args, { cwd, stdio: 'inherit', shell: process.platform === 'win32' });
214
+ child.on('error', reject);
215
+ child.on('close', (code) => {
216
+ if (code === 0) {
217
+ resolve();
218
+ return;
219
+ }
220
+ reject(new Error(`Command failed with exit code ${code}: ${[command, ...args].join(' ')}`));
221
+ });
222
+ });
223
+ }
224
+ async function fileExists(path) {
225
+ try {
226
+ await stat(path);
227
+ return true;
228
+ }
229
+ catch {
230
+ return false;
231
+ }
232
+ }
233
+ async function readTextIfExists(path) {
234
+ try {
235
+ return await readFile(path, 'utf8');
236
+ }
237
+ catch {
238
+ return '';
239
+ }
240
+ }
241
+ function parsePubspecName(pubspec) {
242
+ const match = /^name:\s*([A-Za-z0-9_]+)\s*$/m.exec(pubspec);
243
+ return match?.[1];
244
+ }
245
+ function safePackageName(value) {
246
+ return value.toLowerCase().replace(/[^a-z0-9_-]+/g, '-').replace(/^-+|-+$/g, '') || 'fliwright-app';
247
+ }
248
+ function printNextSteps(log, hasFlutterProject) {
249
+ log('');
250
+ log('Next steps:');
251
+ if (hasFlutterProject) {
252
+ log(' 1. Start your Flutter app with the Fliwright bridge entrypoint:');
253
+ log(' flutter run -t test_driver/fliwright_app.dart');
254
+ log(' 2. Run tests:');
255
+ log(' npm run test:fliwright');
256
+ }
257
+ else {
258
+ log(' 1. Start your Flutter app with FliwrightBridge.init() enabled.');
259
+ log(' 2. Run tests: npm run test:fliwright');
260
+ }
261
+ log(' 3. Check the environment any time: npm run doctor:fliwright');
262
+ }
@@ -0,0 +1,53 @@
1
+ import { type AppSessionDeps, type AppSessionOptions } from '../capabilities/session.js';
2
+ export interface MockCommandOptions extends AppSessionOptions {
3
+ mockDir?: string;
4
+ endpoint?: string;
5
+ method?: string;
6
+ }
7
+ export declare function mockListCommand(options?: MockCommandOptions): Promise<{
8
+ mockDir: string;
9
+ rules: {
10
+ endpoint: string;
11
+ method: string;
12
+ rules: string[];
13
+ activeRule: string;
14
+ }[];
15
+ }>;
16
+ export declare function mockStatusCommand(options: MockCommandOptions, deps?: AppSessionDeps): Promise<{
17
+ connected: boolean;
18
+ rules: {
19
+ endpoint: string;
20
+ method: string;
21
+ rules: string[];
22
+ activeRule: string;
23
+ }[];
24
+ routes: {
25
+ id: string;
26
+ method?: string;
27
+ path: string;
28
+ }[];
29
+ calls: import("@fliwright/core").MockCall[];
30
+ }>;
31
+ export declare function mockApplyCommand(options: MockCommandOptions & {
32
+ endpoint: string;
33
+ ruleName: string;
34
+ }, deps?: AppSessionDeps): Promise<{
35
+ applied: boolean;
36
+ rule: {
37
+ endpoint: string;
38
+ method: string;
39
+ rules: string[];
40
+ activeRule: string;
41
+ };
42
+ }>;
43
+ export declare function mockClearCommand(options: AppSessionOptions, deps?: AppSessionDeps): Promise<{
44
+ cleared: boolean;
45
+ }>;
46
+ export declare function mockCallsCommand(options: MockCommandOptions, deps?: AppSessionDeps): Promise<{
47
+ calls: import("@fliwright/core").MockCall[];
48
+ count: number;
49
+ }>;
50
+ export declare function mockClearCallsCommand(options: AppSessionOptions, deps?: AppSessionDeps): Promise<{
51
+ cleared: boolean;
52
+ scope: string;
53
+ }>;
@@ -0,0 +1,65 @@
1
+ import { MockRuleStore } from '@fliwright/core';
2
+ import { CliError } from '../CommandRegistry.js';
3
+ import { resolve } from 'node:path';
4
+ import { withAppSession } from '../capabilities/session.js';
5
+ export async function mockListCommand(options = {}) {
6
+ const mockDir = resolve(options.cwd ?? process.cwd(), options.mockDir ?? '.fliwright/mocks');
7
+ const store = new MockRuleStore();
8
+ await store.loadFromDirectory(mockDir);
9
+ return { mockDir, rules: store.listEndpoints() };
10
+ }
11
+ export async function mockStatusCommand(options, deps = {}) {
12
+ return withAppSession(options, async ({ driver }) => {
13
+ const catalog = await mockListCommand(options);
14
+ const rules = catalog.rules.filter((rule) => matches(rule, options));
15
+ const routes = (await driver.mock.listFlutterRoutes()).filter((route) => matches(route, options));
16
+ const calls = (await driver.mock.getFlutterCalls(options.endpoint)).filter((call) => !options.method || call.method.toUpperCase() === options.method.toUpperCase());
17
+ return { connected: true, rules, routes, calls };
18
+ }, deps);
19
+ }
20
+ export async function mockApplyCommand(options, deps = {}) {
21
+ const mockDir = resolve(options.cwd ?? process.cwd(), options.mockDir ?? '.fliwright/mocks');
22
+ const store = new MockRuleStore();
23
+ await store.loadFromDirectory(mockDir);
24
+ let response;
25
+ try {
26
+ response = store.switchRule(options.endpoint, options.ruleName, options.method);
27
+ }
28
+ catch (error) {
29
+ throw new CliError('INVALID_INPUT', error instanceof Error ? error.message : String(error), 2);
30
+ }
31
+ const rule = store.listEndpoints().find((candidate) => matches(candidate, options));
32
+ if (!response || !rule)
33
+ throw new CliError('INVALID_INPUT', `Unknown mock rule: ${options.endpoint} ${options.ruleName}`, 2);
34
+ return withAppSession(options, async ({ driver }) => {
35
+ await driver.mock.routeFlutter(options.endpoint, { ...response, method: rule.method });
36
+ return {
37
+ applied: true,
38
+ rule,
39
+ };
40
+ }, deps);
41
+ }
42
+ export async function mockClearCommand(options, deps = {}) {
43
+ return withAppSession(options, async ({ driver }) => {
44
+ await driver.mock.clearFlutterRoutes();
45
+ await driver.mock.clearFlutterCalls();
46
+ await driver.mock.setPassthrough(true);
47
+ return { cleared: true };
48
+ }, deps);
49
+ }
50
+ export async function mockCallsCommand(options, deps = {}) {
51
+ return withAppSession(options, async ({ driver }) => {
52
+ const calls = (await driver.mock.getFlutterCalls(options.endpoint)).filter((call) => (!options.method || call.method.toUpperCase() === options.method.toUpperCase()));
53
+ return { calls, count: calls.length };
54
+ }, deps);
55
+ }
56
+ export async function mockClearCallsCommand(options, deps = {}) {
57
+ return withAppSession(options, async ({ driver }) => {
58
+ await driver.mock.clearFlutterCalls();
59
+ return { cleared: true, scope: 'calls' };
60
+ }, deps);
61
+ }
62
+ function matches(value, options) {
63
+ return (!options.endpoint || (value.path ?? value.endpoint) === options.endpoint)
64
+ && (!options.method || value.method?.toUpperCase() === options.method.toUpperCase());
65
+ }
@@ -0,0 +1,8 @@
1
+ export interface MockStartOptions {
2
+ cwd?: string;
3
+ signal?: AbortSignal;
4
+ host?: string;
5
+ port?: number;
6
+ mockDir?: string;
7
+ }
8
+ export declare function mockStartCommand(options?: MockStartOptions): Promise<void>;
@@ -0,0 +1,27 @@
1
+ import { ToolMockServer } from '@fliwright/core';
2
+ import { join } from 'node:path';
3
+ export async function mockStartCommand(options = {}) {
4
+ const cwd = options.cwd ?? process.cwd();
5
+ const server = new ToolMockServer({
6
+ host: options.host,
7
+ port: options.port,
8
+ });
9
+ try {
10
+ options.signal?.throwIfAborted();
11
+ const url = await server.start();
12
+ await server.loadRules(options.mockDir ?? join(cwd, '.fliwright/mocks'));
13
+ console.error(`Fliwright mock controller: ${url}`);
14
+ await new Promise((resolve) => {
15
+ const done = () => { process.removeListener('SIGINT', done); process.removeListener('SIGTERM', done); options.signal?.removeEventListener('abort', done); resolve(); };
16
+ process.once('SIGINT', done);
17
+ process.once('SIGTERM', done);
18
+ if (options.signal?.aborted)
19
+ done();
20
+ else
21
+ options.signal?.addEventListener('abort', done, { once: true });
22
+ });
23
+ }
24
+ finally {
25
+ await server.stop({ signal: options.signal });
26
+ }
27
+ }
@@ -0,0 +1,55 @@
1
+ import type { DartVerificationEvidence, FliwrightFlowDocument, RecordedOperation } from '@fliwright/core';
2
+ import type { RecordingCaptureResource, RecordingReadinessResult, RecordingResult, RecordingCheckpointCandidate } from '@fliwright/core';
3
+ export interface RecordOptions {
4
+ durationMs?: number;
5
+ print?: boolean;
6
+ vmUrl?: string;
7
+ output?: string;
8
+ flowOutput?: string;
9
+ lang?: 'ts' | 'dart';
10
+ dartAppEntrypoint?: string;
11
+ testName?: string;
12
+ resetToHomeBeforeEach?: boolean;
13
+ homeRoute?: string;
14
+ cwd?: string;
15
+ mode?: 'script' | 'test';
16
+ scenario?: string;
17
+ assertions?: string;
18
+ verify?: boolean;
19
+ signal?: AbortSignal;
20
+ dartVerification?: DartVerificationEvidence;
21
+ dartVerificationFile?: string;
22
+ }
23
+ export interface RecordResult {
24
+ code: string;
25
+ operations: RecordedOperation[];
26
+ flow: FliwrightFlowDocument;
27
+ readiness: RecordingReadinessResult;
28
+ recordingPath?: string;
29
+ blockers: string[];
30
+ recording: RecordingResult;
31
+ checkpoints: RecordingCheckpointCandidate[];
32
+ }
33
+ export interface RecordDeps {
34
+ resolveVmUrl?: (options: {
35
+ cliFlag?: string;
36
+ configUrl?: string;
37
+ cwd?: string;
38
+ verify?: boolean;
39
+ }) => Promise<string | null>;
40
+ openCapture?: (vmUrl: string) => Promise<RecordingCaptureResource>;
41
+ /** An adapter stop source; the signal removes its listeners after capture. */
42
+ waitForStop?: (signal: AbortSignal) => Promise<void>;
43
+ /** Optional explicit replay hook supplied by CLI/IDE integrations. */
44
+ verifyRecording?: (input: {
45
+ code: string;
46
+ scenario: string;
47
+ scenarioFingerprint?: string;
48
+ operations: readonly RecordedOperation[];
49
+ }) => Promise<{
50
+ passed: boolean;
51
+ verifiedRunId?: string;
52
+ issues?: string[];
53
+ }>;
54
+ }
55
+ export declare function recordCommand(options: RecordOptions, deps?: RecordDeps): Promise<RecordResult>;