import { type CursorReceiveReader } from "./cursor-receiver.js"; import type { ProductProfile } from "./profile.js"; export interface WaitProcess { executable: string; args: string[]; windows_start_process_argument_list: string | null; } /** 親の背景process APIへそのまま渡す起動情報。scriptは製品のCursor受信入口の絶対path。 */ export declare function cursorReceiveProcess(script: string, deliveryId: string, executable?: string): WaitProcess; /** * 背景processの起動情報を、親のshellへ書ける1行にする(Windowsの既定shellはPowerShell)。 * Cursor CLIのmodelはtool結果のstructuredContentを読まないので、起動情報は本文にこの行で書く。 */ export declare function waitProcessCommandLine(wait: { executable: string; args: readonly string[]; }, platform?: NodeJS.Platform): string; /** 受信processの出力先。結果を書く口と、読み手(このprocessを背景で起こした親)が居るかを確かめる口。 */ export interface ReceiveOutput extends CursorReceiveReader { emit(value: unknown): Promise; close(): void; } /** * このprocessのstdoutを出力先にする。 * 親が終わると、親が持っていたstdoutの読み口が閉じる。POSIXのNodeは子のstdoutをsocketでつなぐので、閉じた時点で分かる。 * それ以外(Windowsのpipeなど)は、書いてみて失敗するかで確かめる。 */ export declare function stdoutOutput(): ReceiveOutput; /** 受信入口の本体。結果を1行のJSONでstdoutへ出し、exit codeを返す(0=受取、3=期限切れ、5=読み手なし、1=誤り)。 * hookRootを複数渡すと、配送記録のある置き場で待つ(runCursorHookMainと同じ理由)。どこにも無ければ先頭の置き場で誤りを返す。 * outputに関数を渡すと、読み手を確かめずにその関数へ結果を渡す。 */ export declare function runCursorReceive(hookRoot: string | readonly string[], argv: string[], output?: ((value: unknown) => void) | ReceiveOutput, usage?: string, profile?: ProductProfile): Promise;