@loopstack/contracts 0.14.0
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/LICENSE +43 -0
- package/README.md +7 -0
- package/dist/enums/index.d.ts +3 -0
- package/dist/enums/index.d.ts.map +1 -0
- package/dist/enums/index.js +19 -0
- package/dist/enums/pipeline-state.d.ts +8 -0
- package/dist/enums/pipeline-state.d.ts.map +1 -0
- package/dist/enums/pipeline-state.js +12 -0
- package/dist/enums/user-type.enum.d.ts +4 -0
- package/dist/enums/user-type.enum.d.ts.map +1 -0
- package/dist/enums/user-type.enum.js +8 -0
- package/dist/enums/workflow-state.enum.d.ts +8 -0
- package/dist/enums/workflow-state.enum.d.ts.map +1 -0
- package/dist/enums/workflow-state.enum.js +12 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/schemas/assignment.schema.d.ts +3 -0
- package/dist/schemas/assignment.schema.d.ts.map +1 -0
- package/dist/schemas/assignment.schema.js +20 -0
- package/dist/schemas/block.schema.d.ts +2 -0
- package/dist/schemas/block.schema.d.ts.map +1 -0
- package/dist/schemas/block.schema.js +5 -0
- package/dist/schemas/document.schema.d.ts +826 -0
- package/dist/schemas/document.schema.d.ts.map +1 -0
- package/dist/schemas/document.schema.js +91 -0
- package/dist/schemas/index.d.ts +16 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +32 -0
- package/dist/schemas/json-schema.schema.d.ts +2 -0
- package/dist/schemas/json-schema.schema.d.ts.map +1 -0
- package/dist/schemas/json-schema.schema.js +58 -0
- package/dist/schemas/main.schema.d.ts +1126 -0
- package/dist/schemas/main.schema.d.ts.map +1 -0
- package/dist/schemas/main.schema.js +17 -0
- package/dist/schemas/pipeline.schema.d.ts +932 -0
- package/dist/schemas/pipeline.schema.d.ts.map +1 -0
- package/dist/schemas/pipeline.schema.js +57 -0
- package/dist/schemas/startup.schema.d.ts +637 -0
- package/dist/schemas/startup.schema.d.ts.map +1 -0
- package/dist/schemas/startup.schema.js +78 -0
- package/dist/schemas/template-expression.schema.d.ts +2 -0
- package/dist/schemas/template-expression.schema.d.ts.map +1 -0
- package/dist/schemas/template-expression.schema.js +5 -0
- package/dist/schemas/tool-call.schema.d.ts +17 -0
- package/dist/schemas/tool-call.schema.d.ts.map +1 -0
- package/dist/schemas/tool-call.schema.js +11 -0
- package/dist/schemas/tool-config.schema.d.ts +178 -0
- package/dist/schemas/tool-config.schema.d.ts.map +1 -0
- package/dist/schemas/tool-config.schema.js +11 -0
- package/dist/schemas/transition-payload.schema.d.ts +17 -0
- package/dist/schemas/transition-payload.schema.d.ts.map +1 -0
- package/dist/schemas/transition-payload.schema.js +10 -0
- package/dist/schemas/ui-form-element.schema.d.ts +89 -0
- package/dist/schemas/ui-form-element.schema.d.ts.map +1 -0
- package/dist/schemas/ui-form-element.schema.js +38 -0
- package/dist/schemas/ui-form.schema.d.ts +300 -0
- package/dist/schemas/ui-form.schema.d.ts.map +1 -0
- package/dist/schemas/ui-form.schema.js +39 -0
- package/dist/schemas/ui-properties-schema.d.ts +2 -0
- package/dist/schemas/ui-properties-schema.d.ts.map +1 -0
- package/dist/schemas/ui-properties-schema.js +9 -0
- package/dist/schemas/workflow-transition.schema.d.ts +48 -0
- package/dist/schemas/workflow-transition.schema.d.ts.map +1 -0
- package/dist/schemas/workflow-transition.schema.js +17 -0
- package/dist/schemas/workflow.schema.d.ts +439 -0
- package/dist/schemas/workflow.schema.d.ts.map +1 -0
- package/dist/schemas/workflow.schema.js +19 -0
- package/dist/schemas/workspace.schema.d.ts +14 -0
- package/dist/schemas/workspace.schema.d.ts.map +1 -0
- package/dist/schemas/workspace.schema.js +10 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/interfaces/client-message.interface.d.ts +10 -0
- package/dist/types/interfaces/client-message.interface.d.ts.map +1 -0
- package/dist/types/interfaces/client-message.interface.js +2 -0
- package/dist/types/interfaces/document-item.interface.d.ts +25 -0
- package/dist/types/interfaces/document-item.interface.d.ts.map +1 -0
- package/dist/types/interfaces/document-item.interface.js +2 -0
- package/dist/types/interfaces/history-transition.interface.d.ts +5 -0
- package/dist/types/interfaces/history-transition.interface.d.ts.map +1 -0
- package/dist/types/interfaces/history-transition.interface.js +2 -0
- package/dist/types/interfaces/index.d.ts +9 -0
- package/dist/types/interfaces/index.d.ts.map +1 -0
- package/dist/types/interfaces/index.js +25 -0
- package/dist/types/interfaces/namespace-create.interface.d.ts +8 -0
- package/dist/types/interfaces/namespace-create.interface.d.ts.map +1 -0
- package/dist/types/interfaces/namespace-create.interface.js +2 -0
- package/dist/types/interfaces/pipeline-config.interface.d.ts +8 -0
- package/dist/types/interfaces/pipeline-config.interface.d.ts.map +1 -0
- package/dist/types/interfaces/pipeline-config.interface.js +2 -0
- package/dist/types/interfaces/transition-info.interface.d.ts +6 -0
- package/dist/types/interfaces/transition-info.interface.d.ts.map +1 -0
- package/dist/types/interfaces/transition-info.interface.js +2 -0
- package/dist/types/interfaces/transition-metadata.interface.d.ts +4 -0
- package/dist/types/interfaces/transition-metadata.interface.d.ts.map +1 -0
- package/dist/types/interfaces/transition-metadata.interface.js +2 -0
- package/dist/types/interfaces/transition-payload.interface.d.ts +2 -0
- package/dist/types/interfaces/transition-payload.interface.d.ts.map +1 -0
- package/dist/types/interfaces/transition-payload.interface.js +2 -0
- package/dist/types/interfaces/workflow.interface.d.ts +26 -0
- package/dist/types/interfaces/workflow.interface.d.ts.map +1 -0
- package/dist/types/interfaces/workflow.interface.js +2 -0
- package/dist/types/types/assignment.type.d.ts +4 -0
- package/dist/types/types/assignment.type.d.ts.map +1 -0
- package/dist/types/types/assignment.type.js +2 -0
- package/dist/types/types/document.type.d.ts +6 -0
- package/dist/types/types/document.type.d.ts.map +1 -0
- package/dist/types/types/document.type.js +2 -0
- package/dist/types/types/index.d.ts +17 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/index.js +33 -0
- package/dist/types/types/json-schema-config.type.d.ts +4 -0
- package/dist/types/types/json-schema-config.type.d.ts.map +1 -0
- package/dist/types/types/json-schema-config.type.js +2 -0
- package/dist/types/types/main.type.d.ts +9 -0
- package/dist/types/types/main.type.d.ts.map +1 -0
- package/dist/types/types/main.type.js +2 -0
- package/dist/types/types/pipeline-state.type.d.ts +1 -0
- package/dist/types/types/pipeline-state.type.d.ts.map +1 -0
- package/dist/types/types/pipeline-state.type.js +2 -0
- package/dist/types/types/pipeline.type.d.ts +9 -0
- package/dist/types/types/pipeline.type.d.ts.map +1 -0
- package/dist/types/types/pipeline.type.js +2 -0
- package/dist/types/types/startup.type.d.ts +4 -0
- package/dist/types/types/startup.type.d.ts.map +1 -0
- package/dist/types/types/startup.type.js +2 -0
- package/dist/types/types/tool-call.type.d.ts +3 -0
- package/dist/types/types/tool-call.type.d.ts.map +1 -0
- package/dist/types/types/tool-call.type.js +2 -0
- package/dist/types/types/tool-config.type.d.ts +3 -0
- package/dist/types/types/tool-config.type.d.ts.map +1 -0
- package/dist/types/types/tool-config.type.js +2 -0
- package/dist/types/types/transition-payload.type.d.ts +3 -0
- package/dist/types/types/transition-payload.type.d.ts.map +1 -0
- package/dist/types/types/transition-payload.type.js +2 -0
- package/dist/types/types/ui-element.type.d.ts +3 -0
- package/dist/types/types/ui-element.type.d.ts.map +1 -0
- package/dist/types/types/ui-element.type.js +2 -0
- package/dist/types/types/ui-form.type.d.ts +6 -0
- package/dist/types/types/ui-form.type.d.ts.map +1 -0
- package/dist/types/types/ui-form.type.js +2 -0
- package/dist/types/types/ui-properties.type.d.ts +4 -0
- package/dist/types/types/ui-properties.type.d.ts.map +1 -0
- package/dist/types/types/ui-properties.type.js +2 -0
- package/dist/types/types/workflow-state.type.d.ts +1 -0
- package/dist/types/types/workflow-state.type.d.ts.map +1 -0
- package/dist/types/types/workflow-state.type.js +2 -0
- package/dist/types/types/workflow-transition.type.d.ts +3 -0
- package/dist/types/types/workflow-transition.type.d.ts.map +1 -0
- package/dist/types/types/workflow-transition.type.js +2 -0
- package/dist/types/types/workflow.type.d.ts +4 -0
- package/dist/types/types/workflow.type.d.ts.map +1 -0
- package/dist/types/types/workflow.type.js +2 -0
- package/dist/types/types/workspace.type.d.ts +3 -0
- package/dist/types/types/workspace.type.d.ts.map +1 -0
- package/dist/types/types/workspace.type.js +2 -0
- package/package.json +48 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScheduledTaskSchema = exports.StartupTaskSchema = exports.RunPipelineTaskSchema = exports.BaseStartupTaskSchema = exports.JobsScheduleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const transition_payload_schema_1 = require("./transition-payload.schema");
|
|
6
|
+
const RepeatOptionsSchema = zod_1.z.object({
|
|
7
|
+
every: zod_1.z.number().nonnegative().optional()
|
|
8
|
+
.describe('Repeat every X milliseconds. Example: 60000 for every minute'),
|
|
9
|
+
startDate: zod_1.z.string().optional()
|
|
10
|
+
.describe('ISO string or timestamp when to start repeating. Example: "2025-01-01T00:00:00.000Z" or Date.now()'),
|
|
11
|
+
endDate: zod_1.z.string().optional()
|
|
12
|
+
.describe('ISO string or timestamp when to stop repeating. Example: "2025-12-31T23:59:59.999Z"'),
|
|
13
|
+
limit: zod_1.z.number().nonnegative().optional()
|
|
14
|
+
.describe('Maximum number of times to repeat. Example: 100'),
|
|
15
|
+
immediately: zod_1.z.boolean().optional()
|
|
16
|
+
.describe('Whether to run the job immediately when created. Default: false'),
|
|
17
|
+
pattern: zod_1.z.string().optional()
|
|
18
|
+
.describe('Cron pattern for scheduling. Examples: "0 2 * * *" (daily at 2am), "*/15 * * * *" (every 15 min), "0 9 * * MON-FRI" (weekdays at 9am)'),
|
|
19
|
+
tz: zod_1.z.string().optional()
|
|
20
|
+
.describe('IANA timezone for cron pattern. Examples: "UTC", "America/New_York", "Europe/London", "Asia/Tokyo", "Australia/Sydney"'),
|
|
21
|
+
});
|
|
22
|
+
exports.JobsScheduleSchema = zod_1.z.object({
|
|
23
|
+
delay: zod_1.z.number().nonnegative().optional(),
|
|
24
|
+
repeat: RepeatOptionsSchema.optional(),
|
|
25
|
+
}).partial();
|
|
26
|
+
exports.BaseStartupTaskSchema = zod_1.z.object({
|
|
27
|
+
name: zod_1.z.string(),
|
|
28
|
+
title: zod_1.z.string().optional(),
|
|
29
|
+
type: zod_1.z.string(),
|
|
30
|
+
payload: zod_1.z.any(), // Keeping payload flexible as requested
|
|
31
|
+
user: zod_1.z.string(),
|
|
32
|
+
schedule: exports.JobsScheduleSchema.optional(),
|
|
33
|
+
});
|
|
34
|
+
exports.RunPipelineTaskSchema = exports.BaseStartupTaskSchema.extend({
|
|
35
|
+
type: zod_1.z.literal('run_pipeline'),
|
|
36
|
+
payload: zod_1.z.object({
|
|
37
|
+
id: zod_1.z.string(),
|
|
38
|
+
transition: transition_payload_schema_1.TransitionPayloadSchema.optional(),
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
// export const CreateRunPipelineTaskSchema = BaseStartupTaskSchema.extend({
|
|
42
|
+
// type: z.literal('create_run_pipeline'),
|
|
43
|
+
// payload: z.object({
|
|
44
|
+
// pipeline: z.string(),
|
|
45
|
+
// transition: TransitionPayloadSchema.optional(),
|
|
46
|
+
// }),
|
|
47
|
+
// variables: z.record(z.string(), z.any()).optional(),
|
|
48
|
+
// })
|
|
49
|
+
// export const CreateWorkspaceTaskSchema = BaseStartupTaskSchema.extend({
|
|
50
|
+
// type: z.literal('create_workspace'),
|
|
51
|
+
// payload: z.object({
|
|
52
|
+
// workspace: z.string()
|
|
53
|
+
// }),
|
|
54
|
+
// })
|
|
55
|
+
//
|
|
56
|
+
// const intervalRegex = /^(\d+)\s*(days?|hours?|minutes?|seconds?)$/i;
|
|
57
|
+
// export const CleanupPipelineTaskSchema = BaseStartupTaskSchema.extend({
|
|
58
|
+
// type: z.literal('cleanup_pipeline'),
|
|
59
|
+
// payload: z.object({
|
|
60
|
+
// pipeline: z.string(),
|
|
61
|
+
// olderThan: z.string()
|
|
62
|
+
// .regex(intervalRegex, 'Duration must be in format: number followed by the unit (e.g., 30 days", "24 hours", "60 minutes")')
|
|
63
|
+
// .optional(),
|
|
64
|
+
// status: z.nativeEnum(PipelineState).optional(),
|
|
65
|
+
// skip: z.number().optional(), // keep the latest x items
|
|
66
|
+
// limit: z.number().positive().optional(), // Maximum number of pipelines to delete in one execution
|
|
67
|
+
// }),
|
|
68
|
+
// })
|
|
69
|
+
exports.StartupTaskSchema = zod_1.z.discriminatedUnion('type', [
|
|
70
|
+
exports.RunPipelineTaskSchema,
|
|
71
|
+
// CreateRunPipelineTaskSchema,
|
|
72
|
+
// CleanupPipelineTaskSchema,
|
|
73
|
+
// CreateWorkspaceTaskSchema,
|
|
74
|
+
]);
|
|
75
|
+
exports.ScheduledTaskSchema = zod_1.z.object({
|
|
76
|
+
id: zod_1.z.string().min(1, 'id is required'),
|
|
77
|
+
task: exports.StartupTaskSchema,
|
|
78
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-expression.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/template-expression.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,aAG9B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateExpression = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.TemplateExpression = zod_1.z.string().regex(/^(?:\||>)?(?:[-+])?\s*\$\{([\s\S]*?)\}\s*$/, "Must be an expression in format '${ expression }'");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ToolCallSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
tool: z.ZodString;
|
|
5
|
+
args: z.ZodOptional<z.ZodAny>;
|
|
6
|
+
assign: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNull, z.ZodString, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodAny>]>>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
tool: string;
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
args?: any;
|
|
11
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
tool: string;
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
args?: any;
|
|
16
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/tool-call.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAKzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolCallSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const assignment_schema_1 = require("./assignment.schema");
|
|
6
|
+
exports.ToolCallSchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string().optional(),
|
|
8
|
+
tool: zod_1.z.string(),
|
|
9
|
+
args: zod_1.z.any().optional(),
|
|
10
|
+
assign: assignment_schema_1.AssignmentConfigSchema.optional(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ToolConfigSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodDefault<z.ZodLiteral<"tool">>;
|
|
4
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5
|
+
ui: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
7
|
+
transition: z.ZodString;
|
|
8
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
9
|
+
enabledWhen: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
} & {
|
|
11
|
+
type: z.ZodLiteral<"button">;
|
|
12
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
label: z.ZodOptional<z.ZodString>;
|
|
15
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
position?: number | undefined;
|
|
18
|
+
label?: string | undefined;
|
|
19
|
+
props?: Record<string, any> | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
position?: number | undefined;
|
|
22
|
+
label?: string | undefined;
|
|
23
|
+
props?: Record<string, any> | undefined;
|
|
24
|
+
}>>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
type: "button";
|
|
27
|
+
transition: string;
|
|
28
|
+
options?: {
|
|
29
|
+
position?: number | undefined;
|
|
30
|
+
label?: string | undefined;
|
|
31
|
+
props?: Record<string, any> | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
widget?: string | undefined;
|
|
34
|
+
enabledWhen?: string[] | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
type: "button";
|
|
37
|
+
transition: string;
|
|
38
|
+
options?: {
|
|
39
|
+
position?: number | undefined;
|
|
40
|
+
label?: string | undefined;
|
|
41
|
+
props?: Record<string, any> | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
widget?: string | undefined;
|
|
44
|
+
enabledWhen?: string[] | undefined;
|
|
45
|
+
}>, z.ZodObject<{
|
|
46
|
+
transition: z.ZodString;
|
|
47
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
48
|
+
enabledWhen: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
49
|
+
} & {
|
|
50
|
+
type: z.ZodLiteral<"custom">;
|
|
51
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
label: z.ZodOptional<z.ZodString>;
|
|
53
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
label?: string | undefined;
|
|
56
|
+
props?: Record<string, any> | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
label?: string | undefined;
|
|
59
|
+
props?: Record<string, any> | undefined;
|
|
60
|
+
}>>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
type: "custom";
|
|
63
|
+
transition: string;
|
|
64
|
+
options?: {
|
|
65
|
+
label?: string | undefined;
|
|
66
|
+
props?: Record<string, any> | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
widget?: string | undefined;
|
|
69
|
+
enabledWhen?: string[] | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
type: "custom";
|
|
72
|
+
transition: string;
|
|
73
|
+
options?: {
|
|
74
|
+
label?: string | undefined;
|
|
75
|
+
props?: Record<string, any> | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
widget?: string | undefined;
|
|
78
|
+
enabledWhen?: string[] | undefined;
|
|
79
|
+
}>]>, "many">>;
|
|
80
|
+
form: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
form?: any;
|
|
83
|
+
actions?: ({
|
|
84
|
+
type: "button";
|
|
85
|
+
transition: string;
|
|
86
|
+
options?: {
|
|
87
|
+
position?: number | undefined;
|
|
88
|
+
label?: string | undefined;
|
|
89
|
+
props?: Record<string, any> | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
widget?: string | undefined;
|
|
92
|
+
enabledWhen?: string[] | undefined;
|
|
93
|
+
} | {
|
|
94
|
+
type: "custom";
|
|
95
|
+
transition: string;
|
|
96
|
+
options?: {
|
|
97
|
+
label?: string | undefined;
|
|
98
|
+
props?: Record<string, any> | undefined;
|
|
99
|
+
} | undefined;
|
|
100
|
+
widget?: string | undefined;
|
|
101
|
+
enabledWhen?: string[] | undefined;
|
|
102
|
+
})[] | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
form?: any;
|
|
105
|
+
actions?: ({
|
|
106
|
+
type: "button";
|
|
107
|
+
transition: string;
|
|
108
|
+
options?: {
|
|
109
|
+
position?: number | undefined;
|
|
110
|
+
label?: string | undefined;
|
|
111
|
+
props?: Record<string, any> | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
widget?: string | undefined;
|
|
114
|
+
enabledWhen?: string[] | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
type: "custom";
|
|
117
|
+
transition: string;
|
|
118
|
+
options?: {
|
|
119
|
+
label?: string | undefined;
|
|
120
|
+
props?: Record<string, any> | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
widget?: string | undefined;
|
|
123
|
+
enabledWhen?: string[] | undefined;
|
|
124
|
+
})[] | undefined;
|
|
125
|
+
}>>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
type: "tool";
|
|
128
|
+
description?: string | undefined;
|
|
129
|
+
ui?: {
|
|
130
|
+
form?: any;
|
|
131
|
+
actions?: ({
|
|
132
|
+
type: "button";
|
|
133
|
+
transition: string;
|
|
134
|
+
options?: {
|
|
135
|
+
position?: number | undefined;
|
|
136
|
+
label?: string | undefined;
|
|
137
|
+
props?: Record<string, any> | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
widget?: string | undefined;
|
|
140
|
+
enabledWhen?: string[] | undefined;
|
|
141
|
+
} | {
|
|
142
|
+
type: "custom";
|
|
143
|
+
transition: string;
|
|
144
|
+
options?: {
|
|
145
|
+
label?: string | undefined;
|
|
146
|
+
props?: Record<string, any> | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
widget?: string | undefined;
|
|
149
|
+
enabledWhen?: string[] | undefined;
|
|
150
|
+
})[] | undefined;
|
|
151
|
+
} | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
type?: "tool" | undefined;
|
|
154
|
+
description?: string | undefined;
|
|
155
|
+
ui?: {
|
|
156
|
+
form?: any;
|
|
157
|
+
actions?: ({
|
|
158
|
+
type: "button";
|
|
159
|
+
transition: string;
|
|
160
|
+
options?: {
|
|
161
|
+
position?: number | undefined;
|
|
162
|
+
label?: string | undefined;
|
|
163
|
+
props?: Record<string, any> | undefined;
|
|
164
|
+
} | undefined;
|
|
165
|
+
widget?: string | undefined;
|
|
166
|
+
enabledWhen?: string[] | undefined;
|
|
167
|
+
} | {
|
|
168
|
+
type: "custom";
|
|
169
|
+
transition: string;
|
|
170
|
+
options?: {
|
|
171
|
+
label?: string | undefined;
|
|
172
|
+
props?: Record<string, any> | undefined;
|
|
173
|
+
} | undefined;
|
|
174
|
+
widget?: string | undefined;
|
|
175
|
+
enabledWhen?: string[] | undefined;
|
|
176
|
+
})[] | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-config.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/tool-config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const block_schema_1 = require("./block.schema");
|
|
6
|
+
const ui_form_schema_1 = require("./ui-form.schema");
|
|
7
|
+
exports.ToolConfigSchema = block_schema_1.BlockSchema.extend({
|
|
8
|
+
type: zod_1.z.literal('tool').default('tool'),
|
|
9
|
+
description: zod_1.z.string().optional(),
|
|
10
|
+
ui: ui_form_schema_1.UiFormSchema.optional()
|
|
11
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TransitionPayloadSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
workflowId: z.ZodString;
|
|
5
|
+
payload: z.ZodOptional<z.ZodAny>;
|
|
6
|
+
meta: z.ZodOptional<z.ZodAny>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
id: string;
|
|
9
|
+
workflowId: string;
|
|
10
|
+
meta?: any;
|
|
11
|
+
payload?: any;
|
|
12
|
+
}, {
|
|
13
|
+
id: string;
|
|
14
|
+
workflowId: string;
|
|
15
|
+
meta?: any;
|
|
16
|
+
payload?: any;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition-payload.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/transition-payload.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransitionPayloadSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.TransitionPayloadSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
workflowId: zod_1.z.string(),
|
|
8
|
+
payload: zod_1.z.any().optional(),
|
|
9
|
+
meta: zod_1.z.any().optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UiElementSchema: z.ZodObject<{
|
|
3
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
4
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
label: z.ZodOptional<z.ZodString>;
|
|
6
|
+
descriptions: z.ZodOptional<z.ZodString>;
|
|
7
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
8
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
inline: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
inputType: z.ZodOptional<z.ZodString>;
|
|
11
|
+
emptyValue: z.ZodOptional<z.ZodAny>;
|
|
12
|
+
help: z.ZodOptional<z.ZodString>;
|
|
13
|
+
title: z.ZodOptional<z.ZodString>;
|
|
14
|
+
enumOptions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
15
|
+
label: z.ZodString;
|
|
16
|
+
value: z.ZodAny;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
label: string;
|
|
19
|
+
value?: any;
|
|
20
|
+
}, {
|
|
21
|
+
label: string;
|
|
22
|
+
value?: any;
|
|
23
|
+
}>, z.ZodString]>, "many">, z.ZodString]>>;
|
|
24
|
+
titleFormat: z.ZodOptional<z.ZodString>;
|
|
25
|
+
addable: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
removable: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
movable: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
accept: z.ZodOptional<z.ZodString>;
|
|
29
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
order: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
index?: number | undefined;
|
|
37
|
+
inline?: boolean | undefined;
|
|
38
|
+
inputType?: string | undefined;
|
|
39
|
+
order?: string[] | undefined;
|
|
40
|
+
hidden?: boolean | undefined;
|
|
41
|
+
label?: string | undefined;
|
|
42
|
+
title?: string | undefined;
|
|
43
|
+
descriptions?: string | undefined;
|
|
44
|
+
disabled?: boolean | undefined;
|
|
45
|
+
multiple?: boolean | undefined;
|
|
46
|
+
readonly?: boolean | undefined;
|
|
47
|
+
widget?: string | undefined;
|
|
48
|
+
placeholder?: string | undefined;
|
|
49
|
+
rows?: number | undefined;
|
|
50
|
+
emptyValue?: any;
|
|
51
|
+
help?: string | undefined;
|
|
52
|
+
enumOptions?: string | (string | {
|
|
53
|
+
label: string;
|
|
54
|
+
value?: any;
|
|
55
|
+
})[] | undefined;
|
|
56
|
+
titleFormat?: string | undefined;
|
|
57
|
+
addable?: boolean | undefined;
|
|
58
|
+
removable?: boolean | undefined;
|
|
59
|
+
movable?: boolean | undefined;
|
|
60
|
+
accept?: string | undefined;
|
|
61
|
+
collapsed?: boolean | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
index?: number | undefined;
|
|
64
|
+
inline?: boolean | undefined;
|
|
65
|
+
inputType?: string | undefined;
|
|
66
|
+
order?: string[] | undefined;
|
|
67
|
+
hidden?: boolean | undefined;
|
|
68
|
+
label?: string | undefined;
|
|
69
|
+
title?: string | undefined;
|
|
70
|
+
descriptions?: string | undefined;
|
|
71
|
+
disabled?: boolean | undefined;
|
|
72
|
+
multiple?: boolean | undefined;
|
|
73
|
+
readonly?: boolean | undefined;
|
|
74
|
+
widget?: string | undefined;
|
|
75
|
+
placeholder?: string | undefined;
|
|
76
|
+
rows?: number | undefined;
|
|
77
|
+
emptyValue?: any;
|
|
78
|
+
help?: string | undefined;
|
|
79
|
+
enumOptions?: string | (string | {
|
|
80
|
+
label: string;
|
|
81
|
+
value?: any;
|
|
82
|
+
})[] | undefined;
|
|
83
|
+
titleFormat?: string | undefined;
|
|
84
|
+
addable?: boolean | undefined;
|
|
85
|
+
removable?: boolean | undefined;
|
|
86
|
+
movable?: boolean | undefined;
|
|
87
|
+
accept?: string | undefined;
|
|
88
|
+
collapsed?: boolean | undefined;
|
|
89
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-form-element.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/ui-form-element.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoC1B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UiElementSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.UiElementSchema = zod_1.z.object({
|
|
6
|
+
widget: zod_1.z.string().optional(),
|
|
7
|
+
index: zod_1.z.number().optional(),
|
|
8
|
+
label: zod_1.z.string().optional(),
|
|
9
|
+
descriptions: zod_1.z.string().optional(),
|
|
10
|
+
placeholder: zod_1.z.string().optional(),
|
|
11
|
+
rows: zod_1.z.number().int().positive().optional(),
|
|
12
|
+
inline: zod_1.z.boolean().optional(),
|
|
13
|
+
inputType: zod_1.z.string().optional(),
|
|
14
|
+
emptyValue: zod_1.z.any().optional(),
|
|
15
|
+
help: zod_1.z.string().optional(),
|
|
16
|
+
title: zod_1.z.string().optional(),
|
|
17
|
+
enumOptions: zod_1.z.union([
|
|
18
|
+
zod_1.z.array(zod_1.z.union([
|
|
19
|
+
zod_1.z.object({
|
|
20
|
+
label: zod_1.z.string(),
|
|
21
|
+
value: zod_1.z.any()
|
|
22
|
+
}),
|
|
23
|
+
zod_1.z.string(),
|
|
24
|
+
])),
|
|
25
|
+
zod_1.z.string()
|
|
26
|
+
]).optional(),
|
|
27
|
+
titleFormat: zod_1.z.string().optional(),
|
|
28
|
+
addable: zod_1.z.boolean().optional(),
|
|
29
|
+
removable: zod_1.z.boolean().optional(),
|
|
30
|
+
movable: zod_1.z.boolean().optional(),
|
|
31
|
+
accept: zod_1.z.string().optional(),
|
|
32
|
+
multiple: zod_1.z.boolean().optional(),
|
|
33
|
+
hidden: zod_1.z.boolean().optional(),
|
|
34
|
+
disabled: zod_1.z.boolean().optional(),
|
|
35
|
+
readonly: zod_1.z.boolean().optional(),
|
|
36
|
+
collapsed: zod_1.z.boolean().optional(),
|
|
37
|
+
order: zod_1.z.array(zod_1.z.string()).optional(),
|
|
38
|
+
});
|