@ait-co/devtools 0.1.53 → 0.1.54

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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ![@ait-co/devtools — SDK mock + DevTools panel for Apps In Toss mini-apps](./assets/og/image.png)
8
8
 
9
- A mock library for the `@apps-in-toss/web-framework` SDK. Imports of `@apps-in-toss/web-bridge` and `@apps-in-toss/web-analytics` are also mocked.
9
+ A mock library for the `@apps-in-toss/web-framework` SDK. Imports of `@apps-in-toss/webview-bridge` are also mocked. (2.x packages `@apps-in-toss/web-bridge` and `@apps-in-toss/web-analytics` are supported for back-compat.)
10
10
 
11
11
  Lets you develop and test Apps in Toss mini-apps in a **regular browser** — without the Toss app. All SDK features are simulated so you can move fast.
12
12
 
@@ -115,13 +115,9 @@ npm install -D @ait-co/devtools
115
115
  pnpm add -D @ait-co/devtools
116
116
  ```
117
117
 
118
- > **Supported SDK version**: `@apps-in-toss/web-framework >=2.5.0 <2.6.0` (peer, required).
118
+ > **Supported SDK version**: `@apps-in-toss/web-framework 3.0.0-beta.9d42c0b` (beta, peer optional).
119
119
  >
120
- > devtools is only verified against SDK versions within that range. Installing an out-of-range SDK version
121
- > will cause the package manager to emit a peer warning at install time. Additionally, calling an API that
122
- > devtools has not yet mocked will throw a runtime error — this is intentional to prevent the
123
- > "works in devtools but fails with the real SDK" type of production incident. For missing APIs,
124
- > please [file an issue](https://github.com/apps-in-toss-community/devtools/issues).
120
+ > devtools currently tracks the web-framework **3.0.0-beta** pre-release. Since beta versions are not resolved by `^3.0.0`, install using an exact pin: `@apps-in-toss/web-framework@3.0.0-beta.9d42c0b`. The peer range and pin will be updated when stable 3.0.0 GA ships. Calling an API that devtools has not yet mocked will throw a runtime error — please [file an issue](https://github.com/apps-in-toss-community/devtools/issues) for missing APIs.
125
121
 
126
122
  ## Reference consumer
127
123
 
@@ -158,17 +154,16 @@ config.plugins.push(aitDevtools.webpack());
158
154
 
159
155
  Turbopack does not support a plugin system, so use `resolveAlias` instead.
160
156
 
161
- - You also need to alias `@apps-in-toss/web-bridge` and `@apps-in-toss/web-analytics`.
157
+ - You also need to alias `@apps-in-toss/webview-bridge`. (If you're on 2.x, alias `@apps-in-toss/web-bridge` and `@apps-in-toss/web-analytics` instead.)
162
158
  - Turbopack is generally only used with `next dev`, so no extra production guard is needed.
163
159
 
164
160
  ```js
165
- // next.config.js (Next.js 15+)
161
+ // next.config.js (Next.js 15+, web-framework 3.0+)
166
162
  module.exports = {
167
163
  turbo: {
168
164
  resolveAlias: {
169
165
  '@apps-in-toss/web-framework': '@ait-co/devtools/mock',
170
- '@apps-in-toss/web-bridge': '@ait-co/devtools/mock',
171
- '@apps-in-toss/web-analytics': '@ait-co/devtools/mock',
166
+ '@apps-in-toss/webview-bridge': '@ait-co/devtools/mock',
172
167
  },
173
168
  },
174
169
  };
