Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/util/schema.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {FunctionDefinition, LiteralValue, NodeFunction, ReferenceValue,} from "@
* Base interface for all input types.
* Provides common properties for suggestions and input metadata.
*/
interface Input {
export interface Input {
/** The type of input (string representation) */
input?: string;
/** Array of suggested values (functions, references, or literals) */
Expand All @@ -20,31 +20,31 @@ interface Input {
* Represents a generic input type with no specific structure.
* Used as a fallback when the type cannot be determined.
*/
interface GenericInput extends Input {
export interface GenericInput extends Input {
input?: "generic";
}

/**
* Represents a sub-flow input type (callable/function type).
* Used for types that have call signatures.
*/
interface SubFlowInput extends Input {
export interface SubFlowInput extends Input {
input?: "sub-flow";
}

/**
* Represents primitive input types: boolean, number, text, or select.
* Extends the base Input interface to include suggestions.
*/
interface PrimitiveInput extends Input {
export interface PrimitiveInput extends Input {
input?: "boolean" | "number" | "text" | "select";
}

/**
* Represents a data object input type with structured properties.
* Includes property definitions and required field tracking.
*/
interface DataInput extends Input {
export interface DataInput extends Input {
input?: "data";
/** Record mapping property names to their schemas */
properties?: Record<string, Schema | Schema[]>;
Expand All @@ -56,17 +56,17 @@ interface DataInput extends Input {
* Represents a list/array input type with item schemas.
* Supports homogeneous or heterogeneous arrays.
*/
interface ListInput extends Input {
export interface ListInput extends Input {
input?: "list";
/** Schema or array of schemas for list items */
items?: Schema | Schema[];
items?: Schema[];
}

/**
* Represents a complex type input with properties and required fields.
* Similar to DataInput but used for type definitions.
*/
interface TypeInput extends Input {
export interface TypeInput extends Input {
input?: "type";
/** Record mapping property names to their schemas */
properties?: Record<string, Schema | Schema[]>;
Expand Down Expand Up @@ -178,7 +178,7 @@ export const getSchema = (

return {
input: "list",
items: itemSchemas.length === 1 ? itemSchemas[0] : itemSchemas,
items: itemSchemas,
...combinedSuggestions,
};
}
Expand Down