import type { IncomingMessage, ServerResponse } from "node:http"; import type { Router } from "./router.js"; import type { ActiveRootStore } from "./active-root-store.js"; export interface WorkspaceRoutesOptions { /** Where ~/.vskill lives (test injection). Defaults to join(os.homedir(), ".vskill"). */ workspaceDir: string; /** * 0863: when present, switching the active project re-roots the running * server via `rootStore.setRoot(path)`. Omitted in unit tests that only * exercise the persistence layer (those keep the legacy response shape). */ rootStore?: ActiveRootStore; /** * 0863: counts skills under a root for the switch response (`skillCount`), * so the UI can size its skeleton grid and toast. Best-effort: errors → undefined. */ countSkills?: (root: string) => Promise; } export interface WorkspaceHandlers { getWorkspace: (req: IncomingMessage, res: ServerResponse) => Promise; postProject: (req: IncomingMessage, res: ServerResponse) => Promise; deleteProject: (req: IncomingMessage, res: ServerResponse, params: Record) => Promise; postActive: (req: IncomingMessage, res: ServerResponse) => Promise; } export declare function makeWorkspaceHandlers(opts: WorkspaceRoutesOptions): WorkspaceHandlers; export declare function registerWorkspaceRoutes(router: Router, opts: WorkspaceRoutesOptions): void;