refactor(cli): consume shared Functions core - #2701
Draft
shrey150 wants to merge 3 commits into
Draft
Conversation
🦋 Changeset detectedLatest commit: 8b191df The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This was referenced Aug 13, 2026
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.
BLUF
Replace Browse's parallel Functions implementation with thin Oclif adapters over the canonical
@browserbasehq/sdk-functions/corelibrary. This removes roughly 1,300 lines of duplicate API/archive/runtime code while preserving Browse's JSON output, telemetry, flags, and signal handling.Dependency stack
4d7db8bdc5917fed0af17e78fe4cc8ed33e64468.preparebuild and a temporary pnpmallowBuildsentry.Do not publish Browse from this commit pin. After
@browserbasehq/sdk-functions@1.1.0is released, replace the catalog entry with^1.1.0, remove the temporaryallowBuildsentry/TODO, regenerate the lockfile, and rerun the full matrix before merge.What stays host-specific
Browse retains only the CLI concerns that should differ by host: Oclif flags, structured JSON output, telemetry classification, process exit codes, stderr logging, and SIGINT/SIGTERM ownership. The shared SDK core owns scaffolding, archive rules, Functions HTTP requests, project inference/override, polling, and local runtime behavior.
An explicit contract test verifies that importing
@browserbasehq/sdk-functions/coredoes not execute the package's bundled Commander CLI.E2E test matrix
/coredoes not execute CommanderExample Domainbb;bbscaffold published by BrowseLive validation used public starter behavior. Secrets, account identifiers, resource IDs, and connection URLs are intentionally omitted.
Browse release caveat
This stack targets
v4-spike-cli. The current release workflow triggers only on pushes tomain, and currentmaindoes not containpackages/cli, so merging this branch alone cannot publishbrowse.Branch lineage is not the runtime blocker: Browse already aliases Stagehand v3 as
stagehand-v3. The blocker is release orchestration/authentication.Recommended path:
v4-spike-cliwill merge tomainsoon, release normally through Changesets after that merge.workflow_dispatchworkflow on the default branch that accepts and validates an exact CLI branch SHA, checks it out, runs frozen install plus Browse lint/test/build/pack, versions the Browse changeset, and publishes onlybrowseusing trusted publishing.