chore: move tool schema to mcp as it is used by all servers (#887)

This commit is contained in:
Pavel Feldman
2025-08-13 18:23:25 -07:00
committed by GitHub
parent 12942b81d6
commit badfd82202
7 changed files with 46 additions and 35 deletions

View File

@@ -17,8 +17,6 @@
import os from 'node:os';
import path from 'node:path';
import type { FullConfig } from '../config.js';
export function cacheDir() {
let cacheDirectory: string;
if (process.platform === 'linux')
@@ -32,10 +30,6 @@ export function cacheDir() {
return path.join(cacheDirectory, 'ms-playwright');
}
export async function userDataDir(browserConfig: FullConfig['browser']) {
return path.join(cacheDir(), 'ms-playwright', `mcp-${browserConfig.launchOptions?.channel ?? browserConfig?.browserName}-profile`);
}
export function sanitizeForFilePath(s: string) {
const sanitize = (s: string) => s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, '-');
const separator = s.lastIndexOf('.');