@oomol-lab/open-flow 0.1.0-beta.67 → 0.1.0-beta.69
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/browser/ContentIcon-CsECY5id.js +11868 -0
- package/dist/browser/FlowCanvas-C5X22xQ7.js +22721 -0
- package/dist/browser/{createResourceDialog-BQVD8Rqb.js → createResourceDialog-Di5BBrQv.js} +3 -2
- package/dist/browser/dialog-Bjo-r9B0.js +8862 -0
- package/dist/browser/event-sources.d.ts +4 -2
- package/dist/browser/exportSvg-Cj6Spxx-.js +659 -0
- package/dist/browser/flow-authoring-node.d.ts +3 -1
- package/dist/browser/flow-authoring.js +68 -7
- package/dist/browser/flow-change-schema.d.ts +3 -1
- package/dist/browser/flow-change.d.ts +17 -2
- package/dist/browser/flow-change.js +82 -9
- package/dist/browser/{flowChanges-VB9Y4iy7.js → flowChanges-Dp-rcEJ6.js} +4312 -16566
- package/dist/browser/{flowRunInputEditorStore-DJqmR6Qh.js → flowRunInputEditorStore-ys1-w9GW.js} +2 -1
- package/dist/browser/{flowWorkspace-C1hlTnZq.js → flowWorkspace-CB1QACku.js} +1304 -23538
- package/dist/browser/languages-gYzoQqCi.js +68 -0
- package/dist/browser/licenses.md +24 -0
- package/dist/browser/preview.css +53 -41
- package/dist/browser/preview.js +3974 -4094
- package/dist/browser/{dialog-CS2Vt2if.js → tooltip-CJjYs_2I.js} +710 -9472
- package/dist/browser/{typeScriptSession-D0bjYDeg.js → typeScriptSession-B0hC-C8y.js} +1 -1
- package/dist/browser/ui.css +12 -0
- package/dist/browser/{value-BADHeZ9I.js → value-BbFQZZ_V.js} +1 -68
- package/dist/browser/workbench.css +2840 -2824
- package/dist/browser/workbench.js +437 -337
- package/dist/browser/{workbenchSelect-CpXhjUou.js → workbenchSelect-C3hxUcYm.js} +2 -1
- package/dist/command/index.js +55 -51
- package/dist/common/authoring.d.ts +20 -0
- package/dist/common/authoringSchema.d.ts +243 -0
- package/dist/common/connector-proxy.d.ts +4 -0
- package/dist/common/control-api-conformance.js +173 -36
- package/dist/common/control-api.d.ts +22 -8
- package/dist/common/control-api.js +156 -18
- package/dist/common/control-requests.d.ts +32 -19
- package/dist/common/control-requests.js +2854 -152
- package/dist/common/decision.js +27 -3
- package/dist/common/engine-contract.d.ts +2 -2
- package/dist/common/event-source-definition.d.ts +34 -16
- package/dist/common/event-source.d.ts +63 -5
- package/dist/common/event-source.js +5744 -261
- package/dist/common/event-sources.d.ts +99 -6
- package/dist/common/flow-encoding.js +49 -10
- package/dist/common/flow-errorHandling.d.ts +36 -0
- package/dist/common/flow-graph.d.ts +4 -2
- package/dist/common/flow-retry.d.ts +19 -0
- package/dist/common/flow-semantics.js +94 -10
- package/dist/common/{fr-Du5gv3kM.js → fr-CNTSedYU.js} +259 -18
- package/dist/common/integration-trigger.d.ts +1 -1
- package/dist/common/integration-trigger.js +27 -3
- package/dist/common/{ja-D2wyPdTF.js → ja-CxQBHr2J.js} +259 -18
- package/dist/common/{ko-Cuu2AOaC.js → ko-D1Exiv1h.js} +259 -18
- package/dist/common/mcp.d.ts +30 -0
- package/dist/common/mcp.js +158 -20
- package/dist/common/openapi.js +27 -3
- package/dist/common/poll-trigger.js +27 -3
- package/dist/common/provider-triggers.d.ts +0 -2
- package/dist/common/provider-triggers.js +358 -155
- package/dist/common/{ru-BjI_JSsx.js → ru-BzLZv0B7.js} +259 -18
- package/dist/common/run-events.d.ts +2 -0
- package/dist/common/run-events.js +4 -2
- package/dist/common/runtime-contract.d.ts +1 -0
- package/dist/common/runtime-contract.js +4 -4
- package/dist/common/scheduler.d.ts +13 -2
- package/dist/common/scheduler.js +288 -98
- package/dist/common/webhook-trigger.js +27 -3
- package/dist/common/workflow.js +27 -3
- package/dist/common/{zh-CN-CnnXkzLh.js → zh-CN-Dg_xSGde.js} +259 -18
- package/dist/common/{zh-TW-CJnR2dgF.js → zh-TW-oxuLwsV0.js} +259 -18
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/common/event-source-feishu.d.ts +0 -3
- package/dist/common/feishu-events.d.ts +0 -19
- package/dist/common/feishu-subscriptions.d.ts +0 -6
|
@@ -22,6 +22,35 @@ function dequal(foo, bar) {
|
|
|
22
22
|
return foo !== foo && bar !== bar;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
+
//#region src/execution/common/engineContract.ts
|
|
26
|
+
var currentEngineContract = "open-flow-engine/v6";
|
|
27
|
+
`${JSON.stringify(currentEngineContract)}`, new Set([
|
|
28
|
+
"assert",
|
|
29
|
+
"assert/strict",
|
|
30
|
+
"buffer",
|
|
31
|
+
"console",
|
|
32
|
+
"constants",
|
|
33
|
+
"crypto",
|
|
34
|
+
"events",
|
|
35
|
+
"fs",
|
|
36
|
+
"fs/promises",
|
|
37
|
+
"os",
|
|
38
|
+
"path",
|
|
39
|
+
"path/posix",
|
|
40
|
+
"process",
|
|
41
|
+
"punycode",
|
|
42
|
+
"querystring",
|
|
43
|
+
"stream",
|
|
44
|
+
"stream/promises",
|
|
45
|
+
"stream/web",
|
|
46
|
+
"string_decoder",
|
|
47
|
+
"timers",
|
|
48
|
+
"timers/promises",
|
|
49
|
+
"url",
|
|
50
|
+
"util",
|
|
51
|
+
"zlib"
|
|
52
|
+
].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v6/nodejs-compat-v1")}`;
|
|
53
|
+
//#endregion
|
|
25
54
|
//#region src/openapi/common/authBindings.ts
|
|
26
55
|
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
27
56
|
function assertOpenApiAuthBindings(document) {
|
|
@@ -8550,6 +8579,18 @@ function checkJsonDepth(value, depth = 0) {
|
|
|
8550
8579
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
8551
8580
|
}
|
|
8552
8581
|
//#endregion
|
|
8582
|
+
//#region src/flow/common/retry.ts
|
|
8583
|
+
var nodeRetryLimits = {
|
|
8584
|
+
maxRetries: 5,
|
|
8585
|
+
minIntervalMs: 1e3,
|
|
8586
|
+
maxIntervalMs: 6e4,
|
|
8587
|
+
intervalStepMs: 1e3
|
|
8588
|
+
};
|
|
8589
|
+
var retryConfigurationSchema = strictObject({
|
|
8590
|
+
maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
|
|
8591
|
+
intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
|
|
8592
|
+
});
|
|
8593
|
+
//#endregion
|
|
8553
8594
|
//#region src/flow/common/triggerScheduleSchema.ts
|
|
8554
8595
|
var triggerScheduleSchema = array(union([object({
|
|
8555
8596
|
type: literal("cron"),
|
|
@@ -8598,6 +8639,7 @@ var source = union([object({
|
|
|
8598
8639
|
kind: literal("node"),
|
|
8599
8640
|
nodeId: text,
|
|
8600
8641
|
output: text,
|
|
8642
|
+
system: literal(true).optional(),
|
|
8601
8643
|
field: text.optional()
|
|
8602
8644
|
}), object({
|
|
8603
8645
|
kind: literal("binding"),
|
|
@@ -8856,7 +8898,9 @@ var base = {
|
|
|
8856
8898
|
name: text.optional(),
|
|
8857
8899
|
description: text.optional(),
|
|
8858
8900
|
icon: text.optional(),
|
|
8859
|
-
timeoutMs: number().optional()
|
|
8901
|
+
timeoutMs: number().optional(),
|
|
8902
|
+
retry: retryConfigurationSchema.optional(),
|
|
8903
|
+
onError: _enum(["stop", "error"]).optional()
|
|
8860
8904
|
};
|
|
8861
8905
|
var node = union([
|
|
8862
8906
|
strictObject({
|
|
@@ -8992,7 +9036,8 @@ var revision = object({
|
|
|
8992
9036
|
literal(5),
|
|
8993
9037
|
literal(6),
|
|
8994
9038
|
literal(7),
|
|
8995
|
-
literal(8)
|
|
9039
|
+
literal(8),
|
|
9040
|
+
literal(9)
|
|
8996
9041
|
]),
|
|
8997
9042
|
document,
|
|
8998
9043
|
modules: record$3(text, module)
|
|
@@ -9061,6 +9106,13 @@ var shapes = {
|
|
|
9061
9106
|
},
|
|
9062
9107
|
"graph.node.delete": at,
|
|
9063
9108
|
"graph.node.field.set": union([
|
|
9109
|
+
object({
|
|
9110
|
+
...at,
|
|
9111
|
+
kind: literal("graph.node.field.set"),
|
|
9112
|
+
field: literal("retry"),
|
|
9113
|
+
before: retryConfigurationSchema.optional(),
|
|
9114
|
+
value: retryConfigurationSchema.optional()
|
|
9115
|
+
}),
|
|
9064
9116
|
object({
|
|
9065
9117
|
...at,
|
|
9066
9118
|
kind: literal("graph.node.field.set"),
|
|
@@ -9074,7 +9126,8 @@ var shapes = {
|
|
|
9074
9126
|
field: _enum([
|
|
9075
9127
|
"description",
|
|
9076
9128
|
"icon",
|
|
9077
|
-
"name"
|
|
9129
|
+
"name",
|
|
9130
|
+
"onError"
|
|
9078
9131
|
]),
|
|
9079
9132
|
before: text.optional(),
|
|
9080
9133
|
value: text.optional()
|
|
@@ -9179,6 +9232,12 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9179
9232
|
...shape
|
|
9180
9233
|
})])).values()])).min(1);
|
|
9181
9234
|
function checkModelVersion(content) {
|
|
9235
|
+
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
|
|
9236
|
+
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
|
|
9237
|
+
if (candidateNode.onError != null) return true;
|
|
9238
|
+
if ([...Object.values("inputs" in candidateNode ? candidateNode.inputs : {}), ...Object.values(candidateNode.kind == "outputs" ? candidateNode.outputMappings : {})].some((candidateMapping) => candidateMapping.kind == "sources" && candidateMapping.sources.some((candidateSource) => candidateSource.kind == "node" && candidateSource.system))) return true;
|
|
9239
|
+
return candidateNode.kind == "condition" && candidateNode.cases.some((item) => item.groups.some((candidateGroup) => candidateGroup.expressions.some((expression) => [expression.left, expression.right].some((candidateOperand) => candidateOperand?.kind == "source" && candidateOperand.source.kind == "node" && candidateOperand.source.system))));
|
|
9240
|
+
})) throw new TypeError("Node error handling requires Flow model version 9.");
|
|
9182
9241
|
if (content.modelVersion < 8 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "outputs")) throw new TypeError("Workflow outputs require Flow model version 8.");
|
|
9183
9242
|
if (content.modelVersion < 7 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "start")) throw new TypeError("Start Triggers require Flow model version 7.");
|
|
9184
9243
|
if (content.modelVersion < 6 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task)) throw new TypeError("Node-owned managed Tasks require Flow model version 6.");
|
|
@@ -9215,10 +9274,10 @@ function upgradeRevisionContent(content) {
|
|
|
9215
9274
|
function upgradeDecodedRevisionContent(content) {
|
|
9216
9275
|
const graph = content.document.graph;
|
|
9217
9276
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9218
|
-
if (!hasManual && content.modelVersion ==
|
|
9277
|
+
if (!hasManual && content.modelVersion == 9) return content;
|
|
9219
9278
|
return {
|
|
9220
9279
|
...content,
|
|
9221
|
-
modelVersion:
|
|
9280
|
+
modelVersion: 9,
|
|
9222
9281
|
document: {
|
|
9223
9282
|
...content.document,
|
|
9224
9283
|
graph: hasManual ? {
|
|
@@ -9331,12 +9390,19 @@ var output = strictObject({
|
|
|
9331
9390
|
port: id$1.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
|
|
9332
9391
|
field: string$1().optional()
|
|
9333
9392
|
});
|
|
9393
|
+
var system = strictObject({
|
|
9394
|
+
kind: literal("system"),
|
|
9395
|
+
node: referenceSchema,
|
|
9396
|
+
port: literal("error"),
|
|
9397
|
+
field: string$1().optional()
|
|
9398
|
+
});
|
|
9334
9399
|
var variable$1 = strictObject({
|
|
9335
9400
|
kind: literal("variable"),
|
|
9336
9401
|
name: id$1
|
|
9337
9402
|
});
|
|
9338
9403
|
var authoringSourceSchema = union([
|
|
9339
9404
|
output,
|
|
9405
|
+
system,
|
|
9340
9406
|
variable$1,
|
|
9341
9407
|
strictObject({
|
|
9342
9408
|
kind: literal("value"),
|
|
@@ -9346,7 +9412,11 @@ var authoringSourceSchema = union([
|
|
|
9346
9412
|
strictObject({ kind: literal("default") }),
|
|
9347
9413
|
strictObject({
|
|
9348
9414
|
kind: literal("sources"),
|
|
9349
|
-
sources: array(union([
|
|
9415
|
+
sources: array(union([
|
|
9416
|
+
output,
|
|
9417
|
+
system,
|
|
9418
|
+
variable$1
|
|
9419
|
+
])).min(1)
|
|
9350
9420
|
})
|
|
9351
9421
|
]);
|
|
9352
9422
|
var operand = union([
|
|
@@ -9356,6 +9426,7 @@ var operand = union([
|
|
|
9356
9426
|
schema: json$2.optional()
|
|
9357
9427
|
}),
|
|
9358
9428
|
output,
|
|
9429
|
+
system,
|
|
9359
9430
|
variable$1
|
|
9360
9431
|
]);
|
|
9361
9432
|
var agentTool = authoringDefinitionSchemas.agent.shape.tools.element.omit({
|
|
@@ -9447,11 +9518,13 @@ var authoringConfigurations = {
|
|
|
9447
9518
|
approval: strictObject({ inputs: inputFields })
|
|
9448
9519
|
};
|
|
9449
9520
|
var updates = strictObject({
|
|
9521
|
+
onError: _enum(["stop", "error"]).optional(),
|
|
9450
9522
|
name: id$1.optional(),
|
|
9451
9523
|
description: string$1().optional(),
|
|
9452
9524
|
icon: string$1().optional(),
|
|
9453
9525
|
maxExecutions: int().positive().optional(),
|
|
9454
9526
|
timeoutMs: number().nonnegative().optional(),
|
|
9527
|
+
retry: retryConfigurationSchema.partial().optional().describe("Node retry policy for Code, Connector, OpenAPI, LLM and AI Decision. Omitted update fields preserve the policy; use clear: [[\"retry\"]] to disable it. maxRetries counts additional attempts; intervalMs is 1000–60000 in whole seconds."),
|
|
9455
9528
|
config: patch.optional().describe("Recursively merge configuration; omitted fields remain unchanged and arrays replace as a whole. This includes schema objects: {} does not clear an existing schema. Use clear paths to remove fields, e.g. [\"config\",\"inputs\",\"amount\",\"schema\",\"type\"].")
|
|
9456
9529
|
});
|
|
9457
9530
|
var authoringEditSchema = discriminatedUnion("op", [
|
|
@@ -9460,6 +9533,8 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
9460
9533
|
as: id$1.regex(/^[A-Za-z][\w-]*$/).describe("Unique batch-local alias without the $ prefix. Later edits must reference this new node as $alias; the bare alias is not its node ID."),
|
|
9461
9534
|
type,
|
|
9462
9535
|
name: id$1,
|
|
9536
|
+
onError: _enum(["stop", "error"]).optional(),
|
|
9537
|
+
retry: retryConfigurationSchema.optional(),
|
|
9463
9538
|
config: patch.optional(),
|
|
9464
9539
|
inputs: record$3(id$1, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
|
|
9465
9540
|
code: string$1().optional(),
|
|
@@ -10556,22 +10631,44 @@ function connectorProvider(value) {
|
|
|
10556
10631
|
//#endregion
|
|
10557
10632
|
//#region src/control/common/eventSources.ts
|
|
10558
10633
|
var id = string$1().min(1).max(256);
|
|
10559
|
-
var eventType = string$1().regex(/^[a-z][a-z0-9_
|
|
10634
|
+
var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
|
|
10560
10635
|
var name = string$1().trim().min(1).max(128);
|
|
10561
10636
|
var eventSourceSchema = object({
|
|
10562
10637
|
version: literal(1),
|
|
10563
10638
|
sourceId: id,
|
|
10564
10639
|
revision: int().positive(),
|
|
10565
10640
|
name,
|
|
10566
|
-
provider: _enum([
|
|
10567
|
-
|
|
10641
|
+
provider: _enum([
|
|
10642
|
+
"feishu",
|
|
10643
|
+
"feishu_app_bot",
|
|
10644
|
+
"slackbot",
|
|
10645
|
+
"intercom",
|
|
10646
|
+
"sentry",
|
|
10647
|
+
"zoom",
|
|
10648
|
+
"fireflies",
|
|
10649
|
+
"jira"
|
|
10650
|
+
]),
|
|
10651
|
+
appId: id.nullable(),
|
|
10652
|
+
workspaceId: id.optional(),
|
|
10653
|
+
installationId: id.optional(),
|
|
10654
|
+
organizationId: id.optional(),
|
|
10655
|
+
projectId: id.optional(),
|
|
10656
|
+
projectKey: id.optional(),
|
|
10657
|
+
subscriptionStatus: _enum([
|
|
10658
|
+
"idle",
|
|
10659
|
+
"pending",
|
|
10660
|
+
"ready",
|
|
10661
|
+
"error"
|
|
10662
|
+
]).optional(),
|
|
10663
|
+
lastError: string$1().optional(),
|
|
10664
|
+
signingSecretConfigured: boolean().optional(),
|
|
10568
10665
|
connectionId: id,
|
|
10569
10666
|
teamId: id.nullable(),
|
|
10570
10667
|
enabled: boolean(),
|
|
10571
10668
|
eventTypes: array(eventType),
|
|
10572
|
-
manageSubscriptions: boolean(),
|
|
10573
|
-
verificationTokenConfigured: boolean(),
|
|
10574
|
-
encryptKeyConfigured: boolean(),
|
|
10669
|
+
manageSubscriptions: boolean().nullable(),
|
|
10670
|
+
verificationTokenConfigured: boolean().nullable(),
|
|
10671
|
+
encryptKeyConfigured: boolean().nullable(),
|
|
10575
10672
|
endpointUrl: string$1().nullable(),
|
|
10576
10673
|
verifiedAt: string$1().nullable(),
|
|
10577
10674
|
lastReceivedAt: string$1().nullable(),
|
|
@@ -10582,6 +10679,21 @@ var eventSourceSchema = object({
|
|
|
10582
10679
|
triggerNodeId: id
|
|
10583
10680
|
}))
|
|
10584
10681
|
});
|
|
10682
|
+
eventSourceSchema.pick({
|
|
10683
|
+
appId: true,
|
|
10684
|
+
workspaceId: true,
|
|
10685
|
+
installationId: true,
|
|
10686
|
+
organizationId: true,
|
|
10687
|
+
projectId: true,
|
|
10688
|
+
projectKey: true,
|
|
10689
|
+
subscriptionStatus: true,
|
|
10690
|
+
lastError: true,
|
|
10691
|
+
signingSecretConfigured: true,
|
|
10692
|
+
manageSubscriptions: true,
|
|
10693
|
+
verificationTokenConfigured: true,
|
|
10694
|
+
encryptKeyConfigured: true,
|
|
10695
|
+
verifiedAt: true
|
|
10696
|
+
});
|
|
10585
10697
|
function decodeEventSource(value) {
|
|
10586
10698
|
return eventSourceSchema.parse(value);
|
|
10587
10699
|
}
|
|
@@ -11111,6 +11223,21 @@ function workflowIdentity(value) {
|
|
|
11111
11223
|
executionId: string(ref.executionId)
|
|
11112
11224
|
};
|
|
11113
11225
|
}
|
|
11226
|
+
function runInitiator(value) {
|
|
11227
|
+
const source = record$1(value);
|
|
11228
|
+
if (![
|
|
11229
|
+
"workbench",
|
|
11230
|
+
"cli",
|
|
11231
|
+
"mcp",
|
|
11232
|
+
"api",
|
|
11233
|
+
"trigger",
|
|
11234
|
+
"workflow"
|
|
11235
|
+
].includes(source.channel)) return invalidResponse();
|
|
11236
|
+
return {
|
|
11237
|
+
channel: source.channel,
|
|
11238
|
+
...source.actorId === void 0 ? {} : { actorId: string(source.actorId) }
|
|
11239
|
+
};
|
|
11240
|
+
}
|
|
11114
11241
|
function runDetails(value) {
|
|
11115
11242
|
const source = record$1(value);
|
|
11116
11243
|
const summary = run(source);
|
|
@@ -11132,6 +11259,7 @@ function runDetails(value) {
|
|
|
11132
11259
|
if (source.calls !== void 0 && !Array.isArray(source.calls)) return invalidResponse();
|
|
11133
11260
|
const details = {
|
|
11134
11261
|
...summary,
|
|
11262
|
+
...source.initiator === void 0 ? {} : { initiator: runInitiator(source.initiator) },
|
|
11135
11263
|
...errorHandling(source),
|
|
11136
11264
|
...source.triggerNodeId === void 0 ? {} : { triggerNodeId: string(source.triggerNodeId) },
|
|
11137
11265
|
...source.caller === void 0 ? {} : { caller: workflowIdentity(source.caller) },
|
|
@@ -11420,6 +11548,7 @@ function decodeRunEvent(value) {
|
|
|
11420
11548
|
kind,
|
|
11421
11549
|
payload: {
|
|
11422
11550
|
...node,
|
|
11551
|
+
...payload.systemOutputs === void 0 ? {} : { systemOutputs: Object.fromEntries(Object.entries(record$1(payload.systemOutputs)).map(([key, item]) => [key, jsonValue(item)])) },
|
|
11423
11552
|
outputs: Object.fromEntries(Object.entries(record$1(payload.outputs)).map(([key, item]) => [key, jsonValue(item)]))
|
|
11424
11553
|
}
|
|
11425
11554
|
};
|
|
@@ -11430,6 +11559,8 @@ function decodeRunEvent(value) {
|
|
|
11430
11559
|
kind,
|
|
11431
11560
|
payload: {
|
|
11432
11561
|
...node,
|
|
11562
|
+
...payload.handled === true ? { handled: true } : {},
|
|
11563
|
+
...payload.systemOutputs === void 0 ? {} : { systemOutputs: Object.fromEntries(Object.entries(record$1(payload.systemOutputs)).map(([key, item]) => [key, jsonValue(item)])) },
|
|
11433
11564
|
error: {
|
|
11434
11565
|
code: string(error.code),
|
|
11435
11566
|
message: string(error.message)
|
|
@@ -11509,7 +11640,8 @@ function operationKey(operation) {
|
|
|
11509
11640
|
return `${operation}-${randomId()}`;
|
|
11510
11641
|
}
|
|
11511
11642
|
var ControlClient = class {
|
|
11512
|
-
constructor(requestControl) {
|
|
11643
|
+
constructor(requestControl, channel = "api") {
|
|
11644
|
+
this.channel = channel;
|
|
11513
11645
|
this.requestControl = requestControl;
|
|
11514
11646
|
}
|
|
11515
11647
|
async loadOpenApiDocument(url, signal) {
|
|
@@ -11535,8 +11667,8 @@ var ControlClient = class {
|
|
|
11535
11667
|
async listEventSources(flowId, signal) {
|
|
11536
11668
|
return decodeEventSources(await this.request("/v1/event-sources" + (flowId == null ? "" : `?flowId=${segment(flowId)}`), { signal }));
|
|
11537
11669
|
}
|
|
11538
|
-
async listEventSourceConnections(teamId, signal) {
|
|
11539
|
-
const source = record$1(await this.request(`/v1/event-sources/connections${teamId == null ? "" :
|
|
11670
|
+
async listEventSourceConnections(teamId, signal, kind = "feishu") {
|
|
11671
|
+
const source = record$1(await this.request(`/v1/event-sources/connections?kind=${kind}${teamId == null ? "" : `&teamId=${segment(teamId)}`}`, { signal }));
|
|
11540
11672
|
requiredFields(source, ["version", "connections"]);
|
|
11541
11673
|
if (source.version != 1 || !Array.isArray(source.connections)) return invalidResponse();
|
|
11542
11674
|
return source.connections.map(connection);
|
|
@@ -11999,7 +12131,7 @@ var ControlClient = class {
|
|
|
11999
12131
|
async checkFlow(flowId, revisionId) {
|
|
12000
12132
|
return flowCheck(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/check`, {
|
|
12001
12133
|
body: JSON.stringify({
|
|
12002
|
-
engineContract:
|
|
12134
|
+
engineContract: currentEngineContract,
|
|
12003
12135
|
version: 1
|
|
12004
12136
|
}),
|
|
12005
12137
|
method: "POST"
|
|
@@ -12024,12 +12156,15 @@ var ControlClient = class {
|
|
|
12024
12156
|
async createDraftRun(flowId, revisionId, options) {
|
|
12025
12157
|
const created = runDetails(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/runs`, {
|
|
12026
12158
|
body: JSON.stringify({
|
|
12027
|
-
engineContract:
|
|
12159
|
+
engineContract: currentEngineContract,
|
|
12028
12160
|
inputs: options.inputs ?? {},
|
|
12029
12161
|
trigger: options.trigger,
|
|
12030
12162
|
version: 2
|
|
12031
12163
|
}),
|
|
12032
|
-
headers: {
|
|
12164
|
+
headers: {
|
|
12165
|
+
"idempotency-key": options.idempotencyKey ?? operationKey("run"),
|
|
12166
|
+
"x-open-flow-client": this.channel
|
|
12167
|
+
},
|
|
12033
12168
|
method: "POST"
|
|
12034
12169
|
}));
|
|
12035
12170
|
return created.source == "draft" ? created : invalidResponse();
|
|
@@ -12042,7 +12177,10 @@ var ControlClient = class {
|
|
|
12042
12177
|
publicationId,
|
|
12043
12178
|
version: 2
|
|
12044
12179
|
}),
|
|
12045
|
-
headers: {
|
|
12180
|
+
headers: {
|
|
12181
|
+
"idempotency-key": options.idempotencyKey ?? operationKey("run"),
|
|
12182
|
+
"x-open-flow-client": this.channel
|
|
12183
|
+
},
|
|
12046
12184
|
method: "POST"
|
|
12047
12185
|
}));
|
|
12048
12186
|
return created.source == "live" ? created : invalidResponse();
|
|
@@ -12060,7 +12198,7 @@ var ControlClient = class {
|
|
|
12060
12198
|
async publishFlow(flowId, revisionId, expectedLivePublicationId, options = {}) {
|
|
12061
12199
|
return publishOperation(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/publications`, {
|
|
12062
12200
|
body: JSON.stringify({
|
|
12063
|
-
engineContract:
|
|
12201
|
+
engineContract: currentEngineContract,
|
|
12064
12202
|
expectedLivePublicationId,
|
|
12065
12203
|
version: 1
|
|
12066
12204
|
}),
|
|
@@ -12177,7 +12315,6 @@ var ControlClient = class {
|
|
|
12177
12315
|
};
|
|
12178
12316
|
//#endregion
|
|
12179
12317
|
//#region src/control/common/conformance.ts
|
|
12180
|
-
var engineContract = "open-flow-engine/v5";
|
|
12181
12318
|
function fail(message) {
|
|
12182
12319
|
throw new Error(message);
|
|
12183
12320
|
}
|
|
@@ -12292,7 +12429,7 @@ function changedRevisionId(change, message) {
|
|
|
12292
12429
|
function publishRequest(harness, flowId, revisionId, expectedLivePublicationId, key) {
|
|
12293
12430
|
return request(harness, `/v1/flows/${encodeURIComponent(flowId)}/revisions/${encodeURIComponent(revisionId)}/publications`, {
|
|
12294
12431
|
body: JSON.stringify({
|
|
12295
|
-
engineContract,
|
|
12432
|
+
engineContract: currentEngineContract,
|
|
12296
12433
|
expectedLivePublicationId,
|
|
12297
12434
|
version: 1
|
|
12298
12435
|
}),
|
|
@@ -12535,7 +12672,7 @@ var controlApiConformanceCases = [
|
|
|
12535
12672
|
method: "POST",
|
|
12536
12673
|
headers: { "idempotency-key": key },
|
|
12537
12674
|
body: JSON.stringify({
|
|
12538
|
-
engineContract,
|
|
12675
|
+
engineContract: currentEngineContract,
|
|
12539
12676
|
inputs: {},
|
|
12540
12677
|
trigger: {
|
|
12541
12678
|
nodeId,
|
|
@@ -12588,7 +12725,7 @@ var controlApiConformanceCases = [
|
|
|
12588
12725
|
method: "POST",
|
|
12589
12726
|
headers: { "idempotency-key": "concurrent-run" },
|
|
12590
12727
|
body: JSON.stringify({
|
|
12591
|
-
engineContract,
|
|
12728
|
+
engineContract: currentEngineContract,
|
|
12592
12729
|
inputs: {},
|
|
12593
12730
|
trigger: {
|
|
12594
12731
|
nodeId: "start",
|
|
@@ -12932,7 +13069,7 @@ var controlApiConformanceCases = [
|
|
|
12932
13069
|
equal((await json(await request(harness, `${path}/check`, {
|
|
12933
13070
|
method: "POST",
|
|
12934
13071
|
body: JSON.stringify({
|
|
12935
|
-
engineContract,
|
|
13072
|
+
engineContract: currentEngineContract,
|
|
12936
13073
|
version: 1
|
|
12937
13074
|
})
|
|
12938
13075
|
}), 200, "Check entire Draft")).valid, false, "Entire Draft remains invalid");
|
|
@@ -12940,7 +13077,7 @@ var controlApiConformanceCases = [
|
|
|
12940
13077
|
method: "POST",
|
|
12941
13078
|
headers: { "idempotency-key": `partial-${nodeId}` },
|
|
12942
13079
|
body: JSON.stringify({
|
|
12943
|
-
engineContract,
|
|
13080
|
+
engineContract: currentEngineContract,
|
|
12944
13081
|
inputs: {},
|
|
12945
13082
|
trigger: {
|
|
12946
13083
|
nodeId,
|
|
@@ -12967,7 +13104,7 @@ var controlApiConformanceCases = [
|
|
|
12967
13104
|
const draftRevisionId = await addStartTrigger(harness, flowId, requiredString(flow.draftRevisionId, "Run Flow revisionId"));
|
|
12968
13105
|
equal((await json(await request(harness, `/v1/flows/${flowId}/revisions/${draftRevisionId}/check`, {
|
|
12969
13106
|
body: JSON.stringify({
|
|
12970
|
-
engineContract,
|
|
13107
|
+
engineContract: currentEngineContract,
|
|
12971
13108
|
version: 1
|
|
12972
13109
|
}),
|
|
12973
13110
|
method: "POST"
|
|
@@ -12985,7 +13122,7 @@ var controlApiConformanceCases = [
|
|
|
12985
13122
|
}
|
|
12986
13123
|
]) await error(await request(harness, runPath, {
|
|
12987
13124
|
body: JSON.stringify({
|
|
12988
|
-
engineContract,
|
|
13125
|
+
engineContract: currentEngineContract,
|
|
12989
13126
|
inputs: {},
|
|
12990
13127
|
trigger,
|
|
12991
13128
|
version: 2
|
|
@@ -12995,7 +13132,7 @@ var controlApiConformanceCases = [
|
|
|
12995
13132
|
}), 400, "run.invalid", "Reject invalid start node or payload");
|
|
12996
13133
|
const create = () => request(harness, runPath, {
|
|
12997
13134
|
body: JSON.stringify({
|
|
12998
|
-
engineContract,
|
|
13135
|
+
engineContract: currentEngineContract,
|
|
12999
13136
|
inputs: {},
|
|
13000
13137
|
trigger: {
|
|
13001
13138
|
nodeId: "start",
|
|
@@ -13011,7 +13148,7 @@ var controlApiConformanceCases = [
|
|
|
13011
13148
|
equal(await json(await create(), 200, "Replay Draft Run"), run, "Replayed Draft Run");
|
|
13012
13149
|
await error(await request(harness, runPath, {
|
|
13013
13150
|
body: JSON.stringify({
|
|
13014
|
-
engineContract,
|
|
13151
|
+
engineContract: currentEngineContract,
|
|
13015
13152
|
inputs: {},
|
|
13016
13153
|
trigger: {
|
|
13017
13154
|
nodeId: "another",
|
|
@@ -13025,7 +13162,7 @@ var controlApiConformanceCases = [
|
|
|
13025
13162
|
await error(await request(harness, `/v1/runs/${runId}/result`), 409, "run.not-terminal", "Read queued Run result");
|
|
13026
13163
|
const secondRunId = requiredString((await json(await request(harness, runPath, {
|
|
13027
13164
|
body: JSON.stringify({
|
|
13028
|
-
engineContract,
|
|
13165
|
+
engineContract: currentEngineContract,
|
|
13029
13166
|
inputs: {},
|
|
13030
13167
|
trigger: {
|
|
13031
13168
|
nodeId: "start",
|
|
@@ -13115,7 +13252,7 @@ var controlApiConformanceCases = [
|
|
|
13115
13252
|
}]), 200, "Create Wait"), "Wait Revision")}/runs`;
|
|
13116
13253
|
const create = async (key, message) => json(await request(harness, runPath, {
|
|
13117
13254
|
body: JSON.stringify({
|
|
13118
|
-
engineContract,
|
|
13255
|
+
engineContract: currentEngineContract,
|
|
13119
13256
|
inputs: {},
|
|
13120
13257
|
trigger: {
|
|
13121
13258
|
nodeId: "start",
|
|
@@ -13235,7 +13372,7 @@ var controlApiConformanceCases = [
|
|
|
13235
13372
|
method: "POST"
|
|
13236
13373
|
});
|
|
13237
13374
|
await error(await check(revisionId, "unsupported-engine/v1"), 409, "engine.unsupported", "Check unsupported Engine");
|
|
13238
|
-
await error(await check(missingRevision,
|
|
13375
|
+
await error(await check(missingRevision, currentEngineContract), 404, "flow.not-found", "Check missing Revision");
|
|
13239
13376
|
const run = (targetRevision, contract, key) => request(harness, `/v1/flows/${flowId}/revisions/${targetRevision}/runs`, {
|
|
13240
13377
|
body: JSON.stringify({
|
|
13241
13378
|
engineContract: contract,
|
|
@@ -13250,7 +13387,7 @@ var controlApiConformanceCases = [
|
|
|
13250
13387
|
method: "POST"
|
|
13251
13388
|
});
|
|
13252
13389
|
await error(await run(revisionId, "unsupported-engine/v1", "unsupported-run"), 409, "engine.unsupported", "Run unsupported Engine");
|
|
13253
|
-
await error(await run(missingRevision,
|
|
13390
|
+
await error(await run(missingRevision, currentEngineContract, "missing-revision-run"), 404, "flow.not-found", "Run missing Revision");
|
|
13254
13391
|
}
|
|
13255
13392
|
}
|
|
13256
13393
|
];
|
|
@@ -13288,7 +13425,7 @@ var publicationControlApiConformanceCases = [
|
|
|
13288
13425
|
method: "POST",
|
|
13289
13426
|
headers: { "idempotency-key": "disabled-draft" },
|
|
13290
13427
|
body: JSON.stringify({
|
|
13291
|
-
engineContract,
|
|
13428
|
+
engineContract: currentEngineContract,
|
|
13292
13429
|
inputs: {},
|
|
13293
13430
|
trigger: {
|
|
13294
13431
|
nodeId: "start",
|
|
@@ -13706,7 +13843,7 @@ function selectableConnectorAccessControlApiConformanceCases(fixture) {
|
|
|
13706
13843
|
const revisionId = await addStartTrigger(harness, flowId, requiredString(created.draftRevisionId, "Draft Revision ID"));
|
|
13707
13844
|
equal((await json(await request(harness, `/v1/flows/${flowId}/revisions/${revisionId}/runs`, {
|
|
13708
13845
|
body: JSON.stringify({
|
|
13709
|
-
engineContract,
|
|
13846
|
+
engineContract: currentEngineContract,
|
|
13710
13847
|
inputs: {},
|
|
13711
13848
|
trigger: {
|
|
13712
13849
|
nodeId: "start",
|
|
@@ -381,6 +381,11 @@ export interface PublicationPage {
|
|
|
381
381
|
readonly total?: number;
|
|
382
382
|
readonly version: 1;
|
|
383
383
|
}
|
|
384
|
+
export type RunChannel = 'workbench' | 'cli' | 'mcp' | 'api' | 'trigger' | 'workflow';
|
|
385
|
+
export interface RunInitiator {
|
|
386
|
+
readonly actorId?: string;
|
|
387
|
+
readonly channel: RunChannel;
|
|
388
|
+
}
|
|
384
389
|
export interface Run {
|
|
385
390
|
readonly createdAt: string;
|
|
386
391
|
readonly finishedAt?: string;
|
|
@@ -422,6 +427,7 @@ export interface WorkflowRunCall extends WorkflowCaller {
|
|
|
422
427
|
readonly status: RunStatus | null;
|
|
423
428
|
}
|
|
424
429
|
type RunDetailsBase = Run & {
|
|
430
|
+
readonly initiator?: RunInitiator;
|
|
425
431
|
readonly caller?: WorkflowCaller;
|
|
426
432
|
readonly calls?: readonly WorkflowRunCall[];
|
|
427
433
|
readonly triggerNodeId?: string;
|
|
@@ -514,12 +520,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
514
520
|
readonly sequence: number;
|
|
515
521
|
readonly kind: "run.queued";
|
|
516
522
|
readonly payload: {
|
|
523
|
+
nodeId?: undefined;
|
|
517
524
|
readonly flowId?: undefined;
|
|
518
525
|
readonly scopeId?: undefined;
|
|
519
526
|
readonly progress?: undefined;
|
|
520
527
|
readonly waitIds?: undefined;
|
|
521
528
|
readonly expiresAt?: undefined;
|
|
522
|
-
readonly nodeId?: undefined;
|
|
523
529
|
readonly waitingSince?: undefined;
|
|
524
530
|
readonly action?: undefined;
|
|
525
531
|
readonly comment?: undefined;
|
|
@@ -532,13 +538,13 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
532
538
|
readonly sequence: number;
|
|
533
539
|
readonly kind: "run.started";
|
|
534
540
|
readonly payload: {
|
|
541
|
+
nodeId?: undefined;
|
|
535
542
|
readonly flowId: string;
|
|
536
543
|
readonly scopeId: string;
|
|
537
544
|
readonly parentScopeId?: string | undefined;
|
|
538
545
|
readonly progress?: undefined;
|
|
539
546
|
readonly waitIds?: undefined;
|
|
540
547
|
readonly expiresAt?: undefined;
|
|
541
|
-
readonly nodeId?: undefined;
|
|
542
548
|
readonly waitingSince?: undefined;
|
|
543
549
|
readonly action?: undefined;
|
|
544
550
|
readonly comment?: undefined;
|
|
@@ -551,12 +557,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
551
557
|
readonly sequence: number;
|
|
552
558
|
readonly kind: "run.progress";
|
|
553
559
|
readonly payload: {
|
|
560
|
+
nodeId?: undefined;
|
|
554
561
|
readonly flowId: string;
|
|
555
562
|
readonly scopeId: string;
|
|
556
563
|
readonly progress: number;
|
|
557
564
|
readonly waitIds?: undefined;
|
|
558
565
|
readonly expiresAt?: undefined;
|
|
559
|
-
readonly nodeId?: undefined;
|
|
560
566
|
readonly waitingSince?: undefined;
|
|
561
567
|
readonly action?: undefined;
|
|
562
568
|
readonly comment?: undefined;
|
|
@@ -569,12 +575,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
569
575
|
readonly sequence: number;
|
|
570
576
|
readonly kind: "run.waiting";
|
|
571
577
|
readonly payload: {
|
|
578
|
+
nodeId?: undefined;
|
|
572
579
|
readonly flowId?: undefined;
|
|
573
580
|
readonly scopeId?: undefined;
|
|
574
581
|
readonly progress?: undefined;
|
|
575
582
|
readonly waitIds: string[];
|
|
576
583
|
readonly expiresAt?: undefined;
|
|
577
|
-
readonly nodeId?: undefined;
|
|
578
584
|
readonly waitingSince?: undefined;
|
|
579
585
|
readonly action?: undefined;
|
|
580
586
|
readonly comment?: undefined;
|
|
@@ -605,12 +611,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
605
611
|
readonly sequence: number;
|
|
606
612
|
readonly kind: "run.resolved";
|
|
607
613
|
readonly payload: {
|
|
614
|
+
nodeId?: undefined;
|
|
608
615
|
readonly flowId?: undefined;
|
|
609
616
|
readonly scopeId?: undefined;
|
|
610
617
|
readonly progress?: undefined;
|
|
611
618
|
readonly waitIds?: undefined;
|
|
612
619
|
readonly expiresAt?: undefined;
|
|
613
|
-
readonly nodeId?: undefined;
|
|
614
620
|
readonly waitingSince?: undefined;
|
|
615
621
|
readonly action: "approve" | "continue" | "reject";
|
|
616
622
|
readonly comment: string | null;
|
|
@@ -623,12 +629,12 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
623
629
|
readonly sequence: number;
|
|
624
630
|
readonly kind: "run.canceled" | "run.completed" | "run.failed" | "run.indeterminate";
|
|
625
631
|
readonly payload: {
|
|
632
|
+
nodeId?: undefined;
|
|
626
633
|
readonly flowId?: undefined;
|
|
627
634
|
readonly scopeId?: undefined;
|
|
628
635
|
readonly progress?: undefined;
|
|
629
636
|
readonly waitIds?: undefined;
|
|
630
637
|
readonly expiresAt?: undefined;
|
|
631
|
-
readonly nodeId?: undefined;
|
|
632
638
|
readonly waitingSince?: undefined;
|
|
633
639
|
readonly action?: undefined;
|
|
634
640
|
readonly comment?: undefined;
|
|
@@ -683,6 +689,9 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
683
689
|
readonly scopeId: string;
|
|
684
690
|
readonly nodeId: string;
|
|
685
691
|
readonly executionId: string;
|
|
692
|
+
readonly systemOutputs?: {
|
|
693
|
+
[k: string]: JsonValue;
|
|
694
|
+
} | undefined;
|
|
686
695
|
readonly outputs: {
|
|
687
696
|
[k: string]: JsonValue;
|
|
688
697
|
};
|
|
@@ -705,6 +714,10 @@ export declare function decodeRunEvent(value: unknown): {
|
|
|
705
714
|
readonly scopeId: string;
|
|
706
715
|
readonly nodeId: string;
|
|
707
716
|
readonly executionId: string;
|
|
717
|
+
readonly handled?: true | undefined;
|
|
718
|
+
readonly systemOutputs?: {
|
|
719
|
+
[k: string]: JsonValue;
|
|
720
|
+
} | undefined;
|
|
708
721
|
readonly error: {
|
|
709
722
|
readonly code: string;
|
|
710
723
|
readonly message: string;
|
|
@@ -788,7 +801,8 @@ export type ConditionalResult<T> = {
|
|
|
788
801
|
};
|
|
789
802
|
export declare class ControlClient {
|
|
790
803
|
private readonly requestControl;
|
|
791
|
-
|
|
804
|
+
private readonly channel;
|
|
805
|
+
constructor(requestControl: ControlRequest, channel?: 'workbench' | 'cli' | 'api');
|
|
792
806
|
loadOpenApiDocument(url: string, signal?: AbortSignal): Promise<JsonValue>;
|
|
793
807
|
listFlows(options?: {
|
|
794
808
|
readonly cursor?: string;
|
|
@@ -801,7 +815,7 @@ export declare class ControlClient {
|
|
|
801
815
|
readonly sources: readonly EventSource[];
|
|
802
816
|
readonly teamId?: string | null;
|
|
803
817
|
}>;
|
|
804
|
-
listEventSourceConnections(teamId: string | null, signal?: AbortSignal): Promise<readonly ConnectorConnection[]>;
|
|
818
|
+
listEventSourceConnections(teamId: string | null, signal?: AbortSignal, kind?: 'feishu' | 'slack' | 'intercom' | 'sentry' | 'zoom' | 'fireflies' | 'jira'): Promise<readonly ConnectorConnection[]>;
|
|
805
819
|
createEventSource(input: CreateEventSource): Promise<EventSource>;
|
|
806
820
|
updateEventSource(sourceId: string, input: UpdateEventSource): Promise<EventSource>;
|
|
807
821
|
deleteEventSource(sourceId: string, expectedRevision: number): Promise<void>;
|