@ait-co/devtools 0.1.52 → 0.1.54-beta.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 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
@@ -3092,19 +3092,26 @@ var InMemoryDiagnosticsCollector = class {
3092
3092
  }
3093
3093
  };
3094
3094
  /**
3095
- * Reads the `@modelcontextprotocol/sdk` package version from the installed
3096
- * package's `package.json`. Returns `null` on any error (missing file, JSON
3097
- * parse failure, etc.) diagnostics must never throw.
3098
- *
3099
- * Node-only — uses dynamic `import()` so it does not pollute the browser
3100
- * module graph.
3095
+ * Returns the `@modelcontextprotocol/sdk` version baked in at build time via
3096
+ * the `__MCP_SDK_VERSION__` define (see `tsdown.config.ts`). Returns `null`
3097
+ * when the define is absent (unbundled test runs) and the runtime fallback
3098
+ * below also fails — diagnostics must never throw.
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.
3104
+ *
3105
+ * Kept `async` for call-site compatibility (`Promise.all` at the caller); the
3106
+ * body is synchronous apart from the best-effort fallback.
3101
3107
  */
3102
3108
  async function readMcpSdkVersion() {
3103
3109
  try {
3104
3110
  const { createRequire } = await import("node:module");
3105
- const pkgPath = createRequire(import.meta.url).resolve("@modelcontextprotocol/sdk/package.json");
3111
+ const entry = createRequire(import.meta.url).resolve("@modelcontextprotocol/sdk");
3112
+ const root = entry.slice(0, entry.indexOf("@modelcontextprotocol/sdk") + 25);
3106
3113
  const { readFileSync } = await import("node:fs");
3107
- const raw = readFileSync(pkgPath, "utf8");
3114
+ const raw = readFileSync(`${root}/package.json`, "utf8");
3108
3115
  const parsed = JSON.parse(raw);
3109
3116
  return typeof parsed.version === "string" ? parsed.version : null;
3110
3117
  } catch {
@@ -3117,12 +3124,7 @@ async function readMcpSdkVersion() {
3117
3124
  * some test environments that skip the build step).
3118
3125
  */
3119
3126
  function readDevtoolsVersion() {
3120
- try {
3121
- const v = globalThis.__VERSION__;
3122
- return typeof v === "string" && v.length > 0 ? v : null;
3123
- } catch {
3124
- return null;
3125
- }
3127
+ return "0.1.54-beta.0";
3126
3128
  }
3127
3129
  /**
3128
3130
  * Derives the next recommended action from a completed diagnostics snapshot.
@@ -3604,7 +3606,7 @@ function createDebugServer(deps) {
3604
3606
  const collector = collectorDep ?? new InMemoryDiagnosticsCollector();
3605
3607
  const server = new Server({
3606
3608
  name: "ait-debug",
3607
- version: "0.1.52"
3609
+ version: "0.1.54-beta.0"
3608
3610
  }, { capabilities: { tools: { listChanged: true } } });
3609
3611
  server.setRequestHandler(ListToolsRequestSchema, () => {
3610
3612
  const conn = router.active;
@@ -4991,7 +4993,7 @@ function createDevServer(deps = {}) {
4991
4993
  const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
4992
4994
  const server = new Server({
4993
4995
  name: "ait-devtools",
4994
- version: "0.1.52"
4996
+ version: "0.1.54-beta.0"
4995
4997
  }, { capabilities: { tools: {} } });
4996
4998
  server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
4997
4999
  server.setRequestHandler(CallToolRequestSchema, async (request) => {