import type { IControllerStatus, TControllerProcessMode } from '../ts_interfaces/index.js'; import type { IAuthoritySocketPaths } from './classes.authorityclient.js'; import type { IControllerRuntimeOverrides } from './interfaces.config.js'; export interface IControllerStartOptions { processMode: TControllerProcessMode; runtimeOverrides: IControllerRuntimeOverrides; /** * Where the per-user account authority listens. * * Deliberately opt-in and deliberately not resolved inside the controller: the authority is one * shared per-user endpoint, so a controller that resolved it by itself would have every test run * subscribing to the developer's own accounts. The single production entry point supplies it; * a controller built without it reports the authority as absent and opens no connection. */ accountAuthority?: IAuthoritySocketPaths; /** Operator-provided first-start setup code; a random code is minted when absent. */ setupCode?: string; /** Private upgrade transaction token received over parent IPC. */ upgradeToken?: string; upgradeGlobalRoot?: string; onStartupBlocked?: (errorArg: Error) => Promise; } export interface IControllerStartResult { status: IControllerStatus; publicUrl: string; setupCode?: string; } export interface IControllerReadyIpcMessage { type: 'ready'; status: IControllerStatus; publicUrl: string; setupCode?: string; } export interface IControllerStartupErrorIpcMessage { type: 'startupError'; message: string; retained?: true; } export interface IControllerStartIpcMessage { type: 'start'; /** Transported over IPC so the code never appears in the detached child's argv. */ setupCode?: string; /** Transported over IPC so the token never appears in the detached child's argv. */ upgradeToken?: string; upgradeGlobalRoot?: string; } export type TControllerIpcMessage = | IControllerReadyIpcMessage | IControllerStartupErrorIpcMessage | IControllerStartIpcMessage;