You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(react-native): collocate Metro, companion, and DevTools - #3706
Collocate Metro preparation and session bindings, companion lifecycle and worker, and React inspection/profiling in private @agent-device/react-native.
One "." export points to src/index.ts. Its explicit, typed interface exposes Metro operations, session lifecycle operations, and runReactDevtools; runtime implementations load lazily. Persistence helpers and internal modules stay private. Public CLI and SDK behavior is preserved.
flowchart LR
Adapters[CLI / SDK adapters] --> Entry[react-native index.ts]
Entry --> Metro[Metro preparation and bindings]
Entry --> Companion[Companion lifecycle and worker]
Entry --> DevTools[React inspection and profiling]
DevTools --> Metro
Metro --> Companion
Loading
82 files touched, mostly moves. Companion protocol/lifecycle code sits beside its worker; package-wide tests exercise the root interface, SDK session tests sit with the SDK, and shared fixtures live in test-kit. Remove the obsolete root overlay re-export; retain its canonical capture-kit implementation. Update ADR 0019 and path-keyed checks.
Addressed the stale ownership comment in 143c6de: it now names @agent-device/react-native and drops the old migration history.
Kept the other choices deliberately:
The lazy session wrappers keep the single entry within its startup budget. Using the repository's graph walker against the current source, the entry evaluates 6 modules; a static-export variant evaluates 25, above the 20-module ceiling. Every production caller awaits the facade methods.
The independent fixture reader verifies persisted controlBaseUrlanddeviceBaseUrls, including cleanup. readMetroSessionRuntime returns only the resolved control runtime, so substituting it would lose that persistence coverage. Raw storage helpers remain private to the package.
The overlay change removes a redundant re-export during the requested related-code cleanup. Its canonical capture-kit implementation is unchanged, and the PR body names the deletion.
Executable code is unchanged from b60d2b2. pnpm check:affected --run passes at 143c6de (15,564 tests passed; one skipped).
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
ready-for-humanValid work that needs human implementation, judgment, or maintainer merge
1 participant
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.
Summary
Collocate Metro preparation and session bindings, companion lifecycle and worker, and React inspection/profiling in private
@agent-device/react-native.One
"."export points tosrc/index.ts. Its explicit, typed interface exposes Metro operations, session lifecycle operations, andrunReactDevtools; runtime implementations load lazily. Persistence helpers and internal modules stay private. Public CLI and SDK behavior is preserved.82 files touched, mostly moves. Companion protocol/lifecycle code sits beside its worker; package-wide tests exercise the root interface, SDK session tests sit with the SDK, and shared fixtures live in test-kit. Remove the obsolete root overlay re-export; retain its canonical capture-kit implementation. Update ADR 0019 and path-keyed checks.
Validation
Tested commit:
143c6deee769c72ce19b818ece338006ef518c00.pnpm check:affected --run: all runnable checks passed; 1,845 files / 15,564 tests passed, one skipped.src/index.ts; no root imports, value cycles, or zone cycles.b60d2b2: no actionable findings; follow-up changes only a doc comment.