{"_id":"@astralai/stagehand-extended","_rev":"1-03f20a7d37fada8ab03be93fdc3324ff","name":"@astralai/stagehand-extended","dist-tags":{"latest":"1.12.0-extended.2"},"versions":{"1.12.0-extended.1":{"name":"@astralai/stagehand-extended","version":"1.12.0-extended.1","keywords":[],"author":{"name":"Browserbase"},"license":"MIT","_id":"@astralai/stagehand-extended@1.12.0-extended.1","maintainers":[{"name":"savy369","email":"savannah@astral.now"}],"homepage":"https://github.com/savannahfeder/stagehand-extended#readme","bugs":{"url":"https://github.com/savannahfeder/stagehand-extended/issues"},"dist":{"shasum":"f623ef6c11dc610d9ce4c6cf58b574fab6d8e8b1","tarball":"https://registry.npmjs.org/@astralai/stagehand-extended/-/stagehand-extended-1.12.0-extended.1.tgz","fileCount":182,"integrity":"sha512-P5Usi3K1MS0YxVGzfX2DaGKd0erNYI4qF7c69iQBr3qGYs8XXDdA0OlYcgzeX2T7VAVjbtIGHgXakYYdZLRYNA==","signatures":[{"sig":"MEQCIHHSuQAJ1EQ1gmw9k6VO+w3QWV0OZ9EBazkKJDFkqZHJAiB/+46+aPwndaO6xZu+Efmj4ONlC6PUxh75ZmLm1eEPEg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":616332},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","gitHead":"09d93258778ccc331f11536b70e1c2bec766850e","scripts":{"2048":"npm run build-dom-scripts && tsx examples/2048.ts","e2e":"npm run build-dom-scripts && cd evals/deterministic && npx playwright test --config=e2e.playwright.config.ts","lint":"npm run prettier && npm run eslint","build":"npm run build-dom-scripts && npm run build-js && npm run build-types","evals":"npm run build-dom-scripts && tsx evals/index.eval.ts","popup":"npm run build-dom-scripts && tsx examples/popup.ts","watch":"concurrently \"tsup lib/index.ts --dts --watch\" \"npm run build-dom-scripts\" \"nodemon -w dist -x npm run example:run\"","e2e:bb":"npm run build-dom-scripts && cd evals/deterministic && npx playwright test --config=bb.playwright.config.ts","eslint":"eslint .","format":"prettier --write .","example":"npm run build-dom-scripts && npm run example:run","release":"npm run build && changeset publish","build-js":"tsup lib/index.ts --dts","prettier":"prettier --check .","debug-url":"npm run build-dom-scripts && tsx examples/debugUrl.ts","build-types":"tsc --emitDeclarationOnly --outDir dist","cache:clear":"rm -rf .cache","example:run":"tsx examples/example.ts","watch:debug":"DEBUG=* npm run watch","instructions":"npm run build-dom-scripts && tsx examples/instructions.ts","prettier:fix":"prettier --write .","ai-sdk-client":"npm run build-dom-scripts && tsx examples/ai_sdk_example.ts","release-canary":"npm run build && changeset version --snapshot && changeset publish --tag alpha","external-client":"npm run build-dom-scripts && tsx examples/external_client.ts","build-dom-scripts":"tsx lib/dom/genDomScripts.ts","actionable_observe_example":"npm run build-dom-scripts && tsx examples/actionable_observe_example.ts"},"_npmUser":{"name":"savy369","email":"savannah@astral.now"},"repository":{"url":"git+https://github.com/savannahfeder/stagehand-extended.git","type":"git"},"_npmVersion":"10.9.2","description":"An AI web browsing framework with enhanced browser configuration capabilities.","directories":{"doc":"docs","lib":"lib","example":"examples"},"_nodeVersion":"23.4.0","dependencies":{"ws":"^8.18.0","@anthropic-ai/sdk":"^0.27.3","@browserbasehq/sdk":"^2.0.0","zod-to-json-schema":"^3.23.5"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^4.0.26","tsx":"^4.10.5","tsup":"^8.2.1","chalk":"^5.4.1","eslint":"^9.16.0","multer":"^1.4.5-lts.1","adm-zip":"^0.5.16","cheerio":"^1.0.0","esbuild":"^0.21.4","express":"^4.21.0","globals":"^15.13.0","nodemon":"^3.1.9","prettier":"^3.2.5","@types/ws":"^8.5.13","autoevals":"^0.0.64","@eslint/js":"^9.16.0","braintrust":"^0.0.171","typescript":"^5.2.2","@types/node":"^20.11.30","concurrently":"^9.1.2","chromium-bidi":"^0.10.0","@ai-sdk/google":"^1.0.13","@ai-sdk/openai":"^1.0.14","@types/adm-zip":"^0.5.7","@types/cheerio":"^0.22.35","@types/express":"^4.17.21","@changesets/cli":"^2.27.9","string-comparison":"^1.3.0","typescript-eslint":"^8.17.0","@changesets/changelog-github":"^0.5.0"},"peerDependencies":{"zod":"^3.23.8","dotenv":"^16.4.5","openai":"^4.62.1","deepmerge":"^4.3.1","@playwright/test":"^1.42.1"},"_npmOperationalInternal":{"tmp":"tmp/stagehand-extended_1.12.0-extended.1_1739054629620_0.8159307171262757","host":"s3://npm-registry-packages-npm-production"}},"1.12.0-extended.2":{"name":"@astralai/stagehand-extended","version":"1.12.0-extended.2","description":"An AI web browsing framework with enhanced browser configuration capabilities.","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"2048":"npm run build-dom-scripts && tsx examples/2048.ts","popup":"npm run build-dom-scripts && tsx examples/popup.ts","example:run":"tsx examples/example.ts","example":"npm run build-dom-scripts && npm run example:run","debug-url":"npm run build-dom-scripts && tsx examples/debugUrl.ts","external-client":"npm run build-dom-scripts && tsx examples/external_client.ts","instructions":"npm run build-dom-scripts && tsx examples/instructions.ts","ai-sdk-client":"npm run build-dom-scripts && tsx examples/ai_sdk_example.ts","actionable_observe_example":"npm run build-dom-scripts && tsx examples/actionable_observe_example.ts","test-logging":"npm run build-dom-scripts && tsx examples/test_logging.ts","format":"prettier --write .","prettier":"prettier --check .","prettier:fix":"prettier --write .","eslint":"eslint .","cache:clear":"rm -rf .cache","evals":"npm run build-dom-scripts && tsx evals/index.eval.ts","e2e":"npm run build-dom-scripts && cd evals/deterministic && npx playwright test --config=e2e.playwright.config.ts","e2e:bb":"npm run build-dom-scripts && cd evals/deterministic && npx playwright test --config=bb.playwright.config.ts","build-dom-scripts":"tsx lib/dom/genDomScripts.ts","build-types":"tsc --emitDeclarationOnly --outDir dist","build-js":"tsup lib/index.ts --dts","build":"npm run build-dom-scripts && npm run build-js && npm run build-types","lint":"npm run prettier && npm run eslint","release":"npm run build && changeset publish","release-canary":"npm run build && changeset version --snapshot && changeset publish --tag alpha","watch":"concurrently \"tsup lib/index.ts --dts --watch\" \"npm run build-dom-scripts\" \"nodemon -w dist -x npm run example:run\"","watch:debug":"DEBUG=* npm run watch"},"keywords":[],"author":{"name":"Browserbase"},"license":"MIT","devDependencies":{"@ai-sdk/google":"^1.0.13","@ai-sdk/openai":"^1.0.14","@changesets/changelog-github":"^0.5.0","@changesets/cli":"^2.27.9","@eslint/js":"^9.16.0","@types/adm-zip":"^0.5.7","@types/cheerio":"^0.22.35","@types/express":"^4.17.21","@types/node":"^20.11.30","@types/ws":"^8.5.13","adm-zip":"^0.5.16","ai":"^4.0.26","autoevals":"^0.0.64","braintrust":"^0.0.171","chalk":"^5.4.1","cheerio":"^1.0.0","chromium-bidi":"^0.10.0","concurrently":"^9.1.2","esbuild":"^0.21.4","eslint":"^9.16.0","express":"^4.21.0","globals":"^15.13.0","multer":"^1.4.5-lts.1","nodemon":"^3.1.9","prettier":"^3.2.5","string-comparison":"^1.3.0","tsup":"^8.2.1","tsx":"^4.10.5","typescript":"^5.2.2","typescript-eslint":"^8.17.0"},"peerDependencies":{"@playwright/test":"^1.42.1","deepmerge":"^4.3.1","dotenv":"^16.4.5","openai":"^4.62.1","zod":"^3.23.8"},"dependencies":{"@anthropic-ai/sdk":"^0.27.3","@browserbasehq/sdk":"^2.0.0","ws":"^8.18.0","zod-to-json-schema":"^3.23.5"},"directories":{"doc":"docs","example":"examples","lib":"lib"},"repository":{"type":"git","url":"git+https://github.com/savannahfeder/stagehand-extended.git"},"bugs":{"url":"https://github.com/savannahfeder/stagehand-extended/issues"},"homepage":"https://github.com/savannahfeder/stagehand-extended#readme","_id":"@astralai/stagehand-extended@1.12.0-extended.2","gitHead":"4d36d011546c5c55563120c7fbdebe793ba2d81b","_nodeVersion":"23.4.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-gIMoc1uBWeJ90fqcpfK9byoP9YyMDaOUdvWrFzd5UNiQkTehV2bUXC+tlruMxghFjS5vMH4rnY8r5mdrLsH3Zw==","shasum":"0095ead184b7550a97cfd7e121553bc3b994b710","tarball":"https://registry.npmjs.org/@astralai/stagehand-extended/-/stagehand-extended-1.12.0-extended.2.tgz","fileCount":183,"unpackedSize":618551,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHoToHt+wYZhHYn0WDHZWE3jfXBKCh8wmj3NsfN3zAAIAiEAxZkwpBGOYgkhANiWOtiSD+sM5ANA60Qf8kODkiT7hEE="}]},"_npmUser":{"name":"savy369","email":"savannah@astral.now"},"maintainers":[{"name":"savy369","email":"savannah@astral.now"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stagehand-extended_1.12.0-extended.2_1739235947365_0.9230933992407055"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-08T22:43:49.532Z","modified":"2025-02-11T01:05:47.776Z","1.12.0-extended.1":"2025-02-08T22:43:49.796Z","1.12.0-extended.2":"2025-02-11T01:05:47.545Z"},"bugs":{"url":"https://github.com/savannahfeder/stagehand-extended/issues"},"author":{"name":"Browserbase"},"license":"MIT","homepage":"https://github.com/savannahfeder/stagehand-extended#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/savannahfeder/stagehand-extended.git"},"description":"An AI web browsing framework with enhanced browser configuration capabilities.","maintainers":[{"name":"savy369","email":"savannah@astral.now"}],"readme":"# Stagehand Extended\n\nA fork of [Browserbase's Stagehand](https://github.com/browserbase/stagehand) with enhanced browser configuration capabilities.\n\n## Why This Fork?\n\nThis fork extends Stagehand to provide greater control over browser instance configuration, specifically allowing you to:\n- Use custom Chrome/Chromium installations\n- Specify custom user profile directories\n- Maintain persistent browser state across sessions\n\nOther changes:\n- Improvements to the logging system (previously, logging was verbose despite adjusting `verbosity` and `debugDom` arguments)\n\n## Relationship with Upstream Stagehand\n\nThis project maintains a close relationship with the upstream Stagehand repository:\n\n- We regularly sync with the upstream repository to incorporate new features and fixes\n- Our changes are focused solely on browser configuration capabilities\n- Version numbers follow upstream with an `-extended` suffix (e.g., `1.12.0-extended.1`)\n\n### Version Compatibility\n\n| Stagehand Version | Stagehand Extended Version |\n|------------------|---------------------------|\n| 1.12.0           | 1.12.0-extended.1        |\n\n### For Contributors\n\nTo contribute while maintaining upstream compatibility:\n\n```bash\n# Setup\ngit clone https://github.com/your-org/stagehand-extended.git\ngit remote add upstream https://github.com/browserbase/stagehand.git\n\n# Stay up-to-date\ngit checkout main\ngit fetch upstream\ngit merge upstream/main\ngit checkout extended-main\ngit rebase main\n```\n\n## Installation\n\n```bash\nnpm install @your-org/stagehand-extended\n# or\nyarn add @your-org/stagehand-extended\n```\n\n### Key Differences from Original Stagehand\n\n```typescript\n// Original Stagehand - Uses default browser paths\nconst stagehand = new Stagehand({\n  env: \"LOCAL\"\n});\n\n// Stagehand Extended - Supports custom browser configuration\nconst stagehand = new Stagehand({\n  env: \"LOCAL\",\n  browserConfig: {\n    // Use a specific Chrome/Chromium installation\n    executablePath: \"/custom/path/to/chrome-canary\",\n    // Use a specific profile directory to maintain state\n    userDataDir: \"/custom/path/to/user-data-dir\"\n  }\n});\n```\n\n### Additional Configuration Options\n\n| Option | Description | Example |\n|--------|-------------|---------|\n| `browserConfig.executablePath` | Path to Chrome/Chromium executable | `/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary` |\n| `browserConfig.userDataDir` | Path to browser user data directory | `~/Library/Application Support/Google/Chrome Canary` |\n\n### Use Cases\n\n1. **Custom Browser Installations**: Use specific Chrome/Chromium versions or installations\n2. **Profile Persistence**: Maintain login states, cookies, and browser history\n3. **Cross-Platform Support**: Specify paths appropriate for your operating system\n4. **Development Environments**: Use different profiles for different environments\n\n### Example Configuration\n\n```typescript\nimport { Stagehand } from '@your-org/stagehand-extended';\n\n// Using environment-specific paths\nconst stagehand = new Stagehand({\n  env: \"LOCAL\",\n  browserConfig: {\n    executablePath: process.env.CHROME_PATH,\n    userDataDir: process.env.CHROME_PROFILE_DIR\n  }\n});\n\n// Using OS-specific paths\nconst stagehand = new Stagehand({\n  env: \"LOCAL\",\n  browserConfig: {\n    executablePath: process.platform === 'darwin' \n      ? '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary'\n      : 'C:\\\\Users\\\\YourUser\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe',\n    userDataDir: process.platform === 'darwin'\n      ? '~/Library/Application Support/Google/Chrome Canary'\n      : 'C:\\\\Users\\\\YourUser\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\User Data'\n  }\n});\n```\n\n<div id=\"toc\" align=\"center\">\n  <ul style=\"list-style: none\">\n    <a href=\"https://stagehand.dev\">\n      <picture>\n        <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://stagehand.dev/logo-dark.svg\" />\n        <img alt=\"Stagehand\" src=\"https://stagehand.dev/logo-light.svg\" />\n      </picture>\n    </a>\n  </ul>\n</div>\n\n<p align=\"center\">\n  An AI web browsing framework focused on simplicity and extensibility.<br>\n  <a href=\"https://docs.stagehand.dev\">Read the Docs</a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/browserbase/stagehand/tree/main?tab=MIT-1-ov-file#MIT-1-ov-file\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://stagehand.dev/api/assets/license?mode=dark\" />\n      <img alt=\"MIT License\" src=\"https://stagehand.dev/api/assets/license?mode=light\" />\n    </picture>\n  </a>\n  <a href=\"https://stagehand.dev/slack\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://stagehand.dev/api/assets/slack?mode=dark\" />\n      <img alt=\"Slack Community\" src=\"https://stagehand.dev/api/assets/slack?mode=light\" />\n    </picture>\n  </a>\n</p>\n\n<p align=\"center\">\n\t<a href=\"https://trendshift.io/repositories/12122\" target=\"_blank\"><img src=\"https://trendshift.io/api/badge/repositories/12122\" alt=\"browserbase%2Fstagehand | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/></a>\n</p>\n\n---\n\nStagehand is the easiest way to build browser automations. It is fully compatible with [Playwright](https://playwright.dev/), offering three simple AI APIs (`act`, `extract`, and `observe`) on top of the base Playwright `Page` class that provide the building blocks for web automation via natural language. \n\nHere's a sample of what you can do with Stagehand:\n\n```typescript\n// Keep your existing Playwright code unchanged\nawait page.goto(\"https://docs.stagehand.dev\");\n\n// Stagehand AI: Act on the page\nawait page.act(\"click on the 'Quickstart'\");\n\n// Stagehand AI: Extract data from the page\nconst { description } = await page.extract({\n  instruction: \"extract the description of the page\",\n  schema: z.object({\n    description: z.string(),\n  }),\n});\n```\n\n## Why?\n**Stagehand adds determinism to otherwise unpredictable agents.**\n\nWhile there's no limit to what you could instruct Stagehand to do, our primitives allow you to control how much you want to leave to an AI. It works best when your code is a sequence of atomic actions. Instead of writing a single script for a single website, Stagehand allows you to write durable, self-healing, and repeatable web automation workflows that actually work.\n\n> [!NOTE] \n> `Stagehand` is currently available as an early release, and we're actively seeking feedback from the community. Please join our [Slack community](https://join.slack.com/t/stagehand-dev/shared_invite/zt-2tdncfgkk-fF8y5U0uJzR2y2_M9c9OJA) to stay updated on the latest developments and provide feedback.\n\n## Documentation\n\nVisit [docs.stagehand.dev](https://docs.stagehand.dev) to view the full documentation.\n\n## Getting Started\n\n<div align=\"center\">\n    <a href=\"https://www.loom.com/share/f5107f86d8c94fa0a8b4b1e89740f7a7\">\n      <p>Watch Anirudh demo create-browser-app to create a Stagehand project!</p>\n    </a>\n    <a href=\"https://www.loom.com/share/f5107f86d8c94fa0a8b4b1e89740f7a7\">\n      <img style=\"max-width:300px;\" src=\"https://cdn.loom.com/sessions/thumbnails/f5107f86d8c94fa0a8b4b1e89740f7a7-ec3f428b6775ceeb-full-play.gif\">\n    </a>\n  </div>\n\n### Quickstart\n\nTo create a new Stagehand project configured to our default settings, run:\n\n```bash\nnpx create-browser-app --example quickstart\n```\n\nRead our [Quickstart Guide](https://docs.stagehand.dev/get_started/quickstart) in the docs for more information.\n\nYou can also add Stagehand to an existing Typescript project by running:\n\n```bash\nnpm install @browserbasehq/stagehand zod\nnpx playwright install # if running locally\n```\n\n### Build and Run from Source\n\n```bash\ngit clone https://github.com/browserbase/stagehand.git\ncd stagehand\nnpm install\nnpx playwright install\nnpm run build\nnpm run example # run the blank script at ./examples/example.ts\n```\n\nStagehand is best when you have an API key for an LLM provider and Browserbase credentials. To add these to your project, run:\n\n```bash\ncp .env.example .env\nnano .env # Edit the .env file to add API keys\n```\n\n## Contributing\n\n> [!NOTE]  \n> We highly value contributions to Stagehand! For questions or support, please join our [Slack community](https://join.slack.com/t/stagehand-dev/shared_invite/zt-2tdncfgkk-fF8y5U0uJzR2y2_M9c9OJA).\n\nAt a high level, we're focused on improving reliability, speed, and cost in that order of priority. If you're interested in contributing, we strongly recommend reaching out to [Anirudh Kamath](https://x.com/kamathematic) or [Paul Klein](https://x.com/pk_iv) in our [Slack community](https://join.slack.com/t/stagehand-dev/shared_invite/zt-2tdncfgkk-fF8y5U0uJzR2y2_M9c9OJA) before starting to ensure that your contribution aligns with our goals.\n\nFor more information, please see our [Contributing Guide](https://docs.stagehand.dev/contributions/contributing).\n\n## Acknowledgements\n\nThis project heavily relies on [Playwright](https://playwright.dev/) as a resilient backbone to automate the web. It also would not be possible without the awesome techniques and discoveries made by [tarsier](https://github.com/reworkd/tarsier), and [fuji-web](https://github.com/normal-computing/fuji-web).\n\nWe'd like to thank the following people for their contributions to Stagehand:\n- [Jeremy Press](https://x.com/jeremypress) wrote the original MVP of Stagehand and continues to be an ally to the project.\n- [Navid Pour](https://github.com/navidpour) is heavily responsible for the current architecture of Stagehand and the `act` API.\n- [Sean McGuire](https://github.com/seanmcguire12) is a major contributor to the project and has been a great help with improving the `extract` API and getting evals to a high level.\n- [Filip Michalsky](https://github.com/filip-michalsky) has been doing a lot of work on building out integrations like [Langchain](https://js.langchain.com/docs/integrations/tools/stagehand/) and [Claude MCP](https://github.com/browserbase/mcp-server-browserbase), generally improving the repository, and unblocking users.\n- [Sameel Arif](https://github.com/sameelarif) is a major contributor to the project, especially around improving the developer experience.\n\n## License\n\nLicensed under the MIT License.\n\nCopyright 2025 Browserbase, Inc.\n","readmeFilename":"README.md"}