Skip to content

Commit b95f18d

Browse files
authored
Merge pull request #87 from code0-tech/feat/function-schema
Export input-related interfaces
2 parents 4db74ac + 3428ea2 commit b95f18d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/util/schema.util.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {FunctionDefinition, LiteralValue, NodeFunction, ReferenceValue,} from "@
99
* Base interface for all input types.
1010
* Provides common properties for suggestions and input metadata.
1111
*/
12-
interface Input {
12+
export interface Input {
1313
/** The type of input (string representation) */
1414
input?: string;
1515
/** Array of suggested values (functions, references, or literals) */
@@ -20,31 +20,31 @@ interface Input {
2020
* Represents a generic input type with no specific structure.
2121
* Used as a fallback when the type cannot be determined.
2222
*/
23-
interface GenericInput extends Input {
23+
export interface GenericInput extends Input {
2424
input?: "generic";
2525
}
2626

2727
/**
2828
* Represents a sub-flow input type (callable/function type).
2929
* Used for types that have call signatures.
3030
*/
31-
interface SubFlowInput extends Input {
31+
export interface SubFlowInput extends Input {
3232
input?: "sub-flow";
3333
}
3434

3535
/**
3636
* Represents primitive input types: boolean, number, text, or select.
3737
* Extends the base Input interface to include suggestions.
3838
*/
39-
interface PrimitiveInput extends Input {
39+
export interface PrimitiveInput extends Input {
4040
input?: "boolean" | "number" | "text" | "select";
4141
}
4242

4343
/**
4444
* Represents a data object input type with structured properties.
4545
* Includes property definitions and required field tracking.
4646
*/
47-
interface DataInput extends Input {
47+
export interface DataInput extends Input {
4848
input?: "data";
4949
/** Record mapping property names to their schemas */
5050
properties?: Record<string, Schema | Schema[]>;
@@ -56,17 +56,17 @@ interface DataInput extends Input {
5656
* Represents a list/array input type with item schemas.
5757
* Supports homogeneous or heterogeneous arrays.
5858
*/
59-
interface ListInput extends Input {
59+
export interface ListInput extends Input {
6060
input?: "list";
6161
/** Schema or array of schemas for list items */
62-
items?: Schema | Schema[];
62+
items?: Schema[];
6363
}
6464

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

179179
return {
180180
input: "list",
181-
items: itemSchemas.length === 1 ? itemSchemas[0] : itemSchemas,
181+
items: itemSchemas,
182182
...combinedSuggestions,
183183
};
184184
}

0 commit comments

Comments
 (0)