@playdrop/playdrop-cli 0.12.15 → 0.12.17

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.12.8",
3
- "build": 7,
3
+ "build": 10,
4
4
  "runtimeSdkVersion": "0.12.5",
5
5
  "runtimeSdkBuild": 2,
6
6
  "clients": {
@@ -69,6 +69,7 @@ export declare function buildClaudeExecArgs(input: {
69
69
  effort?: string | null;
70
70
  chrome?: boolean;
71
71
  playwrightMcp?: boolean;
72
+ playwrightMcpConfigPath?: string | null;
72
73
  workspaceDir?: string | null;
73
74
  denyReadRoots?: string[] | null;
74
75
  pluginDir?: string | null;
@@ -492,23 +492,38 @@ function buildClaudeExecArgs(input) {
492
492
  if (input.chrome && input.playwrightMcp) {
493
493
  throw new Error('claude_exec_browser_mode_conflict');
494
494
  }
495
+ const playwrightMcpConfigPath = typeof input.playwrightMcpConfigPath === 'string'
496
+ ? input.playwrightMcpConfigPath.trim()
497
+ : '';
498
+ if (input.playwrightMcp && !playwrightMcpConfigPath) {
499
+ throw new Error('playwright_mcp_config_path_missing');
500
+ }
495
501
  const permissionSettings = buildClaudePermissionSettings({
496
502
  workspaceDir: input.workspaceDir,
497
503
  denyReadRoots: input.denyReadRoots ?? [],
498
504
  });
499
505
  const permissionMode = input.chrome || input.playwrightMcp ? 'bypassPermissions' : 'acceptEdits';
506
+ // MCP tools are deferred behind ToolSearch in the Claude CLI; without it in the toolset a
507
+ // session cannot reach any MCP server's tools no matter what --mcp-config provides.
500
508
  const tools = input.chrome
501
509
  ? [...CLAUDE_BASE_TOOL_NAMES, ...CLAUDE_CHROME_TOOL_NAMES].join(',')
502
- : CLAUDE_BASE_TOOL_NAMES.join(',');
510
+ : input.playwrightMcp
511
+ ? [...CLAUDE_BASE_TOOL_NAMES, 'ToolSearch'].join(',')
512
+ : CLAUDE_BASE_TOOL_NAMES.join(',');
503
513
  const allowedPermissionRules = buildClaudeAllowedPermissionRules(input.workspaceDir);
504
514
  const allowedTools = input.chrome
505
515
  ? [...allowedPermissionRules, ...CLAUDE_CHROME_TOOL_NAMES]
506
516
  : input.playwrightMcp
507
517
  ? [...allowedPermissionRules, PLAYWRIGHT_MCP_ALLOWED_TOOL_RULE]
508
518
  : allowedPermissionRules;
519
+ // --safe-mode disables ALL MCP servers, including ones passed explicitly via --mcp-config
520
+ // (verified empirically on claude 2.1.207). Playwright judge sessions therefore drop it:
521
+ // their CLAUDE_CONFIG_DIR is an isolated per-task directory with no user customizations,
522
+ // so the surface --safe-mode guards is already empty, while --strict-mcp-config and the
523
+ // permission rules below stay in force.
509
524
  const args = [
510
525
  '-p',
511
- '--safe-mode',
526
+ ...(input.playwrightMcp ? [] : ['--safe-mode']),
512
527
  '--strict-mcp-config',
513
528
  '--model',
514
529
  model,
@@ -532,7 +547,7 @@ function buildClaudeExecArgs(input) {
532
547
  args.unshift('--chrome');
533
548
  }
534
549
  if (input.playwrightMcp) {
535
- args.push('--mcp-config', JSON.stringify(buildPlaywrightMcpServerConfig()));
550
+ args.push('--mcp-config', playwrightMcpConfigPath);
536
551
  }
537
552
  const pluginDir = typeof input.pluginDir === 'string' ? input.pluginDir.trim() : '';
538
553
  if (pluginDir) {
@@ -2105,6 +2105,11 @@ async function runClaude(input) {
2105
2105
  const screenshotCollector = input.enableChrome || input.enablePlaywrightMcp
2106
2106
  ? (0, instrument_evidence_1.createWorkerInstrumentScreenshotCollector)(input.workspaceDir)
2107
2107
  : null;
2108
+ let playwrightMcpConfigPath = null;
2109
+ if (input.enablePlaywrightMcp) {
2110
+ playwrightMcpConfigPath = node_path_1.default.join(claudeConfigDir, 'playwright-mcp.json');
2111
+ (0, node_fs_1.writeFileSync)(playwrightMcpConfigPath, `${JSON.stringify((0, runtime_1.buildPlaywrightMcpServerConfig)(), null, 2)}\n`, 'utf8');
2112
+ }
2108
2113
  const result = await (0, runtime_1.runLoggedProcess)({
2109
2114
  command: 'claude',
2110
2115
  args: (0, runtime_1.buildClaudeExecArgs)({
@@ -2114,6 +2119,7 @@ async function runClaude(input) {
2114
2119
  pluginDir: input.taskPluginRoot,
2115
2120
  chrome: input.enableChrome,
2116
2121
  playwrightMcp: input.enablePlaywrightMcp,
2122
+ playwrightMcpConfigPath,
2117
2123
  }),
2118
2124
  cwd: input.workspaceDir,
2119
2125
  env: (0, runtime_1.buildWorkerChildEnv)({
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.12.8",
3
- "build": 7,
3
+ "build": 10,
4
4
  "runtimeSdkVersion": "0.12.5",
5
5
  "runtimeSdkBuild": 2,
6
6
  "clients": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playdrop/playdrop-cli",
3
- "version": "0.12.15",
3
+ "version": "0.12.17",
4
4
  "description": "Official Playdrop CLI for publishing browser games, creator apps, and AI-generated game assets on playdrop.ai",
5
5
  "homepage": "https://www.playdrop.ai",
6
6
  "repository": {