feat(eve): add Stagehand code-mode MCP example #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Code-mode sandbox examples | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| paths: | |
| - ".github/workflows/codemode-framework-examples.yml" | |
| - "packages/integrations/**" | |
| - "packages/extension/**" | |
| - "packages/protocol/**" | |
| - "packages/sdk-ts/**" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| - "pnpm-workspace.yaml" | |
| - "tsconfig.json" | |
| - "turbo.json" | |
| push: | |
| branches: [main, v4-spike] | |
| paths: | |
| - ".github/workflows/codemode-framework-examples.yml" | |
| - "packages/integrations/**" | |
| - "packages/extension/**" | |
| - "packages/protocol/**" | |
| - "packages/sdk-ts/**" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| - "pnpm-workspace.yaml" | |
| - "tsconfig.json" | |
| - "turbo.json" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| example: | |
| name: ${{ matrix.name }} | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| contains(github.event.pull_request.labels.*.name, 'safe-to-test') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Vercel Sandbox package-installed MCP | |
| package: "@browserbasehq/stagehand-integrations-example-vercel-sandbox" | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| use-prebuilt-artifacts: "false" | |
| - uses: ./.github/actions/setup-chrome-verified | |
| id: setup-chrome | |
| - run: pnpm --filter ${{ matrix.package }} typecheck | |
| - run: pnpm --filter ${{ matrix.package }} test:contract | |
| - run: pnpm --filter ${{ matrix.package }} pack:artifacts | |
| - run: pnpm --filter ${{ matrix.package }} smoke | |
| env: | |
| CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }} | |
| STAGEHAND_BROWSER: local | |
| - name: Detect live test credentials | |
| id: live-credentials | |
| uses: ./.github/actions/detect-codemode-live-credentials | |
| env: | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| - name: Run live package-installed sandbox proof | |
| if: steps.live-credentials.outputs.available == 'true' | |
| run: pnpm --filter ${{ matrix.package }} e2e | |
| env: | |
| STAGEHAND_SANDBOX_ARTIFACTS: ${{ github.workspace }}/packages/integrations/examples/vercel-sandbox/.artifacts | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| mastra: | |
| name: Mastra | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| contains(github.event.pull_request.labels.*.name, 'safe-to-test') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| use-prebuilt-artifacts: "false" | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-mastra typecheck | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-mastra test:contract | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-vercel-sandbox pack:artifacts | |
| - name: Detect Mastra live test credentials | |
| id: mastra-live-credentials | |
| uses: ./.github/actions/detect-codemode-live-credentials | |
| with: | |
| require-openai: "true" | |
| env: | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run Mastra live sandbox proof | |
| if: steps.mastra-live-credentials.outputs.available == 'true' | |
| run: pnpm --filter @browserbasehq/stagehand-integrations-example-mastra e2e | |
| env: | |
| STAGEHAND_SANDBOX_ARTIFACTS: ${{ github.workspace }}/packages/integrations/examples/vercel-sandbox/.artifacts | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| crewai: | |
| name: CrewAI | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| contains(github.event.pull_request.labels.*.name, 'safe-to-test') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| use-prebuilt-artifacts: "false" | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: packages/integrations/examples/crewai/requirements.txt | |
| - run: python -m pip install -r packages/integrations/examples/crewai/requirements.txt | |
| - run: >- | |
| python -m py_compile | |
| packages/integrations/examples/shared/vercel_sandbox_lease.py | |
| packages/integrations/examples/shared/test_vercel_sandbox_lease.py | |
| packages/integrations/examples/crewai/agent.py | |
| packages/integrations/examples/crewai/sandbox.py | |
| packages/integrations/examples/crewai/test_agent.py | |
| packages/integrations/examples/crewai/test_e2e.py | |
| packages/integrations/examples/crewai/e2e.py | |
| - run: python packages/integrations/examples/shared/test_vercel_sandbox_lease.py | |
| - run: python packages/integrations/examples/crewai/test_agent.py | |
| - run: python packages/integrations/examples/crewai/test_e2e.py | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-vercel-sandbox pack:artifacts | |
| - name: Detect CrewAI live test credentials | |
| id: crewai-live-credentials | |
| uses: ./.github/actions/detect-codemode-live-credentials | |
| with: | |
| require-openai: "true" | |
| env: | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run CrewAI live sandbox proof | |
| if: steps.crewai-live-credentials.outputs.available == 'true' | |
| run: python packages/integrations/examples/crewai/e2e.py | |
| env: | |
| STAGEHAND_SANDBOX_ARTIFACTS: ${{ github.workspace }}/packages/integrations/examples/vercel-sandbox/.artifacts | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| langchain: | |
| name: LangChain Deep Agents | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| contains(github.event.pull_request.labels.*.name, 'safe-to-test') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| use-prebuilt-artifacts: "false" | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: packages/integrations/examples/langchain/requirements.txt | |
| - run: python -m pip install -r packages/integrations/examples/langchain/requirements.txt | |
| - run: >- | |
| python -m py_compile | |
| packages/integrations/examples/shared/vercel_sandbox_lease.py | |
| packages/integrations/examples/shared/test_vercel_sandbox_lease.py | |
| packages/integrations/examples/langchain/agent.py | |
| packages/integrations/examples/langchain/sandbox.py | |
| packages/integrations/examples/langchain/test_agent.py | |
| packages/integrations/examples/langchain/test_e2e.py | |
| packages/integrations/examples/langchain/e2e.py | |
| - run: python packages/integrations/examples/shared/test_vercel_sandbox_lease.py | |
| - run: python packages/integrations/examples/langchain/test_agent.py | |
| - run: python packages/integrations/examples/langchain/test_e2e.py | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-vercel-sandbox pack:artifacts | |
| - name: Detect LangChain live test credentials | |
| id: langchain-live-credentials | |
| uses: ./.github/actions/detect-codemode-live-credentials | |
| with: | |
| require-openai: "true" | |
| env: | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run LangChain live sandbox proof | |
| if: steps.langchain-live-credentials.outputs.available == 'true' | |
| run: python packages/integrations/examples/langchain/e2e.py | |
| env: | |
| STAGEHAND_SANDBOX_ARTIFACTS: ${{ github.workspace }}/packages/integrations/examples/vercel-sandbox/.artifacts | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| eve: | |
| name: Eve | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository || | |
| contains(github.event.pull_request.labels.*.name, 'safe-to-test') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| use-prebuilt-artifacts: "false" | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-eve typecheck | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-eve contract | |
| - run: pnpm --filter @browserbasehq/stagehand-integrations-example-vercel-sandbox pack:artifacts | |
| - name: Detect Eve live test credentials | |
| id: eve-live-credentials | |
| uses: ./.github/actions/detect-codemode-live-credentials | |
| with: | |
| require-openai: "true" | |
| env: | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| - name: Run Eve live sandbox proof | |
| if: steps.eve-live-credentials.outputs.available == 'true' | |
| run: pnpm --filter @browserbasehq/stagehand-integrations-example-eve e2e | |
| env: | |
| STAGEHAND_SANDBOX_ARTIFACTS: ${{ github.workspace }}/packages/integrations/examples/vercel-sandbox/.artifacts | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }} | |
| VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |