Skip to content

Commit 2be4de0

Browse files
committed
chore: prettier
1 parent ca6f60e commit 2be4de0

162 files changed

Lines changed: 5001 additions & 3066 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Minimal operating guide for AI coding agents in this repo.
9090
- Daemon handler/shared module change: `pnpm test:unit` and `pnpm test:smoke`.
9191
- iOS runner/Swift change: `pnpm build:xcuitest`.
9292
- Cross-platform behavior change: run `pnpm test:integration`.
93+
- Any change in: `src/`, `test/`, `skills/`: `pnpm format`.
9394

9495
## Token Guardrails
9596
- Do not read unrelated files once owning module is identified.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"build:xcuitest:tvos": "rm -rf ~/.agent-device/ios-runner/derived/tvos && xcodebuild build-for-testing -project ios-runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj -scheme AgentDeviceRunner -destination \"generic/platform=tvOS Simulator\" -derivedDataPath ~/.agent-device/ios-runner/derived/tvos",
2929
"build:all": "pnpm build:node && pnpm build:xcuitest",
3030
"ad": "node bin/agent-device.mjs",
31-
"format": "prettier --write .",
31+
"format": "prettier --write src test skills",
3232
"prepublishOnly": "pnpm build:all",
3333
"prepack": "pnpm build:all",
3434
"typecheck": "tsc -p tsconfig.json",

skills/agent-device/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ curl -sS "${AGENT_DEVICE_DAEMON_BASE_URL}/rpc" \
155155
```
156156

157157
Notes:
158+
158159
- `AGENT_DEVICE_DAEMON_BASE_URL` makes the CLI skip local daemon discovery/startup and call the remote HTTP daemon directly.
159160
- `AGENT_DEVICE_DAEMON_AUTH_TOKEN` is sent in both the JSON-RPC request token and HTTP auth headers.
160161
- In remote daemon mode, `--debug` does not tail a local `daemon.log`; inspect logs on the remote host instead.
@@ -189,19 +190,22 @@ For local iOS QA in mixed simulator/device environments, use `ensure-simulator`
189190
For session-bound automation, prefer `AGENT_DEVICE_SESSION` + `AGENT_DEVICE_PLATFORM`; that bound-session default now enables lock mode automatically.
190191

191192
Isolation scoping quick reference:
193+
192194
- `--ios-simulator-device-set <path>` scopes iOS simulator discovery + command execution to one simulator set.
193195
- `--android-device-allowlist <serials>` scopes Android discovery/selection to comma/space separated serials.
194196
- Scope is applied before selectors (`--device`, `--udid`, `--serial`); out-of-scope selectors fail with `DEVICE_NOT_FOUND`.
195197
- With iOS simulator-set scope enabled, iOS physical devices are not enumerated.
196198
- In bound-session `strip` mode, conflicting per-call scope/selectors are ignored and the configured binding is restored for the request. Batch steps still inherit the parent `--platform` when they do not set their own.
197199

198200
Simulator provisioning quick reference:
201+
199202
- Use `ensure-simulator` to create or reuse a named iOS simulator inside a device set before starting a session.
200203
- `--device <name>` is required (e.g. `"iPhone 16 Pro"`). `--runtime <id>` pins the runtime; omit to use the newest compatible one.
201204
- `--boot` boots it immediately. Returns `udid`, `device`, `runtime`, `ios_simulator_device_set`, `created`, `booted`.
202205
- Idempotent: safe to call repeatedly; reuses an existing matching simulator by default.
203206

204207
TV quick reference:
208+
205209
- AndroidTV: `open`/`apps` use TV launcher discovery automatically.
206210
- TV target selection works on emulators/simulators and connected physical devices (AndroidTV + AppleTV).
207211
- tvOS: runner-driven interactions and snapshots are supported (`snapshot`, `wait`, `press`, `fill`, `get`, `scroll`, `back`, `home`, `app-switcher`, `record` and related selector flows).

skills/agent-device/references/snapshot-refs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ agent-device diff snapshot -i # Shows +/− structural lines vs prior
6262
```
6363

