text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import {zod} from '../third_party/index.js'; import type {Frame, JSHandle, Page, WebWorker} from '../third_party/index.js'; import type {ExtensionServiceWorker} from '../types.js'; import {ToolCategory} from './categ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type {Dialog} from '../../third_party/index.js'; import {zod} from '../../third_party/index.js'; import {ToolCategory} from '../categories.js'; import {definePageTool} from '../ToolDefinition.js'; export const...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>t of texts. Resolves when any value appears on the page.', ), ...timeoutSchema, }, blockedByDialog: true, verifyFilesSchema: [], handler: async (request, response, context) => { const page = request.page; await context.waitForTextOnPage( request.params.text, request.p...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import {zod, ajv, type JSONSchema7} from '../third_party/index.js'; import {ToolCategory} from './categories.js'; import {definePageTool} from './ToolDefinition.js'; export interface ToolDefinition { name: string;...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type {ParsedArguments} from '../bin/chrome-devtools-mcp-cli-options.js'; import * as consoleTools from './console.js'; import * as emulationTools from './emulation.js'; import * as extensionTools from './exten...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import {zod} from '../third_party/index.js'; import {ToolCategory} from './categories.js'; import {definePageTool} from './ToolDefinition.js'; export const listWebMcpTools = definePageTool({ name: 'list_webmcp_tools', descrip...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>DevTools.TraceEngine.Insights.Types.TraceInsightSets | null; } export function traceResultIsSuccess( x: TraceResult | TraceParseError, ): x is TraceResult { return 'parsedTrace' in x; } export interface TraceParseError { error: string; } export async function parseRawTraceBuffer( buffer: Uint8A...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> } export type Logger = ((...args: unknown[]) => void) | undefined; <|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type {SerializedAXNode, Viewport, Target} from './third_party/index.js'; export interface ExtensionServiceWorker { url: stri...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import child_process from 'node:child_process'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import process from 'node:process'; import {semver} from '../third_party/inde...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import fs from 'node:fs/promi<|fim_suffix|>st canonicalParent = await fs.realpath(parent); return path.join( canonicalParent, path.basename(current), ...missingSegments, ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ export function createIdGenerator() { let i = 1; return () =><|fim_suffix|> }; } export const stableIdSymbol = Symbol('stableIdSymbol'); export type WithSymbolId<T> = T & { [stableIdSymbol]?: number; }; <|fi...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> 'F19', 'F20', 'F21', 'F22', 'F23', 'F24', 'NumLock', 'ScrollLock', 'AudioVolumeMute', 'AudioVolumeDown', 'AudioVolumeUp', 'MediaTrackNext', 'MediaTrackPrevious', 'MediaStop', 'MediaPlayPause', 'Semicolon', 'Equal', 'NumpadEqual', 'Comma', 'Minus', 'Period', 'Slas...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>entPage, invalidPage} = resolvePageIndex( options.pageIdx, totalPages, ); const startIndex = currentPage * pageSize; const pageItems = items.slice(startIndex, startIndex + pageSize); const endIndex = startIndex + pageItems.length; return { items: pageItems, currentPage, tot...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Converts a given string to snake_case. * This function handles camelCase, PascalCase, and acronyms, including transitions between letters and numbers. * It uses Unicode-aware regular expressions (`\p{L}`, `\p...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Id<|fim_suffix|> */ export interface PaginationOptions { pageSize?: number; pageIdx?: number; } <|fim_middle|>entifier: Apache-2.0<|endoftext|>
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>release-please-end <|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ // If moved update release-p<|fim_middle|>lease config // x-release-please-start-version export const VERSION = '1.2.0'; // x-<|endoftext|>
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>rue}); try { const roots = [ {uri: pathToFileURL(workspacePath).href, name: 'workspace'}, ]; context.setRoots(roots); // Valid path within root await context.validatePath(path.join(workspacePath, 'test.txt')); await context.validatePath(works...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {readFile, rm} from 'node:fs/promises'; import {tmpdir} from 'node:os'; import {join} from 'node:path'; import {describe, it} from 'node:test'; import sinon from 'sinon'; imp...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {afterEach, beforeEach, describe, it} from 'node:test'; import type {Frame, HTTPRequest, Target, Protocol} from 'puppeteer-core'; import sinon from 'sinon'; import type {ListenerMap} from ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>s = collector.getData(extensionId); assert.strictEqual(logs.length, 10, 'Should limit logs to 10'); const firstLog = logs[0] as UncaughtError; assert.strictEqual( firstLog.details.exceptionId, 5, 'Oldest log should be Log 5', ); const lastLog = logs[logs.length - 1]...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {afterEach, describe, it} from 'node:test'; import sinon from 'sinon'; import {TextSnapshot} from '../src/TextSnapshot.js'; import type {TextSnapshotNode} from '../src/types....
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> }, }; const mockContext = sinon.createStubInstance(McpContext); mockContext.detectOpenDevToolsWindows.resolves(); const toolMutex = new Mutex(); const serverArgs = parseArguments('1.0.0', ['node', 'script.js'], { CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS: 'true', }); c...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import os from 'node:os'; import path from 'node:path'; import {describe, it} from 'node:test'; import {executablePath} from 'puppeteer'; import {detectDisplay, ensureBrowserConnect...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>ake(async filePath => { if (filePath.toString().includes('latest.json')) { return JSON.stringify({ version: VERSION, }); } throw new Error(`File not found: ${filePath}`); }); const unrefSpy = sinon.spy(); const spawnStub = sinon.stub(child_process, ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it} from 'node:test'; import {parseArguments} from '../src/bin/chrome-devtools-mcp-cli-options.js'; describe('cli args parsing', () => { const defaultArgs = { ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>ionId), 'Daemon should still not be running', ); }); }); describe('parsing', () => { it('handles MCP response with text format', async () => { const textResponse = {content: [{type: 'text' as const, text: 'test'}]}; assert.strictEqual(await handleResponse(textRespons...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>ath.join(pidDir, 'target_file.txt'); fs.writeFileSync(targetPath, 'original content', 'utf-8'); // Create a symlink at pidFilePath pointing to targetPath fs.symlinkSync(targetPath, pidFilePath); // Try to spawn the daemon const child = spawn(process.execPath, [DAEMON_SCRIPT_PATH], { ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX<|fim_suffix|>alizeArgs(options, argv); assert.deepStrictEqual(result, ['--foo', '--no-bar']); }); it('should handle array values', () => { const options: Record<string, YargsOptions> = {foo: {}}; const argv = { foo: ['val1', 'val2...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> sinon.assert.notCalled(pausedSpy); }); }); it('disables network domain', async () => { server.addHtmlRoute('/test', html`<div>Test</div>`); await withBrowser(async (browser, page) => { const manager = new UniverseManager(browser); await manager.init([page]); const targ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>al( startResult.status, 0, `start command failed: ${startResult.stderr}`, ); const result = await runCli(['take_screenshot'], sessionId); assert.strictEqual( result.status, 0, `take_screenshot command failed: ${result.stderr}`, ); assert( resu...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>ert.strictEqual( result.status, 0, `start command failed: ${result.stderr}`, ); assert( result.stderr.includes('chrome-devtools-mcp exposes content'), 'Disclaimer not found in stderr on start', ); }); }); <|fim_prefix|>/** * @license * Copyright 2026 Google LL...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license *<|fim_suffix|>}); it('can start and stop the daemon', async () => { await assertDaemonIsNotRunning(sessionId); const startResult = await runCli(['start'], sessionId); assert.strictEqual( startResult.status, 0, `start command failed: ${startResult.stderr}...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>rt command failed: ${startResult.stderr}`, ); await assertDaemonIsRunning(sessionId); }); }); <|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import crypto from 'node:crypto'; import {describe, it, afterEac...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {spawn, type ChildProcess, type SpawnOptions} from 'node:child_process'; import http from 'node:http'; import type {AddressInfo} from 'node:net'; import path from 'node:path'; import {descri...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import {describe, it} from 'node:test'; import {SymbolizedError} from '../../src/devtools/DevtoolsUtils.js'; import {ConsoleFormatter} from '../../src/formatters/ConsoleFormatter.js'; import {UncaughtError} from '../...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>{ const grouped = ConsoleFormatter.groupConsecutive([]); assert.strictEqual(grouped.length, 0); }); it('handles single message', async () => { const msgs = await Promise.all([makeFormatter(1, 'log', 'solo')]); const grouped = ConsoleFormatter.groupConsecutive(msgs); ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>ter.formatRetainingPaths(mockRetainingPaths); const expected = [ '<- @10 ClassA via property foo (distance: 2)', ' <- @20 ClassB via element bar (distance: 1)', ].join('\n'); assert.strictEqual(result, expected); }); }); }); <|fim_prefix|>/** * @license * Copyri...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it, beforeEach, afterEach} from 'node:test'; import sinon from 'sinon'; import {IssueFormatter} from '../../src/for<|fim_suffix|>onStub .withArgs('mock.md'...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> method: 'GET', url: 'http://example.com', status: '200', selectedInDevToolsUI: undefined, requestHeaders: { 'content-size': '10', }, requestBody: 'request', requestBodyFilePath: undefined, responseHeaders: {}, responseBody:...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it} from 'node:test'; import type {ElementHandle} from 'puppeteer-core'; import {SnapshotFormatter} from '../../src/formatters/SnapshotFormatter.js'; import type {...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import {describe, it} from 'node:test'; import {Client} from '@modelcontextprotocol/sdk/client/index...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> 'Failed to fetch', 'Fetch should still be blocked after audit', ); }, { blockedUrlPattern, }, ); }); it('throws error when trying to emulate network conditions while blocklist is configured', async () => { const blockedUrlPattern = ['*://*/*']; ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import {describe, it} from 'node:test'; import {pathToFileURL} from 'node:url'; import {wit...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> html`<h1>404 - Not Found</h1><p>The requested page does not exist.</p>`, ); } } restore() { this.#routes = {}; } start(): Promise<void> { return new Promise(res => { this.#server.listen(this.#port, res); }); } stop(): Promise<void> { return new Promi...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import '../src/polyfill.js'; import path from 'node:path'; import {before, it} from 'node:test'; import {overrideDevToolsGlobals} from '../src/devtools/DevtoolsUtils.js'; before(() => { overrideDevToolsGlobals({ loadResour...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>hrome subprocess, stdin EOF // would close the event loop on its own and shutdown would look fine // even with broken handlers. await rpc(child, { method: 'tools/call', params: { name: 'navigate_page', arguments: {url: 'about:blank'}, }, }); } describe('shutdown', () => { ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>ccapurple;">View Port overflow</div>', }, button: { html: '<button>I am button click me</button>', }, }; <|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ interface ScreenshotData { html: string; } export const screenshots: Record<string, S...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>rns instance after initialization', () => { const logger = ClearcutLogger.initialize({ persistence: mockPersistence, appVersion: '1.0.0', watchdogClient: mockWatchdogClient, }); assert.strictEqual(ClearcutLogger.get(), logger); }); it('throws error if ini...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>; assert.ok( cmdArgs.includes('--os-type=2'), 'Arguments should include OS type', ); assert.strictEqual( spawnStub.firstCall.args[2].detached, true, 'Process should be spawned as detached', ); }); it('passes log-file argument if provided', () => { new...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>false); assert.equal(usage.flag_with_default_present, undefined); }); it('logs presence when no default exists and user provides value', () => { // Case 3: No default, user provides value. const args = {stringFlag: 'value'}; const usage = computeFlagUsage(args, mockOptions...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it} from 'node:test'; import { applyToExistingMetrics, generateToolMetrics, validateEnumHomogeneity, } from '../../src/telemetry/metricsRegistry.js'; import {...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import crypto from 'node:crypto'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import {describe, it, afterEach, beforeEach} from 'node:te...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>trictEqual( transformArgName('ZodString', 'my3pParam'), 'my3p_param_length', ); }); }); <|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it} from 'node:test'; import { bucketizeLa...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import crypto from 'node:crypto'; import {describe, it, afterEach, beforeEach} from 'node:test'; import sinon from 'sinon'; import {OsType} from '../../../s<|fim_suffix|>.parse( ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> }); }); <|fim_prefix|>/** * @license * Copyright 2025 Googl<|fim_middle|>e LLC * SPDX-License-Identifier: Apache-2.0 */ import fs from 'node:fs'; import path from 'node:path'; import {describe, it} from 'node:test'; describe('THIRD_PARTY_NOTICES', () => { it('matches snapshot if exists', t => { ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import path from 'node:path'; import {before, describe, it} from 'node:test'; import type {Dialog} from 'puppeteer-core'; import type {ParsedArguments} from '../../src/bin/chrome-de...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> page: context.getSelectedMcpPage(), }, response, context, ); assert.strictEqual(context.getSelectedMcpPage().colorScheme, null); assert.strictEqual( await page.evaluate( () => window.matchMedia('(prefers-color-scheme: dark)')...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> const extensionId = extractExtensionId(response); const installSpy = sinon.spy(context, 'installExtension'); response.resetResponseLineForTesting(); await reloadExtension.handler( {params: {id: extensionId!}}, response, context, ); a...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
console.log('Hello from content script!'); <|endoftext|>
fim
ChromeDevTools/chrome-devtools-mcp
javascript
<|fim_suffix|>his is a warning from Service Worker'); <|fim_prefix|>// Minimal service worker for testing console.log('Service Worker starting...'); console.warn('<|fim_middle|>T<|endoftext|>
fim
ChromeDevTools/chrome-devtools-mcp
javascript
<|fim_suffix|>rror); <|fim_prefix|>chrome.sidePanel .setPanelBehavior(<|fim_middle|>{openPanelOnActionClick: true}) .catch(console.e<|endoftext|>
fim
ChromeDevTools/chrome-devtools-mcp
javascript
<|fim_prefix|>chrome.action.<|fim_suffix|>r(tab => { console.log('Action clicked'); }); <|fim_middle|>onClicked.addListene<|endoftext|>
fim
ChromeDevTools/chrome-devtools-mcp
javascript
<|fim_suffix|> }); describe('fill', () => { it('fills out an input', async () => { await withMcpContext(async (response, context) => { const page = context.getSelectedPptrPage(); await page.setContent(html`<input />`); context.getSelectedMcpPage().textSnapshot = await TextSnapshot....
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert/strict'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import {describe, it} from 'node:test'; import {lighthouseAudit} from '../../src/too...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>t getHeapSnapshotEdges.handler( {params: {filePath, nodeId: 25341, pageSize: 2}}, response, context, ); const responseData = await response.handle( getHeapSnapshotEdges.name, context, ); const output = responseData.content ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it} from 'node:test'; import { getNetworkRequest, listNetworkRequests, } from '../../src/tools/network.js'; import {serverHooks} from '../server.js'; import { ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import path from 'node:path'; import {afterEach, describe, it} from 'node:test'; import type {Dialog} from 'puppeteer-core'; import sinon from 'sinon'; import type {ParsedArguments}...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> assert.notStrictEqual(url, `${baseUrl}/c.html`); assert.ok( response.responseLines.some(line => line.includes('Unable to navigate'), ), ); }); }); }); <|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ i...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>dev-with-commit.json.gz'); // Use a unique URL to avoid cache issues const jsonString = new TextDecoder().decode(rawData); const modifiedJsonString = jsonString.replaceAll( 'https://web.dev/', 'https://mobile.web.dev/', ); const modifiedData = new TextEncoder(...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {describe, it, afterEach} from 'node:test'; import sinon from 'sinon'; import type {ParsedArguments} from '../../src/bin/chrome-devtools-mcp-cli-options.js'; import {startScr...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>re = screenshots.basic; const page = context.getSelectedPptrPage(); await page.setContent(fixture.html); await assert.rejects( screenshot.handler( { params: {format: 'png', filePath}, page: context.getSel...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import path from 'node:path'; import {describe, it} from 'node:test'; import type {ParsedArguments} from '../../src/bin/chrome-devtools-mcp-cli-options.js'; import {TextSnapshot} fro...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import fs from 'node:fs'; import path from 'node:path'; import {describe, it} from 'node:test'; import {evaluate, navigate, screenshot} from '../../../src/tools/slim/tools.js'; impor...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> text: ['Hello World'], }, page: context.getSelectedMcpPage(), }, response, context, ); await page.setContent( html`<main><span>Hello</span><span> </span><div>World</div></main>`, ); await handlePromise; ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> { name: 'test-tool', description: 'test tool description', inputSchema: {}, }, ], }, ]; await page.pptrPage.evaluate(() => { window.__dtmcp = { execute...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|>WebMCPTesting,DevToolsWebMCPSupport']}, {categoryExperimentalWebmcp: true} as ParsedArguments, ); }); it('throws if input is invalid', async () => { await withMcpContext( async (response, context) => { await assert.rejects( async () => { ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> 'fixtures', filePath, ), ); const decompressedData = zlib.gunzipSync(compressedData); const jsonString = decompressedData.toString('utf-8'); const jsonObject = JSON.parse(jsonString); const finalBuffer = Buffer.from(JSON.stringify(jsonObject)); const uint8Array = new...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_suffix|> const rawData = loadTraceAsBuffer('basic-trace.json.gz'); const result = await parseRawTraceBuffer(rawData); if ('error' in result) { assert.fail(`Unexpected parse failure: ${result.error}`); } assert.ok(result?.parsedTrace); assert.ok(result?.insights); }); it('can format...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import {describe, it} from 'node:test'; import {ensureExtension, resolveCanonicalPath} from...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
<|fim_prefix|>/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import assert from 'node:assert'; import {spawn} from 'node:child_process'; import path from 'node:path'; import type {CallToolResult} from '@modelcontextprotocol/sdk/types.js'; import logger from 'debug'; import typ...
fim
ChromeDevTools/chrome-devtools-mcp
typescript
#!/usr/bin/env python3 """PreToolUse hook for the investigate-ci reduced-prompt profile. Auto-approves ONLY the exact safe command shapes the skill runs every time, so they need no allow-list entry (whose wildcard tail cannot be constrained) and no prompt. Two families: 1. The play.clickhouse.com read-only SELECT h...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """Table-driven tests for allow_investigate_cmds.py (the investigate-ci PreToolUse hook). The hook is the durable boundary for the promptless play.clickhouse.com query and fetch_ci_report.js paths, so every allow/deny case is pinned here. A future regex edit that re-opens one of th...
fim
ClickHouse/ClickHouse
python
<|fim_suffix|>> int: if len(sys.argv) < 2: sys.exit(__doc__) path = sys.argv[1] out = sys.argv[2] if len(sys.argv) > 2 else "clickhouse.elf" data = open(path, "rb").read() number_of_files, start_of_files = struct.unpack_from("<QQ", data, len(data) - 16) print(f"number_of_files={number_o...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>"""Shared helpers used by every script in this skill. Lives next to the per-step scripts so they can `from _common import …`. Anything that previously had to be defined in three files (the fault/no-fault matcher, `to_float`, `iso_week`, `classify`, the `KEEPER_SKILL_THRESHOLD` window edge) is consolidate...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """Per-(scenario, backend, metric) Δ between two arbitrary commit SHAs. Use case: "compare commit `abcd1234` vs `efgh5678` <|fim_suffix|>" — the two SHAs need not be a PR's pre/post pair. For PR validation, use `compute_deltas` instead (it handles the kind-matched fallback baseline...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """Compute baseline-window vs current-window medians for every metric on every scenario+backend, then emit per-scenario gain tables. Outputs: cumulative_gains.tsv — one row per (scenario, backend, metric) cumulative_gains_summary.tsv — pivoted view per scenario+backend with ke...
fim
ClickHouse/ClickHouse
python
#!/usr/bin/env python3 """Join the five staging TSVs into a wide per-(scenario, backend, commit_sha) metrics table. Output: `merged_metrics.tsv`, one row per (scenario, backend, commit), with one column per tracked metric. Inputs (all under `staging/`, produced by the SQL queries in `queries/`): 1. `bench_summary.t...
fim
ClickHouse/ClickHouse
python
#!/usr/bin/env python3 """Per-(scenario, backend, metric) noise characterization. For each (scenario, backend) group in `merged_metrics.tsv`, computes the median, sample stddev, coefficient of variation (`cv = stddev / |median|`), and p95 of every metric in `_common.HEADLINE_METRICS` across the available runs. Output:...
fim
ClickHouse/ClickHouse
python
#!/usr/bin/env python3 """Flat TSV: one row per (PR, scenario, backend, metric) with pre, post, delta_abs, delta_pct. `delta_abs` is the unitful absolute change (`post - pre`); `delta_pct` is the relative change in percent. The output file is `per_pr_metrics_long.tsv` and its header is the canonical schema for downstr...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """ Per-PR isolated effect, using PR-branch stress runs. Method: 1. Each PR branch's last commit's stress run = "PR HEAD" measurement. 2. Pool ALL PR branch runs (across all PRs touching Keeper) by week. 3. Compute the median of all-PR-branch runs in the SAME week as the PR H...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """Build PR -> first-post-merge nightly mapping with co-merged PR list. The window edge (`THRESHOLD`) is sourced from `_common.KEEPER_SKILL_THRESHOLD` so all scripts agree on which PRs are in-window.""" import csv import datetime import sys from pathlib import Path from _common im...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """ Compute per-PR and per-nightly deltas from merged_metrics.tsv + pr_to_nightly.tsv. Outputs: - per_pr_scenario_deltas.tsv : (pr, scenario, backend, metrics + Δ) - per_pr_summary.tsv : one row per PR with worst regression / best improvement - per_nightly_summary.tsv : ...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#!/usr/bin/env python3 """Single CLI entrypoint for the keeper-stress-analysis pipeline. Usage: python3 keeper_s<|fim_suffix|>and operates on files in this script's directory (where `rebuild.sh` copies the SQL queries and scripts before running). """ import sys import build_commit_diff import build_...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>"""Tests for the s<|fim_suffix|>arseMergedAtTest(unittest.TestCase): """`parse_merged_at` is the single guard for empty `mergedAt` in `pr_meta.tsv`. `gh pr list --state all` returns open PRs with empty `mergedAt`, so the loader must skip them with a clear message instead of aborting the pi...
fim
ClickHouse/ClickHouse
python
<|fim_suffix|>FailureStatus(t.status) ); } // If this is a single report being fetched (part of multi-report fetch), just return data if (options.isSingleReport) { return { testResults, artifactLinks, jsonData }; } // Print results for standalone report console.log('=== Test Result...
fim
ClickHouse/ClickHouse
javascript
<|fim_prefix|>#!/usr/bin/env python3 """ Fetch ClickHouse CI performance comparison results. Fetches the machine-readable all-query-metrics.tsv from S3 for each performance comparison shard, then uses clickhouse-local to filter, classify, and format the results. Usage: python3 fetch_perf_report.py <url> [options] ...
fim
ClickHouse/ClickHouse
python
<|fim_prefix|>#pragma once #include <algorithm> /// Replacement for std::aligned_union which is deprecated in C++23 template<std::size_t len, class... Types> struct AlignedUnion { static constexpr std::size_t alignment_value = std::max({alignof(Types)...}); struct Type { alignas(alignment_value) c...
fim
ClickHouse/ClickHouse
c
<|fim_suffix|>) constexpr bool operator<=(const T & a, const BFloat16 & b) { return static_cast<BFloat16CommonType<T>>(a) <= static_cast<BFloat16CommonType<T>>(Float32(b)); } constexpr inline bool operator<=(BFloat16 a, BFloat16 b) { return Float32(a) <= Float32(b); } template <typename T> requires(!std::is_s...
fim
ClickHouse/ClickHouse
c
<|fim_prefix|>#pragma once #include <cstdint> #include <vector> #include <chrono> #include <mutex> #include <condition_variable> #include <base/defines.h> #include <base/MoveOrCopyIfThrow.h> /** Pool for limited size objects that cannot be used from different threads simultaneously. * The main use case is to have ...
fim
ClickHouse/ClickHouse
c
<|fim_suffix|> after 2105 */ STRONG_TYPEDEF(Int32, ExtendedDayNum) <|fim_prefix|>#pragma once #include <base/types.h> #include <base/strong_typedef.h> /** Repres<|fim_middle|>ents number of days since 1970-01-01. * See DateLUTImpl for usage examples. */ STRONG_TYPEDEF(UInt16, DayNum) /** Represent number of day...
fim
ClickHouse/ClickHouse
c