Skip to content

Commit 0add9e4

Browse files
authored
feat: revisit input schema types export and fix missing editor option (#620)
1 parent 896b9c3 commit 0add9e4

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

packages/input_schema/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ export {
77
NumberFieldDefinition,
88
ObjectFieldDefinition,
99
ArrayFieldDefinition,
10+
11+
ResourceFieldDefinition,
12+
ResourceArrayFieldDefinition,
13+
1014
MixedFieldDefinition,
1115
FieldDefinition,
1216

1317
InputSchema,
14-
15-
McpServer,
16-
McpServerTools,
1718
} from './types';
1819
export * from './utilities';

packages/input_schema/src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ type StorageResourceFieldDefinition<T> = CommonResourceFieldDefinition<T> & {
8181
resourcePermissions?: ('READ' | 'WRITE')[];
8282
}
8383

84-
export type McpServerTools = {
84+
type McpServerTools = {
8585
required?: string[];
8686
readOnly?: boolean;
8787
destructive?: boolean;
8888
idempotent?: boolean;
8989
openWorld?: boolean;
9090
}
9191

92-
export type McpServer = {
92+
type McpServer = {
9393
url: string;
9494
tools?: McpServerTools;
9595
}
@@ -105,6 +105,8 @@ type AnyResourceFieldDefinition<T> =
105105

106106
export type ResourceFieldDefinition = AnyResourceFieldDefinition<string> & {
107107
type: 'string';
108+
// Singular resource field also supports 'textfield' editor, unlike the array variant.
109+
editor?: CommonResourceFieldDefinition<string>['editor'] | 'textfield';
108110
}
109111

110112
export type ResourceArrayFieldDefinition = AnyResourceFieldDefinition<string[]> & {

0 commit comments

Comments
 (0)