skedyul 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp +1 -1
- package/dist/config/app-config.d.ts +73 -0
- package/dist/config/app-config.js +12 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.js +33 -0
- package/dist/config/loader.d.ts +7 -0
- package/dist/config/loader.js +119 -0
- package/dist/config/types/agent.d.ts +29 -0
- package/dist/config/types/agent.js +5 -0
- package/dist/config/types/channel.d.ts +46 -0
- package/dist/config/types/channel.js +2 -0
- package/dist/config/types/compute.d.ts +1 -0
- package/dist/config/types/compute.js +5 -0
- package/dist/config/types/env.d.ts +16 -0
- package/dist/config/types/env.js +5 -0
- package/dist/config/types/index.d.ts +9 -0
- package/dist/config/types/index.js +26 -0
- package/dist/config/types/model.d.ts +62 -0
- package/dist/config/types/model.js +2 -0
- package/dist/config/types/page.d.ts +436 -0
- package/dist/config/types/page.js +5 -0
- package/dist/config/types/resource.d.ts +30 -0
- package/dist/config/types/resource.js +5 -0
- package/dist/config/types/webhook.d.ts +35 -0
- package/dist/config/types/webhook.js +5 -0
- package/dist/config/types/workflow.d.ts +24 -0
- package/dist/config/types/workflow.js +2 -0
- package/dist/config/utils.d.ts +16 -0
- package/dist/config/utils.js +37 -0
- package/dist/config.d.ts +5 -767
- package/dist/config.js +11 -151
- package/dist/schemas.d.ts +43 -43
- package/dist/server/core-api-handler.d.ts +8 -0
- package/dist/server/core-api-handler.js +148 -0
- package/dist/server/dedicated.d.ts +7 -0
- package/dist/server/dedicated.js +610 -0
- package/dist/server/handler-helpers.d.ts +24 -0
- package/dist/server/handler-helpers.js +75 -0
- package/dist/server/index.d.ts +19 -0
- package/dist/server/index.js +196 -0
- package/dist/server/serverless.d.ts +7 -0
- package/dist/server/serverless.js +629 -0
- package/dist/server/startup-logger.d.ts +9 -0
- package/dist/server/startup-logger.js +113 -0
- package/dist/server/tool-handler.d.ts +14 -0
- package/dist/server/tool-handler.js +189 -0
- package/dist/server/types.d.ts +22 -0
- package/dist/server/types.js +2 -0
- package/dist/server/utils/env.d.ts +12 -0
- package/dist/server/utils/env.js +38 -0
- package/dist/server/utils/http.d.ts +30 -0
- package/dist/server/utils/http.js +81 -0
- package/dist/server/utils/index.d.ts +3 -0
- package/dist/server/utils/index.js +24 -0
- package/dist/server/utils/schema.d.ts +22 -0
- package/dist/server/utils/schema.js +102 -0
- package/dist/server.d.ts +7 -11
- package/dist/server.js +39 -2026
- package/dist/types/aws.d.ts +15 -0
- package/dist/types/aws.js +5 -0
- package/dist/types/handlers.d.ts +122 -0
- package/dist/types/handlers.js +2 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.js +16 -0
- package/dist/types/server.d.ts +43 -0
- package/dist/types/server.js +2 -0
- package/dist/types/shared.d.ts +16 -0
- package/dist/types/shared.js +5 -0
- package/dist/types/tool-context.d.ts +64 -0
- package/dist/types/tool-context.js +12 -0
- package/dist/types/tool.d.ts +96 -0
- package/dist/types/tool.js +19 -0
- package/dist/types/webhook.d.ts +116 -0
- package/dist/types/webhook.js +7 -0
- package/dist/types.d.ts +4 -461
- package/dist/types.js +21 -31
- package/package.json +2 -2
package/dist/config.d.ts
CHANGED
|
@@ -1,769 +1,7 @@
|
|
|
1
|
-
import type { ToolRegistry, WebhookRegistry, ToolMetadata, WebhookMetadata } from './types';
|
|
2
|
-
export type EnvVisibility = 'visible' | 'encrypted';
|
|
3
|
-
export interface EnvVariableDefinition {
|
|
4
|
-
/** Human-readable label for the variable */
|
|
5
|
-
label: string;
|
|
6
|
-
/** Whether this variable is required */
|
|
7
|
-
required?: boolean;
|
|
8
|
-
/** Visibility setting (encrypted values are hidden in UI) */
|
|
9
|
-
visibility?: EnvVisibility;
|
|
10
|
-
/** Default value if not provided */
|
|
11
|
-
default?: string;
|
|
12
|
-
/** Description/help text */
|
|
13
|
-
description?: string;
|
|
14
|
-
/** Placeholder text for input fields */
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
}
|
|
17
|
-
export type EnvSchema = Record<string, EnvVariableDefinition>;
|
|
18
|
-
export type ComputeLayerType = 'serverless' | 'dedicated';
|
|
19
|
-
/** Scope of a model: INTERNAL (app-owned) or SHARED (user-mapped) */
|
|
20
|
-
export type ResourceScope = 'INTERNAL' | 'SHARED';
|
|
21
1
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
2
|
+
* Config module - re-exports from the config folder
|
|
3
|
+
*
|
|
4
|
+
* This file maintains backward compatibility while the actual configuration types
|
|
5
|
+
* have been split into smaller, focused modules in the config/ folder.
|
|
26
6
|
*/
|
|
27
|
-
export
|
|
28
|
-
/**
|
|
29
|
-
* StructuredFilter for conditional dependencies.
|
|
30
|
-
* Format: { fieldHandle: { operator: value | value[] } }
|
|
31
|
-
*/
|
|
32
|
-
export type StructuredFilter = Record<string, Record<string, string | number | boolean | (string | number | boolean)[]>>;
|
|
33
|
-
/** Model dependency reference */
|
|
34
|
-
export interface ModelDependency {
|
|
35
|
-
model: string;
|
|
36
|
-
fields?: string[];
|
|
37
|
-
where?: StructuredFilter;
|
|
38
|
-
}
|
|
39
|
-
/** Channel dependency reference */
|
|
40
|
-
export interface ChannelDependency {
|
|
41
|
-
channel: string;
|
|
42
|
-
}
|
|
43
|
-
/** Workflow dependency reference */
|
|
44
|
-
export interface WorkflowDependency {
|
|
45
|
-
workflow: string;
|
|
46
|
-
}
|
|
47
|
-
/** Union of all resource dependency types */
|
|
48
|
-
export type ResourceDependency = ModelDependency | ChannelDependency | WorkflowDependency;
|
|
49
|
-
export type InternalFieldDataType = 'LONG_STRING' | 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATE_TIME' | 'TIME' | 'FILE' | 'IMAGE' | 'RELATION' | 'OBJECT';
|
|
50
|
-
export interface FieldOption {
|
|
51
|
-
label: string;
|
|
52
|
-
value: string;
|
|
53
|
-
color?: string;
|
|
54
|
-
}
|
|
55
|
-
export interface InlineFieldDefinition {
|
|
56
|
-
limitChoices?: number;
|
|
57
|
-
options?: FieldOption[];
|
|
58
|
-
minLength?: number;
|
|
59
|
-
maxLength?: number;
|
|
60
|
-
min?: number;
|
|
61
|
-
max?: number;
|
|
62
|
-
relatedModel?: string;
|
|
63
|
-
pattern?: string;
|
|
64
|
-
}
|
|
65
|
-
export interface AppFieldVisibility {
|
|
66
|
-
data?: boolean;
|
|
67
|
-
list?: boolean;
|
|
68
|
-
filters?: boolean;
|
|
69
|
-
}
|
|
70
|
-
export interface ModelFieldDefinition {
|
|
71
|
-
handle: string;
|
|
72
|
-
label: string;
|
|
73
|
-
type?: InternalFieldDataType;
|
|
74
|
-
definitionHandle?: string;
|
|
75
|
-
definition?: InlineFieldDefinition;
|
|
76
|
-
required?: boolean;
|
|
77
|
-
unique?: boolean;
|
|
78
|
-
system?: boolean;
|
|
79
|
-
isList?: boolean;
|
|
80
|
-
defaultValue?: {
|
|
81
|
-
value: unknown;
|
|
82
|
-
};
|
|
83
|
-
description?: string;
|
|
84
|
-
visibility?: AppFieldVisibility;
|
|
85
|
-
owner?: FieldOwner;
|
|
86
|
-
}
|
|
87
|
-
export interface ModelDefinition {
|
|
88
|
-
handle: string;
|
|
89
|
-
name: string;
|
|
90
|
-
namePlural?: string;
|
|
91
|
-
scope: ResourceScope;
|
|
92
|
-
labelTemplate?: string;
|
|
93
|
-
description?: string;
|
|
94
|
-
fields: ModelFieldDefinition[];
|
|
95
|
-
requires?: ResourceDependency[];
|
|
96
|
-
}
|
|
97
|
-
export type RelationshipCardinality = 'ONE_TO_ONE' | 'ONE_TO_MANY' | 'MANY_TO_ONE' | 'MANY_TO_MANY';
|
|
98
|
-
export type OnDeleteBehavior = 'NONE' | 'CASCADE' | 'RESTRICT';
|
|
99
|
-
export interface RelationshipLink {
|
|
100
|
-
model: string;
|
|
101
|
-
field: string;
|
|
102
|
-
label: string;
|
|
103
|
-
cardinality: RelationshipCardinality;
|
|
104
|
-
onDelete?: OnDeleteBehavior;
|
|
105
|
-
}
|
|
106
|
-
export interface RelationshipDefinition {
|
|
107
|
-
source: RelationshipLink;
|
|
108
|
-
target: RelationshipLink;
|
|
109
|
-
}
|
|
110
|
-
/** Standard capability types for communication channels */
|
|
111
|
-
export type ChannelCapabilityType = 'messaging' | 'voice' | 'video';
|
|
112
|
-
/** Capability definition with display info and handler references */
|
|
113
|
-
export interface ChannelCapability {
|
|
114
|
-
/** Display name: "SMS", "WhatsApp Messages" */
|
|
115
|
-
name: string;
|
|
116
|
-
/** Lucide icon name */
|
|
117
|
-
icon?: string;
|
|
118
|
-
/** Inbound webhook handler */
|
|
119
|
-
receive?: string;
|
|
120
|
-
/** Outbound tool handle */
|
|
121
|
-
send?: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ChannelFieldPermissions {
|
|
124
|
-
read?: boolean;
|
|
125
|
-
write?: boolean;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Field definition for channel field mappings.
|
|
129
|
-
* One field should have identifier: true to mark it as the channel identifier.
|
|
130
|
-
*/
|
|
131
|
-
export interface ChannelFieldDefinition {
|
|
132
|
-
handle: string;
|
|
133
|
-
label: string;
|
|
134
|
-
definition: {
|
|
135
|
-
handle: string;
|
|
136
|
-
};
|
|
137
|
-
/** Marks this field as the identifier field for the channel */
|
|
138
|
-
identifier?: boolean;
|
|
139
|
-
required?: boolean;
|
|
140
|
-
defaultValue?: {
|
|
141
|
-
value: unknown;
|
|
142
|
-
};
|
|
143
|
-
visibility?: AppFieldVisibility;
|
|
144
|
-
permissions?: ChannelFieldPermissions;
|
|
145
|
-
}
|
|
146
|
-
export interface ChannelDefinition {
|
|
147
|
-
handle: string;
|
|
148
|
-
name: string;
|
|
149
|
-
icon?: string;
|
|
150
|
-
/** Field definitions for channel. One field must have identifier: true. */
|
|
151
|
-
fields: ChannelFieldDefinition[];
|
|
152
|
-
/** Capabilities keyed by standard type (messaging, voice, video) */
|
|
153
|
-
capabilities: Partial<Record<ChannelCapabilityType, ChannelCapability>>;
|
|
154
|
-
}
|
|
155
|
-
export interface WorkflowActionInput {
|
|
156
|
-
key: string;
|
|
157
|
-
label: string;
|
|
158
|
-
fieldRef?: {
|
|
159
|
-
fieldHandle: string;
|
|
160
|
-
entityHandle: string;
|
|
161
|
-
};
|
|
162
|
-
template?: string;
|
|
163
|
-
}
|
|
164
|
-
export interface WorkflowAction {
|
|
165
|
-
label: string;
|
|
166
|
-
handle: string;
|
|
167
|
-
batch?: boolean;
|
|
168
|
-
entityHandle?: string;
|
|
169
|
-
inputs?: WorkflowActionInput[];
|
|
170
|
-
}
|
|
171
|
-
export interface WorkflowDefinition {
|
|
172
|
-
path: string;
|
|
173
|
-
label?: string;
|
|
174
|
-
handle?: string;
|
|
175
|
-
requires?: ResourceDependency[];
|
|
176
|
-
actions: WorkflowAction[];
|
|
177
|
-
}
|
|
178
|
-
export type PageType = 'INSTANCE' | 'LIST';
|
|
179
|
-
export type PageBlockType = 'form' | 'spreadsheet' | 'kanban' | 'calendar' | 'link' | 'list' | 'card';
|
|
180
|
-
export type PageFieldType = 'STRING' | 'FILE' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'SELECT' | 'FORM' | 'RELATIONSHIP';
|
|
181
|
-
export interface PageFieldSource {
|
|
182
|
-
model: string;
|
|
183
|
-
field: string;
|
|
184
|
-
}
|
|
185
|
-
export interface PageFormHeader {
|
|
186
|
-
title: string;
|
|
187
|
-
description?: string;
|
|
188
|
-
}
|
|
189
|
-
export interface PageActionDefinition {
|
|
190
|
-
handle: string;
|
|
191
|
-
/** Button label - supports Liquid templates e.g. "{{ compliance_records[0].status == 'APPROVED' ? 'Register' : 'Pending' }}" */
|
|
192
|
-
label: string;
|
|
193
|
-
handler: string;
|
|
194
|
-
icon?: string;
|
|
195
|
-
variant?: 'primary' | 'secondary' | 'destructive';
|
|
196
|
-
/** Whether the action is disabled - boolean or Liquid template string e.g. "{{ compliance_records[0].status != 'APPROVED' }}" */
|
|
197
|
-
isDisabled?: boolean | string;
|
|
198
|
-
/** Whether the action is hidden - boolean or Liquid template string */
|
|
199
|
-
isHidden?: boolean | string;
|
|
200
|
-
}
|
|
201
|
-
/** Base style props for FormV2 components */
|
|
202
|
-
export interface FormV2StyleProps {
|
|
203
|
-
id: string;
|
|
204
|
-
row: number;
|
|
205
|
-
col: number;
|
|
206
|
-
className?: string;
|
|
207
|
-
hidden?: boolean;
|
|
208
|
-
}
|
|
209
|
-
/** Button props for FieldSetting component */
|
|
210
|
-
export interface FieldSettingButtonProps {
|
|
211
|
-
label: string;
|
|
212
|
-
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
213
|
-
size?: 'default' | 'sm' | 'lg' | 'icon';
|
|
214
|
-
isLoading?: boolean;
|
|
215
|
-
/** Can be boolean or Liquid template string that resolves to boolean */
|
|
216
|
-
isDisabled?: boolean | string;
|
|
217
|
-
leftIcon?: string;
|
|
218
|
-
}
|
|
219
|
-
/** Relationship extension for dynamic data loading */
|
|
220
|
-
export interface RelationshipExtension {
|
|
221
|
-
model: string;
|
|
222
|
-
}
|
|
223
|
-
/** Modal form definition for nested forms (handled by skedyul-web, not skedyul-ui) */
|
|
224
|
-
export interface ModalFormDefinition {
|
|
225
|
-
header: PageFormHeader;
|
|
226
|
-
handler: string;
|
|
227
|
-
/** Named dialog template to use instead of inline fields */
|
|
228
|
-
template?: string;
|
|
229
|
-
/** Template-specific params to pass to the dialog */
|
|
230
|
-
templateParams?: Record<string, unknown>;
|
|
231
|
-
/** Inline field definitions (used when template is not specified) */
|
|
232
|
-
fields?: FormV2ComponentDefinition[];
|
|
233
|
-
layout?: FormLayoutConfigDefinition;
|
|
234
|
-
actions?: PageActionDefinition[];
|
|
235
|
-
}
|
|
236
|
-
/** Input component definition */
|
|
237
|
-
export interface InputComponentDefinition extends FormV2StyleProps {
|
|
238
|
-
component: 'Input';
|
|
239
|
-
props: {
|
|
240
|
-
label?: string;
|
|
241
|
-
placeholder?: string;
|
|
242
|
-
helpText?: string;
|
|
243
|
-
type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'hidden';
|
|
244
|
-
required?: boolean;
|
|
245
|
-
disabled?: boolean;
|
|
246
|
-
value?: string | number;
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
/** Textarea component definition */
|
|
250
|
-
export interface TextareaComponentDefinition extends FormV2StyleProps {
|
|
251
|
-
component: 'Textarea';
|
|
252
|
-
props: {
|
|
253
|
-
label?: string;
|
|
254
|
-
placeholder?: string;
|
|
255
|
-
helpText?: string;
|
|
256
|
-
required?: boolean;
|
|
257
|
-
disabled?: boolean;
|
|
258
|
-
value?: string;
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
/** Select component definition */
|
|
262
|
-
export interface SelectComponentDefinition extends FormV2StyleProps {
|
|
263
|
-
component: 'Select';
|
|
264
|
-
props: {
|
|
265
|
-
label?: string;
|
|
266
|
-
placeholder?: string;
|
|
267
|
-
helpText?: string;
|
|
268
|
-
/** Static items array (will be populated by iterable if using dynamic items) */
|
|
269
|
-
items?: Array<{
|
|
270
|
-
value: string;
|
|
271
|
-
label: string;
|
|
272
|
-
}> | string;
|
|
273
|
-
value?: string;
|
|
274
|
-
isDisabled?: boolean;
|
|
275
|
-
required?: boolean;
|
|
276
|
-
};
|
|
277
|
-
/** For relationship-based selects */
|
|
278
|
-
relationship?: RelationshipExtension;
|
|
279
|
-
/** For dynamic items using iterable pattern (e.g., 'system.models') */
|
|
280
|
-
iterable?: string;
|
|
281
|
-
/** Template for each item in the iterable */
|
|
282
|
-
itemTemplate?: {
|
|
283
|
-
value: string;
|
|
284
|
-
label: string;
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
/** Combobox component definition */
|
|
288
|
-
export interface ComboboxComponentDefinition extends FormV2StyleProps {
|
|
289
|
-
component: 'Combobox';
|
|
290
|
-
props: {
|
|
291
|
-
label?: string;
|
|
292
|
-
placeholder?: string;
|
|
293
|
-
helpText?: string;
|
|
294
|
-
items?: Array<{
|
|
295
|
-
value: string;
|
|
296
|
-
label: string;
|
|
297
|
-
}>;
|
|
298
|
-
value?: string;
|
|
299
|
-
};
|
|
300
|
-
/** For relationship-based comboboxes */
|
|
301
|
-
relationship?: RelationshipExtension;
|
|
302
|
-
}
|
|
303
|
-
/** Checkbox component definition */
|
|
304
|
-
export interface CheckboxComponentDefinition extends FormV2StyleProps {
|
|
305
|
-
component: 'Checkbox';
|
|
306
|
-
props: {
|
|
307
|
-
label?: string;
|
|
308
|
-
helpText?: string;
|
|
309
|
-
checked?: boolean;
|
|
310
|
-
disabled?: boolean;
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
/** DatePicker component definition */
|
|
314
|
-
export interface DatePickerComponentDefinition extends FormV2StyleProps {
|
|
315
|
-
component: 'DatePicker';
|
|
316
|
-
props: {
|
|
317
|
-
label?: string;
|
|
318
|
-
helpText?: string;
|
|
319
|
-
value?: string | Date;
|
|
320
|
-
disabled?: boolean;
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
/** TimePicker component definition */
|
|
324
|
-
export interface TimePickerComponentDefinition extends FormV2StyleProps {
|
|
325
|
-
component: 'TimePicker';
|
|
326
|
-
props: {
|
|
327
|
-
label?: string;
|
|
328
|
-
helpText?: string;
|
|
329
|
-
value?: string;
|
|
330
|
-
disabled?: boolean;
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
/** FieldSetting component definition (button that can open modal) */
|
|
334
|
-
export interface FieldSettingComponentDefinition extends FormV2StyleProps {
|
|
335
|
-
component: 'FieldSetting';
|
|
336
|
-
props: {
|
|
337
|
-
label: string;
|
|
338
|
-
description?: string;
|
|
339
|
-
helpText?: string;
|
|
340
|
-
mode?: 'field' | 'setting';
|
|
341
|
-
/** Status indicator: 'success', 'pending', 'error', 'warning' - can be Liquid template */
|
|
342
|
-
status?: 'success' | 'pending' | 'error' | 'warning' | string;
|
|
343
|
-
/** Text to display alongside status badge - can be Liquid template */
|
|
344
|
-
statusText?: string;
|
|
345
|
-
button: FieldSettingButtonProps;
|
|
346
|
-
};
|
|
347
|
-
/** Nested modal form (handled by skedyul-web) */
|
|
348
|
-
modalForm?: ModalFormDefinition;
|
|
349
|
-
}
|
|
350
|
-
/** ImageSetting component definition */
|
|
351
|
-
export interface ImageSettingComponentDefinition extends FormV2StyleProps {
|
|
352
|
-
component: 'ImageSetting';
|
|
353
|
-
props: {
|
|
354
|
-
label?: string;
|
|
355
|
-
description?: string;
|
|
356
|
-
helpText?: string;
|
|
357
|
-
accept?: string;
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
/** FileSetting component definition for file uploads */
|
|
361
|
-
export interface FileSettingComponentDefinition extends FormV2StyleProps {
|
|
362
|
-
component: 'FileSetting';
|
|
363
|
-
props: {
|
|
364
|
-
label?: string;
|
|
365
|
-
description?: string;
|
|
366
|
-
helpText?: string;
|
|
367
|
-
accept?: string;
|
|
368
|
-
required?: boolean;
|
|
369
|
-
button?: {
|
|
370
|
-
label?: string;
|
|
371
|
-
variant?: 'default' | 'outline' | 'ghost' | 'link';
|
|
372
|
-
size?: 'sm' | 'md' | 'lg';
|
|
373
|
-
};
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
/** Item template for server-side iterable rendering */
|
|
377
|
-
export interface ListItemTemplate {
|
|
378
|
-
component: string;
|
|
379
|
-
span?: number;
|
|
380
|
-
mdSpan?: number;
|
|
381
|
-
lgSpan?: number;
|
|
382
|
-
props: Record<string, unknown>;
|
|
383
|
-
}
|
|
384
|
-
/** List component definition */
|
|
385
|
-
export interface ListComponentDefinition extends FormV2StyleProps {
|
|
386
|
-
component: 'List';
|
|
387
|
-
props: {
|
|
388
|
-
title?: string;
|
|
389
|
-
items?: Array<{
|
|
390
|
-
id: string;
|
|
391
|
-
label: string;
|
|
392
|
-
description?: string;
|
|
393
|
-
}>;
|
|
394
|
-
emptyMessage?: string;
|
|
395
|
-
};
|
|
396
|
-
/** Model to fetch list items from (legacy) */
|
|
397
|
-
model?: string;
|
|
398
|
-
labelField?: string;
|
|
399
|
-
descriptionField?: string;
|
|
400
|
-
icon?: string;
|
|
401
|
-
/** Context variable name to iterate over (e.g., 'phone_numbers') */
|
|
402
|
-
iterable?: string;
|
|
403
|
-
/** Template for each item - use {{ item.xyz }} for field values */
|
|
404
|
-
itemTemplate?: ListItemTemplate;
|
|
405
|
-
}
|
|
406
|
-
/** EmptyForm component definition */
|
|
407
|
-
export interface EmptyFormComponentDefinition extends FormV2StyleProps {
|
|
408
|
-
component: 'EmptyForm';
|
|
409
|
-
props: {
|
|
410
|
-
title?: string;
|
|
411
|
-
description?: string;
|
|
412
|
-
icon?: string;
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
/** Alert component definition for display-only informational content */
|
|
416
|
-
export interface AlertComponentDefinition extends FormV2StyleProps {
|
|
417
|
-
component: 'Alert';
|
|
418
|
-
props: {
|
|
419
|
-
title: string;
|
|
420
|
-
description: string;
|
|
421
|
-
icon?: string;
|
|
422
|
-
variant?: 'default' | 'destructive';
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
/** Union of all FormV2 component definitions */
|
|
426
|
-
export type FormV2ComponentDefinition = InputComponentDefinition | TextareaComponentDefinition | SelectComponentDefinition | ComboboxComponentDefinition | CheckboxComponentDefinition | DatePickerComponentDefinition | TimePickerComponentDefinition | FieldSettingComponentDefinition | ImageSettingComponentDefinition | FileSettingComponentDefinition | ListComponentDefinition | EmptyFormComponentDefinition | AlertComponentDefinition;
|
|
427
|
-
/** Layout column definition */
|
|
428
|
-
export interface FormLayoutColumnDefinition {
|
|
429
|
-
field: string;
|
|
430
|
-
colSpan: number;
|
|
431
|
-
dataType?: string;
|
|
432
|
-
subQuery?: unknown;
|
|
433
|
-
}
|
|
434
|
-
/** Layout row definition */
|
|
435
|
-
export interface FormLayoutRowDefinition {
|
|
436
|
-
columns: FormLayoutColumnDefinition[];
|
|
437
|
-
}
|
|
438
|
-
/** FormLayoutConfig definition (mirrors skedyul-ui FormLayoutConfig) */
|
|
439
|
-
export interface FormLayoutConfigDefinition {
|
|
440
|
-
type: 'form';
|
|
441
|
-
rows: FormLayoutRowDefinition[];
|
|
442
|
-
}
|
|
443
|
-
/** FormV2 props definition */
|
|
444
|
-
export interface FormV2PropsDefinition {
|
|
445
|
-
formVersion: 'v2';
|
|
446
|
-
id?: string;
|
|
447
|
-
fields: FormV2ComponentDefinition[];
|
|
448
|
-
layout: FormLayoutConfigDefinition;
|
|
449
|
-
/** Optional actions that trigger MCP tool calls */
|
|
450
|
-
actions?: PageActionDefinition[];
|
|
451
|
-
}
|
|
452
|
-
/** Card block header definition */
|
|
453
|
-
export interface CardBlockHeader {
|
|
454
|
-
title: string;
|
|
455
|
-
description?: string;
|
|
456
|
-
descriptionHref?: string;
|
|
457
|
-
}
|
|
458
|
-
/** Card block definition (CardV2-aligned) */
|
|
459
|
-
export interface CardBlockDefinition {
|
|
460
|
-
type: 'card';
|
|
461
|
-
/** Disable drag-and-drop in the form */
|
|
462
|
-
restructurable?: boolean;
|
|
463
|
-
header?: CardBlockHeader;
|
|
464
|
-
form: FormV2PropsDefinition;
|
|
465
|
-
actions?: PageActionDefinition[];
|
|
466
|
-
secondaryActions?: PageActionDefinition[];
|
|
467
|
-
primaryActions?: PageActionDefinition[];
|
|
468
|
-
}
|
|
469
|
-
export interface PageFieldDefinition {
|
|
470
|
-
handle: string;
|
|
471
|
-
type: PageFieldType;
|
|
472
|
-
label: string;
|
|
473
|
-
description?: string;
|
|
474
|
-
required?: boolean;
|
|
475
|
-
handler?: string;
|
|
476
|
-
source?: PageFieldSource;
|
|
477
|
-
options?: Array<{
|
|
478
|
-
value: string;
|
|
479
|
-
label: string;
|
|
480
|
-
}>;
|
|
481
|
-
accept?: string;
|
|
482
|
-
header?: PageFormHeader;
|
|
483
|
-
fields?: PageFieldDefinition[];
|
|
484
|
-
actions?: PageActionDefinition[];
|
|
485
|
-
/** Target internal model handle for RELATIONSHIP type fields */
|
|
486
|
-
model?: string;
|
|
487
|
-
}
|
|
488
|
-
/** Legacy form block definition */
|
|
489
|
-
export interface LegacyFormBlockDefinition {
|
|
490
|
-
type: 'form' | 'spreadsheet' | 'kanban' | 'calendar' | 'link';
|
|
491
|
-
title?: string;
|
|
492
|
-
fields?: PageFieldDefinition[];
|
|
493
|
-
readonly?: boolean;
|
|
494
|
-
}
|
|
495
|
-
/** List block definition */
|
|
496
|
-
export interface ListBlockDefinition {
|
|
497
|
-
type: 'list';
|
|
498
|
-
title?: string;
|
|
499
|
-
/** Model handle to fetch instances from */
|
|
500
|
-
model: string;
|
|
501
|
-
/** Field to use as the tile label */
|
|
502
|
-
labelField?: string;
|
|
503
|
-
/** Field to use as the tile description */
|
|
504
|
-
descriptionField?: string;
|
|
505
|
-
/** Icon for each tile */
|
|
506
|
-
icon?: string;
|
|
507
|
-
/** Message when no items */
|
|
508
|
-
emptyMessage?: string;
|
|
509
|
-
}
|
|
510
|
-
/** Model mapper block definition - for mapping SHARED models to workspace models */
|
|
511
|
-
export interface ModelMapperBlockDefinition {
|
|
512
|
-
type: 'model-mapper';
|
|
513
|
-
/** The SHARED model handle from provision config (e.g., "client", "patient") */
|
|
514
|
-
model: string;
|
|
515
|
-
}
|
|
516
|
-
/** Union of all block types */
|
|
517
|
-
export type PageBlockDefinition = CardBlockDefinition | LegacyFormBlockDefinition | ListBlockDefinition | ModelMapperBlockDefinition;
|
|
518
|
-
/** Mode for context data fetching */
|
|
519
|
-
export type PageContextMode = 'first' | 'many' | 'count';
|
|
520
|
-
/**
|
|
521
|
-
* Page context filters using structured format.
|
|
522
|
-
* Format: { fieldHandle: { operator: value } }
|
|
523
|
-
* Values can be Liquid template strings, e.g., { id: { eq: '{{ path_params.id }}' } }
|
|
524
|
-
*/
|
|
525
|
-
export type PageContextFilters = Record<string, Record<string, string | number | boolean | (string | number | boolean)[]>>;
|
|
526
|
-
/** Single context item definition (model-based) */
|
|
527
|
-
export interface PageContextItemDefinition {
|
|
528
|
-
/** Model handle to fetch data from */
|
|
529
|
-
model: string;
|
|
530
|
-
/** Fetch mode: 'first' returns single object, 'many' returns array, 'count' returns number */
|
|
531
|
-
mode: PageContextMode;
|
|
532
|
-
/**
|
|
533
|
-
* Optional filters. Supports:
|
|
534
|
-
* - Simple key-value with Liquid templates: { id: '{{ path_params.id }}' }
|
|
535
|
-
* - StructuredFilter format: { status: { eq: 'APPROVED' } }
|
|
536
|
-
*/
|
|
537
|
-
filters?: PageContextFilters;
|
|
538
|
-
/** Optional limit for 'many' mode */
|
|
539
|
-
limit?: number;
|
|
540
|
-
}
|
|
541
|
-
/** Single context item definition (tool-based) */
|
|
542
|
-
export interface PageContextToolItemDefinition {
|
|
543
|
-
/** Tool name to invoke for fetching context data */
|
|
544
|
-
tool: string;
|
|
545
|
-
}
|
|
546
|
-
/** Context definition: variable name -> context item (model or tool-based) */
|
|
547
|
-
export type PageContextDefinition = Record<string, PageContextItemDefinition | PageContextToolItemDefinition>;
|
|
548
|
-
/** @deprecated Use PageContextDefinition instead */
|
|
549
|
-
export interface PageInstanceFilter {
|
|
550
|
-
model: string;
|
|
551
|
-
where?: Record<string, unknown>;
|
|
552
|
-
}
|
|
553
|
-
/** Navigation item for sidebar */
|
|
554
|
-
export interface NavigationItem {
|
|
555
|
-
/** Display label (supports Liquid templates) */
|
|
556
|
-
label: string;
|
|
557
|
-
/** URL href (supports Liquid templates with path_params and context) */
|
|
558
|
-
href: string;
|
|
559
|
-
/** Optional icon name */
|
|
560
|
-
icon?: string;
|
|
561
|
-
}
|
|
562
|
-
/** Navigation section with title and items */
|
|
563
|
-
export interface NavigationSection {
|
|
564
|
-
/** Section title (supports Liquid templates) */
|
|
565
|
-
title?: string;
|
|
566
|
-
/** Navigation items in this section */
|
|
567
|
-
items: NavigationItem[];
|
|
568
|
-
}
|
|
569
|
-
/** Sidebar navigation configuration */
|
|
570
|
-
export interface NavigationSidebar {
|
|
571
|
-
/** Sections to display in the sidebar */
|
|
572
|
-
sections: NavigationSection[];
|
|
573
|
-
}
|
|
574
|
-
/** Breadcrumb item */
|
|
575
|
-
export interface BreadcrumbItem {
|
|
576
|
-
/** Display label (supports Liquid templates) */
|
|
577
|
-
label: string;
|
|
578
|
-
/** Optional href - if not provided, item is not clickable */
|
|
579
|
-
href?: string;
|
|
580
|
-
}
|
|
581
|
-
/** Breadcrumb navigation configuration */
|
|
582
|
-
export interface NavigationBreadcrumb {
|
|
583
|
-
/** Breadcrumb items from left to right */
|
|
584
|
-
items: BreadcrumbItem[];
|
|
585
|
-
}
|
|
586
|
-
/** Full navigation configuration */
|
|
587
|
-
export interface NavigationConfig {
|
|
588
|
-
/** Sidebar navigation */
|
|
589
|
-
sidebar?: NavigationSidebar;
|
|
590
|
-
/** Breadcrumb navigation */
|
|
591
|
-
breadcrumb?: NavigationBreadcrumb;
|
|
592
|
-
}
|
|
593
|
-
export interface PageDefinition {
|
|
594
|
-
type: PageType;
|
|
595
|
-
title: string;
|
|
596
|
-
/** URL path for this page (e.g., '/phone-numbers' or '/phone-numbers/[id]' for dynamic segments) */
|
|
597
|
-
path: string;
|
|
598
|
-
/** When true, this page is the default landing page for the app installation */
|
|
599
|
-
default?: boolean;
|
|
600
|
-
/**
|
|
601
|
-
* Navigation configuration:
|
|
602
|
-
* - true/false: show/hide in auto-generated navigation
|
|
603
|
-
* - string: Liquid template that evaluates to true/false
|
|
604
|
-
* - NavigationConfig: full navigation override for this page (replaces base navigation)
|
|
605
|
-
*/
|
|
606
|
-
navigation?: boolean | string | NavigationConfig;
|
|
607
|
-
blocks: PageBlockDefinition[];
|
|
608
|
-
actions?: PageActionDefinition[];
|
|
609
|
-
/** Context data to load for Liquid templates. appInstallationId filtering is automatic. */
|
|
610
|
-
context?: PageContextDefinition;
|
|
611
|
-
/** @deprecated Use context instead */
|
|
612
|
-
filter?: PageInstanceFilter;
|
|
613
|
-
}
|
|
614
|
-
export type WebhookHttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
615
|
-
export interface WebhookRequest {
|
|
616
|
-
method: string;
|
|
617
|
-
url: string;
|
|
618
|
-
path: string;
|
|
619
|
-
headers: Record<string, string | string[] | undefined>;
|
|
620
|
-
query: Record<string, string>;
|
|
621
|
-
body: unknown;
|
|
622
|
-
rawBody?: Buffer;
|
|
623
|
-
}
|
|
624
|
-
export interface WebhookHandlerContext {
|
|
625
|
-
appInstallationId: string | null;
|
|
626
|
-
workplace: {
|
|
627
|
-
id: string;
|
|
628
|
-
subdomain: string | null;
|
|
629
|
-
} | null;
|
|
630
|
-
registration: Record<string, unknown>;
|
|
631
|
-
}
|
|
632
|
-
export interface WebhookHandlerResponse {
|
|
633
|
-
status: number;
|
|
634
|
-
body?: unknown;
|
|
635
|
-
headers?: Record<string, string>;
|
|
636
|
-
}
|
|
637
|
-
export type WebhookHandlerFn = (request: WebhookRequest, context: WebhookHandlerContext) => Promise<WebhookHandlerResponse>;
|
|
638
|
-
export interface WebhookHandlerDefinition {
|
|
639
|
-
description?: string;
|
|
640
|
-
methods?: WebhookHttpMethod[];
|
|
641
|
-
handler: WebhookHandlerFn;
|
|
642
|
-
}
|
|
643
|
-
export type Webhooks = Record<string, WebhookHandlerDefinition>;
|
|
644
|
-
export type { InstallHandlerContext, InstallHandlerResult, InstallHandler, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooks, } from './types';
|
|
645
|
-
/**
|
|
646
|
-
* Install configuration - defines per-install env vars.
|
|
647
|
-
*/
|
|
648
|
-
export interface InstallConfig {
|
|
649
|
-
/** Per-install environment variables (collected from user during install, passed at runtime) */
|
|
650
|
-
env?: EnvSchema;
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Definition for an app-provided agent.
|
|
654
|
-
* Agents are created globally during provisioning and become available
|
|
655
|
-
* to workplaces that install the app.
|
|
656
|
-
*/
|
|
657
|
-
export interface AgentDefinition {
|
|
658
|
-
/** Unique identifier within the app (used for upserts) */
|
|
659
|
-
handle: string;
|
|
660
|
-
/** Display name */
|
|
661
|
-
name: string;
|
|
662
|
-
/** Description of what the agent does */
|
|
663
|
-
description: string;
|
|
664
|
-
/** System prompt (static, no templating) */
|
|
665
|
-
system: string;
|
|
666
|
-
/** Tool names to bind (must exist in this app's tools) */
|
|
667
|
-
tools: string[];
|
|
668
|
-
/** Optional LLM model override (defaults to workspace default) */
|
|
669
|
-
llmModelId?: string;
|
|
670
|
-
/**
|
|
671
|
-
* Parent agent that can call this agent.
|
|
672
|
-
* Creates an AGENT-type tool and binds it to the parent.
|
|
673
|
-
*
|
|
674
|
-
* Values:
|
|
675
|
-
* - 'composer' - Bind to the workspace's Composer agent
|
|
676
|
-
* - '<handle>' - Bind to another agent in this app (by handle)
|
|
677
|
-
* - undefined - Standalone agent (not callable by other agents)
|
|
678
|
-
*/
|
|
679
|
-
parentAgent?: string;
|
|
680
|
-
}
|
|
681
|
-
/** Provision-level configuration - auto-synced when app version is deployed */
|
|
682
|
-
export interface ProvisionConfig {
|
|
683
|
-
/** Global environment variables (developer-level, shared across all installs) */
|
|
684
|
-
env?: EnvSchema;
|
|
685
|
-
/** Model definitions (INTERNAL + SHARED) */
|
|
686
|
-
models?: ModelDefinition[];
|
|
687
|
-
/** Relationship definitions between models */
|
|
688
|
-
relationships?: RelationshipDefinition[];
|
|
689
|
-
/** Communication channel definitions */
|
|
690
|
-
channels?: ChannelDefinition[];
|
|
691
|
-
/** Workflow definitions */
|
|
692
|
-
workflows?: WorkflowDefinition[];
|
|
693
|
-
/** Base navigation configuration for all pages (can be overridden per page) */
|
|
694
|
-
navigation?: NavigationConfig;
|
|
695
|
-
/** Page definitions for app UI */
|
|
696
|
-
pages?: PageDefinition[];
|
|
697
|
-
}
|
|
698
|
-
export interface SkedyulConfig {
|
|
699
|
-
/** App name */
|
|
700
|
-
name: string;
|
|
701
|
-
/** App version (semver) */
|
|
702
|
-
version?: string;
|
|
703
|
-
/** App description */
|
|
704
|
-
description?: string;
|
|
705
|
-
/** Compute layer: 'serverless' (Lambda) or 'dedicated' (ECS/Docker) */
|
|
706
|
-
computeLayer?: ComputeLayerType;
|
|
707
|
-
/** Tool registry - direct object or dynamic import */
|
|
708
|
-
tools?: ToolRegistry | Promise<{
|
|
709
|
-
toolRegistry: ToolRegistry;
|
|
710
|
-
}>;
|
|
711
|
-
/** Webhook registry - direct object or dynamic import */
|
|
712
|
-
webhooks?: WebhookRegistry | Promise<{
|
|
713
|
-
webhookRegistry: WebhookRegistry;
|
|
714
|
-
}>;
|
|
715
|
-
/** Provision configuration - direct object or dynamic import */
|
|
716
|
-
provision?: ProvisionConfig | Promise<{
|
|
717
|
-
default: ProvisionConfig;
|
|
718
|
-
}>;
|
|
719
|
-
/** Install configuration - hooks for install/uninstall lifecycle */
|
|
720
|
-
install?: InstallConfig | Promise<{
|
|
721
|
-
default: InstallConfig;
|
|
722
|
-
}>;
|
|
723
|
-
/** Agent definitions - multi-tenant agents with tool bindings */
|
|
724
|
-
agents?: AgentDefinition[];
|
|
725
|
-
}
|
|
726
|
-
export interface SerializableSkedyulConfig {
|
|
727
|
-
name: string;
|
|
728
|
-
version?: string;
|
|
729
|
-
description?: string;
|
|
730
|
-
computeLayer?: ComputeLayerType;
|
|
731
|
-
/** Tool metadata (serialized from ToolRegistry) */
|
|
732
|
-
tools?: ToolMetadata[];
|
|
733
|
-
/** Webhook metadata (serialized from WebhookRegistry) */
|
|
734
|
-
webhooks?: WebhookMetadata[];
|
|
735
|
-
/** Provision config (fully resolved) */
|
|
736
|
-
provision?: ProvisionConfig;
|
|
737
|
-
/** Agent definitions (stored as-is) */
|
|
738
|
-
agents?: AgentDefinition[];
|
|
739
|
-
}
|
|
740
|
-
export interface WebhookHandlerMetadata {
|
|
741
|
-
name: string;
|
|
742
|
-
description?: string;
|
|
743
|
-
methods?: WebhookHttpMethod[];
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* Define a Skedyul app configuration with full type safety.
|
|
747
|
-
*/
|
|
748
|
-
export declare function defineConfig(config: SkedyulConfig): SkedyulConfig;
|
|
749
|
-
export declare const CONFIG_FILE_NAMES: string[];
|
|
750
|
-
export declare function loadConfig(configPath: string): Promise<SkedyulConfig>;
|
|
751
|
-
export declare function validateConfig(config: SkedyulConfig): {
|
|
752
|
-
valid: boolean;
|
|
753
|
-
errors: string[];
|
|
754
|
-
};
|
|
755
|
-
/**
|
|
756
|
-
* Get all environment variable keys from the config.
|
|
757
|
-
* Returns separate arrays for global and install-level keys.
|
|
758
|
-
* Note: With the new config structure, all env is at provision level (global).
|
|
759
|
-
*/
|
|
760
|
-
export declare function getAllEnvKeys(config: SkedyulConfig): {
|
|
761
|
-
global: string[];
|
|
762
|
-
install: string[];
|
|
763
|
-
};
|
|
764
|
-
/**
|
|
765
|
-
* Get required install-level environment variable keys.
|
|
766
|
-
* Note: With the new config structure, install-level env is deprecated.
|
|
767
|
-
* All required env vars are now at provision level.
|
|
768
|
-
*/
|
|
769
|
-
export declare function getRequiredInstallEnvKeys(config: SkedyulConfig): string[];
|
|
7
|
+
export * from './config/index';
|