app.ts imported McpSessionDOSqlite only to pass it through as mcpExport and re-export it. ExecutorApp.make documents mcpExport as passed back out untouched, its result cloudMcpExport has no consumers, and server.ts imports the DO class directly for Cloudflare's required export. So the import was dead weight that pulled the MCP DO stack and the QuickJS WASM into TanStack Start's loadEntries closure (9.22MB -> 8.58MB without it). No measured latency win: loadEntries cost does not track closure size, same as isolate startup. Kept as dead-code removal and because the SSR graph should not depend on the MCP session DO.
Unified · Split
| @@ -13,7 +13,6 @@ import { ApiKeyService } from "./auth/api-keys"; · 12 unmodified lines | ||
| 13 | 13 | import { cloudIdentityFailureStrategy, workosIdentityLayer } from "./auth/workos-auth-provider"; |
| 14 | 14 | import { DbService } from "./db/db"; |
| 15 | 15 | import { cloudMcpAuth } from "./mcp"; |
| 16 | −import { McpSessionDOSqlite } from "./mcp/session-durable-object"; | |
| 17 | 16 | import { ErrorCaptureLive } from "./observability"; |
| 18 | 17 | import { AutumnService } from "./extensions/billing/service"; |
| 19 | 18 | import { |
| @@ -31,7 +30,7 @@ import { WorkerTelemetryLive } from "./observability/telemetry"; · 11 unmodified lines | ||
| 31 | 30 | // The whole scenario in 60 seconds: WorkOS identity (api-key Bearer OR sealed- |
| 32 | 31 | // session cookie, api-key wins) over a per-request Hyperdrive→Postgres socket, |
| 33 | 32 | // the Cloudflare dynamic-worker code substrate, MCP served by a Durable-Object |
| 34 | −// session store (the DO surfaced via `config.mcpExport`), console+Sentry error | |
| 33 | +// session store (the DO class is exported straight from server.ts), console+Sentry error | |
| 35 | 34 | // capture — and Autumn BILLING entering ONLY as extensions: the engine |
| 36 | 35 | // metering decorator, the account seat-gate, the `/api/billing/*` proxy route, |
| 37 | 36 | // and the createOrganization free-limit gate. `diff` against |
| @@ -66,7 +65,7 @@ const controlPlane = Layer.mergeAll(CoreSharedServices, apiKeyService); · 28 unmodified lines | ||
| 66 | 65 | // satisfied by `boot`, `DbService` per request via `requestScoped`). |
| 67 | 66 | const cloudDb: Layer.Layer<DbProvider, never, DbService | AutumnService> = CloudDbProvider; |
| 68 | 67 | |
| 69 | −const { appLayer, toWebHandler, mcpExport } = ExecutorApp.make({ | |
| 68 | +const { appLayer, toWebHandler } = ExecutorApp.make({ | |
| 70 | 69 | plugins: cloudPlugins, |
| 71 | 70 | providers: { |
| 72 | 71 | // Identity: the NEUTRAL `IdentityProvider`. WorkOS api-key Bearer BEATS |
| @@ -112,7 +111,6 @@ const { appLayer, toWebHandler, mcpExport } = ExecutorApp.make({ · 39 unmodified lines | ||
| 112 | 111 | failure: cloudIdentityFailureStrategy, |
| 113 | 112 | // The MCP session Durable Object class — a top-level Workers export a Layer |
| 114 | 113 | // can't return; surfaced so `server.ts` can re-export it. |
| 115 | − mcpExport: McpSessionDOSqlite, | |
| 116 | 114 | }, |
| 117 | 115 | // The long-lived (boot-scoped) context provideMerge'd under everything: the |
| 118 | 116 | // WorkOS control plane (the raw `WorkOSClient` + `ApiKeyService` the per-request |
| @@ -135,10 +133,7 @@ const { appLayer, toWebHandler, mcpExport } = ExecutorApp.make({ · 16 unmodified lines | ||
| 135 | 133 | requestScoped: RequestScopedServicesLive, |
| 136 | 134 | }); |
| 137 | 135 | |
| 138 | −export { McpSessionDOSqlite }; | |
| 139 | − | |
| 140 | 136 | export const CloudAppLayer = appLayer; |
| 141 | −export const cloudMcpExport = mcpExport; | |
| 142 | 137 | |
| 143 | 138 | // The unified cloud web handler: serves /api/* (incl. /api/billing/*, /api/docs), |
| 144 | 139 | // /mcp, /.well-known/* — everything the worker dispatches. |