@flowgram.ai/runtime-interface 0.2.23 → 0.2.25

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 CHANGED
@@ -1,5 +1,50 @@
1
- // src/api/validation/index.ts
1
+ // src/api/task-validate/index.ts
2
+ import z2 from "zod";
3
+
4
+ // src/api/schema.ts
2
5
  import z from "zod";
6
+ var WorkflowIOZodSchema = z.record(z.string(), z.any());
7
+ var WorkflowSnapshotZodSchema = z.object({
8
+ id: z.string(),
9
+ nodeID: z.string(),
10
+ inputs: WorkflowIOZodSchema,
11
+ outputs: WorkflowIOZodSchema.optional(),
12
+ data: WorkflowIOZodSchema,
13
+ branch: z.string().optional()
14
+ });
15
+ var WorkflowStatusZodShape = {
16
+ status: z.string(),
17
+ terminated: z.boolean(),
18
+ startTime: z.number(),
19
+ endTime: z.number().optional(),
20
+ timeCost: z.number()
21
+ };
22
+ var WorkflowStatusZodSchema = z.object(WorkflowStatusZodShape);
23
+ var WorkflowNodeReportZodSchema = z.object({
24
+ id: z.string(),
25
+ ...WorkflowStatusZodShape,
26
+ snapshots: z.array(WorkflowSnapshotZodSchema)
27
+ });
28
+ var WorkflowReportsZodSchema = z.record(z.string(), WorkflowNodeReportZodSchema);
29
+ var WorkflowMessageZodSchema = z.object({
30
+ id: z.string(),
31
+ type: z.enum(["log", "info", "debug", "error", "warning"]),
32
+ message: z.string(),
33
+ nodeID: z.string().optional(),
34
+ timestamp: z.number()
35
+ });
36
+ var WorkflowMessagesZodSchema = z.record(
37
+ z.enum(["log", "info", "debug", "error", "warning"]),
38
+ z.array(WorkflowMessageZodSchema)
39
+ );
40
+ var WorkflowZodSchema = {
41
+ Inputs: WorkflowIOZodSchema,
42
+ Outputs: WorkflowIOZodSchema,
43
+ Status: WorkflowStatusZodSchema,
44
+ Snapshot: WorkflowSnapshotZodSchema,
45
+ Reports: WorkflowReportsZodSchema,
46
+ Messages: WorkflowMessagesZodSchema
47
+ };
3
48
 
4
49
  // src/api/constant.ts
