diff --git a/README.md b/README.md index 013bc8e1db..58f076319e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Works with Claude Code, Codex, Cursor, Windsurf, Cline, Goose, and any agent tha Install the CLI and check setup. It requires Node.js 22.12 or newer; web automation requires Node.js 24 or newer. See [Installation](https://agent-device.dev/docs/installation) for target requirements. ```bash -npm install -g agent-device@latest +npm install -g agent-device@nightly-0.22 agent-device doctor agent-device help workflow ``` @@ -156,7 +156,7 @@ The same session and evidence model works at every step: the agent explores the | --- | --- | --- | | Local | Trying commands and debugging apps on simulators, emulators, physical devices, macOS, and Linux. | Follow the Quick Start. | | CI/CD | Automated pull request and merge validation with replay scripts and captured artifacts. | Try the [EAS workflow template](https://github.com/callstackincubator/eas-agent-device/blob/main/.eas/workflows/agent-qa-mobile.yml). | -| Cloud / remote | Linux runners, managed devices, and remote jobs. | Set up a [remote proxy](https://agent-device.dev/docs/remote-proxy), connect a [device cloud](https://agent-device.dev/docs/device-clouds) (BrowserStack and TestMu AI through `agent-device plugins add`, AWS Device Farm after its plugin is published, or Limrun), or [contact Callstack](mailto:hello@callstack.com) for team QA. | +| Cloud / remote | Linux runners, managed devices, and remote jobs. | Set up a [remote proxy](https://agent-device.dev/docs/remote-proxy), connect a [device cloud](https://agent-device.dev/docs/device-clouds) (BrowserStack, AWS Device Farm, and TestMu AI through `agent-device plugins add`, or Limrun), or [contact Callstack](mailto:hello@callstack.com) for team QA. | ## How it works diff --git a/packages/provider-aws-device-farm/README.md b/packages/provider-aws-device-farm/README.md index b1c80c5723..486e47f90f 100644 --- a/packages/provider-aws-device-farm/README.md +++ b/packages/provider-aws-device-farm/README.md @@ -1,9 +1,11 @@ # AWS Device Farm for agent-device -This plugin is private and not yet published. After publication, install it on the daemon host: +Install the plugin on the daemon host. ```sh -agent-device plugins add @agent-device/aws-device-farm +agent-device plugins add @agent-device/aws-device-farm@nightly-0.22 ``` +Run `agent-device help remote` to see the install command for your CLI. + Configure AWS CLI credentials and connect using your Device Farm project and device ARNs. See the [AWS Device Farm guide](https://agent-device.dev/docs/aws-device-farm). diff --git a/packages/provider-browserstack/README.md b/packages/provider-browserstack/README.md index 4dcfc47f30..66596fcf74 100644 --- a/packages/provider-browserstack/README.md +++ b/packages/provider-browserstack/README.md @@ -3,16 +3,18 @@ Use BrowserStack App Automate Android and iOS devices with [agent-device](https://agent-device.dev). You need a BrowserStack account with App Automate access. +Install the plugin on the daemon host, then connect with your BrowserStack credentials. + ```sh -npm install -g agent-device -agent-device plugins add @agent-device/browserstack +agent-device plugins add @agent-device/browserstack@nightly-0.22 export BROWSERSTACK_USERNAME=your-username export BROWSERSTACK_ACCESS_KEY=your-access-key agent-device connect browserstack --session checkout-android --platform android --device "Google Pixel 8" --provider-os-version 14.0 --provider-app bs://app-id ``` +Run `agent-device help remote` to see the install command for your CLI. + See the [BrowserStack guide](https://agent-device.dev/docs/browserstack) for setup and supported operations. -To update the plugin, run `agent-device plugins update @agent-device/browserstack`. After you add or update the plugin, close your sessions and run `agent-device daemon stop --state-dir ` for your daemon before reconnecting. diff --git a/src/cli/commands/connection-plugin-guidance.test.ts b/src/cli/commands/connection-plugin-guidance.test.ts index af6ec49aa3..04a66d8b42 100644 --- a/src/cli/commands/connection-plugin-guidance.test.ts +++ b/src/cli/commands/connection-plugin-guidance.test.ts @@ -1,9 +1,26 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { test } from 'vitest'; +import { afterEach, test, vi } from 'vitest'; import { pluginHome, selectV2Plugin, v2RegistrationSource } from '@agent-device/test-kit'; +import { readVersion } from '@agent-device/host-kit/version'; import { runCliCapture } from '../../__tests__/cli-capture.ts'; +import { usageForCommand } from '../parser/args.ts'; + +vi.mock('@agent-device/host-kit/version', async (importOriginal) => { + const original = await importOriginal(); + return { ...original, readVersion: vi.fn(original.readVersion) }; +}); + +afterEach(() => { + // Restores the real reader this checkout's version reports, so no case hands its channel to + // the next one. + vi.mocked(readVersion).mockReset(); +}); + +// The release `scripts/release-version.mjs` stamps on the 0.22 source branch. Its provider plugins +// publish at the same version, and their `latest` tag stays the staged placeholder. +const NIGHTLY_0_22 = '0.22.0-nightly-0-22.20261118.187'; test('connect names a missing provider plugin and returns installation guidance before dispatch', async () => { const { home, env } = pluginHome(); @@ -27,6 +44,7 @@ test('connect names a missing provider plugin and returns installation guidance }); test('connect browserstack without its plugin names the package, even with credentials set', async () => { + vi.mocked(readVersion).mockReturnValue('0.22.0-dev'); const { home, env } = pluginHome(); const result = await runCliCapture( ['connect', 'browserstack', '--platform', 'android', '--session', 'checkout', '--json'], @@ -44,7 +62,7 @@ test('connect browserstack without its plugin names the package, even with crede reason: 'plugin-not-installed', provider: 'browserstack', package: '@agent-device/browserstack', - installCommand: 'agent-device plugins add @agent-device/browserstack', + installCommand: 'agent-device plugins add @agent-device/browserstack@nightly-0.22', }); assert.match(error.hint, /agent-device plugins add @agent-device\/browserstack/); }); @@ -113,6 +131,74 @@ test('connect does not call a selected plugin missing when it has no connection assert.equal(JSON.parse(result.stdout).error.details.reason, 'plugin-unavailable'); }); +// A channel plugin's `latest` tag is the staged placeholder, so an unversioned selector installs a +// package that exports no factory and the plugin manager refuses it as `incompatible_plugin`. The +// guidance has to name the release built with the running core. +test('a 0.22 nightly core prescribes the matching channel plugin release', async () => { + vi.mocked(readVersion).mockReturnValue(NIGHTLY_0_22); + const { home, env } = pluginHome(); + const result = await runCliCapture( + ['connect', 'browserstack', '--platform', 'android', '--session', 'checkout', '--json'], + { cwd: home, env, stateDirPrefix: 'connect-nightly-browserstack-' }, + ); + assert.equal(result.code, 1); + assert.deepEqual(result.calls, []); + const { error } = JSON.parse(result.stdout); + assert.deepEqual(error.details, { + reason: 'plugin-not-installed', + provider: 'browserstack', + package: '@agent-device/browserstack', + installCommand: `agent-device plugins add @agent-device/browserstack@${NIGHTLY_0_22}`, + }); + assert.match(error.hint, new RegExp(`plugins add @agent-device/browserstack@${NIGHTLY_0_22}`)); + assert.match(error.hint, /If a local daemon is already running/); + const help = await usageForCommand('remote'); + assert.ok(help?.includes(`${error.details.installCommand}\n`)); +}); + +test('a main-channel 0.22 nightly repairs a failed BrowserStack selection with the matching release', async () => { + const version = '0.22.0-nightly.20261118.186'; + vi.mocked(readVersion).mockReturnValue(version); + const { home, env } = pluginHome(); + selectV2Plugin(home, '@agent-device/browserstack', 'throw new Error("Plugin failed to load.");'); + const result = await runCliCapture( + ['connect', 'browserstack', '--platform', 'android', '--session', 'checkout', '--json'], + { cwd: home, env, stateDirPrefix: 'connect-nightly-broken-browserstack-' }, + ); + assert.equal(result.code, 1); + assert.deepEqual(result.calls, []); + const { error } = JSON.parse(result.stdout); + assert.equal(error.details.reason, 'plugin-unavailable'); + assert.ok(error.hint.includes(`plugins add @agent-device/browserstack@${version}`)); +}); + +test('a stable core prescribes the plain package for the same plugin', async () => { + vi.mocked(readVersion).mockReturnValue('0.22.0'); + const { home, env } = pluginHome(); + const result = await runCliCapture( + ['connect', 'browserstack', '--platform', 'android', '--session', 'checkout', '--json'], + { cwd: home, env, stateDirPrefix: 'connect-stable-browserstack-' }, + ); + assert.equal(result.code, 1); + const { error } = JSON.parse(result.stdout); + assert.equal(error.details.installCommand, 'agent-device plugins add @agent-device/browserstack'); + const help = await usageForCommand('remote'); + assert.ok(help?.includes(`${error.details.installCommand}\n`)); +}); + +test('a 0.22 nightly core still prescribes the plain package for a full-channel plugin', async () => { + vi.mocked(readVersion).mockReturnValue(NIGHTLY_0_22); + const { home, env } = pluginHome(); + const result = await runCliCapture( + ['connect', 'testmu', '--platform', 'android', '--session', 'checkout', '--json'], + { cwd: home, env, stateDirPrefix: 'connect-nightly-testmu-' }, + ); + assert.equal(result.code, 1); + assert.deepEqual(result.calls, []); + const { error } = JSON.parse(result.stdout); + assert.equal(error.details.installCommand, 'agent-device plugins add @agent-device/testmu'); +}); + test('connect reports an unreadable plugin selection instead of prescribing a new installation', async () => { const { home, env } = pluginHome(); fs.writeFileSync(path.join(home, 'config.json'), JSON.stringify({ plugins: [] })); diff --git a/src/cli/connection/provider-policy.ts b/src/cli/connection/provider-policy.ts index edd03d78dc..1d38a4e408 100644 --- a/src/cli/connection/provider-policy.ts +++ b/src/cli/connection/provider-policy.ts @@ -7,7 +7,11 @@ import { primePluginConnections, } from '@agent-device/plugins/connection'; import { AppError } from '@agent-device/kernel/errors'; -import { getProviderPluginDeclaration } from '../../commands/provider-plugin-catalog.ts'; +import { + getProviderPluginDeclaration, + providerPluginInstallCommand, + providerPluginRepairCommand, +} from '../../commands/provider-plugin-catalog.ts'; import { BUILTIN_CONNECT_PROVIDER_IDS, BUILTIN_PROVIDER_IDS, @@ -87,10 +91,10 @@ export function unavailableConnectPluginError( provider, package: declaration.package, ...(failures.length > 0 ? { failedPlugins: failures } : {}), - hint: `Run agent-device plugins list --json to inspect the plugin, fix its configuration or run agent-device plugins update ${declaration.package}, then retry your original command.`, + hint: `Run agent-device plugins list --json to inspect the plugin, fix its configuration or run ${providerPluginRepairCommand(declaration)}, then retry your original command.`, }); } - const installCommand = `agent-device plugins add ${declaration.package}`; + const installCommand = providerPluginInstallCommand(declaration); return new AppError( 'UNSUPPORTED_OPERATION', `${declaration.label} requires the ${declaration.package} plugin.`, @@ -99,7 +103,7 @@ export function unavailableConnectPluginError( provider, package: declaration.package, installCommand, - hint: `${declaration.unpublished ? 'This plugin is private and not yet published. After publication, install' : 'Install'}:\n ${installCommand}\nThen retry your original command. If a local daemon is already running, close its sessions and run agent-device daemon stop with the same --state-dir before retrying.`, + hint: `Install:\n ${installCommand}\nThen retry your original command. If a local daemon is already running, close its sessions and run agent-device daemon stop with the same --state-dir before retrying.`, }, ); } diff --git a/src/commands/provider-plugin-catalog.test.ts b/src/commands/provider-plugin-catalog.test.ts new file mode 100644 index 0000000000..30e5b36279 --- /dev/null +++ b/src/commands/provider-plugin-catalog.test.ts @@ -0,0 +1,68 @@ +import assert from 'node:assert/strict'; +import { test } from 'vitest'; +import { + getProviderPluginDeclaration, + providerPluginHelp, + providerPluginInstallCommand, +} from './provider-plugin-catalog.ts'; + +const NIGHTLY_0_22 = '0.22.0-nightly-0-22.20261118.187'; +const MAIN_NIGHTLY_0_22 = '0.22.0-nightly.20261118.186'; + +function declaration(provider: string) { + const found = getProviderPluginDeclaration(provider); + assert.ok(found, `Expected ${provider} in the provider plugin catalog`); + return found; +} + +test.each([NIGHTLY_0_22, MAIN_NIGHTLY_0_22])( + '0.22 nightly core %s names the plugin release built with it', + (coreVersion) => { + for (const provider of ['browserstack', 'aws-device-farm']) { + assert.equal( + providerPluginInstallCommand(declaration(provider), coreVersion), + `agent-device plugins add @agent-device/${provider}@${coreVersion}`, + ); + } + }, +); + +test('a 0.22 source checkout names the nightly tag', () => { + assert.equal( + providerPluginInstallCommand(declaration('browserstack'), '0.22.0-dev'), + 'agent-device plugins add @agent-device/browserstack@nightly-0.22', + ); +}); + +test('a core outside the 0.22 nightlies keeps the plain package selector', () => { + for (const coreVersion of ['0.21.40-nightly.20261118.186', '0.22.0', '0.0.0']) { + assert.equal( + providerPluginInstallCommand(declaration('aws-device-farm'), coreVersion), + 'agent-device plugins add @agent-device/aws-device-farm', + `core ${coreVersion} must not name a release it cannot match`, + ); + } +}); + +test('a plugin that ships every release ignores the channel of the core', () => { + for (const provider of ['testmu', 'revyl', 'webos', 'tizen']) { + assert.equal( + providerPluginInstallCommand(declaration(provider), NIGHTLY_0_22), + `agent-device plugins add @agent-device/${provider}`, + ); + assert.equal( + providerPluginInstallCommand(declaration(provider), '0.21.39'), + `agent-device plugins add @agent-device/${provider}`, + ); + } +}); + +test('help gives nightly and stable users the same plugin selectors as recovery', () => { + const nightly = providerPluginHelp(NIGHTLY_0_22); + const stable = providerPluginHelp('0.22.0'); + for (const provider of ['browserstack', 'aws-device-farm']) { + assert.ok(nightly.includes(`connect ${provider}; @agent-device/${provider}@${NIGHTLY_0_22})`)); + assert.ok(stable.includes(`connect ${provider}; @agent-device/${provider})`)); + } + assert.match(nightly, /TestMu AI \(connect testmu; @agent-device\/testmu\)/); +}); diff --git a/src/commands/provider-plugin-catalog.ts b/src/commands/provider-plugin-catalog.ts index 9f8c69b525..ccd566c29c 100644 --- a/src/commands/provider-plugin-catalog.ts +++ b/src/commands/provider-plugin-catalog.ts @@ -1,18 +1,31 @@ +import { readVersion } from '@agent-device/host-kit/version'; + type ProviderPluginDeclaration = Readonly<{ provider: string; package: string; label: string; - unpublished?: boolean; + // A 0.22.x-dev version carries no source branch. Use the 0.22 branch's nightly tag + // as the shared default for development builds, including main checkouts. + nightlyTag?: 'nightly-0.22'; }>; +export const AWS_DEVICE_FARM: ProviderPluginDeclaration = { + provider: 'aws-device-farm', + package: '@agent-device/aws-device-farm', + label: 'AWS Device Farm', + nightlyTag: 'nightly-0.22', +}; + +export const BROWSERSTACK: ProviderPluginDeclaration = { + provider: 'browserstack', + package: '@agent-device/browserstack', + label: 'BrowserStack', + nightlyTag: 'nightly-0.22', +}; + const PROVIDER_PLUGIN_CATALOG: readonly ProviderPluginDeclaration[] = [ - { - provider: 'aws-device-farm', - package: '@agent-device/aws-device-farm', - label: 'AWS Device Farm', - unpublished: true, - }, - { provider: 'browserstack', package: '@agent-device/browserstack', label: 'BrowserStack' }, + AWS_DEVICE_FARM, + BROWSERSTACK, { provider: 'revyl', package: '@agent-device/revyl', label: 'Revyl' }, { provider: 'testmu', package: '@agent-device/testmu', label: 'TestMu AI' }, { provider: 'webos', package: '@agent-device/webos', label: 'LG webOS' }, @@ -25,11 +38,43 @@ export function getProviderPluginDeclaration( return PROVIDER_PLUGIN_CATALOG.find((plugin) => plugin.provider === provider); } -// One line for the whole catalog keeps help remote's first screen fixed as plugins are added. -export function providerPluginHelp(): string { +// The release workflow stamps the core and its public plugins with the same nightly version. +const NIGHTLY_0_22_VERSION = /^0\.22\.\d+-nightly(?:-0-22)?\.\d{8}\.[1-9]\d*$/; +const DEVELOPMENT_0_22_VERSION = /^0\.22\.\d+-dev$/; + +function providerPluginSelector( + declaration: ProviderPluginDeclaration, + coreVersion: string, +): string { + if (declaration.nightlyTag === undefined) return declaration.package; + const version = coreVersion.trim(); + if (NIGHTLY_0_22_VERSION.test(version)) return `${declaration.package}@${version}`; + if (DEVELOPMENT_0_22_VERSION.test(version)) { + return `${declaration.package}@${declaration.nightlyTag}`; + } + return declaration.package; +} + +export function providerPluginInstallCommand( + declaration: ProviderPluginDeclaration, + coreVersion: string = readVersion(), +): string { + return `agent-device plugins add ${providerPluginSelector(declaration, coreVersion)}`; +} + +export function providerPluginRepairCommand( + declaration: ProviderPluginDeclaration, + coreVersion: string = readVersion(), +): string { + const selector = providerPluginSelector(declaration, coreVersion); + const action = selector === declaration.package ? 'update' : 'add'; + return `agent-device plugins ${action} ${selector}`; +} + +export function providerPluginHelp(coreVersion: string = readVersion()): string { const plugins = PROVIDER_PLUGIN_CATALOG.map( (plugin) => - `${plugin.label} (connect ${plugin.provider}; ${plugin.package}${plugin.unpublished ? '; unpublished' : ''})`, + `${plugin.label} (connect ${plugin.provider}; ${providerPluginSelector(plugin, coreVersion)})`, ).join(', '); return ` Plugins, installed separately: ${plugins}. Run agent-device plugins add , then retry agent-device connect with your original arguments.`; } diff --git a/src/commands/schema/cli-help-topics.test.ts b/src/commands/schema/cli-help-topics.test.ts index 996193933c..1b4b253cf2 100644 --- a/src/commands/schema/cli-help-topics.test.ts +++ b/src/commands/schema/cli-help-topics.test.ts @@ -417,7 +417,7 @@ test('usageForCommand resolves remote help topic', async () => { ); assert.match( help, - /AWS Device Farm: the @agent-device\/aws-device-farm plugin is private and unpublished/, + /AWS Device Farm \(plugin, install separately\): install the @agent-device\/aws-device-farm plugin/, ); assert.match(help, /Limrun: agent-device connect limrun/); assert.match(help, /It does not create an App Automate session/); diff --git a/src/commands/schema/cli-help.ts b/src/commands/schema/cli-help.ts index 5489c162b8..b4468dc7a9 100644 --- a/src/commands/schema/cli-help.ts +++ b/src/commands/schema/cli-help.ts @@ -27,7 +27,12 @@ import { renderCliHelpOverview } from './cli-help-overview.ts'; import { foldableHelpTopic } from './cli-help-foldable.ts'; import { reactNativeHelpTopic } from './cli-help-react-native.ts'; import { TV_PLUGIN_FLOWS } from './cli-help-tv.ts'; -import { providerPluginHelp } from '../provider-plugin-catalog.ts'; +import { + AWS_DEVICE_FARM, + BROWSERSTACK, + providerPluginHelp, + providerPluginInstallCommand, +} from '../provider-plugin-catalog.ts'; const CONFIGURATION_LINES = [ 'Default config files: ~/.agent-device/config.json (or /config.json), ./agent-device.json (project-safe defaults only).', @@ -462,7 +467,7 @@ Rules: foldable: foldableHelpTopic, remote: { summary: 'Direct proxy, cloud profiles, and remote config', - body: `agent-device help remote + body: (coreVersion: string) => `agent-device help remote Remote connection providers use the same lifecycle: connect -> install/open -> commands -> close -> disconnect @@ -472,13 +477,13 @@ Providers: Remote config: agent-device connect --remote-config ./remote-config.json uses a local profile. Direct proxy: agent-device connect proxy --daemon-base-url stores the shared proxy profile and client identity. BrowserStack (plugin, install separately): agent-device connect browserstack verifies credentials, the exact device, and a bs:// app reference, then stores a local provider profile. It does not create an App Automate session. - AWS Device Farm: the @agent-device/aws-device-farm plugin is private and unpublished; after publication install it with agent-device plugins add, then agent-device connect aws-device-farm verifies credentials and the exact project, device, and optional app upload, then stores a local provider profile. It does not create a remote access session. + AWS Device Farm (plugin, install separately): install the @agent-device/aws-device-farm plugin, then agent-device connect aws-device-farm verifies credentials and the exact project, device, and optional app upload, then stores a local provider profile. It does not create a remote access session. TestMu AI (plugin, install separately): agent-device connect testmu verifies credentials and the exact virtual device (emulator or simulator) or, with --provider-device-type real, real device and OS version, then stores a local provider profile. --provider-app takes an lt:// app reference, an https URL, or a local path: connect looks an lt:// id up among your uploads for that device pool, while URL and local sources are uploaded and validated when open creates the session. It does not create a hub session. Limrun: agent-device connect limrun verifies access to the selected iOS or Android instance service, then stores a local provider profile. It does not create an instance. Revyl (plugin, install separately): agent-device connect revyl verifies credentials against the Revyl backend, then stores a local provider profile with the platform, optional --device model and --provider-os-version, and a required --provider-app https URL: Revyl downloads and installs that build when it starts the device. It does not rent a device. Plugin installation: the lines below name the plugin each provider needs, and plugin help is available before installation. plugins list --json reports your installed plugins. A missing plugin returns reason plugin-not-installed with its installation command; a selected plugin that cannot supply the provider returns plugin-unavailable instead. After changing plugins, close sessions and stop an existing local daemon with the same --state-dir before the next device command. -${providerPluginHelp()} +${providerPluginHelp(coreVersion)} After direct-provider connect: Read the printed Device, App, Next, and workflow-note lines. They are also available as verification/device/app/liveSession/nextSteps/notes in --json output. @@ -546,7 +551,7 @@ TestMu AI real-device flow: ${TV_PLUGIN_FLOWS} BrowserStack hosted-device flow: - agent-device plugins add @agent-device/browserstack + ${providerPluginInstallCommand(BROWSERSTACK, coreVersion)} export BROWSERSTACK_USERNAME=... BROWSERSTACK_ACCESS_KEY=... AGENT_DEVICE_SESSION=checkout-android agent-device connect browserstack --platform android --device "Google Pixel 8" --provider-os-version 14.0 --provider-app bs://app-id agent-device open com.example.app @@ -556,6 +561,7 @@ BrowserStack hosted-device flow: agent-device disconnect AWS Device Farm hosted-device flow: + ${providerPluginInstallCommand(AWS_DEVICE_FARM, coreVersion)} export AWS_REGION=us-west-2 AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_SESSION_TOKEN=... AGENT_DEVICE_SESSION=checkout-android agent-device connect aws-device-farm --platform android --aws-project-arn --aws-device-arn --aws-app-arn agent-device open com.example.app @@ -718,7 +724,10 @@ Rules: Keep browser plans session-scoped: open a URL, inspect refs, act on refs/selectors, verify with wait/get/is/snapshot, capture screenshot only when visual evidence is needed, then close. Each --session name is its own browser (cookies and storage) and its own device (agent-browser-chrome:session:p_, or t__ under tenant isolation so tenants never share a browser): web sessions with different names run in parallel, and the same name in the same tenant conflicts while different tenants may reuse a name. Without --session under local workspace scoping, each workspace uses its own browser and device (agent-browser-chrome:session:w_); different workspaces can run in parallel, while the same workspace conflicts across daemons sharing a claims directory. A request without a workspace scope (no cwd) uses the default session's browser and device (p_default, or t__default under tenant isolation). A name matches case-insensitively and must be 1 to 30 characters of letters, digits, "_" and "-" (1 to 17 under tenant isolation); anything else, including surrounding whitespace or an empty --session "", is refused with web_session_name_invalid.`, }, ...qaReportHelpTopics, -} as const satisfies Record; +} as const satisfies Record< + string, + { summary: string; body: string | ((coreVersion: string) => string) } +>; function formatCommandListArg(commandName: string, schema: CommandSchema, arg: string): string { const optional = arg.endsWith('?'); @@ -932,11 +941,13 @@ export function helpTopicIds(): string[] { function buildHelpTopicUsageText(topicName: string): string | null { const topic = HELP_TOPICS[topicName as keyof typeof HELP_TOPICS]; if (!topic) return null; - const body = topicName === 'commands' ? renderFullCommandReferenceText() : topic.body; + const coreVersion = readVersion(); + const topicBody = typeof topic.body === 'function' ? topic.body(coreVersion) : topic.body; + const body = topicName === 'commands' ? renderFullCommandReferenceText() : topicBody; const related = RELATED_HELP_LINES.filter((entry) => entry.topic !== topicName) .map((entry) => ` ${entry.line}\n`) .join(''); - return `${withVersionHeader(topicName, body)} + return `${withVersionHeader(topicName, body, coreVersion)} Related: ${related}`; @@ -952,8 +963,8 @@ const RELATED_HELP_LINES = [ // installed version here (instead of hand-editing every topic string) gives the skill router a // single, reliable header to read the CLI version from without a separate --version call: a // missing/old header on `help workflow` means an old CLI that predates this format. -function withVersionHeader(topicId: string, body: string): string { +function withVersionHeader(topicId: string, body: string, coreVersion: string): string { const legacyHeader = `agent-device help ${topicId}`; if (!body.startsWith(legacyHeader)) return body; - return `agent-device ${readVersion()} — ${topicId}${body.slice(legacyHeader.length)}`; + return `agent-device ${coreVersion} — ${topicId}${body.slice(legacyHeader.length)}`; } diff --git a/website/docs/docs/aws-device-farm.md b/website/docs/docs/aws-device-farm.md index 2d602e1bb6..9c064ee7b0 100644 --- a/website/docs/docs/aws-device-farm.md +++ b/website/docs/docs/aws-device-farm.md @@ -7,12 +7,14 @@ Use AWS Device Farm to run agent-device on hosted Android and iOS devices throug ## Install the plugin -The AWS Device Farm plugin is private and not yet published. After publication, install it on the host that runs the daemon: +Install the plugin on the host that runs the daemon. ```bash -agent-device plugins add @agent-device/aws-device-farm +agent-device plugins add @agent-device/aws-device-farm@nightly-0.22 ``` +If the CLI prints an install command in a missing-plugin error, use that command. + After installing or changing a plugin, finish sessions and run `agent-device daemon stop --state-dir ` for the matching detached daemon, then retry the command. For an embedded runtime, import the factory and pass it to `startAgentDevice`. The embedded runtime does not read the CLI plugin store. After changing plugins, close and recreate the runtime. diff --git a/website/docs/docs/browserstack.md b/website/docs/docs/browserstack.md index 7c34e1d2b3..a45582a2fd 100644 --- a/website/docs/docs/browserstack.md +++ b/website/docs/docs/browserstack.md @@ -7,10 +7,14 @@ Use BrowserStack App Automate to run agent-device on hosted Android and iOS devi ## Install the plugin +Install the plugin on the host that runs the daemon. + ```bash -agent-device plugins add @agent-device/browserstack +agent-device plugins add @agent-device/browserstack@nightly-0.22 ``` +If the CLI prints an install command in a missing-plugin error, use that command. + The plugin is an optional npm package installed under `AGENT_DEVICE_HOME`. After you add or update it, close open sessions and run `agent-device daemon stop` with `--state-dir ` set to the state directory you use; the next device command loads the plugin. diff --git a/website/docs/docs/device-clouds.md b/website/docs/docs/device-clouds.md index 08553507a0..5e10af18dd 100644 --- a/website/docs/docs/device-clouds.md +++ b/website/docs/docs/device-clouds.md @@ -6,7 +6,7 @@ description: Choose a hosted device provider for agent and CI workflows. Use a device cloud or farm when an agent needs to drive a hosted mobile device without an interactive login. Pick the provider whose account and devices you use: - [BrowserStack](/docs/browserstack): Android and iOS App Automate sessions over WebDriver. Install the `@agent-device/browserstack` plugin first. -- [AWS Device Farm](/docs/aws-device-farm): Android and iOS remote-access sessions through AWS. The `@agent-device/aws-device-farm` plugin is private and not yet published. +- [AWS Device Farm](/docs/aws-device-farm): Android and iOS remote-access sessions through AWS. Install the `@agent-device/aws-device-farm` plugin first. - [TestMu AI](/docs/testmu): Android emulator, iOS simulator, and real-device sessions over WebDriver. - [Limrun](/docs/limrun): direct iOS simulator and Android emulator instances. - [Revyl](/docs/revyl): iOS simulators and Android emulators rented from Revyl's execution API. @@ -16,7 +16,7 @@ Use a device cloud or farm when an agent needs to drive a hosted mobile device w | | BrowserStack | AWS Device Farm | TestMu AI | Limrun | Revyl | | --- | --- | --- | --- | --- | --- | | Devices | Android and iOS real devices | Android and iOS real devices | Android emulators and iOS simulators by default; real devices with `--provider-device-type real` | Android emulators and iOS simulators | Android emulators and iOS simulators | -| Ships as | The `@agent-device/browserstack` plugin | The private, unpublished `@agent-device/aws-device-farm` plugin; needs the AWS CLI | The `@agent-device/testmu` plugin | Built in | The `@agent-device/revyl` plugin | +| Ships as | The `@agent-device/browserstack` plugin | The `@agent-device/aws-device-farm` plugin; needs the AWS CLI | The `@agent-device/testmu` plugin | Built in | The `@agent-device/revyl` plugin | | Credentials | `BROWSERSTACK_USERNAME`, `BROWSERSTACK_ACCESS_KEY` | The AWS CLI credential chain, such as `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, `AWS_REGION` | `LT_USERNAME`, `LT_ACCESS_KEY` | `LIMRUN_API_KEY` (optional `LIMRUN_REGION`), or `LIM_*_INSTANCE_*` for an existing instance | `REVYL_API_KEY` (optional `REVYL_API_URL` for another Revyl backend) | | Device allocated on | `open` | `open` | `open` | First device command, such as `install` or `open` | First device command, such as `open` | | App source | `--provider-app`: `bs://` reference, HTTP(S) URL, or local path | `--aws-app-arn` upload ARN; no install after allocation | `--provider-app`: `lt://` reference, HTTP(S) URL, or local path | `install `, or `open ` for an uploaded asset | `--provider-app`: a public HTTPS URL only, installed when the device starts | diff --git a/website/docs/docs/installation.md b/website/docs/docs/installation.md index 7840eaabd7..e2cf97a116 100644 --- a/website/docs/docs/installation.md +++ b/website/docs/docs/installation.md @@ -24,7 +24,7 @@ Install `agent-device` on the machine where your coding agent runs terminal comm ## Global install ```bash -npm install -g agent-device@latest +npm install -g agent-device@nightly-0.22 agent-device doctor agent-device --version agent-device help @@ -46,37 +46,22 @@ For Cursor, Codex, Claude Code, Windsurf, Cline, Goose, skills, and project rule Interactive CLI runs periodically check npm for a newer `agent-device` release in the background. When one is available, the CLI suggests reinstalling globally: ```bash -npm install -g agent-device@latest +npm install -g agent-device@nightly-0.22 agent-device doctor agent-device --version ``` Set `AGENT_DEVICE_NO_UPDATE_NOTIFIER=1` to disable the notice. -## Nightly builds - -Nightly builds publish `main` after its CI passes, at most once per UTC day: - -```bash -npm install -g agent-device@nightly -``` - -The `0.22` preview channel requires a separate activation and first successful publish. Once -available, install it with `npm install -g agent-device@nightly-0.22`. If npm reports that the tag -is missing, that channel has not published yet; use `@nightly` for `main` or `@latest` for stable. - -A nightly install's update notice follows the channel you installed, including `nightly-0.22`. To -return to stable releases, install `agent-device@latest`. - ## Without installing ```bash -npx agent-device --version -npx agent-device help workflow -npx agent-device open Settings --platform ios +npx agent-device@nightly-0.22 --version +npx agent-device@nightly-0.22 help workflow +npx agent-device@nightly-0.22 open Settings --platform ios ``` -One-off `npx` use is fine for you and for scripts that intentionally fetch from npm. For agents, use a global install, a project-local install, or a version pinned by you or your project config, so repeated commands resolve to a known CLI. Don't let agents choose a version or run `npx -y agent-device@latest` unless you've decided to trust whatever npm serves. +One-off `npx` use is fine for you and for scripts that intentionally fetch from npm. For agents, use a global install, a project-local install, or a version pinned by you or your project config, so repeated commands resolve to a known CLI. ## Vega OS TV prerequisites diff --git a/website/docs/docs/plugins.md b/website/docs/docs/plugins.md index a5a5a44110..1c0b08cbc8 100644 --- a/website/docs/docs/plugins.md +++ b/website/docs/docs/plugins.md @@ -13,7 +13,7 @@ agent-device plugins remove @example/agent-device-provider `agent-device help connect` and `agent-device help remote` identify known optional providers as `plugin, install separately` and show their installation commands, even before you install them. -For example, BrowserStack requires `agent-device plugins add @agent-device/browserstack`, AWS Device Farm will require `agent-device plugins add @agent-device/aws-device-farm` after that private package is published, and TestMu AI requires `agent-device plugins add @agent-device/testmu`. +Use the install command shown for your provider. TestMu AI uses `agent-device plugins add @agent-device/testmu`. If you run `agent-device connect browserstack`, `agent-device connect aws-device-farm`, or `agent-device connect testmu` without its plugin, the error gives that installation command and tells you to retry your original command. With `--json`, the error has @@ -31,9 +31,7 @@ A failed install keeps the previous selection. A running daemon keeps the plugin ## Install replay and test support -The 0.22 `@agent-device/replay` and `@agent-device/maestro` packages are private and not yet published. The npm commands below apply after publication. Native replay and suites cannot be installed from npm until then. - -In 0.22, install the native replay plugin on the daemon host: +Install the native replay plugin on the daemon host. ```bash agent-device plugins add @agent-device/replay @@ -41,8 +39,6 @@ agent-device plugins add @agent-device/replay Finish your sessions and restart that daemon, then retry the original invocation with all its arguments. Native `.ad` scripts keep their syntax, variables, target verification, resume and repair behavior. Ordinary script recording stays in core. -The plugin uses API version 2 and supports core `>=0.22.0-0 <0.23.0`, plus the pinned `0.21.38-dev` extraction host. A mismatched release returns `incompatible_plugin`. - A remote daemon needs its own installation. A local plugin store does not make an engine available remotely. An embedded host imports the factory from `@agent-device/replay/agent-device` and supplies `plugins: [replay()]` to `startAgentDevice`. Supplied plugins are authoritative; the embedded runtime does not read the store. Maestro YAML replay requires `@agent-device/maestro` on both client and daemon hosts. Maestro suites also need `@agent-device/replay` on the daemon host. `replay export` needs the Maestro plugin on the client only. @@ -78,7 +74,7 @@ A lease that names a provider this daemon has no runtime for refuses with `UNSUP ## Install Maestro support -The 0.22 Maestro plugin is private and unavailable from npm. After publication, `agent-device plugins add @agent-device/maestro` installs the optional Maestro engine for `replay --maestro`, `test --maestro`, and `replay export`. [Run Maestro flows](/docs/run-maestro-flows) explains client and daemon installation. `help maestro` remains available without the plugin. +`agent-device plugins add @agent-device/maestro` installs the optional Maestro engine for `replay --maestro`, `test --maestro`, and `replay export`. [Run Maestro flows](/docs/run-maestro-flows) explains client and daemon installation. `help maestro` remains available without the plugin. Replay backends appear in plugin inventories with `backend` instead of `provider`. A daemon keeps its plugin set until it stops. Installing a package on a client does not change a remote or embedded daemon's plugin set. diff --git a/website/docs/docs/replay-e2e.md b/website/docs/docs/replay-e2e.md index f4b2fea899..a065d0d3c9 100644 --- a/website/docs/docs/replay-e2e.md +++ b/website/docs/docs/replay-e2e.md @@ -42,9 +42,7 @@ To run Maestro YAML flows or export `.ad` scripts to Maestro YAML, see [Run Maes ## Install replay support -For 0.22, native `.ad` replay and all `test` suites require a separately installed first-party plugin on the daemon host: - -The 0.22 `@agent-device/replay` and `@agent-device/maestro` packages are private and not yet published. The npm commands below apply after publication. Native replay and suites cannot be installed from npm until then. +Install the replay plugin on the daemon host to run native `.ad` scripts and `test` suites. ```bash agent-device plugins add @agent-device/replay diff --git a/website/docs/docs/run-maestro-flows.md b/website/docs/docs/run-maestro-flows.md index c4724f97d6..21e16d2692 100644 --- a/website/docs/docs/run-maestro-flows.md +++ b/website/docs/docs/run-maestro-flows.md @@ -12,7 +12,7 @@ For recording and replaying native `.ad` scripts, see [Replay and E2E testing](/ ## Install Maestro support -The 0.22 plugin is private and not yet available from npm. After publication, Maestro flows and export require the optional `@agent-device/maestro` plugin: +Install the Maestro plugin to replay Maestro flows or export scripts to Maestro YAML. ```bash agent-device plugins add @agent-device/maestro diff --git a/website/src/site/content.ts b/website/src/site/content.ts index fb35f5b304..768e154acb 100644 --- a/website/src/site/content.ts +++ b/website/src/site/content.ts @@ -475,7 +475,7 @@ export const cloud = { icon: 'cube', label: 'Device clouds', title: 'On hosted devices', - body: 'The same commands drive AWS Device Farm and Limrun devices built in, BrowserStack and TestMu AI through their provider plugins, and Expo Simulators on EAS.', + body: 'The same commands drive Limrun devices with built-in support, AWS Device Farm, BrowserStack, and TestMu AI through their provider plugins, and Expo Simulators on EAS.', cmd: 'agent-device connect limrun --platform ios', href: docs.clouds, },