@ait-co/devtools 0.1.43 → 0.1.44
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 +85 -0
- package/README.md +85 -0
- package/dist/mcp/cli.js +668 -139
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +35 -30
- package/dist/mcp/server.js.map +1 -1
- package/dist/panel/index.js +2 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -18,6 +18,91 @@ Lets you develop and test Apps in Toss mini-apps in a **regular browser** — wi
|
|
|
18
18
|
|
|
19
19
|
Live demo: <https://devtools.aitc.dev/> (the `e2e/fixture/` from this repo deployed to GitHub Pages as a self-contained demo).
|
|
20
20
|
|
|
21
|
+
## 15-second quickstart — pick your environment
|
|
22
|
+
|
|
23
|
+
There are four runtime environments. Pick the card that fits your situation and follow the link to the detailed scenario doc.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
**Environment 1 — Local browser** (fastest, HMR on)
|
|
28
|
+
|
|
29
|
+
Develop with the mock SDK + DevTools panel in desktop Chrome. No Toss app or phone needed.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm add -D @ait-co/devtools
|
|
33
|
+
# add the unplugin to vite.config.ts → pnpm dev
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
DevTools panel: click the **AIT** button in the bottom-right corner. Details: [`docs/scenarios/env-1.md`](./docs/scenarios/env-1.md)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
**Environment 2 — Real-device PWA** (real WebKit engine, HMR on, no Toss review required)
|
|
41
|
+
|
|
42
|
+
Preview your mini-app on a real phone using Safari/WebKit. Install the launcher PWA once, then scan a QR code each session.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# add the tunnel option to vite.config.ts, then:
|
|
46
|
+
pnpm dev:phone # same as AIT_TUNNEL=1 pnpm dev
|
|
47
|
+
# QR appears in the terminal → scan with your phone camera → opens in the launcher PWA
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
One-time prerequisite: add `https://devtools.aitc.dev/launcher/` to your phone's home screen. Details: [`docs/scenarios/env-2.md`](./docs/scenarios/env-2.md)
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
**Environment 3 — intoss-private** (Toss WebView, HMR off, debug only)
|
|
55
|
+
|
|
56
|
+
Load a dogfood bundle in the real Toss app WebView and debug it via the MCP relay.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
devtools-mcp # start MCP server → QR printed in terminal
|
|
60
|
+
# ait build && ait deploy --scheme-only
|
|
61
|
+
# call build_attach_url → scan QR → Toss app loads bundle + relay attaches
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
No HMR (Toss WebView cold-load only). Details: [`docs/scenarios/env-3.md`](./docs/scenarios/env-3.md)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
**Environment 4 — Live deployed app** (passed review, HMR off, read-only debug)
|
|
69
|
+
|
|
70
|
+
Attach a relay to a live OPENED app to observe runtime behavior.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
devtools-mcp # start MCP server
|
|
74
|
+
# call build_attach_url → scan QR → live app loads + relay attaches
|
|
75
|
+
# call_sdk / evaluate: watch for side effects (real users may be affected)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Details: [`docs/scenarios/env-4.md`](./docs/scenarios/env-4.md)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Five common problems
|
|
83
|
+
|
|
84
|
+
**"QR window doesn't open"**
|
|
85
|
+
|
|
86
|
+
Either `build_attach_url` wasn't called first, or `open_in_browser` failed silently in a headless environment. The terminal output includes a path to a saved PNG — open that file directly, or scan the text QR printed in the terminal. (Related: [#288](https://github.com/apps-in-toss-community/devtools/issues/288))
|
|
87
|
+
|
|
88
|
+
**"Page not attached" — list_pages returns an empty array**
|
|
89
|
+
|
|
90
|
+
No page has joined the relay yet. Re-enter via `build_attach_url` → QR scan on your phone. When the MCP error message reads "page not attached — run build_attach_url then scan QR", this is the case.
|
|
91
|
+
|
|
92
|
+
**"Tunnel down" — no response or timeout**
|
|
93
|
+
|
|
94
|
+
A cloudflared quick tunnel can drop after a few hours. Restart the `devtools-mcp` process to get a new tunnel URL, then scan the new QR. (Related: [#290](https://github.com/apps-in-toss-community/devtools/issues/290))
|
|
95
|
+
|
|
96
|
+
**"Page crash" — list_pages shows a non-null crashDetectedAt**
|
|
97
|
+
|
|
98
|
+
The page on the phone died (OOM, JS exception, or native bridge crash). Relaunch the app, then re-attach via `build_attach_url` → QR scan. (Related: [#265](https://github.com/apps-in-toss-community/devtools/issues/265))
|
|
99
|
+
|
|
100
|
+
**"SDK not available" — window.__sdkCall not injected**
|
|
101
|
+
|
|
102
|
+
When `call_sdk` returns `ok: false, error: "window.__sdkCall is not available"`, a non-dogfood bundle is loaded. Redeploy through the dogfood channel with the `__DEBUG_BUILD__` flag enabled and try again. This error is the expected result in environment 2 (PWA). (Related: [#285](https://github.com/apps-in-toss-community/devtools/issues/285))
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
21
106
|
## Install
|
|
22
107
|
|
|
23
108
|
```bash
|
package/README.md
CHANGED
|
@@ -18,6 +18,91 @@
|
|
|
18
18
|
|
|
19
19
|
라이브 데모: <https://devtools.aitc.dev/> (이 repo의 `e2e/fixture/`를 GitHub Pages에 그대로 배포한 self-contained 데모).
|
|
20
20
|
|
|
21
|
+
## 15초 quickstart — 내 상황에 맞는 환경 고르기
|
|
22
|
+
|
|
23
|
+
4가지 실행 환경이 있습니다. 지금 상황에 맞는 카드 하나를 고르고, 해당 상세 시나리오 문서로 이동하세요.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
**환경 1 — 로컬 브라우저** (가장 빠름, HMR O)
|
|
28
|
+
|
|
29
|
+
데스크탑 Chrome에서 mock SDK + DevTools 패널로 개발합니다. 토스 앱·폰 없이 즉시 시작.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm add -D @ait-co/devtools
|
|
33
|
+
# vite.config.ts에 unplugin 추가 → pnpm dev
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
DevTools 패널: 화면 우하단 **AIT** 버튼. 상세: [`docs/scenarios/env-1.md`](./docs/scenarios/env-1.md)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
**환경 2 — 실기기 PWA** (실 WebKit 엔진, HMR O, 토스 검수 불필요)
|
|
41
|
+
|
|
42
|
+
폰에서 실기기 Safari/WebKit 엔진으로 미니앱을 확인합니다. launcher PWA를 한 번 설치하고, 매 세션마다 QR 스캔.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# vite.config.ts에 tunnel 옵션 추가 후:
|
|
46
|
+
pnpm dev:phone # AIT_TUNNEL=1 pnpm dev 와 동일
|
|
47
|
+
# 터미널에 QR 출력 → 폰 카메라로 스캔 → launcher PWA에서 자동 열림
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
사전: 폰에 `https://devtools.aitc.dev/launcher/` 를 홈 화면에 한 번 추가. 상세: [`docs/scenarios/env-2.md`](./docs/scenarios/env-2.md)
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
**환경 3 — intoss-private** (토스 WebView, HMR X, debug 전용)
|
|
55
|
+
|
|
56
|
+
실기기 토스 앱 WebView에서 dogfood 번들을 로드하고 MCP relay로 디버깅합니다.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
devtools-mcp # MCP 서버 시작 → QR 출력
|
|
60
|
+
# ait build && ait deploy --scheme-only
|
|
61
|
+
# build_attach_url 호출 → QR 스캔 → 토스 앱 로드 + relay attach
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
HMR 없음(토스 WebView cold-load만). 상세: [`docs/scenarios/env-3.md`](./docs/scenarios/env-3.md)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
**환경 4 — 배포된 앱 (LIVE)** (검수 통과 앱, HMR X, read-only debug)
|
|
69
|
+
|
|
70
|
+
검수를 통과하고 OPENED 상태인 실 출시 앱에 relay를 붙여 런타임을 관측합니다.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
devtools-mcp # MCP 서버 시작
|
|
74
|
+
# build_attach_url 호출 → QR 스캔 → LIVE 앱 로드 + relay attach
|
|
75
|
+
# call_sdk / evaluate 는 side-effect 주의 (실유저 영향)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
상세: [`docs/scenarios/env-4.md`](./docs/scenarios/env-4.md)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 자주 겪는 문제 5가지
|
|
83
|
+
|
|
84
|
+
**"QR 창이 안 열림"**
|
|
85
|
+
|
|
86
|
+
`build_attach_url`을 먼저 호출하지 않았거나, GUI 없는 headless 환경에서 `open_in_browser`가 실패한 경우입니다. 터미널에 PNG 저장 경로가 출력됩니다 — 그 파일을 직접 열거나, 텍스트 QR을 터미널에서 스캔하세요. (관련: [#288](https://github.com/apps-in-toss-community/devtools/issues/288))
|
|
87
|
+
|
|
88
|
+
**"page 미attach" — list_pages가 빈 배열 반환**
|
|
89
|
+
|
|
90
|
+
relay에 붙은 페이지가 없는 상태입니다. `build_attach_url` → QR 스캔 순서로 폰을 다시 진입시키세요. MCP 에러 메시지가 "페이지가 attach 안 됨. build_attach_url → QR 스캔."으로 뜨면 이 케이스입니다.
|
|
91
|
+
|
|
92
|
+
**"tunnel down" — 터널 응답 없음 또는 timeout**
|
|
93
|
+
|
|
94
|
+
cloudflared quick tunnel은 수 시간 후 drop될 수 있습니다. `devtools-mcp` 프로세스를 재시작하면 새 tunnel URL이 발급됩니다. 재발급 후 QR을 다시 스캔하세요. (관련: [#290](https://github.com/apps-in-toss-community/devtools/issues/290))
|
|
95
|
+
|
|
96
|
+
**"page crash" — list_pages에 crashDetectedAt이 찍힘**
|
|
97
|
+
|
|
98
|
+
폰 측 페이지가 OOM·JS exception·native bridge crash로 죽은 상태입니다. 앱을 재실행 후 `build_attach_url` → QR 스캔으로 다시 attach하세요. (관련: [#265](https://github.com/apps-in-toss-community/devtools/issues/265))
|
|
99
|
+
|
|
100
|
+
**"SDK 부재" — window.__sdkCall 미주입**
|
|
101
|
+
|
|
102
|
+
`call_sdk` 호출 시 `ok: false, error: "window.__sdkCall is not available"` 에러가 뜨면 dogfood 빌드가 아닌 일반 번들이 로드된 것입니다. `__DEBUG_BUILD__` 플래그가 켜진 dogfood 채널로 재배포 후 다시 시도하세요. 환경 2(PWA)에서는 이 에러가 예상 결과입니다. (관련: [#285](https://github.com/apps-in-toss-community/devtools/issues/285))
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
21
106
|
## 설치
|
|
22
107
|
|
|
23
108
|
```bash
|