Standing up packages/api/ as the home of the programmatic public
API. Moves diagnose() into it as a thin Effect.runPromise shell
around #412's runInspect orchestrator, with tagged-error translation
back to legacy thrown classes (NoReactDependencyError /
ProjectNotFoundError / AmbiguousProjectError) for backwards compat.
inspect() stays in react-doctor/src/ for now (CLI rendering coupled
in). PR 6 (cli package) moves it.
## Files
- packages/api/ (private workspace package)
- src/diagnose.ts: pre-resolves rootDir redirect + resolveDiagnoseTarget,
then runInspect, translates tagged failures, returns DiagnoseResult.
- src/index.ts: re-exports diagnose + public types + legacy errors.
- tests/diagnose.test.ts: 4 tests — happy path, NoReactDependency,
ProjectNotFound, elapsedMilliseconds positive.
- packages/react-doctor/src/index.ts: deletes ~120-line local diagnose,
re-exports from @react-doctor/api.
- packages/core/src/run-inspect.ts: rejects projects without React via
tagged NoReactDependency (used to happen in the legacy diagnose).
## Validation
- pnpm typecheck (12/12)
- pnpm test — 123 files / 1485 pass / 3 skipped
- pnpm lint, format:check, build, smoke:json-report — all green
Co-authored-by: Cursor <cursoragent@cursor.com>