@flowgram.ai/runtime-interface 0.1.0-alpha.10
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 +286 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +794 -0
- package/dist/index.d.ts +794 -0
- package/dist/index.js +341 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
ConditionOperation: () => ConditionOperation,
|
|
34
|
+
FlowGramAPIMethod: () => FlowGramAPIMethod,
|
|
35
|
+
FlowGramAPIModule: () => FlowGramAPIModule,
|
|
36
|
+
FlowGramAPIName: () => FlowGramAPIName,
|
|
37
|
+
FlowGramAPINames: () => FlowGramAPINames,
|
|
38
|
+
FlowGramAPIs: () => FlowGramAPIs,
|
|
39
|
+
FlowGramNode: () => FlowGramNode,
|
|
40
|
+
IEngine: () => IEngine,
|
|
41
|
+
IExecutor: () => IExecutor,
|
|
42
|
+
IValidation: () => IValidation,
|
|
43
|
+
ServerInfoDefine: () => ServerInfoDefine,
|
|
44
|
+
TaskCancelDefine: () => TaskCancelDefine,
|
|
45
|
+
TaskReportDefine: () => TaskReportDefine,
|
|
46
|
+
TaskResultDefine: () => TaskResultDefine,
|
|
47
|
+
TaskRunDefine: () => TaskRunDefine,
|
|
48
|
+
ValidationDefine: () => ValidationDefine,
|
|
49
|
+
WorkflowPortType: () => WorkflowPortType,
|
|
50
|
+
WorkflowStatus: () => WorkflowStatus,
|
|
51
|
+
WorkflowVariableType: () => WorkflowVariableType
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(src_exports);
|
|
54
|
+
|
|
55
|
+
// src/api/validation/index.ts
|
|
56
|
+
var import_zod = __toESM(require("zod"));
|
|
57
|
+
|
|
58
|
+
// src/api/constant.ts
|
|
59
|
+
var FlowGramAPIMethod = /* @__PURE__ */ ((FlowGramAPIMethod2) => {
|
|
60
|
+
FlowGramAPIMethod2["GET"] = "GET";
|
|
61
|
+
FlowGramAPIMethod2["POST"] = "POST";
|
|
62
|
+
FlowGramAPIMethod2["PUT"] = "PUT";
|
|
63
|
+
FlowGramAPIMethod2["DELETE"] = "DELETE";
|
|
64
|
+
FlowGramAPIMethod2["PATCH"] = "PATCH";
|
|
65
|
+
return FlowGramAPIMethod2;
|
|
66
|
+
})(FlowGramAPIMethod || {});
|
|
67
|
+
var FlowGramAPIName = /* @__PURE__ */ ((FlowGramAPIName2) => {
|
|
68
|
+
FlowGramAPIName2["ServerInfo"] = "ServerInfo";
|
|
69
|
+
FlowGramAPIName2["TaskRun"] = "TaskRun";
|
|
70
|
+
FlowGramAPIName2["TaskReport"] = "TaskReport";
|
|
71
|
+
FlowGramAPIName2["TaskResult"] = "TaskResult";
|
|
72
|
+
FlowGramAPIName2["TaskCancel"] = "TaskCancel";
|
|
73
|
+
FlowGramAPIName2["Validation"] = "Validation";
|
|
74
|
+
return FlowGramAPIName2;
|
|
75
|
+
})(FlowGramAPIName || {});
|
|
76
|
+
var FlowGramAPIModule = /* @__PURE__ */ ((FlowGramAPIModule2) => {
|
|
77
|
+
FlowGramAPIModule2["Info"] = "Info";
|
|
78
|
+
FlowGramAPIModule2["Task"] = "Task";
|
|
79
|
+
FlowGramAPIModule2["Validation"] = "Validation";
|
|
80
|
+
return FlowGramAPIModule2;
|
|
81
|
+
})(FlowGramAPIModule || {});
|
|
82
|
+
|
|
83
|
+
// src/api/validation/index.ts
|
|
84
|
+
var ValidationDefine = {
|
|
85
|
+
name: "Validation" /* Validation */,
|
|
86
|
+
method: "POST" /* POST */,
|
|
87
|
+
path: "/validation",
|
|
88
|
+
module: "Validation" /* Validation */,
|
|
89
|
+
schema: {
|
|
90
|
+
input: import_zod.default.object({
|
|
91
|
+
schema: import_zod.default.string()
|
|
92
|
+
}),
|
|
93
|
+
output: import_zod.default.object({
|
|
94
|
+
valid: import_zod.default.boolean(),
|
|
95
|
+
nodeErrors: import_zod.default.array(
|
|
96
|
+
import_zod.default.object({
|
|
97
|
+
message: import_zod.default.string(),
|
|
98
|
+
nodeID: import_zod.default.string()
|
|
99
|
+
})
|
|
100
|
+
),
|
|
101
|
+
edgeErrors: import_zod.default.array(
|
|
102
|
+
import_zod.default.object({
|
|
103
|
+
message: import_zod.default.string(),
|
|
104
|
+
edge: import_zod.default.object({
|
|
105
|
+
sourceNodeID: import_zod.default.string(),
|
|
106
|
+
targetNodeID: import_zod.default.string(),
|
|
107
|
+
sourcePortID: import_zod.default.string().optional(),
|
|
108
|
+
targetPortID: import_zod.default.string().optional()
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
)
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// src/api/task-run/index.ts
|
|
117
|
+
var import_zod3 = __toESM(require("zod"));
|
|
118
|
+
|
|
119
|
+
// src/api/schema.ts
|
|
120
|
+
var import_zod2 = __toESM(require("zod"));
|
|
121
|
+
var WorkflowIOZodSchema = import_zod2.default.record(import_zod2.default.string(), import_zod2.default.any());
|
|
122
|
+
var WorkflowSnapshotZodSchema = import_zod2.default.object({
|
|
123
|
+
id: import_zod2.default.string(),
|
|
124
|
+
nodeID: import_zod2.default.string(),
|
|
125
|
+
inputs: WorkflowIOZodSchema,
|
|
126
|
+
outputs: WorkflowIOZodSchema.optional(),
|
|
127
|
+
data: WorkflowIOZodSchema,
|
|
128
|
+
branch: import_zod2.default.string().optional()
|
|
129
|
+
});
|
|
130
|
+
var WorkflowStatusZodShape = {
|
|
131
|
+
status: import_zod2.default.string(),
|
|
132
|
+
terminated: import_zod2.default.boolean(),
|
|
133
|
+
startTime: import_zod2.default.number(),
|
|
134
|
+
endTime: import_zod2.default.number().optional(),
|
|
135
|
+
timeCost: import_zod2.default.number()
|
|
136
|
+
};
|
|
137
|
+
var WorkflowStatusZodSchema = import_zod2.default.object(WorkflowStatusZodShape);
|
|
138
|
+
var WorkflowZodSchema = {
|
|
139
|
+
Inputs: WorkflowIOZodSchema,
|
|
140
|
+
Outputs: WorkflowIOZodSchema,
|
|
141
|
+
Status: WorkflowStatusZodSchema,
|
|
142
|
+
Snapshot: WorkflowSnapshotZodSchema,
|
|
143
|
+
NodeReport: import_zod2.default.object({
|
|
144
|
+
id: import_zod2.default.string(),
|
|
145
|
+
...WorkflowStatusZodShape,
|
|
146
|
+
snapshots: import_zod2.default.array(WorkflowSnapshotZodSchema)
|
|
147
|
+
})
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/api/task-run/index.ts
|
|
151
|
+
var TaskRunDefine = {
|
|
152
|
+
name: "TaskRun" /* TaskRun */,
|
|
153
|
+
method: "POST" /* POST */,
|
|
154
|
+
path: "/task/run",
|
|
155
|
+
module: "Task" /* Task */,
|
|
156
|
+
schema: {
|
|
157
|
+
input: import_zod3.default.object({
|
|
158
|
+
schema: import_zod3.default.string(),
|
|
159
|
+
inputs: WorkflowZodSchema.Inputs
|
|
160
|
+
}),
|
|
161
|
+
output: import_zod3.default.object({
|
|
162
|
+
taskID: import_zod3.default.string()
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// src/api/task-result/index.ts
|
|
168
|
+
var import_zod4 = __toESM(require("zod"));
|
|
169
|
+
var TaskResultDefine = {
|
|
170
|
+
name: "TaskResult" /* TaskResult */,
|
|
171
|
+
method: "GET" /* GET */,
|
|
172
|
+
path: "/task/result",
|
|
173
|
+
module: "Task" /* Task */,
|
|
174
|
+
schema: {
|
|
175
|
+
input: import_zod4.default.object({
|
|
176
|
+
taskID: import_zod4.default.string()
|
|
177
|
+
}),
|
|
178
|
+
output: WorkflowZodSchema.Outputs
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// src/api/task-report/index.ts
|
|
183
|
+
var import_zod5 = __toESM(require("zod"));
|
|
184
|
+
var TaskReportDefine = {
|
|
185
|
+
name: "TaskReport" /* TaskReport */,
|
|
186
|
+
method: "GET" /* GET */,
|
|
187
|
+
path: "/task/report",
|
|
188
|
+
module: "Task" /* Task */,
|
|
189
|
+
schema: {
|
|
190
|
+
input: import_zod5.default.object({
|
|
191
|
+
taskID: import_zod5.default.string()
|
|
192
|
+
}),
|
|
193
|
+
output: import_zod5.default.object({
|
|
194
|
+
id: import_zod5.default.string(),
|
|
195
|
+
inputs: WorkflowZodSchema.Inputs,
|
|
196
|
+
outputs: WorkflowZodSchema.Outputs,
|
|
197
|
+
workflowStatus: WorkflowZodSchema.Status,
|
|
198
|
+
reports: import_zod5.default.record(import_zod5.default.string(), WorkflowZodSchema.NodeReport)
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// src/api/task-cancel/index.ts
|
|
204
|
+
var import_zod6 = __toESM(require("zod"));
|
|
205
|
+
var TaskCancelDefine = {
|
|
206
|
+
name: "TaskCancel" /* TaskCancel */,
|
|
207
|
+
method: "PUT" /* PUT */,
|
|
208
|
+
path: "/task/cancel",
|
|
209
|
+
module: "Task" /* Task */,
|
|
210
|
+
schema: {
|
|
211
|
+
input: import_zod6.default.object({
|
|
212
|
+
taskID: import_zod6.default.string()
|
|
213
|
+
}),
|
|
214
|
+
output: import_zod6.default.object({
|
|
215
|
+
success: import_zod6.default.boolean()
|
|
216
|
+
})
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// src/api/server-info/index.ts
|
|
221
|
+
var import_zod7 = __toESM(require("zod"));
|
|
222
|
+
var ServerInfoDefine = {
|
|
223
|
+
name: "ServerInfo" /* ServerInfo */,
|
|
224
|
+
method: "GET" /* GET */,
|
|
225
|
+
path: "/info",
|
|
226
|
+
module: "Info" /* Info */,
|
|
227
|
+
schema: {
|
|
228
|
+
input: import_zod7.default.undefined(),
|
|
229
|
+
output: import_zod7.default.object({
|
|
230
|
+
name: import_zod7.default.string(),
|
|
231
|
+
runtime: import_zod7.default.string(),
|
|
232
|
+
version: import_zod7.default.string(),
|
|
233
|
+
time: import_zod7.default.string()
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// src/api/define.ts
|
|
239
|
+
var FlowGramAPIs = {
|
|
240
|
+
["ServerInfo" /* ServerInfo */]: ServerInfoDefine,
|
|
241
|
+
["TaskRun" /* TaskRun */]: TaskRunDefine,
|
|
242
|
+
["TaskReport" /* TaskReport */]: TaskReportDefine,
|
|
243
|
+
["TaskResult" /* TaskResult */]: TaskResultDefine,
|
|
244
|
+
["TaskCancel" /* TaskCancel */]: TaskCancelDefine,
|
|
245
|
+
["Validation" /* Validation */]: ValidationDefine
|
|
246
|
+
};
|
|
247
|
+
var FlowGramAPINames = Object.keys(FlowGramAPIs);
|
|
248
|
+
|
|
249
|
+
// src/schema/constant.ts
|
|
250
|
+
var WorkflowPortType = /* @__PURE__ */ ((WorkflowPortType2) => {
|
|
251
|
+
WorkflowPortType2["Input"] = "input";
|
|
252
|
+
WorkflowPortType2["Output"] = "output";
|
|
253
|
+
return WorkflowPortType2;
|
|
254
|
+
})(WorkflowPortType || {});
|
|
255
|
+
var WorkflowVariableType = /* @__PURE__ */ ((WorkflowVariableType2) => {
|
|
256
|
+
WorkflowVariableType2["String"] = "string";
|
|
257
|
+
WorkflowVariableType2["Integer"] = "integer";
|
|
258
|
+
WorkflowVariableType2["Number"] = "number";
|
|
259
|
+
WorkflowVariableType2["Boolean"] = "boolean";
|
|
260
|
+
WorkflowVariableType2["Object"] = "object";
|
|
261
|
+
WorkflowVariableType2["Array"] = "array";
|
|
262
|
+
WorkflowVariableType2["Null"] = "null";
|
|
263
|
+
return WorkflowVariableType2;
|
|
264
|
+
})(WorkflowVariableType || {});
|
|
265
|
+
|
|
266
|
+
// src/node/constant.ts
|
|
267
|
+
var FlowGramNode = /* @__PURE__ */ ((FlowGramNode2) => {
|
|
268
|
+
FlowGramNode2["Root"] = "root";
|
|
269
|
+
FlowGramNode2["Start"] = "start";
|
|
270
|
+
FlowGramNode2["End"] = "end";
|
|
271
|
+
FlowGramNode2["LLM"] = "llm";
|
|
272
|
+
FlowGramNode2["code"] = "code";
|
|
273
|
+
FlowGramNode2["Condition"] = "condition";
|
|
274
|
+
FlowGramNode2["Loop"] = "loop";
|
|
275
|
+
FlowGramNode2["Comment"] = "comment";
|
|
276
|
+
FlowGramNode2["Group"] = "group";
|
|
277
|
+
FlowGramNode2["BlockStart"] = "block-start";
|
|
278
|
+
FlowGramNode2["BlockEnd"] = "block-end";
|
|
279
|
+
return FlowGramNode2;
|
|
280
|
+
})(FlowGramNode || {});
|
|
281
|
+
|
|
282
|
+
// src/node/condition/constant.ts
|
|
283
|
+
var ConditionOperation = /* @__PURE__ */ ((ConditionOperation2) => {
|
|
284
|
+
ConditionOperation2["EQ"] = "eq";
|
|
285
|
+
ConditionOperation2["NEQ"] = "neq";
|
|
286
|
+
ConditionOperation2["GT"] = "gt";
|
|
287
|
+
ConditionOperation2["GTE"] = "gte";
|
|
288
|
+
ConditionOperation2["LT"] = "lt";
|
|
289
|
+
ConditionOperation2["LTE"] = "lte";
|
|
290
|
+
ConditionOperation2["IN"] = "in";
|
|
291
|
+
ConditionOperation2["NIN"] = "nin";
|
|
292
|
+
ConditionOperation2["CONTAINS"] = "contains";
|
|
293
|
+
ConditionOperation2["NOT_CONTAINS"] = "not_contains";
|
|
294
|
+
ConditionOperation2["IS_EMPTY"] = "is_empty";
|
|
295
|
+
ConditionOperation2["IS_NOT_EMPTY"] = "is_not_empty";
|
|
296
|
+
ConditionOperation2["IS_TRUE"] = "is_true";
|
|
297
|
+
ConditionOperation2["IS_FALSE"] = "is_false";
|
|
298
|
+
return ConditionOperation2;
|
|
299
|
+
})(ConditionOperation || {});
|
|
300
|
+
|
|
301
|
+
// src/runtime/engine/index.ts
|
|
302
|
+
var IEngine = Symbol.for("Engine");
|
|
303
|
+
|
|
304
|
+
// src/runtime/executor/executor.ts
|
|
305
|
+
var IExecutor = Symbol.for("Executor");
|
|
306
|
+
|
|
307
|
+
// src/runtime/status/index.ts
|
|
308
|
+
var WorkflowStatus = /* @__PURE__ */ ((WorkflowStatus2) => {
|
|
309
|
+
WorkflowStatus2["Pending"] = "pending";
|
|
310
|
+
WorkflowStatus2["Processing"] = "processing";
|
|
311
|
+
WorkflowStatus2["Succeeded"] = "succeeded";
|
|
312
|
+
WorkflowStatus2["Failed"] = "failed";
|
|
313
|
+
WorkflowStatus2["Canceled"] = "canceled";
|
|
314
|
+
return WorkflowStatus2;
|
|
315
|
+
})(WorkflowStatus || {});
|
|
316
|
+
|
|
317
|
+
// src/runtime/validation/index.ts
|
|
318
|
+
var IValidation = Symbol.for("Validation");
|
|
319
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
320
|
+
0 && (module.exports = {
|
|
321
|
+
ConditionOperation,
|
|
322
|
+
FlowGramAPIMethod,
|
|
323
|
+
FlowGramAPIModule,
|
|
324
|
+
FlowGramAPIName,
|
|
325
|
+
FlowGramAPINames,
|
|
326
|
+
FlowGramAPIs,
|
|
327
|
+
FlowGramNode,
|
|
328
|
+
IEngine,
|
|
329
|
+
IExecutor,
|
|
330
|
+
IValidation,
|
|
331
|
+
ServerInfoDefine,
|
|
332
|
+
TaskCancelDefine,
|
|
333
|
+
TaskReportDefine,
|
|
334
|
+
TaskResultDefine,
|
|
335
|
+
TaskRunDefine,
|
|
336
|
+
ValidationDefine,
|
|
337
|
+
WorkflowPortType,
|
|
338
|
+
WorkflowStatus,
|
|
339
|
+
WorkflowVariableType
|
|
340
|
+
});
|
|
341
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"],"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,iBAAc;;;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,E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AY,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;","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"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flowgram.ai/runtime-interface",
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
|
+
"homepage": "https://flowgram.ai/",
|
|
5
|
+
"repository": "https://github.com/bytedance/flowgram.ai",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/esm/index.js",
|
|
10
|
+
"require": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/esm/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"zod": "^3.24.4"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"eslint": "^8.54.0",
|
|
23
|
+
"tsup": "^8.0.1",
|
|
24
|
+
"typescript": "^5.0.4",
|
|
25
|
+
"vitest": "^0.34.6",
|
|
26
|
+
"@flowgram.ai/eslint-config": "0.1.0-alpha.10",
|
|
27
|
+
"@flowgram.ai/ts-config": "0.1.0-alpha.10"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"registry": "https://registry.npmjs.org/"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "npm run watch",
|
|
35
|
+
"build": "npm run build:fast -- --dts-resolve",
|
|
36
|
+
"build:fast": "tsup src/index.ts --format cjs,esm --sourcemap --legacy-output",
|
|
37
|
+
"build:watch": "npm run build:fast -- --dts-resolve",
|
|
38
|
+
"clean": "rimraf dist",
|
|
39
|
+
"test": "exit 0",
|
|
40
|
+
"test:cov": "exit 0",
|
|
41
|
+
"ts-check": "tsc --noEmit",
|
|
42
|
+
"watch": "npm run build:fast -- --dts-resolve --watch --ignore-watch dist"
|
|
43
|
+
}
|
|
44
|
+
}
|