[CE-865] feat: bundle Stagehand docs for agents#2113
Draft
shrey150 wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: a2531db The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
No issues found across 5 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant Turbo as Turbo Build
participant CorePkg as @browserbasehq/stagehand
participant BuildScript as scripts/build-docs.ts
participant DocsSource as packages/docs/v3
participant DistDocs as dist/docs/
participant PkgJson as package.json files
Note over Dev,DistDocs: PR: Bundle version-matched Stagehand docs for agents
Dev->>Turbo: pnpm exec turbo run build --filter=@browserbasehq/stagehand
Turbo->>CorePkg: Execute build task
CorePkg->>CorePkg: Run build:esm and build:cjs in parallel
CorePkg->>CorePkg: Run build-docs script
CorePkg->>BuildScript: Call tsx scripts/build-docs.ts
activate BuildScript
BuildScript->>BuildScript: Clear & recreate dist/docs/
BuildScript->>DocsSource: Read v3 directory recursively
DocsSource-->>BuildScript: List of .mdx files
loop For each .mdx file
BuildScript->>DocsSource: Read .mdx content
DocsSource-->>BuildScript: Content with frontmatter
BuildScript->>BuildScript: Parse frontmatter (title, description)
BuildScript->>BuildScript: Strip import/V3Banner lines
BuildScript->>BuildScript: Convert .mdx to .md extension
BuildScript->>DistDocs: Write converted .md file in dist/docs/v3/
end
BuildScript->>DistDocs: Generate index.md with metadata & navigation
BuildScript-->>CorePkg: Done - 58 markdown files created
deactivate BuildScript
CorePkg->>PkgJson: Include dist/docs and AGENTS.md in publish files
Dev->>CorePkg: Read AGENTS.md at package root
CorePkg-->>Dev: Pointers to dist/docs/index.md and search commands
Dev->>DistDocs: Search using rg for Stagehand API references
DistDocs-->>Dev: Version-matched local documentation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: https://linear.app/browserbase/issue/CE-865/bundle-stagehand-docs-and-ship-agentsmd
Summary
Verification
Summary by cubic
Bundles version-matched Stagehand docs into the
@browserbasehq/stagehandpackage so agents and devs can read local docs that match the installed version. Addresses Linear CE-865 and adds anAGENTS.mdentry point for quick navigation.packages/docs/v3/**/*.mdxtodist/docsduring build (viascripts/build-docs.ts).AGENTS.mdthat points to local docs and suggests search commands.dist/docsandAGENTS.md, and include docs sources in Turbo build inputs; add a patch changeset.Written for commit a2531db. Summary will update on new commits.