{
  "name": "mcp-server",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/mcp-server/src",
  "projectType": "application",
  "tags": ["scope:internal", "license:oss"],
  "targets": {
    "worker-build": {
      "executor": "nx:run-commands",
      "outputs": ["{workspaceRoot}/dist/apps/mcp-server/worker.js"],
      "options": {
        "command": "node_modules/.bin/esbuild apps/mcp-server/src/worker.ts --bundle --format=esm --platform=browser --outfile=dist/apps/mcp-server/worker.js --define:import.meta.env=undefined --conditions=worker,browser,import,default --external:node:* --external:crypto --external:http --external:http2 --external:stream --external:net --external:tls --external:zlib --external:url --external:util --external:path --external:fs --external:os --external:events --external:buffer"
      }
    },
    "deploy": {
      "executor": "nx:run-commands",
      "dependsOn": ["worker-build"],
      "options": {
        "cwd": "apps/mcp-server",
        "command": "npx wrangler deploy"
      }
    },
    "secrets:push": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/mcp-server",
        "command": "node -e \"const fs=require('fs');const {execSync}=require('child_process');const lines=fs.readFileSync('.env','utf8').split('\\n');lines.filter(l=>l&&!l.startsWith('#')).forEach(l=>{const [k,...v]=l.split('=');if(k&&v.length){console.log('pushing '+k.trim());execSync('npx wrangler secret put '+k.trim()+' --name lenserfight-mcp',{input:v.join('=').trim(),stdio:['pipe','inherit','inherit']})}});\""
      }
    },
    "build": {
      "executor": "@nx/esbuild:esbuild",
      "outputs": ["{options.outputPath}"],
      "defaultConfiguration": "production",
      "options": {
        "platform": "node",
        "outputPath": "dist/apps/mcp-server",
        "format": ["cjs"],
        "bundle": true,
        "thirdParty": true,
        "main": "apps/mcp-server/src/main.ts",
        "tsConfig": "apps/mcp-server/tsconfig.app.json",
        "generatePackageJson": true,
        "esbuildOptions": {
          "sourcemap": true,
          "outExtension": {
            ".js": ".js"
          },
          "define": {
            "import.meta.env": "undefined"
          }
        }
      },
      "configurations": {
        "development": {},
        "production": {
          "esbuildOptions": {
            "sourcemap": false,
            "outExtension": {
              ".js": ".js"
            },
            "define": {
              "import.meta.env": "undefined"
            }
          }
        }
      }
    },
    "serve": {
      "continuous": true,
      "executor": "@nx/js:node",
      "defaultConfiguration": "development",
      "dependsOn": ["build"],
      "options": {
        "buildTarget": "mcp-server:build",
        "runBuildTargetDependencies": false
      },
      "configurations": {
        "development": {
          "buildTarget": "mcp-server:build:development"
        },
        "production": {
          "buildTarget": "mcp-server:build:production"
        }
      }
    },
    "test": {
      "options": {
        "jestConfig": "apps/mcp-server/jest.config.cjs",
        "passWithNoTests": true
      }
    }
  }
}
