import { STANDALONE_PROTOCOL_VERSION } from "./standalone-contract.js"; import type { StandaloneWorkflowRuntime } from "./standalone-runtime.js"; export interface StandaloneWorkflowServerOptions { host?: string; port?: number; authToken?: string; /** Override descriptor location (primarily for embedders/tests). */ descriptorPath?: string; /** Set false when discovery is owned by a parent process. Default true. */ writeDescriptor?: boolean; title?: string; } export interface RuntimeDescriptor { protocolVersion: typeof STANDALONE_PROTOCOL_VERSION; pid: number; cwd: string; host: string; port: number; authToken: string; startedAt: string; descriptorPath: string; } export interface ListeningStandaloneWorkflowServer { host: string; port: number; authToken: string; url: string; descriptor: RuntimeDescriptor; } /** * Local HTTP/SSE control plane for the standalone runtime. * * The server defaults to loopback and uses a random bearer token. The token is * also embedded into the local dashboard and written to a mode-0600 runtime * descriptor so other local `dynworkflow` processes can discover the owner. */ export declare class StandaloneWorkflowServer { readonly runtime: StandaloneWorkflowRuntime; readonly authToken: string; private readonly options; private readonly server; private readonly sseClients; private listening?; private heartbeat?; private closed; constructor(runtime: StandaloneWorkflowRuntime, options?: StandaloneWorkflowServerOptions); listen(): Promise; address(): ListeningStandaloneWorkflowServer | undefined; close(options?: { closeRuntime?: boolean; }): Promise; private readonly onRuntimeEvent; private handle; private openEventStream; private authorized; private originAllowed; private sendJson; } export declare function standaloneRuntimeDescriptorPath(cwd: string): string; export declare function readRuntimeDescriptor(cwd: string, descriptorPath?: string): RuntimeDescriptor | null;