diff --git a/src/commands/device.ts b/src/commands/device.ts index eb96746..db11dfb 100644 --- a/src/commands/device.ts +++ b/src/commands/device.ts @@ -718,11 +718,15 @@ const launchSub = defineCommand({ }, }); -/** Shared by the typed-action subcommands: the Maestro switch. */ +/** + * Shared by the typed-action subcommands. It chose Maestro over the device's + * direct path when a device session had two engines. It has one now, so the + * flag is still taken, for scripts that pass it, and does nothing. + */ const maestroArg = { type: 'boolean', default: false, - description: 'Run the action as a Maestro flow instead of directly on the device', + description: 'Deprecated: has no effect. Device sessions have a single engine', } as const; /** A percentage of the screen from a flag value, or a usage error. */ @@ -755,10 +759,7 @@ async function performAction( ) { const ctx = await context(args); const sessionId = await resolveSessionId(ctx.apiUrl, ctx.auth, id); - const { result, session } = await DeviceGateway.action(ctx.apiUrl, ctx.auth, sessionId, { - ...body, - ...(args.maestro ? { mode: 'maestro' as const } : {}), - }); + const { result, session } = await DeviceGateway.action(ctx.apiUrl, ctx.auth, sessionId, body); return { session, data: { result } as { result: DeviceCommandResult }, @@ -1087,7 +1088,12 @@ async function waitForCommand(ctx: Ctx, id: string, commandId: string): Promise< } const runSub = defineCommand({ - meta: { name: 'run', description: 'Run a Maestro flow (or a directory of flows) on the device, and wait for the result' }, + meta: { + name: 'run', + description: + 'Run a Maestro flow (or a directory of flows) on the device, and wait for the result. ' + + 'A device session runs the common Maestro commands and no flow scripts (runScript, evalScript)', + }, args: { ...commonArgs, id: idArg, diff --git a/src/types/domain/device-session.types.ts b/src/types/domain/device-session.types.ts index 993539a..774b978 100644 --- a/src/types/domain/device-session.types.ts +++ b/src/types/domain/device-session.types.ts @@ -125,8 +125,9 @@ export interface DevicePoint { } /** - * One typed action for POST /device/sessions/:id/actions. `mode: 'maestro'` - * runs it as a Maestro flow instead of on the device directly. + * One typed action for POST /device/sessions/:id/actions. `mode` is + * deprecated: the API still accepts `'maestro'` and ignores it, and the CLI + * no longer sends it. */ export type DeviceActionRequest = | { id?: string; mode?: 'maestro'; text?: string; type: 'tap'; x?: number; y?: number } diff --git a/test/unit/device-command.test.ts b/test/unit/device-command.test.ts index 00f33f0..cf2529c 100644 --- a/test/unit/device-command.test.ts +++ b/test/unit/device-command.test.ts @@ -324,10 +324,11 @@ describe('dcd device', () => { expect(calls).to.have.length(0); }); - it('--maestro asks for the Maestro path', async () => { + it('--maestro is still accepted and changes nothing: device sessions have one engine', async () => { const calls = stubFetch(ok); - await runJson('tap', { id: 'a-b-c', text: 'OK', maestro: true }); - expect(calls[0].body).to.deep.equal({ type: 'tap', text: 'OK', mode: 'maestro' }); + const { exit } = await runJson('tap', { id: 'a-b-c', text: 'OK', maestro: true }); + expect(exit).to.equal(0); + expect(calls[0].body).to.deep.equal({ type: 'tap', text: 'OK' }); }); it('type sends the text, sensitive when asked, and keeps it out of the envelope', async () => {