@flowgram.ai/runtime-interface 0.1.8
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 +264 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +525 -0
- package/dist/index.d.ts +525 -0
- package/dist/index.js +318 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
declare enum FlowGramAPIMethod {
|
|
4
|
+
GET = "GET",
|
|
5
|
+
POST = "POST",
|
|
6
|
+
PUT = "PUT",
|
|
7
|
+
DELETE = "DELETE",
|
|
8
|
+
PATCH = "PATCH"
|
|
9
|
+
}
|
|
10
|
+
declare enum FlowGramAPIName {
|
|
11
|
+
ServerInfo = "ServerInfo",
|
|
12
|
+
TaskRun = "TaskRun",
|
|
13
|
+
TaskReport = "TaskReport",
|
|
14
|
+
TaskResult = "TaskResult",
|
|
15
|
+
TaskCancel = "TaskCancel",
|
|
16
|
+
Validation = "Validation"
|
|
17
|
+
}
|
|
18
|
+
declare enum FlowGramAPIModule {
|
|
19
|
+
Info = "Info",
|
|
20
|
+
Task = "Task",
|
|
21
|
+
Validation = "Validation"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface FlowGramAPIDefine {
|
|
25
|
+
name: FlowGramAPIName;
|
|
26
|
+
method: FlowGramAPIMethod;
|
|
27
|
+
path: `/${string}`;
|
|
28
|
+
module: FlowGramAPIModule;
|
|
29
|
+
schema: {
|
|
30
|
+
input: z.ZodFirstPartySchemaTypes;
|
|
31
|
+
output: z.ZodFirstPartySchemaTypes;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
interface FlowGramAPIDefines {
|
|
35
|
+
[key: string]: FlowGramAPIDefine;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const FlowGramAPIs: FlowGramAPIDefines;
|
|
39
|
+
declare const FlowGramAPINames: FlowGramAPIName[];
|
|
40
|
+
|
|
41
|
+
type ContainerService = any;
|
|
42
|
+
interface IContainer {
|
|
43
|
+
get<T = ContainerService>(key: any): T;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type VOData<T> = Omit<T, 'id'>;
|
|
47
|
+
|
|
48
|
+
interface WorkflowEdgeSchema {
|
|
49
|
+
sourceNodeID: string;
|
|
50
|
+
targetNodeID: string;
|
|
51
|
+
sourcePortID?: string;
|
|
52
|
+
targetPortID?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type JsonSchemaBasicType = 'boolean' | 'string' | 'integer' | 'number' | 'object' | 'array' | 'map';
|
|
56
|
+
interface IJsonSchema<T = string> {
|
|
57
|
+
type: T;
|
|
58
|
+
default?: any;
|
|
59
|
+
title?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
enum?: (string | number)[];
|
|
62
|
+
properties?: Record<string, IJsonSchema<T>>;
|
|
63
|
+
additionalProperties?: IJsonSchema<T>;
|
|
64
|
+
items?: IJsonSchema<T>;
|
|
65
|
+
required?: string[];
|
|
66
|
+
$ref?: string;
|
|
67
|
+
extra?: {
|
|
68
|
+
index?: number;
|
|
69
|
+
weak?: boolean;
|
|
70
|
+
formComponent?: string;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
type IBasicJsonSchema = IJsonSchema<JsonSchemaBasicType>;
|
|
75
|
+
|
|
76
|
+
interface XYSchema {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
}
|
|
80
|
+
type PositionSchema = XYSchema;
|
|
81
|
+
|
|
82
|
+
interface WorkflowNodeMetaSchema {
|
|
83
|
+
position: PositionSchema;
|
|
84
|
+
canvasPosition?: PositionSchema;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface IFlowConstantValue {
|
|
88
|
+
type: 'constant';
|
|
89
|
+
content?: string | number | boolean;
|
|
90
|
+
}
|
|
91
|
+
interface IFlowRefValue {
|
|
92
|
+
type: 'ref';
|
|
93
|
+
content?: string[];
|
|
94
|
+
}
|
|
95
|
+
type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
|
|
96
|
+
|
|
97
|
+
interface WorkflowNodeSchema<T = string, D = any> {
|
|
98
|
+
id: string;
|
|
99
|
+
type: T;
|
|
100
|
+
meta: WorkflowNodeMetaSchema;
|
|
101
|
+
data: D & {
|
|
102
|
+
title?: string;
|
|
103
|
+
inputsValues?: Record<string, IFlowConstantRefValue>;
|
|
104
|
+
inputs?: IJsonSchema;
|
|
105
|
+
outputs?: IJsonSchema;
|
|
106
|
+
[key: string]: any;
|
|
107
|
+
};
|
|
108
|
+
blocks?: WorkflowNodeSchema[];
|
|
109
|
+
edges?: WorkflowEdgeSchema[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface WorkflowSchema {
|
|
113
|
+
nodes: WorkflowNodeSchema[];
|
|
114
|
+
edges: WorkflowEdgeSchema[];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare enum WorkflowPortType {
|
|
118
|
+
Input = "input",
|
|
119
|
+
Output = "output"
|
|
120
|
+
}
|
|
121
|
+
declare enum WorkflowVariableType {
|
|
122
|
+
String = "string",
|
|
123
|
+
Integer = "integer",
|
|
124
|
+
Number = "number",
|
|
125
|
+
Boolean = "boolean",
|
|
126
|
+
Object = "object",
|
|
127
|
+
Array = "array",
|
|
128
|
+
Null = "null"
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
type WorkflowInputs = Record<string, any>;
|
|
132
|
+
type WorkflowOutputs = Record<string, any>;
|
|
133
|
+
|
|
134
|
+
interface InvokeParams {
|
|
135
|
+
schema: WorkflowSchema;
|
|
136
|
+
inputs: WorkflowInputs;
|
|
137
|
+
}
|
|
138
|
+
type WorkflowRuntimeInvoke = (params: InvokeParams) => Promise<WorkflowInputs>;
|
|
139
|
+
|
|
140
|
+
interface VariableTypeInfo {
|
|
141
|
+
type: WorkflowVariableType;
|
|
142
|
+
itemsType?: WorkflowVariableType;
|
|
143
|
+
}
|
|
144
|
+
interface IVariable<T = Object> extends VariableTypeInfo {
|
|
145
|
+
id: string;
|
|
146
|
+
nodeID: string;
|
|
147
|
+
key: string;
|
|
148
|
+
value: T;
|
|
149
|
+
}
|
|
150
|
+
interface IVariableParseResult<T = unknown> extends VariableTypeInfo {
|
|
151
|
+
value: T;
|
|
152
|
+
type: WorkflowVariableType;
|
|
153
|
+
}
|
|
154
|
+
interface IVariableStore {
|
|
155
|
+
id: string;
|
|
156
|
+
store: Map<string, Map<string, IVariable>>;
|
|
157
|
+
setParent(parent: IVariableStore): void;
|
|
158
|
+
setVariable(params: {
|
|
159
|
+
nodeID: string;
|
|
160
|
+
key: string;
|
|
161
|
+
value: Object;
|
|
162
|
+
} & VariableTypeInfo): void;
|
|
163
|
+
setValue(params: {
|
|
164
|
+
nodeID: string;
|
|
165
|
+
variableKey: string;
|
|
166
|
+
variablePath?: string[];
|
|
167
|
+
value: Object;
|
|
168
|
+
}): void;
|
|
169
|
+
getValue<T = unknown>(params: {
|
|
170
|
+
nodeID: string;
|
|
171
|
+
variableKey: string;
|
|
172
|
+
variablePath?: string[];
|
|
173
|
+
}): IVariableParseResult<T> | null;
|
|
174
|
+
init(): void;
|
|
175
|
+
dispose(): void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare enum WorkflowStatus {
|
|
179
|
+
Pending = "pending",
|
|
180
|
+
Processing = "processing",
|
|
181
|
+
Succeeded = "succeeded",
|
|
182
|
+
Failed = "failed",
|
|
183
|
+
Canceled = "canceled"
|
|
184
|
+
}
|
|
185
|
+
interface StatusData {
|
|
186
|
+
status: WorkflowStatus;
|
|
187
|
+
terminated: boolean;
|
|
188
|
+
startTime: number;
|
|
189
|
+
endTime?: number;
|
|
190
|
+
timeCost: number;
|
|
191
|
+
}
|
|
192
|
+
interface IStatus extends StatusData {
|
|
193
|
+
id: string;
|
|
194
|
+
process(): void;
|
|
195
|
+
success(): void;
|
|
196
|
+
fail(): void;
|
|
197
|
+
cancel(): void;
|
|
198
|
+
export(): StatusData;
|
|
199
|
+
}
|
|
200
|
+
interface IStatusCenter {
|
|
201
|
+
workflow: IStatus;
|
|
202
|
+
nodeStatus(nodeID: string): IStatus;
|
|
203
|
+
init(): void;
|
|
204
|
+
dispose(): void;
|
|
205
|
+
getStatusNodeIDs(status: WorkflowStatus): string[];
|
|
206
|
+
exportNodeStatus(): Record<string, StatusData>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
interface SnapshotData {
|
|
210
|
+
nodeID: string;
|
|
211
|
+
inputs: WorkflowInputs;
|
|
212
|
+
outputs: WorkflowOutputs;
|
|
213
|
+
data: any;
|
|
214
|
+
branch?: string;
|
|
215
|
+
}
|
|
216
|
+
interface Snapshot extends SnapshotData {
|
|
217
|
+
id: string;
|
|
218
|
+
}
|
|
219
|
+
interface ISnapshot {
|
|
220
|
+
id: string;
|
|
221
|
+
data: Partial<SnapshotData>;
|
|
222
|
+
addData(data: Partial<SnapshotData>): void;
|
|
223
|
+
validate(): boolean;
|
|
224
|
+
export(): Snapshot;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
interface ISnapshotCenter {
|
|
228
|
+
id: string;
|
|
229
|
+
create(snapshot: Partial<SnapshotData>): ISnapshot;
|
|
230
|
+
exportAll(): Snapshot[];
|
|
231
|
+
export(): Record<string, Snapshot[]>;
|
|
232
|
+
init(): void;
|
|
233
|
+
dispose(): void;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
interface IOData {
|
|
237
|
+
inputs: WorkflowInputs;
|
|
238
|
+
outputs: WorkflowOutputs;
|
|
239
|
+
}
|
|
240
|
+
/** Input & Output */
|
|
241
|
+
interface IIOCenter {
|
|
242
|
+
inputs: WorkflowInputs;
|
|
243
|
+
outputs: WorkflowOutputs;
|
|
244
|
+
setInputs(inputs: WorkflowInputs): void;
|
|
245
|
+
setOutputs(outputs: WorkflowOutputs): void;
|
|
246
|
+
init(inputs: WorkflowInputs): void;
|
|
247
|
+
dispose(): void;
|
|
248
|
+
export(): IOData;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare enum FlowGramNode {
|
|
252
|
+
Root = "root",
|
|
253
|
+
Start = "start",
|
|
254
|
+
End = "end",
|
|
255
|
+
LLM = "llm",
|
|
256
|
+
code = "code",
|
|
257
|
+
Condition = "condition",
|
|
258
|
+
Loop = "loop",
|
|
259
|
+
Comment = "comment",
|
|
260
|
+
Group = "group"
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
interface IEdge {
|
|
264
|
+
id: string;
|
|
265
|
+
from: INode;
|
|
266
|
+
to: INode;
|
|
267
|
+
fromPort: IPort;
|
|
268
|
+
toPort: IPort;
|
|
269
|
+
}
|
|
270
|
+
interface CreateEdgeParams {
|
|
271
|
+
id: string;
|
|
272
|
+
from: INode;
|
|
273
|
+
to: INode;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface IPort {
|
|
277
|
+
id: string;
|
|
278
|
+
node: INode;
|
|
279
|
+
edges: IEdge[];
|
|
280
|
+
type: WorkflowPortType;
|
|
281
|
+
}
|
|
282
|
+
interface CreatePortParams {
|
|
283
|
+
id: string;
|
|
284
|
+
node: INode;
|
|
285
|
+
type: WorkflowPortType;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
interface NodeDeclare {
|
|
289
|
+
inputsValues?: Record<string, IFlowConstantRefValue>;
|
|
290
|
+
inputs?: IJsonSchema;
|
|
291
|
+
outputs?: IJsonSchema;
|
|
292
|
+
}
|
|
293
|
+
interface INode<T = any> {
|
|
294
|
+
id: string;
|
|
295
|
+
type: FlowGramNode;
|
|
296
|
+
name: string;
|
|
297
|
+
position: PositionSchema;
|
|
298
|
+
declare: NodeDeclare;
|
|
299
|
+
data: T;
|
|
300
|
+
ports: {
|
|
301
|
+
inputs: IPort[];
|
|
302
|
+
outputs: IPort[];
|
|
303
|
+
};
|
|
304
|
+
edges: {
|
|
305
|
+
inputs: IEdge[];
|
|
306
|
+
outputs: IEdge[];
|
|
307
|
+
};
|
|
308
|
+
parent: INode | null;
|
|
309
|
+
children: INode[];
|
|
310
|
+
prev: INode[];
|
|
311
|
+
next: INode[];
|
|
312
|
+
isBranch: boolean;
|
|
313
|
+
}
|
|
314
|
+
interface CreateNodeParams {
|
|
315
|
+
id: string;
|
|
316
|
+
type: FlowGramNode;
|
|
317
|
+
name: string;
|
|
318
|
+
position: PositionSchema;
|
|
319
|
+
variable?: NodeDeclare;
|
|
320
|
+
data?: any;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface IDocument {
|
|
324
|
+
id: string;
|
|
325
|
+
nodes: INode[];
|
|
326
|
+
edges: IEdge[];
|
|
327
|
+
root: INode;
|
|
328
|
+
start: INode;
|
|
329
|
+
end: INode;
|
|
330
|
+
init(schema: WorkflowSchema): void;
|
|
331
|
+
dispose(): void;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
interface IState {
|
|
335
|
+
id: string;
|
|
336
|
+
variableStore: IVariableStore;
|
|
337
|
+
init(): void;
|
|
338
|
+
dispose(): void;
|
|
339
|
+
getNodeInputs(node: INode): WorkflowInputs;
|
|
340
|
+
setNodeOutputs(params: {
|
|
341
|
+
node: INode;
|
|
342
|
+
outputs: WorkflowOutputs;
|
|
343
|
+
}): void;
|
|
344
|
+
parseRef<T = unknown>(ref: IFlowRefValue): IVariableParseResult<T> | null;
|
|
345
|
+
parseValue<T = unknown>(flowValue: IFlowConstantRefValue, type?: WorkflowVariableType): IVariableParseResult<T> | null;
|
|
346
|
+
isExecutedNode(node: INode): boolean;
|
|
347
|
+
addExecutedNode(node: INode): void;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface NodeReport extends StatusData {
|
|
351
|
+
id: string;
|
|
352
|
+
snapshots: Snapshot[];
|
|
353
|
+
}
|
|
354
|
+
interface IReport {
|
|
355
|
+
id: string;
|
|
356
|
+
inputs: WorkflowInputs;
|
|
357
|
+
outputs: WorkflowOutputs;
|
|
358
|
+
workflowStatus: StatusData;
|
|
359
|
+
reports: Record<string, NodeReport>;
|
|
360
|
+
}
|
|
361
|
+
interface IReporter {
|
|
362
|
+
snapshotCenter: ISnapshotCenter;
|
|
363
|
+
statusCenter: IStatusCenter;
|
|
364
|
+
init(): void;
|
|
365
|
+
dispose(): void;
|
|
366
|
+
export(): IReport;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface ContextData {
|
|
370
|
+
variableStore: IVariableStore;
|
|
371
|
+
state: IState;
|
|
372
|
+
document: IDocument;
|
|
373
|
+
ioCenter: IIOCenter;
|
|
374
|
+
snapshotCenter: ISnapshotCenter;
|
|
375
|
+
statusCenter: IStatusCenter;
|
|
376
|
+
reporter: IReporter;
|
|
377
|
+
}
|
|
378
|
+
interface IContext extends ContextData {
|
|
379
|
+
id: string;
|
|
380
|
+
init(params: InvokeParams): void;
|
|
381
|
+
dispose(): void;
|
|
382
|
+
sub(): IContext;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
interface ITask {
|
|
386
|
+
id: string;
|
|
387
|
+
processing: Promise<WorkflowOutputs>;
|
|
388
|
+
context: IContext;
|
|
389
|
+
cancel(): void;
|
|
390
|
+
}
|
|
391
|
+
interface TaskParams {
|
|
392
|
+
processing: Promise<WorkflowOutputs>;
|
|
393
|
+
context: IContext;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
interface EndNodeData {
|
|
397
|
+
title: string;
|
|
398
|
+
inputs: IJsonSchema<'object'>;
|
|
399
|
+
outputs: IJsonSchema<'object'>;
|
|
400
|
+
outputValues: Record<string, IFlowConstantRefValue>;
|
|
401
|
+
}
|
|
402
|
+
type EndNodeSchema = WorkflowNodeSchema<FlowGramNode.End, EndNodeData>;
|
|
403
|
+
|
|
404
|
+
interface LLMNodeData {
|
|
405
|
+
title: string;
|
|
406
|
+
inputs: IJsonSchema<'object'>;
|
|
407
|
+
outputs: IJsonSchema<'object'>;
|
|
408
|
+
inputValues: {
|
|
409
|
+
apiKey: IFlowConstantRefValue;
|
|
410
|
+
modelType: IFlowConstantRefValue;
|
|
411
|
+
baseURL: IFlowConstantRefValue;
|
|
412
|
+
temperature: IFlowConstantRefValue;
|
|
413
|
+
systemPrompt: IFlowConstantRefValue;
|
|
414
|
+
prompt: IFlowConstantRefValue;
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
type LLMNodeSchema = WorkflowNodeSchema<FlowGramNode.LLM, LLMNodeData>;
|
|
418
|
+
|
|
419
|
+
interface StartNodeData {
|
|
420
|
+
title: string;
|
|
421
|
+
outputs: IJsonSchema<'object'>;
|
|
422
|
+
}
|
|
423
|
+
type StartNodeSchema = WorkflowNodeSchema<FlowGramNode.Start, StartNodeData>;
|
|
424
|
+
|
|
425
|
+
interface ExecutionContext {
|
|
426
|
+
node: INode;
|
|
427
|
+
inputs: WorkflowInputs;
|
|
428
|
+
container: IContainer;
|
|
429
|
+
runtime: IContext;
|
|
430
|
+
}
|
|
431
|
+
interface ExecutionResult {
|
|
432
|
+
outputs: WorkflowOutputs;
|
|
433
|
+
branch?: string;
|
|
434
|
+
}
|
|
435
|
+
interface INodeExecutor {
|
|
436
|
+
type: FlowGramNode;
|
|
437
|
+
execute: (context: ExecutionContext) => Promise<ExecutionResult>;
|
|
438
|
+
}
|
|
439
|
+
interface INodeExecutorFactory {
|
|
440
|
+
new (): INodeExecutor;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
interface IExecutor {
|
|
444
|
+
execute: (context: ExecutionContext) => Promise<ExecutionResult>;
|
|
445
|
+
register: (executor: INodeExecutor) => void;
|
|
446
|
+
}
|
|
447
|
+
declare const IExecutor: unique symbol;
|
|
448
|
+
|
|
449
|
+
interface EngineServices {
|
|
450
|
+
Executor: IExecutor;
|
|
451
|
+
}
|
|
452
|
+
interface IEngine {
|
|
453
|
+
invoke(params: InvokeParams): ITask;
|
|
454
|
+
executeNode(params: {
|
|
455
|
+
context: IContext;
|
|
456
|
+
node: INode;
|
|
457
|
+
}): Promise<void>;
|
|
458
|
+
}
|
|
459
|
+
declare const IEngine: unique symbol;
|
|
460
|
+
|
|
461
|
+
interface ValidationResult {
|
|
462
|
+
valid: boolean;
|
|
463
|
+
errors?: string[];
|
|
464
|
+
}
|
|
465
|
+
interface IValidation {
|
|
466
|
+
validate(schema: WorkflowSchema): ValidationResult;
|
|
467
|
+
}
|
|
468
|
+
declare const IValidation: unique symbol;
|
|
469
|
+
|
|
470
|
+
interface TaskRunInput {
|
|
471
|
+
inputs: WorkflowInputs;
|
|
472
|
+
schema: string;
|
|
473
|
+
}
|
|
474
|
+
interface TaskRunOutput {
|
|
475
|
+
taskID: string;
|
|
476
|
+
}
|
|
477
|
+
declare const TaskRunDefine: FlowGramAPIDefine;
|
|
478
|
+
|
|
479
|
+
interface ServerInfoInput {
|
|
480
|
+
}
|
|
481
|
+
interface ServerInfoOutput {
|
|
482
|
+
name: string;
|
|
483
|
+
title: string;
|
|
484
|
+
description: string;
|
|
485
|
+
runtime: string;
|
|
486
|
+
version: string;
|
|
487
|
+
time: string;
|
|
488
|
+
}
|
|
489
|
+
declare const ServerInfoDefine: FlowGramAPIDefine;
|
|
490
|
+
|
|
491
|
+
interface TaskReportInput {
|
|
492
|
+
taskID: string;
|
|
493
|
+
}
|
|
494
|
+
type TaskReportOutput = IReport | undefined;
|
|
495
|
+
declare const TaskReportDefine: FlowGramAPIDefine;
|
|
496
|
+
|
|
497
|
+
interface ValidationReq {
|
|
498
|
+
schema: string;
|
|
499
|
+
}
|
|
500
|
+
interface ValidationRes extends ValidationResult {
|
|
501
|
+
}
|
|
502
|
+
declare const ValidationDefine: FlowGramAPIDefine;
|
|
503
|
+
|
|
504
|
+
interface TaskResultInput {
|
|
505
|
+
taskID: string;
|
|
506
|
+
}
|
|
507
|
+
type TaskResultOutput = WorkflowOutputs | undefined;
|
|
508
|
+
declare const TaskResultDefine: FlowGramAPIDefine;
|
|
509
|
+
|
|
510
|
+
interface TaskCancelInput {
|
|
511
|
+
taskID: string;
|
|
512
|
+
}
|
|
513
|
+
type TaskCancelOutput = {
|
|
514
|
+
success: boolean;
|
|
515
|
+
};
|
|
516
|
+
declare const TaskCancelDefine: FlowGramAPIDefine;
|
|
517
|
+
|
|
518
|
+
interface IRuntimeClient {
|
|
519
|
+
[FlowGramAPIName.TaskRun]: (input: TaskRunInput) => Promise<TaskRunOutput | undefined>;
|
|
520
|
+
[FlowGramAPIName.TaskReport]: (input: TaskReportInput) => Promise<TaskReportOutput | undefined>;
|
|
521
|
+
[FlowGramAPIName.TaskResult]: (input: TaskResultInput) => Promise<TaskResultOutput | undefined>;
|
|
522
|
+
[FlowGramAPIName.TaskCancel]: (input: TaskCancelInput) => Promise<TaskCancelOutput | undefined>;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export { type ContainerService, type ContextData, type CreateEdgeParams, type CreateNodeParams, type CreatePortParams, type EndNodeSchema, type EngineServices, type ExecutionContext, type ExecutionResult, type FlowGramAPIDefine, type FlowGramAPIDefines, FlowGramAPIMethod, FlowGramAPIModule, FlowGramAPIName, FlowGramAPINames, FlowGramAPIs, FlowGramNode, type IBasicJsonSchema, type IContainer, type IContext, type IDocument, type IEdge, IEngine, IExecutor, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowRefValue, type IIOCenter, type IJsonSchema, type INode, type INodeExecutor, type INodeExecutorFactory, type IOData, type IPort, type IReport, type IReporter, type IRuntimeClient, type ISnapshot, type ISnapshotCenter, type IState, type IStatus, type IStatusCenter, type ITask, IValidation, type IVariable, type IVariableParseResult, type IVariableStore, type InvokeParams, type JsonSchemaBasicType, type LLMNodeSchema, type NodeReport, type NodeDeclare as NodeVariable, type PositionSchema, ServerInfoDefine, type ServerInfoInput, type ServerInfoOutput, type Snapshot, type SnapshotData, type StartNodeSchema, type StatusData, TaskCancelDefine, type TaskCancelInput, type TaskCancelOutput, type TaskParams, TaskReportDefine, type TaskReportInput, type TaskReportOutput, TaskResultDefine, type TaskResultInput, type TaskResultOutput, TaskRunDefine, type TaskRunInput, type TaskRunOutput, type VOData, ValidationDefine, type ValidationReq, type ValidationRes, type ValidationResult, type WorkflowEdgeSchema, type WorkflowInputs, type WorkflowNodeMetaSchema, type WorkflowNodeSchema, type WorkflowOutputs, WorkflowPortType, type WorkflowRuntimeInvoke, type WorkflowSchema, WorkflowStatus, WorkflowVariableType, type XYSchema };
|