@ait-co/devtools 0.1.50 → 0.1.52

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.
@@ -104,7 +104,8 @@ function mcpError(message) {
104
104
  * @param toolName - 거부된 tool 이름.
105
105
  * @param requiredEnv - 해당 tool이 요구하는 환경 ('mock' | 'relay').
106
106
  * @param currentEnv - 현재 세션 환경.
107
- * @param reason - 환경이 결정된 근거 (EnvironmentReason 문자열).
107
+ * @param reason - 환경이 결정된 근거를 나타내는 파생 문자열
108
+ * (예: `derived:kind=relay,liveIntent=true`).
108
109
  */
109
110
  function tierRejectionError(toolName, requiredEnv, currentEnv, reason) {
110
111
  return mcpError(`${`${toolName}은 ${requiredEnv === "relay" ? "relay (실기기 연결)" : "mock (로컬 브라우저)"} 환경에서만 사용할 수 있습니다. 현재 환경: ${currentEnv === "relay" ? "relay" : "mock"} (${reason}). ${requiredEnv === "relay" ? "relay로 전환하려면 MCP_ENV=relay 설정 후 서버를 재시작하고 build_attach_url → QR 스캔으로 실기기를 attach하세요." : "mock으로 전환하려면 MCP_ENV=mock 설정 후 서버를 재시작하세요."}`}\n\n${`tool ${toolName} is available only in ${requiredEnv}. Current environment is ${currentEnv} (${reason}).`}`);
@@ -427,6 +428,31 @@ new Set([
427
428
  },
428
429
  availableIn: "both"
429
430
  },
431
+ {
432
+ name: "start_debug",
433
+ description: "Switches the active debug environment in-place (issue #348) — no Claude Code restart and no MCP re-handshake. One daemon holds both a local (env 1, mock SDK in a Chromium) and a relay (env 3/4, real-device Toss WebView over the Chii relay + cloudflared tunnel) connection at once; this tool flips which one every other tool reads from, lazily booting the requested family's infra on first use and keeping the inactive one warm so an existing attach survives the switch. After switching it emits notifications/tools/list_changed — call tools/list again to see the updated tool surface for the new environment.\n\nmodes:\n local-browser-dev / local-browser-cdp — local Chromium CDP attach (env 1, mock). Both route to the local connection; the names preserve dev-vs-cdp intent.\n relay-dev — real-device dogfood relay (env 3). Side-effect tools run unguarded.\n relay-live — real-device live/production relay (env 4, read-only debugging). Arms the LIVE guard: call_sdk/evaluate then require confirm: true. Entering relay-live ALSO requires confirm: true on this call to acknowledge LIVE intent.\n\nSwitching back to a local mode automatically disarms the LIVE guard.",
434
+ inputSchema: {
435
+ type: "object",
436
+ properties: {
437
+ mode: {
438
+ type: "string",
439
+ enum: [
440
+ "local-browser-dev",
441
+ "local-browser-cdp",
442
+ "relay-dev",
443
+ "relay-live"
444
+ ],
445
+ description: "Target environment to switch to. relay-live additionally requires confirm: true."
446
+ },
447
+ confirm: {
448
+ type: "boolean",
449
+ description: "Required when mode=relay-live — set true to acknowledge entering LIVE (env 4) debugging that can affect real users. Ignored for the other modes."
450
+ }
451
+ },
452
+ required: ["mode"]
453
+ },
454
+ availableIn: "both"
455
+ },
430
456
  {
431
457
  name: "get_diagnostics",
432
458
  description: "Returns a single-call server status snapshot so the agent can diagnose \"why is this not working?\" without calling multiple tools. Fields: mcpVersion (MCP SDK version), devtoolsVersion (@ait-co/devtools package version), tunnel (up/wssUrl/pid/startedAt), pages (list_pages result + lastSeenAt stats), lastAttachAt, lastDetachAt, recentErrors (last N server-side errors, PII/secret redacted), environment (kind: mock|relay-dev|relay-live, env: mock|relay backward-compat, reason, liveGuardActive: true when relay-live LIVE guard is active), serverLockHolder (pid + startedAt from the lock file, or null), nextRecommendedAction ({tool, reason} or null — the single next tool to call; in local-target mode tunnel.up=false is normal so \"restart\" is never recommended). All fields are nullable — missing data is null, not an error. debug-mode only — dev-mode (--mode=dev) does not support relay diagnostics. Tier C (both mock and relay). Call this first when debugging session state.",
@@ -923,7 +949,7 @@ function createDevServer(deps = {}) {
923
949
  const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
924
950
  const server = new Server({
925
951
  name: "ait-devtools",
926
- version: "0.1.50"
952
+ version: "0.1.52"
927
953
  }, { capabilities: { tools: {} } });
928
954
  server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
929
955
  server.setRequestHandler(CallToolRequestSchema, async (request) => {