@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.
- package/LICENSE +21 -0
- package/README.md +59 -2
- package/dist/ArtifactReferences.d.ts +7 -0
- package/dist/ArtifactReferences.js +82 -0
- package/dist/CommandRegistry.d.ts +40 -0
- package/dist/CommandRegistry.js +177 -0
- package/dist/InspectionOutput.d.ts +5 -0
- package/dist/InspectionOutput.js +11 -0
- package/dist/RecordingReplay.d.ts +24 -0
- package/dist/RecordingReplay.js +79 -0
- package/dist/WorkflowContext.d.ts +20 -0
- package/dist/WorkflowContext.js +1 -0
- package/dist/capabilities/form.d.ts +13 -0
- package/dist/capabilities/form.js +9 -0
- package/dist/capabilities/interaction.d.ts +226 -0
- package/dist/capabilities/interaction.js +447 -0
- package/dist/capabilities/session.d.ts +18 -0
- package/dist/capabilities/session.js +55 -0
- package/dist/catalog.d.ts +36 -0
- package/dist/catalog.js +69 -0
- package/dist/commands/app-inspect.d.ts +96 -0
- package/dist/commands/app-inspect.js +70 -0
- package/dist/commands/app.d.ts +53 -0
- package/dist/commands/app.js +104 -0
- package/dist/commands/artifact-query.d.ts +138 -0
- package/dist/commands/artifact-query.js +81 -0
- package/dist/commands/artifacts.d.ts +40 -0
- package/dist/commands/artifacts.js +311 -0
- package/dist/commands/doctor.d.ts +11 -0
- package/dist/commands/doctor.js +285 -0
- package/dist/commands/flow-runtime.d.ts +40 -0
- package/dist/commands/flow-runtime.js +37 -0
- package/dist/commands/flow.d.ts +122 -0
- package/dist/commands/flow.js +236 -0
- package/dist/commands/generate-test.d.ts +46 -0
- package/dist/commands/generate-test.js +233 -0
- package/dist/commands/init.d.ts +22 -0
- package/dist/commands/init.js +262 -0
- package/dist/commands/mock-management.d.ts +53 -0
- package/dist/commands/mock-management.js +65 -0
- package/dist/commands/mock.d.ts +8 -0
- package/dist/commands/mock.js +27 -0
- package/dist/commands/record.d.ts +55 -0
- package/dist/commands/record.js +216 -0
- package/dist/commands/run.d.ts +93 -0
- package/dist/commands/run.js +707 -0
- package/dist/commands/scenario.d.ts +26 -0
- package/dist/commands/scenario.js +39 -0
- package/dist/commands/tdd.d.ts +72 -0
- package/dist/commands/tdd.js +218 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.js +40 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +139 -0
- package/dist/registry/devices.d.ts +2 -0
- package/dist/registry/devices.js +12 -0
- package/dist/registry/finite.d.ts +38 -0
- package/dist/registry/finite.js +121 -0
- package/dist/registry/flow-schemas.d.ts +405 -0
- package/dist/registry/flow-schemas.js +98 -0
- package/dist/registry/flow.d.ts +3 -0
- package/dist/registry/flow.js +56 -0
- package/dist/registry/generation-schema.d.ts +112 -0
- package/dist/registry/generation-schema.js +36 -0
- package/dist/registry/session.d.ts +2 -0
- package/dist/registry/session.js +24 -0
- package/dist/registry/tdd.d.ts +3 -0
- package/dist/registry/tdd.js +118 -0
- package/dist/reporter.d.ts +95 -0
- package/dist/reporter.js +61 -0
- package/dist/run.d.ts +6 -0
- package/dist/run.js +5 -0
- package/dist/session/ConnectionHost.d.ts +43 -0
- package/dist/session/ConnectionHost.js +129 -0
- package/dist/session/client.d.ts +38 -0
- package/dist/session/client.js +120 -0
- package/dist/session/worker.d.ts +1 -0
- package/dist/session/worker.js +161 -0
- package/dist/vm-discovery.d.ts +14 -0
- package/dist/vm-discovery.js +85 -0
- package/package.json +78 -3
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { waitForVmServiceEndpoint } from '@fliwright/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { FlutterDaemonController, SubprocessDaemonTransport } from '@fliwright/tdd';
|
|
4
|
+
import { CliError } from '../CommandRegistry.js';
|
|
5
|
+
import { collectCatalog } from '../catalog.js';
|
|
6
|
+
import { loadConfig } from '../config.js';
|
|
7
|
+
import { runCommand } from '../commands/run.js';
|
|
8
|
+
import { initCommand } from '../commands/init.js';
|
|
9
|
+
import { doctorCommand } from '../commands/doctor.js';
|
|
10
|
+
import { recordCommand } from '../commands/record.js';
|
|
11
|
+
import { appStatusCommand, appObserveCommand, appInteractCommand, appScreenshotCommand } from '../commands/app.js';
|
|
12
|
+
import * as inspect from '../commands/app-inspect.js';
|
|
13
|
+
import { scenarioListCommand, scenarioResolveCommand, scenarioApplyCommand } from '../commands/scenario.js';
|
|
14
|
+
import * as mocks from '../commands/mock-management.js';
|
|
15
|
+
import { artifactsShowCommand, artifactsExportCommand } from '../commands/artifacts.js';
|
|
16
|
+
import * as artifacts from '../commands/artifact-query.js';
|
|
17
|
+
import { mockStartCommand } from '../commands/mock.js';
|
|
18
|
+
export const str = z.string().min(1).optional();
|
|
19
|
+
export const bool = z.boolean().optional();
|
|
20
|
+
export const positive = z.number().int().positive().optional();
|
|
21
|
+
export const number = z.number().finite().optional();
|
|
22
|
+
export const target = { ref: str, key: str, text: str, type: str };
|
|
23
|
+
export const snapshot = { depth: positive, includeRects: bool, includeProperties: bool };
|
|
24
|
+
export const diagnostics = { listen: bool, clear: bool, limit: positive, kinds: z.array(z.string()).optional(), streams: z.array(z.string()).optional() };
|
|
25
|
+
export const connection = { vmUrl: str };
|
|
26
|
+
export const artifact = { runId: str, runsRoot: str, allowPartial: bool };
|
|
27
|
+
export const actionNames = ['doubleClick', 'tripleClick', 'rightClick', 'hover', 'focus', 'blur', 'clear', 'pressKey', 'setCheckbox', 'selectOption', 'drag', 'dismissModal', 'dismissKeyboard', 'waitForNetworkIdle'];
|
|
28
|
+
export function registerFinite(registry, deps = {}) {
|
|
29
|
+
const add = (path, input, execute, effects = [], extra = {}) => registry.add({ path, input: z.object(input), execute, effects, description: path.replaceAll('.', ' '), ...extra });
|
|
30
|
+
const withContext = (fn) => (input, context) => fn({ ...input, cwd: context.cwd, signal: context.signal }, deps.app);
|
|
31
|
+
add('schema', { path: str }, (input) => registry.schema(input.path), [], { positional: ['path'] });
|
|
32
|
+
add('init', { install: bool, node: bool, flutter: bool, pm: z.enum(['npm', 'pnpm', 'yarn', 'bun']).optional() }, (input, context) => initCommand(context.cwd, { ...input, packageManager: input.pm }, { log: console.error }), ['project-files', 'dependency-install']);
|
|
33
|
+
add('doctor', { ...connection, strict: bool }, async (input, context) => {
|
|
34
|
+
const checks = await doctorCommand(context.cwd, { vmServiceUrl: input.vmUrl, print: false, signal: context.signal });
|
|
35
|
+
const optional = new Set(['Riverpod observer', 'Mock server']);
|
|
36
|
+
const data = { checks: checks.map((check) => ({ ...check, required: !optional.has(check.name), status: check.passed ? 'passed' : check.message.startsWith('skipped') ? 'skipped' : 'failed' })) };
|
|
37
|
+
if (input.strict && data.checks.some((check) => check.required && check.status !== 'passed'))
|
|
38
|
+
throw new CliError('ENVIRONMENT_INVALID', 'Required environment checks failed.', 3, data);
|
|
39
|
+
return data;
|
|
40
|
+
}, ['environment-probe']);
|
|
41
|
+
add('catalog', { suites: z.record(z.string().min(1)).optional() }, async (input, context) => {
|
|
42
|
+
const config = await loadConfig(context.cwd);
|
|
43
|
+
return collectCatalog({ cwd: context.cwd, suites: input.suites ?? config.suites ?? { tests: `${config.testDir}/**/*.test.ts` } });
|
|
44
|
+
}, ['trusted-project-import'], { description: 'Collect test catalog without running test or hook bodies', needsApp: false });
|
|
45
|
+
const runFields = { deviceId: str, target: str, flutterArgs: z.array(z.string()).optional(), keepAppAlive: bool, test: str, testName: str, caseSelection: z.object({ caseId: z.string().regex(/^[a-f0-9]{64}$/), file: z.string().min(1), titlePath: z.array(z.string()).min(1), duplicateIndex: z.number().int().nonnegative() }).strict().optional(), ...connection, reporter: z.enum(['pretty', 'json', 'junit']).optional(), timeout: positive,
|
|
46
|
+
screenshot: z.enum(['file', 'base64', 'off']).optional(), recordingMode: z.enum(['standard', 'full', 'off']).optional(),
|
|
47
|
+
output: str, junitOutput: str, runsRoot: str, scenario: str };
|
|
48
|
+
const run = async (input, context) => {
|
|
49
|
+
if (input.vmUrl && input.deviceId)
|
|
50
|
+
throw new CliError('INVALID_INPUT', 'Choose vmUrl or deviceId.', 2);
|
|
51
|
+
const daemon = input.deviceId ? new FlutterDaemonController(new SubprocessDaemonTransport()) : undefined;
|
|
52
|
+
let appId;
|
|
53
|
+
const abortLaunch = () => { void daemon?.dispose(); };
|
|
54
|
+
context.signal.addEventListener('abort', abortLaunch, { once: true });
|
|
55
|
+
try {
|
|
56
|
+
context.signal.throwIfAborted();
|
|
57
|
+
let vmUrl = input.vmUrl;
|
|
58
|
+
if (daemon) {
|
|
59
|
+
await daemon.start();
|
|
60
|
+
const app = await daemon.startApp({ deviceId: input.deviceId, target: input.target, projectId: context.cwd, flutterArgs: input.flutterArgs });
|
|
61
|
+
appId = app.appId;
|
|
62
|
+
vmUrl = app.wsUri;
|
|
63
|
+
await waitForVmServiceEndpoint({ url: vmUrl, kind: 'direct-vm', source: 'managed-launch', scope: 'execution-worker', acquiredAt: new Date().toISOString() }, { signal: context.signal });
|
|
64
|
+
}
|
|
65
|
+
const data = await runCommand({ ...input, vmUrl, testPattern: input.test, scenarioMode: daemon ? 'managed-start' : 'attach', cwd: context.cwd, signal: context.signal, print: false });
|
|
66
|
+
if (!data.passed)
|
|
67
|
+
throw new CliError(data.runnerErrors?.length ? 'RUNNER_FAILED' : 'TEST_FAILED', 'Run did not pass.', data.runnerErrors?.length ? 3 : 1, data);
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
context.signal.removeEventListener('abort', abortLaunch);
|
|
72
|
+
try {
|
|
73
|
+
if (daemon && appId && !input.keepAppAlive)
|
|
74
|
+
await daemon.stop(appId);
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
await daemon?.dispose({ keepAppAlive: input.keepAppAlive });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
add('run', runFields, run, ['app', 'run-artifacts'], { needsApp: true, output: 'CliRunResult' });
|
|
82
|
+
add('script', { ...runFields, file: z.string().min(1) }, (input, context) => run({ ...input, test: input.file }, context), ['app', 'run-artifacts'], { positional: ['file'], needsApp: true, output: 'CliRunResult' });
|
|
83
|
+
add('record', { ...connection, output: str, flowOutput: str, lang: z.enum(['ts', 'dart']).optional(), mode: z.enum(['script', 'test']).optional(),
|
|
84
|
+
scenario: str, assertions: str, verify: bool, name: str, homeRoute: str, resetHome: bool, duration: z.number().finite().positive().optional(),
|
|
85
|
+
dartAppEntrypoint: str, dartVerification: str }, (input, context) => recordCommand({ ...input, cwd: context.cwd, signal: context.signal,
|
|
86
|
+
testName: input.name, durationMs: input.duration === undefined ? undefined : input.duration * 1000, resetToHomeBeforeEach: input.resetHome,
|
|
87
|
+
dartVerificationFile: input.dartVerification, print: false }, { waitForStop: context.waitForInterrupt }), ['app', 'recording-artifacts', 'generated-files'], { needsApp: true });
|
|
88
|
+
add('app.status', connection, withContext(appStatusCommand), [], { needsApp: true });
|
|
89
|
+
add('app.observe', { ...connection, intent: str, roles: str, limit: positive, includeDiagnostics: bool }, withContext(appObserveCommand), ['snapshot-refs'], { needsApp: true });
|
|
90
|
+
add('app.snapshot', { ...connection, ...snapshot }, withContext(inspect.appSnapshotCommand), ['snapshot-refs'], { needsApp: true });
|
|
91
|
+
add('app.find', { ...connection, text: str, containsText: str, key: str, semanticsLabel: str, role: str, type: str }, withContext(inspect.appFindCommand), ['snapshot-refs'], { needsApp: true });
|
|
92
|
+
add('app.source-map', { ...connection, ...snapshot, includeFramework: bool, limit: positive }, withContext(inspect.appSourceMapCommand), [], { needsApp: true });
|
|
93
|
+
add('app.diagnostics', { ...connection, ...diagnostics }, withContext(inspect.appDiagnosticsCommand), ['diagnostic-subscriptions'], { needsApp: true });
|
|
94
|
+
add('app.reload', { ...connection, ...snapshot, includeScreenshot: bool, screenshotPixelRatio: number }, withContext(inspect.appReloadCommand), ['app-reload', 'snapshot-refs'], { needsApp: true });
|
|
95
|
+
add('app.screenshot', { ...connection, output: str, pixelRatio: z.number().finite().positive().optional(), fullPage: bool, scrollable: str, maxHeight: z.number().finite().positive().optional() }, withContext(appScreenshotCommand), ['image-file'], { needsApp: true });
|
|
96
|
+
add('app.debug-snapshot', { ...connection, ...snapshot, output: str, includeScreenshot: bool, pixelRatio: z.number().positive().optional(), includeDiagnostics: bool,
|
|
97
|
+
diagnosticLimit: positive, includeMockStatus: bool, mockRecentCallsLimit: positive, includeSourceMap: bool, sourceMapLimit: positive }, withContext(inspect.appDebugSnapshotCommand), ['snapshot-refs', 'optional-image-file'], { needsApp: true });
|
|
98
|
+
add('app.interact', { ...connection, ...target, operation: z.enum(['tap', 'type', 'navigate', 'wait', 'drag', 'action']), value: z.union([z.string(), z.number()]).optional(),
|
|
99
|
+
replace: bool, path: str, homeRoute: str, navigationAction: z.enum(['goto', 'resetRouteStack', 'resetToHome']).optional(), timeout: positive,
|
|
100
|
+
deltaX: number, deltaY: number, steps: positive, x: number, y: number, action: z.enum(actionNames).optional(), keyboardKey: str,
|
|
101
|
+
checked: bool, includeSnapshot: bool, quietMs: positive, extra: z.record(z.unknown()).optional(), waitUntil: z.enum(['none', 'settled']).optional(),
|
|
102
|
+
settleTimeout: positive, stableFrames: positive, waitFor: z.record(z.unknown()).optional(), waitForTimeout: positive, throwOnSettleTimeout: bool }, withContext(appInteractCommand), ['app'], { positional: ['operation'], needsApp: true });
|
|
103
|
+
add('scenario.list', {}, withContext(scenarioListCommand));
|
|
104
|
+
add('scenario.resolve', { name: z.string().min(1) }, withContext(scenarioResolveCommand), [], { positional: ['name'] });
|
|
105
|
+
add('scenario.apply', { ...connection, name: z.string().min(1) }, withContext(scenarioApplyCommand), ['app-state'], { positional: ['name'], needsApp: true });
|
|
106
|
+
add('scenario.reset', { ...connection, name: z.string().min(1) }, withContext(scenarioApplyCommand), ['app-state'], { positional: ['name'], needsApp: true });
|
|
107
|
+
const mockFields = { ...connection, mockDir: str, endpoint: str, method: str };
|
|
108
|
+
add('mock.list', { mockDir: str }, withContext(mocks.mockListCommand));
|
|
109
|
+
add('mock.status', mockFields, withContext(mocks.mockStatusCommand), [], { needsApp: true });
|
|
110
|
+
add('mock.calls', mockFields, withContext(mocks.mockCallsCommand), [], { needsApp: true });
|
|
111
|
+
add('mock.apply', { ...mockFields, endpoint: z.string().min(1), ruleName: z.string().min(1) }, withContext(mocks.mockApplyCommand), ['mock-routes'], { positional: ['endpoint', 'ruleName'], needsApp: true });
|
|
112
|
+
add('mock.clear-calls', connection, withContext(mocks.mockClearCallsCommand), ['mock-history'], { needsApp: true });
|
|
113
|
+
add('mock.reset', connection, withContext(mocks.mockClearCommand), ['mock-routes', 'mock-history', 'passthrough'], { needsApp: true });
|
|
114
|
+
add('mock.start', { host: str, port: z.number().int().min(0).max(65535).optional(), mockDir: str }, (input, context) => mockStartCommand({ ...input, cwd: context.cwd, signal: context.signal }), ['local-http-listener']);
|
|
115
|
+
add('artifacts.show', artifact, withContext(artifactsShowCommand), [], { positional: ['runId'] });
|
|
116
|
+
add('artifacts.export', { ...artifact, output: z.string().min(1) }, withContext(artifactsExportCommand), ['export-files'], { positional: ['runId'] });
|
|
117
|
+
add('artifacts.failures', { ...artifact, testName: str }, withContext(artifacts.artifactsFailuresCommand), [], { positional: ['runId'] });
|
|
118
|
+
const timeline = { ...artifact, path: str, testId: str, attemptId: str, nodeId: str, includeArtifacts: bool, includeFlow: bool };
|
|
119
|
+
add('artifacts.timeline', timeline, withContext(artifacts.artifactsTimelineCommand), [], { positional: ['runId'] });
|
|
120
|
+
add('artifacts.diagnose', { ...timeline, failureIndex: z.number().int().min(0).optional(), failure: z.object({ code: z.string(), title: z.string(), message: z.string(), timelineNodeId: str }).optional() }, withContext(artifacts.artifactsDiagnoseCommand), ['optional-ai'], { positional: ['runId'] });
|
|
121
|
+
}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FlowListParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
3
|
+
export declare const FlowGetParamsSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodOptional<z.ZodString>;
|
|
5
|
+
path: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
path?: string | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
path?: string | undefined;
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const FlowBindFigmaParamsSchema: z.ZodObject<{
|
|
14
|
+
id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
path: z.ZodOptional<z.ZodString>;
|
|
16
|
+
flowNodeId: z.ZodString;
|
|
17
|
+
figmaUrl: z.ZodOptional<z.ZodString>;
|
|
18
|
+
fileKey: z.ZodOptional<z.ZodString>;
|
|
19
|
+
figmaNodeId: z.ZodOptional<z.ZodString>;
|
|
20
|
+
name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
codeConnectId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
componentName: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
flowNodeId: string;
|
|
25
|
+
path?: string | undefined;
|
|
26
|
+
name?: string | undefined;
|
|
27
|
+
id?: string | undefined;
|
|
28
|
+
figmaUrl?: string | undefined;
|
|
29
|
+
fileKey?: string | undefined;
|
|
30
|
+
figmaNodeId?: string | undefined;
|
|
31
|
+
codeConnectId?: string | undefined;
|
|
32
|
+
componentName?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
flowNodeId: string;
|
|
35
|
+
path?: string | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
id?: string | undefined;
|
|
38
|
+
figmaUrl?: string | undefined;
|
|
39
|
+
fileKey?: string | undefined;
|
|
40
|
+
figmaNodeId?: string | undefined;
|
|
41
|
+
codeConnectId?: string | undefined;
|
|
42
|
+
componentName?: string | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const FlowAgentSpecParamsSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodOptional<z.ZodString>;
|
|
46
|
+
path: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
path?: string | undefined;
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
path?: string | undefined;
|
|
52
|
+
id?: string | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const FlowCleanParamsSchema: z.ZodObject<{
|
|
55
|
+
id: z.ZodOptional<z.ZodString>;
|
|
56
|
+
path: z.ZodOptional<z.ZodString>;
|
|
57
|
+
} & {
|
|
58
|
+
outputPath: z.ZodOptional<z.ZodString>;
|
|
59
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
aiProvider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom-cli", "mock", "none"]>>;
|
|
61
|
+
aiTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
protectedNodeIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
63
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
path?: string | undefined;
|
|
66
|
+
id?: string | undefined;
|
|
67
|
+
outputPath?: string | undefined;
|
|
68
|
+
dryRun?: boolean | undefined;
|
|
69
|
+
aiProvider?: "none" | "mock" | "claude" | "codex" | "custom-cli" | undefined;
|
|
70
|
+
aiTimeoutMs?: number | undefined;
|
|
71
|
+
protectedNodeIds?: string[] | undefined;
|
|
72
|
+
instructions?: string | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
path?: string | undefined;
|
|
75
|
+
id?: string | undefined;
|
|
76
|
+
outputPath?: string | undefined;
|
|
77
|
+
dryRun?: boolean | undefined;
|
|
78
|
+
aiProvider?: "none" | "mock" | "claude" | "codex" | "custom-cli" | undefined;
|
|
79
|
+
aiTimeoutMs?: number | undefined;
|
|
80
|
+
protectedNodeIds?: string[] | undefined;
|
|
81
|
+
instructions?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const FlowReviewPlanParamsSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodOptional<z.ZodString>;
|
|
85
|
+
path: z.ZodOptional<z.ZodString>;
|
|
86
|
+
pixelDiffTolerance: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
layoutPxTolerance: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
path?: string | undefined;
|
|
90
|
+
id?: string | undefined;
|
|
91
|
+
pixelDiffTolerance?: number | undefined;
|
|
92
|
+
layoutPxTolerance?: number | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
path?: string | undefined;
|
|
95
|
+
id?: string | undefined;
|
|
96
|
+
pixelDiffTolerance?: number | undefined;
|
|
97
|
+
layoutPxTolerance?: number | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
export declare const FlowReviewCaptureRuntimeParamsSchema: z.ZodObject<{
|
|
100
|
+
id: z.ZodOptional<z.ZodString>;
|
|
101
|
+
path: z.ZodOptional<z.ZodString>;
|
|
102
|
+
pixelDiffTolerance: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
layoutPxTolerance: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
} & {
|
|
105
|
+
pixelRatio: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
106
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
107
|
+
targetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
108
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
pixelRatio: number;
|
|
111
|
+
path?: string | undefined;
|
|
112
|
+
outputDir?: string | undefined;
|
|
113
|
+
id?: string | undefined;
|
|
114
|
+
limit?: number | undefined;
|
|
115
|
+
pixelDiffTolerance?: number | undefined;
|
|
116
|
+
layoutPxTolerance?: number | undefined;
|
|
117
|
+
targetIds?: string[] | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
path?: string | undefined;
|
|
120
|
+
outputDir?: string | undefined;
|
|
121
|
+
id?: string | undefined;
|
|
122
|
+
pixelRatio?: number | undefined;
|
|
123
|
+
limit?: number | undefined;
|
|
124
|
+
pixelDiffTolerance?: number | undefined;
|
|
125
|
+
layoutPxTolerance?: number | undefined;
|
|
126
|
+
targetIds?: string[] | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
export declare const FlowReviewBundleParamsSchema: z.ZodObject<{
|
|
129
|
+
id: z.ZodOptional<z.ZodString>;
|
|
130
|
+
path: z.ZodOptional<z.ZodString>;
|
|
131
|
+
pixelDiffTolerance: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
layoutPxTolerance: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
} & {
|
|
134
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
135
|
+
outputPath: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
path?: string | undefined;
|
|
138
|
+
outputDir?: string | undefined;
|
|
139
|
+
id?: string | undefined;
|
|
140
|
+
outputPath?: string | undefined;
|
|
141
|
+
pixelDiffTolerance?: number | undefined;
|
|
142
|
+
layoutPxTolerance?: number | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
path?: string | undefined;
|
|
145
|
+
outputDir?: string | undefined;
|
|
146
|
+
id?: string | undefined;
|
|
147
|
+
outputPath?: string | undefined;
|
|
148
|
+
pixelDiffTolerance?: number | undefined;
|
|
149
|
+
layoutPxTolerance?: number | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
export declare const FlowReviewCaptureFigmaParamsSchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodOptional<z.ZodString>;
|
|
153
|
+
path: z.ZodOptional<z.ZodString>;
|
|
154
|
+
pixelDiffTolerance: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
layoutPxTolerance: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
} & {
|
|
157
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
158
|
+
capturesFile: z.ZodOptional<z.ZodString>;
|
|
159
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
160
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
path?: string | undefined;
|
|
163
|
+
outputDir?: string | undefined;
|
|
164
|
+
id?: string | undefined;
|
|
165
|
+
pixelDiffTolerance?: number | undefined;
|
|
166
|
+
layoutPxTolerance?: number | undefined;
|
|
167
|
+
capturesFile?: string | undefined;
|
|
168
|
+
accessToken?: string | undefined;
|
|
169
|
+
scale?: number | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
path?: string | undefined;
|
|
172
|
+
outputDir?: string | undefined;
|
|
173
|
+
id?: string | undefined;
|
|
174
|
+
pixelDiffTolerance?: number | undefined;
|
|
175
|
+
layoutPxTolerance?: number | undefined;
|
|
176
|
+
capturesFile?: string | undefined;
|
|
177
|
+
accessToken?: string | undefined;
|
|
178
|
+
scale?: number | undefined;
|
|
179
|
+
}>;
|
|
180
|
+
export declare const FlowReviewRunParamsSchema: z.ZodObject<{
|
|
181
|
+
id: z.ZodOptional<z.ZodString>;
|
|
182
|
+
path: z.ZodOptional<z.ZodString>;
|
|
183
|
+
pixelDiffTolerance: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
layoutPxTolerance: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
} & {
|
|
186
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
187
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
188
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
pixelRatio: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
190
|
+
pixelThreshold: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
autoCompare: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
192
|
+
targetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
193
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
pixelRatio: number;
|
|
196
|
+
autoCompare: boolean;
|
|
197
|
+
path?: string | undefined;
|
|
198
|
+
outputDir?: string | undefined;
|
|
199
|
+
id?: string | undefined;
|
|
200
|
+
limit?: number | undefined;
|
|
201
|
+
pixelDiffTolerance?: number | undefined;
|
|
202
|
+
layoutPxTolerance?: number | undefined;
|
|
203
|
+
accessToken?: string | undefined;
|
|
204
|
+
scale?: number | undefined;
|
|
205
|
+
pixelThreshold?: number | undefined;
|
|
206
|
+
targetIds?: string[] | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
path?: string | undefined;
|
|
209
|
+
outputDir?: string | undefined;
|
|
210
|
+
id?: string | undefined;
|
|
211
|
+
pixelRatio?: number | undefined;
|
|
212
|
+
limit?: number | undefined;
|
|
213
|
+
pixelDiffTolerance?: number | undefined;
|
|
214
|
+
layoutPxTolerance?: number | undefined;
|
|
215
|
+
accessToken?: string | undefined;
|
|
216
|
+
scale?: number | undefined;
|
|
217
|
+
autoCompare?: boolean | undefined;
|
|
218
|
+
pixelThreshold?: number | undefined;
|
|
219
|
+
targetIds?: string[] | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
export declare const FlowReviewArtifactSchema: z.ZodObject<{
|
|
222
|
+
flowNodeId: z.ZodString;
|
|
223
|
+
screenshotPath: z.ZodOptional<z.ZodString>;
|
|
224
|
+
error: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
flowNodeId: string;
|
|
227
|
+
error?: string | undefined;
|
|
228
|
+
screenshotPath?: string | undefined;
|
|
229
|
+
}, {
|
|
230
|
+
flowNodeId: string;
|
|
231
|
+
error?: string | undefined;
|
|
232
|
+
screenshotPath?: string | undefined;
|
|
233
|
+
}>;
|
|
234
|
+
export declare const FlowReviewReportParamsSchema: z.ZodObject<{
|
|
235
|
+
id: z.ZodOptional<z.ZodString>;
|
|
236
|
+
path: z.ZodOptional<z.ZodString>;
|
|
237
|
+
pixelDiffTolerance: z.ZodOptional<z.ZodNumber>;
|
|
238
|
+
layoutPxTolerance: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
} & {
|
|
240
|
+
runtimeCapturesFile: z.ZodOptional<z.ZodString>;
|
|
241
|
+
figmaCapturesFile: z.ZodOptional<z.ZodString>;
|
|
242
|
+
runtimeCaptures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
243
|
+
flowNodeId: z.ZodString;
|
|
244
|
+
screenshotPath: z.ZodOptional<z.ZodString>;
|
|
245
|
+
error: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
flowNodeId: string;
|
|
248
|
+
error?: string | undefined;
|
|
249
|
+
screenshotPath?: string | undefined;
|
|
250
|
+
}, {
|
|
251
|
+
flowNodeId: string;
|
|
252
|
+
error?: string | undefined;
|
|
253
|
+
screenshotPath?: string | undefined;
|
|
254
|
+
}>, "many">>;
|
|
255
|
+
figmaCaptures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
256
|
+
flowNodeId: z.ZodString;
|
|
257
|
+
screenshotPath: z.ZodOptional<z.ZodString>;
|
|
258
|
+
error: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
flowNodeId: string;
|
|
261
|
+
error?: string | undefined;
|
|
262
|
+
screenshotPath?: string | undefined;
|
|
263
|
+
}, {
|
|
264
|
+
flowNodeId: string;
|
|
265
|
+
error?: string | undefined;
|
|
266
|
+
screenshotPath?: string | undefined;
|
|
267
|
+
}>, "many">>;
|
|
268
|
+
comparisons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
269
|
+
flowNodeId: z.ZodString;
|
|
270
|
+
pixelDiff: z.ZodOptional<z.ZodNumber>;
|
|
271
|
+
layoutPx: z.ZodOptional<z.ZodNumber>;
|
|
272
|
+
textMismatches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
273
|
+
tokenMismatches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
274
|
+
componentMismatches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
275
|
+
error: z.ZodOptional<z.ZodString>;
|
|
276
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
flowNodeId: string;
|
|
279
|
+
error?: string | undefined;
|
|
280
|
+
pixelDiff?: number | undefined;
|
|
281
|
+
layoutPx?: number | undefined;
|
|
282
|
+
textMismatches?: string[] | undefined;
|
|
283
|
+
tokenMismatches?: string[] | undefined;
|
|
284
|
+
componentMismatches?: string[] | undefined;
|
|
285
|
+
notes?: string | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
flowNodeId: string;
|
|
288
|
+
error?: string | undefined;
|
|
289
|
+
pixelDiff?: number | undefined;
|
|
290
|
+
layoutPx?: number | undefined;
|
|
291
|
+
textMismatches?: string[] | undefined;
|
|
292
|
+
tokenMismatches?: string[] | undefined;
|
|
293
|
+
componentMismatches?: string[] | undefined;
|
|
294
|
+
notes?: string | undefined;
|
|
295
|
+
}>, "many">>;
|
|
296
|
+
autoCompare: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
297
|
+
pixelThreshold: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
outputPath: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
autoCompare: boolean;
|
|
301
|
+
path?: string | undefined;
|
|
302
|
+
id?: string | undefined;
|
|
303
|
+
outputPath?: string | undefined;
|
|
304
|
+
pixelDiffTolerance?: number | undefined;
|
|
305
|
+
layoutPxTolerance?: number | undefined;
|
|
306
|
+
runtimeCaptures?: {
|
|
307
|
+
flowNodeId: string;
|
|
308
|
+
error?: string | undefined;
|
|
309
|
+
screenshotPath?: string | undefined;
|
|
310
|
+
}[] | undefined;
|
|
311
|
+
figmaCaptures?: {
|
|
312
|
+
flowNodeId: string;
|
|
313
|
+
error?: string | undefined;
|
|
314
|
+
screenshotPath?: string | undefined;
|
|
315
|
+
}[] | undefined;
|
|
316
|
+
comparisons?: {
|
|
317
|
+
flowNodeId: string;
|
|
318
|
+
error?: string | undefined;
|
|
319
|
+
pixelDiff?: number | undefined;
|
|
320
|
+
layoutPx?: number | undefined;
|
|
321
|
+
textMismatches?: string[] | undefined;
|
|
322
|
+
tokenMismatches?: string[] | undefined;
|
|
323
|
+
componentMismatches?: string[] | undefined;
|
|
324
|
+
notes?: string | undefined;
|
|
325
|
+
}[] | undefined;
|
|
326
|
+
pixelThreshold?: number | undefined;
|
|
327
|
+
runtimeCapturesFile?: string | undefined;
|
|
328
|
+
figmaCapturesFile?: string | undefined;
|
|
329
|
+
}, {
|
|
330
|
+
path?: string | undefined;
|
|
331
|
+
id?: string | undefined;
|
|
332
|
+
outputPath?: string | undefined;
|
|
333
|
+
pixelDiffTolerance?: number | undefined;
|
|
334
|
+
layoutPxTolerance?: number | undefined;
|
|
335
|
+
runtimeCaptures?: {
|
|
336
|
+
flowNodeId: string;
|
|
337
|
+
error?: string | undefined;
|
|
338
|
+
screenshotPath?: string | undefined;
|
|
339
|
+
}[] | undefined;
|
|
340
|
+
figmaCaptures?: {
|
|
341
|
+
flowNodeId: string;
|
|
342
|
+
error?: string | undefined;
|
|
343
|
+
screenshotPath?: string | undefined;
|
|
344
|
+
}[] | undefined;
|
|
345
|
+
comparisons?: {
|
|
346
|
+
flowNodeId: string;
|
|
347
|
+
error?: string | undefined;
|
|
348
|
+
pixelDiff?: number | undefined;
|
|
349
|
+
layoutPx?: number | undefined;
|
|
350
|
+
textMismatches?: string[] | undefined;
|
|
351
|
+
tokenMismatches?: string[] | undefined;
|
|
352
|
+
componentMismatches?: string[] | undefined;
|
|
353
|
+
notes?: string | undefined;
|
|
354
|
+
}[] | undefined;
|
|
355
|
+
autoCompare?: boolean | undefined;
|
|
356
|
+
pixelThreshold?: number | undefined;
|
|
357
|
+
runtimeCapturesFile?: string | undefined;
|
|
358
|
+
figmaCapturesFile?: string | undefined;
|
|
359
|
+
}>;
|
|
360
|
+
export declare const FlowGenerateTestParamsSchema: z.ZodObject<{
|
|
361
|
+
id: z.ZodOptional<z.ZodString>;
|
|
362
|
+
path: z.ZodOptional<z.ZodString>;
|
|
363
|
+
} & {
|
|
364
|
+
testName: z.ZodOptional<z.ZodString>;
|
|
365
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
366
|
+
resetToHomeBeforeEach: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
+
homeRoute: z.ZodOptional<z.ZodString>;
|
|
368
|
+
useFlowSteps: z.ZodOptional<z.ZodBoolean>;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
path?: string | undefined;
|
|
371
|
+
id?: string | undefined;
|
|
372
|
+
testName?: string | undefined;
|
|
373
|
+
resetToHomeBeforeEach?: boolean | undefined;
|
|
374
|
+
homeRoute?: string | undefined;
|
|
375
|
+
outputFile?: string | undefined;
|
|
376
|
+
useFlowSteps?: boolean | undefined;
|
|
377
|
+
}, {
|
|
378
|
+
path?: string | undefined;
|
|
379
|
+
id?: string | undefined;
|
|
380
|
+
testName?: string | undefined;
|
|
381
|
+
resetToHomeBeforeEach?: boolean | undefined;
|
|
382
|
+
homeRoute?: string | undefined;
|
|
383
|
+
outputFile?: string | undefined;
|
|
384
|
+
useFlowSteps?: boolean | undefined;
|
|
385
|
+
}>;
|
|
386
|
+
export declare const FlowValidateParamsSchema: z.ZodObject<{
|
|
387
|
+
id: z.ZodOptional<z.ZodString>;
|
|
388
|
+
path: z.ZodOptional<z.ZodString>;
|
|
389
|
+
} & {
|
|
390
|
+
requireFigmaForFigmaNodes: z.ZodOptional<z.ZodBoolean>;
|
|
391
|
+
requireCodeTargetForFigmaNodes: z.ZodOptional<z.ZodBoolean>;
|
|
392
|
+
requireReviewRuntimeEntryForFigmaNodes: z.ZodOptional<z.ZodBoolean>;
|
|
393
|
+
}, "strip", z.ZodTypeAny, {
|
|
394
|
+
path?: string | undefined;
|
|
395
|
+
id?: string | undefined;
|
|
396
|
+
requireCodeTargetForFigmaNodes?: boolean | undefined;
|
|
397
|
+
requireReviewRuntimeEntryForFigmaNodes?: boolean | undefined;
|
|
398
|
+
requireFigmaForFigmaNodes?: boolean | undefined;
|
|
399
|
+
}, {
|
|
400
|
+
path?: string | undefined;
|
|
401
|
+
id?: string | undefined;
|
|
402
|
+
requireCodeTargetForFigmaNodes?: boolean | undefined;
|
|
403
|
+
requireReviewRuntimeEntryForFigmaNodes?: boolean | undefined;
|
|
404
|
+
requireFigmaForFigmaNodes?: boolean | undefined;
|
|
405
|
+
}>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const FlowListParamsSchema = z.object({});
|
|
3
|
+
export const FlowGetParamsSchema = z.object({
|
|
4
|
+
id: z.string().optional().describe('Flow id under .fliwright/flows'),
|
|
5
|
+
path: z.string().optional().describe('Direct path to a .flow.json file'),
|
|
6
|
+
});
|
|
7
|
+
export const FlowBindFigmaParamsSchema = z.object({
|
|
8
|
+
id: z.string().optional().describe('Flow id under .fliwright/flows'),
|
|
9
|
+
path: z.string().optional().describe('Direct path to a .flow.json file'),
|
|
10
|
+
flowNodeId: z.string().describe('Flow node id to bind to a Figma node'),
|
|
11
|
+
figmaUrl: z.string().optional().describe('Figma URL. When provided, fileKey and node id are parsed from it.'),
|
|
12
|
+
fileKey: z.string().optional().describe('Figma file key when figmaUrl is not provided'),
|
|
13
|
+
figmaNodeId: z.string().optional().describe('Figma node id, e.g. 120:340'),
|
|
14
|
+
name: z.string().optional().describe('Readable Figma node or frame name'),
|
|
15
|
+
codeConnectId: z.string().optional().describe('Figma Code Connect id or local mapping key'),
|
|
16
|
+
componentName: z.string().optional().describe('Expected code component name'),
|
|
17
|
+
});
|
|
18
|
+
export const FlowAgentSpecParamsSchema = z.object({
|
|
19
|
+
id: z.string().optional().describe('Flow id under .fliwright/flows'),
|
|
20
|
+
path: z.string().optional().describe('Direct path to a .flow.json file'),
|
|
21
|
+
});
|
|
22
|
+
export const FlowCleanParamsSchema = FlowAgentSpecParamsSchema.extend({
|
|
23
|
+
outputPath: z.string().optional().describe('Path to write cleaned flow JSON. Defaults to updating the input flow.'),
|
|
24
|
+
dryRun: z.boolean().optional().describe('Return clean plan and cleaned flow without writing. Default false.'),
|
|
25
|
+
aiProvider: z.enum(['claude', 'codex', 'custom-cli', 'mock', 'none']).optional().describe('AI provider used for cleaning. Defaults to FLIWRIGHT_AI_PROVIDER.'),
|
|
26
|
+
aiTimeoutMs: z.number().optional().describe('AI invocation timeout in milliseconds.'),
|
|
27
|
+
protectedNodeIds: z.array(z.string()).optional().describe('Flow node ids to always keep.'),
|
|
28
|
+
instructions: z.string().optional().describe('Additional cleaning instructions for the AI.'),
|
|
29
|
+
});
|
|
30
|
+
export const FlowReviewPlanParamsSchema = z.object({
|
|
31
|
+
id: z.string().optional().describe('Flow id under .fliwright/flows'),
|
|
32
|
+
path: z.string().optional().describe('Direct path to a .flow.json file'),
|
|
33
|
+
pixelDiffTolerance: z.number().optional().describe('Allowed visual diff ratio, default 0.03'),
|
|
34
|
+
layoutPxTolerance: z.number().optional().describe('Allowed layout delta in px, default 4'),
|
|
35
|
+
});
|
|
36
|
+
export const FlowReviewCaptureRuntimeParamsSchema = FlowReviewPlanParamsSchema.extend({
|
|
37
|
+
pixelRatio: z.number().optional().default(1).describe('Runtime screenshot pixel ratio, default 1'),
|
|
38
|
+
outputDir: z.string().optional().describe('Directory to write runtime screenshots. Defaults to .fliwright/reviews/<flowId>-<timestamp>.'),
|
|
39
|
+
targetIds: z.array(z.string()).optional().describe('Optional subset of flow node ids to capture'),
|
|
40
|
+
limit: z.number().optional().describe('Optional max number of targets to capture'),
|
|
41
|
+
});
|
|
42
|
+
export const FlowReviewBundleParamsSchema = FlowReviewPlanParamsSchema.extend({
|
|
43
|
+
outputDir: z.string().optional().describe('Review artifact root directory. Defaults to .fliwright/reviews/<flowId>.'),
|
|
44
|
+
outputPath: z.string().optional().describe('Optional path to write the review bundle JSON.'),
|
|
45
|
+
});
|
|
46
|
+
export const FlowReviewCaptureFigmaParamsSchema = FlowReviewPlanParamsSchema.extend({
|
|
47
|
+
outputDir: z.string().optional().describe('Directory for Figma screenshots. Defaults to .fliwright/reviews/<flowId>/figma.'),
|
|
48
|
+
capturesFile: z.string().optional().describe('Path to write figma-captures.json.'),
|
|
49
|
+
accessToken: z.string().optional().describe('Figma access token. Defaults to FIGMA_ACCESS_TOKEN or FIGMA_TOKEN.'),
|
|
50
|
+
scale: z.number().optional().describe('Figma image render scale.'),
|
|
51
|
+
});
|
|
52
|
+
export const FlowReviewRunParamsSchema = FlowReviewPlanParamsSchema.extend({
|
|
53
|
+
outputDir: z.string().optional().describe('Review artifact root directory. Defaults to .fliwright/reviews/<flowId>-<timestamp>.'),
|
|
54
|
+
accessToken: z.string().optional().describe('Figma access token. Defaults to FIGMA_ACCESS_TOKEN or FIGMA_TOKEN.'),
|
|
55
|
+
scale: z.number().optional().describe('Figma image render scale.'),
|
|
56
|
+
pixelRatio: z.number().optional().default(1).describe('Runtime screenshot pixel ratio, default 1.'),
|
|
57
|
+
pixelThreshold: z.number().optional().describe('Per-pixel RGBA delta threshold used by autoCompare. Default 0.'),
|
|
58
|
+
autoCompare: z.boolean().optional().default(true).describe('Automatically compare runtime/Figma PNG screenshots. Default true.'),
|
|
59
|
+
targetIds: z.array(z.string()).optional().describe('Optional subset of flow node ids to capture.'),
|
|
60
|
+
limit: z.number().optional().describe('Optional max number of targets to capture.'),
|
|
61
|
+
});
|
|
62
|
+
export const FlowReviewArtifactSchema = z.object({
|
|
63
|
+
flowNodeId: z.string(),
|
|
64
|
+
screenshotPath: z.string().optional(),
|
|
65
|
+
error: z.string().optional(),
|
|
66
|
+
});
|
|
67
|
+
const FlowReviewComparisonSchema = z.object({
|
|
68
|
+
flowNodeId: z.string(),
|
|
69
|
+
pixelDiff: z.number().optional(),
|
|
70
|
+
layoutPx: z.number().optional(),
|
|
71
|
+
textMismatches: z.array(z.string()).optional(),
|
|
72
|
+
tokenMismatches: z.array(z.string()).optional(),
|
|
73
|
+
componentMismatches: z.array(z.string()).optional(),
|
|
74
|
+
error: z.string().optional(),
|
|
75
|
+
notes: z.string().optional(),
|
|
76
|
+
});
|
|
77
|
+
export const FlowReviewReportParamsSchema = FlowReviewPlanParamsSchema.extend({
|
|
78
|
+
runtimeCapturesFile: z.string().optional().describe('JSON array file of runtime captures; exclusive with runtimeCaptures'),
|
|
79
|
+
figmaCapturesFile: z.string().optional().describe('JSON array file of Figma captures; exclusive with figmaCaptures'),
|
|
80
|
+
runtimeCaptures: z.array(FlowReviewArtifactSchema).optional().describe('Runtime screenshots produced by fliwright flow review-capture-runtime'),
|
|
81
|
+
figmaCaptures: z.array(FlowReviewArtifactSchema).optional().describe('Figma screenshots produced by Figma MCP or other design export'),
|
|
82
|
+
comparisons: z.array(FlowReviewComparisonSchema).optional().describe('Optional visual/text/token comparison metrics from a diff engine'),
|
|
83
|
+
autoCompare: z.boolean().optional().default(true).describe('Automatically compare runtime/Figma PNG screenshots when both paths are available. Default true.'),
|
|
84
|
+
pixelThreshold: z.number().optional().describe('Per-pixel RGBA delta threshold used by autoCompare. Default 0.'),
|
|
85
|
+
outputPath: z.string().optional().describe('Path to write the review report JSON. Defaults to .fliwright/reviews/<flowId>-report.json'),
|
|
86
|
+
});
|
|
87
|
+
export const FlowGenerateTestParamsSchema = FlowAgentSpecParamsSchema.extend({
|
|
88
|
+
testName: z.string().optional().describe('Generated test name. Defaults to flow title or id.'),
|
|
89
|
+
outputFile: z.string().optional().describe('Optional path to write the generated test skeleton'),
|
|
90
|
+
resetToHomeBeforeEach: z.boolean().optional().describe('Generate a beforeEach page.resetToHome hook'),
|
|
91
|
+
homeRoute: z.string().optional().describe('Home route used by the beforeEach reset hook'),
|
|
92
|
+
useFlowSteps: z.boolean().optional().describe('Wrap each flow node in flow.step calls; default true'),
|
|
93
|
+
});
|
|
94
|
+
export const FlowValidateParamsSchema = FlowAgentSpecParamsSchema.extend({
|
|
95
|
+
requireFigmaForFigmaNodes: z.boolean().optional().describe('Require figma nodes to have fileKey/nodeId. Default true.'),
|
|
96
|
+
requireCodeTargetForFigmaNodes: z.boolean().optional().describe('Warn when Figma-bound nodes lack componentName/codeConnectId'),
|
|
97
|
+
requireReviewRuntimeEntryForFigmaNodes: z.boolean().optional().describe('Warn when Figma-bound nodes lack route/selector/recording screenshot entry points'),
|
|
98
|
+
});
|