Chrome DevTools for coding agents
chore: forward disclaimers (#1082)
Alex Rudenkobedfd5d8860d
diff --git a/src/daemon/client.ts b/src/daemon/client.tsindex f741ed64..de18d26d 100644--- a/src/daemon/client.ts+++ b/src/daemon/client.ts@@ -9,6 +9,7 @@ import fs from 'node:fs';import net from 'node:net';import {logger} from '../logger.js';+import {START_INDICATOR} from '../server.js';import type {CallToolResult} from '../third_party/index.js';import {PipeTransport} from '../third_party/index.js';@@ -56,7 +57,7 @@ export async function startDaemon(mcpArgs: string[] = []) {logger('Starting daemon...');const child = spawn(process.execPath, [DAEMON_SCRIPT_PATH, ...mcpArgs], {detached: true,- stdio: 'ignore',+ stdio: ['ignore', 'ignore', 'pipe'],cwd: process.cwd(),});@@ -72,8 +73,19 @@ export async function startDaemon(mcpArgs: string[] = []) {waitForFile(getPidFilePath()).then(resolve).catch(reject);});- child.unref();logger(`Pid file found ${getPidFilePath()}`);++ child.stderr.pipe(process.stderr);+ await new Promise<void>(resolve => {+ child.stderr.on('data', data => {+ if (data.toString().includes(START_INDICATOR)) {+ child.stderr.unpipe(process.stderr);+ child.stderr.destroy();+ child.unref();+ resolve();+ }+ });+ });}const SEND_COMMAND_TIMEOUT = 60_000; // msdiff --git a/src/main.ts b/src/main.tsindex 4954ae7e..4ae3f758 100644--- a/src/main.ts+++ b/src/main.ts@@ -10,7 +10,7 @@ import process from 'node:process';import {cliOptions, parseArguments} from './cli.js';import {logger, saveLogsToFile} from './logger.js';-import {createMcpServer} from './server.js';+import {createMcpServer, START_INDICATOR} from './server.js';import {computeFlagUsage} from './telemetry/flagUtils.js';import {StdioServerTransport} from './third_party/index.js';import {VERSION} from './version.js';@@ -56,6 +56,8 @@ Google collects usage statistics to improve Chrome DevTools MCP. To opt-out, runFor more details, visit: https://github.com/ChromeDevTools/chrome-devtools-mcp#usage-statistics`,);}++ console.error(START_INDICATOR);};const {server, clearcutLogger} = await createMcpServer(args, {diff --git a/src/server.ts b/src/server.tsindex 747f60c4..def4a83d 100644--- a/src/server.ts+++ b/src/server.ts@@ -256,3 +256,5 @@ export async function createMcpServer(return {server, clearcutLogger};}++export const START_INDICATOR = 'Server started.';