feat: expose reusable Functions core - #40
Draft
shrey150 wants to merge 3 commits into
Draft
Conversation
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
Expose the canonical Functions implementation as
@browserbasehq/sdk-functions/coreand makebb functionsa thin CLI adapter over it. This removes the need for Browse or any future host CLI to copy the Functions API/archive/runtime logic.Root cause and design
The Functions HTTP API did not make a breaking change. The SDK/CLI implementation evolved—scaffold metadata/dependencies, project inference, archive validation, local runtime behavior, invocation/build polling—and Browse retained an older parallel copy.
This PR creates a headless core boundary:
@browserbasehq/sdk-functions/core; importing it does not execute the bundledbbCLIPublic core operations include
createFunctionProject,createFunctionArchive,publishFunction,invokeFunction,getBuildStatus,getInvocationStatus, andstartDevServer, plus their typed results/errors.Compatibility and package shape
@browserbasehq/sdk-functions/coreships ESM, CommonJS, and declarations from the existing package.@browserbasehq/sdk-functionsroot export andbbbinary remain intact.functions-corepackage without reintroducing duplicate implementations.E2E test matrix
pnpm lint && pnpm buildpnpm testpnpm test:integrationagainst the packed tarballpnpm test:e2ewith real Functions credentialsbbflows using the exact SDK commitbb;bbscaffold published by Browse; local dev, sync invoke, async invoke, and status polling passedLive validation used public starter behavior. Secrets, account identifiers, resource IDs, and connection URLs are intentionally omitted.
Release and rollout
This repository has CI but no automated npm release workflow. Because
./coreis a new public API, the recommended release is1.1.0:package.jsonandpnpm-lock.yamlto1.1.0.main, runpnpm install --frozen-lockfile,pnpm lint,pnpm test,pnpm test:integration,pnpm build, andpnpm pack --json.pnpm publish --access public(including the registry's normal authentication/OTP requirements).npm view @browserbasehq/sdk-functions@1.1.0 exports --jsonincludes./coreand smoke-import both module formats.^1.1.0, remove its temporary build allowance, regenerate the lockfile, rerun tests, then merge/release Browse.The downstream Browse proof is browserbase/stagehand#2701. It is intentionally draft and must not be published while it references the GitHub commit.