/** * Returns `workspacePath` when it passes `validateProjectPath`, otherwise logs * and returns `fallbackPath` (requirement 1.8). * * Falls back rather than throwing: `initialize` runs before the transport * connects, so a rejected inference must not be able to kill the MCP handshake. * `fallbackPath` is the configured path's git top-level — the value resolution * would have produced with inference off — not the raw configured path * (requirement 1.2). */ export declare function validateInferredWorkspace(workspacePath: string, fallbackPath: string): Promise; /** Both roots, once the inferred workspace has had its validation. */ export interface SettledRoots { workflowRootPath: string; workspacePath: string; } /** * Settles **both** roots together after a rejected inference (requirements 1.8, * 2.8). * * The workspace falls back to the configured path's git top-level. The workflow * root has to move with it whenever it *is* the workspace — which is what * `--no-shared-worktree-specs` makes it (requirement 2.8) — because otherwise * the workflow root keeps the path validation just rejected, and the * `validateProjectPath(this.projectPath)` in `initialize` throws on it: the * startup abort requirement 1.8 exists to prevent, reached through the other * root. A workflow root that resolves independently (the shared main-repo root, * or an explicit `SPEC_WORKFLOW_SHARED_ROOT`) is left alone. */ export declare function settleWorkspaceRoots(workflowRootPath: string, workspacePath: string, inferredWorkspaceFallback?: string): Promise; export declare class SpecWorkflowMCPServer { private server; private projectPath; private workspacePath; private projectRegistry; private lang?; /** * The projectId returned by `registerProject`, cached for `stop()` * (requirement 1.13). * * `stop()` must not recompute this from `workspacePath`: `generateProjectId` * realpath-normalizes, and `realpath` fails with ENOENT once the directory is * gone. A `git worktree remove` while this server is running would therefore * make shutdown compute a *different* id and delete nothing, leaving the * removed worktree in the registry forever. * * Undefined until registration returns — `stop()` can run after `initialize` * threw earlier than that, and there is then nothing registered to remove. */ private registeredProjectId?; constructor(); /** * The roots in force, or `undefined` before `initialize` has settled them. * * `initialize` assigns both before it can throw, so the caller's `finally` * reports the settled state rather than the provisional one it passed in * (requirement 1.18: one emission, and a true one). */ get settledWorkflowRootPath(): string | undefined; get settledWorkspacePath(): string | undefined; /** * @param inferredWorkspaceFallback - Set only when `workspacePath` was * **inferred** from the launch directory (requirement 1.8). Inference * derives the workspace from `process.cwd()`, which the user did not * choose, and `validateProjectPath` rejects non-directories, paths without * write access, and `/var`-prefixed paths — any of which would turn a * working setup into a failed startup. The check lives here because that * predicate is async and `resolveWorkspaceRoots` is not. * @returns the **settled** workspace path — `workspacePath` itself, or * `inferredWorkspaceFallback` when the inferred path was rejected. The * caller logs the resolution (requirement 1.18) and can only tell the truth * about which path is in force once this has returned — or, when this * throws, by reading {@link settledWorkspacePath} and * {@link settledWorkflowRootPath}, which are assigned before anything below * can fail. */ initialize(projectPath: string, workspacePath: string, lang?: string, inferredWorkspaceFallback?: string): Promise; private setupHandlers; /** * Check if running in Docker mode (path translation enabled) * When in Docker, we can't verify host PIDs and want projects to persist */ private isDockerMode; stop(): Promise; } //# sourceMappingURL=server.d.ts.map