/** * City 宿主进程协调协议。 * * 该模块只协调 CLI 与 Desktop 的 City 宿主,不保存 Agent 配置,也不改变 * Agent 的生命周期模型。宿主启动前读取状态,确认后可以请求已有宿主退出。 */ /** City 宿主类型。 */ export type CityHostOwner = "cli" | "desktop"; /** City 宿主状态文件内容。 */ export interface CityHostState { /** 当前宿主类型。 */ owner: CityHostOwner; /** 操作系统进程 ID。 */ pid: number; /** 本次宿主实例的唯一 ID。 */ instance_id: string; /** 宿主启动时间。 */ started_at: string; /** 可选 HTTP 地址。 */ http_host?: string; /** 可选 HTTP 端口。 */ http_port?: number; /** 可选 RPC 地址。 */ rpc_host?: string; /** 可选 RPC 端口。 */ rpc_port?: number; } /** 当前宿主状态文件路径。 */ export declare function get_city_host_state_path(): string; /** 生成本次宿主实例 ID。 */ export declare function create_city_host_instance_id(): string; /** 读取当前 City 宿主状态。无效或已退出的状态返回 null。 */ export declare function read_city_host_state(): Promise; /** 登记当前 City 宿主。 */ export declare function register_city_host(state: CityHostState): Promise; /** 只删除仍属于当前实例的宿主状态。 */ export declare function unregister_city_host(instance_id: string): Promise; /** 请求已有宿主退出并等待进程释放资源。 */ export declare function request_city_host_shutdown(state: CityHostState, timeout_ms?: number): Promise; /** 等待指定宿主进程退出;超时不会强制杀死进程。 */ export declare function wait_for_city_host_exit(state: CityHostState, timeout_ms?: number): Promise; /** 检查进程是否存活。 */ export declare function is_process_alive(pid: number): boolean; //# sourceMappingURL=CityHostRegistry.d.ts.map