@ait-co/devtools 0.1.144 → 0.2.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/README.en.md +33 -217
- package/README.md +33 -246
- package/dist/in-app/auto.d.ts +1 -138
- package/dist/in-app/auto.js +28 -1102
- package/dist/in-app/auto.js.map +1 -1
- package/dist/in-app/index.d.ts +38 -547
- package/dist/in-app/index.d.ts.map +1 -1
- package/dist/in-app/index.js +62 -939
- package/dist/in-app/index.js.map +1 -1
- package/dist/mcp/cli.d.ts +1 -54
- package/dist/mcp/cli.js +33 -9720
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -88
- package/dist/mcp/server.js +36 -1076
- package/dist/mcp/server.js.map +1 -1
- package/dist/mock/index.d.ts +19 -20
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js.map +1 -1
- package/dist/panel/index.js +1 -103
- package/dist/panel/index.js.map +1 -1
- package/dist/relay-url-store-CPZAn-T5.js +107 -0
- package/dist/relay-url-store-CPZAn-T5.js.map +1 -0
- package/dist/relay-url-store-DLjlvMSA.cjs +108 -0
- package/dist/relay-url-store-DLjlvMSA.cjs.map +1 -0
- package/dist/stubs/bin-devtools-mcp.js +58 -0
- package/dist/stubs/bin-devtools-mcp.js.map +1 -0
- package/dist/stubs/bin-devtools-test.d.ts +2 -0
- package/dist/stubs/bin-devtools-test.js +55 -0
- package/dist/stubs/bin-devtools-test.js.map +1 -0
- package/dist/test-runner/config.d.ts +1 -231
- package/dist/test-runner/config.js +41 -45
- package/dist/test-runner/config.js.map +1 -1
- package/dist/{tunnel-BGT9Curk.cjs → tunnel-BKZkOyQp.cjs} +1 -1
- package/dist/{tunnel-BGT9Curk.cjs.map → tunnel-BKZkOyQp.cjs.map} +1 -1
- package/dist/{tunnel-BOKmLzBO.js → tunnel-CqSCIrdU.js} +1 -1
- package/dist/{tunnel-BOKmLzBO.js.map → tunnel-CqSCIrdU.js.map} +1 -1
- package/dist/unplugin/index.cjs +9 -18
- package/dist/unplugin/index.cjs.map +1 -1
- package/dist/unplugin/index.d.cts +22 -3
- package/dist/unplugin/index.d.cts.map +1 -1
- package/dist/unplugin/index.d.ts +23 -4
- package/dist/unplugin/index.d.ts.map +1 -1
- package/dist/unplugin/index.js +10 -19
- package/dist/unplugin/index.js.map +1 -1
- package/package.json +10 -25
- package/dist/attach-orchestrator-0F0m_UqQ.js +0 -1845
- package/dist/attach-orchestrator-0F0m_UqQ.js.map +0 -1
- package/dist/attach-orchestrator-D65KxFy_.js +0 -1831
- package/dist/attach-orchestrator-D65KxFy_.js.map +0 -1
- package/dist/attach-orchestrator-DL3NQ9ca.js +0 -1846
- package/dist/attach-orchestrator-DL3NQ9ca.js.map +0 -1
- package/dist/bundle-C796JIwG.d.ts +0 -159
- package/dist/bundle-C796JIwG.d.ts.map +0 -1
- package/dist/capture-DsP525OZ.d.ts +0 -58
- package/dist/capture-DsP525OZ.d.ts.map +0 -1
- package/dist/cdp-connection-rP1WdnH5.d.ts +0 -287
- package/dist/cdp-connection-rP1WdnH5.d.ts.map +0 -1
- package/dist/cell-BaLvusOl.js +0 -68
- package/dist/cell-BaLvusOl.js.map +0 -1
- package/dist/cell-CBUS3-nT.js +0 -274
- package/dist/cell-CBUS3-nT.js.map +0 -1
- package/dist/cell-EBKKpAAT.js +0 -307
- package/dist/cell-EBKKpAAT.js.map +0 -1
- package/dist/chii-relay-B3ZhjGMi.js +0 -304
- package/dist/chii-relay-B3ZhjGMi.js.map +0 -1
- package/dist/chii-relay-CGMlePMd.cjs +0 -304
- package/dist/chii-relay-CGMlePMd.cjs.map +0 -1
- package/dist/debug-server-B3ABDrRI.js +0 -456
- package/dist/debug-server-B3ABDrRI.js.map +0 -1
- package/dist/debug-server-BWhwrVXa.js +0 -1158
- package/dist/debug-server-BWhwrVXa.js.map +0 -1
- package/dist/debug-server-CfQNxxGW.js +0 -600
- package/dist/debug-server-CfQNxxGW.js.map +0 -1
- package/dist/devtools-opener-3Drge_RJ.js +0 -75
- package/dist/devtools-opener-3Drge_RJ.js.map +0 -1
- package/dist/devtools-opener-CJpEsXXQ.js +0 -76
- package/dist/devtools-opener-CJpEsXXQ.js.map +0 -1
- package/dist/devtools-opener-CxtryS8c.js +0 -75
- package/dist/devtools-opener-CxtryS8c.js.map +0 -1
- package/dist/in-app/auto.d.ts.map +0 -1
- package/dist/mcp/cli.d.ts.map +0 -1
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/pool-DcaaOwUq.d.ts +0 -14761
- package/dist/pool-DcaaOwUq.d.ts.map +0 -1
- package/dist/qr-http-server-C_lqOrgc.js +0 -1644
- package/dist/qr-http-server-C_lqOrgc.js.map +0 -1
- package/dist/qr-http-server-CopuMbub.js +0 -1644
- package/dist/qr-http-server-CopuMbub.js.map +0 -1
- package/dist/qr-http-server-DrbIVDjO.js +0 -1645
- package/dist/qr-http-server-DrbIVDjO.js.map +0 -1
- package/dist/relay-factory-N9QobQxG.js +0 -206
- package/dist/relay-factory-N9QobQxG.js.map +0 -1
- package/dist/relay-secret-store-BR0YIkNv.cjs +0 -241
- package/dist/relay-secret-store-BR0YIkNv.cjs.map +0 -1
- package/dist/relay-secret-store-Bmyleu0A.js +0 -154
- package/dist/relay-secret-store-Bmyleu0A.js.map +0 -1
- package/dist/relay-secret-store-CQenfcSL.js +0 -154
- package/dist/relay-secret-store-CQenfcSL.js.map +0 -1
- package/dist/relay-secret-store-CYM8CBIF.js +0 -240
- package/dist/relay-secret-store-CYM8CBIF.js.map +0 -1
- package/dist/relay-secret-store-DKxs7zwq.js +0 -153
- package/dist/relay-secret-store-DKxs7zwq.js.map +0 -1
- package/dist/relay-secret-store-WJ8EGkIl.js +0 -153
- package/dist/relay-secret-store-WJ8EGkIl.js.map +0 -1
- package/dist/relay-url-store-BR2XodiO.js +0 -123
- package/dist/relay-url-store-BR2XodiO.js.map +0 -1
- package/dist/relay-url-store-C1as_m5G.cjs +0 -115
- package/dist/relay-url-store-C1as_m5G.cjs.map +0 -1
- package/dist/relay-url-store-CH63fVCm.js +0 -122
- package/dist/relay-url-store-CH63fVCm.js.map +0 -1
- package/dist/relay-url-store-CzFo_84F.js +0 -114
- package/dist/relay-url-store-CzFo_84F.js.map +0 -1
- package/dist/relay-url-store-DaY1QPes.js +0 -123
- package/dist/relay-url-store-DaY1QPes.js.map +0 -1
- package/dist/relay-url-store-xmUuTjXA.js +0 -122
- package/dist/relay-url-store-xmUuTjXA.js.map +0 -1
- package/dist/relay-worker-B5HKkGUY.js +0 -832
- package/dist/relay-worker-B5HKkGUY.js.map +0 -1
- package/dist/relay-worker-YdlpZQl9.d.ts +0 -214
- package/dist/relay-worker-YdlpZQl9.d.ts.map +0 -1
- package/dist/rolldown-runtime-DGkTqVfb.js +0 -15
- package/dist/rolldown-runtime-DUslC3ob.js +0 -14
- package/dist/runtime-kn9DxOeg.d.ts +0 -249
- package/dist/runtime-kn9DxOeg.d.ts.map +0 -1
- package/dist/test-runner/bin.js +0 -2584
- package/dist/test-runner/bin.js.map +0 -1
- package/dist/test-runner/bridge-stub.d.ts +0 -125
- package/dist/test-runner/bridge-stub.d.ts.map +0 -1
- package/dist/test-runner/bridge-stub.js +0 -92
- package/dist/test-runner/bridge-stub.js.map +0 -1
- package/dist/test-runner/bundle.d.ts +0 -2
- package/dist/test-runner/bundle.js +0 -439
- package/dist/test-runner/bundle.js.map +0 -1
- package/dist/test-runner/capture.d.ts +0 -2
- package/dist/test-runner/capture.js +0 -44
- package/dist/test-runner/capture.js.map +0 -1
- package/dist/test-runner/config.d.ts.map +0 -1
- package/dist/test-runner/method-pace.d.ts +0 -82
- package/dist/test-runner/method-pace.d.ts.map +0 -1
- package/dist/test-runner/method-pace.js +0 -120
- package/dist/test-runner/method-pace.js.map +0 -1
- package/dist/test-runner/pool.d.ts +0 -2
- package/dist/test-runner/pool.js +0 -136
- package/dist/test-runner/pool.js.map +0 -1
- package/dist/test-runner/relay-factory.d.ts +0 -11245
- package/dist/test-runner/relay-factory.d.ts.map +0 -1
- package/dist/test-runner/relay-factory.js +0 -206
- package/dist/test-runner/relay-factory.js.map +0 -1
- package/dist/test-runner/relay-worker.d.ts +0 -2
- package/dist/test-runner/relay-worker.js +0 -2
- package/dist/test-runner/report.d.ts +0 -163
- package/dist/test-runner/report.d.ts.map +0 -1
- package/dist/test-runner/report.js +0 -198
- package/dist/test-runner/report.js.map +0 -1
- package/dist/test-runner/rpc.d.ts +0 -56
- package/dist/test-runner/rpc.d.ts.map +0 -1
- package/dist/test-runner/rpc.js +0 -98
- package/dist/test-runner/rpc.js.map +0 -1
- package/dist/test-runner/runtime.d.ts +0 -2
- package/dist/test-runner/runtime.js +0 -659
- package/dist/test-runner/runtime.js.map +0 -1
- package/dist/test-runner/task-graph.d.ts +0 -38
- package/dist/test-runner/task-graph.d.ts.map +0 -1
- package/dist/test-runner/task-graph.js +0 -182
- package/dist/test-runner/task-graph.js.map +0 -1
- package/dist/throttle-DKKzX1qC.js +0 -59
- package/dist/throttle-DKKzX1qC.js.map +0 -1
- package/dist/totp-BqmCLSNA.js +0 -189
- package/dist/totp-BqmCLSNA.js.map +0 -1
- package/dist/totp-CMHR5lsW.cjs +0 -191
- package/dist/totp-CMHR5lsW.cjs.map +0 -1
- package/dist/totp-CZLLKfOC.js +0 -200
- package/dist/totp-CZLLKfOC.js.map +0 -1
- package/dist/totp-DAxys-r0.js +0 -199
- package/dist/totp-DAxys-r0.js.map +0 -1
- package/dist/totp-DfekTBk3.js +0 -211
- package/dist/totp-DfekTBk3.js.map +0 -1
- package/dist/totp-Dwft0Kz7.js +0 -3
- package/dist/totp-WY6l0ysP.js +0 -190
- package/dist/totp-WY6l0ysP.js.map +0 -1
- /package/dist/{test-runner/bin.d.ts → stubs/bin-devtools-mcp.d.ts} +0 -0
package/README.en.md
CHANGED
|
@@ -55,10 +55,10 @@ One-time prerequisite: add `https://devtools.aitc.dev/launcher/` to your phone's
|
|
|
55
55
|
|
|
56
56
|
**Environment 3 — intoss-private** (Toss WebView, HMR off, debug only)
|
|
57
57
|
|
|
58
|
-
Load a dog-food bundle in the real Toss app WebView and debug it via the MCP relay.
|
|
58
|
+
Load a dog-food bundle in the real Toss app WebView and debug it via the MCP relay. Requires `@ait-co/debugger` — see [Debugging packages](#debugging-packages-environments-2-and-3) below.
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
|
|
61
|
+
npx -y -p @ait-co/debugger debugger # start MCP server → QR printed in terminal (or `pnpm exec debugger` if it's a devDependency)
|
|
62
62
|
# ait build && ait deploy --scheme-only
|
|
63
63
|
# one start_attach(scheme_url) call generates the QR and waits for the phone to attach — scan it and the Toss app loads the bundle + relay attaches
|
|
64
64
|
```
|
|
@@ -73,7 +73,7 @@ To enable on-device CDP debugging in environments 2 and 3, add **one line** to y
|
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
// main.tsx (or the top of your mini-app entry)
|
|
76
|
-
import '@ait-co/
|
|
76
|
+
import '@ait-co/debug-console/auto';
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
What this single line does:
|
|
@@ -85,7 +85,9 @@ What this single line does:
|
|
|
85
85
|
|
|
86
86
|
For environment 3 (intoss-private relay), the relay QR deep-link carries `?debug=1&relay=<wss>` query params, so this one line is all the wiring you need. Environment 2 (PWA, `tunnel: { cdp: true }`) works the same way.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
The old `@ait-co/devtools/in-app/auto` path still resolves in 0.2.x as an inert no-op stub and is removed in 1.0.0 — migrate the import to the path above.
|
|
89
|
+
|
|
90
|
+
> For dog-food builds with TOTP authentication, inject `__DEBUG_TOTP_SECRET__` via your build define and use `@ait-co/debug-console` directly with `evaluateDebugGate({ verifyTotpCode })` + `maybeAttach()`. `in-app/auto` does not inject a TOTP verifier, so Layer C3 is disabled.
|
|
89
91
|
|
|
90
92
|
## Five common problems
|
|
91
93
|
|
|
@@ -99,7 +101,7 @@ No page has joined the relay yet. Re-enter via `start_attach` → QR scan on you
|
|
|
99
101
|
|
|
100
102
|
**"Tunnel down" — no response or timeout**
|
|
101
103
|
|
|
102
|
-
A cloudflared quick tunnel can drop after a few hours. Restart the `
|
|
104
|
+
A cloudflared quick tunnel can drop after a few hours. Restart the `debugger` process to get a new tunnel URL, then scan the new QR. (Related: [#290](https://github.com/apps-in-toss-community/devtools/issues/290))
|
|
103
105
|
|
|
104
106
|
**"Page crash" — list_pages shows a non-null crashDetectedAt**
|
|
105
107
|
|
|
@@ -107,7 +109,7 @@ The page on the phone died (OOM, JS exception, or native bridge crash). Relaunch
|
|
|
107
109
|
|
|
108
110
|
**"SDK not available" — window.__sdkCall not injected**
|
|
109
111
|
|
|
110
|
-
When `call_sdk` returns `ok: false, error: "window.__sdkCall is not available"`, the SDK bridge has not been installed. Check that `import '@ait-co/
|
|
112
|
+
When `call_sdk` returns `ok: false, error: "window.__sdkCall is not available"`, the SDK bridge has not been installed. Check that `import '@ait-co/debug-console/auto'` is present at the top of your mini-app entry — see the "On-device debugging in one line" section above. This error is the expected result in environment 2 (PWA). (Related: [#285](https://github.com/apps-in-toss-community/devtools/issues/285))
|
|
111
113
|
|
|
112
114
|
**"QR scanned but auth rejected" — TOTP code expired**
|
|
113
115
|
|
|
@@ -300,7 +302,7 @@ aitDevtools.vite({ tunnel: { cdp: true } }); // real-device preview + on-device
|
|
|
300
302
|
|
|
301
303
|
## Production builds
|
|
302
304
|
|
|
303
|
-
By default, the devtools plugin **automatically disables itself in production** (`NODE_ENV === 'production'` causes both the alias transform and the Panel injection to be skipped). No conditional configuration is needed to keep it safe.
|
|
305
|
+
By default, the devtools plugin **automatically disables itself in production** (`NODE_ENV === 'production'` causes both the alias transform and the Panel injection to be skipped). No conditional configuration is needed to keep it safe. `@ait-co/devtools` is a devDependency, and its contribution to a production bundle is zero bytes. CI enforces this by building a real consumer fixture and grepping the output.
|
|
304
306
|
|
|
305
307
|
To use devtools in a production build — for example in a staging environment — use the `forceEnable` option:
|
|
306
308
|
|
|
@@ -411,9 +413,9 @@ The launcher **only works when launched as an installed PWA from the home screen
|
|
|
411
413
|
>
|
|
412
414
|
> The `tunnel` option only works in Vite dev mode — no tunnel is started for production builds, even with `forceEnable`. It is silently ignored for other bundlers (Webpack/Rspack, etc.). When the option is enabled, `cloudflared` and `qrcode-terminal` are loaded via dynamic import only, so they do not appear in the bundle graph when the option is off.
|
|
413
415
|
|
|
414
|
-
### One-line setup
|
|
416
|
+
### One-line setup
|
|
415
417
|
|
|
416
|
-
The per-project steps above (vite.config patch + `onlyBuiltDependencies` + `dev:phone` script) are
|
|
418
|
+
The per-project steps above (vite.config patch + `onlyBuiltDependencies` + `dev:phone` script) are automated by a single [`agent-plugin`](https://github.com/apps-in-toss-community/agent-plugin) command, `/ait:setup-phone-preview`. Since this README serves as the spec for that automation, the manual steps stay documented here alongside it.
|
|
417
419
|
|
|
418
420
|
## Device API mode system
|
|
419
421
|
|
|
@@ -865,68 +867,18 @@ it('can write and read from Storage', async () => {
|
|
|
865
867
|
});
|
|
866
868
|
```
|
|
867
869
|
|
|
868
|
-
## On-device test runner (`
|
|
870
|
+
## On-device test runner (`debugger-test`)
|
|
869
871
|
|
|
870
|
-
"Using in tests" above verifies mocks in desktop jsdom.
|
|
872
|
+
"Using in tests" above verifies mocks in desktop jsdom. The runner that runs the same style of tests **against the real SDK inside the Toss app WebView on a real phone (environment 3)** moved to `@ait-co/debugger` (#818) — the bin is now `debugger-test`, renamed from `devtools-test`.
|
|
871
873
|
|
|
872
874
|
```bash
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
--cell-sdk-line <2.x|3.x> --cell-platform <ios|android> [--report-dir <dir>]
|
|
876
|
-
|
|
877
|
-
# example
|
|
878
|
-
pnpm exec devtools-test 'src/**/*.ait.test.ts' \
|
|
875
|
+
pnpm add -D @ait-co/debugger
|
|
876
|
+
pnpm exec debugger-test 'src/**/*.ait.test.ts' \
|
|
879
877
|
--scheme-url "intoss-private://my-mini-app?_deploymentId=<uuid>" \
|
|
880
878
|
--cell-sdk-line 3.x --cell-platform ios --report-dir .ait-report
|
|
881
879
|
```
|
|
882
880
|
|
|
883
|
-
|
|
884
|
-
|---|---|
|
|
885
|
-
| `<glob>` | Test file glob (more than one may be given) |
|
|
886
|
-
| `--scheme-url` | The `intoss-private://` URL printed by `ait deploy --scheme-only`. Required for environment 3 attach |
|
|
887
|
-
| `--cell-sdk-line` | SDK line axis stamped into the report (`2.x` / `3.x`, defaults to `2.x`) |
|
|
888
|
-
| `--cell-platform` | Platform axis (`mock` / `ios` / `android` / `ios-pwa`). Resolution order: flag → `AIT_CELL_PLATFORM` env → `mock` |
|
|
889
|
-
| `--manual-blocking` | Run `*.manual.ait.test.ts` last, with a human driving the native sheets |
|
|
890
|
-
| `--report-dir` | Directory for the report + captures. Omitted means nothing is written |
|
|
891
|
-
|
|
892
|
-
Four things need to be in place:
|
|
893
|
-
|
|
894
|
-
| Item | Detail |
|
|
895
|
-
|---|---|
|
|
896
|
-
| A relay TOTP secret | The runner requires this before it boots the relay — without it, it exits 1 before the QR ever appears. Booting `pnpm dev:phone:cdp` once (unplugin's `tunnel.cdp` option) auto-generates `.ait_relay` in the project root; otherwise set `AIT_DEBUG_TOTP_SECRET` yourself (`openssl rand -hex 32`). Which directory the runner looks for `.ait_relay` in is decided by `--project-root` (defaults to cwd) |
|
|
897
|
-
| Dog-food bundle | `ait build && ait deploy --scheme-only` → the printed `intoss-private://…?_deploymentId=…` URL is your `--scheme-url` value |
|
|
898
|
-
| One line in the mini-app entry | `import '@ait-co/devtools/in-app/auto'` — wires attach + the `window.__sdk` bridge ([section above](#on-device-debugging-in-one-line)) |
|
|
899
|
-
| Test files | `*.ait.test.ts`. `describe`/`it`/`test`/`expect` are installed as globals by the runner (no import needed), and `@apps-in-toss/web-framework` imports are redirected to `window.__sdk` at bundle time |
|
|
900
|
-
|
|
901
|
-
### Scan the dashboard QR, not the raw scheme URL
|
|
902
|
-
|
|
903
|
-
On start, the runner boots its own Chii relay + cloudflared tunnel + a local QR dashboard, and prints the dashboard address to stderr (`http://127.0.0.1:8317/` by default — if that port is taken it scans up to 20 ports, incrementing by 1, then falls back to an ephemeral port; override with `--dashboard-port` or `AIT_DEBUG_HTTP_PORT`).
|
|
904
|
-
|
|
905
|
-
**The QR you scan with the phone is the one on that dashboard.** Only that QR carries the scheme URL, the relay wss URL, and the always-present rotating `at=` code in a single capsule, so one scan cold-loads the bundle in the Toss app and attaches CDP at the same time. Once the attach succeeds a `Debugger Connected` badge appears in the phone's bottom-left corner and the runner starts executing tests.
|
|
906
|
-
|
|
907
|
-
> Turning the bare `intoss-private://` URL from `ait deploy --scheme-only` into a QR and scanning that opens the app but **does not attach the debugger** — without `debug=1` and `relay=` the in-app gate blocks the attach. The runner waits indefinitely for a scan (`--attach-timeout` bounds the wait) and runs no tests until one arrives.
|
|
908
|
-
|
|
909
|
-
### The debugger disconnects when the run ends (this is normal)
|
|
910
|
-
|
|
911
|
-
The runner is run-then-exit. Once the last test file finishes it prints the summary, tears down the relay, tunnel, and dashboard, and exits (exit code 1 if any test failed) — at that moment the badge on the phone flips to a disconnected notice and then dismisses itself. The debug session closed; the app did not crash, and the mini-app stays open. To run again, restart the runner and scan the new dashboard QR.
|
|
912
|
-
|
|
913
|
-
### Tests that open native sheets (`--manual-blocking`)
|
|
914
|
-
|
|
915
|
-
Tests that need a human to tap through a native sheet — photo picker, permission dialog, fullscreen ad — go in files named `*.manual.ait.test.ts`. Those files are **excluded** from a default run and are only included with `--manual-blocking`, where they run **last**, after every regular file. Before each manual file the dashboard and stdout show its filename plus progress (k/n), and the per-file timeout is raised to 5 minutes.
|
|
916
|
-
|
|
917
|
-
### Artifacts (`--report-dir`)
|
|
918
|
-
|
|
919
|
-
| Path | Contents |
|
|
920
|
-
|---|---|
|
|
921
|
-
| `<dir>/<sdkLine>.<platform>.json` | Runner-agnostic report. File paths are relative to the project root, and no relay / scheme / TOTP values are stored |
|
|
922
|
-
| `<dir>/<sdkLine>.<platform>.manual.json` | The manual files included in a `--manual-blocking` run — written alongside the standard report, never replacing it |
|
|
923
|
-
| `<dir>/.ait-capture/<category>.<sdkLine>.<platform>.json` | `__AIT_CAPTURE__` lines emitted by the tests (for offline 2.x↔3.0 comparison) |
|
|
924
|
-
|
|
925
|
-
`<sdkLine>` and `<platform>` are the `--cell-sdk-line` / `--cell-platform` values verbatim. Without `--report-dir`, neither the report nor the captures are collected.
|
|
926
|
-
|
|
927
|
-
### Everything else
|
|
928
|
-
|
|
929
|
-
`devtools-test --help` is the source of truth for the full flag reference. Attach/run timeouts, bridge-call pacing, and the `--attach-launcher --app-url` mode that attaches to the environment 2 launcher PWA all live there.
|
|
881
|
+
The full flag reference, QR-scan procedure, and artifact layout are now documented in `@ait-co/debugger` — see `debugger-test --help`. The one line this package still owns is the mini-app entry point: `import '@ait-co/debug-console/auto'` ([section above](#on-device-debugging-in-one-line)).
|
|
930
882
|
|
|
931
883
|
## SDK update tracking
|
|
932
884
|
|
|
@@ -1042,176 +994,40 @@ import '@ait-co/devtools/panel';
|
|
|
1042
994
|
|
|
1043
995
|
## MCP Server
|
|
1044
996
|
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
A local browser (env 1) and a phone Toss WebView (env 2/3) both speak CDP, so every tool works identically in both environments — the only difference is the attach strategy (`--target=relay` vs `--target=local`).
|
|
1048
|
-
|
|
1049
|
-
| Mode + target | Invocation | Env vars | Target | Tools |
|
|
1050
|
-
|---|---|---|---|---|
|
|
1051
|
-
| `--target=mobile` (env 2) | `devtools-mcp` → `start_debug({mode:'relay-sandbox'})` | `AIT_RELAY_BASE_URL`, `AIT_TUNNEL_BASE_URL` | Real-device Safari/WebKit PWA (external Chii relay + cloudflared tunnel, env 2) | console/network/page + DOM/snapshot/screenshot |
|
|
1052
|
-
| `--mode=debug --target=relay` (default, env 3) | `devtools-mcp` → `start_debug({mode: 'relay-staging'})` | — | Dog-food bundle on a phone (CDP/Chii relay + cloudflared tunnel, env 3) | same + `AIT.*` |
|
|
1053
|
-
| `--mode=debug --target=local` (env 1) | `devtools-mcp --target=local` | `MCP_ENV=mock` (auto) | Local Chromium launched by the MCP server (CDP direct-attach, no relay needed, env 1) | same |
|
|
1054
|
-
| `--mode=dev` | `devtools-mcp --mode=dev` | `MCP_ENV=mock` (auto) | Mock state from a running Vite dev server (AIT.* only, no CDP) | `AIT.*` (+ `devtools_get_mock_state` alias) |
|
|
1055
|
-
|
|
1056
|
-
`--target=local` opens `AIT_DEVTOOLS_URL` (default `http://localhost:5173`) and attaches directly to a local Chromium — no relay or tunnel required. `--mode=dev` reads the mock-state HTTP endpoint of the Vite dev server and does not provide CDP tools. Switch environments in-session with `start_debug(mode)`: `relay-sandbox` (env 2 PWA), `relay-staging` (env 3 dogfood), `local-browser` (env 1).
|
|
1057
|
-
|
|
1058
|
-
#### Environment 2 (real-device PWA CDP) — `--target=mobile`
|
|
1059
|
-
|
|
1060
|
-
Debug on a real phone using Safari/WebKit without Toss review. The Vite dev server with [`tunnel:{cdp:true}`](#tunnel-option) brings up both an app HTTP tunnel and a Chii relay tunnel. The MCP server attaches to that relay and provides `start_attach` → launcher QR.
|
|
1061
|
-
|
|
1062
|
-
**Setup procedure:**
|
|
1063
|
-
|
|
1064
|
-
1. Start the Vite dev server in CDP tunnel mode:
|
|
1065
|
-
```bash
|
|
1066
|
-
AIT_TUNNEL_CDP=1 pnpm exec vite --config e2e/fixture/vite.config.ts
|
|
1067
|
-
```
|
|
1068
|
-
The terminal banner prints two URLs:
|
|
1069
|
-
- **App HTTP tunnel** `https://<A>.trycloudflare.com` → set as `AIT_TUNNEL_BASE_URL`
|
|
1070
|
-
- **Relay wss tunnel** `wss://<B>.trycloudflare.com` → set `AIT_RELAY_BASE_URL` to its `https://` form
|
|
1071
|
-
|
|
1072
|
-
2. Start the MCP server in mobile mode (separate terminal):
|
|
1073
|
-
```json
|
|
1074
|
-
{
|
|
1075
|
-
"mcpServers": {
|
|
1076
|
-
"ait-debug": {
|
|
1077
|
-
"command": "npx",
|
|
1078
|
-
"args": ["-y", "@ait-co/devtools", "devtools-mcp"],
|
|
1079
|
-
"env": {
|
|
1080
|
-
"AIT_RELAY_BASE_URL": "https://<B>.trycloudflare.com",
|
|
1081
|
-
"AIT_TUNNEL_BASE_URL": "https://<A>.trycloudflare.com"
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
```
|
|
1087
|
-
|
|
1088
|
-
3. In a Claude Code session:
|
|
1089
|
-
```
|
|
1090
|
-
start_debug({mode: 'relay-sandbox'})
|
|
1091
|
-
start_attach()
|
|
1092
|
-
```
|
|
1093
|
-
Scan the QR with your phone camera. The launcher PWA opens the app in a frame and injects Chii target.js.
|
|
1094
|
-
|
|
1095
|
-
4. `list_pages()` → expect one page. Use `take_screenshot()` and other CDP tools.
|
|
1096
|
-
|
|
1097
|
-
**Env 2 fidelity boundary**: uses the mock SDK (`call_sdk` hits the mock). For real SDK fidelity, move to env 3. CDP runs on the real WebKit engine, so DOM, console, and screenshot reflect the real device screen.
|
|
1098
|
-
|
|
1099
|
-
**Local-PC verification**: `e2e/launcher-cdp.test.ts` automates node-side relay startup (`startChiiRelay({port:0})`) and launcher param forwarding (Playwright). Browser-side Chii target.js injection is not automated in CI due to the localhost host gate (Layer B1) and ws:// vs wss:// constraints — completed by the manual procedure above on a real device with a trycloudflare.com hostname.
|
|
1100
|
-
|
|
1101
|
-
### Debug mode (CDP via Chii)
|
|
1102
|
-
|
|
1103
|
-
For a step-by-step walkthrough of the on-device relay debug loop (dog-food build → QR scan → relay attach) including common failure recovery, see **[`docs/dogfood-relay-loop.md`](./docs/dogfood-relay-loop.md)** (Korean). For crash triage — `list_pages.crashDetectedAt`, iOS Console.app `.ips` analysis, and the redact procedure — see **[`docs/crash-triage.md`](./docs/crash-triage.md)** (Korean).
|
|
1104
|
-
|
|
1105
|
-
Read-only tools only. Tools are registered in two tiers based on attach state — before attach, only the bootstrap tools (`start_attach`, `list_pages`) are visible; once a relay/local page attaches, the attach-dependent tools are registered dynamically in the same session via `notifications/tools/list_changed` (no session restart needed). The phone attach roundtrip is fully wired; all that remains is a single on-device acceptance run. The tool layer is CI-verified via a mockable injectable CDP connection / AIT source.
|
|
1106
|
-
|
|
1107
|
-
Running `devtools-mcp` as a stdio server starts a local Chii relay on an OS-assigned port and opens a cloudflared quick tunnel, printing a public `wss://*.trycloudflare.com` URL and a QR code in the terminal (secrets/auth codes are never printed). When the phone enters the dog-food entry point, the in-app attach UI connects to the relay with that URL, and the agent reads console/network/page state via `chrome-devtools-mcp`-compatible tools — diagnosing regressions without anyone watching the phone.
|
|
1108
|
-
|
|
1109
|
-
Environment 3 (intoss-private relay) — start `devtools-mcp` as-is, then enter via `start_debug(mode)`:
|
|
997
|
+
The MCP surface (daemon, attach, CDP tools) moved to `@ait-co/debugger` (#818). Point your agent's registration at debugger, not devtools:
|
|
1110
998
|
|
|
1111
999
|
```json
|
|
1112
1000
|
{
|
|
1113
1001
|
"mcpServers": {
|
|
1114
1002
|
"ait-debug": {
|
|
1115
|
-
"command": "
|
|
1116
|
-
"args": ["
|
|
1003
|
+
"command": "npx",
|
|
1004
|
+
"args": ["-y", "-p", "@ait-co/debugger", "debugger"]
|
|
1117
1005
|
}
|
|
1118
1006
|
}
|
|
1119
1007
|
}
|
|
1120
1008
|
```
|
|
1121
1009
|
|
|
1122
|
-
-
|
|
1123
|
-
**`start_debug(mode)` is the single in-session entry path.**
|
|
1124
|
-
|
|
1125
|
-
| Tool | CDP / AIT backing | Description |
|
|
1126
|
-
|---|---|---|
|
|
1127
|
-
| `list_console_messages` | `Runtime.consoleAPICalled` | Recent console.log/warn/error messages (level, text, timestamp, args) |
|
|
1128
|
-
| `list_network_requests` | `Network.requestWillBeSent` + `responseReceived` | Recent XHR/fetch requests (url, method, status, timing) |
|
|
1129
|
-
| `list_pages` | Chii relay target list | Attached pages + tunnel status + wss URL |
|
|
1130
|
-
| `start_attach` | (pure synthesis + attach wait) | Splices `debug=1` + the relay URL into an `ait deploy --scheme-only` URL, prints a QR, then waits in the same call until the phone attaches (QR generation and attach in one call). A `mode` arg can switch the session environment too, and the TOTP code is re-minted automatically during the wait. Entry tool for env 2 and 3 (bootstrap) — no `list_pages` needed first |
|
|
1131
|
-
| `get_dom_document` | `DOM.getDocument` | DOM tree read (structural/layout regression diagnosis) |
|
|
1132
|
-
| `take_snapshot` | `DOMSnapshot.captureSnapshot` | Page snapshot (documents + interned strings, visual regression) |
|
|
1133
|
-
| `take_screenshot` | `Page.captureScreenshot` | Page PNG screenshot (returned as an MCP image content block) |
|
|
1134
|
-
| `measure_safe_area` | `Runtime.evaluate` | Runs a safe-area probe on the attached page → returns normalized safe-area insets, viewport geometry, DPR, and User-Agent. Read-only. Use in a relay session to get ground-truth values for upgrading a viewport preset from extrapolated/placeholder to measured. Requires attach (`list_pages` first) |
|
|
1135
|
-
| `evaluate` | `Runtime.evaluate` | Evaluates an arbitrary JS expression on the attached page (returnByValue) and returns the result. **Not read-only** — the expression can have side effects (DOM mutations, SDK calls, state changes). Requires attach |
|
|
1136
|
-
| `call_sdk` | `window.__sdkCall` bridge (via `Runtime.evaluate`) | Calls a dog-food SDK method via the `window.__sdkCall` bridge (exported by `@apps-in-toss/web-framework` in `__DEBUG_BUILD__` bundles only). **Not read-only** — SDK calls have side effects (navigation, payments, permissions, etc.). Hits the real SDK on env 3, mock SDK on env 1. Env 2 (PWA) does not inject the SDK — not available there. Requires attach. Returns `{ok,value}` / `{ok,error}` |
|
|
1137
|
-
| `AIT.getSdkCallHistory` | AIT domain | SDK call trace (method, args, result/error, timestamp) |
|
|
1138
|
-
| `AIT.getMockState` | AIT domain | Mock state snapshot (`window.__ait`) |
|
|
1139
|
-
| `AIT.getOperationalEnvironment` | AIT domain | `getOperationalEnvironment()` + SDK version |
|
|
1140
|
-
|
|
1141
|
-
`AIT.*` covers what raw CDP cannot; the same MCP server forwards it alongside CDP. In debug mode the in-app side answers over the Chii channel.
|
|
1142
|
-
|
|
1143
|
-
### Dev mode (mock state)
|
|
1144
|
-
|
|
1145
|
-
`devtools-mcp --mode=dev` reads the mock state from a running browser. It shares the same `AIT.*` tool surface as debug mode.
|
|
1146
|
-
|
|
1147
|
-
#### Architecture
|
|
1148
|
-
|
|
1149
|
-
```
|
|
1150
|
-
Browser (aitState)
|
|
1151
|
-
└─ POST /api/ait-devtools/state (auto-pushed by the panel on every state change)
|
|
1152
|
-
└─ Vite dev server (unplugin with mcp: true)
|
|
1153
|
-
└─ GET /api/ait-devtools/state
|
|
1154
|
-
└─ MCP stdio server (dist/mcp/server.js)
|
|
1155
|
-
└─ AI agent (AIT.getMockState tool)
|
|
1156
|
-
```
|
|
1157
|
-
|
|
1158
|
-
#### Setup
|
|
1159
|
-
|
|
1160
|
-
**1. Add `mcp: true` to the Vite plugin**
|
|
1161
|
-
|
|
1162
|
-
```ts
|
|
1163
|
-
// vite.config.ts
|
|
1164
|
-
import aitDevtools from '@ait-co/devtools/unplugin';
|
|
1165
|
-
|
|
1166
|
-
export default {
|
|
1167
|
-
plugins: [aitDevtools.vite({ mcp: true })],
|
|
1168
|
-
};
|
|
1169
|
-
```
|
|
1170
|
-
|
|
1171
|
-
**2. Configure your MCP client (e.g. Claude Code `.claude/settings.json`)**
|
|
1172
|
-
|
|
1173
|
-
```json
|
|
1174
|
-
{
|
|
1175
|
-
"mcpServers": {
|
|
1176
|
-
"ait-devtools": {
|
|
1177
|
-
"command": "pnpm",
|
|
1178
|
-
"args": ["exec", "devtools-mcp", "--mode=dev"],
|
|
1179
|
-
"env": {
|
|
1180
|
-
"AIT_DEVTOOLS_URL": "http://localhost:5173"
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
```
|
|
1186
|
-
|
|
1187
|
-
`AIT_DEVTOOLS_URL` defaults to `http://localhost:5173` — you can omit it if you're using the default port.
|
|
1188
|
-
|
|
1189
|
-
**3. Open the app in your browser, then call the tool from your AI agent**
|
|
1190
|
-
|
|
1191
|
-
```
|
|
1192
|
-
> AIT.getMockState
|
|
1193
|
-
```
|
|
1194
|
-
|
|
1195
|
-
Returns the full current mock state (permissions, location, auth, network, IAP, etc.) as JSON.
|
|
1196
|
-
|
|
1197
|
-
| Tool | Description |
|
|
1198
|
-
|---|---|
|
|
1199
|
-
| `AIT.getMockState` | Returns the current `AitDevtoolsState` snapshot (read-only) |
|
|
1200
|
-
| `AIT.getOperationalEnvironment` | Environment + version derived from the mock state's `environment` + `appVersion` |
|
|
1201
|
-
| `AIT.getSdkCallHistory` | Empty in dev mode (the HTTP endpoint records no trace) |
|
|
1202
|
-
| `devtools_get_mock_state` | Backward-compatible alias of `AIT.getMockState` (prefer `AIT.getMockState` in new configs) |
|
|
1010
|
+
What this gives you: CDP observation of a running mini-app across environments 1 (local browser), 2 (PWA), and 3 (intoss-private WebView) — console, network, DOM, snapshot, screenshot — plus `start_attach` for on-device entry in environments 2/3. The full tool list, mode/target matrix, and per-environment config live in the [`@ait-co/debugger`](https://www.npmjs.com/package/@ait-co/debugger) package docs.
|
|
1203
1011
|
|
|
1204
1012
|
## Package export structure
|
|
1205
1013
|
|
|
1014
|
+
The entry points this package actually ships:
|
|
1015
|
+
|
|
1206
1016
|
| Import path | Purpose |
|
|
1207
1017
|
|---|---|
|
|
1208
|
-
| `@ait-co/devtools`
|
|
1018
|
+
| `@ait-co/devtools` (= `/mock`) | Bundler alias target, all mock exports |
|
|
1209
1019
|
| `@ait-co/devtools/panel` | Floating DevTools Panel (auto-mounts on import) |
|
|
1210
1020
|
| `@ait-co/devtools/unplugin` | Bundler plugin (.vite, .webpack, .rspack, .esbuild, .rollup) |
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
|
1021
|
+
|
|
1022
|
+
Everything below is a **transition stub** — it exists only in 0.2.x and is removed in 1.0.0 (#818). Migrate to the new package.
|
|
1023
|
+
|
|
1024
|
+
| Import path | New home | On import |
|
|
1025
|
+
|---|---|---|
|
|
1026
|
+
| `@ait-co/devtools/mcp/server` | `@ait-co/debugger/mcp/server` | throws |
|
|
1027
|
+
| `@ait-co/devtools/mcp/cli` | `@ait-co/debugger/mcp/cli` | throws |
|
|
1028
|
+
| `@ait-co/devtools/test-runner` | `@ait-co/debugger/test-runner` | throws |
|
|
1029
|
+
| `@ait-co/devtools/in-app` | `@ait-co/debug-console` | no-op + one `console.error` |
|
|
1030
|
+
| `@ait-co/devtools/in-app/auto` | `@ait-co/debug-console/auto` | no-op + one `console.error` |
|
|
1215
1031
|
|
|
1216
1032
|
## License
|
|
1217
1033
|
|