@oomol-lab/open-flow 0.1.0-beta.65 → 0.1.0-beta.67
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/{createResourceDialog-BAJXbzNH.js → createResourceDialog-BQVD8Rqb.js} +2 -2
- package/dist/browser/{icons-Db2Jb2iX.js → dialog-CS2Vt2if.js} +5736 -5621
- package/dist/browser/event-sources.d.ts +4 -1
- package/dist/browser/flow-authoring-node.d.ts +14 -3
- package/dist/browser/flow-authoring.js +120 -24
- package/dist/browser/flow-change-schema.d.ts +3 -1
- package/dist/browser/flow-change.d.ts +15 -3
- package/dist/browser/flow-change.js +117 -21
- package/dist/browser/{flowChanges-DkvG5uDq.js → flowChanges-VB9Y4iy7.js} +3423 -2380
- package/dist/browser/{flowRunInputEditorStore-B2Rw4VsT.js → flowRunInputEditorStore-DJqmR6Qh.js} +3 -2
- package/dist/browser/{flowWorkspace-BEp-lxqF.js → flowWorkspace-C1hlTnZq.js} +1410 -799
- package/dist/browser/preview.css +273 -119
- package/dist/browser/preview.js +17118 -15810
- package/dist/browser/theme.css +1 -0
- package/dist/browser/ui.css +119 -7
- package/dist/browser/ui.js +8 -5
- package/dist/browser/workbench-contract.d.ts +1 -1
- package/dist/browser/workbench.css +282 -162
- package/dist/browser/workbench.d.ts +0 -1
- package/dist/browser/workbench.js +503 -173
- package/dist/browser/{workbenchSelect-C-jf6NIM.js → workbenchSelect-CpXhjUou.js} +1 -1
- package/dist/command/index.js +49 -49
- package/dist/common/authoring.d.ts +7 -5
- package/dist/common/authoringExamples.d.ts +4 -4
- package/dist/common/authoringFields.d.ts +20 -0
- package/dist/common/authoringSchema.d.ts +404 -15
- package/dist/common/control-api-conformance.js +415 -146
- package/dist/common/control-api.d.ts +67 -8
- package/dist/common/control-api.js +3587 -3443
- package/dist/common/control-requests.d.ts +10 -3
- package/dist/common/control-requests.js +425 -49
- package/dist/common/decision.js +33 -7
- package/dist/common/flow-encoding.d.ts +4 -2
- package/dist/common/flow-encoding.js +151 -14
- package/dist/common/flow-graph.d.ts +1 -1
- package/dist/common/flow-semantics.d.ts +12 -2
- package/dist/common/flow-semantics.js +157 -41
- package/dist/common/integration-trigger.js +33 -7
- package/dist/common/liveDetails.d.ts +26 -11
- package/dist/common/mcp.d.ts +6 -3
- package/dist/common/mcp.js +219 -90
- package/dist/common/openapi.js +33 -7
- package/dist/common/poll-trigger.js +33 -7
- package/dist/common/run-events.d.ts +2 -0
- package/dist/common/run-events.js +9 -3
- package/dist/common/scheduler.d.ts +10 -1
- package/dist/common/scheduler.js +172 -49
- package/dist/common/trigger-contract.d.ts +2 -0
- package/dist/common/webhook-trigger.js +33 -7
- package/dist/common/workflow.d.ts +93 -0
- package/dist/common/workflow.js +10492 -0
- package/package.json +5 -1
- package/skills/open-flow/SKILL.md +9 -0
- package/skills/open-flow/references/flow-authoring.md +28 -16
package/dist/common/mcp.js
CHANGED
|
@@ -6037,6 +6037,7 @@ function webhookSupportsBody(method) {
|
|
|
6037
6037
|
return method !== "GET";
|
|
6038
6038
|
}
|
|
6039
6039
|
var text = string$1();
|
|
6040
|
+
var actionConnection = text.describe("Account selection: omit while unconfigured; use an account ID to select it; use \"\" to explicitly defer configuration. Deferred Actions fail if called; deferred Agent tools are excluded from the callable tool set. Not supported by Triggers.");
|
|
6040
6041
|
var json$3 = json$4();
|
|
6041
6042
|
var strings$1 = array(text);
|
|
6042
6043
|
var port$1 = object({
|
|
@@ -6045,6 +6046,7 @@ var port$1 = object({
|
|
|
6045
6046
|
nullable: boolean(),
|
|
6046
6047
|
handle: text
|
|
6047
6048
|
});
|
|
6049
|
+
var workflowInputDefs = array(port$1.strict());
|
|
6048
6050
|
var input = port$1.extend({ value: json$3.optional() });
|
|
6049
6051
|
var group = object({
|
|
6050
6052
|
collapsed: boolean().optional(),
|
|
@@ -6091,7 +6093,7 @@ var capability = union([
|
|
|
6091
6093
|
mode: literal("independent"),
|
|
6092
6094
|
actions: array(strictObject({
|
|
6093
6095
|
action: text,
|
|
6094
|
-
connectionId:
|
|
6096
|
+
connectionId: actionConnection.optional()
|
|
6095
6097
|
}))
|
|
6096
6098
|
}),
|
|
6097
6099
|
strictObject({
|
|
@@ -6151,7 +6153,7 @@ var managedFields = object({
|
|
|
6151
6153
|
object({
|
|
6152
6154
|
kind: literal("connector"),
|
|
6153
6155
|
action: text,
|
|
6154
|
-
connectionId:
|
|
6156
|
+
connectionId: actionConnection.optional(),
|
|
6155
6157
|
outputMode: literal("value").optional()
|
|
6156
6158
|
}),
|
|
6157
6159
|
object({
|
|
@@ -6191,17 +6193,22 @@ var managedFields = object({
|
|
|
6191
6193
|
name: text,
|
|
6192
6194
|
description: text,
|
|
6193
6195
|
action: text,
|
|
6194
|
-
connectionId:
|
|
6196
|
+
connectionId: actionConnection.optional(),
|
|
6195
6197
|
approval: boolean(),
|
|
6196
6198
|
inputs: array(input.extend({ source: agentInput }))
|
|
6197
6199
|
})),
|
|
6198
6200
|
notification: object({
|
|
6199
6201
|
action: text,
|
|
6200
|
-
connectionId:
|
|
6202
|
+
connectionId: actionConnection.optional(),
|
|
6201
6203
|
inputDefinitions: array(input),
|
|
6202
6204
|
messageHandle: text,
|
|
6203
6205
|
inputs: record$2(text, agentValue)
|
|
6204
6206
|
}).optional()
|
|
6207
|
+
}),
|
|
6208
|
+
strictObject({
|
|
6209
|
+
kind: literal("workflow"),
|
|
6210
|
+
flowId: text,
|
|
6211
|
+
revisionId: text
|
|
6205
6212
|
})
|
|
6206
6213
|
])
|
|
6207
6214
|
});
|
|
@@ -6310,6 +6317,12 @@ var base = {
|
|
|
6310
6317
|
timeoutMs: number().optional()
|
|
6311
6318
|
};
|
|
6312
6319
|
var node = union([
|
|
6320
|
+
strictObject({
|
|
6321
|
+
...base,
|
|
6322
|
+
kind: literal("outputs"),
|
|
6323
|
+
outputDefs: array(port$1.strict()),
|
|
6324
|
+
outputMappings: inputs
|
|
6325
|
+
}).omit({ inputs: true }),
|
|
6313
6326
|
object({
|
|
6314
6327
|
...base,
|
|
6315
6328
|
inputs: record$2(text, never()),
|
|
@@ -6342,6 +6355,11 @@ var node = union([
|
|
|
6342
6355
|
...trigger,
|
|
6343
6356
|
kind: literal("manual")
|
|
6344
6357
|
}),
|
|
6358
|
+
strictObject({
|
|
6359
|
+
...trigger,
|
|
6360
|
+
kind: literal("start"),
|
|
6361
|
+
inputDefs: workflowInputDefs
|
|
6362
|
+
}),
|
|
6345
6363
|
strictObject({
|
|
6346
6364
|
...trigger,
|
|
6347
6365
|
kind: literal("error"),
|
|
@@ -6421,7 +6439,7 @@ var module = object({
|
|
|
6421
6439
|
imports: strings$1,
|
|
6422
6440
|
source: text
|
|
6423
6441
|
});
|
|
6424
|
-
var document = preprocess(
|
|
6442
|
+
var document = preprocess(normalizeDocument, object({
|
|
6425
6443
|
bindings: record$2(text, binding$1),
|
|
6426
6444
|
graph
|
|
6427
6445
|
}));
|
|
@@ -6430,7 +6448,9 @@ var revision = object({
|
|
|
6430
6448
|
literal(2),
|
|
6431
6449
|
literal(4),
|
|
6432
6450
|
literal(5),
|
|
6433
|
-
literal(6)
|
|
6451
|
+
literal(6),
|
|
6452
|
+
literal(7),
|
|
6453
|
+
literal(8)
|
|
6434
6454
|
]),
|
|
6435
6455
|
document,
|
|
6436
6456
|
modules: record$2(text, module)
|
|
@@ -6439,13 +6459,19 @@ revision.extend({
|
|
|
6439
6459
|
kind: literal("open-flow-flow-revision"),
|
|
6440
6460
|
version: literal(1)
|
|
6441
6461
|
});
|
|
6442
|
-
function
|
|
6462
|
+
function normalizeDocument(value) {
|
|
6443
6463
|
const candidate = record$1(value);
|
|
6444
6464
|
if (candidate.tasks !== void 0 && (candidate.tasks === null || typeof candidate.tasks !== "object" || Array.isArray(candidate.tasks) || Object.keys(candidate.tasks).length > 0)) throw new TypeError("Independent Task definitions are no longer supported.");
|
|
6445
6465
|
if (Object.values(record$1(record$1(candidate.graph).nodes)).some((candidateNode) => Object.hasOwn(record$1(candidateNode), "taskId"))) throw new TypeError("Task references are no longer supported.");
|
|
6446
6466
|
const subflows = candidate.subflows;
|
|
6447
6467
|
if (subflows !== void 0 && (subflows === null || typeof subflows !== "object" || Array.isArray(subflows) || Object.keys(subflows).length > 0)) throw new TypeError("Subflows are no longer supported.");
|
|
6448
6468
|
if (Object.values(record$1(record$1(candidate.graph).nodes)).some((candidateNode) => record$1(candidateNode).kind === "subflow")) throw new TypeError("Subflow nodes are no longer supported.");
|
|
6469
|
+
if ([
|
|
6470
|
+
"inputDefs",
|
|
6471
|
+
"outputDefs",
|
|
6472
|
+
"outputMappings"
|
|
6473
|
+
].some((field) => Object.hasOwn(candidate, field))) throw new TypeError("Workflow interface configuration must belong to Start and Outputs nodes.");
|
|
6474
|
+
if (Object.values(record$1(record$1(candidate.graph).nodes)).some((candidateNode) => record$1(candidateNode).kind == "start" && Object.hasOwn(record$1(candidateNode), "parameters"))) throw new TypeError("Legacy Start.parameters is unsupported; configure node.inputDefs.");
|
|
6449
6475
|
return value;
|
|
6450
6476
|
}
|
|
6451
6477
|
function record$1(value) {
|
|
@@ -6611,6 +6637,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
6611
6637
|
...shape
|
|
6612
6638
|
})])).values()])).min(1);
|
|
6613
6639
|
function checkModelVersion(content) {
|
|
6640
|
+
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.");
|
|
6641
|
+
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.");
|
|
6614
6642
|
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.");
|
|
6615
6643
|
if (content.modelVersion < 5 && Object.values(content.document.graph.nodes).some((itemNode) => itemNode.kind == "error")) throw new TypeError("Error workflows require Flow model version 5.");
|
|
6616
6644
|
}
|
|
@@ -9440,7 +9468,9 @@ var id$2 = string$1().min(1);
|
|
|
9440
9468
|
var json$2 = json$4();
|
|
9441
9469
|
var patch = record$2(id$2, json$2);
|
|
9442
9470
|
var type = _enum([
|
|
9443
|
-
"
|
|
9471
|
+
"start",
|
|
9472
|
+
"outputs",
|
|
9473
|
+
"workflow",
|
|
9444
9474
|
"webhook",
|
|
9445
9475
|
"cron",
|
|
9446
9476
|
"error",
|
|
@@ -9512,6 +9542,12 @@ var field = strictObject({
|
|
|
9512
9542
|
description: string$1().optional()
|
|
9513
9543
|
});
|
|
9514
9544
|
var inputFields = record$2(id$2, field.extend({ default: json$2.optional() })).describe("Optional business input constraints by name. A binding to a new Code, Agent, LLM, Wait or Approval input automatically declares an input accepting any JSON. Existing constraints are preserved. Omitted schema accepts any JSON; omitted nullable is true. Use default for inherited values; input.set supplies data.");
|
|
9545
|
+
var flowInputFields = record$2(id$2, field).describe("Workflow input definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Supply call values as trigger.outputs.");
|
|
9546
|
+
var flowOutputFields = flowInputFields.describe("Workflow output definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Set values on the Outputs node with input.set or node.add.inputs.");
|
|
9547
|
+
var flowInputFieldsView = record$2(id$2, field.extend({
|
|
9548
|
+
schema: json$2,
|
|
9549
|
+
nullable: boolean()
|
|
9550
|
+
}));
|
|
9515
9551
|
var outputFields = record$2(id$2, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
|
|
9516
9552
|
var expression = strictObject({
|
|
9517
9553
|
left: operand,
|
|
@@ -9525,7 +9561,9 @@ var when = union([
|
|
|
9525
9561
|
strictObject({ any: array(union([expression, all])) })
|
|
9526
9562
|
]);
|
|
9527
9563
|
var authoringConfigurations = {
|
|
9528
|
-
|
|
9564
|
+
workflow: strictObject({ flowId: id$2 }),
|
|
9565
|
+
start: strictObject({ inputDefs: flowInputFields.default({}) }),
|
|
9566
|
+
outputs: strictObject({ outputDefs: flowOutputFields.default({}) }),
|
|
9529
9567
|
error: strictObject({ sourceFlowIds: array(id$2).optional() }),
|
|
9530
9568
|
webhook: authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
|
|
9531
9569
|
cron: strictObject({ schedule: authoringDefinitionSchemas.schedule }),
|
|
@@ -9596,6 +9634,10 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
9596
9634
|
set: updates.optional(),
|
|
9597
9635
|
clear: array(array(id$2).min(1)).optional()
|
|
9598
9636
|
}),
|
|
9637
|
+
strictObject({
|
|
9638
|
+
op: literal("node.refresh"),
|
|
9639
|
+
node: referenceSchema
|
|
9640
|
+
}),
|
|
9599
9641
|
strictObject({
|
|
9600
9642
|
op: literal("node.remove"),
|
|
9601
9643
|
node: referenceSchema
|
|
@@ -9706,7 +9748,7 @@ var authoringSearchResponse = object({
|
|
|
9706
9748
|
revision: id$2,
|
|
9707
9749
|
data: object({
|
|
9708
9750
|
matches: array(object({
|
|
9709
|
-
node: id$2,
|
|
9751
|
+
node: id$2.optional(),
|
|
9710
9752
|
field: id$2,
|
|
9711
9753
|
line: int().optional(),
|
|
9712
9754
|
excerpt: string$1()
|
|
@@ -9725,6 +9767,43 @@ var resultQuerySchema = strictObject({
|
|
|
9725
9767
|
maxBytes: number().int().min(1).max(1048576).default(15e3)
|
|
9726
9768
|
});
|
|
9727
9769
|
//#endregion
|
|
9770
|
+
//#region src/workflow/common/workflow.ts
|
|
9771
|
+
var portSchema = object({
|
|
9772
|
+
handle: string$1().min(1),
|
|
9773
|
+
jsonSchema: json$4(),
|
|
9774
|
+
nullable: boolean(),
|
|
9775
|
+
description: string$1().optional()
|
|
9776
|
+
});
|
|
9777
|
+
strictObject({
|
|
9778
|
+
inputs: array(portSchema).nullable(),
|
|
9779
|
+
outputs: array(portSchema).nullable()
|
|
9780
|
+
});
|
|
9781
|
+
var workflowContractSchema = object({
|
|
9782
|
+
version: literal(1),
|
|
9783
|
+
flowId: string$1().min(1),
|
|
9784
|
+
name: string$1(),
|
|
9785
|
+
revisionId: string$1().min(1),
|
|
9786
|
+
publicationId: string$1().min(1),
|
|
9787
|
+
inputs: array(portSchema),
|
|
9788
|
+
outputs: array(portSchema).nullable()
|
|
9789
|
+
});
|
|
9790
|
+
var workflowReferencesSchema = object({
|
|
9791
|
+
version: literal(1),
|
|
9792
|
+
direction: _enum(["incoming", "outgoing"]),
|
|
9793
|
+
total: int().nonnegative(),
|
|
9794
|
+
nextOffset: int().nonnegative().optional(),
|
|
9795
|
+
references: array(object({
|
|
9796
|
+
flowId: string$1(),
|
|
9797
|
+
name: string$1().nullable(),
|
|
9798
|
+
available: boolean(),
|
|
9799
|
+
draft: boolean(),
|
|
9800
|
+
live: object({
|
|
9801
|
+
publicationId: string$1(),
|
|
9802
|
+
enabled: boolean()
|
|
9803
|
+
}).nullable()
|
|
9804
|
+
}))
|
|
9805
|
+
});
|
|
9806
|
+
//#endregion
|
|
9728
9807
|
//#region src/control/common/errors.ts
|
|
9729
9808
|
var controlErrorCode = {
|
|
9730
9809
|
authenticationRequired: "authentication.required",
|
|
@@ -9802,6 +9881,10 @@ function record(value) {
|
|
|
9802
9881
|
function string(value) {
|
|
9803
9882
|
return typeof value == "string" && value.length > 0 ? value : invalidResponse("Expected a non-empty string.");
|
|
9804
9883
|
}
|
|
9884
|
+
function requiredFields(value, keys) {
|
|
9885
|
+
const missing = keys.filter((key) => !Object.hasOwn(value, key));
|
|
9886
|
+
if (missing.length > 0) invalidResponse(`Missing fields: ${missing.join(", ")}.`);
|
|
9887
|
+
}
|
|
9805
9888
|
function exact(value, keys) {
|
|
9806
9889
|
const actual = Object.keys(value);
|
|
9807
9890
|
if (actual.length != keys.length || actual.some((key) => !keys.includes(key))) {
|
|
@@ -9869,7 +9952,7 @@ function publishOperation(value) {
|
|
|
9869
9952
|
if (source.version != 1) return invalidResponse();
|
|
9870
9953
|
switch (status) {
|
|
9871
9954
|
case "pending":
|
|
9872
|
-
|
|
9955
|
+
requiredFields(source, [
|
|
9873
9956
|
"createdAt",
|
|
9874
9957
|
"flowId",
|
|
9875
9958
|
"operationId",
|
|
@@ -9883,7 +9966,7 @@ function publishOperation(value) {
|
|
|
9883
9966
|
status
|
|
9884
9967
|
};
|
|
9885
9968
|
case "succeeded":
|
|
9886
|
-
|
|
9969
|
+
requiredFields(source, [
|
|
9887
9970
|
"createdAt",
|
|
9888
9971
|
"flowId",
|
|
9889
9972
|
"operationId",
|
|
@@ -9899,7 +9982,7 @@ function publishOperation(value) {
|
|
|
9899
9982
|
status
|
|
9900
9983
|
};
|
|
9901
9984
|
case "failed": {
|
|
9902
|
-
|
|
9985
|
+
requiredFields(source, [
|
|
9903
9986
|
"createdAt",
|
|
9904
9987
|
"flowId",
|
|
9905
9988
|
"issue",
|
|
@@ -9911,7 +9994,7 @@ function publishOperation(value) {
|
|
|
9911
9994
|
]);
|
|
9912
9995
|
const issue = record(source.issue);
|
|
9913
9996
|
const nodeId = issue.nodeId;
|
|
9914
|
-
|
|
9997
|
+
requiredFields(issue, [
|
|
9915
9998
|
"code",
|
|
9916
9999
|
"message",
|
|
9917
10000
|
...nodeId == null ? [] : ["nodeId"]
|
|
@@ -10152,43 +10235,48 @@ var metadata = {
|
|
|
10152
10235
|
var binding = unknown().transform(triggerBinding);
|
|
10153
10236
|
var provider = {
|
|
10154
10237
|
provider: string$1().min(1),
|
|
10155
|
-
inputs: record$2(string$1(), discriminatedUnion("kind", [
|
|
10238
|
+
inputs: record$2(string$1(), discriminatedUnion("kind", [object({
|
|
10156
10239
|
kind: literal("value"),
|
|
10157
10240
|
value: json$4()
|
|
10158
|
-
}),
|
|
10241
|
+
}), object({ kind: literal("unset") })]))
|
|
10159
10242
|
};
|
|
10160
10243
|
var entrySchema = discriminatedUnion("type", [
|
|
10161
|
-
|
|
10244
|
+
object({
|
|
10245
|
+
...metadata,
|
|
10246
|
+
type: literal("start"),
|
|
10247
|
+
config: authoringConfigurations.start
|
|
10248
|
+
}),
|
|
10249
|
+
object({
|
|
10162
10250
|
...metadata,
|
|
10163
10251
|
type: literal("manual"),
|
|
10164
|
-
config:
|
|
10252
|
+
config: object({})
|
|
10165
10253
|
}),
|
|
10166
|
-
|
|
10254
|
+
object({
|
|
10167
10255
|
...metadata,
|
|
10168
10256
|
type: literal("webhook"),
|
|
10169
10257
|
config: authoringConfigurations.webhook,
|
|
10170
10258
|
binding
|
|
10171
10259
|
}),
|
|
10172
|
-
|
|
10260
|
+
object({
|
|
10173
10261
|
...metadata,
|
|
10174
10262
|
type: literal("cron"),
|
|
10175
10263
|
config: authoringConfigurations.cron,
|
|
10176
10264
|
binding
|
|
10177
10265
|
}),
|
|
10178
|
-
|
|
10266
|
+
object({
|
|
10179
10267
|
...metadata,
|
|
10180
10268
|
type: literal("error"),
|
|
10181
10269
|
config: authoringConfigurations.error,
|
|
10182
10270
|
binding
|
|
10183
10271
|
}),
|
|
10184
|
-
|
|
10272
|
+
object({
|
|
10185
10273
|
...metadata,
|
|
10186
10274
|
...provider,
|
|
10187
10275
|
type: literal("poll"),
|
|
10188
10276
|
config: authoringConfigurations.poll,
|
|
10189
10277
|
binding
|
|
10190
10278
|
}),
|
|
10191
|
-
|
|
10279
|
+
object({
|
|
10192
10280
|
...metadata,
|
|
10193
10281
|
...provider,
|
|
10194
10282
|
type: literal("integration"),
|
|
@@ -10201,9 +10289,10 @@ function decodeLiveDetails(value) {
|
|
|
10201
10289
|
const flowId = string(source.flowId);
|
|
10202
10290
|
if (source.version != 1 || !Array.isArray(source.entries)) return invalidResponse();
|
|
10203
10291
|
if (source.publication === null) {
|
|
10204
|
-
if (source.status != "not-published" || source.entries.length != 0 || Object.hasOwn(source, "enabled")) return invalidResponse();
|
|
10292
|
+
if (source.inputDefs !== null || source.status != "not-published" || source.entries.length != 0 || Object.hasOwn(source, "enabled")) return invalidResponse();
|
|
10205
10293
|
return {
|
|
10206
10294
|
flowId,
|
|
10295
|
+
inputDefs: null,
|
|
10207
10296
|
publication: null,
|
|
10208
10297
|
status: "not-published",
|
|
10209
10298
|
entries: [],
|
|
@@ -10215,8 +10304,11 @@ function decodeLiveDetails(value) {
|
|
|
10215
10304
|
if (current.flowId != flowId || typeof source.enabled != "boolean") return invalidResponse();
|
|
10216
10305
|
if (status != "runnable" && status != "suspended") return invalidResponse();
|
|
10217
10306
|
if (!source.enabled && source.status == "runnable") return invalidResponse();
|
|
10307
|
+
const inputDefs = flowInputFieldsView.safeParse(source.inputDefs);
|
|
10308
|
+
if (!inputDefs.success) return invalidResponse();
|
|
10218
10309
|
return {
|
|
10219
10310
|
flowId,
|
|
10311
|
+
inputDefs: inputDefs.data,
|
|
10220
10312
|
publication: current,
|
|
10221
10313
|
status,
|
|
10222
10314
|
enabled: source.enabled,
|
|
@@ -10232,7 +10324,7 @@ function decodeEntries(values, current) {
|
|
|
10232
10324
|
for (const entry of parsed.data) {
|
|
10233
10325
|
if (ids.has(entry.nodeId)) return invalidResponse();
|
|
10234
10326
|
ids.add(entry.nodeId);
|
|
10235
|
-
if (entry.type != "manual" && (entry.binding.flowId != current.flowId || entry.binding.triggerNodeId != entry.nodeId || entry.binding.kind != entry.type || entry.binding.currentPublicationId != current.publicationId || entry.binding.currentRevisionId != current.revisionId)) return invalidResponse();
|
|
10327
|
+
if (entry.type != "start" && entry.type != "manual" && (entry.binding.flowId != current.flowId || entry.binding.triggerNodeId != entry.nodeId || entry.binding.kind != entry.type || entry.binding.currentPublicationId != current.publicationId || entry.binding.currentRevisionId != current.revisionId)) return invalidResponse();
|
|
10236
10328
|
if (entry.type == "webhook" && (!entry.binding.endpointUrl || !webhookSupportsBody(entry.config.method) && Object.keys(entry.config.body).length > 0)) return invalidResponse();
|
|
10237
10329
|
}
|
|
10238
10330
|
return parsed.data;
|
|
@@ -10545,7 +10637,7 @@ function connectorAccessCandidatesBatch(value, providerIds) {
|
|
|
10545
10637
|
}
|
|
10546
10638
|
function connection(value) {
|
|
10547
10639
|
const source = record(value);
|
|
10548
|
-
|
|
10640
|
+
requiredFields(source, [
|
|
10549
10641
|
...Object.hasOwn(source, "providerAccountId") ? ["providerAccountId"] : [],
|
|
10550
10642
|
...Object.hasOwn(source, "alias") ? ["alias"] : [],
|
|
10551
10643
|
...Object.hasOwn(source, "builtInAccount") ? ["builtInAccount"] : [],
|
|
@@ -10574,7 +10666,7 @@ function port(value, input = false) {
|
|
|
10574
10666
|
const source = record(value);
|
|
10575
10667
|
const description = source.description;
|
|
10576
10668
|
const hasValue = input && Object.hasOwn(source, "value");
|
|
10577
|
-
|
|
10669
|
+
requiredFields(source, [
|
|
10578
10670
|
"jsonSchema",
|
|
10579
10671
|
"nullable",
|
|
10580
10672
|
...description == null ? [] : ["description"],
|
|
@@ -10599,7 +10691,7 @@ function connectorActionMetadata(value) {
|
|
|
10599
10691
|
const source = record(value);
|
|
10600
10692
|
const homepageUrl = source.homepageUrl;
|
|
10601
10693
|
const icon = source.icon;
|
|
10602
|
-
|
|
10694
|
+
requiredFields(source, [
|
|
10603
10695
|
"actionId",
|
|
10604
10696
|
...Object.hasOwn(source, "operationType") ? ["operationType"] : [],
|
|
10605
10697
|
...Object.hasOwn(source, "inputSchema") ? ["inputSchema"] : [],
|
|
@@ -10650,7 +10742,7 @@ function connectorProvider(value) {
|
|
|
10650
10742
|
const homepageUrl = source.homepageUrl;
|
|
10651
10743
|
const icon = source.icon;
|
|
10652
10744
|
if (source.noSetup !== void 0 && typeof source.noSetup != "boolean") return invalidResponse();
|
|
10653
|
-
|
|
10745
|
+
requiredFields(source, [
|
|
10654
10746
|
...Object.hasOwn(source, "noSetup") ? ["noSetup"] : [],
|
|
10655
10747
|
"serviceId",
|
|
10656
10748
|
"serviceName",
|
|
@@ -10674,7 +10766,7 @@ function connectorProvider(value) {
|
|
|
10674
10766
|
var id$1 = string$1().min(1).max(256);
|
|
10675
10767
|
var eventType = string$1().regex(/^[a-z][a-z0-9_.]{0,127}$/);
|
|
10676
10768
|
var name = string$1().trim().min(1).max(128);
|
|
10677
|
-
var eventSourceSchema =
|
|
10769
|
+
var eventSourceSchema = object({
|
|
10678
10770
|
version: literal(1),
|
|
10679
10771
|
sourceId: id$1,
|
|
10680
10772
|
revision: int().positive(),
|
|
@@ -10692,7 +10784,7 @@ var eventSourceSchema = strictObject({
|
|
|
10692
10784
|
verifiedAt: string$1().nullable(),
|
|
10693
10785
|
lastReceivedAt: string$1().nullable(),
|
|
10694
10786
|
updatedAt: string$1(),
|
|
10695
|
-
consumers: array(
|
|
10787
|
+
consumers: array(object({
|
|
10696
10788
|
flowId: id$1,
|
|
10697
10789
|
flowName: string$1(),
|
|
10698
10790
|
triggerNodeId: id$1
|
|
@@ -10702,7 +10794,7 @@ function decodeEventSource(value) {
|
|
|
10702
10794
|
return eventSourceSchema.parse(value);
|
|
10703
10795
|
}
|
|
10704
10796
|
function decodeEventSources(value) {
|
|
10705
|
-
return
|
|
10797
|
+
return object({
|
|
10706
10798
|
version: literal(1),
|
|
10707
10799
|
sources: array(eventSourceSchema),
|
|
10708
10800
|
teamId: id$1.nullable().optional()
|
|
@@ -10724,7 +10816,7 @@ function isUiLanguage(value) {
|
|
|
10724
10816
|
//#region src/control/common/triggerCatalog.ts
|
|
10725
10817
|
function decodeTriggerCatalog(value) {
|
|
10726
10818
|
const source = record(value);
|
|
10727
|
-
|
|
10819
|
+
requiredFields(source, [
|
|
10728
10820
|
"version",
|
|
10729
10821
|
"locale",
|
|
10730
10822
|
"definitions",
|
|
@@ -10738,7 +10830,7 @@ function decodeTriggerCatalog(value) {
|
|
|
10738
10830
|
const display = Object.fromEntries(definitions.map((definition) => {
|
|
10739
10831
|
const { key } = definition;
|
|
10740
10832
|
const copy = record(entries[key]);
|
|
10741
|
-
|
|
10833
|
+
requiredFields(copy, [
|
|
10742
10834
|
"configInputs",
|
|
10743
10835
|
"configInputLabels",
|
|
10744
10836
|
"displayName",
|
|
@@ -10776,7 +10868,7 @@ function labels(value, handles) {
|
|
|
10776
10868
|
//#endregion
|
|
10777
10869
|
//#region src/control/common/results.ts
|
|
10778
10870
|
var json$1 = json$4();
|
|
10779
|
-
var entry =
|
|
10871
|
+
var entry = object({
|
|
10780
10872
|
pointer: string$1(),
|
|
10781
10873
|
type: _enum([
|
|
10782
10874
|
"object",
|
|
@@ -10795,25 +10887,25 @@ var page = entry.extend({
|
|
|
10795
10887
|
nextOffset: number().int().positive().optional(),
|
|
10796
10888
|
entries: array(entry).optional()
|
|
10797
10889
|
});
|
|
10798
|
-
var result =
|
|
10890
|
+
var result = object({
|
|
10799
10891
|
resultId: string$1().min(1),
|
|
10800
10892
|
callId: string$1().min(1),
|
|
10801
10893
|
toolId: string$1().min(1),
|
|
10802
|
-
source: discriminatedUnion("kind", [
|
|
10894
|
+
source: discriminatedUnion("kind", [object({
|
|
10803
10895
|
kind: literal("connector"),
|
|
10804
10896
|
action: string$1().min(1)
|
|
10805
|
-
}),
|
|
10897
|
+
}), object({ kind: literal("code") })]),
|
|
10806
10898
|
bytes: number().int().nonnegative(),
|
|
10807
10899
|
digest: string$1().regex(/^[a-f0-9]{64}$/),
|
|
10808
10900
|
createdAt: string$1().datetime()
|
|
10809
10901
|
});
|
|
10810
|
-
var listSchema =
|
|
10902
|
+
var listSchema = object({
|
|
10811
10903
|
version: literal(1),
|
|
10812
10904
|
runId: string$1(),
|
|
10813
10905
|
results: array(result),
|
|
10814
10906
|
nextAfter: string$1().optional()
|
|
10815
10907
|
});
|
|
10816
|
-
var readSchema =
|
|
10908
|
+
var readSchema = object({
|
|
10817
10909
|
version: literal(1),
|
|
10818
10910
|
runId: string$1(),
|
|
10819
10911
|
result,
|
|
@@ -10890,7 +10982,7 @@ function connectorProvidersQuery(flowId, locale) {
|
|
|
10890
10982
|
path: `/v1/connector/providers${parameters ? `?${parameters}` : ""}`,
|
|
10891
10983
|
decode: (value) => {
|
|
10892
10984
|
const source = record(value);
|
|
10893
|
-
|
|
10985
|
+
requiredFields(source, ["providers", "version"]);
|
|
10894
10986
|
if (source.version != 1 || !Array.isArray(source.providers)) return invalidResponse();
|
|
10895
10987
|
return source.providers.map(connectorProvider);
|
|
10896
10988
|
}
|
|
@@ -10905,7 +10997,7 @@ function connectorActionQuery(actionId, flowId, locale) {
|
|
|
10905
10997
|
path: `/v1/connector/actions/${encodeURIComponent(actionId)}${parameters ? `?${parameters}` : ""}`,
|
|
10906
10998
|
decode: (value) => {
|
|
10907
10999
|
const source = record(value);
|
|
10908
|
-
|
|
11000
|
+
requiredFields(source, ["action", "version"]);
|
|
10909
11001
|
if (source.version != 1) return invalidResponse();
|
|
10910
11002
|
return connectorAction(source.action);
|
|
10911
11003
|
}
|
|
@@ -10916,7 +11008,7 @@ function allConnectorConnectionsQuery(flowId) {
|
|
|
10916
11008
|
path: `/v1/connector/connections${scope(flowId)}`,
|
|
10917
11009
|
decode: (value) => {
|
|
10918
11010
|
const source = record(value);
|
|
10919
|
-
|
|
11011
|
+
requiredFields(source, ["connections", "version"]);
|
|
10920
11012
|
if (source.version != 1 || !Array.isArray(source.connections)) return invalidResponse();
|
|
10921
11013
|
return source.connections.map(connection);
|
|
10922
11014
|
}
|
|
@@ -10927,7 +11019,7 @@ function connectorConnectionsQuery(serviceId, flowId) {
|
|
|
10927
11019
|
path: `/v1/connector/connections/${encodeURIComponent(serviceId)}${scope(flowId)}`,
|
|
10928
11020
|
decode: (value) => {
|
|
10929
11021
|
const source = record(value);
|
|
10930
|
-
|
|
11022
|
+
requiredFields(source, [
|
|
10931
11023
|
"connections",
|
|
10932
11024
|
"serviceId",
|
|
10933
11025
|
"version"
|
|
@@ -10952,6 +11044,7 @@ function resourceReferences(input) {
|
|
|
10952
11044
|
if (accessRevision < 0) return invalidResponse();
|
|
10953
11045
|
return {
|
|
10954
11046
|
draft: draft == null ? null : {
|
|
11047
|
+
...draft.calledFlowIds === void 0 ? {} : { calledFlowIds: strings(draft.calledFlowIds) },
|
|
10955
11048
|
variableNames: strings(draft.variableNames),
|
|
10956
11049
|
errorSourceFlowIds: strings(draft.errorSourceFlowIds),
|
|
10957
11050
|
connections: draft.connections.map((value) => {
|
|
@@ -10982,10 +11075,11 @@ function flow$1(value) {
|
|
|
10982
11075
|
if (source.version != 1) return invalidResponse();
|
|
10983
11076
|
if (status != "active" && status != "retiring") return invalidResponse();
|
|
10984
11077
|
const target = source.live == null ? void 0 : record(source.live);
|
|
10985
|
-
if (target != null && typeof target.enabled != "boolean") return invalidResponse();
|
|
11078
|
+
if (target != null && (typeof target.enabled != "boolean" || typeof target.hasStart != "boolean")) return invalidResponse();
|
|
10986
11079
|
return {
|
|
10987
11080
|
...target == null ? {} : { live: {
|
|
10988
11081
|
enabled: target.enabled,
|
|
11082
|
+
hasStart: target.hasStart,
|
|
10989
11083
|
publicationId: string(target.publicationId),
|
|
10990
11084
|
revisionId: string(target.revisionId)
|
|
10991
11085
|
} },
|
|
@@ -11000,6 +11094,15 @@ function flow$1(value) {
|
|
|
11000
11094
|
version: 1
|
|
11001
11095
|
};
|
|
11002
11096
|
}
|
|
11097
|
+
function flowListItem(value) {
|
|
11098
|
+
const source = record(value);
|
|
11099
|
+
const referenceCount = integer(source.referenceCount);
|
|
11100
|
+
if (referenceCount < 0) return invalidResponse();
|
|
11101
|
+
return {
|
|
11102
|
+
...flow$1(source),
|
|
11103
|
+
referenceCount
|
|
11104
|
+
};
|
|
11105
|
+
}
|
|
11003
11106
|
function flowPage(value) {
|
|
11004
11107
|
const source = record(value);
|
|
11005
11108
|
if (source.version != 1 || !Array.isArray(source.flows)) return invalidResponse();
|
|
@@ -11009,14 +11112,14 @@ function flowPage(value) {
|
|
|
11009
11112
|
if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
|
|
11010
11113
|
return {
|
|
11011
11114
|
...nextCursor == null ? {} : { nextCursor },
|
|
11012
|
-
flows: source.flows.map(
|
|
11115
|
+
flows: source.flows.map(flowListItem),
|
|
11013
11116
|
...total == null ? {} : { total },
|
|
11014
11117
|
version: 1
|
|
11015
11118
|
};
|
|
11016
11119
|
}
|
|
11017
11120
|
function variable(value) {
|
|
11018
11121
|
const source = record(value);
|
|
11019
|
-
|
|
11122
|
+
requiredFields(source, [
|
|
11020
11123
|
"name",
|
|
11021
11124
|
"updatedAt",
|
|
11022
11125
|
"value",
|
|
@@ -11036,6 +11139,15 @@ function variable(value) {
|
|
|
11036
11139
|
version: 1
|
|
11037
11140
|
};
|
|
11038
11141
|
}
|
|
11142
|
+
function variableListItem(value) {
|
|
11143
|
+
const { referenceCount, ...fields } = record(value);
|
|
11144
|
+
const count = integer(referenceCount);
|
|
11145
|
+
if (count < 0) return invalidResponse();
|
|
11146
|
+
return {
|
|
11147
|
+
...variable(fields),
|
|
11148
|
+
referenceCount: count
|
|
11149
|
+
};
|
|
11150
|
+
}
|
|
11039
11151
|
function errorListener(value) {
|
|
11040
11152
|
const source = record(value);
|
|
11041
11153
|
if (typeof source.enabled != "boolean") return invalidResponse();
|
|
@@ -11049,17 +11161,13 @@ function errorListener(value) {
|
|
|
11049
11161
|
}
|
|
11050
11162
|
function variableReferences(input) {
|
|
11051
11163
|
const source = record(input);
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
"references",
|
|
11055
|
-
"unknown"
|
|
11056
|
-
]);
|
|
11057
|
-
if (source.version != 1 || !Array.isArray(source.references) || !Array.isArray(source.unknown)) return invalidResponse();
|
|
11164
|
+
requiredFields(source, ["version", "references"]);
|
|
11165
|
+
if (source.version != 1 || !Array.isArray(source.references)) return invalidResponse();
|
|
11058
11166
|
return {
|
|
11059
11167
|
version: 1,
|
|
11060
11168
|
references: source.references.map((value) => {
|
|
11061
11169
|
const item = record(value);
|
|
11062
|
-
|
|
11170
|
+
requiredFields(item, [
|
|
11063
11171
|
"flowId",
|
|
11064
11172
|
"flowName",
|
|
11065
11173
|
"draft",
|
|
@@ -11068,7 +11176,7 @@ function variableReferences(input) {
|
|
|
11068
11176
|
if (typeof item.draft != "boolean") return invalidResponse();
|
|
11069
11177
|
const live = item.live === null ? null : record(item.live);
|
|
11070
11178
|
if (live != null) {
|
|
11071
|
-
|
|
11179
|
+
requiredFields(live, ["publicationId", "enabled"]);
|
|
11072
11180
|
if (typeof live.enabled != "boolean") return invalidResponse();
|
|
11073
11181
|
}
|
|
11074
11182
|
return {
|
|
@@ -11080,20 +11188,6 @@ function variableReferences(input) {
|
|
|
11080
11188
|
enabled: live.enabled
|
|
11081
11189
|
}
|
|
11082
11190
|
};
|
|
11083
|
-
}),
|
|
11084
|
-
unknown: source.unknown.map((value) => {
|
|
11085
|
-
const item = record(value);
|
|
11086
|
-
exact(item, [
|
|
11087
|
-
"flowId",
|
|
11088
|
-
"flowName",
|
|
11089
|
-
"scope"
|
|
11090
|
-
]);
|
|
11091
|
-
if (item.scope !== "draft" && item.scope !== "live") return invalidResponse();
|
|
11092
|
-
return {
|
|
11093
|
-
flowId: string(item.flowId),
|
|
11094
|
-
flowName: string(item.flowName),
|
|
11095
|
-
scope: item.scope
|
|
11096
|
-
};
|
|
11097
11191
|
})
|
|
11098
11192
|
};
|
|
11099
11193
|
}
|
|
@@ -11180,7 +11274,7 @@ function run$1(value) {
|
|
|
11180
11274
|
}
|
|
11181
11275
|
function runWaiting(value) {
|
|
11182
11276
|
const source = record(value);
|
|
11183
|
-
|
|
11277
|
+
requiredFields(source, [
|
|
11184
11278
|
"actions",
|
|
11185
11279
|
"expiresAt",
|
|
11186
11280
|
"nodeId",
|
|
@@ -11199,6 +11293,15 @@ function runWaiting(value) {
|
|
|
11199
11293
|
waitingSince: string(source.waitingSince)
|
|
11200
11294
|
};
|
|
11201
11295
|
}
|
|
11296
|
+
function workflowIdentity(value) {
|
|
11297
|
+
const ref = record(value);
|
|
11298
|
+
return {
|
|
11299
|
+
flowId: string(ref.flowId),
|
|
11300
|
+
runId: string(ref.runId),
|
|
11301
|
+
nodeId: string(ref.nodeId),
|
|
11302
|
+
executionId: string(ref.executionId)
|
|
11303
|
+
};
|
|
11304
|
+
}
|
|
11202
11305
|
function runDetails(value) {
|
|
11203
11306
|
const source = record(value);
|
|
11204
11307
|
const summary = run$1(source);
|
|
@@ -11206,20 +11309,24 @@ function runDetails(value) {
|
|
|
11206
11309
|
if (eventsExpiresAt != null && typeof eventsExpiresAt != "string") return invalidResponse();
|
|
11207
11310
|
if (source.waiting !== void 0 || !Array.isArray(source.waits)) return invalidResponse();
|
|
11208
11311
|
const waits = source.waits.map(runWaiting);
|
|
11209
|
-
if (new Set(waits.map((wait) => wait.waitId)).size != waits.length || summary.status == "waiting" && waits.length == 0 || [
|
|
11312
|
+
if (new Set(waits.map((wait) => wait.waitId)).size != waits.length || summary.status == "waiting" && waits.length == 0 && (!Array.isArray(source.calls) || source.calls.length == 0) || [
|
|
11210
11313
|
"completed",
|
|
11211
11314
|
"failed",
|
|
11212
11315
|
"canceled",
|
|
11213
11316
|
"indeterminate"
|
|
11214
11317
|
].includes(summary.status) && waits.length > 0) return invalidResponse();
|
|
11215
|
-
if (source.occurrenceId
|
|
11318
|
+
if (source.occurrenceId !== void 0 && source.triggerNodeId === void 0) return invalidResponse();
|
|
11216
11319
|
const state = {
|
|
11217
11320
|
status: summary.status,
|
|
11218
11321
|
waits
|
|
11219
11322
|
};
|
|
11323
|
+
if (source.calls !== void 0 && !Array.isArray(source.calls)) return invalidResponse();
|
|
11220
11324
|
const details = {
|
|
11221
11325
|
...summary,
|
|
11222
11326
|
...errorHandling(source),
|
|
11327
|
+
...source.triggerNodeId === void 0 ? {} : { triggerNodeId: string(source.triggerNodeId) },
|
|
11328
|
+
...source.caller === void 0 ? {} : { caller: workflowIdentity(source.caller) },
|
|
11329
|
+
...source.calls === void 0 ? {} : { calls: source.calls.map((item) => Object.assign(workflowIdentity(item), { status: record(item).status === null ? null : runStatus(record(item).status) })) },
|
|
11223
11330
|
closureDigest: string(source.closureDigest),
|
|
11224
11331
|
engineContract: string(source.engineContract),
|
|
11225
11332
|
engineDigest: string(source.engineDigest),
|
|
@@ -11270,7 +11377,7 @@ function runCancellation(value) {
|
|
|
11270
11377
|
}
|
|
11271
11378
|
function waitResolution(value) {
|
|
11272
11379
|
const source = record(value);
|
|
11273
|
-
|
|
11380
|
+
requiredFields(source, [
|
|
11274
11381
|
"action",
|
|
11275
11382
|
"comment",
|
|
11276
11383
|
"resolutionAccepted",
|
|
@@ -11487,7 +11594,7 @@ function decodeRunEvent(value) {
|
|
|
11487
11594
|
switch (kind) {
|
|
11488
11595
|
case "node.started": {
|
|
11489
11596
|
const nodeKind = payload.nodeKind;
|
|
11490
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
|
|
11597
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
11491
11598
|
return {
|
|
11492
11599
|
...base,
|
|
11493
11600
|
kind,
|
|
@@ -11614,14 +11721,14 @@ var ControlClient = class {
|
|
|
11614
11721
|
if (options.limit != null) parameters.set("limit", String(options.limit));
|
|
11615
11722
|
if (options.includeTotal != null) parameters.set("includeTotal", String(options.includeTotal));
|
|
11616
11723
|
const query = parameters.size == 0 ? "" : `?${parameters}`;
|
|
11617
|
-
return flowPage(await this.request(`/v1/flows${query}
|
|
11724
|
+
return flowPage(await this.request(`/v1/flows${query}`, options.signal == null ? void 0 : { signal: options.signal }));
|
|
11618
11725
|
}
|
|
11619
11726
|
async listEventSources(flowId, signal) {
|
|
11620
11727
|
return decodeEventSources(await this.request("/v1/event-sources" + (flowId == null ? "" : `?flowId=${segment(flowId)}`), { signal }));
|
|
11621
11728
|
}
|
|
11622
11729
|
async listEventSourceConnections(teamId, signal) {
|
|
11623
11730
|
const source = record(await this.request(`/v1/event-sources/connections${teamId == null ? "" : `?teamId=${segment(teamId)}`}`, { signal }));
|
|
11624
|
-
|
|
11731
|
+
requiredFields(source, ["version", "connections"]);
|
|
11625
11732
|
if (source.version != 1 || !Array.isArray(source.connections)) return invalidResponse();
|
|
11626
11733
|
return source.connections.map(connection);
|
|
11627
11734
|
}
|
|
@@ -11648,13 +11755,24 @@ var ControlClient = class {
|
|
|
11648
11755
|
}
|
|
11649
11756
|
async listVariables() {
|
|
11650
11757
|
const source = record(await this.request("/v1/variables"));
|
|
11651
|
-
|
|
11758
|
+
requiredFields(source, ["variables", "version"]);
|
|
11652
11759
|
if (source.version != 1 || !Array.isArray(source.variables)) return invalidResponse();
|
|
11653
11760
|
return {
|
|
11654
|
-
variables: source.variables.map(
|
|
11761
|
+
variables: source.variables.map(variableListItem),
|
|
11655
11762
|
version: 1
|
|
11656
11763
|
};
|
|
11657
11764
|
}
|
|
11765
|
+
async getFlowReferences(flowId, options = {}) {
|
|
11766
|
+
const query = new URLSearchParams({
|
|
11767
|
+
direction: options.direction ?? "incoming",
|
|
11768
|
+
offset: String(options.offset ?? 0),
|
|
11769
|
+
limit: String(options.limit ?? 50)
|
|
11770
|
+
});
|
|
11771
|
+
return workflowReferencesSchema.parse(await this.request(`/v1/flows/${segment(flowId)}/references?${query}`, { signal: options.signal }));
|
|
11772
|
+
}
|
|
11773
|
+
async getWorkflowContract(flowId, signal) {
|
|
11774
|
+
return workflowContractSchema.parse(await this.request(`/v1/flows/${segment(flowId)}/call-contract`, { signal }));
|
|
11775
|
+
}
|
|
11658
11776
|
async getVariableReferences(name, signal) {
|
|
11659
11777
|
return variableReferences(await this.request(`/v1/variables/${segment(name)}/references`, { signal }));
|
|
11660
11778
|
}
|
|
@@ -11669,7 +11787,7 @@ var ControlClient = class {
|
|
|
11669
11787
|
}
|
|
11670
11788
|
async deleteVariable(name) {
|
|
11671
11789
|
const source = record(await this.request(`/v1/variables/${segment(name)}`, { method: "DELETE" }));
|
|
11672
|
-
|
|
11790
|
+
requiredFields(source, ["version"]);
|
|
11673
11791
|
if (source.version != 1) return invalidResponse();
|
|
11674
11792
|
}
|
|
11675
11793
|
async exportFlow(flowId) {
|
|
@@ -11711,7 +11829,7 @@ var ControlClient = class {
|
|
|
11711
11829
|
command
|
|
11712
11830
|
})
|
|
11713
11831
|
}));
|
|
11714
|
-
|
|
11832
|
+
requiredFields(source, [
|
|
11715
11833
|
"version",
|
|
11716
11834
|
"flowId",
|
|
11717
11835
|
"broadcast"
|
|
@@ -11851,11 +11969,11 @@ var ControlClient = class {
|
|
|
11851
11969
|
}
|
|
11852
11970
|
async listTriggerConfigOptions(flowId, nodeId, field, signal) {
|
|
11853
11971
|
const source = record(await this.request(`/v1/flows/${segment(flowId)}/triggers/${segment(nodeId)}/options/${segment(field)}`, { signal }));
|
|
11854
|
-
|
|
11972
|
+
requiredFields(source, ["options", "version"]);
|
|
11855
11973
|
if (source.version != 1 || !Array.isArray(source.options) || source.options.length > 1e3) return invalidResponse();
|
|
11856
11974
|
return source.options.map((value) => {
|
|
11857
11975
|
const item = record(value);
|
|
11858
|
-
|
|
11976
|
+
requiredFields(item, [
|
|
11859
11977
|
"value",
|
|
11860
11978
|
"label",
|
|
11861
11979
|
...item.color == null ? [] : ["color"]
|
|
@@ -11874,7 +11992,7 @@ var ControlClient = class {
|
|
|
11874
11992
|
}
|
|
11875
11993
|
async listConnectorTeams(signal) {
|
|
11876
11994
|
const source = record(await this.request("/v1/connector/teams", { signal }));
|
|
11877
|
-
|
|
11995
|
+
requiredFields(source, [
|
|
11878
11996
|
"enabled",
|
|
11879
11997
|
"teams",
|
|
11880
11998
|
"version"
|
|
@@ -11884,7 +12002,7 @@ var ControlClient = class {
|
|
|
11884
12002
|
enabled: source.enabled,
|
|
11885
12003
|
teams: source.teams.map((value) => {
|
|
11886
12004
|
const team = record(value);
|
|
11887
|
-
|
|
12005
|
+
requiredFields(team, [
|
|
11888
12006
|
"id",
|
|
11889
12007
|
"name",
|
|
11890
12008
|
"systemCreated"
|
|
@@ -11997,7 +12115,7 @@ var ControlClient = class {
|
|
|
11997
12115
|
body: JSON.stringify({ version: 1 }),
|
|
11998
12116
|
method: "POST"
|
|
11999
12117
|
}));
|
|
12000
|
-
|
|
12118
|
+
requiredFields(source, ["url", "version"]);
|
|
12001
12119
|
if (source.version != 1) return invalidResponse();
|
|
12002
12120
|
try {
|
|
12003
12121
|
const url = new URL(string(source.url));
|
|
@@ -12059,6 +12177,16 @@ var ControlClient = class {
|
|
|
12059
12177
|
method: "POST"
|
|
12060
12178
|
}));
|
|
12061
12179
|
}
|
|
12180
|
+
async upgradeDraft(flowId, expectedRevisionId, options = {}) {
|
|
12181
|
+
return draftChange(await this.request(`/v1/flows/${segment(flowId)}/draft/upgrade`, {
|
|
12182
|
+
body: JSON.stringify({
|
|
12183
|
+
expectedRevisionId,
|
|
12184
|
+
version: 1
|
|
12185
|
+
}),
|
|
12186
|
+
headers: { "idempotency-key": options.idempotencyKey ?? operationKey("upgrade") },
|
|
12187
|
+
method: "POST"
|
|
12188
|
+
}));
|
|
12189
|
+
}
|
|
12062
12190
|
async checkFlow(flowId, revisionId) {
|
|
12063
12191
|
return flowCheck(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/check`, {
|
|
12064
12192
|
body: JSON.stringify({
|
|
@@ -12201,7 +12329,7 @@ var ControlClient = class {
|
|
|
12201
12329
|
const suffix = query == "" ? "" : `?${query}`;
|
|
12202
12330
|
return this.connectorRequest(`/v1/connector/actions${suffix}`, "actions", signal, (value) => {
|
|
12203
12331
|
const source = record(value);
|
|
12204
|
-
|
|
12332
|
+
requiredFields(source, ["actions", "version"]);
|
|
12205
12333
|
if (source.version != 1 || !Array.isArray(source.actions)) return invalidResponse();
|
|
12206
12334
|
return source.actions.map(connectorAction);
|
|
12207
12335
|
});
|
|
@@ -12337,7 +12465,8 @@ var mcpConformanceCases = [
|
|
|
12337
12465
|
kind: "graph.node.create",
|
|
12338
12466
|
nodeId: "start",
|
|
12339
12467
|
node: {
|
|
12340
|
-
|
|
12468
|
+
inputDefs: [],
|
|
12469
|
+
kind: "start",
|
|
12341
12470
|
name: "Start"
|
|
12342
12471
|
}
|
|
12343
12472
|
}]);
|
|
@@ -12446,7 +12575,7 @@ var mutationKey = id.max(256).describe("Stable identity for this mutation. Retry
|
|
|
12446
12575
|
var pageLimit = int().min(1).max(100).default(50);
|
|
12447
12576
|
var flow = id.describe("Exact Flow ID returned by flow_list or flow_create.");
|
|
12448
12577
|
var run = id.describe("Exact Run ID returned by flow_run or run_list.");
|
|
12449
|
-
var mcpInstructions = "Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_live to inspect current online entries after publication. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_edit with identical arguments and the same requestId. Retry flow_create, flow_import, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Canvas commands are transient broadcasts without execution confirmation; never automatically retry flow_canvas because pan is relative. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
|
|
12578
|
+
var mcpInstructions = "Keep generated Flow and node names short enough to scan on the canvas. Aim for 2–4 English words or 4–8 Chinese characters, using the user's language unless the workflow has an established naming language. Name a Flow by its main purpose and a node by its action and object, such as \"AI Trend Digest\", \"Fetch trends\", \"Verify sources\", or \"发布文章\". Keep only qualifiers needed to distinguish similar nodes. Put detailed behavior in descriptions; avoid sentences, repeated workflow context, and obscure abbreviations. Preserve names explicitly supplied by the user, and do not rename unrelated existing nodes. Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_live to inspect current online entries after publication. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_edit with identical arguments and the same requestId. Retry flow_create, flow_import, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Canvas commands are transient broadcasts without execution confirmation; never automatically retry flow_canvas because pan is relative. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
|
|
12450
12579
|
function tool(description, schema, readOnly, idempotent = true) {
|
|
12451
12580
|
return {
|
|
12452
12581
|
description,
|
|
@@ -12518,7 +12647,7 @@ var mcpTools = {
|
|
|
12518
12647
|
expectedPublicationId: id,
|
|
12519
12648
|
enabled: boolean()
|
|
12520
12649
|
}), false),
|
|
12521
|
-
flow_run: tool("Start a Run and return its runId. For draft supply flowId and revisionId; for live supply publicationId. Always fix the source, Trigger and idempotencyKey. Poll run_get for completion.", discriminatedUnion("source", [strictObject({
|
|
12650
|
+
flow_run: tool("Start a Run and return its runId. For draft supply flowId and revisionId; for live supply publicationId and select a Start node. Only draft Runs may simulate other Triggers. Always fix the source, Trigger and idempotencyKey. Start parameters come from the Start node’s flow_read config.inputDefs and are supplied in trigger.outputs; required parameters must be present, omitted nullable parameters become null, and unknown parameters are rejected. Poll run_get for completion.", discriminatedUnion("source", [strictObject({
|
|
12522
12651
|
source: literal("draft"),
|
|
12523
12652
|
flowId: flow,
|
|
12524
12653
|
revisionId: id,
|
|
@@ -12608,7 +12737,7 @@ var mcpTools = {
|
|
|
12608
12737
|
flowId: flow.optional()
|
|
12609
12738
|
}), true),
|
|
12610
12739
|
event_source_list: tool("List independent Feishu event sources, including Team, Connection, event types, enabled and verification status. Inspect consumers for Flows actually using each source.", strictObject({}), true),
|
|
12611
|
-
trigger_search: tool("Search provider Trigger summaries; omit query to list all. Flow trigger instances are in flow_read.
|
|
12740
|
+
trigger_search: tool("Search provider Trigger summaries; omit query to list all. Flow trigger instances are in flow_read. Start, Webhook and Cron are built-in node kinds described by flow_schema.", strictObject({ query: string$1().trim().min(1).max(256).optional() }), true),
|
|
12612
12741
|
trigger_get: tool("Read a provider Trigger definition before creating its node.", strictObject({ key: id }), true)
|
|
12613
12742
|
};
|
|
12614
12743
|
//#endregion
|