6464
Efficient pattern:
65+
6566
- Initialize once at a stable point.
6667
- Mutate UI (`press`, `fill`, `swipe`).
6768
- Run `diff snapshot` after interactions to confirm expected change shape with bounded output.

skills/dogfood/SKILL.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Systematically explore a mobile app, find issues, and produce a report with full
1212

1313
Only the **Target app** is required. Everything else has sensible defaults.
1414

15-
| Parameter | Default | Example override |
16-
|-----------|---------|-----------------|
17-
| **Target app** | _(required)_ | `Settings`, `com.example.app`, deep link URL |
18-
| **Platform** | Infer from user context; otherwise ask (`ios` or `android`) | `--platform ios` |
19-
| **Session name** | Slugified app/platform (for example `settings-ios`) | `--session my-session` |
20-
| **Output directory** | `./dogfood-output/` | `Output directory: /tmp/mobile-qa` |
21-
| **Scope** | Full app | `Focus on onboarding and profile` |
22-
| **Authentication** | None | `Sign in to user@example.com` |
15+
| Parameter | Default | Example override |
16+
| -------------------- | ----------------------------------------------------------- | -------------------------------------------- |
17+
| **Target app** | _(required)_ | `Settings`, `com.example.app`, deep link URL |
18+
| **Platform** | Infer from user context; otherwise ask (`ios` or `android`) | `--platform ios` |
19+
| **Session name** | Slugified app/platform (for example `settings-ios`) | `--session my-session` |
20+
| **Output directory** | `./dogfood-output/` | `Output directory: /tmp/mobile-qa` |
21+
| **Scope** | Full app | `Focus on onboarding and profile` |
22+
| **Authentication** | None | `Sign in to user@example.com` |
2323

2424
If the user gives enough context to start, begin immediately with defaults. Ask follow-up only when a required detail is missing (for example platform or credentials).
2525

@@ -172,12 +172,12 @@ agent-device --session {SESSION} close
172172

173173
## References
174174

175-
| Reference | When to Read |
176-
|-----------|--------------|
175+
| Reference | When to Read |
176+
| ------------------------------------------------------------ | ----------------------------------------------- |
177177
| [references/issue-taxonomy.md](references/issue-taxonomy.md) | Start of session; severity/categories/checklist |
178178

179179
## Templates
180180

181-
| Template | Purpose |
182-
|----------|---------|
181+
| Template | Purpose |
182+
| ---------------------------------------------------------------------------- | --------------------------------------------- |
183183
| [templates/dogfood-report-template.md](templates/dogfood-report-template.md) | Copy into output directory as the report file |

skills/dogfood/references/issue-taxonomy.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Reference for categorizing issues found during mobile dogfooding.
44

55
## Severity Levels
66

7-
| Severity | Definition |
8-
|----------|------------|
7+
| Severity | Definition |
8+
| ------------ | ------------------------------------------------------------------------- |
99
| **critical** | Blocks a core workflow, causes data loss, or crashes/freeze loops the app |
10-
| **high** | Major feature broken or unusable, no practical workaround |
11-
| **medium** | Feature works with notable friction or partial failure; workaround exists |
12-
| **low** | Minor cosmetic or polish issue |
10+
| **high** | Major feature broken or unusable, no practical workaround |
11+
| **medium** | Feature works with notable friction or partial failure; workaround exists |
12+
| **low** | Minor cosmetic or polish issue |
1313

1414
## Categories
1515

skills/dogfood/templates/dogfood-report-template.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Dogfood Report: {APP_NAME}
22

