/** * Pause lifecycle of `ptbk coder run`. */ export type CoderRunPauseState = 'RUNNING' | 'PAUSING' | 'PAUSED'; /** * Result of toggling the pause hotkey state. */ export type CoderRunPauseToggleResult = 'REQUESTED_PAUSE' | 'CANCELLED_PAUSE' | 'RESUMED'; /** * Result of requesting a timed wait skip. */ export type CoderRunSkipCurrentWaitResult = 'REQUESTED_SKIP' | 'NO_ACTIVE_WAIT'; /** * Result of toggling the dynamic end-after-current-prompt state. */ export type CoderRunEndAfterCurrentPromptToggleResult = 'REQUESTED_END' | 'CANCELLED_END'; /** * Token that identifies one active timed wait which can be skipped by the user. */ export type CoderRunSkippableWaitToken = symbol; /** * Applies the same three-state toggle used by the `P` hotkey. */ export declare function togglePauseState(): CoderRunPauseToggleResult; /** * Applies the two-state toggle used by the `X` hotkey. */ export declare function toggleEndAfterCurrentPromptState(): CoderRunEndAfterCurrentPromptToggleResult; /** * Returns whether the dynamic end-after-current-prompt control is active. */ export declare function getEndAfterCurrentPromptState(): boolean; /** * Starts one timed wait which can be skipped by the `S` hotkey. */ export declare function beginSkippableWait(): CoderRunSkippableWaitToken; /** * Finishes one timed wait and clears any skip request that belonged to it. */ export declare function finishSkippableWait(waitToken: CoderRunSkippableWaitToken): void; /** * Requests that the currently active timed wait ends immediately. */ export declare function requestSkipCurrentWait(): CoderRunSkipCurrentWaitResult; /** * Returns whether one timed wait should end early. */ export declare function shouldSkipCurrentWait(waitToken: CoderRunSkippableWaitToken): boolean; /** * Waits for either a timeout or an `S` hotkey skip request. */ export declare function waitForSkippableMilliseconds(waitToken: CoderRunSkippableWaitToken, durationMs: number): Promise; /** * Restores all shared terminal controls to their default state. */ export declare function resetCoderRunControls(): void; /** * If the execution is paused, it will wait until it is resumed. * * @param options.silent - When `true`, suppresses console output (used when the terminal UI handles display). * @param options.onPaused - Callback invoked when entering the PAUSED state. * @param options.onResumed - Callback invoked when leaving the PAUSED state. */ export declare function checkPause(options?: { silent?: boolean; onPaused?: () => void; onResumed?: () => void; }): Promise; /** * Returns the current pause state for external consumers such as the terminal UI. */ export declare function getPauseState(): CoderRunPauseState; /** * Returns the label of the next checkpoint where pausing will take effect. */ export declare function getPauseTargetLabel(): string; /** * Updates the label of the next pause checkpoint. */ export declare function announcePauseTargetLabel(nextPauseTargetLabel: string): void; /** * Restores the default generic pause target label. */ export declare function resetPauseTargetLabel(): void; /** * Requests a pause from an external controller (e.g. the Ink UI). */ export declare function requestPause(): void; /** * Resumes execution from an external controller after a pause. */ export declare function requestResume(): void;