5
50
  var FlowGramAPIMethod = /* @__PURE__ */ ((FlowGramAPIMethod2) => {
@@ -16,84 +61,35 @@ var FlowGramAPIName = /* @__PURE__ */ ((FlowGramAPIName2) => {
16
61
  FlowGramAPIName2["TaskReport"] = "TaskReport";
17
62
  FlowGramAPIName2["TaskResult"] = "TaskResult";
18
63
  FlowGramAPIName2["TaskCancel"] = "TaskCancel";
19
- FlowGramAPIName2["Validation"] = "Validation";
64
+ FlowGramAPIName2["TaskValidate"] = "TaskValidate";
20
65
  return FlowGramAPIName2;
21
66
  })(FlowGramAPIName || {});
22
67
  var FlowGramAPIModule = /* @__PURE__ */ ((FlowGramAPIModule2) => {
23
68
  FlowGramAPIModule2["Info"] = "Info";
24
69
  FlowGramAPIModule2["Task"] = "Task";
25
- FlowGramAPIModule2["Validation"] = "Validation";
26
70
  return FlowGramAPIModule2;
27
71
  })(FlowGramAPIModule || {});
28
72
 
29
- // src/api/validation/index.ts
30
- var ValidationDefine = {
31
- name: "Validation" /* Validation */,
73
+ // src/api/task-validate/index.ts
74
+ var TaskValidateDefine = {
75
+ name: "TaskValidate" /* TaskValidate */,
32
76
  method: "POST" /* POST */,
33
- path: "/validation",
34
- module: "Validation" /* Validation */,
77
+ path: "/task/validate",
78
+ module: "Task" /* Task */,
35
79
  schema: {
36
- input: z.object({
37
- schema: z.string()
80
+ input: z2.object({
81
+ schema: z2.string(),
82
+ inputs: WorkflowZodSchema.Inputs
38
83
  }),
39
- output: z.object({
40
- valid: z.boolean(),
41
- nodeErrors: z.array(
42
- z.object({
43
- message: z.string(),
44
- nodeID: z.string()
45
- })
46
- ),
47
- edgeErrors: z.array(
48
- z.object({
49
- message: z.string(),
50
- edge: z.object({
51
- sourceNodeID: z.string(),
52
- targetNodeID: z.string(),
53
- sourcePortID: z.string().optional(),
54
- targetPortID: z.string().optional()
55
- })
56
- })
57
- )
84
+ output: z2.object({
85
+ valid: z2.boolean(),
86
+ errors: z2.array(z2.string()).optional()
58
87
  })
59
88
  }
60
89
  };
61
90
 
62
91
  // src/api/task-run/index.ts
63
92
  import z3 from "zod";
64
-
65
- // src/api/schema.ts
66
- import z2 from "zod";
67
- var WorkflowIOZodSchema = z2.record(z2.string(), z2.any());
68
- var WorkflowSnapshotZodSchema = z2.object({
69
- id: z2.string(),
70
- nodeID: z2.string(),
71
- inputs: WorkflowIOZodSchema,
72
- outputs: WorkflowIOZodSchema.optional(),
73
- data: WorkflowIOZodSchema,
74
- branch: z2.string().optional()
75
- });
76
- var WorkflowStatusZodShape = {
77
- status: z2.string(),
78
- terminated: z2.boolean(),
79
- startTime: z2.number(),
80
- endTime: z2.number().optional(),
81
- timeCost: z2.number()
82
- };
83
- var WorkflowStatusZodSchema = z2.object(WorkflowStatusZodShape);
84
- var WorkflowZodSchema = {
85
- Inputs: WorkflowIOZodSchema,
86
- Outputs: WorkflowIOZodSchema,
87
- Status: WorkflowStatusZodSchema,
88
- Snapshot: WorkflowSnapshotZodSchema,
89
- NodeReport: z2.object({
90
- id: z2.string(),
91
- ...WorkflowStatusZodShape,
92
- snapshots: z2.array(WorkflowSnapshotZodSchema)
93
- })
94
- };
95
-
96
- // src/api/task-run/index.ts
97
93
  var TaskRunDefine = {
98
94
  name: "TaskRun" /* TaskRun */,
99
95
  method: "POST" /* POST */,
@@ -141,7 +137,8 @@ var TaskReportDefine = {
141
137
  inputs: WorkflowZodSchema.Inputs,
142
138
  outputs: WorkflowZodSchema.Outputs,
143
139
  workflowStatus: WorkflowZodSchema.Status,
144
- reports: z5.record(z5.string(), WorkflowZodSchema.NodeReport)
140
+ reports: WorkflowZodSchema.Reports,
141
+ messages: WorkflowZodSchema.Messages
145
142
  })
146
143
  }
147
144
  };
@@ -188,7 +185,7 @@ var FlowGramAPIs = {
188
185
  ["TaskReport" /* TaskReport */]: TaskReportDefine,
189
186
  ["TaskResult" /* TaskResult */]: TaskResultDefine,
190
187
  ["TaskCancel" /* TaskCancel */]: TaskCancelDefine,
191
- ["Validation" /* Validation */]: ValidationDefine
188
+ ["TaskValidate" /* TaskValidate */]: TaskValidateDefine
192
189
  };
193
190
  var FlowGramAPINames = Object.keys(FlowGramAPIs);
194
191
 
@@ -288,7 +285,7 @@ export {
288
285
  TaskReportDefine,
289
286
  TaskResultDefine,
290
287
  TaskRunDefine,
291
- ValidationDefine,
288
+ TaskValidateDefine,
292
289
  WorkflowMessageType,
293
290
  WorkflowPortType,
294
291
  WorkflowStatus,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/validation/index.ts","../../src/api/constant.ts","../../src/api/task-run/index.ts","../../src/api/schema.ts","../../src/api/task-result/index.ts","../../src/api/task-report/index.ts","../../src/api/task-cancel/index.ts","../../src/api/server-info/index.ts","../../src/api/define.ts","../../src/schema/constant.ts","../../src/node/constant.ts","../../src/node/condition/constant.ts","../../src/runtime/engine/index.ts","../../src/runtime/executor/executor.ts","../../src/runtime/status/index.ts","../../src/runtime/validation/index.ts","../../src/runtime/message/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { ValidationResult } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface ValidationReq {\n schema: string;\n}\n\nexport interface ValidationRes extends ValidationResult {}\n\nexport const ValidationDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.Validation,\n method: FlowGramAPIMethod.POST,\n path: '/validation',\n module: FlowGramAPIModule.Validation,\n schema: {\n input: z.object({\n schema: z.string(),\n }),\n output: z.object({\n valid: z.boolean(),\n nodeErrors: z.array(\n z.object({\n message: z.string(),\n nodeID: z.string(),\n })\n ),\n edgeErrors: z.array(\n z.object({\n message: z.string(),\n edge: z.object({\n sourceNodeID: z.string(),\n targetNodeID: z.string(),\n sourcePortID: z.string().optional(),\n targetPortID: z.string().optional(),\n }),\n })\n ),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramAPIMethod {\n GET = 'GET',\n POST = 'POST',\n PUT = 'PUT',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\nexport enum FlowGramAPIName {\n ServerInfo = 'ServerInfo',\n TaskRun = 'TaskRun',\n TaskReport = 'TaskReport',\n TaskResult = 'TaskResult',\n TaskCancel = 'TaskCancel',\n Validation = 'Validation',\n}\n\nexport enum FlowGramAPIModule {\n Info = 'Info',\n Task = 'Task',\n Validation = 'Validation',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowInputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface TaskRunInput {\n inputs: WorkflowInputs;\n schema: string;\n}\n\nexport interface TaskRunOutput {\n taskID: string;\n}\n\nexport const TaskRunDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskRun,\n method: FlowGramAPIMethod.POST,\n path: '/task/run',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n schema: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n }),\n output: z.object({\n taskID: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nconst WorkflowIOZodSchema = z.record(z.string(), z.any());\nconst WorkflowSnapshotZodSchema = z.object({\n id: z.string(),\n nodeID: z.string(),\n inputs: WorkflowIOZodSchema,\n outputs: WorkflowIOZodSchema.optional(),\n data: WorkflowIOZodSchema,\n branch: z.string().optional(),\n});\nconst WorkflowStatusZodShape = {\n status: z.string(),\n terminated: z.boolean(),\n startTime: z.number(),\n endTime: z.number().optional(),\n timeCost: z.number(),\n};\nconst WorkflowStatusZodSchema = z.object(WorkflowStatusZodShape);\n\nexport const WorkflowZodSchema = {\n Inputs: WorkflowIOZodSchema,\n Outputs: WorkflowIOZodSchema,\n Status: WorkflowStatusZodSchema,\n Snapshot: WorkflowSnapshotZodSchema,\n NodeReport: z.object({\n id: z.string(),\n ...WorkflowStatusZodShape,\n snapshots: z.array(WorkflowSnapshotZodSchema),\n }),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowOutputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskResultInput {\n taskID: string;\n}\n\nexport type TaskResultOutput = WorkflowOutputs | undefined;\n\nexport const TaskResultDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskResult,\n method: FlowGramAPIMethod.GET,\n path: '/task/result',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: WorkflowZodSchema.Outputs,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { IReport } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskReportInput {\n taskID: string;\n}\n\nexport type TaskReportOutput = IReport | undefined;\n\nexport const TaskReportDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskReport,\n method: FlowGramAPIMethod.GET,\n path: '/task/report',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n id: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n outputs: WorkflowZodSchema.Outputs,\n workflowStatus: WorkflowZodSchema.Status,\n reports: z.record(z.string(), WorkflowZodSchema.NodeReport),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskCancelInput {\n taskID: string;\n}\n\nexport type TaskCancelOutput = {\n success: boolean;\n};\n\nexport const TaskCancelDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskCancel,\n method: FlowGramAPIMethod.PUT,\n path: '/task/cancel',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n success: z.boolean(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { type FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface ServerInfoInput {}\n\nexport interface ServerInfoOutput {\n name: string;\n title: string;\n description: string;\n runtime: string;\n version: string;\n time: string;\n}\n\nexport const ServerInfoDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.ServerInfo,\n method: FlowGramAPIMethod.GET,\n path: '/info',\n module: FlowGramAPIModule.Info,\n schema: {\n input: z.undefined(),\n output: z.object({\n name: z.string(),\n runtime: z.string(),\n version: z.string(),\n time: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ValidationDefine } from './validation';\nimport { FlowGramAPIDefines } from './type';\nimport { TaskRunDefine } from './task-run';\nimport { TaskResultDefine } from './task-result';\nimport { TaskReportDefine } from './task-report';\nimport { TaskCancelDefine } from './task-cancel';\nimport { ServerInfoDefine } from './server-info';\nimport { FlowGramAPIName } from './constant';\n\nexport const FlowGramAPIs: FlowGramAPIDefines = {\n [FlowGramAPIName.ServerInfo]: ServerInfoDefine,\n [FlowGramAPIName.TaskRun]: TaskRunDefine,\n [FlowGramAPIName.TaskReport]: TaskReportDefine,\n [FlowGramAPIName.TaskResult]: TaskResultDefine,\n [FlowGramAPIName.TaskCancel]: TaskCancelDefine,\n [FlowGramAPIName.Validation]: ValidationDefine,\n};\n\nexport const FlowGramAPINames = Object.keys(FlowGramAPIs) as FlowGramAPIName[];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowPortType {\n Input = 'input',\n Output = 'output',\n}\n\nexport enum WorkflowVariableType {\n String = 'string',\n Integer = 'integer',\n Number = 'number',\n Boolean = 'boolean',\n Object = 'object',\n Array = 'array',\n Null = 'null',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramNode {\n Root = 'root',\n Start = 'start',\n End = 'end',\n LLM = 'llm',\n code = 'code',\n Condition = 'condition',\n Loop = 'loop',\n Comment = 'comment',\n Group = 'group',\n BlockStart = 'block-start',\n BlockEnd = 'block-end',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum ConditionOperation {\n EQ = 'eq',\n NEQ = 'neq',\n GT = 'gt',\n GTE = 'gte',\n LT = 'lt',\n LTE = 'lte',\n IN = 'in',\n NIN = 'nin',\n CONTAINS = 'contains',\n NOT_CONTAINS = 'not_contains',\n IS_EMPTY = 'is_empty',\n IS_NOT_EMPTY = 'is_not_empty',\n IS_TRUE = 'is_true',\n IS_FALSE = 'is_false',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ITask } from '../task';\nimport { IExecutor } from '../executor';\nimport { INode } from '../document';\nimport { IContext } from '../context';\nimport { InvokeParams } from '../base';\n\nexport interface EngineServices {\n Executor: IExecutor;\n}\n\nexport interface IEngine {\n invoke(params: InvokeParams): ITask;\n executeNode(params: { context: IContext; node: INode }): Promise<void>;\n}\n\nexport const IEngine = Symbol.for('Engine');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ExecutionContext, ExecutionResult, INodeExecutor } from './node-executor';\n\nexport interface IExecutor {\n execute: (context: ExecutionContext) => Promise<ExecutionResult>;\n register: (executor: INodeExecutor) => void;\n}\n\nexport const IExecutor = Symbol.for('Executor');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowStatus {\n Pending = 'pending',\n Processing = 'processing',\n Succeeded = 'succeeded',\n Failed = 'failed',\n Canceled = 'canceled',\n}\n\nexport interface StatusData {\n status: WorkflowStatus;\n terminated: boolean;\n startTime: number;\n endTime?: number;\n timeCost: number;\n}\n\nexport interface IStatus extends StatusData {\n id: string;\n process(): void;\n success(): void;\n fail(): void;\n cancel(): void;\n export(): StatusData;\n}\n\nexport interface IStatusCenter {\n workflow: IStatus;\n nodeStatus(nodeID: string): IStatus;\n init(): void;\n dispose(): void;\n getStatusNodeIDs(status: WorkflowStatus): string[];\n exportNodeStatus(): Record<string, StatusData>;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { WorkflowSchema } from '@schema/index';\n\nexport interface ValidationResult {\n valid: boolean;\n errors?: string[];\n}\n\nexport interface IValidation {\n validate(schema: WorkflowSchema): ValidationResult;\n}\n\nexport const IValidation = Symbol.for('Validation');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowMessageType {\n Log = 'log',\n Info = 'info',\n Debug = 'debug',\n Error = 'error',\n Warn = 'warning',\n}\n\nexport interface MessageData {\n message: string;\n nodeID?: string;\n timestamp?: number;\n}\n\nexport interface IMessage extends MessageData {\n id: string;\n type: WorkflowMessageType;\n timestamp: number;\n}\n\nexport type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;\n\nexport interface IMessageCenter {\n init(): void;\n dispose(): void;\n log(data: MessageData): IMessage;\n info(data: MessageData): IMessage;\n debug(data: MessageData): IMessage;\n error(data: MessageData): IMessage;\n warn(data: MessageData): IMessage;\n export(): WorkflowMessages;\n}\n"],"mappings":";AAKA,OAAO,OAAO;;;ACAP,IAAK,oBAAL,kBAAKA,uBAAL;AACL,EAAAA,mBAAA,SAAM;AACN,EAAAA,mBAAA,UAAO;AACP,EAAAA,mBAAA,SAAM;AACN,EAAAA,mBAAA,YAAS;AACT,EAAAA,mBAAA,WAAQ;AALE,SAAAA;AAAA,GAAA;AAQL,IAAK,kBAAL,kBAAKC,qBAAL;AACL,EAAAA,iBAAA,gBAAa;AACb,EAAAA,iBAAA,aAAU;AACV,EAAAA,iBAAA,gBAAa;AACb,EAAAA,iBAAA,gBAAa;AACb,EAAAA,iBAAA,gBAAa;AACb,EAAAA,iBAAA,gBAAa;AANH,SAAAA;AAAA,GAAA;AASL,IAAK,oBAAL,kBAAKC,uBAAL;AACL,EAAAA,mBAAA,UAAO;AACP,EAAAA,mBAAA,UAAO;AACP,EAAAA,mBAAA,gBAAa;AAHH,SAAAA;AAAA,GAAA;;;ADLL,IAAM,mBAAsC;AAAA,EACjD;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,QAAQ;AAAA,IACN,OAAO,EAAE,OAAO;AAAA,MACd,QAAQ,EAAE,OAAO;AAAA,IACnB,CAAC;AAAA,IACD,QAAQ,EAAE,OAAO;AAAA,MACf,OAAO,EAAE,QAAQ;AAAA,MACjB,YAAY,EAAE;AAAA,QACZ,EAAE,OAAO;AAAA,UACP,SAAS,EA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;ACAL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,cAAW;AAdD,SAAAA;AAAA,GAAA;;;ACeL,IAAM,UAAU,OAAO,IAAI,QAAQ;;;ACRnC,IAAM,YAAY,OAAO,IAAI,UAAU;;;ACPvC,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,cAAW;AALD,SAAAA;AAAA,GAAA;;;ACWL,IAAM,cAAc,OAAO,IAAI,YAAY;;;ACX3C,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,SAAM;AACN,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AALG,SAAAA;AAAA,GAAA;","names":["FlowGramAPIMethod","FlowGramAPIName","FlowGramAPIModule","z","z","z","z","z","z","z","z","z","z","z","WorkflowPortType","WorkflowVariableType","FlowGramNode","ConditionOperation","WorkflowStatus","WorkflowMessageType"]}
1
+ {"version":3,"sources":["../../src/api/task-validate/index.ts","../../src/api/schema.ts","../../src/api/constant.ts","../../src/api/task-run/index.ts","../../src/api/task-result/index.ts","../../src/api/task-report/index.ts","../../src/api/task-cancel/index.ts","../../src/api/server-info/index.ts","../../src/api/define.ts","../../src/schema/constant.ts","../../src/node/constant.ts","../../src/node/condition/constant.ts","../../src/runtime/engine/index.ts","../../src/runtime/executor/executor.ts","../../src/runtime/status/index.ts","../../src/runtime/validation/index.ts","../../src/runtime/message/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { ValidationResult, WorkflowInputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface TaskValidateInput {\n inputs: WorkflowInputs;\n schema: string;\n}\n\nexport interface TaskValidateOutput extends ValidationResult {}\n\nexport const TaskValidateDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskValidate,\n method: FlowGramAPIMethod.POST,\n path: '/task/validate',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n schema: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n }),\n output: z.object({\n valid: z.boolean(),\n errors: z.array(z.string()).optional(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nconst WorkflowIOZodSchema = z.record(z.string(), z.any());\n\nconst WorkflowSnapshotZodSchema = z.object({\n id: z.string(),\n nodeID: z.string(),\n inputs: WorkflowIOZodSchema,\n outputs: WorkflowIOZodSchema.optional(),\n data: WorkflowIOZodSchema,\n branch: z.string().optional(),\n});\n\nconst WorkflowStatusZodShape = {\n status: z.string(),\n terminated: z.boolean(),\n startTime: z.number(),\n endTime: z.number().optional(),\n timeCost: z.number(),\n};\nconst WorkflowStatusZodSchema = z.object(WorkflowStatusZodShape);\n\nconst WorkflowNodeReportZodSchema = z.object({\n id: z.string(),\n ...WorkflowStatusZodShape,\n snapshots: z.array(WorkflowSnapshotZodSchema),\n});\n\nconst WorkflowReportsZodSchema = z.record(z.string(), WorkflowNodeReportZodSchema);\n\nconst WorkflowMessageZodSchema = z.object({\n id: z.string(),\n type: z.enum(['log', 'info', 'debug', 'error', 'warning']),\n message: z.string(),\n nodeID: z.string().optional(),\n timestamp: z.number(),\n});\n\nconst WorkflowMessagesZodSchema = z.record(\n z.enum(['log', 'info', 'debug', 'error', 'warning']),\n z.array(WorkflowMessageZodSchema)\n);\n\nexport const WorkflowZodSchema = {\n Inputs: WorkflowIOZodSchema,\n Outputs: WorkflowIOZodSchema,\n Status: WorkflowStatusZodSchema,\n Snapshot: WorkflowSnapshotZodSchema,\n Reports: WorkflowReportsZodSchema,\n Messages: WorkflowMessagesZodSchema,\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramAPIMethod {\n GET = 'GET',\n POST = 'POST',\n PUT = 'PUT',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\nexport enum FlowGramAPIName {\n ServerInfo = 'ServerInfo',\n TaskRun = 'TaskRun',\n TaskReport = 'TaskReport',\n TaskResult = 'TaskResult',\n TaskCancel = 'TaskCancel',\n TaskValidate = 'TaskValidate',\n}\n\nexport enum FlowGramAPIModule {\n Info = 'Info',\n Task = 'Task',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowInputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface TaskRunInput {\n inputs: WorkflowInputs;\n schema: string;\n}\n\nexport interface TaskRunOutput {\n taskID: string;\n}\n\nexport const TaskRunDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskRun,\n method: FlowGramAPIMethod.POST,\n path: '/task/run',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n schema: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n }),\n output: z.object({\n taskID: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowOutputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskResultInput {\n taskID: string;\n}\n\nexport type TaskResultOutput = WorkflowOutputs | undefined;\n\nexport const TaskResultDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskResult,\n method: FlowGramAPIMethod.GET,\n path: '/task/result',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: WorkflowZodSchema.Outputs,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { IReport } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskReportInput {\n taskID: string;\n}\n\nexport type TaskReportOutput = IReport | undefined;\n\nexport const TaskReportDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskReport,\n method: FlowGramAPIMethod.GET,\n path: '/task/report',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n id: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n outputs: WorkflowZodSchema.Outputs,\n workflowStatus: WorkflowZodSchema.Status,\n reports: WorkflowZodSchema.Reports,\n messages: WorkflowZodSchema.Messages,\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskCancelInput {\n taskID: string;\n}\n\nexport type TaskCancelOutput = {\n success: boolean;\n};\n\nexport const TaskCancelDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskCancel,\n method: FlowGramAPIMethod.PUT,\n path: '/task/cancel',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n success: z.boolean(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { type FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface ServerInfoInput {}\n\nexport interface ServerInfoOutput {\n name: string;\n title: string;\n description: string;\n runtime: string;\n version: string;\n time: string;\n}\n\nexport const ServerInfoDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.ServerInfo,\n method: FlowGramAPIMethod.GET,\n path: '/info',\n module: FlowGramAPIModule.Info,\n schema: {\n input: z.undefined(),\n output: z.object({\n name: z.string(),\n runtime: z.string(),\n version: z.string(),\n time: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowGramAPIDefines } from './type';\nimport { TaskValidateDefine } from './task-validate';\nimport { TaskRunDefine } from './task-run';\nimport { TaskResultDefine } from './task-result';\nimport { TaskReportDefine } from './task-report';\nimport { TaskCancelDefine } from './task-cancel';\nimport { ServerInfoDefine } from './server-info';\nimport { FlowGramAPIName } from './constant';\n\nexport const FlowGramAPIs: FlowGramAPIDefines = {\n [FlowGramAPIName.ServerInfo]: ServerInfoDefine,\n [FlowGramAPIName.TaskRun]: TaskRunDefine,\n [FlowGramAPIName.TaskReport]: TaskReportDefine,\n [FlowGramAPIName.TaskResult]: TaskResultDefine,\n [FlowGramAPIName.TaskCancel]: TaskCancelDefine,\n [FlowGramAPIName.TaskValidate]: TaskValidateDefine,\n};\n\nexport const FlowGramAPINames = Object.keys(FlowGramAPIs) as FlowGramAPIName[];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowPortType {\n Input = 'input',\n Output = 'output',\n}\n\nexport enum WorkflowVariableType {\n String = 'string',\n Integer = 'integer',\n Number = 'number',\n Boolean = 'boolean',\n Object = 'object',\n Array = 'array',\n Null = 'null',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramNode {\n Root = 'root',\n Start = 'start',\n End = 'end',\n LLM = 'llm',\n code = 'code',\n Condition = 'condition',\n Loop = 'loop',\n Comment = 'comment',\n Group = 'group',\n BlockStart = 'block-start',\n BlockEnd = 'block-end',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum ConditionOperation {\n EQ = 'eq',\n NEQ = 'neq',\n GT = 'gt',\n GTE = 'gte',\n LT = 'lt',\n LTE = 'lte',\n IN = 'in',\n NIN = 'nin',\n CONTAINS = 'contains',\n NOT_CONTAINS = 'not_contains',\n IS_EMPTY = 'is_empty',\n IS_NOT_EMPTY = 'is_not_empty',\n IS_TRUE = 'is_true',\n IS_FALSE = 'is_false',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IValidation } from '@runtime/validation';\nimport { ITask } from '../task';\nimport { IExecutor } from '../executor';\nimport { INode } from '../document';\nimport { IContext } from '../context';\nimport { InvokeParams } from '../base';\n\nexport interface EngineServices {\n Validation: IValidation;\n Executor: IExecutor;\n}\n\nexport interface IEngine {\n invoke(params: InvokeParams): ITask;\n executeNode(params: { context: IContext; node: INode }): Promise<void>;\n}\n\nexport const IEngine = Symbol.for('Engine');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ExecutionContext, ExecutionResult, INodeExecutor } from './node-executor';\n\nexport interface IExecutor {\n execute: (context: ExecutionContext) => Promise<ExecutionResult>;\n register: (executor: INodeExecutor) => void;\n}\n\nexport const IExecutor = Symbol.for('Executor');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowStatus {\n Pending = 'pending',\n Processing = 'processing',\n Succeeded = 'succeeded',\n Failed = 'failed',\n Canceled = 'canceled',\n}\n\nexport interface StatusData {\n status: WorkflowStatus;\n terminated: boolean;\n startTime: number;\n endTime?: number;\n timeCost: number;\n}\n\nexport interface IStatus extends StatusData {\n id: string;\n process(): void;\n success(): void;\n fail(): void;\n cancel(): void;\n export(): StatusData;\n}\n\nexport interface IStatusCenter {\n workflow: IStatus;\n nodeStatus(nodeID: string): IStatus;\n init(): void;\n dispose(): void;\n getStatusNodeIDs(status: WorkflowStatus): string[];\n exportNodeStatus(): Record<string, StatusData>;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { InvokeParams } from '@runtime/base';\n\nexport interface ValidationResult {\n valid: boolean;\n errors?: string[];\n}\n\nexport interface IValidation {\n invoke(params: InvokeParams): ValidationResult;\n}\n\nexport const IValidation = Symbol.for('Validation');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowMessageType {\n Log = 'log',\n Info = 'info',\n Debug = 'debug',\n Error = 'error',\n Warn = 'warning',\n}\n\nexport interface MessageData {\n message: string;\n nodeID?: string;\n timestamp?: number;\n}\n\nexport interface IMessage extends MessageData {\n id: string;\n type: WorkflowMessageType;\n timestamp: number;\n}\n\nexport type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;\n\nexport interface IMessageCenter {\n init(): void;\n dispose(): void;\n log(data: MessageData): IMessage;\n info(data: MessageData): IMessage;\n debug(data: MessageData): IMessage;\n error(data: MessageData): IMessage;\n warn(data: MessageData): IMessage;\n export(): WorkflowMessages;\n}\n"],"mappings":";AAKA,OAAOA,QAAO;;;ACAd,OAAO,OAAO;AAEd,IAAM,sBAAsB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAExD,IAAM,4BAA4B,EAAE,OAAO;AAAA,EACzC,IAAI,EAAE,OAAO;AAAA,EACb,QAAQ,EAAE,OAAO;AAAA,EACjB,QAAQ;AAAA,EACR,SAAS,oBAAoB,SAAS;AAAA,EACtC,MAAM;AAAA,EACN,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAED,IAAM,yBAAyB;AAAA,EAC7B,QAAQ,EAAE,OAAO;AAAA,EACjB,YAAY,EAAE,QAAQ;AAAA,EACtB,WAAW,EAAE,OAAO;AAAA,EACpB,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,UAAU,EAAE,OAAO;AACrB;AACA,IAAM,0BAA0B,EAAE,OAAO,sBAAsB;AAE/D,IAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,IAAI,EAAE,OAAO;AAAA,EACb,GAAG;AAAA,EACH,WAAW,EAAE,MAAM,yBAAyB;AAC9C,CAAC;AAED,IAAM,2BAA2B,EAAE,OAAO,EAAE,OAAO,GAAG,2BAA2B;AAEjF,IAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,KAAK,CAAC,OAAO,QAAQ,SAAS,SAAS,SAAS,CAAC;AAAA,EACzD,SAAS,EAAE,OAAO;AAAA,EAClB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,WAAW,EAAE,OAAO;AACtB,CAAC;AAED,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AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,cAAW;AAdD,SAAAA;AAAA,GAAA;;;ACiBL,IAAM,UAAU,OAAO,IAAI,QAAQ;;;ACVnC,IAAM,YAAY,OAAO,IAAI,UAAU;;;ACPvC,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,cAAW;AALD,SAAAA;AAAA,GAAA;;;ACWL,IAAM,cAAc,OAAO,IAAI,YAAY;;;ACX3C,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,SAAM;AACN,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AALG,SAAAA;AAAA,GAAA;","names":["z","FlowGramAPIMethod","FlowGramAPIName","FlowGramAPIModule","z","z","z","z","z","z","z","z","z","z","z","WorkflowPortType","WorkflowVariableType","FlowGramNode","ConditionOperation","WorkflowStatus","WorkflowMessageType"]}
@@ -17,12 +17,11 @@ declare enum FlowGramAPIName {
17
17
  TaskReport = "TaskReport",
18
18
  TaskResult = "TaskResult",
19
19
  TaskCancel = "TaskCancel",
20
- Validation = "Validation"
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,97 +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
- error?: string;
305
- }
306
- interface Snapshot extends SnapshotData {
307
- id: string;
308
- }
309
- interface ISnapshot {
310
- id: string;
311
- data: Partial<SnapshotData>;
312
- update(data: Partial<SnapshotData>): void;
313
- validate(): boolean;
314
- export(): Snapshot;
315
- }
316
-
317
- /**
318
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
319
- * SPDX-License-Identifier: MIT
320
- */
321
-
322
- interface ISnapshotCenter {
323
- id: string;
324
- create(snapshot: Partial<SnapshotData>): ISnapshot;
325
- exportAll(): Snapshot[];
326
- export(): Record<string, Snapshot[]>;
327
- init(): void;
328
- dispose(): void;
329
- }
330
-
331
- /**
332
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
333
- * SPDX-License-Identifier: MIT
334
- */
335
- declare enum WorkflowMessageType {
336
- Log = "log",
337
- Info = "info",
338
- Debug = "debug",
339
- Error = "error",
340
- Warn = "warning"
341
- }
342
- interface MessageData {
343
- message: string;
344
- nodeID?: string;
345
- timestamp?: number;
346
- }
347
- interface IMessage extends MessageData {
348
- id: string;
349
- type: WorkflowMessageType;
350
- timestamp: number;
351
- }
352
- type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;
353
- interface IMessageCenter {
354
- init(): void;
355
- dispose(): void;
356
- log(data: MessageData): IMessage;
357
- info(data: MessageData): IMessage;
358
- debug(data: MessageData): IMessage;
359
- error(data: MessageData): IMessage;
360
- warn(data: MessageData): IMessage;
361
- export(): WorkflowMessages;
362
- }
363
-
364
- /**
365
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
366
- * SPDX-License-Identifier: MIT
367
- */
368
-
369
- interface IOData {
370
- inputs: WorkflowInputs;
371
- outputs: WorkflowOutputs;
372
- }
373
- /** Input & Output */
374
- interface IIOCenter {
375
- inputs: WorkflowInputs;
376
- outputs: WorkflowOutputs;
377
- setInputs(inputs: WorkflowInputs): void;
378
- setOutputs(outputs: WorkflowOutputs): void;
379
- init(inputs: WorkflowInputs): void;
380
- dispose(): void;
381
- export(): IOData;
382
- }
383
-
384
309
  /**
385
310
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
386
311
  * SPDX-License-Identifier: MIT
@@ -514,6 +439,77 @@ interface IState {
514
439
  addExecutedNode(node: INode): void;
515
440
  }
516
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
+
517
513
  /**
518
514
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
519
515
  * SPDX-License-Identifier: MIT
@@ -541,6 +537,26 @@ interface IReporter {
541
537
  export(): IReport;
542
538
  }
543
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
+
544
560
  /**
545
561
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
546
562
  * SPDX-License-Identifier: MIT
@@ -714,6 +730,7 @@ declare const IExecutor: unique symbol;
714
730
  */
715
731
 
716
732
  interface EngineServices {
733
+ Validation: IValidation;
717
734
  Executor: IExecutor;
718
735
  }
719
736
  interface IEngine {
@@ -725,20 +742,6 @@ interface IEngine {
725
742
  }
726
743
  declare const IEngine: unique symbol;
727
744
 
728
- /**
729
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
730
- * SPDX-License-Identifier: MIT
731
- */
732
-
733
- interface ValidationResult {
734
- valid: boolean;
735
- errors?: string[];
736
- }
737
- interface IValidation {
738
- validate(schema: WorkflowSchema): ValidationResult;
739
- }
740
- declare const IValidation: unique symbol;
741
-
742
745
  /**
743
746
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
744
747
  * SPDX-License-Identifier: MIT
@@ -786,12 +789,13 @@ declare const TaskReportDefine: FlowGramAPIDefine;
786
789
  * SPDX-License-Identifier: MIT
787
790
  */
788
791
 
789
- interface ValidationReq {
792
+ interface TaskValidateInput {
793
+ inputs: WorkflowInputs;
790
794
  schema: string;
791
795
  }
792
- interface ValidationRes extends ValidationResult {
796
+ interface TaskValidateOutput extends ValidationResult {
793
797
  }
794
- declare const ValidationDefine: FlowGramAPIDefine;
798
+ declare const TaskValidateDefine: FlowGramAPIDefine;
795
799
 
796
800
  /**
797
801
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -827,6 +831,7 @@ interface IRuntimeClient {
827
831
  [FlowGramAPIName.TaskReport]: (input: TaskReportInput) => Promise<TaskReportOutput | undefined>;
828
832
  [FlowGramAPIName.TaskResult]: (input: TaskResultInput) => Promise<TaskResultOutput | undefined>;
829
833
  [FlowGramAPIName.TaskCancel]: (input: TaskCancelInput) => Promise<TaskCancelOutput | undefined>;
834
+ [FlowGramAPIName.TaskValidate]: (input: TaskValidateInput) => Promise<TaskValidateOutput | undefined>;
830
835
  }
831
836
 
832
- 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, type VOData, ValidationDefine, type ValidationReq, type ValidationRes, 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 };
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.d.ts CHANGED
@@ -17,12 +17,11 @@ declare enum FlowGramAPIName {
17
17
  TaskReport = "TaskReport",
18
18
  TaskResult = "TaskResult",
19
19
  TaskCancel = "TaskCancel",
20
- Validation = "Validation"
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,97 +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
- error?: string;
305
- }
306
- interface Snapshot extends SnapshotData {
307
- id: string;
308
- }
309
- interface ISnapshot {
310
- id: string;
311
- data: Partial<SnapshotData>;
312
- update(data: Partial<SnapshotData>): void;
313
- validate(): boolean;
314
- export(): Snapshot;
315
- }
316
-
317
- /**
318
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
319
- * SPDX-License-Identifier: MIT
320
- */
321
-
322
- interface ISnapshotCenter {
323
- id: string;
324
- create(snapshot: Partial<SnapshotData>): ISnapshot;
325
- exportAll(): Snapshot[];
326
- export(): Record<string, Snapshot[]>;
327
- init(): void;
328
- dispose(): void;
329
- }
330
-
331
- /**
332
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
333
- * SPDX-License-Identifier: MIT
334
- */
335
- declare enum WorkflowMessageType {
336
- Log = "log",
337
- Info = "info",
338
- Debug = "debug",
339
- Error = "error",
340
- Warn = "warning"
341
- }
342
- interface MessageData {
343
- message: string;
344
- nodeID?: string;
345
- timestamp?: number;
346
- }
347
- interface IMessage extends MessageData {
348
- id: string;
349
- type: WorkflowMessageType;
350
- timestamp: number;
351
- }
352
- type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;
353
- interface IMessageCenter {
354
- init(): void;
355
- dispose(): void;
356
- log(data: MessageData): IMessage;
357
- info(data: MessageData): IMessage;
358
- debug(data: MessageData): IMessage;
359
- error(data: MessageData): IMessage;
360
- warn(data: MessageData): IMessage;
361
- export(): WorkflowMessages;
362
- }
363
-
364
- /**
365
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
366
- * SPDX-License-Identifier: MIT
367
- */
368
-
369
- interface IOData {
370
- inputs: WorkflowInputs;
371
- outputs: WorkflowOutputs;
372
- }
373
- /** Input & Output */
374
- interface IIOCenter {
375
- inputs: WorkflowInputs;
376
- outputs: WorkflowOutputs;
377
- setInputs(inputs: WorkflowInputs): void;
378
- setOutputs(outputs: WorkflowOutputs): void;
379
- init(inputs: WorkflowInputs): void;
380
- dispose(): void;
381
- export(): IOData;
382
- }
383
-
384
309
  /**
385
310
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
386
311
  * SPDX-License-Identifier: MIT
@@ -514,6 +439,77 @@ interface IState {
514
439
  addExecutedNode(node: INode): void;
515
440
  }
516
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
+
517
513
  /**
518
514
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
519
515
  * SPDX-License-Identifier: MIT
@@ -541,6 +537,26 @@ interface IReporter {
541
537
  export(): IReport;
542
538
  }
543
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
+
544
560
  /**
545
561
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
546
562
  * SPDX-License-Identifier: MIT
@@ -714,6 +730,7 @@ declare const IExecutor: unique symbol;
714
730
  */
715
731
 
716
732
  interface EngineServices {
733
+ Validation: IValidation;
717
734
  Executor: IExecutor;
718
735
  }
719
736
  interface IEngine {
@@ -725,20 +742,6 @@ interface IEngine {
725
742
  }
726
743
  declare const IEngine: unique symbol;
727
744
 
728
- /**
729
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
730
- * SPDX-License-Identifier: MIT
731
- */
732
-
733
- interface ValidationResult {
734
- valid: boolean;
735
- errors?: string[];
736
- }
737
- interface IValidation {
738
- validate(schema: WorkflowSchema): ValidationResult;
739
- }
740
- declare const IValidation: unique symbol;
741
-
742
745
  /**
743
746
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
744
747
  * SPDX-License-Identifier: MIT
@@ -786,12 +789,13 @@ declare const TaskReportDefine: FlowGramAPIDefine;
786
789
  * SPDX-License-Identifier: MIT
787
790
  */
788
791
 
789
- interface ValidationReq {
792
+ interface TaskValidateInput {
793
+ inputs: WorkflowInputs;
790
794
  schema: string;
791
795
  }
792
- interface ValidationRes extends ValidationResult {
796
+ interface TaskValidateOutput extends ValidationResult {
793
797
  }
794
- declare const ValidationDefine: FlowGramAPIDefine;
798
+ declare const TaskValidateDefine: FlowGramAPIDefine;
795
799
 
796
800
  /**
797
801
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -827,6 +831,7 @@ interface IRuntimeClient {
827
831
  [FlowGramAPIName.TaskReport]: (input: TaskReportInput) => Promise<TaskReportOutput | undefined>;
828
832
  [FlowGramAPIName.TaskResult]: (input: TaskResultInput) => Promise<TaskResultOutput | undefined>;
829
833
  [FlowGramAPIName.TaskCancel]: (input: TaskCancelInput) => Promise<TaskCancelOutput | undefined>;
834
+ [FlowGramAPIName.TaskValidate]: (input: TaskValidateInput) => Promise<TaskValidateOutput | undefined>;
830
835
  }
831
836
 
832
- 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, type VOData, ValidationDefine, type ValidationReq, type ValidationRes, 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 };
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
@@ -45,7 +45,7 @@ __export(src_exports, {
45
45
  TaskReportDefine: () => TaskReportDefine,
46
46
  TaskResultDefine: () => TaskResultDefine,
47
47
  TaskRunDefine: () => TaskRunDefine,
48
- ValidationDefine: () => ValidationDefine,
48
+ TaskValidateDefine: () => TaskValidateDefine,
49
49
  WorkflowMessageType: () => WorkflowMessageType,
50
50
  WorkflowPortType: () => WorkflowPortType,
51
51
  WorkflowStatus: () => WorkflowStatus,
@@ -53,8 +53,53 @@ __export(src_exports, {
53
53
  });
54
54
  module.exports = __toCommonJS(src_exports);
55
55
 
56
- // src/api/validation/index.ts
57
- var import_zod = __toESM(require("zod"));
56
+ // src/api/task-validate/index.ts
57
+ var import_zod2 = __toESM(require("zod"), 1);
58
+
59
+ // src/api/schema.ts
60
+ var import_zod = __toESM(require("zod"), 1);
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
+ };
58
103
 
59
104
  // src/api/constant.ts
60
105
  var FlowGramAPIMethod = /* @__PURE__ */ ((FlowGramAPIMethod2) => {
@@ -71,84 +116,35 @@ var FlowGramAPIName = /* @__PURE__ */ ((FlowGramAPIName2) => {
71
116
  FlowGramAPIName2["TaskReport"] = "TaskReport";
72
117
  FlowGramAPIName2["TaskResult"] = "TaskResult";
73
118
  FlowGramAPIName2["TaskCancel"] = "TaskCancel";
74
- FlowGramAPIName2["Validation"] = "Validation";
119
+ FlowGramAPIName2["TaskValidate"] = "TaskValidate";
75
120
  return FlowGramAPIName2;
76
121
  })(FlowGramAPIName || {});
77
122
  var FlowGramAPIModule = /* @__PURE__ */ ((FlowGramAPIModule2) => {
78
123
  FlowGramAPIModule2["Info"] = "Info";
79
124
  FlowGramAPIModule2["Task"] = "Task";
80
- FlowGramAPIModule2["Validation"] = "Validation";
81
125
  return FlowGramAPIModule2;
82
126
  })(FlowGramAPIModule || {});
83
127
 
84
- // src/api/validation/index.ts
85
- var ValidationDefine = {
86
- name: "Validation" /* Validation */,
128
+ // src/api/task-validate/index.ts
129
+ var TaskValidateDefine = {
130
+ name: "TaskValidate" /* TaskValidate */,
87
131
  method: "POST" /* POST */,
88
- path: "/validation",
89
- module: "Validation" /* Validation */,
132
+ path: "/task/validate",
133
+ module: "Task" /* Task */,
90
134
  schema: {
91
- input: import_zod.default.object({
92
- schema: import_zod.default.string()
135
+ input: import_zod2.default.object({
136
+ schema: import_zod2.default.string(),
137
+ inputs: WorkflowZodSchema.Inputs
93
138
  }),
94
- output: import_zod.default.object({
95
- valid: import_zod.default.boolean(),
96
- nodeErrors: import_zod.default.array(
97
- import_zod.default.object({
98
- message: import_zod.default.string(),
99
- nodeID: import_zod.default.string()
100
- })
101
- ),
102
- edgeErrors: import_zod.default.array(
103
- import_zod.default.object({
104
- message: import_zod.default.string(),
105
- edge: import_zod.default.object({
106
- sourceNodeID: import_zod.default.string(),
107
- targetNodeID: import_zod.default.string(),
108
- sourcePortID: import_zod.default.string().optional(),
109
- targetPortID: import_zod.default.string().optional()
110
- })
111
- })
112
- )
139
+ output: import_zod2.default.object({
140
+ valid: import_zod2.default.boolean(),
141
+ errors: import_zod2.default.array(import_zod2.default.string()).optional()
113
142
  })
114
143
  }
115
144
  };
116
145
 
117
146
  // src/api/task-run/index.ts
118
- var import_zod3 = __toESM(require("zod"));
119
-
120
- // src/api/schema.ts
121
- var import_zod2 = __toESM(require("zod"));
122
- var WorkflowIOZodSchema = import_zod2.default.record(import_zod2.default.string(), import_zod2.default.any());
123
- var WorkflowSnapshotZodSchema = import_zod2.default.object({
124
- id: import_zod2.default.string(),
125
- nodeID: import_zod2.default.string(),
126
- inputs: WorkflowIOZodSchema,
127
- outputs: WorkflowIOZodSchema.optional(),
128
- data: WorkflowIOZodSchema,
129
- branch: import_zod2.default.string().optional()
130
- });
131
- var WorkflowStatusZodShape = {
132
- status: import_zod2.default.string(),
133
- terminated: import_zod2.default.boolean(),
134
- startTime: import_zod2.default.number(),
135
- endTime: import_zod2.default.number().optional(),
136
- timeCost: import_zod2.default.number()
137
- };
138
- var WorkflowStatusZodSchema = import_zod2.default.object(WorkflowStatusZodShape);
139
- var WorkflowZodSchema = {
140
- Inputs: WorkflowIOZodSchema,
141
- Outputs: WorkflowIOZodSchema,
142
- Status: WorkflowStatusZodSchema,
143
- Snapshot: WorkflowSnapshotZodSchema,
144
- NodeReport: import_zod2.default.object({
145
- id: import_zod2.default.string(),
146
- ...WorkflowStatusZodShape,
147
- snapshots: import_zod2.default.array(WorkflowSnapshotZodSchema)
148
- })
149
- };
150
-
151
- // src/api/task-run/index.ts
147
+ var import_zod3 = __toESM(require("zod"), 1);
152
148
  var TaskRunDefine = {
153
149
  name: "TaskRun" /* TaskRun */,
154
150
  method: "POST" /* POST */,
@@ -166,7 +162,7 @@ var TaskRunDefine = {
166
162
  };
167
163
 
168
164
  // src/api/task-result/index.ts
169
- var import_zod4 = __toESM(require("zod"));
165
+ var import_zod4 = __toESM(require("zod"), 1);
170
166
  var TaskResultDefine = {
171
167
  name: "TaskResult" /* TaskResult */,
172
168
  method: "GET" /* GET */,
@@ -181,7 +177,7 @@ var TaskResultDefine = {
181
177
  };
182
178
 
183
179
  // src/api/task-report/index.ts
184
- var import_zod5 = __toESM(require("zod"));
180
+ var import_zod5 = __toESM(require("zod"), 1);
185
181
  var TaskReportDefine = {
186
182
  name: "TaskReport" /* TaskReport */,
187
183
  method: "GET" /* GET */,
@@ -196,13 +192,14 @@ var TaskReportDefine = {
196
192
  inputs: WorkflowZodSchema.Inputs,
197
193
  outputs: WorkflowZodSchema.Outputs,
198
194
  workflowStatus: WorkflowZodSchema.Status,
199
- reports: import_zod5.default.record(import_zod5.default.string(), WorkflowZodSchema.NodeReport)
195
+ reports: WorkflowZodSchema.Reports,
196
+ messages: WorkflowZodSchema.Messages
200
197
  })
201
198
  }
202
199
  };
203
200
 
204
201
  // src/api/task-cancel/index.ts
205
- var import_zod6 = __toESM(require("zod"));
202
+ var import_zod6 = __toESM(require("zod"), 1);
206
203
  var TaskCancelDefine = {
207
204
  name: "TaskCancel" /* TaskCancel */,
208
205
  method: "PUT" /* PUT */,
@@ -219,7 +216,7 @@ var TaskCancelDefine = {
219
216
  };
220
217
 
221
218
  // src/api/server-info/index.ts
222
- var import_zod7 = __toESM(require("zod"));
219
+ var import_zod7 = __toESM(require("zod"), 1);
223
220
  var ServerInfoDefine = {
224
221
  name: "ServerInfo" /* ServerInfo */,
225
222
  method: "GET" /* GET */,
@@ -243,7 +240,7 @@ var FlowGramAPIs = {
243
240
  ["TaskReport" /* TaskReport */]: TaskReportDefine,
244
241
  ["TaskResult" /* TaskResult */]: TaskResultDefine,
245
242
  ["TaskCancel" /* TaskCancel */]: TaskCancelDefine,
246
- ["Validation" /* Validation */]: ValidationDefine
243
+ ["TaskValidate" /* TaskValidate */]: TaskValidateDefine
247
244
  };
248
245
  var FlowGramAPINames = Object.keys(FlowGramAPIs);
249
246
 
@@ -344,7 +341,7 @@ var WorkflowMessageType = /* @__PURE__ */ ((WorkflowMessageType2) => {
344
341
  TaskReportDefine,
345
342
  TaskResultDefine,
346
343
  TaskRunDefine,
347
- ValidationDefine,
344
+ TaskValidateDefine,
348
345
  WorkflowMessageType,
349
346
  WorkflowPortType,
350
347
  WorkflowStatus,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/api/validation/index.ts","../src/api/constant.ts","../src/api/task-run/index.ts","../src/api/schema.ts","../src/api/task-result/index.ts","../src/api/task-report/index.ts","../src/api/task-cancel/index.ts","../src/api/server-info/index.ts","../src/api/define.ts","../src/schema/constant.ts","../src/node/constant.ts","../src/node/condition/constant.ts","../src/runtime/engine/index.ts","../src/runtime/executor/executor.ts","../src/runtime/status/index.ts","../src/runtime/validation/index.ts","../src/runtime/message/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './api';\nexport * from './schema';\nexport * from './node';\nexport * from './runtime';\nexport * from './client';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { ValidationResult } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface ValidationReq {\n schema: string;\n}\n\nexport interface ValidationRes extends ValidationResult {}\n\nexport const ValidationDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.Validation,\n method: FlowGramAPIMethod.POST,\n path: '/validation',\n module: FlowGramAPIModule.Validation,\n schema: {\n input: z.object({\n schema: z.string(),\n }),\n output: z.object({\n valid: z.boolean(),\n nodeErrors: z.array(\n z.object({\n message: z.string(),\n nodeID: z.string(),\n })\n ),\n edgeErrors: z.array(\n z.object({\n message: z.string(),\n edge: z.object({\n sourceNodeID: z.string(),\n targetNodeID: z.string(),\n sourcePortID: z.string().optional(),\n targetPortID: z.string().optional(),\n }),\n })\n ),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramAPIMethod {\n GET = 'GET',\n POST = 'POST',\n PUT = 'PUT',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\nexport enum FlowGramAPIName {\n ServerInfo = 'ServerInfo',\n TaskRun = 'TaskRun',\n TaskReport = 'TaskReport',\n TaskResult = 'TaskResult',\n TaskCancel = 'TaskCancel',\n Validation = 'Validation',\n}\n\nexport enum FlowGramAPIModule {\n Info = 'Info',\n Task = 'Task',\n Validation = 'Validation',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowInputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface TaskRunInput {\n inputs: WorkflowInputs;\n schema: string;\n}\n\nexport interface TaskRunOutput {\n taskID: string;\n}\n\nexport const TaskRunDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskRun,\n method: FlowGramAPIMethod.POST,\n path: '/task/run',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n schema: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n }),\n output: z.object({\n taskID: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nconst WorkflowIOZodSchema = z.record(z.string(), z.any());\nconst WorkflowSnapshotZodSchema = z.object({\n id: z.string(),\n nodeID: z.string(),\n inputs: WorkflowIOZodSchema,\n outputs: WorkflowIOZodSchema.optional(),\n data: WorkflowIOZodSchema,\n branch: z.string().optional(),\n});\nconst WorkflowStatusZodShape = {\n status: z.string(),\n terminated: z.boolean(),\n startTime: z.number(),\n endTime: z.number().optional(),\n timeCost: z.number(),\n};\nconst WorkflowStatusZodSchema = z.object(WorkflowStatusZodShape);\n\nexport const WorkflowZodSchema = {\n Inputs: WorkflowIOZodSchema,\n Outputs: WorkflowIOZodSchema,\n Status: WorkflowStatusZodSchema,\n Snapshot: WorkflowSnapshotZodSchema,\n NodeReport: z.object({\n id: z.string(),\n ...WorkflowStatusZodShape,\n snapshots: z.array(WorkflowSnapshotZodSchema),\n }),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowOutputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskResultInput {\n taskID: string;\n}\n\nexport type TaskResultOutput = WorkflowOutputs | undefined;\n\nexport const TaskResultDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskResult,\n method: FlowGramAPIMethod.GET,\n path: '/task/result',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: WorkflowZodSchema.Outputs,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { IReport } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskReportInput {\n taskID: string;\n}\n\nexport type TaskReportOutput = IReport | undefined;\n\nexport const TaskReportDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskReport,\n method: FlowGramAPIMethod.GET,\n path: '/task/report',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n id: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n outputs: WorkflowZodSchema.Outputs,\n workflowStatus: WorkflowZodSchema.Status,\n reports: z.record(z.string(), WorkflowZodSchema.NodeReport),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskCancelInput {\n taskID: string;\n}\n\nexport type TaskCancelOutput = {\n success: boolean;\n};\n\nexport const TaskCancelDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskCancel,\n method: FlowGramAPIMethod.PUT,\n path: '/task/cancel',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n success: z.boolean(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { type FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface ServerInfoInput {}\n\nexport interface ServerInfoOutput {\n name: string;\n title: string;\n description: string;\n runtime: string;\n version: string;\n time: string;\n}\n\nexport const ServerInfoDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.ServerInfo,\n method: FlowGramAPIMethod.GET,\n path: '/info',\n module: FlowGramAPIModule.Info,\n schema: {\n input: z.undefined(),\n output: z.object({\n name: z.string(),\n runtime: z.string(),\n version: z.string(),\n time: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ValidationDefine } from './validation';\nimport { FlowGramAPIDefines } from './type';\nimport { TaskRunDefine } from './task-run';\nimport { TaskResultDefine } from './task-result';\nimport { TaskReportDefine } from './task-report';\nimport { TaskCancelDefine } from './task-cancel';\nimport { ServerInfoDefine } from './server-info';\nimport { FlowGramAPIName } from './constant';\n\nexport const FlowGramAPIs: FlowGramAPIDefines = {\n [FlowGramAPIName.ServerInfo]: ServerInfoDefine,\n [FlowGramAPIName.TaskRun]: TaskRunDefine,\n [FlowGramAPIName.TaskReport]: TaskReportDefine,\n [FlowGramAPIName.TaskResult]: TaskResultDefine,\n [FlowGramAPIName.TaskCancel]: TaskCancelDefine,\n [FlowGramAPIName.Validation]: ValidationDefine,\n};\n\nexport const FlowGramAPINames = Object.keys(FlowGramAPIs) as FlowGramAPIName[];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowPortType {\n Input = 'input',\n Output = 'output',\n}\n\nexport enum WorkflowVariableType {\n String = 'string',\n Integer = 'integer',\n Number = 'number',\n Boolean = 'boolean',\n Object = 'object',\n Array = 'array',\n Null = 'null',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramNode {\n Root = 'root',\n Start = 'start',\n End = 'end',\n LLM = 'llm',\n code = 'code',\n Condition = 'condition',\n Loop = 'loop',\n Comment = 'comment',\n Group = 'group',\n BlockStart = 'block-start',\n BlockEnd = 'block-end',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum ConditionOperation {\n EQ = 'eq',\n NEQ = 'neq',\n GT = 'gt',\n GTE = 'gte',\n LT = 'lt',\n LTE = 'lte',\n IN = 'in',\n NIN = 'nin',\n CONTAINS = 'contains',\n NOT_CONTAINS = 'not_contains',\n IS_EMPTY = 'is_empty',\n IS_NOT_EMPTY = 'is_not_empty',\n IS_TRUE = 'is_true',\n IS_FALSE = 'is_false',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ITask } from '../task';\nimport { IExecutor } from '../executor';\nimport { INode } from '../document';\nimport { IContext } from '../context';\nimport { InvokeParams } from '../base';\n\nexport interface EngineServices {\n Executor: IExecutor;\n}\n\nexport interface IEngine {\n invoke(params: InvokeParams): ITask;\n executeNode(params: { context: IContext; node: INode }): Promise<void>;\n}\n\nexport const IEngine = Symbol.for('Engine');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ExecutionContext, ExecutionResult, INodeExecutor } from './node-executor';\n\nexport interface IExecutor {\n execute: (context: ExecutionContext) => Promise<ExecutionResult>;\n register: (executor: INodeExecutor) => void;\n}\n\nexport const IExecutor = Symbol.for('Executor');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowStatus {\n Pending = 'pending',\n Processing = 'processing',\n Succeeded = 'succeeded',\n Failed = 'failed',\n Canceled = 'canceled',\n}\n\nexport interface StatusData {\n status: WorkflowStatus;\n terminated: boolean;\n startTime: number;\n endTime?: number;\n timeCost: number;\n}\n\nexport interface IStatus extends StatusData {\n id: string;\n process(): void;\n success(): void;\n fail(): void;\n cancel(): void;\n export(): StatusData;\n}\n\nexport interface IStatusCenter {\n workflow: IStatus;\n nodeStatus(nodeID: string): IStatus;\n init(): void;\n dispose(): void;\n getStatusNodeIDs(status: WorkflowStatus): string[];\n exportNodeStatus(): Record<string, StatusData>;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { WorkflowSchema } from '@schema/index';\n\nexport interface ValidationResult {\n valid: boolean;\n errors?: string[];\n}\n\nexport interface IValidation {\n validate(schema: WorkflowSchema): ValidationResult;\n}\n\nexport const IValidation = Symbol.for('Validation');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowMessageType {\n Log = 'log',\n Info = 'info',\n Debug = 'debug',\n Error = 'error',\n Warn = 'warning',\n}\n\nexport interface MessageData {\n message: string;\n nodeID?: string;\n timestamp?: number;\n}\n\nexport interface IMessage extends MessageData {\n id: string;\n type: WorkflowMessageType;\n timestamp: number;\n}\n\nexport type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;\n\nexport interface IMessageCenter {\n init(): void;\n dispose(): void;\n log(data: MessageData): IMessage;\n info(data: MessageData): IMessage;\n debug(data: MessageData): IMessage;\n error(data: MessageData): IMessage;\n warn(data: MessageData): IMessage;\n export(): WorkflowMessages;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAa;AACb,EAAAA,cAAA,cAAW;AAXD,SAAAA;AAAA,GAAA;;;ACAL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,QAAK;AACL,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,cAAW;AAdD,SAAAA;AAAA,GAAA;;;ACeL,IAAM,UAAU,OAAO,IAAI,QAAQ;;;ACRnC,IAAM,YAAY,OAAO,IAAI,UAAU;;;ACPvC,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,cAAW;AALD,SAAAA;AAAA,GAAA;;;ACWL,IAAM,cAAc,OAAO,IAAI,YAAY;;;ACX3C,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,SAAM;AACN,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AALG,SAAAA;AAAA,GAAA;","names":["FlowGramAPIMethod","FlowGramAPIName","FlowGramAPIModule","z","import_zod","import_zod","z","z","import_zod","z","import_zod","z","import_zod","z","import_zod","z","WorkflowPortType","WorkflowVariableType","FlowGramNode","ConditionOperation","WorkflowStatus","WorkflowMessageType"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/api/task-validate/index.ts","../src/api/schema.ts","../src/api/constant.ts","../src/api/task-run/index.ts","../src/api/task-result/index.ts","../src/api/task-report/index.ts","../src/api/task-cancel/index.ts","../src/api/server-info/index.ts","../src/api/define.ts","../src/schema/constant.ts","../src/node/constant.ts","../src/node/condition/constant.ts","../src/runtime/engine/index.ts","../src/runtime/executor/executor.ts","../src/runtime/status/index.ts","../src/runtime/validation/index.ts","../src/runtime/message/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './api';\nexport * from './schema';\nexport * from './node';\nexport * from './runtime';\nexport * from './client';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { ValidationResult, WorkflowInputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface TaskValidateInput {\n inputs: WorkflowInputs;\n schema: string;\n}\n\nexport interface TaskValidateOutput extends ValidationResult {}\n\nexport const TaskValidateDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskValidate,\n method: FlowGramAPIMethod.POST,\n path: '/task/validate',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n schema: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n }),\n output: z.object({\n valid: z.boolean(),\n errors: z.array(z.string()).optional(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nconst WorkflowIOZodSchema = z.record(z.string(), z.any());\n\nconst WorkflowSnapshotZodSchema = z.object({\n id: z.string(),\n nodeID: z.string(),\n inputs: WorkflowIOZodSchema,\n outputs: WorkflowIOZodSchema.optional(),\n data: WorkflowIOZodSchema,\n branch: z.string().optional(),\n});\n\nconst WorkflowStatusZodShape = {\n status: z.string(),\n terminated: z.boolean(),\n startTime: z.number(),\n endTime: z.number().optional(),\n timeCost: z.number(),\n};\nconst WorkflowStatusZodSchema = z.object(WorkflowStatusZodShape);\n\nconst WorkflowNodeReportZodSchema = z.object({\n id: z.string(),\n ...WorkflowStatusZodShape,\n snapshots: z.array(WorkflowSnapshotZodSchema),\n});\n\nconst WorkflowReportsZodSchema = z.record(z.string(), WorkflowNodeReportZodSchema);\n\nconst WorkflowMessageZodSchema = z.object({\n id: z.string(),\n type: z.enum(['log', 'info', 'debug', 'error', 'warning']),\n message: z.string(),\n nodeID: z.string().optional(),\n timestamp: z.number(),\n});\n\nconst WorkflowMessagesZodSchema = z.record(\n z.enum(['log', 'info', 'debug', 'error', 'warning']),\n z.array(WorkflowMessageZodSchema)\n);\n\nexport const WorkflowZodSchema = {\n Inputs: WorkflowIOZodSchema,\n Outputs: WorkflowIOZodSchema,\n Status: WorkflowStatusZodSchema,\n Snapshot: WorkflowSnapshotZodSchema,\n Reports: WorkflowReportsZodSchema,\n Messages: WorkflowMessagesZodSchema,\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramAPIMethod {\n GET = 'GET',\n POST = 'POST',\n PUT = 'PUT',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\nexport enum FlowGramAPIName {\n ServerInfo = 'ServerInfo',\n TaskRun = 'TaskRun',\n TaskReport = 'TaskReport',\n TaskResult = 'TaskResult',\n TaskCancel = 'TaskCancel',\n TaskValidate = 'TaskValidate',\n}\n\nexport enum FlowGramAPIModule {\n Info = 'Info',\n Task = 'Task',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowInputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface TaskRunInput {\n inputs: WorkflowInputs;\n schema: string;\n}\n\nexport interface TaskRunOutput {\n taskID: string;\n}\n\nexport const TaskRunDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskRun,\n method: FlowGramAPIMethod.POST,\n path: '/task/run',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n schema: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n }),\n output: z.object({\n taskID: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { WorkflowOutputs } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskResultInput {\n taskID: string;\n}\n\nexport type TaskResultOutput = WorkflowOutputs | undefined;\n\nexport const TaskResultDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskResult,\n method: FlowGramAPIMethod.GET,\n path: '/task/result',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: WorkflowZodSchema.Outputs,\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { IReport } from '@runtime/index';\nimport { FlowGramAPIDefine } from '@api/type';\nimport { WorkflowZodSchema } from '@api/schema';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskReportInput {\n taskID: string;\n}\n\nexport type TaskReportOutput = IReport | undefined;\n\nexport const TaskReportDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskReport,\n method: FlowGramAPIMethod.GET,\n path: '/task/report',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n id: z.string(),\n inputs: WorkflowZodSchema.Inputs,\n outputs: WorkflowZodSchema.Outputs,\n workflowStatus: WorkflowZodSchema.Status,\n reports: WorkflowZodSchema.Reports,\n messages: WorkflowZodSchema.Messages,\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';\n\nexport interface TaskCancelInput {\n taskID: string;\n}\n\nexport type TaskCancelOutput = {\n success: boolean;\n};\n\nexport const TaskCancelDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.TaskCancel,\n method: FlowGramAPIMethod.PUT,\n path: '/task/cancel',\n module: FlowGramAPIModule.Task,\n schema: {\n input: z.object({\n taskID: z.string(),\n }),\n output: z.object({\n success: z.boolean(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport z from 'zod';\n\nimport { type FlowGramAPIDefine } from '@api/type';\nimport { FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName } from '@api/constant';\n\nexport interface ServerInfoInput {}\n\nexport interface ServerInfoOutput {\n name: string;\n title: string;\n description: string;\n runtime: string;\n version: string;\n time: string;\n}\n\nexport const ServerInfoDefine: FlowGramAPIDefine = {\n name: FlowGramAPIName.ServerInfo,\n method: FlowGramAPIMethod.GET,\n path: '/info',\n module: FlowGramAPIModule.Info,\n schema: {\n input: z.undefined(),\n output: z.object({\n name: z.string(),\n runtime: z.string(),\n version: z.string(),\n time: z.string(),\n }),\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowGramAPIDefines } from './type';\nimport { TaskValidateDefine } from './task-validate';\nimport { TaskRunDefine } from './task-run';\nimport { TaskResultDefine } from './task-result';\nimport { TaskReportDefine } from './task-report';\nimport { TaskCancelDefine } from './task-cancel';\nimport { ServerInfoDefine } from './server-info';\nimport { FlowGramAPIName } from './constant';\n\nexport const FlowGramAPIs: FlowGramAPIDefines = {\n [FlowGramAPIName.ServerInfo]: ServerInfoDefine,\n [FlowGramAPIName.TaskRun]: TaskRunDefine,\n [FlowGramAPIName.TaskReport]: TaskReportDefine,\n [FlowGramAPIName.TaskResult]: TaskResultDefine,\n [FlowGramAPIName.TaskCancel]: TaskCancelDefine,\n [FlowGramAPIName.TaskValidate]: TaskValidateDefine,\n};\n\nexport const FlowGramAPINames = Object.keys(FlowGramAPIs) as FlowGramAPIName[];\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowPortType {\n Input = 'input',\n Output = 'output',\n}\n\nexport enum WorkflowVariableType {\n String = 'string',\n Integer = 'integer',\n Number = 'number',\n Boolean = 'boolean',\n Object = 'object',\n Array = 'array',\n Null = 'null',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum FlowGramNode {\n Root = 'root',\n Start = 'start',\n End = 'end',\n LLM = 'llm',\n code = 'code',\n Condition = 'condition',\n Loop = 'loop',\n Comment = 'comment',\n Group = 'group',\n BlockStart = 'block-start',\n BlockEnd = 'block-end',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum ConditionOperation {\n EQ = 'eq',\n NEQ = 'neq',\n GT = 'gt',\n GTE = 'gte',\n LT = 'lt',\n LTE = 'lte',\n IN = 'in',\n NIN = 'nin',\n CONTAINS = 'contains',\n NOT_CONTAINS = 'not_contains',\n IS_EMPTY = 'is_empty',\n IS_NOT_EMPTY = 'is_not_empty',\n IS_TRUE = 'is_true',\n IS_FALSE = 'is_false',\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IValidation } from '@runtime/validation';\nimport { ITask } from '../task';\nimport { IExecutor } from '../executor';\nimport { INode } from '../document';\nimport { IContext } from '../context';\nimport { InvokeParams } from '../base';\n\nexport interface EngineServices {\n Validation: IValidation;\n Executor: IExecutor;\n}\n\nexport interface IEngine {\n invoke(params: InvokeParams): ITask;\n executeNode(params: { context: IContext; node: INode }): Promise<void>;\n}\n\nexport const IEngine = Symbol.for('Engine');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ExecutionContext, ExecutionResult, INodeExecutor } from './node-executor';\n\nexport interface IExecutor {\n execute: (context: ExecutionContext) => Promise<ExecutionResult>;\n register: (executor: INodeExecutor) => void;\n}\n\nexport const IExecutor = Symbol.for('Executor');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowStatus {\n Pending = 'pending',\n Processing = 'processing',\n Succeeded = 'succeeded',\n Failed = 'failed',\n Canceled = 'canceled',\n}\n\nexport interface StatusData {\n status: WorkflowStatus;\n terminated: boolean;\n startTime: number;\n endTime?: number;\n timeCost: number;\n}\n\nexport interface IStatus extends StatusData {\n id: string;\n process(): void;\n success(): void;\n fail(): void;\n cancel(): void;\n export(): StatusData;\n}\n\nexport interface IStatusCenter {\n workflow: IStatus;\n nodeStatus(nodeID: string): IStatus;\n init(): void;\n dispose(): void;\n getStatusNodeIDs(status: WorkflowStatus): string[];\n exportNodeStatus(): Record<string, StatusData>;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { InvokeParams } from '@runtime/base';\n\nexport interface ValidationResult {\n valid: boolean;\n errors?: string[];\n}\n\nexport interface IValidation {\n invoke(params: InvokeParams): ValidationResult;\n}\n\nexport const IValidation = Symbol.for('Validation');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport enum WorkflowMessageType {\n Log = 'log',\n Info = 'info',\n Debug = 'debug',\n Error = 'error',\n Warn = 'warning',\n}\n\nexport interface MessageData {\n message: string;\n nodeID?: string;\n timestamp?: number;\n}\n\nexport interface IMessage extends MessageData {\n id: string;\n type: WorkflowMessageType;\n timestamp: number;\n}\n\nexport type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;\n\nexport interface IMessageCenter {\n init(): void;\n dispose(): void;\n log(data: MessageData): IMessage;\n info(data: MessageData): IMessage;\n debug(data: MessageData): IMessage;\n error(data: MessageData): IMessage;\n warn(data: MessageData): IMessage;\n export(): WorkflowMessages;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,cAAc;;;ACAd,iBAAc;AAEd,IAAM,sBAAsB,WAAAC,QAAE,OAAO,WAAAA,QAAE,OAAO,GAAG,WAAAA,QAAE,IAAI,CAAC;AAExD,IAAM,4BAA4B,WAAAA,QAAE,OAAO;AAAA,EACzC,IAAI,WAAAA,QAAE,OAAO;AAAA,EACb,QAAQ,WAAAA,QAAE,OAAO;AAAA,EACjB,QAAQ;AAAA,EACR,SAAS,oBAAoB,SAAS;AAAA,EACtC,MAAM;AAAA,EACN,QAAQ,WAAAA,QAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAED,IAAM,yBAAyB;AAAA,EAC7B,QAAQ,WAAAA,QAAE,OAAO;AAAA,EACjB,YAAY,WAAAA,QAAE,QAAQ;AAAA,EACtB,WAAW,WAAAA,QAAE,OAAO;AAAA,EACpB,SAAS,WAAAA,QAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,UAAU,WAAAA,QAAE,OAAO;AACrB;AACA,IAAM,0BAA0B,WAA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A,gBAAA,aAAU;AACV,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,cAAW;AALD,SAAAA;AAAA,GAAA;;;ACWL,IAAM,cAAc,OAAO,IAAI,YAAY;;;ACX3C,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,SAAM;AACN,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AALG,SAAAA;AAAA,GAAA;","names":["import_zod","z","FlowGramAPIMethod","FlowGramAPIName","FlowGramAPIModule","z","import_zod","z","import_zod","z","import_zod","z","import_zod","z","import_zod","z","WorkflowPortType","WorkflowVariableType","FlowGramNode","ConditionOperation","WorkflowStatus","WorkflowMessageType"]}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@flowgram.ai/runtime-interface",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "homepage": "https://flowgram.ai/",
5
5
  "repository": "https://github.com/bytedance/flowgram.ai",
6
6
  "license": "MIT",
7
+ "type": "module",
7
8
  "exports": {
8
9
  "types": "./dist/index.d.ts",
9
10
  "import": "./dist/esm/index.js",
@@ -23,8 +24,8 @@
23
24
  "tsup": "^8.0.1",
24
25
  "typescript": "^5.0.4",
25
26
  "vitest": "^0.34.6",
26
- "@flowgram.ai/eslint-config": "0.2.23",
27
- "@flowgram.ai/ts-config": "0.2.23"
27
+ "@flowgram.ai/ts-config": "0.2.25",
28
+ "@flowgram.ai/eslint-config": "0.2.25"
28
29
  },
29
30
  "publishConfig": {
30
31
  "access": "public",