3-
| Field | Value |
4-
|-------|-------|
5-
| **Date** | {DATE} |
6-
| **Platform** | {PLATFORM} |
7-
| **Target App** | {TARGET_APP} |
8-
| **Session** | {SESSION_NAME} |
9-
| **Scope** | {SCOPE} |
3+
| Field | Value |
4+
| -------------- | -------------- |
5+
| **Date** | {DATE} |
6+
| **Platform** | {PLATFORM} |
7+
| **Target App** | {TARGET_APP} |
8+
| **Session** | {SESSION_NAME} |
9+
| **Scope** | {SCOPE} |
1010

1111
## Summary
1212

13-
| Severity | Count |
14-
|----------|-------|
15-
| Critical | 0 |
16-
| High | 0 |
17-
| Medium | 0 |
18-
| Low | 0 |
13+
| Severity | Count |
14+
| --------- | ----- |
15+
| Critical | 0 |
16+
| High | 0 |
17+
| Medium | 0 |
18+
| Low | 0 |
1919
| **Total** | **0** |
2020

2121
## Issues
@@ -24,12 +24,12 @@
2424

2525
### ISSUE-001: {Short title}
2626

27-
| Field | Value |
28-
|-------|-------|
29-
| **Severity** | critical / high / medium / low |
30-
| **Category** | visual / functional / ux / content / performance / diagnostics / permissions / accessibility |
31-
| **Screen / Route** | {screen where issue was found} |
32-
| **Repro Video** | {path to video, or N/A for static issues} |
27+
| Field | Value |
28+
| ------------------ | -------------------------------------------------------------------------------------------- |
29+
| **Severity** | critical / high / medium / low |
30+
| **Category** | visual / functional / ux / content / performance / diagnostics / permissions / accessibility |
31+
| **Screen / Route** | {screen where issue was found} |
32+
| **Repro Video** | {path to video, or N/A for static issues} |
3333

3434
**Description**
3535

src/__tests__/cli-batch.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ type RunResult = {
2222
calls: Omit<DaemonRequest, 'token'>[];
2323
};
2424

