Summary
Part of #488. Extract src/api/ and src/web/ into a standalone @libscope/server package, isolating HTTP server concerns (middleware, auth, CORS, rate limiting) from the core library.
Problem / Motivation
Servers have process lifecycle concerns (listen/close), authentication middleware, HTTP framework dependencies, and a web dashboard — none of which are relevant to library consumers. Today they're accessible via src/core/index.ts re-exports, polluting the core public surface.
Proposed Solution
Move src/api/ and src/web/ into packages/server/ with its own package.json. The package depends on @libscope/core for all data access.
Acceptance Criteria
Out of Scope
- Changes to the REST API routes or OpenAPI spec
- Changes to the web dashboard UI
Technical Notes
src/api/ contains: server.ts, routes.ts, middleware, OpenAPI spec
src/web/ contains: server.ts, dashboard.ts (one giant template literal — do not modify), graph-api.ts
- Note:
src/web/dashboard.ts contains intentional escape sequences and must not be reformatted
Summary
Part of #488. Extract
src/api/andsrc/web/into a standalone@libscope/serverpackage, isolating HTTP server concerns (middleware, auth, CORS, rate limiting) from the core library.Problem / Motivation
Servers have process lifecycle concerns (listen/close), authentication middleware, HTTP framework dependencies, and a web dashboard — none of which are relevant to library consumers. Today they're accessible via
src/core/index.tsre-exports, polluting the core public surface.Proposed Solution
Move
src/api/andsrc/web/intopackages/server/with its ownpackage.json. The package depends on@libscope/corefor all data access.Acceptance Criteria
@libscope/serverbuilds independently, depending on@libscope/corefor data accesssrc/core/index.tsno longer re-exportssrc/api/server.tsorsrc/web/server.tslibscope servecommand works correctly after the moveOut of Scope
Technical Notes
src/api/contains:server.ts,routes.ts, middleware, OpenAPI specsrc/web/contains:server.ts,dashboard.ts(one giant template literal — do not modify),graph-api.tssrc/web/dashboard.tscontains intentional escape sequences and must not be reformatted