@ait-co/devtools 0.1.63 → 0.1.65

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 CHANGED
@@ -3938,7 +3938,7 @@ async function readMcpSdkVersion() {
3938
3938
  * some test environments that skip the build step).
3939
3939
  */
3940
3940
  function readDevtoolsVersion() {
3941
- return "0.1.63";
3941
+ return "0.1.65";
3942
3942
  }
3943
3943
  /**
3944
3944
  * Derives the next recommended action from a completed diagnostics snapshot.
@@ -4426,7 +4426,7 @@ function createDebugServer(deps) {
4426
4426
  const collector = collectorDep ?? new InMemoryDiagnosticsCollector();
4427
4427
  const server = new Server({
4428
4428
  name: "ait-debug",
4429
- version: "0.1.63"
4429
+ version: "0.1.65"
4430
4430
  }, { capabilities: { tools: { listChanged: true } } });
4431
4431
  server.setRequestHandler(ListToolsRequestSchema, () => {
4432
4432
  const conn = router.active;
@@ -4512,9 +4512,10 @@ function createDebugServer(deps) {
4512
4512
  const tunnelStatus = getTunnelStatus();
4513
4513
  if (!tunnelStatus.up || tunnelStatus.wssUrl === null) return mcpError("build_attach_url(mobile): relay wssUrl이 아직 설정되지 않았습니다. unplugin tunnel:{cdp:true}가 relay를 완전히 기동할 때까지 잠시 후 다시 시도하세요.");
4514
4514
  const secret = getTotpSecret();
4515
+ if (secret === void 0 || secret === "") return mcpError("build_attach_url(relay): TOTP secret(AIT_DEBUG_TOTP_SECRET)이 설정되지 않았습니다. relay 환경은 TOTP 인증이 필수입니다 — relay를 secret과 함께 재기동하세요.");
4515
4516
  let totpCode;
4516
4517
  let totpMeta;
4517
- if (secret !== void 0 && secret !== "") {
4518
+ {
4518
4519
  const now = Date.now();
4519
4520
  totpCode = generateTotp(secret, now);
4520
4521
  const STEP_SECONDS = 30;
@@ -4698,6 +4699,10 @@ function createDebugServer(deps) {
4698
4699
  const observedNote = observed.length > 0 ? ` — previously attached pages: [${observedUrls}]` : "";
4699
4700
  return `${baseText}\n\nNo page${deploymentId ? ` matching deploymentId=${deploymentId}` : ""} attached within ${timeoutSec}s${observedNote} — call list_pages to retry.`;
4700
4701
  };
4702
+ {
4703
+ const relaySecret = getTotpSecret();
4704
+ if (relaySecret === void 0 || relaySecret === "") return mcpError("build_attach_url(relay): TOTP secret(AIT_DEBUG_TOTP_SECRET)이 설정되지 않았습니다. relay 환경은 TOTP 인증이 필수입니다 — relay를 secret과 함께 재기동하세요.");
4705
+ }
4701
4706
  try {
4702
4707
  const tunnelForBuild = getTunnelStatus();
4703
4708
  const { attachUrl, relayUrl, authorityWarning, totp } = buildAttachUrl(schemeUrl, tunnelForBuild, getTotpSecret());
@@ -5633,6 +5638,12 @@ async function runLocalDebugServer(options = {}) {
5633
5638
  } catch (err) {
5634
5639
  logWarn("server.start", { msg: `QR HTTP 서버 시작 실패 (text QR fallback 사용): ${err instanceof Error ? err.message : String(err)}` });
5635
5640
  }
5641
+ const TOTP_REFRESH_INTERVAL_MS = 2e4;
5642
+ let totpRefreshHandle = null;
5643
+ totpRefreshHandle = setInterval(() => {
5644
+ if (lastAttachParts !== null) qrServer?.notifyStateChange();
5645
+ }, TOTP_REFRESH_INTERVAL_MS);
5646
+ totpRefreshHandle.unref();
5636
5647
  const server = createDebugServer({
5637
5648
  connection: router.active,
5638
5649
  router,
@@ -5655,6 +5666,7 @@ async function runLocalDebugServer(options = {}) {
5655
5666
  if (closed) return;
5656
5667
  closed = true;
5657
5668
  parentWatcher?.stop();
5669
+ if (totpRefreshHandle) clearInterval(totpRefreshHandle);
5658
5670
  router.stopWatcher();
5659
5671
  for (const family of router.bootedFamilies()) family.stop();
5660
5672
  server.close();
@@ -5668,6 +5680,7 @@ async function runLocalDebugServer(options = {}) {
5668
5680
  if (!closed) {
5669
5681
  closed = true;
5670
5682
  parentWatcher?.stop();
5683
+ if (totpRefreshHandle) clearInterval(totpRefreshHandle);
5671
5684
  router.stopWatcher();
5672
5685
  for (const family of router.bootedFamilies()) family.stop();
5673
5686
  lockHandle.release();
@@ -5773,6 +5786,12 @@ async function runMobileDebugServer(options = {}) {
5773
5786
  } catch (err) {
5774
5787
  logWarn("server.start", { msg: `QR HTTP 서버 시작 실패 (text QR fallback 사용): ${err instanceof Error ? err.message : String(err)}` });
5775
5788
  }
5789
+ const TOTP_REFRESH_INTERVAL_MS = 2e4;
5790
+ let totpRefreshHandle = null;
5791
+ totpRefreshHandle = setInterval(() => {
5792
+ if (lastAttachParts !== null) qrServer?.notifyStateChange();
5793
+ }, TOTP_REFRESH_INTERVAL_MS);
5794
+ totpRefreshHandle.unref();
5776
5795
  const server = createDebugServer({
5777
5796
  connection: router.active,
5778
5797
  router,
@@ -5795,6 +5814,7 @@ async function runMobileDebugServer(options = {}) {
5795
5814
  if (closed) return;
5796
5815
  closed = true;
5797
5816
  parentWatcher?.stop();
5817
+ if (totpRefreshHandle) clearInterval(totpRefreshHandle);
5798
5818
  router.stopWatcher();
5799
5819
  for (const family of router.bootedFamilies()) family.stop();
5800
5820
  server.close();
@@ -5808,6 +5828,7 @@ async function runMobileDebugServer(options = {}) {
5808
5828
  if (!closed) {
5809
5829
  closed = true;
5810
5830
  parentWatcher?.stop();
5831
+ if (totpRefreshHandle) clearInterval(totpRefreshHandle);
5811
5832
  router.stopWatcher();
5812
5833
  for (const family of router.bootedFamilies()) family.stop();
5813
5834
  lockHandle.release();
@@ -6276,7 +6297,7 @@ function createDevServer(deps = {}) {
6276
6297
  const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
6277
6298
  const server = new Server({
6278
6299
  name: "ait-devtools",
6279
- version: "0.1.63"
6300
+ version: "0.1.65"
6280
6301
  }, { capabilities: { tools: {} } });
6281
6302
  server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
6282
6303
  server.setRequestHandler(CallToolRequestSchema, async (request) => {