25-
async function runCliCapture(
26-
argv: string[],
27-
): Promise<RunResult> {
25+
async function runCliCapture(argv: string[]): Promise<RunResult> {
2826
let stdout = '';
2927
let stderr = '';
3028
let code: number | null = null;
@@ -100,7 +98,11 @@ test('batch --steps-file parses file payload', async () => {
10098
});
10199

102100
test('batch --steps-file returns clear error for missing file', async () => {
103-
const result = await runCliCapture(['batch', '--steps-file', '/tmp/definitely-missing-batch-steps.json']);
101+
const result = await runCliCapture([
102+
'batch',
103+
'--steps-file',
104+
'/tmp/definitely-missing-batch-steps.json',
105+
]);
104106
assert.equal(result.code, 1);
105107
assert.equal(result.calls.length, 0);
106108
assert.match(result.stderr, /Failed to read --steps-file/);

src/__tests__/cli-diagnostics.test.ts

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,16 @@ test('cli does not tail local daemon log when remote daemon base URL is set', as
9797
process.env.AGENT_DEVICE_DAEMON_BASE_URL = 'http://remote-mac.example.test:7777/agent-device';
9898

9999
try {
100-
const result = await runCliCapture(['clipboard', 'write', 'hello', '--debug', '--state-dir', stateDir], async () => {
101-
await new Promise((resolve) => setTimeout(resolve, 300));
102-
return {
103-
ok: true,
104-
data: { action: 'write' },
105-
};
106-
});
100+
const result = await runCliCapture(
101+
['clipboard', 'write', 'hello', '--debug', '--state-dir', stateDir],
102+
async () => {
103+
await new Promise((resolve) => setTimeout(resolve, 300));
104+
return {
105+
ok: true,
106+
data: { action: 'write' },
107+
};
108+
},
109+
);
107110
assert.equal(result.code, null);
108111
assert.equal(result.stdout.includes('REMOTE_TAIL_SENTINEL'), false);
109112
assert.match(result.stdout, /Clipboard updated/);
@@ -158,16 +161,19 @@ test('cli parse failures include diagnostic references in JSON mode', async () =
158161
});
159162

160163
test('cli forwards save-script and no-record flags for client-backed open', async () => {
161-
const result = await runCliCapture(['open', 'settings', '--save-script', '--no-record', '--json'], async () => ({
162-
ok: true,
163-
data: {
164-
app: 'settings',
165-
platform: 'ios',
166-
target: 'mobile',
167-
device: 'iPhone 16',
168-
id: 'SIM-001',
169-
},
170-
}));
164+
const result = await runCliCapture(
165+
['open', 'settings', '--save-script', '--no-record', '--json'],
166+
async () => ({
167+
ok: true,
168+
data: {
169+
app: 'settings',
170+
platform: 'ios',
171+
target: 'mobile',
172+
device: 'iPhone 16',
173+
id: 'SIM-001',
174+
},
175+
}),
176+
);
171177
assert.equal(result.code, null);
172178
assert.equal(result.calls.length, 1);
173179
assert.equal(result.calls[0]?.command, 'open');
@@ -176,10 +182,13 @@ test('cli forwards save-script and no-record flags for client-backed open', asyn
176182
});
177183

178184
test('cli preserves --out for client-backed screenshot', async () => {
179-
const result = await runCliCapture(['screenshot', '--out', '/tmp/shot.png', '--json'], async () => ({
180-
ok: true,
181-
data: { path: '/tmp/shot.png' },
182-
}));
185+
const result = await runCliCapture(
186+
['screenshot', '--out', '/tmp/shot.png', '--json'],
187+
async () => ({
188+
ok: true,
189+
data: { path: '/tmp/shot.png' },
190+
}),
191+
);
183192
assert.equal(result.code, null);
184193
assert.equal(result.calls.length, 1);
185194
assert.equal(result.calls[0]?.command, 'screenshot');
@@ -238,10 +247,13 @@ test('cli session lock flag overrides environment for a single invocation', asyn
238247
process.env.AGENT_DEVICE_PLATFORM = 'ios';
239248
process.env.AGENT_DEVICE_SESSION_LOCKED = '0';
240249
try {
241-
const result = await runCliCapture(['snapshot', '--session-lock', 'reject', '--device', 'Pixel 9', '--json'], async () => ({
242-
ok: true,
243-
data: {},
244-
}));
250+
const result = await runCliCapture(
251+
['snapshot', '--session-lock', 'reject', '--device', 'Pixel 9', '--json'],
252+
async () => ({
253+
ok: true,
254+
data: {},
255+
}),
256+
);
245257
assert.equal(result.code, null);
246258
assert.equal(result.calls.length, 1);
247259
assert.equal(result.calls[0]?.meta?.lockPolicy, 'reject');

src/__tests__/client.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import test from 'node:test';
22
import assert from 'node:assert/strict';
3-
import {
4-
createAgentDeviceClient,
5-
type AgentDeviceClientConfig,
6-
} from '../client.ts';
3+
import { createAgentDeviceClient, type AgentDeviceClientConfig } from '../client.ts';
74
import type { DaemonRequest, DaemonResponse } from '../daemon/types.ts';
85
import { AppError } from '../utils/errors.ts';
96

@@ -102,11 +99,14 @@ test('typed client forwards shared request lock policy metadata', async () => {
10299
devices: [],
103100
},
104101
}));
105-
const client = createAgentDeviceClient({
106-
...setup.config,
107-
lockPolicy: 'reject',
108-
lockPlatform: 'ios',
109-
}, { transport: setup.transport });
102+
const client = createAgentDeviceClient(
103+
{
104+
...setup.config,
105+
lockPolicy: 'reject',
106+
lockPlatform: 'ios',
107+
},
108+
{ transport: setup.transport },
109+
);
110110

111111
await client.devices.list({
112112
device: 'Pixel 9',

0 commit comments

Comments
 (0)