/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { DataPortSchemaObject } from "@workglow/util/schema"; export interface PromptFieldDescriptor { readonly key: string; readonly type: "string" | "number" | "integer" | "boolean" | "enum" | "array" | "object"; readonly label: string; readonly description?: string; readonly format?: string; readonly enumValues?: readonly string[]; readonly defaultValue?: unknown; readonly required: boolean; } /** * Walk schema properties and return descriptors for missing required fields. * Evaluates allOf if/then conditions to include conditionally required fields. */ export declare function getMissingFields(input: Record, schema: DataPortSchemaObject): PromptFieldDescriptor[]; /** * Walk schema properties and return descriptors for ALL visible fields, * pre-populated with current values from input. */ export declare function getAllFields(input: Record, schema: DataPortSchemaObject): PromptFieldDescriptor[]; /** * Builds field descriptors for an Ink form (including model/credential option enrichment). */ export declare function prepareSchemaFormFields(input: Record, schema: DataPortSchemaObject): Promise; export interface PromptEditableInputOptions { /** Schema field `key` to focus first (e.g. `"value"` when Key was pre-filled from the CLI). */ readonly initialFocusedFieldKey?: string; } /** * Present a full editable form with all schema fields pre-populated from input. * Returns the edited values merged with input, or exits if cancelled. */ export declare function promptEditableInput(input: Record, schema: DataPortSchemaObject, options?: PromptEditableInputOptions): Promise>; /** * Prompt the user interactively for missing required fields (TTY only). * Loops to handle conditionally required fields that emerge after initial answers. * Returns the input with prompted values merged in. */ export declare function promptMissingInput(input: Record, schema: DataPortSchemaObject): Promise>;