import type { Server } from 'srvx'; import type { WorkflowWebAuth } from './auth-options.js'; export type { WorkflowWebAuth, WorkflowWebAuthOptions, } from './auth-options.js'; export interface StartServerOptions { /** * Host names, besides `localhost`, `*.localhost` and IP addresses, that * requests may address the server by in their `Host` header. An array, or a * comma-separated string. `.example.com` matches the domain and its * subdomains; `true` or `"*"` disables the check. Defaults to * `WORKFLOW_WEB_ALLOWED_HOSTS`. */ allowedHosts?: string | string[] | true; /** * Authentication for every request. Defaults to the `WORKFLOW_WEB_AUTH*` * environment variables; without them, only loopback clients are served. * An invalid configuration makes `startServer` reject before it listens. */ auth?: WorkflowWebAuth; /** * Refuse every change to runs and hooks. Defaults to * `WORKFLOW_WEB_READ_ONLY`. */ readOnly?: boolean; /** * Path to serve the UI under, such as `/workflows`, for a reverse proxy that * forwards only that prefix without rewriting it. Defaults to * `WORKFLOW_WEB_BASENAME`, then the root. */ basename?: string; } /** * Start the standalone observability UI server on `port` (defaults to `PORT`, then 3000), * and resolve once it is listening. */ export function startServer( port?: number, options?: StartServerOptions ): Promise; /** * Normalize a mount path (`/` or empty -> `""`), throwing for anything but * `/segment` paths. @internal */ export function parseBasename(basename: string | undefined): string;