feat(core): remove workspace server, WorkspaceContext, start work towards better routing (#19316)

This commit is contained in:
James Long
2026-03-26 12:30:26 -04:00
committed by GitHub
parent 332e29dcbe
commit e2706b7d41
13 changed files with 68 additions and 537 deletions
@@ -1,24 +0,0 @@
import { Context } from "../util/context"
import type { WorkspaceID } from "./schema"
interface Context {
workspaceID?: WorkspaceID
}
const context = Context.create<Context>("workspace")
export const WorkspaceContext = {
async provide<R>(input: { workspaceID?: WorkspaceID; fn: () => R }): Promise<R> {
return context.provide({ workspaceID: input.workspaceID }, async () => {
return input.fn()
})
},
get workspaceID() {
try {
return context.use().workspaceID
} catch (e) {
return undefined
}
},
}