@oomol-lab/open-flow 0.1.0-beta.65 → 0.1.0-beta.66
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-C-Si_cYs.js} +2 -2
- package/dist/browser/flow-authoring-node.d.ts +12 -3
- package/dist/browser/flow-authoring.js +114 -19
- 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 +111 -16
- package/dist/browser/{flowChanges-DkvG5uDq.js → flowChanges-T4_R5p1f.js} +2654 -1858
- package/dist/browser/{flowRunInputEditorStore-B2Rw4VsT.js → flowRunInputEditorStore-DJqmR6Qh.js} +3 -2
- package/dist/browser/{flowWorkspace-BEp-lxqF.js → flowWorkspace-C0J5C0oM.js} +700 -224
- package/dist/browser/{icons-Db2Jb2iX.js → icons-BD3m0RQq.js} +4484 -4370
- package/dist/browser/preview.css +152 -64
- package/dist/browser/preview.js +4460 -3412
- package/dist/browser/ui.css +85 -3
- package/dist/browser/ui.js +8 -5
- package/dist/browser/workbench.css +152 -64
- package/dist/browser/workbench.js +146 -57
- package/dist/browser/{workbenchSelect-C-jf6NIM.js → workbenchSelect-B-PFpF_Q.js} +1 -1
- package/dist/command/index.js +49 -49
- package/dist/common/authoring.d.ts +7 -5
- package/dist/common/authoringExamples.d.ts +3 -3
- package/dist/common/authoringFields.d.ts +20 -0
- package/dist/common/authoringSchema.d.ts +404 -15
- package/dist/common/control-api-conformance.js +384 -137
- package/dist/common/control-api.d.ts +63 -7
- package/dist/common/control-api.js +3562 -3428
- package/dist/common/control-requests.d.ts +10 -3
- package/dist/common/control-requests.js +418 -43
- package/dist/common/decision.js +28 -3
- package/dist/common/flow-encoding.d.ts +4 -2
- package/dist/common/flow-encoding.js +144 -10
- package/dist/common/flow-graph.d.ts +1 -1
- package/dist/common/flow-semantics.d.ts +12 -2
- package/dist/common/flow-semantics.js +146 -33
- package/dist/common/integration-trigger.js +28 -3
- package/dist/common/liveDetails.d.ts +26 -11
- package/dist/common/mcp.d.ts +6 -3
- package/dist/common/mcp.js +203 -84
- package/dist/common/openapi.js +28 -3
- package/dist/common/poll-trigger.js +28 -3
- 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 +167 -45
- package/dist/common/trigger-contract.d.ts +2 -0
- package/dist/common/webhook-trigger.js +28 -3
- package/dist/common/workflow.d.ts +93 -0
- package/dist/common/workflow.js +10491 -0
- package/package.json +5 -1
- package/skills/open-flow/references/flow-authoring.md +26 -16
|
@@ -8783,7 +8783,7 @@ var webhookMethods = [
|
|
|
8783
8783
|
];
|
|
8784
8784
|
//#endregion
|
|
8785
8785
|
//#region src/flow/common/changeSchema.ts
|
|
8786
|
-
var currentFlowModelVersion =
|
|
8786
|
+
var currentFlowModelVersion = 8;
|
|
8787
8787
|
var text = string();
|
|
8788
8788
|
var json = json$1();
|
|
8789
8789
|
var strings = array(text);
|
|
@@ -8793,6 +8793,7 @@ var port = object({
|
|
|
8793
8793
|
nullable: boolean(),
|
|
8794
8794
|
handle: text
|
|
8795
8795
|
});
|
|
8796
|
+
var workflowInputDefs = array(port.strict());
|
|
8796
8797
|
var input = port.extend({ value: json.optional() });
|
|
8797
8798
|
var group = object({
|
|
8798
8799
|
collapsed: boolean().optional(),
|
|
@@ -8950,6 +8951,11 @@ var managedFields = object({
|
|
|
8950
8951
|
messageHandle: text,
|
|
8951
8952
|
inputs: record$1(text, agentValue)
|
|
8952
8953
|
}).optional()
|
|
8954
|
+
}),
|
|
8955
|
+
strictObject({
|
|
8956
|
+
kind: literal("workflow"),
|
|
8957
|
+
flowId: text,
|
|
8958
|
+
revisionId: text
|
|
8953
8959
|
})
|
|
8954
8960
|
])
|
|
8955
8961
|
});
|
|
@@ -9058,6 +9064,12 @@ var base = {
|
|
|
9058
9064
|
timeoutMs: number().optional()
|
|
9059
9065
|
};
|
|
9060
9066
|
var node = union([
|
|
9067
|
+
strictObject({
|
|
9068
|
+
...base,
|
|
9069
|
+
kind: literal("outputs"),
|
|
9070
|
+
outputDefs: array(port.strict()),
|
|
9071
|
+
outputMappings: inputs
|
|
9072
|
+
}).omit({ inputs: true }),
|
|
9061
9073
|
object({
|
|
9062
9074
|
...base,
|
|
9063
9075
|
inputs: record$1(text, never()),
|
|
@@ -9090,6 +9102,11 @@ var node = union([
|
|
|
9090
9102
|
...trigger,
|
|
9091
9103
|
kind: literal("manual")
|
|
9092
9104
|
}),
|
|
9105
|
+
strictObject({
|
|
9106
|
+
...trigger,
|
|
9107
|
+
kind: literal("start"),
|
|
9108
|
+
inputDefs: workflowInputDefs
|
|
9109
|
+
}),
|
|
9093
9110
|
strictObject({
|
|
9094
9111
|
...trigger,
|
|
9095
9112
|
kind: literal("error"),
|
|
@@ -9154,35 +9171,51 @@ var module = object({
|
|
|
9154
9171
|
imports: strings,
|
|
9155
9172
|
source: text
|
|
9156
9173
|
});
|
|
9157
|
-
var document = preprocess(
|
|
9174
|
+
var document = preprocess(normalizeDocument, object({
|
|
9158
9175
|
bindings: record$1(text, binding),
|
|
9159
9176
|
graph
|
|
9160
9177
|
}));
|
|
9161
|
-
object({
|
|
9178
|
+
var revision = object({
|
|
9162
9179
|
modelVersion: union([
|
|
9163
9180
|
literal(2),
|
|
9164
9181
|
literal(4),
|
|
9165
9182
|
literal(5),
|
|
9166
|
-
literal(6)
|
|
9183
|
+
literal(6),
|
|
9184
|
+
literal(7),
|
|
9185
|
+
literal(8)
|
|
9167
9186
|
]),
|
|
9168
9187
|
document,
|
|
9169
9188
|
modules: record$1(text, module)
|
|
9170
|
-
})
|
|
9189
|
+
});
|
|
9190
|
+
revision.extend({
|
|
9171
9191
|
kind: literal("open-flow-flow-revision"),
|
|
9172
9192
|
version: literal(1)
|
|
9173
9193
|
});
|
|
9174
|
-
function
|
|
9194
|
+
function normalizeDocument(value) {
|
|
9175
9195
|
const candidate = record(value);
|
|
9176
9196
|
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.");
|
|
9177
9197
|
if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => Object.hasOwn(record(candidateNode), "taskId"))) throw new TypeError("Task references are no longer supported.");
|
|
9178
9198
|
const subflows = candidate.subflows;
|
|
9179
9199
|
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.");
|
|
9180
9200
|
if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind === "subflow")) throw new TypeError("Subflow nodes are no longer supported.");
|
|
9201
|
+
if ([
|
|
9202
|
+
"inputDefs",
|
|
9203
|
+
"outputDefs",
|
|
9204
|
+
"outputMappings"
|
|
9205
|
+
].some((field) => Object.hasOwn(candidate, field))) throw new TypeError("Workflow interface configuration must belong to Start and Outputs nodes.");
|
|
9206
|
+
if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind == "start" && Object.hasOwn(record(candidateNode), "parameters"))) throw new TypeError("Legacy Start.parameters is unsupported; configure node.inputDefs.");
|
|
9181
9207
|
return value;
|
|
9182
9208
|
}
|
|
9183
9209
|
function record(value) {
|
|
9184
9210
|
return value != null && typeof value == "object" && !Array.isArray(value) ? value : {};
|
|
9185
9211
|
}
|
|
9212
|
+
function decodeRevisionContent(value) {
|
|
9213
|
+
checkJsonDepth(value);
|
|
9214
|
+
const content = revision.parse(value);
|
|
9215
|
+
checkModelVersion(content);
|
|
9216
|
+
assertOpenApiAuthBindings(content.document);
|
|
9217
|
+
return content;
|
|
9218
|
+
}
|
|
9186
9219
|
var shapes = {
|
|
9187
9220
|
"graph.trigger.sources.set": {
|
|
9188
9221
|
nodeId: text,
|
|
@@ -9359,6 +9392,12 @@ function changeOperationsSchema(kind) {
|
|
|
9359
9392
|
if (schema == null) throw new TypeError(`Unknown operation ${JSON.stringify(kind)}.`);
|
|
9360
9393
|
return toJSONSchema(schema, { io: "input" });
|
|
9361
9394
|
}
|
|
9395
|
+
function checkModelVersion(content) {
|
|
9396
|
+
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.");
|
|
9397
|
+
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.");
|
|
9398
|
+
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.");
|
|
9399
|
+
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.");
|
|
9400
|
+
}
|
|
9362
9401
|
//#endregion
|
|
9363
9402
|
//#region src/flow/common/condition.ts
|
|
9364
9403
|
var unaryOperator = (operator) => operator.startsWith("is");
|
|
@@ -9378,6 +9417,7 @@ function conditionOperands(node) {
|
|
|
9378
9417
|
}] : []])));
|
|
9379
9418
|
}
|
|
9380
9419
|
function nodeInputMappings(node) {
|
|
9420
|
+
if (node.kind == "outputs") return node.outputMappings;
|
|
9381
9421
|
if (node.kind != "condition") return "inputs" in node ? node.inputs : {};
|
|
9382
9422
|
return Object.fromEntries(conditionOperands(node).flatMap(({ handle, operand }) => operand.kind == "source" ? [[handle, {
|
|
9383
9423
|
kind: "sources",
|
|
@@ -9567,6 +9607,45 @@ function decodeConnectorCapabilities(value) {
|
|
|
9567
9607
|
};
|
|
9568
9608
|
});
|
|
9569
9609
|
}
|
|
9610
|
+
function isTriggerNode(node) {
|
|
9611
|
+
return [
|
|
9612
|
+
"manual",
|
|
9613
|
+
"start",
|
|
9614
|
+
"error",
|
|
9615
|
+
"webhook",
|
|
9616
|
+
"cron",
|
|
9617
|
+
"poll",
|
|
9618
|
+
"integration"
|
|
9619
|
+
].includes(node.kind);
|
|
9620
|
+
}
|
|
9621
|
+
/** Lossless upgrade of readable content. Historical content and its encoding stay unchanged. */
|
|
9622
|
+
function upgradeRevisionContent(content) {
|
|
9623
|
+
const upgraded = upgradeDecodedRevisionContent(decodeRevisionContent(content));
|
|
9624
|
+
return dequal(content, upgraded) ? content : upgraded;
|
|
9625
|
+
}
|
|
9626
|
+
function upgradeDecodedRevisionContent(content) {
|
|
9627
|
+
const graph = content.document.graph;
|
|
9628
|
+
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9629
|
+
if (!hasManual && content.modelVersion == 8) return content;
|
|
9630
|
+
return {
|
|
9631
|
+
...content,
|
|
9632
|
+
modelVersion: 8,
|
|
9633
|
+
document: {
|
|
9634
|
+
...content.document,
|
|
9635
|
+
graph: hasManual ? {
|
|
9636
|
+
...graph,
|
|
9637
|
+
nodes: Object.fromEntries(Object.entries(graph.nodes).map(([id, node]) => [id, upgradeManualTrigger(node)]))
|
|
9638
|
+
} : graph
|
|
9639
|
+
}
|
|
9640
|
+
};
|
|
9641
|
+
}
|
|
9642
|
+
function upgradeManualTrigger(node) {
|
|
9643
|
+
return node.kind == "manual" ? {
|
|
9644
|
+
...node,
|
|
9645
|
+
kind: "start",
|
|
9646
|
+
inputDefs: []
|
|
9647
|
+
} : node;
|
|
9648
|
+
}
|
|
9570
9649
|
function normalizeNodeName(value) {
|
|
9571
9650
|
return value.trim().normalize("NFC");
|
|
9572
9651
|
}
|
|
@@ -9597,8 +9676,9 @@ function invalid(message) {
|
|
|
9597
9676
|
throw new FlowChangeError(message);
|
|
9598
9677
|
}
|
|
9599
9678
|
function applyFlowChanges(content, operations) {
|
|
9600
|
-
const
|
|
9601
|
-
const
|
|
9679
|
+
const source = content.modelVersion != 8 || Object.values(content.document.graph.nodes).some((node) => node.kind == "manual") ? decodeRevisionContent(content) : content;
|
|
9680
|
+
const document = { ...source.document };
|
|
9681
|
+
const modules = { ...source.modules };
|
|
9602
9682
|
for (const operation of operations) switch (operation.kind) {
|
|
9603
9683
|
case "graph.trigger.sources.set": {
|
|
9604
9684
|
const graph = document.graph;
|
|
@@ -9649,8 +9729,9 @@ function applyFlowChanges(content, operations) {
|
|
|
9649
9729
|
case "graph.edge.connect": {
|
|
9650
9730
|
const graph = document.graph;
|
|
9651
9731
|
if (graph.nodes[operation.edge.source] == null) invalid("The source Node does not exist.");
|
|
9732
|
+
if (graph.nodes[operation.edge.source]?.kind == "outputs") invalid("Outputs cannot have downstream execution edges.");
|
|
9652
9733
|
const node = graph.nodes[operation.edge.target];
|
|
9653
|
-
if (node == null ||
|
|
9734
|
+
if (node == null || isTriggerNode(node)) invalid("The target Node does not accept execution dependencies.");
|
|
9654
9735
|
if (graph.edges.some((edge) => dequal(edge, operation.edge))) invalid("The Nodes are already connected.");
|
|
9655
9736
|
Object.assign(document, { graph: {
|
|
9656
9737
|
...graph,
|
|
@@ -9730,9 +9811,10 @@ function applyFlowChanges(content, operations) {
|
|
|
9730
9811
|
const graph = document.graph;
|
|
9731
9812
|
if (graph.nodes[operation.nodeId] != null) invalid("A Node with this ID already exists in the target graph.");
|
|
9732
9813
|
if (operation.node.kind == "error" && Object.values(graph.nodes).some((node) => node.kind == "error")) invalid("A graph can contain only one Flow Error node.");
|
|
9733
|
-
if (operation.node.kind == "manual" && Object.values(graph.nodes).some((node) => node.kind == "manual")) invalid("A graph can contain only one
|
|
9814
|
+
if ((operation.node.kind == "manual" || operation.node.kind == "start") && Object.values(graph.nodes).some((node) => node.kind == "manual" || node.kind == "start")) invalid("A graph can contain only one Start Trigger.");
|
|
9734
9815
|
if (operation.node.kind == "task" && "moduleId" in operation.node.task && operation.node.task.capabilities !== void 0) decodeConnectorCapabilities(operation.node.task.capabilities);
|
|
9735
9816
|
if (operation.node.name == null) invalid("A Node name cannot be empty.");
|
|
9817
|
+
if (operation.node.kind == "outputs" && Object.values(graph.nodes).some((node) => node.kind == "outputs")) invalid("A graph can contain only one Outputs node.");
|
|
9736
9818
|
const name = normalizeNodeName(operation.node.name);
|
|
9737
9819
|
const issue = nodeNameIssue(graph, operation.nodeId, name);
|
|
9738
9820
|
if (issue == "empty") invalid("A Node name cannot be empty.");
|
|
@@ -9790,11 +9872,24 @@ function applyFlowChanges(content, operations) {
|
|
|
9790
9872
|
case "graph.node.input.set": {
|
|
9791
9873
|
const graph = document.graph;
|
|
9792
9874
|
const node = graph.nodes[operation.nodeId];
|
|
9793
|
-
if (node == null ||
|
|
9875
|
+
if (node == null || isTriggerNode(node)) invalid("The Node does not accept inputs.");
|
|
9794
9876
|
if (!dequal(nodeInputMappings(node)[operation.handle], operation.before)) invalid("The Node input changed before this operation was applied.");
|
|
9795
|
-
const inputs = { ...node
|
|
9877
|
+
const inputs = { ...nodeInputMappings(node) };
|
|
9796
9878
|
if (operation.value == null) delete inputs[operation.handle];
|
|
9797
9879
|
else inputs[operation.handle] = operation.value;
|
|
9880
|
+
if (node.kind == "outputs") {
|
|
9881
|
+
document.graph = {
|
|
9882
|
+
...graph,
|
|
9883
|
+
nodes: {
|
|
9884
|
+
...graph.nodes,
|
|
9885
|
+
[operation.nodeId]: {
|
|
9886
|
+
...node,
|
|
9887
|
+
outputMappings: inputs
|
|
9888
|
+
}
|
|
9889
|
+
}
|
|
9890
|
+
};
|
|
9891
|
+
break;
|
|
9892
|
+
}
|
|
9798
9893
|
Object.assign(document, { graph: {
|
|
9799
9894
|
...graph,
|
|
9800
9895
|
nodes: {
|
|
@@ -10022,11 +10117,11 @@ function applyFlowChanges(content, operations) {
|
|
|
10022
10117
|
}
|
|
10023
10118
|
}
|
|
10024
10119
|
assertOpenApiAuthBindings(document);
|
|
10025
|
-
return {
|
|
10120
|
+
return upgradeDecodedRevisionContent({
|
|
10026
10121
|
document,
|
|
10027
|
-
modelVersion:
|
|
10122
|
+
modelVersion: 8,
|
|
10028
10123
|
modules
|
|
10029
|
-
};
|
|
10124
|
+
});
|
|
10030
10125
|
}
|
|
10031
10126
|
//#endregion
|
|
10032
|
-
export { FlowChangeError, applyFlowChanges, changeOperationsSchema, currentFlowModelVersion, decodeChangeOperations, decodeConnectorCapabilities, fixedInputValue, inputValue, inputValues, isSchemaKeyword, nextNodeName, nodeNameIssue, normalizeNodeName, portsByHandle, resourceNameIssue, resourceNameMaxLength, validVariableName };
|
|
10127
|
+
export { FlowChangeError, applyFlowChanges, changeOperationsSchema, currentFlowModelVersion, decodeChangeOperations, decodeConnectorCapabilities, fixedInputValue, inputValue, inputValues, isSchemaKeyword, isTriggerNode, nextNodeName, nodeNameIssue, normalizeNodeName, portsByHandle, resourceNameIssue, resourceNameMaxLength, upgradeManualTrigger, upgradeRevisionContent, validVariableName };
|