Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 9 additions & 102 deletions .fallowrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
"@theme"
],
"ignoreExports": [
{
"file": "src/__tests__/test-utils/index.ts",
"exports": [
"*"
]
},
{
"comment": "Authoritative supported-command list; sole consumer is the conformance oracle (scripts/maestro-conformance, an ignored tooling tree).",
"file": "src/compat/maestro/program-ir-command-parser.ts",
Expand All @@ -50,102 +44,15 @@
]
},
{
"file": "src/__tests__/test-utils/device-fixtures.ts",
"exports": [
"LINUX_DEVICE",
"ANDROID_TV_DEVICE",
"TVOS_SIMULATOR"
]
},
{
"file": "src/platforms/android/app-lifecycle.ts",
"exports": [
"parseAndroidForegroundApp",
"parseAndroidLaunchablePackages",
"parseAndroidUserInstalledPackages",
"installAndroidInstallablePath"
]
},
{
"file": "src/platforms/android/index.ts",
"exports": [
"installAndroidInstallablePath"
]
},
{
"file": "src/platforms/apple/core/apps.ts",
"exports": [
"listSimulatorApps",
"uninstallIosApp"
]
},
{
"file": "src/platforms/apple/core/runner/runner-contract.ts",
"exports": [
"resolveRunnerEarlyExitHint"
]
},
{
"file": "src/platforms/apple/core/runner/runner-session.ts",
"exports": [
"stopAllIosRunnerSessions"
]
},
{
"file": "src/platforms/apple/core/runner/runner-xctestrun.ts",
"exports": [
"resolveRunnerBuildDestination",
"resolveRunnerAppBundleId",
"resolveRunnerSigningBuildSettings",
"resolveRunnerBundleBuildSettings",
"assertSafeDerivedCleanup"
]
},
{
"file": "src/cloud-webdriver.ts",
"exports": [
"CLOUD_WEBDRIVER_PROVIDERS"
]
},
{
"file": "src/daemon/handlers/lease.ts",
"exports": [
"handleLeaseCommands"
]
},
{
"file": "src/daemon/handlers/session.ts",
"exports": [
"handleSessionCommands"
]
},
{
"file": "src/daemon/handlers/snapshot.ts",
"exports": [
"handleSnapshotCommands"
]
},
{
"file": "src/daemon/handlers/react-native.ts",
"exports": [
"handleReactNativeCommands"
]
},
{
"file": "src/daemon/handlers/record-trace.ts",
"exports": [
"handleRecordTraceCommands"
]
},
{
"file": "src/daemon/handlers/find.ts",
"exports": [
"handleFindCommands"
]
},
{
"file": "src/daemon/handlers/interaction.ts",
"comment": "Daemon route handlers are reached only through the dynamic `import()` table in request-handler-chain.ts, which --production analysis cannot follow to a consumer.",
"file": "src/daemon/handlers/{lease,session,snapshot,react-native,record-trace,find,interaction}.ts",
"exports": [
"handleLeaseCommands",
"handleSessionCommands",
"handleSnapshotCommands",
"handleReactNativeCommands",
"handleRecordTraceCommands",
"handleFindCommands",
"handleInteractionCommands"
]
},
Expand Down Expand Up @@ -183,7 +90,7 @@
"isExpired"
],
"rules": {
"unused-types": "warn",
"unused-types": "error",
"duplicate-exports": "off"
},
"production": {
Expand Down
5 changes: 2 additions & 3 deletions src/batch-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { AppError } from './kernel/errors.ts';
* literal `batchable`. Extracting the entries whose `batchable` is `true` and
* indexing their `name` reconstructs this union from the same single source the
* runtime allowlist below is built from — no hand-maintained list to drift. The
* downstream contracts (`BatchCommandName`, re-exported from `command-surface.ts`,
* and the `satisfies readonly DaemonCommandName[]` guard in
* `commands/batch/projection.ts`) are still enforced by `tsc`.
* downstream contracts (`BatchCommandName` in `commands/batch/projection.ts` and
* its `satisfies readonly DaemonCommandName[]` guard) are still enforced by `tsc`.
*/
export type StructuredBatchCommandName = Extract<
(typeof commandDescriptors)[number],
Expand Down
7 changes: 3 additions & 4 deletions src/cli-schema/command-schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CliCommandName } from '../command-catalog.ts';
import { listCommandMetadata } from '../commands/command-metadata.ts';
import type { CommandSchema, CommandSchemaOverride } from './types.ts';
import type { CommandSchema } from './types.ts';
import { getCliCommandOverride, getSchemaOnlyCliCommandSchema } from './command-overrides.ts';
import { getFlagDefinition, getFlagDefinitions } from '../commands/cli-grammar/flag-registry.ts';
import {
Expand All @@ -9,13 +9,12 @@ import {
} from '../commands/cli-grammar/flag-groups.ts';
import {
type CliFlags,
type DaemonExcludedCliFlag,
type FlagDefinition,
type FlagKey,
} from '../commands/cli-grammar/flag-types.ts';

export type { CliFlags, DaemonExcludedCliFlag, FlagDefinition, FlagKey };
export type { CommandSchema, CommandSchemaOverride };
export type { CliFlags, FlagDefinition, FlagKey };
export type { CommandSchema };
export { getFlagDefinition, getFlagDefinitions, GLOBAL_FLAG_KEYS };

const COMMAND_SCHEMA_BASES = new Map<string, CommandSchema>(
Expand Down
6 changes: 1 addition & 5 deletions src/cli/commands/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { replayCommand } from './replay.ts';
import { screenshotCommand, diffCommand } from './screenshot.ts';
import type { ClientCommandHandlerMap, ClientCommandParams } from './router-types.ts';

export type {
ClientCommandHandler,
ClientCommandHandlerMap,
ClientCommandParams,
} from './router-types.ts';
export type { ClientCommandParams } from './router-types.ts';

const dedicatedCliCommandHandlers = {
connect: connectCommand,
Expand Down
2 changes: 0 additions & 2 deletions src/cli/parser/cli-help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,6 @@ Report:
},
} as const satisfies Record<string, { summary: string; body: string }>;

export type HelpTopicName = keyof typeof HELP_TOPICS;

function formatCommandListArg(commandName: string, schema: CommandSchema, arg: string): string {
const optional = arg.endsWith('?');
const name = optional ? arg.slice(0, -1) : arg;
Expand Down
1 change: 0 additions & 1 deletion src/commands/batch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const batchCommandFamily = defineCommandFamilyFromFacets({
});

export { createBatchDaemonWriter };
export type { BatchCommandName } from './projection.ts';

function toBatchOptions(input: BatchInput): BatchRunOptions {
return {
Expand Down
2 changes: 0 additions & 2 deletions src/commands/capture/runtime/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import type {
} from '../../runtime-types.ts';
import { now } from '../../runtime-common.ts';

export type { SnapshotDiffLine, SnapshotDiffSummary } from '../../../snapshot/snapshot-diff.ts';

export type SnapshotCommandResult = {
nodes: SnapshotNode[];
truncated: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cli-grammar/flag-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CliFlags } from '../../contracts/cli-flags.ts';

export type { CliFlags, DaemonExcludedCliFlag } from '../../contracts/cli-flags.ts';
export type { CliFlags } from '../../contracts/cli-flags.ts';

export type FlagKey = keyof CliFlags;
type FlagType = 'boolean' | 'int' | 'enum' | 'string' | 'booleanOrString';
Expand Down
6 changes: 1 addition & 5 deletions src/commands/cli-grammar/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { InteractionTarget, InternalRequestOptions } from '../../client/client-types.ts';
import type { InternalRequestOptions } from '../../client/client-types.ts';
import type { CommandFlags } from '../../core/dispatch-context.ts';
import type { CliFlags } from './flag-types.ts';
import type { ClickButton } from '../../core/click-button.ts';
import type { DecodedFillTarget } from '../../core/interaction-positionals.ts';
import type { WaitParsed } from '../../core/wait-positionals.ts';

export type DaemonCommandRequest = {
command: string;
Expand Down Expand Up @@ -88,5 +86,3 @@ export type SelectionOptions = {
export type CliInput = Record<string, unknown>;
export type CliReader = (positionals: string[], flags: CliFlags) => CliInput;
export type DaemonWriter = (input: CommandInput) => DaemonCommandRequest;

export type { DecodedFillTarget, InteractionTarget, WaitParsed };
4 changes: 1 addition & 3 deletions src/commands/command-projection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createBatchDaemonWriter, type BatchCommandName } from './batch/index.ts';
import { createBatchDaemonWriter } from './batch/index.ts';
import type { CommandInput, DaemonCommandRequest, DaemonWriter } from './cli-grammar/types.ts';
import { findCommandMetadata } from './command-metadata.ts';
import { readMetadataCommandFlags } from './command-flags.ts';
Expand All @@ -12,8 +12,6 @@ const daemonWriters: Record<string, DaemonWriter> = {

export type DaemonCommandName = keyof typeof daemonWriters;

export type { BatchCommandName };

function prepareBatchDaemonCommandRequest(
command: string,
input: CommandInput,
Expand Down
3 changes: 1 addition & 2 deletions src/commands/command-surface.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { AgentDeviceClient } from '../client/client-types.ts';
import { listCommandFamilyDefinitions, type CommandFamilyDefinition } from './family/registry.ts';
import type { BatchCommandName } from './command-projection.ts';
import type { CommandName } from './command-metadata.ts';

const commandSurface = listCommandFamilyDefinitions();

export type { BatchCommandName, CommandName };
export type { CommandName };

type CommandDefinitionFor<Name extends CommandName> = Extract<
CommandFamilyDefinition,
Expand Down
9 changes: 1 addition & 8 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ import {
type SystemCommands,
} from './system/runtime/index.ts';

export type {
BoundRuntimeCommand,
CommandResult,
DiffSnapshotCommandOptions,
RuntimeCommand,
ScreenshotCommandOptions,
SnapshotCommandOptions,
} from './runtime-types.ts';
export type { ScreenshotCommandOptions } from './runtime-types.ts';

export type AgentDeviceCommands = {
capture: CaptureCommands;
Expand Down
4 changes: 1 addition & 3 deletions src/commands/interaction/runtime/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ export { focusCommand, longPressCommand, scrollCommand } from './gestures.ts';
export type {
FocusCommandOptions,
FocusCommandResult,
GestureDirection,
LongPressCommandOptions,
LongPressCommandResult,
ScrollCommandOptions,
ScrollCommandResult,
ScrollTarget,
} from './gestures.ts';
export type { InteractionTarget, PointTarget, ResolvedInteractionTarget } from './resolution.ts';
export type { InteractionTarget } from './resolution.ts';

export type PressCommandOptions = CommandContext &
RepeatedInput & {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/interaction/runtime/resolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
type ReplayTargetGuardDenotation,
} from '../../../replay/target-identity-node.ts';

export type { InteractionTarget, PointTarget, ResolvedInteractionTarget };
export type { InteractionTarget, ResolvedInteractionTarget };

/**
* ADR 0012 migration step 4, post-resolution guard: the LOCAL identity AND
Expand Down
6 changes: 1 addition & 5 deletions src/compat/maestro/daemon-runtime-port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ import type {
MaestroPublicOperation,
} from './daemon-runtime-public-operation.ts';

export type { DaemonMaestroRuntimeDependencies } from './daemon-runtime-port-observation.ts';
export type {
CreateDaemonMaestroRuntimeOperationsOptions,
DaemonMaestroRuntimeBaseRequest,
} from './daemon-runtime-port-support.ts';
export type { CreateDaemonMaestroRuntimeOperationsOptions } from './daemon-runtime-port-support.ts';

function createDaemonMaestroRuntimeParts(options: CreateDaemonMaestroRuntimeOperationsOptions): {
operations: MaestroRuntimeOperations;
Expand Down
2 changes: 0 additions & 2 deletions src/daemon/handlers/record-trace-recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ const IOS_DEVICE_RECORD_MIN_FPS = 1;
const IOS_DEVICE_RECORD_MAX_FPS = 120;
const IOS_SIMULATOR_RECORDING_TAIL_SETTLE_MS = 350;

export type { RecordTraceDeps, RecordingBase } from './record-trace-types.ts';

type StartRecordingParams = {
req: DaemonRequest;
sessionName: string;
Expand Down
3 changes: 1 addition & 2 deletions src/daemon/lease-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import {
findMissingProxyLeaseFields,
isProxyLeaseScope,
leaseScopeFromRequest,
type LeaseDiagnosticsContext,
type LeaseScope,
} from '../core/lease-scope.ts';

export { DEFAULT_PROXY_LEASE_TTL_MS, findMissingProxyLeaseFields, isProxyLeaseScope };
export type { LeaseDiagnosticsContext, LeaseScope };
export type { LeaseScope };

export type SessionLease = {
tenantId: string;
Expand Down
4 changes: 0 additions & 4 deletions src/daemon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ import type {
import type { AudioProbeSource } from '../audio-probe-result.ts';
import type { SnapshotDiagnosticsState } from '../snapshot-diagnostics.ts';
export type {
ReplaySuiteAttemptFailure,
ReplaySuiteResult,
ReplaySuiteTestFailed,
ReplaySuiteTestPassed,
ReplaySuiteTestResult,
ReplaySuiteTestSkipped,
ReplaySuiteTestSkipReason,
} from '../contracts/replay.ts';

export type DaemonInstallSource = PublicDaemonInstallSource;
Expand Down
7 changes: 0 additions & 7 deletions src/kernel/contracts.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
export type { AppErrorCode } from './errors.ts';
export { defaultHintForCode, normalizeError } from './errors.ts';
export type {
DebugSymbolsCrashFrame,
DebugSymbolsCrashSummary,
DebugSymbolsImage,
DebugSymbolsOptions,
DebugSymbolsResult,
} from '../contracts/debug-symbols.ts';
import type { PlatformSelector } from './device.ts';

export type SessionRuntimeHints = {
Expand Down
5 changes: 1 addition & 4 deletions src/metro/client-metro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ type ResolvedMetroKind = Exclude<MetroPrepareKind, 'auto'>;
type EnvSource = NodeJS.ProcessEnv | Record<string, string | undefined>;
type RepackBundlerKind = 'rspack' | 'webpack';

export type {
CompanionTunnelScope,
MetroBridgeScope,
} from '../client/client-companion-tunnel-contract.ts';
export type { MetroBridgeScope } from '../client/client-companion-tunnel-contract.ts';

type PackageManagerConfig = {
command: string;
Expand Down
8 changes: 1 addition & 7 deletions src/platforms/android/app-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ import {
type AndroidForegroundApp,
} from './app-parsers.ts';

export {
parseAndroidForegroundApp,
parseAndroidLaunchablePackages,
parseAndroidUserInstalledPackages,
type AndroidBlockingDialogFocus,
type AndroidForegroundApp,
} from './app-parsers.ts';
export type { AndroidBlockingDialogFocus, AndroidForegroundApp } from './app-parsers.ts';

const ALIASES: Record<string, { type: 'intent' | 'package'; value: string }> = {
settings: { type: 'intent', value: 'android.settings.SETTINGS' },
Expand Down
1 change: 0 additions & 1 deletion src/platforms/android/perf-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { parseAndroidFramePerfSample, type AndroidFramePerfSample } from './perf
export {
ANDROID_FRAME_SAMPLE_DESCRIPTION,
ANDROID_FRAME_SAMPLE_METHOD,
type AndroidFrameDropWindow,
type AndroidFramePerfSample,
} from './perf-frame-parser.ts';

Expand Down
Loading
Loading