# why
the protocol package previously owned a repository-wide TypeScript
config that also checked SDK TS, extension, & root tooling files. Turbo
was still running that typecheck as a protocol package task, so changes
outside the protocol package could reuse a stale cached result
giving each package ownership of its own TypeScript program makes the
check graph match the source graph, closes gaps in the old umbrella
config, & lets Turbo invalidate checks through declared workspace
dependencies
# what changed
- added package-owned TypeScript configs & typecheck scripts for the
extension, SDK TS, & selected root tooling
- narrowed the protocol TypeScript config to protocol-owned source,
tests, schema generation, & type tests
- added internal protocol source exports & declared the private protocol
workspace package as an SDK TS and extension development dependency
- replaced SDK TS & extension filesystem imports into the protocol
package with explicit package subpath imports
- moved RPC client tests from protocol to SDK TS, moved the
fake-WebSocket CDP transport test to extension, & moved the full
client/extension browser smoke test to SDK TS
- removed the now-empty protocol browser test script & Turbo task
- replaced cross-package Turbo input globs with package-owned typecheck
tasks & workspace dependency edges
- scoped the root tooling task to `rules/ast-grep` & `scripts/release`
- removed cross-package unit-test cache inputs now covered by the
workspace graph
# test plan
- [x] Run protocol, extension, SDK TS, & root tooling typechecks
directly.
- [x] Verify Turbo's dry typecheck graph has protocol as the upstream
dependency of SDK TS & extension, with no package task owning source
outside its package.
- [x] Verify Turbo's dry unit-test graph derives protocol invalidation
through workspace build dependencies & no protocol browser task remains.
- [x] Run protocol unit tests & the moved SDK TS and extension tests.
- [x] Build protocol, extension, & SDK TS and regenerate repository
artifacts.
- [x] Verify SDK JavaScript & declaration output contain no unresolved
private protocol imports.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes stale Turbo typecheck caching by giving each package ownership of
its own TypeScript config. The protocol package previously ran a
repository-wide typecheck, so changes outside it could reuse a stale
cached result.
**What changed**
- Added package-owned typecheck scripts and tsconfigs for the extension,
SDK TS, and root tooling, and narrowed the protocol tsconfig to
protocol-owned source.
- Replaced filesystem imports into `packages/protocol` with
`@browserbasehq/stagehand-protocol` subpath imports and declared the
private protocol package as a dev dependency of SDK TS and the
extension.
- Moved RPC client tests to SDK TS, the fake-WebSocket CDP transport
test to the extension, and the browser smoke test to SDK TS; removed the
protocol browser test task.
- Replaced cross-package Turbo input globs with workspace dependency
edges so typecheck and unit-test invalidation follows the source graph.
<sup>Written for commit f514c26d8d9b9c281ae6617c1acca0e8041f69a4.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/browserbase/stagehand/pull/2865?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->