/** * @deepseek-ai/dsh-host-frontend-static — SPA dist server over the webserver * fallback seat: serves the built frontend directory with the semantics the * Web shell locked at step1 — traversal outside the dist root is 403, any * miss falls back to index.html with HTTP 200 (SPA routing), unknown * extensions ship as octet-stream, non-GET/HEAD is 405. Every index response * runs through the webserver's registered index taps (boot-manifest * injection). The dist location is workspace knowledge of the composing * application, so `distIndex` is typically supplied through a `!!js` * expression, never hardcoded by a deployment. * @module @deepseek-ai/dsh-host-frontend-static */ import type { ServerResponse } from 'node:http'; import type { Context } from '@deepseek-ai/cordis'; import z from '@deepseek-ai/schemastery'; /** Stable Cordis plugin name. */ export declare const name = "frontend-static"; /** Service required before the fallback seat can be claimed. */ export declare const inject: string[]; /** Plugin config: the dist anchor. */ export interface Config { /** Absolute path of index.html inside the dist root. */ distIndex: string; } export declare const Config: z; /** * Serve one GET/HEAD static request from the dist root. * @param pathname - decoded URL pathname of the request. * @param res - the node:http response to write. * @param distRoot - absolute dist root directory (resolved by the caller). * @param distIndex - absolute path of index.html inside distRoot. * @param renderIndex - produces the index.html body (index-tap injection) for * `/` and every SPA fallback. */ export declare function serveStatic(pathname: string, res: ServerResponse, distRoot: string, distIndex: string, renderIndex: () => Promise): Promise; /** * Claim the webserver fallback seat and serve the dist. * @param ctx - plugin context carrying the webServer service. * @param config - validated {@link Config}. */ export declare function apply(ctx: Context, config: Config): void; //# sourceMappingURL=index.d.ts.map