/** * Minimal logger interface for the bridge. */ export interface IRustBridgeLogger { log(level: string, message: string, data?: Record): void; } /** * Options for locating a Rust binary. */ export interface IBinaryLocatorOptions { /** Name of the binary (e.g., 'rustproxy') */ binaryName: string; /** Environment variable to check for explicit binary path (e.g., 'SMARTPROXY_RUST_BINARY') */ envVarName?: string; /** Prefix for platform-specific npm packages (e.g., '@push.rocks/smartproxy') */ platformPackagePrefix?: string; /** Additional local paths to search (defaults to ./rust/target/release/ and ./rust/target/debug/) */ localPaths?: string[]; /** Whether to search the system PATH (default: true) */ searchSystemPath?: boolean; /** Explicit binary path override - skips all other search */ binaryPath?: string; } /** * Options for the RustBridge. */ export interface IRustBridgeOptions extends IBinaryLocatorOptions { /** CLI arguments passed to the binary (default: ['--management']) */ cliArgs?: string[]; /** Timeout for individual requests in ms (default: 30000) */ requestTimeoutMs?: number; /** Timeout for the ready event during spawn in ms (default: 10000) */ readyTimeoutMs?: number; /** Additional environment variables for the child process */ env?: Record; /** Name of the ready event emitted by the Rust binary (default: 'ready') */ readyEventName?: string; /** Optional logger instance */ logger?: IRustBridgeLogger; }