@ait-co/devtools 0.1.57 → 0.1.58
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/dist/mcp/cli.js +17 -17
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.js +10 -10
- package/dist/mcp/server.js.map +1 -1
- package/dist/panel/index.js +2 -2
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -437,7 +437,7 @@ new Set([
|
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
439
|
name: "start_debug",
|
|
440
|
-
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 — env 1: desktop Chromium with the MOCK SDK and a local CDP attach. Side-effect tools (call_sdk/evaluate) run unguarded against the mock; nothing touches a real device or real users. No prerequisites — the default, always-available environment for state/contract and visual-layout work.\n relay-sandbox — env 2: a real-device PWA (real WebKit engine, MOCK SDK) over an external Chii relay
|
|
440
|
+
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 — env 1: desktop Chromium with the MOCK SDK and a local CDP attach. Side-effect tools (call_sdk/evaluate) run unguarded against the mock; nothing touches a real device or real users. No prerequisites — the default, always-available environment for state/contract and visual-layout work.\n relay-sandbox — env 2: a real-device PWA (real WebKit engine, MOCK SDK) over an external Chii relay. CDP covers real-device WebKit DOM, console, exceptions, and safe-area observation; call_sdk still hits the mock (SDK fidelity needs relay-staging). liveIntent off — dev-intent, LIVE guard inactive, side-effect tools run unguarded against the mock. Only the dual-connection daemon can enter relay-sandbox in-place; a single-connection session rejects it with \"동적 전환할 수 없습니다 … relay-sandbox 모드로 재시작하세요\" — follow that hint and restart the MCP server in relay-sandbox mode rather than retrying. Prerequisites: both AIT_RELAY_BASE_URL (the relay base the unplugin emits when started with tunnel:{cdp:true}, used for the CDP attach) and AIT_TUNNEL_BASE_URL (the dev-server tunnel host, required by build_attach_url to render the launcher QR) must be set before the MCP server starts — the unplugin does not auto-forward either; set them explicitly. Both carry relay/tunnel hosts (secret-class) — keep them out of logs.\n relay-staging — env 3: a real-device Toss WebView dogfood build with the REAL SDK over the intoss-private relay. The first environment where call_sdk exercises the genuine native bridge. Side-effect tools run unguarded (dogfood, not released to real users). Prerequisite: a dogfood candidate bundle built with `RELEASE_CHANNEL=dogfood ait build`, then uploaded with `ait deploy` (add `--scheme-only` to print the resulting intoss-private://…?_deploymentId=… deep-link); open that deep-link/QR on the device to cold-load the bundle with the relay injected. Unlike env 2, env 3 is NOT a dev-server tunnel — it is a deployed bundle reached via the intoss-private scheme, so `pnpm dev` plays no part here.\n relay-live — env 4: the REVIEW-PASSED, released production runtime with the REAL SDK over the intoss relay — real end users are on the other side. Read-only debugging is the intent: the LIVE guard is armed, so call_sdk/evaluate require confirm:true per call, and ENTERING relay-live ALSO requires confirm:true on this call. Use it only to observe a shipped regression; verify fixes in relay-staging first.\n\nSwitching back to local-browser automatically disarms the LIVE guard.\n\nFor a relay mode (relay-sandbox/relay-staging/relay-live), also pass projectRoot — the absolute mini-app project root — so the daemon can read the relay auth secret from <projectRoot>/.ait_relay (read-only; the daemon never mints it). Omit it for local-browser.",
|
|
441
441
|
inputSchema: {
|
|
442
442
|
type: "object",
|
|
443
443
|
properties: {
|
|
@@ -465,8 +465,8 @@ new Set([
|
|
|
465
465
|
availableIn: "both"
|
|
466
466
|
},
|
|
467
467
|
{
|
|
468
|
-
name: "
|
|
469
|
-
description: "
|
|
468
|
+
name: "get_debug_status",
|
|
469
|
+
description: "Reports the current debug session state — which environment/mode is active, whether a page is attached, and a full diagnostic snapshot — in one call. Use this any time to answer \"what mode am I in right now?\" or \"why is this not working?\" without chaining 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|relay-mobile, 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).",
|
|
470
470
|
inputSchema: {
|
|
471
471
|
type: "object",
|
|
472
472
|
properties: { recent_errors_limit: {
|
|
@@ -592,13 +592,13 @@ function getOperationalEnvironment(source) {
|
|
|
592
592
|
* backward-compatible alias of `AIT.getMockState`.
|
|
593
593
|
*
|
|
594
594
|
* Issue #305 (M2-1) — dev/debug tool-surface unification:
|
|
595
|
-
* dev-mode now also exposes `list_pages`, `
|
|
595
|
+
* dev-mode now also exposes `list_pages`, `get_debug_status`, `measure_safe_area`,
|
|
596
596
|
* and `call_sdk` so the docs/qa/scenarios.md acceptance sequence
|
|
597
597
|
* `list_pages → measure_safe_area → call_sdk` works in dev mode without
|
|
598
598
|
* "Unknown tool" failures.
|
|
599
599
|
*
|
|
600
600
|
* - `list_pages` — shim: returns the Vite dev URL as a single-entry array.
|
|
601
|
-
* - `
|
|
601
|
+
* - `get_debug_status` — dumps dev-mode server state (endpoint URL, last fetch
|
|
602
602
|
* error, reachability, mode/environment metadata).
|
|
603
603
|
* - `measure_safe_area`— reads safeAreaInsets from the mock state snapshot
|
|
604
604
|
* (source: 'mock-vite').
|
|
@@ -691,8 +691,8 @@ const DEV_TOOL_DEFINITIONS = [
|
|
|
691
691
|
availableIn: "both"
|
|
692
692
|
},
|
|
693
693
|
{
|
|
694
|
-
name: "
|
|
695
|
-
description: "dev-mode:
|
|
694
|
+
name: "get_debug_status",
|
|
695
|
+
description: "dev-mode: reports the current dev session state — Vite endpoint URL, last fetch timestamp/error, mock state endpoint reachability, mode (\"dev\"), and environment metadata — in one call. Use this any time to confirm what the dev server is doing or when its connection is suspect. In debug mode this returns tunnel/relay/attach status instead.",
|
|
696
696
|
inputSchema: {
|
|
697
697
|
type: "object",
|
|
698
698
|
properties: { recent_errors_limit: {
|
|
@@ -868,7 +868,7 @@ function buildDevListPagesResult(devtoolsUrl) {
|
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
870
|
/**
|
|
871
|
-
* Builds the `
|
|
871
|
+
* Builds the `get_debug_status` dev-mode response.
|
|
872
872
|
* Probes the mock state endpoint reachability and returns server metadata.
|
|
873
873
|
*/
|
|
874
874
|
async function buildDevDiagnostics(devtoolsUrl, stateEndpoint, fetchImpl) {
|
|
@@ -960,7 +960,7 @@ function createDevServer(deps = {}) {
|
|
|
960
960
|
const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
|
|
961
961
|
const server = new Server({
|
|
962
962
|
name: "ait-devtools",
|
|
963
|
-
version: "0.1.
|
|
963
|
+
version: "0.1.58"
|
|
964
964
|
}, { capabilities: { tools: {} } });
|
|
965
965
|
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
|
|
966
966
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -978,7 +978,7 @@ function createDevServer(deps = {}) {
|
|
|
978
978
|
}
|
|
979
979
|
switch (name) {
|
|
980
980
|
case "list_pages": return envelopeResult("list_pages", buildDevListPagesResult(devtoolsUrl));
|
|
981
|
-
case "
|
|
981
|
+
case "get_debug_status": return envelopeResult("get_debug_status", await buildDevDiagnostics(devtoolsUrl, stateEndpoint, (url) => fetch(url)));
|
|
982
982
|
case "measure_safe_area": return envelopeResult("measure_safe_area", await buildDevMeasureSafeArea(aitSource));
|
|
983
983
|
case "call_sdk": {
|
|
984
984
|
const sdkName = request.params.arguments?.name;
|