@@ -177,14 +172,13 @@ module.exports = {
177
172
  For Next.js 14 and below, use `experimental.turbo`:
178
173
 
179
174
  ```js
180
- // next.config.js (Next.js 14 and below)
175
+ // next.config.js (Next.js 14 and below, web-framework 3.0+)
181
176
  module.exports = {
182
177
  experimental: {
183
178
  turbo: {
184
179
  resolveAlias: {
185
180
  '@apps-in-toss/web-framework': '@ait-co/devtools/mock',
186
- '@apps-in-toss/web-bridge': '@ait-co/devtools/mock',
187
- '@apps-in-toss/web-analytics': '@ait-co/devtools/mock',
181
+ '@apps-in-toss/webview-bridge': '@ait-co/devtools/mock',
188
182
  },
189
183
  },
190
184
  },
@@ -220,28 +214,26 @@ module.exports = {
220
214
  You can also configure the bundler's `resolve.alias` directly:
221
215
 
222
216
  ```ts
223
- // vite.config.ts
217
+ // vite.config.ts (web-framework 3.0+)
224
218
  import { defineConfig } from 'vite';
225
219
 
226
220
  export default defineConfig({
227
221
  resolve: {
228
222
  alias: {
229
223
  '@apps-in-toss/web-framework': '@ait-co/devtools/mock',
230
- '@apps-in-toss/web-bridge': '@ait-co/devtools/mock',
231
- '@apps-in-toss/web-analytics': '@ait-co/devtools/mock',
224
+ '@apps-in-toss/webview-bridge': '@ait-co/devtools/mock',
232
225
  },
233
226
  },
234
227
  });
235
228
  ```
236
229
 
237
230
  ```js
238
- // webpack.config.js (Webpack requires absolute paths)
231
+ // webpack.config.js (Webpack requires absolute paths, web-framework 3.0+)
239
232
  module.exports = {
240
233
  resolve: {
241
234
  alias: {
242
235
  '@apps-in-toss/web-framework': require.resolve('@ait-co/devtools/mock'),
243
- '@apps-in-toss/web-bridge': require.resolve('@ait-co/devtools/mock'),
244
- '@apps-in-toss/web-analytics': require.resolve('@ait-co/devtools/mock'),
236
+ '@apps-in-toss/webview-bridge': require.resolve('@ait-co/devtools/mock'),
245
237
  },
246
238
  },
247
239
  };
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ![@ait-co/devtools — SDK mock + DevTools panel for Apps In Toss mini-apps](./assets/og/image.png)
8
8
 
9
- `@apps-in-toss/web-framework` SDK의 mock 라이브러리입니다. `@apps-in-toss/web-bridge`, `@apps-in-toss/web-analytics` import도 함께 mock됩니다.
9
+ `@apps-in-toss/web-framework` SDK의 mock 라이브러리입니다. `@apps-in-toss/webview-bridge` import도 함께 mock됩니다. (2.x의 `@apps-in-toss/web-bridge`, `@apps-in-toss/web-analytics`도 back-compat으로 지원.)
10
10
 
11
11
  앱인토스(Apps in Toss) 미니앱을 **일반 브라우저**에서 개발하고 테스트할 수 있게 해줍니다. 토스 앱 없이도 SDK의 모든 기능을 시뮬레이션하여 빠른 개발 사이클을 지원합니다.
12
12
 
@@ -115,13 +115,9 @@ npm install -D @ait-co/devtools
115
115
  pnpm add -D @ait-co/devtools
116
116
  ```
117
117
 
118
- > **지원 SDK 버전**: `@apps-in-toss/web-framework >=2.5.0 <2.6.0` (peer, required).
118
+ > **지원 SDK 버전**: `@apps-in-toss/web-framework 3.0.0-beta.9d42c0b` (beta, peer optional).
119
119
  >
120
- > devtools는 범위의 SDK 버전에서만 동작이 검증됩니다. 범위 SDK설치하면
121
- > 패키지 매니저가 install-time에 peer 경고를 표시합니다. 또한 devtools가 아직 mock하지
122
- > 않은 API를 호출하면 런타임에 에러가 발생합니다 — "devtools에서는 잘 되는데 실제 SDK에서는
123
- > 안 되는" 상황을 방지하기 위한 의도적 동작입니다. 누락된 API는
124
- > [이슈](https://github.com/apps-in-toss-community/devtools/issues)로 알려주세요.
120
+ > 현재 devtools는 web-framework **3.0.0-beta** 프리릴리즈를 추적합니다. beta 버전은 `^3.0.0`으로 resolve되지 않으므로 설치 시 exact pin(`@apps-in-toss/web-framework@3.0.0-beta.9d42c0b`)을 사용하세요. stable 3.0.0 GA 출시 후 peer range와 pin이 업데이트됩니다. devtools가 아직 mock하지 않은 API호출하면 런타임에 에러가 발생합니다 — 누락된 API는 [이슈](https://github.com/apps-in-toss-community/devtools/issues)로 알려주세요.
125
121
 
126
122
  ## Reference consumer
127
123
 
@@ -158,17 +154,16 @@ config.plugins.push(aitDevtools.webpack());
158
154
 
159
155
  Turbopack은 플러그인 시스템을 지원하지 않으므로 `resolveAlias`를 사용합니다.
160
156
 
161
- - `@apps-in-toss/web-bridge`, `@apps-in-toss/web-analytics`도 함께 alias해야 합니다.
157
+ - `@apps-in-toss/webview-bridge`도 함께 alias해야 합니다. (2.x를 사용 중이라면 `@apps-in-toss/web-bridge`, `@apps-in-toss/web-analytics`도 추가.)
162
158
  - Turbopack은 일반적으로 `next dev`에서만 사용되므로 별도의 production 가드가 필요하지 않습니다.
163
159
 
164
160
  ```js
165
- // next.config.js (Next.js 15+)
161
+ // next.config.js (Next.js 15+, web-framework 3.0+)
166
162
  module.exports = {
167
163
  turbo: {
168
164
  resolveAlias: {
169
165
  '@apps-in-toss/web-framework': '@ait-co/devtools/mock',
170
- '@apps-in-toss/web-bridge': '@ait-co/devtools/mock',
171
- '@apps-in-toss/web-analytics': '@ait-co/devtools/mock',
166
+ '@apps-in-toss/webview-bridge': '@ait-co/devtools/mock',
172
167
  },
173
168
  },
174
169
  };
@@ -177,14 +172,13 @@ module.exports = {
177
172
  Next.js 14 이하에서는 `experimental.turbo`를 사용합니다:
178
173
 
179
174
  ```js
180
- // next.config.js (Next.js 14 이하)
175
+ // next.config.js (Next.js 14 이하, web-framework 3.0+)
181
176
  module.exports = {
182
177
  experimental: {
183
178
  turbo: {
184
179
  resolveAlias: {
185
180
  '@apps-in-toss/web-framework': '@ait-co/devtools/mock',
186
- '@apps-in-toss/web-bridge': '@ait-co/devtools/mock',
187
- '@apps-in-toss/web-analytics': '@ait-co/devtools/mock',
181
+ '@apps-in-toss/webview-bridge': '@ait-co/devtools/mock',
188
182
  },
189
183
  },
190
184
  },
@@ -220,28 +214,26 @@ module.exports = {
220
214
  번들러의 `resolve.alias` 설정으로 직접 지정할 수도 있습니다:
221
215
 
222
216
  ```ts
223
- // vite.config.ts
217
+ // vite.config.ts (web-framework 3.0+)
224
218
  import { defineConfig } from 'vite';
225
219
 
226
220
  export default defineConfig({
227
221
  resolve: {
228
222
  alias: {
229
223
  '@apps-in-toss/web-framework': '@ait-co/devtools/mock',
230
- '@apps-in-toss/web-bridge': '@ait-co/devtools/mock',
231
- '@apps-in-toss/web-analytics': '@ait-co/devtools/mock',
224
+ '@apps-in-toss/webview-bridge': '@ait-co/devtools/mock',
232
225
  },
233
226
  },
234
227
  });
235
228
  ```
236
229
 
237
230
  ```js
238
- // webpack.config.js (Webpack은 절대 경로 필요)
231
+ // webpack.config.js (Webpack은 절대 경로 필요, web-framework 3.0+)
239
232
  module.exports = {
240
233
  resolve: {
241
234
  alias: {
242
235
  '@apps-in-toss/web-framework': require.resolve('@ait-co/devtools/mock'),
243
- '@apps-in-toss/web-bridge': require.resolve('@ait-co/devtools/mock'),
244
- '@apps-in-toss/web-analytics': require.resolve('@ait-co/devtools/mock'),
236
+ '@apps-in-toss/webview-bridge': require.resolve('@ait-co/devtools/mock'),
245
237
  },
246
238
  },
247
239
  };
package/dist/mcp/cli.js CHANGED
@@ -3097,26 +3097,19 @@ var InMemoryDiagnosticsCollector = class {
3097
3097
  * when the define is absent (unbundled test runs) and the runtime fallback
3098
3098
  * below also fails — diagnostics must never throw.
3099
3099
  *
3100
- * The old implementation resolved `@modelcontextprotocol/sdk/package.json` at
3101
- * runtime, but that subpath is NOT in the SDK's `exports` map, so the resolve
3102
- * threw `ERR_PACKAGE_PATH_NOT_EXPORTED` and this always returned `null` in a
3103
- * real bundle (issue #361). The build-time define sidesteps the exports gate.
3100
+ * Earlier attempts resolved `@modelcontextprotocol/sdk/package.json` (not in
3101
+ * the SDK `exports` map `ERR_PACKAGE_PATH_NOT_EXPORTED`) or the bare
3102
+ * `@modelcontextprotocol/sdk` main entry (also absent `MODULE_NOT_FOUND`),
3103
+ * so both this fallback AND the build-time define silently produced `null`
3104
+ * leaving `mcpVersion: null` in a real bundle (issue #361, observed live). The
3105
+ * fix resolves a subpath that IS exported (`./server/mcp.js`) and walks back to
3106
+ * the package root, in BOTH the build define and this fallback.
3104
3107
  *
3105
3108
  * Kept `async` for call-site compatibility (`Promise.all` at the caller); the
3106
3109
  * body is synchronous apart from the best-effort fallback.
3107
3110
  */
3108
3111
  async function readMcpSdkVersion() {
3109
- try {
3110
- const { createRequire } = await import("node:module");
3111
- const entry = createRequire(import.meta.url).resolve("@modelcontextprotocol/sdk");
3112
- const root = entry.slice(0, entry.indexOf("@modelcontextprotocol/sdk") + 25);
3113
- const { readFileSync } = await import("node:fs");
3114
- const raw = readFileSync(`${root}/package.json`, "utf8");
3115
- const parsed = JSON.parse(raw);
3116
- return typeof parsed.version === "string" ? parsed.version : null;
3117
- } catch {
3118
- return null;
3119
- }
3112
+ return "1.29.0";
3120
3113
  }
3121
3114
  /**
3122
3115
  * Returns the `@ait-co/devtools` package version injected at build time via
@@ -3124,7 +3117,7 @@ async function readMcpSdkVersion() {
3124
3117
  * some test environments that skip the build step).
3125
3118
  */
3126
3119
  function readDevtoolsVersion() {
3127
- return "0.1.53";
3120
+ return "0.1.54";
3128
3121
  }
3129
3122
  /**
3130
3123
  * Derives the next recommended action from a completed diagnostics snapshot.
@@ -3606,7 +3599,7 @@ function createDebugServer(deps) {
3606
3599
  const collector = collectorDep ?? new InMemoryDiagnosticsCollector();
3607
3600
  const server = new Server({
3608
3601
  name: "ait-debug",
3609
- version: "0.1.53"
3602
+ version: "0.1.54"
3610
3603
  }, { capabilities: { tools: { listChanged: true } } });
3611
3604
  server.setRequestHandler(ListToolsRequestSchema, () => {
3612
3605
  const conn = router.active;
@@ -4993,7 +4986,7 @@ function createDevServer(deps = {}) {
4993
4986
  const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
4994
4987
  const server = new Server({
4995
4988
  name: "ait-devtools",
4996
- version: "0.1.53"
4989
+ version: "0.1.54"
4997
4990
  }, { capabilities: { tools: {} } });
4998
4991
  server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
4999
4992
  server.setRequestHandler(CallToolRequestSchema, async (request) => {