@flowgram.ai/runtime-interface 0.2.26 → 0.2.28
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 +26 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +130 -3
- package/dist/index.d.ts +130 -3
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -212,13 +212,16 @@ var FlowGramNode = /* @__PURE__ */ ((FlowGramNode2) => {
|
|
|
212
212
|
FlowGramNode2["Start"] = "start";
|
|
213
213
|
FlowGramNode2["End"] = "end";
|
|
214
214
|
FlowGramNode2["LLM"] = "llm";
|
|
215
|
-
FlowGramNode2["
|
|
215
|
+
FlowGramNode2["Code"] = "code";
|
|
216
216
|
FlowGramNode2["Condition"] = "condition";
|
|
217
217
|
FlowGramNode2["Loop"] = "loop";
|
|
218
218
|
FlowGramNode2["Comment"] = "comment";
|
|
219
219
|
FlowGramNode2["Group"] = "group";
|
|
220
220
|
FlowGramNode2["BlockStart"] = "block-start";
|
|
221
221
|
FlowGramNode2["BlockEnd"] = "block-end";
|
|
222
|
+
FlowGramNode2["HTTP"] = "http";
|
|
223
|
+
FlowGramNode2["Break"] = "break";
|
|
224
|
+
FlowGramNode2["Continue"] = "continue";
|
|
222
225
|
return FlowGramNode2;
|
|
223
226
|
})(FlowGramNode || {});
|
|
224
227
|
|
|
@@ -241,6 +244,26 @@ var ConditionOperation = /* @__PURE__ */ ((ConditionOperation2) => {
|
|
|
241
244
|
return ConditionOperation2;
|
|
242
245
|
})(ConditionOperation || {});
|
|
243
246
|
|
|
247
|
+
// src/node/http/constant.ts
|
|
248
|
+
var HTTPMethod = /* @__PURE__ */ ((HTTPMethod2) => {
|
|
249
|
+
HTTPMethod2["Get"] = "GET";
|
|
250
|
+
HTTPMethod2["Post"] = "POST";
|
|
251
|
+
HTTPMethod2["Put"] = "PUT";
|
|
252
|
+
HTTPMethod2["Delete"] = "DELETE";
|
|
253
|
+
HTTPMethod2["Patch"] = "PATCH";
|
|
254
|
+
HTTPMethod2["Head"] = "HEAD";
|
|
255
|
+
return HTTPMethod2;
|
|
256
|
+
})(HTTPMethod || {});
|
|
257
|
+
var HTTPBodyType = /* @__PURE__ */ ((HTTPBodyType2) => {
|
|
258
|
+
HTTPBodyType2["None"] = "none";
|
|
259
|
+
HTTPBodyType2["FormData"] = "form-data";
|
|
260
|
+
HTTPBodyType2["XWwwFormUrlencoded"] = "x-www-form-urlencoded";
|
|
261
|
+
HTTPBodyType2["RawText"] = "raw-text";
|
|
262
|
+
HTTPBodyType2["JSON"] = "JSON";
|
|
263
|
+
HTTPBodyType2["Binary"] = "binary";
|
|
264
|
+
return HTTPBodyType2;
|
|
265
|
+
})(HTTPBodyType || {});
|
|
266
|
+
|
|
244
267
|
// src/runtime/engine/index.ts
|
|
245
268
|
var IEngine = Symbol.for("Engine");
|
|
246
269
|
|
|
@@ -277,6 +300,8 @@ export {
|
|
|
277
300
|
FlowGramAPINames,
|
|
278
301
|
FlowGramAPIs,
|
|
279
302
|
FlowGramNode,
|
|
303
|
+
HTTPBodyType,
|
|
304
|
+
HTTPMethod,
|
|
280
305
|
IEngine,
|
|
281
306
|
IExecutor,
|
|
282
307
|
IValidation,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;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,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"]}
|
|
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/node/http/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 HTTP = 'http',\n Break = 'break',\n Continue = 'continue',\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\nexport enum HTTPMethod {\n Get = 'GET',\n Post = 'POST',\n Put = 'PUT',\n Delete = 'DELETE',\n Patch = 'PATCH',\n Head = 'HEAD',\n}\n\nexport enum HTTPBodyType {\n None = 'none',\n FormData = 'form-data',\n XWwwFormUrlencoded = 'x-www-form-urlencoded',\n RawText = 'raw-text',\n JSON = 'JSON',\n Binary = 'binary',\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,EACz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AAM,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","HTTPMethod","HTTPBodyType","WorkflowStatus","WorkflowMessageType"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -165,6 +165,20 @@ interface WorkflowNodeSchema<T = string, D = any> {
|
|
|
165
165
|
edges?: WorkflowEdgeSchema[];
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
170
|
+
* SPDX-License-Identifier: MIT
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
interface WorkflowGroupSchema extends WorkflowNodeSchema {
|
|
174
|
+
data: {
|
|
175
|
+
title?: string;
|
|
176
|
+
color?: string;
|
|
177
|
+
parentID: string;
|
|
178
|
+
blockIDs: string[];
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
168
182
|
/**
|
|
169
183
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
170
184
|
* SPDX-License-Identifier: MIT
|
|
@@ -173,6 +187,7 @@ interface WorkflowNodeSchema<T = string, D = any> {
|
|
|
173
187
|
interface WorkflowSchema {
|
|
174
188
|
nodes: WorkflowNodeSchema[];
|
|
175
189
|
edges: WorkflowEdgeSchema[];
|
|
190
|
+
groups?: WorkflowGroupSchema[];
|
|
176
191
|
}
|
|
177
192
|
|
|
178
193
|
/**
|
|
@@ -312,13 +327,16 @@ declare enum FlowGramNode {
|
|
|
312
327
|
Start = "start",
|
|
313
328
|
End = "end",
|
|
314
329
|
LLM = "llm",
|
|
315
|
-
|
|
330
|
+
Code = "code",
|
|
316
331
|
Condition = "condition",
|
|
317
332
|
Loop = "loop",
|
|
318
333
|
Comment = "comment",
|
|
319
334
|
Group = "group",
|
|
320
335
|
BlockStart = "block-start",
|
|
321
|
-
BlockEnd = "block-end"
|
|
336
|
+
BlockEnd = "block-end",
|
|
337
|
+
HTTP = "http",
|
|
338
|
+
Break = "break",
|
|
339
|
+
Continue = "continue"
|
|
322
340
|
}
|
|
323
341
|
|
|
324
342
|
/**
|
|
@@ -429,6 +447,10 @@ interface IState {
|
|
|
429
447
|
node: INode;
|
|
430
448
|
outputs: WorkflowOutputs;
|
|
431
449
|
}): void;
|
|
450
|
+
parseInputs(params: {
|
|
451
|
+
values: Record<string, IFlowValue>;
|
|
452
|
+
declare: IJsonSchema;
|
|
453
|
+
}): WorkflowInputs;
|
|
432
454
|
parseRef<T = unknown>(ref: IFlowRefValue): IVariableParseResult<T> | null;
|
|
433
455
|
parseTemplate(template: IFlowTemplateValue): IVariableParseResult<string> | null;
|
|
434
456
|
parseValue<T = unknown>(flowValue: IFlowValue, type?: WorkflowVariableType): IVariableParseResult<T> | null;
|
|
@@ -554,12 +576,26 @@ interface IIOCenter {
|
|
|
554
576
|
export(): IOData;
|
|
555
577
|
}
|
|
556
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
581
|
+
* SPDX-License-Identifier: MIT
|
|
582
|
+
*/
|
|
583
|
+
interface ICache<K = string, V = any> {
|
|
584
|
+
init(): void;
|
|
585
|
+
dispose(): void;
|
|
586
|
+
get(key: K): V;
|
|
587
|
+
set(key: K, value: V): this;
|
|
588
|
+
delete(key: K): boolean;
|
|
589
|
+
has(key: K): boolean;
|
|
590
|
+
}
|
|
591
|
+
|
|
557
592
|
/**
|
|
558
593
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
559
594
|
* SPDX-License-Identifier: MIT
|
|
560
595
|
*/
|
|
561
596
|
|
|
562
597
|
interface ContextData {
|
|
598
|
+
cache: ICache;
|
|
563
599
|
variableStore: IVariableStore;
|
|
564
600
|
state: IState;
|
|
565
601
|
document: IDocument;
|
|
@@ -687,6 +723,96 @@ interface ConditionNodeData {
|
|
|
687
723
|
}
|
|
688
724
|
type ConditionNodeSchema = WorkflowNodeSchema<FlowGramNode.Condition, ConditionNodeData>;
|
|
689
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
728
|
+
* SPDX-License-Identifier: MIT
|
|
729
|
+
*/
|
|
730
|
+
declare enum HTTPMethod {
|
|
731
|
+
Get = "GET",
|
|
732
|
+
Post = "POST",
|
|
733
|
+
Put = "PUT",
|
|
734
|
+
Delete = "DELETE",
|
|
735
|
+
Patch = "PATCH",
|
|
736
|
+
Head = "HEAD"
|
|
737
|
+
}
|
|
738
|
+
declare enum HTTPBodyType {
|
|
739
|
+
None = "none",
|
|
740
|
+
FormData = "form-data",
|
|
741
|
+
XWwwFormUrlencoded = "x-www-form-urlencoded",
|
|
742
|
+
RawText = "raw-text",
|
|
743
|
+
JSON = "JSON",
|
|
744
|
+
Binary = "binary"
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
749
|
+
* SPDX-License-Identifier: MIT
|
|
750
|
+
*/
|
|
751
|
+
|
|
752
|
+
interface HTTPNodeData {
|
|
753
|
+
title: string;
|
|
754
|
+
outputs: IJsonSchema<'object'>;
|
|
755
|
+
api: {
|
|
756
|
+
method: HTTPMethod;
|
|
757
|
+
url: IFlowTemplateValue;
|
|
758
|
+
};
|
|
759
|
+
headers: IJsonSchema<'object'>;
|
|
760
|
+
headersValues: Record<string, IFlowConstantRefValue>;
|
|
761
|
+
params: IJsonSchema<'object'>;
|
|
762
|
+
paramsValues: Record<string, IFlowConstantRefValue>;
|
|
763
|
+
body: {
|
|
764
|
+
bodyType: HTTPBodyType;
|
|
765
|
+
json?: IFlowTemplateValue;
|
|
766
|
+
formData?: IJsonSchema<'object'>;
|
|
767
|
+
formDataValues?: Record<string, IFlowConstantRefValue>;
|
|
768
|
+
rawText?: IFlowTemplateValue;
|
|
769
|
+
binary?: IFlowTemplateValue;
|
|
770
|
+
xWwwFormUrlencoded?: IJsonSchema<'object'>;
|
|
771
|
+
xWwwFormUrlencodedValues?: Record<string, IFlowConstantRefValue>;
|
|
772
|
+
};
|
|
773
|
+
timeout: {
|
|
774
|
+
retryTimes: number;
|
|
775
|
+
timeout: number;
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
type HTTPNodeSchema = WorkflowNodeSchema<FlowGramNode.HTTP, HTTPNodeData>;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
783
|
+
* SPDX-License-Identifier: MIT
|
|
784
|
+
*/
|
|
785
|
+
|
|
786
|
+
interface CodeNodeData {
|
|
787
|
+
title: string;
|
|
788
|
+
inputsValues: Record<string, IFlowValue>;
|
|
789
|
+
inputs: IJsonSchema<'object'>;
|
|
790
|
+
outputs: IJsonSchema<'object'>;
|
|
791
|
+
script: {
|
|
792
|
+
language: 'javascript';
|
|
793
|
+
content: string;
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
type CodeNodeSchema = WorkflowNodeSchema<FlowGramNode.Code, CodeNodeData>;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
800
|
+
* SPDX-License-Identifier: MIT
|
|
801
|
+
*/
|
|
802
|
+
|
|
803
|
+
interface BreakNodeData {
|
|
804
|
+
}
|
|
805
|
+
type BreakNodeSchema = WorkflowNodeSchema<FlowGramNode.Break, BreakNodeData>;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
809
|
+
* SPDX-License-Identifier: MIT
|
|
810
|
+
*/
|
|
811
|
+
|
|
812
|
+
interface ContinueNodeData {
|
|
813
|
+
}
|
|
814
|
+
type ContinueNodeSchema = WorkflowNodeSchema<FlowGramNode.Continue, ContinueNodeData>;
|
|
815
|
+
|
|
690
816
|
/**
|
|
691
817
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
692
818
|
* SPDX-License-Identifier: MIT
|
|
@@ -697,6 +823,7 @@ interface ExecutionContext {
|
|
|
697
823
|
inputs: WorkflowInputs;
|
|
698
824
|
container: IContainer;
|
|
699
825
|
runtime: IContext;
|
|
826
|
+
snapshot: ISnapshot;
|
|
700
827
|
}
|
|
701
828
|
interface ExecutionResult {
|
|
702
829
|
outputs: WorkflowOutputs;
|
|
@@ -831,4 +958,4 @@ interface IRuntimeClient {
|
|
|
831
958
|
[FlowGramAPIName.TaskValidate]: (input: TaskValidateInput) => Promise<TaskValidateOutput | undefined>;
|
|
832
959
|
}
|
|
833
960
|
|
|
834
|
-
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 };
|
|
961
|
+
export { type BreakNodeSchema, type CodeNodeSchema, type ConditionItem, type ConditionNodeSchema, ConditionOperation, type ContainerService, type ContextData, type ContinueNodeSchema, type CreateEdgeParams, type CreateNodeParams, type CreatePortParams, type EndNodeSchema, type EngineServices, type ExecutionContext, type ExecutionResult, type FlowGramAPIDefine, type FlowGramAPIDefines, FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName, FlowGramAPINames, FlowGramAPIs, FlowGramNode, HTTPBodyType, HTTPMethod, type HTTPNodeSchema, type IBasicJsonSchema, type ICache, 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
|
@@ -165,6 +165,20 @@ interface WorkflowNodeSchema<T = string, D = any> {
|
|
|
165
165
|
edges?: WorkflowEdgeSchema[];
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
170
|
+
* SPDX-License-Identifier: MIT
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
interface WorkflowGroupSchema extends WorkflowNodeSchema {
|
|
174
|
+
data: {
|
|
175
|
+
title?: string;
|
|
176
|
+
color?: string;
|
|
177
|
+
parentID: string;
|
|
178
|
+
blockIDs: string[];
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
168
182
|
/**
|
|
169
183
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
170
184
|
* SPDX-License-Identifier: MIT
|
|
@@ -173,6 +187,7 @@ interface WorkflowNodeSchema<T = string, D = any> {
|
|
|
173
187
|
interface WorkflowSchema {
|
|
174
188
|
nodes: WorkflowNodeSchema[];
|
|
175
189
|
edges: WorkflowEdgeSchema[];
|
|
190
|
+
groups?: WorkflowGroupSchema[];
|
|
176
191
|
}
|
|
177
192
|
|
|
178
193
|
/**
|
|
@@ -312,13 +327,16 @@ declare enum FlowGramNode {
|
|
|
312
327
|
Start = "start",
|
|
313
328
|
End = "end",
|
|
314
329
|
LLM = "llm",
|
|
315
|
-
|
|
330
|
+
Code = "code",
|
|
316
331
|
Condition = "condition",
|
|
317
332
|
Loop = "loop",
|
|
318
333
|
Comment = "comment",
|
|
319
334
|
Group = "group",
|
|
320
335
|
BlockStart = "block-start",
|
|
321
|
-
BlockEnd = "block-end"
|
|
336
|
+
BlockEnd = "block-end",
|
|
337
|
+
HTTP = "http",
|
|
338
|
+
Break = "break",
|
|
339
|
+
Continue = "continue"
|
|
322
340
|
}
|
|
323
341
|
|
|
324
342
|
/**
|
|
@@ -429,6 +447,10 @@ interface IState {
|
|
|
429
447
|
node: INode;
|
|
430
448
|
outputs: WorkflowOutputs;
|
|
431
449
|
}): void;
|
|
450
|
+
parseInputs(params: {
|
|
451
|
+
values: Record<string, IFlowValue>;
|
|
452
|
+
declare: IJsonSchema;
|
|
453
|
+
}): WorkflowInputs;
|
|
432
454
|
parseRef<T = unknown>(ref: IFlowRefValue): IVariableParseResult<T> | null;
|
|
433
455
|
parseTemplate(template: IFlowTemplateValue): IVariableParseResult<string> | null;
|
|
434
456
|
parseValue<T = unknown>(flowValue: IFlowValue, type?: WorkflowVariableType): IVariableParseResult<T> | null;
|
|
@@ -554,12 +576,26 @@ interface IIOCenter {
|
|
|
554
576
|
export(): IOData;
|
|
555
577
|
}
|
|
556
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
581
|
+
* SPDX-License-Identifier: MIT
|
|
582
|
+
*/
|
|
583
|
+
interface ICache<K = string, V = any> {
|
|
584
|
+
init(): void;
|
|
585
|
+
dispose(): void;
|
|
586
|
+
get(key: K): V;
|
|
587
|
+
set(key: K, value: V): this;
|
|
588
|
+
delete(key: K): boolean;
|
|
589
|
+
has(key: K): boolean;
|
|
590
|
+
}
|
|
591
|
+
|
|
557
592
|
/**
|
|
558
593
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
559
594
|
* SPDX-License-Identifier: MIT
|
|
560
595
|
*/
|
|
561
596
|
|
|
562
597
|
interface ContextData {
|
|
598
|
+
cache: ICache;
|
|
563
599
|
variableStore: IVariableStore;
|
|
564
600
|
state: IState;
|
|
565
601
|
document: IDocument;
|
|
@@ -687,6 +723,96 @@ interface ConditionNodeData {
|
|
|
687
723
|
}
|
|
688
724
|
type ConditionNodeSchema = WorkflowNodeSchema<FlowGramNode.Condition, ConditionNodeData>;
|
|
689
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
728
|
+
* SPDX-License-Identifier: MIT
|
|
729
|
+
*/
|
|
730
|
+
declare enum HTTPMethod {
|
|
731
|
+
Get = "GET",
|
|
732
|
+
Post = "POST",
|
|
733
|
+
Put = "PUT",
|
|
734
|
+
Delete = "DELETE",
|
|
735
|
+
Patch = "PATCH",
|
|
736
|
+
Head = "HEAD"
|
|
737
|
+
}
|
|
738
|
+
declare enum HTTPBodyType {
|
|
739
|
+
None = "none",
|
|
740
|
+
FormData = "form-data",
|
|
741
|
+
XWwwFormUrlencoded = "x-www-form-urlencoded",
|
|
742
|
+
RawText = "raw-text",
|
|
743
|
+
JSON = "JSON",
|
|
744
|
+
Binary = "binary"
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
749
|
+
* SPDX-License-Identifier: MIT
|
|
750
|
+
*/
|
|
751
|
+
|
|
752
|
+
interface HTTPNodeData {
|
|
753
|
+
title: string;
|
|
754
|
+
outputs: IJsonSchema<'object'>;
|
|
755
|
+
api: {
|
|
756
|
+
method: HTTPMethod;
|
|
757
|
+
url: IFlowTemplateValue;
|
|
758
|
+
};
|
|
759
|
+
headers: IJsonSchema<'object'>;
|
|
760
|
+
headersValues: Record<string, IFlowConstantRefValue>;
|
|
761
|
+
params: IJsonSchema<'object'>;
|
|
762
|
+
paramsValues: Record<string, IFlowConstantRefValue>;
|
|
763
|
+
body: {
|
|
764
|
+
bodyType: HTTPBodyType;
|
|
765
|
+
json?: IFlowTemplateValue;
|
|
766
|
+
formData?: IJsonSchema<'object'>;
|
|
767
|
+
formDataValues?: Record<string, IFlowConstantRefValue>;
|
|
768
|
+
rawText?: IFlowTemplateValue;
|
|
769
|
+
binary?: IFlowTemplateValue;
|
|
770
|
+
xWwwFormUrlencoded?: IJsonSchema<'object'>;
|
|
771
|
+
xWwwFormUrlencodedValues?: Record<string, IFlowConstantRefValue>;
|
|
772
|
+
};
|
|
773
|
+
timeout: {
|
|
774
|
+
retryTimes: number;
|
|
775
|
+
timeout: number;
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
type HTTPNodeSchema = WorkflowNodeSchema<FlowGramNode.HTTP, HTTPNodeData>;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
783
|
+
* SPDX-License-Identifier: MIT
|
|
784
|
+
*/
|
|
785
|
+
|
|
786
|
+
interface CodeNodeData {
|
|
787
|
+
title: string;
|
|
788
|
+
inputsValues: Record<string, IFlowValue>;
|
|
789
|
+
inputs: IJsonSchema<'object'>;
|
|
790
|
+
outputs: IJsonSchema<'object'>;
|
|
791
|
+
script: {
|
|
792
|
+
language: 'javascript';
|
|
793
|
+
content: string;
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
type CodeNodeSchema = WorkflowNodeSchema<FlowGramNode.Code, CodeNodeData>;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
800
|
+
* SPDX-License-Identifier: MIT
|
|
801
|
+
*/
|
|
802
|
+
|
|
803
|
+
interface BreakNodeData {
|
|
804
|
+
}
|
|
805
|
+
type BreakNodeSchema = WorkflowNodeSchema<FlowGramNode.Break, BreakNodeData>;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
809
|
+
* SPDX-License-Identifier: MIT
|
|
810
|
+
*/
|
|
811
|
+
|
|
812
|
+
interface ContinueNodeData {
|
|
813
|
+
}
|
|
814
|
+
type ContinueNodeSchema = WorkflowNodeSchema<FlowGramNode.Continue, ContinueNodeData>;
|
|
815
|
+
|
|
690
816
|
/**
|
|
691
817
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
692
818
|
* SPDX-License-Identifier: MIT
|
|
@@ -697,6 +823,7 @@ interface ExecutionContext {
|
|
|
697
823
|
inputs: WorkflowInputs;
|
|
698
824
|
container: IContainer;
|
|
699
825
|
runtime: IContext;
|
|
826
|
+
snapshot: ISnapshot;
|
|
700
827
|
}
|
|
701
828
|
interface ExecutionResult {
|
|
702
829
|
outputs: WorkflowOutputs;
|
|
@@ -831,4 +958,4 @@ interface IRuntimeClient {
|
|
|
831
958
|
[FlowGramAPIName.TaskValidate]: (input: TaskValidateInput) => Promise<TaskValidateOutput | undefined>;
|
|
832
959
|
}
|
|
833
960
|
|
|
834
|
-
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 };
|
|
961
|
+
export { type BreakNodeSchema, type CodeNodeSchema, type ConditionItem, type ConditionNodeSchema, ConditionOperation, type ContainerService, type ContextData, type ContinueNodeSchema, type CreateEdgeParams, type CreateNodeParams, type CreatePortParams, type EndNodeSchema, type EngineServices, type ExecutionContext, type ExecutionResult, type FlowGramAPIDefine, type FlowGramAPIDefines, FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName, FlowGramAPINames, FlowGramAPIs, FlowGramNode, HTTPBodyType, HTTPMethod, type HTTPNodeSchema, type IBasicJsonSchema, type ICache, 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
|
@@ -37,6 +37,8 @@ __export(src_exports, {
|
|
|
37
37
|
FlowGramAPINames: () => FlowGramAPINames,
|
|
38
38
|
FlowGramAPIs: () => FlowGramAPIs,
|
|
39
39
|
FlowGramNode: () => FlowGramNode,
|
|
40
|
+
HTTPBodyType: () => HTTPBodyType,
|
|
41
|
+
HTTPMethod: () => HTTPMethod,
|
|
40
42
|
IEngine: () => IEngine,
|
|
41
43
|
IExecutor: () => IExecutor,
|
|
42
44
|
IValidation: () => IValidation,
|
|
@@ -267,13 +269,16 @@ var FlowGramNode = /* @__PURE__ */ ((FlowGramNode2) => {
|
|
|
267
269
|
FlowGramNode2["Start"] = "start";
|
|
268
270
|
FlowGramNode2["End"] = "end";
|
|
269
271
|
FlowGramNode2["LLM"] = "llm";
|
|
270
|
-
FlowGramNode2["
|
|
272
|
+
FlowGramNode2["Code"] = "code";
|
|
271
273
|
FlowGramNode2["Condition"] = "condition";
|
|
272
274
|
FlowGramNode2["Loop"] = "loop";
|
|
273
275
|
FlowGramNode2["Comment"] = "comment";
|
|
274
276
|
FlowGramNode2["Group"] = "group";
|
|
275
277
|
FlowGramNode2["BlockStart"] = "block-start";
|
|
276
278
|
FlowGramNode2["BlockEnd"] = "block-end";
|
|
279
|
+
FlowGramNode2["HTTP"] = "http";
|
|
280
|
+
FlowGramNode2["Break"] = "break";
|
|
281
|
+
FlowGramNode2["Continue"] = "continue";
|
|
277
282
|
return FlowGramNode2;
|
|
278
283
|
})(FlowGramNode || {});
|
|
279
284
|
|
|
@@ -296,6 +301,26 @@ var ConditionOperation = /* @__PURE__ */ ((ConditionOperation2) => {
|
|
|
296
301
|
return ConditionOperation2;
|
|
297
302
|
})(ConditionOperation || {});
|
|
298
303
|
|
|
304
|
+
// src/node/http/constant.ts
|
|
305
|
+
var HTTPMethod = /* @__PURE__ */ ((HTTPMethod2) => {
|
|
306
|
+
HTTPMethod2["Get"] = "GET";
|
|
307
|
+
HTTPMethod2["Post"] = "POST";
|
|
308
|
+
HTTPMethod2["Put"] = "PUT";
|
|
309
|
+
HTTPMethod2["Delete"] = "DELETE";
|
|
310
|
+
HTTPMethod2["Patch"] = "PATCH";
|
|
311
|
+
HTTPMethod2["Head"] = "HEAD";
|
|
312
|
+
return HTTPMethod2;
|
|
313
|
+
})(HTTPMethod || {});
|
|
314
|
+
var HTTPBodyType = /* @__PURE__ */ ((HTTPBodyType2) => {
|
|
315
|
+
HTTPBodyType2["None"] = "none";
|
|
316
|
+
HTTPBodyType2["FormData"] = "form-data";
|
|
317
|
+
HTTPBodyType2["XWwwFormUrlencoded"] = "x-www-form-urlencoded";
|
|
318
|
+
HTTPBodyType2["RawText"] = "raw-text";
|
|
319
|
+
HTTPBodyType2["JSON"] = "JSON";
|
|
320
|
+
HTTPBodyType2["Binary"] = "binary";
|
|
321
|
+
return HTTPBodyType2;
|
|
322
|
+
})(HTTPBodyType || {});
|
|
323
|
+
|
|
299
324
|
// src/runtime/engine/index.ts
|
|
300
325
|
var IEngine = Symbol.for("Engine");
|
|
301
326
|
|
|
@@ -333,6 +358,8 @@ var WorkflowMessageType = /* @__PURE__ */ ((WorkflowMessageType2) => {
|
|
|
333
358
|
FlowGramAPINames,
|
|
334
359
|
FlowGramAPIs,
|
|
335
360
|
FlowGramNode,
|
|
361
|
+
HTTPBodyType,
|
|
362
|
+
HTTPMethod,
|
|
336
363
|
IEngine,
|
|
337
364
|
IExecutor,
|
|
338
365
|
IValidation,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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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ACL,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":["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"]}
|
|
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/node/http/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 HTTP = 'http',\n Break = 'break',\n Continue = 'continue',\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\nexport enum HTTPMethod {\n Get = 'GET',\n Post = 'POST',\n Put = 'PUT',\n Delete = 'DELETE',\n Patch = 'PATCH',\n Head = 'HEAD',\n}\n\nexport enum HTTPBodyType {\n None = 'none',\n FormData = 'form-data',\n XWwwFormUrlencoded = 'x-www-form-urlencoded',\n RawText = 'raw-text',\n JSON = 'JSON',\n Binary = 'binary',\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;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,WAA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ACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,cAAW;AAdD,SAAAA;AAAA,GAAA;;;ACAL,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,SAAM;AACN,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,SAAM;AACN,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AASL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,UAAO;AACP,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,wBAAqB;AACrB,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,UAAO;AACP,EAAAA,cAAA,YAAS;AANC,SAAAA;AAAA,GAAA;;;ACQL,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":["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","HTTPMethod","HTTPBodyType","WorkflowStatus","WorkflowMessageType"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowgram.ai/runtime-interface",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.28",
|
|
4
4
|
"homepage": "https://flowgram.ai/",
|
|
5
5
|
"repository": "https://github.com/bytedance/flowgram.ai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "^8.54.0",
|
|
24
24
|
"tsup": "^8.0.1",
|
|
25
|
-
"typescript": "^5.
|
|
25
|
+
"typescript": "^5.8.3",
|
|
26
26
|
"vitest": "^0.34.6",
|
|
27
|
-
"@flowgram.ai/eslint-config": "0.2.
|
|
28
|
-
"@flowgram.ai/ts-config": "0.2.
|
|
27
|
+
"@flowgram.ai/eslint-config": "0.2.28",
|
|
28
|
+
"@flowgram.ai/ts-config": "0.2.28"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public",
|