@flowgram.ai/runtime-interface 0.2.22 → 0.2.24
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/esm/index.js +95 -65
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +180 -82
- package/dist/index.d.ts +180 -82
- package/dist/index.js +98 -66
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -17,12 +17,11 @@ declare enum FlowGramAPIName {
|
|
|
17
17
|
TaskReport = "TaskReport",
|
|
18
18
|
TaskResult = "TaskResult",
|
|
19
19
|
TaskCancel = "TaskCancel",
|
|
20
|
-
|
|
20
|
+
TaskValidate = "TaskValidate"
|
|
21
21
|
}
|
|
22
22
|
declare enum FlowGramAPIModule {
|
|
23
23
|
Info = "Info",
|
|
24
|
-
Task = "Task"
|
|
25
|
-
Validation = "Validation"
|
|
24
|
+
Task = "Task"
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
/**
|
|
@@ -94,6 +93,9 @@ interface IJsonSchema<T = string> {
|
|
|
94
93
|
items?: IJsonSchema<T>;
|
|
95
94
|
required?: string[];
|
|
96
95
|
$ref?: string;
|
|
96
|
+
key?: number;
|
|
97
|
+
name?: string;
|
|
98
|
+
isPropertyRequired?: boolean;
|
|
97
99
|
extra?: {
|
|
98
100
|
index?: number;
|
|
99
101
|
weak?: boolean;
|
|
@@ -212,6 +214,20 @@ interface InvokeParams {
|
|
|
212
214
|
}
|
|
213
215
|
type WorkflowRuntimeInvoke = (params: InvokeParams) => Promise<WorkflowInputs>;
|
|
214
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
219
|
+
* SPDX-License-Identifier: MIT
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
interface ValidationResult {
|
|
223
|
+
valid: boolean;
|
|
224
|
+
errors?: string[];
|
|
225
|
+
}
|
|
226
|
+
interface IValidation {
|
|
227
|
+
invoke(params: InvokeParams): ValidationResult;
|
|
228
|
+
}
|
|
229
|
+
declare const IValidation: unique symbol;
|
|
230
|
+
|
|
215
231
|
/**
|
|
216
232
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
217
233
|
* SPDX-License-Identifier: MIT
|
|
@@ -290,63 +306,6 @@ interface IStatusCenter {
|
|
|
290
306
|
exportNodeStatus(): Record<string, StatusData>;
|
|
291
307
|
}
|
|
292
308
|
|
|
293
|
-
/**
|
|
294
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
295
|
-
* SPDX-License-Identifier: MIT
|
|
296
|
-
*/
|
|
297
|
-
|
|
298
|
-
interface SnapshotData {
|
|
299
|
-
nodeID: string;
|
|
300
|
-
inputs: WorkflowInputs;
|
|
301
|
-
outputs: WorkflowOutputs;
|
|
302
|
-
data: any;
|
|
303
|
-
branch?: string;
|
|
304
|
-
}
|
|
305
|
-
interface Snapshot extends SnapshotData {
|
|
306
|
-
id: string;
|
|
307
|
-
}
|
|
308
|
-
interface ISnapshot {
|
|
309
|
-
id: string;
|
|
310
|
-
data: Partial<SnapshotData>;
|
|
311
|
-
addData(data: Partial<SnapshotData>): void;
|
|
312
|
-
validate(): boolean;
|
|
313
|
-
export(): Snapshot;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
318
|
-
* SPDX-License-Identifier: MIT
|
|
319
|
-
*/
|
|
320
|
-
|
|
321
|
-
interface ISnapshotCenter {
|
|
322
|
-
id: string;
|
|
323
|
-
create(snapshot: Partial<SnapshotData>): ISnapshot;
|
|
324
|
-
exportAll(): Snapshot[];
|
|
325
|
-
export(): Record<string, Snapshot[]>;
|
|
326
|
-
init(): void;
|
|
327
|
-
dispose(): void;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
332
|
-
* SPDX-License-Identifier: MIT
|
|
333
|
-
*/
|
|
334
|
-
|
|
335
|
-
interface IOData {
|
|
336
|
-
inputs: WorkflowInputs;
|
|
337
|
-
outputs: WorkflowOutputs;
|
|
338
|
-
}
|
|
339
|
-
/** Input & Output */
|
|
340
|
-
interface IIOCenter {
|
|
341
|
-
inputs: WorkflowInputs;
|
|
342
|
-
outputs: WorkflowOutputs;
|
|
343
|
-
setInputs(inputs: WorkflowInputs): void;
|
|
344
|
-
setOutputs(outputs: WorkflowOutputs): void;
|
|
345
|
-
init(inputs: WorkflowInputs): void;
|
|
346
|
-
dispose(): void;
|
|
347
|
-
export(): IOData;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
309
|
/**
|
|
351
310
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
352
311
|
* SPDX-License-Identifier: MIT
|
|
@@ -360,7 +319,9 @@ declare enum FlowGramNode {
|
|
|
360
319
|
Condition = "condition",
|
|
361
320
|
Loop = "loop",
|
|
362
321
|
Comment = "comment",
|
|
363
|
-
Group = "group"
|
|
322
|
+
Group = "group",
|
|
323
|
+
BlockStart = "block-start",
|
|
324
|
+
BlockEnd = "block-end"
|
|
364
325
|
}
|
|
365
326
|
|
|
366
327
|
/**
|
|
@@ -427,6 +388,8 @@ interface INode<T = any> {
|
|
|
427
388
|
children: INode[];
|
|
428
389
|
prev: INode[];
|
|
429
390
|
next: INode[];
|
|
391
|
+
successors: INode[];
|
|
392
|
+
predecessors: INode[];
|
|
430
393
|
isBranch: boolean;
|
|
431
394
|
}
|
|
432
395
|
interface CreateNodeParams {
|
|
@@ -476,6 +439,77 @@ interface IState {
|
|
|
476
439
|
addExecutedNode(node: INode): void;
|
|
477
440
|
}
|
|
478
441
|
|
|
442
|
+
/**
|
|
443
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
444
|
+
* SPDX-License-Identifier: MIT
|
|
445
|
+
*/
|
|
446
|
+
|
|
447
|
+
interface SnapshotData {
|
|
448
|
+
nodeID: string;
|
|
449
|
+
inputs: WorkflowInputs;
|
|
450
|
+
outputs: WorkflowOutputs;
|
|
451
|
+
data: any;
|
|
452
|
+
branch?: string;
|
|
453
|
+
error?: string;
|
|
454
|
+
}
|
|
455
|
+
interface Snapshot extends SnapshotData {
|
|
456
|
+
id: string;
|
|
457
|
+
}
|
|
458
|
+
interface ISnapshot {
|
|
459
|
+
id: string;
|
|
460
|
+
data: Partial<SnapshotData>;
|
|
461
|
+
update(data: Partial<SnapshotData>): void;
|
|
462
|
+
validate(): boolean;
|
|
463
|
+
export(): Snapshot;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
468
|
+
* SPDX-License-Identifier: MIT
|
|
469
|
+
*/
|
|
470
|
+
|
|
471
|
+
interface ISnapshotCenter {
|
|
472
|
+
id: string;
|
|
473
|
+
create(snapshot: Partial<SnapshotData>): ISnapshot;
|
|
474
|
+
exportAll(): Snapshot[];
|
|
475
|
+
export(): Record<string, Snapshot[]>;
|
|
476
|
+
init(): void;
|
|
477
|
+
dispose(): void;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
482
|
+
* SPDX-License-Identifier: MIT
|
|
483
|
+
*/
|
|
484
|
+
declare enum WorkflowMessageType {
|
|
485
|
+
Log = "log",
|
|
486
|
+
Info = "info",
|
|
487
|
+
Debug = "debug",
|
|
488
|
+
Error = "error",
|
|
489
|
+
Warn = "warning"
|
|
490
|
+
}
|
|
491
|
+
interface MessageData {
|
|
492
|
+
message: string;
|
|
493
|
+
nodeID?: string;
|
|
494
|
+
timestamp?: number;
|
|
495
|
+
}
|
|
496
|
+
interface IMessage extends MessageData {
|
|
497
|
+
id: string;
|
|
498
|
+
type: WorkflowMessageType;
|
|
499
|
+
timestamp: number;
|
|
500
|
+
}
|
|
501
|
+
type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;
|
|
502
|
+
interface IMessageCenter {
|
|
503
|
+
init(): void;
|
|
504
|
+
dispose(): void;
|
|
505
|
+
log(data: MessageData): IMessage;
|
|
506
|
+
info(data: MessageData): IMessage;
|
|
507
|
+
debug(data: MessageData): IMessage;
|
|
508
|
+
error(data: MessageData): IMessage;
|
|
509
|
+
warn(data: MessageData): IMessage;
|
|
510
|
+
export(): WorkflowMessages;
|
|
511
|
+
}
|
|
512
|
+
|
|
479
513
|
/**
|
|
480
514
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
481
515
|
* SPDX-License-Identifier: MIT
|
|
@@ -485,21 +519,44 @@ interface NodeReport extends StatusData {
|
|
|
485
519
|
id: string;
|
|
486
520
|
snapshots: Snapshot[];
|
|
487
521
|
}
|
|
522
|
+
type WorkflowReports = Record<string, NodeReport>;
|
|
488
523
|
interface IReport {
|
|
489
524
|
id: string;
|
|
490
525
|
inputs: WorkflowInputs;
|
|
491
526
|
outputs: WorkflowOutputs;
|
|
492
527
|
workflowStatus: StatusData;
|
|
493
|
-
reports:
|
|
528
|
+
reports: WorkflowReports;
|
|
529
|
+
messages: WorkflowMessages;
|
|
494
530
|
}
|
|
495
531
|
interface IReporter {
|
|
496
532
|
snapshotCenter: ISnapshotCenter;
|
|
497
533
|
statusCenter: IStatusCenter;
|
|
534
|
+
messageCenter: IMessageCenter;
|
|
498
535
|
init(): void;
|
|
499
536
|
dispose(): void;
|
|
500
537
|
export(): IReport;
|
|
501
538
|
}
|
|
502
539
|
|
|
540
|
+
/**
|
|
541
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
542
|
+
* SPDX-License-Identifier: MIT
|
|
543
|
+
*/
|
|
544
|
+
|
|
545
|
+
interface IOData {
|
|
546
|
+
inputs: WorkflowInputs;
|
|
547
|
+
outputs: WorkflowOutputs;
|
|
548
|
+
}
|
|
549
|
+
/** Input & Output */
|
|
550
|
+
interface IIOCenter {
|
|
551
|
+
inputs: WorkflowInputs;
|
|
552
|
+
outputs: WorkflowOutputs;
|
|
553
|
+
setInputs(inputs: WorkflowInputs): void;
|
|
554
|
+
setOutputs(outputs: WorkflowOutputs): void;
|
|
555
|
+
init(inputs: WorkflowInputs): void;
|
|
556
|
+
dispose(): void;
|
|
557
|
+
export(): IOData;
|
|
558
|
+
}
|
|
559
|
+
|
|
503
560
|
/**
|
|
504
561
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
505
562
|
* SPDX-License-Identifier: MIT
|
|
@@ -512,6 +569,7 @@ interface ContextData {
|
|
|
512
569
|
ioCenter: IIOCenter;
|
|
513
570
|
snapshotCenter: ISnapshotCenter;
|
|
514
571
|
statusCenter: IStatusCenter;
|
|
572
|
+
messageCenter: IMessageCenter;
|
|
515
573
|
reporter: IReporter;
|
|
516
574
|
}
|
|
517
575
|
interface IContext extends ContextData {
|
|
@@ -545,8 +603,7 @@ interface TaskParams {
|
|
|
545
603
|
interface EndNodeData {
|
|
546
604
|
title: string;
|
|
547
605
|
inputs: IJsonSchema<'object'>;
|
|
548
|
-
|
|
549
|
-
outputValues: Record<string, IFlowConstantRefValue>;
|
|
606
|
+
inputsValues: Record<string, IFlowConstantRefValue>;
|
|
550
607
|
}
|
|
551
608
|
type EndNodeSchema = WorkflowNodeSchema<FlowGramNode.End, EndNodeData>;
|
|
552
609
|
|
|
@@ -581,6 +638,58 @@ interface StartNodeData {
|
|
|
581
638
|
}
|
|
582
639
|
type StartNodeSchema = WorkflowNodeSchema<FlowGramNode.Start, StartNodeData>;
|
|
583
640
|
|
|
641
|
+
/**
|
|
642
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
643
|
+
* SPDX-License-Identifier: MIT
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
interface LoopNodeData {
|
|
647
|
+
title: string;
|
|
648
|
+
loopFor: IFlowRefValue;
|
|
649
|
+
loopOutputs: Record<string, IFlowRefValue>;
|
|
650
|
+
}
|
|
651
|
+
type LoopNodeSchema = WorkflowNodeSchema<FlowGramNode.Loop, LoopNodeData>;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
655
|
+
* SPDX-License-Identifier: MIT
|
|
656
|
+
*/
|
|
657
|
+
declare enum ConditionOperation {
|
|
658
|
+
EQ = "eq",
|
|
659
|
+
NEQ = "neq",
|
|
660
|
+
GT = "gt",
|
|
661
|
+
GTE = "gte",
|
|
662
|
+
LT = "lt",
|
|
663
|
+
LTE = "lte",
|
|
664
|
+
IN = "in",
|
|
665
|
+
NIN = "nin",
|
|
666
|
+
CONTAINS = "contains",
|
|
667
|
+
NOT_CONTAINS = "not_contains",
|
|
668
|
+
IS_EMPTY = "is_empty",
|
|
669
|
+
IS_NOT_EMPTY = "is_not_empty",
|
|
670
|
+
IS_TRUE = "is_true",
|
|
671
|
+
IS_FALSE = "is_false"
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
676
|
+
* SPDX-License-Identifier: MIT
|
|
677
|
+
*/
|
|
678
|
+
|
|
679
|
+
interface ConditionItem {
|
|
680
|
+
key: string;
|
|
681
|
+
value: {
|
|
682
|
+
left: IFlowRefValue;
|
|
683
|
+
operator: ConditionOperation;
|
|
684
|
+
right: IFlowConstantRefValue;
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
interface ConditionNodeData {
|
|
688
|
+
title: string;
|
|
689
|
+
conditions: ConditionItem[];
|
|
690
|
+
}
|
|
691
|
+
type ConditionNodeSchema = WorkflowNodeSchema<FlowGramNode.Condition, ConditionNodeData>;
|
|
692
|
+
|
|
584
693
|
/**
|
|
585
694
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
586
695
|
* SPDX-License-Identifier: MIT
|
|
@@ -621,6 +730,7 @@ declare const IExecutor: unique symbol;
|
|
|
621
730
|
*/
|
|
622
731
|
|
|
623
732
|
interface EngineServices {
|
|
733
|
+
Validation: IValidation;
|
|
624
734
|
Executor: IExecutor;
|
|
625
735
|
}
|
|
626
736
|
interface IEngine {
|
|
@@ -632,20 +742,6 @@ interface IEngine {
|
|
|
632
742
|
}
|
|
633
743
|
declare const IEngine: unique symbol;
|
|
634
744
|
|
|
635
|
-
/**
|
|
636
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
637
|
-
* SPDX-License-Identifier: MIT
|
|
638
|
-
*/
|
|
639
|
-
|
|
640
|
-
interface ValidationResult {
|
|
641
|
-
valid: boolean;
|
|
642
|
-
errors?: string[];
|
|
643
|
-
}
|
|
644
|
-
interface IValidation {
|
|
645
|
-
validate(schema: WorkflowSchema): ValidationResult;
|
|
646
|
-
}
|
|
647
|
-
declare const IValidation: unique symbol;
|
|
648
|
-
|
|
649
745
|
/**
|
|
650
746
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
651
747
|
* SPDX-License-Identifier: MIT
|
|
@@ -693,12 +789,13 @@ declare const TaskReportDefine: FlowGramAPIDefine;
|
|
|
693
789
|
* SPDX-License-Identifier: MIT
|
|
694
790
|
*/
|
|
695
791
|
|
|
696
|
-
interface
|
|
792
|
+
interface TaskValidateInput {
|
|
793
|
+
inputs: WorkflowInputs;
|
|
697
794
|
schema: string;
|
|
698
795
|
}
|
|
699
|
-
interface
|
|
796
|
+
interface TaskValidateOutput extends ValidationResult {
|
|
700
797
|
}
|
|
701
|
-
declare const
|
|
798
|
+
declare const TaskValidateDefine: FlowGramAPIDefine;
|
|
702
799
|
|
|
703
800
|
/**
|
|
704
801
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -734,6 +831,7 @@ interface IRuntimeClient {
|
|
|
734
831
|
[FlowGramAPIName.TaskReport]: (input: TaskReportInput) => Promise<TaskReportOutput | undefined>;
|
|
735
832
|
[FlowGramAPIName.TaskResult]: (input: TaskResultInput) => Promise<TaskResultOutput | undefined>;
|
|
736
833
|
[FlowGramAPIName.TaskCancel]: (input: TaskCancelInput) => Promise<TaskCancelOutput | undefined>;
|
|
834
|
+
[FlowGramAPIName.TaskValidate]: (input: TaskValidateInput) => Promise<TaskValidateOutput | undefined>;
|
|
737
835
|
}
|
|
738
836
|
|
|
739
|
-
export { type ContainerService, type ContextData, type CreateEdgeParams, type CreateNodeParams, type CreatePortParams, type EndNodeSchema, type EngineServices, type ExecutionContext, type ExecutionResult, type FlowGramAPIDefine, type FlowGramAPIDefines, FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName, FlowGramAPINames, FlowGramAPIs, FlowGramNode, type IBasicJsonSchema, type IContainer, type IContext, type IDocument, type IEdge, IEngine, IExecutor, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IIOCenter, type IJsonSchema, type INode, type INodeExecutor, type INodeExecutorFactory, type IOData, type IPort, type IReport, type IReporter, type IRuntimeClient, type ISnapshot, type ISnapshotCenter, type IState, type IStatus, type IStatusCenter, type ITask, IValidation, type IVariable, type IVariableParseResult, type IVariableStore, type InvokeParams, type JsonSchemaBasicType, type LLMNodeSchema, type NodeReport, type NodeDeclare as NodeVariable, type PositionSchema, ServerInfoDefine, type ServerInfoInput, type ServerInfoOutput, type Snapshot, type SnapshotData, type StartNodeSchema, type StatusData, TaskCancelDefine, type TaskCancelInput, type TaskCancelOutput, type TaskParams, TaskReportDefine, type TaskReportInput, type TaskReportOutput, TaskResultDefine, type TaskResultInput, type TaskResultOutput, TaskRunDefine, type TaskRunInput, type TaskRunOutput, type
|
|
837
|
+
export { type ConditionItem, type ConditionNodeSchema, ConditionOperation, type ContainerService, type ContextData, type CreateEdgeParams, type CreateNodeParams, type CreatePortParams, type EndNodeSchema, type EngineServices, type ExecutionContext, type ExecutionResult, type FlowGramAPIDefine, type FlowGramAPIDefines, FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName, FlowGramAPINames, FlowGramAPIs, FlowGramNode, type IBasicJsonSchema, type IContainer, type IContext, type IDocument, type IEdge, IEngine, IExecutor, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IIOCenter, type IJsonSchema, type IMessage, type IMessageCenter, type INode, type INodeExecutor, type INodeExecutorFactory, type IOData, type IPort, type IReport, type IReporter, type IRuntimeClient, type ISnapshot, type ISnapshotCenter, type IState, type IStatus, type IStatusCenter, type ITask, IValidation, type IVariable, type IVariableParseResult, type IVariableStore, type InvokeParams, type JsonSchemaBasicType, type LLMNodeSchema, type LoopNodeSchema, type MessageData, type NodeReport, type NodeDeclare as NodeVariable, type PositionSchema, ServerInfoDefine, type ServerInfoInput, type ServerInfoOutput, type Snapshot, type SnapshotData, type StartNodeSchema, type StatusData, TaskCancelDefine, type TaskCancelInput, type TaskCancelOutput, type TaskParams, TaskReportDefine, type TaskReportInput, type TaskReportOutput, TaskResultDefine, type TaskResultInput, type TaskResultOutput, TaskRunDefine, type TaskRunInput, type TaskRunOutput, TaskValidateDefine, type TaskValidateInput, type TaskValidateOutput, type VOData, type ValidationResult, type WorkflowEdgeSchema, type WorkflowInputs, WorkflowMessageType, type WorkflowMessages, type WorkflowNodeMetaSchema, type WorkflowNodeSchema, type WorkflowOutputs, WorkflowPortType, type WorkflowReports, type WorkflowRuntimeInvoke, type WorkflowSchema, WorkflowStatus, WorkflowVariableType, type XYSchema };
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
ConditionOperation: () => ConditionOperation,
|
|
33
34
|
FlowGramAPIMethod: () => FlowGramAPIMethod,
|
|
34
35
|
FlowGramAPIModule: () => FlowGramAPIModule,
|
|
35
36
|
FlowGramAPIName: () => FlowGramAPIName,
|
|
@@ -44,15 +45,61 @@ __export(src_exports, {
|
|
|
44
45
|
TaskReportDefine: () => TaskReportDefine,
|
|
45
46
|
TaskResultDefine: () => TaskResultDefine,
|
|
46
47
|
TaskRunDefine: () => TaskRunDefine,
|
|
47
|
-
|
|
48
|
+
TaskValidateDefine: () => TaskValidateDefine,
|
|
49
|
+
WorkflowMessageType: () => WorkflowMessageType,
|
|
48
50
|
WorkflowPortType: () => WorkflowPortType,
|
|
49
51
|
WorkflowStatus: () => WorkflowStatus,
|
|
50
52
|
WorkflowVariableType: () => WorkflowVariableType
|
|
51
53
|
});
|
|
52
54
|
module.exports = __toCommonJS(src_exports);
|
|
53
55
|
|
|
54
|
-
// src/api/
|
|
56
|
+
// src/api/task-validate/index.ts
|
|
57
|
+
var import_zod2 = __toESM(require("zod"));
|
|
58
|
+
|
|
59
|
+
// src/api/schema.ts
|
|
55
60
|
var import_zod = __toESM(require("zod"));
|
|
61
|
+
var WorkflowIOZodSchema = import_zod.default.record(import_zod.default.string(), import_zod.default.any());
|
|
62
|
+
var WorkflowSnapshotZodSchema = import_zod.default.object({
|
|
63
|
+
id: import_zod.default.string(),
|
|
64
|
+
nodeID: import_zod.default.string(),
|
|
65
|
+
inputs: WorkflowIOZodSchema,
|
|
66
|
+
outputs: WorkflowIOZodSchema.optional(),
|
|
67
|
+
data: WorkflowIOZodSchema,
|
|
68
|
+
branch: import_zod.default.string().optional()
|
|
69
|
+
});
|
|
70
|
+
var WorkflowStatusZodShape = {
|
|
71
|
+
status: import_zod.default.string(),
|
|
72
|
+
terminated: import_zod.default.boolean(),
|
|
73
|
+
startTime: import_zod.default.number(),
|
|
74
|
+
endTime: import_zod.default.number().optional(),
|
|
75
|
+
timeCost: import_zod.default.number()
|
|
76
|
+
};
|
|
77
|
+
var WorkflowStatusZodSchema = import_zod.default.object(WorkflowStatusZodShape);
|
|
78
|
+
var WorkflowNodeReportZodSchema = import_zod.default.object({
|
|
79
|
+
id: import_zod.default.string(),
|
|
80
|
+
...WorkflowStatusZodShape,
|
|
81
|
+
snapshots: import_zod.default.array(WorkflowSnapshotZodSchema)
|
|
82
|
+
});
|
|
83
|
+
var WorkflowReportsZodSchema = import_zod.default.record(import_zod.default.string(), WorkflowNodeReportZodSchema);
|
|
84
|
+
var WorkflowMessageZodSchema = import_zod.default.object({
|
|
85
|
+
id: import_zod.default.string(),
|
|
86
|
+
type: import_zod.default.enum(["log", "info", "debug", "error", "warning"]),
|
|
87
|
+
message: import_zod.default.string(),
|
|
88
|
+
nodeID: import_zod.default.string().optional(),
|
|
89
|
+
timestamp: import_zod.default.number()
|
|
90
|
+
});
|
|
91
|
+
var WorkflowMessagesZodSchema = import_zod.default.record(
|
|
92
|
+
import_zod.default.enum(["log", "info", "debug", "error", "warning"]),
|
|
93
|
+
import_zod.default.array(WorkflowMessageZodSchema)
|
|
94
|
+
);
|
|
95
|
+
var WorkflowZodSchema = {
|
|
96
|
+
Inputs: WorkflowIOZodSchema,
|
|
97
|
+
Outputs: WorkflowIOZodSchema,
|
|
98
|
+
Status: WorkflowStatusZodSchema,
|
|
99
|
+
Snapshot: WorkflowSnapshotZodSchema,
|
|
100
|
+
Reports: WorkflowReportsZodSchema,
|
|
101
|
+
Messages: WorkflowMessagesZodSchema
|
|
102
|
+
};
|
|
56
103
|
|
|
57
104
|
// src/api/constant.ts
|
|
58
105
|
var FlowGramAPIMethod = /* @__PURE__ */ ((FlowGramAPIMethod2) => {
|
|
@@ -69,84 +116,35 @@ var FlowGramAPIName = /* @__PURE__ */ ((FlowGramAPIName2) => {
|
|
|
69
116
|
FlowGramAPIName2["TaskReport"] = "TaskReport";
|
|
70
117
|
FlowGramAPIName2["TaskResult"] = "TaskResult";
|
|
71
118
|
FlowGramAPIName2["TaskCancel"] = "TaskCancel";
|
|
72
|
-
FlowGramAPIName2["
|
|
119
|
+
FlowGramAPIName2["TaskValidate"] = "TaskValidate";
|
|
73
120
|
return FlowGramAPIName2;
|
|
74
121
|
})(FlowGramAPIName || {});
|
|
75
122
|
var FlowGramAPIModule = /* @__PURE__ */ ((FlowGramAPIModule2) => {
|
|
76
123
|
FlowGramAPIModule2["Info"] = "Info";
|
|
77
124
|
FlowGramAPIModule2["Task"] = "Task";
|
|
78
|
-
FlowGramAPIModule2["Validation"] = "Validation";
|
|
79
125
|
return FlowGramAPIModule2;
|
|
80
126
|
})(FlowGramAPIModule || {});
|
|
81
127
|
|
|
82
|
-
// src/api/
|
|
83
|
-
var
|
|
84
|
-
name: "
|
|
128
|
+
// src/api/task-validate/index.ts
|
|
129
|
+
var TaskValidateDefine = {
|
|
130
|
+
name: "TaskValidate" /* TaskValidate */,
|
|
85
131
|
method: "POST" /* POST */,
|
|
86
|
-
path: "/
|
|
87
|
-
module: "
|
|
132
|
+
path: "/task/validate",
|
|
133
|
+
module: "Task" /* Task */,
|
|
88
134
|
schema: {
|
|
89
|
-
input:
|
|
90
|
-
schema:
|
|
135
|
+
input: import_zod2.default.object({
|
|
136
|
+
schema: import_zod2.default.string(),
|
|
137
|
+
inputs: WorkflowZodSchema.Inputs
|
|
91
138
|
}),
|
|
92
|
-
output:
|
|
93
|
-
valid:
|
|
94
|
-
|
|
95
|
-
import_zod.default.object({
|
|
96
|
-
message: import_zod.default.string(),
|
|
97
|
-
nodeID: import_zod.default.string()
|
|
98
|
-
})
|
|
99
|
-
),
|
|
100
|
-
edgeErrors: import_zod.default.array(
|
|
101
|
-
import_zod.default.object({
|
|
102
|
-
message: import_zod.default.string(),
|
|
103
|
-
edge: import_zod.default.object({
|
|
104
|
-
sourceNodeID: import_zod.default.string(),
|
|
105
|
-
targetNodeID: import_zod.default.string(),
|
|
106
|
-
sourcePortID: import_zod.default.string().optional(),
|
|
107
|
-
targetPortID: import_zod.default.string().optional()
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
)
|
|
139
|
+
output: import_zod2.default.object({
|
|
140
|
+
valid: import_zod2.default.boolean(),
|
|
141
|
+
errors: import_zod2.default.array(import_zod2.default.string()).optional()
|
|
111
142
|
})
|
|
112
143
|
}
|
|
113
144
|
};
|
|
114
145
|
|
|
115
146
|
// src/api/task-run/index.ts
|
|
116
147
|
var import_zod3 = __toESM(require("zod"));
|
|
117
|
-
|
|
118
|
-
// src/api/schema.ts
|
|
119
|
-
var import_zod2 = __toESM(require("zod"));
|
|
120
|
-
var WorkflowIOZodSchema = import_zod2.default.record(import_zod2.default.string(), import_zod2.default.any());
|
|
121
|
-
var WorkflowSnapshotZodSchema = import_zod2.default.object({
|
|
122
|
-
id: import_zod2.default.string(),
|
|
123
|
-
nodeID: import_zod2.default.string(),
|
|
124
|
-
inputs: WorkflowIOZodSchema,
|
|
125
|
-
outputs: WorkflowIOZodSchema.optional(),
|
|
126
|
-
data: WorkflowIOZodSchema,
|
|
127
|
-
branch: import_zod2.default.string().optional()
|
|
128
|
-
});
|
|
129
|
-
var WorkflowStatusZodShape = {
|
|
130
|
-
status: import_zod2.default.string(),
|
|
131
|
-
terminated: import_zod2.default.boolean(),
|
|
132
|
-
startTime: import_zod2.default.number(),
|
|
133
|
-
endTime: import_zod2.default.number().optional(),
|
|
134
|
-
timeCost: import_zod2.default.number()
|
|
135
|
-
};
|
|
136
|
-
var WorkflowStatusZodSchema = import_zod2.default.object(WorkflowStatusZodShape);
|
|
137
|
-
var WorkflowZodSchema = {
|
|
138
|
-
Inputs: WorkflowIOZodSchema,
|
|
139
|
-
Outputs: WorkflowIOZodSchema,
|
|
140
|
-
Status: WorkflowStatusZodSchema,
|
|
141
|
-
Snapshot: WorkflowSnapshotZodSchema,
|
|
142
|
-
NodeReport: import_zod2.default.object({
|
|
143
|
-
id: import_zod2.default.string(),
|
|
144
|
-
...WorkflowStatusZodShape,
|
|
145
|
-
snapshots: import_zod2.default.array(WorkflowSnapshotZodSchema)
|
|
146
|
-
})
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
// src/api/task-run/index.ts
|
|
150
148
|
var TaskRunDefine = {
|
|
151
149
|
name: "TaskRun" /* TaskRun */,
|
|
152
150
|
method: "POST" /* POST */,
|
|
@@ -194,7 +192,8 @@ var TaskReportDefine = {
|
|
|
194
192
|
inputs: WorkflowZodSchema.Inputs,
|
|
195
193
|
outputs: WorkflowZodSchema.Outputs,
|
|
196
194
|
workflowStatus: WorkflowZodSchema.Status,
|
|
197
|
-
reports:
|
|
195
|
+
reports: WorkflowZodSchema.Reports,
|
|
196
|
+
messages: WorkflowZodSchema.Messages
|
|
198
197
|
})
|
|
199
198
|
}
|
|
200
199
|
};
|
|
@@ -241,7 +240,7 @@ var FlowGramAPIs = {
|
|
|
241
240
|
["TaskReport" /* TaskReport */]: TaskReportDefine,
|
|
242
241
|
["TaskResult" /* TaskResult */]: TaskResultDefine,
|
|
243
242
|
["TaskCancel" /* TaskCancel */]: TaskCancelDefine,
|
|
244
|
-
["
|
|
243
|
+
["TaskValidate" /* TaskValidate */]: TaskValidateDefine
|
|
245
244
|
};
|
|
246
245
|
var FlowGramAPINames = Object.keys(FlowGramAPIs);
|
|
247
246
|
|
|
@@ -273,9 +272,30 @@ var FlowGramNode = /* @__PURE__ */ ((FlowGramNode2) => {
|
|
|
273
272
|
FlowGramNode2["Loop"] = "loop";
|
|
274
273
|
FlowGramNode2["Comment"] = "comment";
|
|
275
274
|
FlowGramNode2["Group"] = "group";
|
|
275
|
+
FlowGramNode2["BlockStart"] = "block-start";
|
|
276
|
+
FlowGramNode2["BlockEnd"] = "block-end";
|
|
276
277
|
return FlowGramNode2;
|
|
277
278
|
})(FlowGramNode || {});
|
|
278
279
|
|
|
280
|
+
// src/node/condition/constant.ts
|
|
281
|
+
var ConditionOperation = /* @__PURE__ */ ((ConditionOperation2) => {
|
|
282
|
+
ConditionOperation2["EQ"] = "eq";
|
|
283
|
+
ConditionOperation2["NEQ"] = "neq";
|
|
284
|
+
ConditionOperation2["GT"] = "gt";
|
|
285
|
+
ConditionOperation2["GTE"] = "gte";
|
|
286
|
+
ConditionOperation2["LT"] = "lt";
|
|
287
|
+
ConditionOperation2["LTE"] = "lte";
|
|
288
|
+
ConditionOperation2["IN"] = "in";
|
|
289
|
+
ConditionOperation2["NIN"] = "nin";
|
|
290
|
+
ConditionOperation2["CONTAINS"] = "contains";
|
|
291
|
+
ConditionOperation2["NOT_CONTAINS"] = "not_contains";
|
|
292
|
+
ConditionOperation2["IS_EMPTY"] = "is_empty";
|
|
293
|
+
ConditionOperation2["IS_NOT_EMPTY"] = "is_not_empty";
|
|
294
|
+
ConditionOperation2["IS_TRUE"] = "is_true";
|
|
295
|
+
ConditionOperation2["IS_FALSE"] = "is_false";
|
|
296
|
+
return ConditionOperation2;
|
|
297
|
+
})(ConditionOperation || {});
|
|
298
|
+
|
|
279
299
|
// src/runtime/engine/index.ts
|
|
280
300
|
var IEngine = Symbol.for("Engine");
|
|
281
301
|
|
|
@@ -294,8 +314,19 @@ var WorkflowStatus = /* @__PURE__ */ ((WorkflowStatus2) => {
|
|
|
294
314
|
|
|
295
315
|
// src/runtime/validation/index.ts
|
|
296
316
|
var IValidation = Symbol.for("Validation");
|
|
317
|
+
|
|
318
|
+
// src/runtime/message/index.ts
|
|
319
|
+
var WorkflowMessageType = /* @__PURE__ */ ((WorkflowMessageType2) => {
|
|
320
|
+
WorkflowMessageType2["Log"] = "log";
|
|
321
|
+
WorkflowMessageType2["Info"] = "info";
|
|
322
|
+
WorkflowMessageType2["Debug"] = "debug";
|
|
323
|
+
WorkflowMessageType2["Error"] = "error";
|
|
324
|
+
WorkflowMessageType2["Warn"] = "warning";
|
|
325
|
+
return WorkflowMessageType2;
|
|
326
|
+
})(WorkflowMessageType || {});
|
|
297
327
|
// Annotate the CommonJS export names for ESM import in node:
|
|
298
328
|
0 && (module.exports = {
|
|
329
|
+
ConditionOperation,
|
|
299
330
|
FlowGramAPIMethod,
|
|
300
331
|
FlowGramAPIModule,
|
|
301
332
|
FlowGramAPIName,
|
|
@@ -310,7 +341,8 @@ var IValidation = Symbol.for("Validation");
|
|
|
310
341
|
TaskReportDefine,
|
|
311
342
|
TaskResultDefine,
|
|
312
343
|
TaskRunDefine,
|
|
313
|
-
|
|
344
|
+
TaskValidateDefine,
|
|
345
|
+
WorkflowMessageType,
|
|
314
346
|
WorkflowPortType,
|
|
315
347
|
WorkflowStatus,
|
|
316
348
|
WorkflowVariableType
|