/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IRunConfig, ITask, ITaskConstructor, TaskGraph } from "@workglow/task-graph"; import type { InputTaskConfig } from "@workglow/tasks"; import type { PromptFieldDescriptor } from "../input/prompt"; import type { SearchSelectAppProps, SearchSelectItem } from "./SearchSelectApp"; export type { SearchPage, SearchSelectItem } from "./SearchSelectApp"; interface RenderOptions { readonly outputJsonFile?: string; /** When true, do not print JSON to stdout on success (TUI embed / library use). */ readonly suppressResultOutput?: boolean; } export declare function renderTaskRun(Ctor: ITaskConstructor, input: Record, opts: RenderOptions & { readonly config?: InputTaskConfig; }): Promise; export declare function renderWorkflowRun(graph: TaskGraph, input: Record, opts: RenderOptions & { readonly config?: InputTaskConfig; readonly runExecutor?: () => Promise; }): Promise; export declare function renderTaskInstanceRun(task: ITask, taskType: string, opts: RenderOptions & { readonly overrides?: Record; readonly runConfig?: Partial; }): Promise; export interface SchemaPromptRenderOptions { readonly initialFocusedFieldKey?: string; } /** * How a form that can also be refused came back. A refusal is not an empty * submission and not an abandonment, so it cannot be squeezed into * `values | undefined` — see {@link renderRefusableSchemaPrompt}. */ export type RefusableFormOutcome = { readonly status: "submitted"; readonly values: Record; } | { readonly status: "declined"; } | { readonly status: "cancelled"; }; /** * The form, with the action row that lets a person refuse it. * * Separate from {@link renderSchemaPrompt} rather than a flag on it: the two * other callers offer no refusal, and widening their return type would make * them handle a case they cannot produce. */ export declare function renderRefusableSchemaPrompt(fields: readonly PromptFieldDescriptor[], options?: SchemaPromptRenderOptions, signal?: AbortSignal): Promise; export declare function renderSchemaPrompt(fields: readonly PromptFieldDescriptor[], options?: SchemaPromptRenderOptions, signal?: AbortSignal): Promise | undefined>; export declare function renderSearchSelect(props: Omit, "onSelect" | "onCancel">): Promise; export declare function renderSelectPrompt(options: Array<{ label: string; value: string; }>, message?: string, signal?: AbortSignal): Promise;