@oomol-lab/open-flow 0.1.0-beta.69 → 0.1.0-beta.70
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 → ContentIcon-CUQHjQIw.js} +16 -8
- package/dist/browser/{FlowCanvas-C5X22xQ7.js → FlowCanvas-CqtUDPGj.js} +11 -26
- package/dist/browser/{createResourceDialog-Di5BBrQv.js → createResourceDialog-BAHYW9yu.js} +3 -3
- package/dist/browser/{dialog-Bjo-r9B0.js → dialog-DcGOzUP2.js} +162 -12
- package/dist/browser/{exportSvg-Cj6Spxx-.js → exportSvg-Dv5Qgrq7.js} +2 -2
- package/dist/browser/flow-authoring.js +95 -12
- package/dist/browser/flow-change-schema.d.ts +24 -1
- package/dist/browser/flow-change.d.ts +33 -4
- package/dist/browser/flow-change.js +96 -13
- package/dist/browser/{flowChanges-Dp-rcEJ6.js → flowChanges-CYyehKer.js} +2593 -2254
- package/dist/browser/{flowWorkspace-CB1QACku.js → flowWorkspace-qYUZPJHR.js} +1114 -392
- package/dist/browser/preview.css +225 -221
- package/dist/browser/preview.js +3781 -2655
- package/dist/browser/{tooltip-CJjYs_2I.js → tooltip-wZJRB9oP.js} +28 -1
- package/dist/browser/ui.css +8 -20
- package/dist/browser/workbench.css +225 -221
- package/dist/browser/workbench.js +31 -10
- package/dist/browser/{workbenchSelect-C3hxUcYm.js → workbenchSelect-D8_vP2p5.js} +2 -2
- package/dist/command/index.js +45 -45
- package/dist/common/authoring.d.ts +3 -3
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +37 -374
- package/dist/common/control-api-conformance.js +151 -55
- package/dist/common/control-api.d.ts +12 -78
- package/dist/common/control-api.js +162 -39
- package/dist/common/control-requests.d.ts +3 -3
- package/dist/common/control-requests.js +221 -35
- package/dist/common/decision.js +85 -7
- package/dist/common/engine-contract.d.ts +4 -2
- package/dist/common/flow-encoding.js +110 -14
- package/dist/common/flow-graph.d.ts +3 -0
- package/dist/common/flow-semantics.js +273 -14
- package/dist/common/integration-trigger.js +85 -7
- package/dist/common/liveDetails.d.ts +15 -0
- package/dist/common/mcp.d.ts +3 -3
- package/dist/common/mcp.js +134 -38
- package/dist/common/openapi.js +85 -7
- package/dist/common/poll-trigger.js +85 -7
- package/dist/common/run-events.d.ts +2 -0
- package/dist/common/run-events.js +59 -2
- package/dist/common/runtime-contract.js +14 -4
- package/dist/common/scheduler.d.ts +6 -2
- package/dist/common/scheduler.js +178 -11
- package/dist/common/webhook-response.d.ts +43 -0
- package/dist/common/webhook-trigger.d.ts +12 -0
- package/dist/common/webhook-trigger.js +236 -9
- package/dist/common/workflow.js +85 -7
- package/package.json +1 -1
- package/skills/open-flow/references/flow-authoring.md +15 -10
|
@@ -1052,7 +1052,7 @@ function timeSource(args) {
|
|
|
1052
1052
|
function time(args) {
|
|
1053
1053
|
return new RegExp(`^${timeSource(args)}$`);
|
|
1054
1054
|
}
|
|
1055
|
-
function datetime(args) {
|
|
1055
|
+
function datetime$1(args) {
|
|
1056
1056
|
const opts = ["Z"];
|
|
1057
1057
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
1058
1058
|
const qualified = `${timeSource({
|
|
@@ -1703,7 +1703,7 @@ var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
1703
1703
|
$ZodStringFormat.init(inst, def);
|
|
1704
1704
|
});
|
|
1705
1705
|
var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1706
|
-
def.pattern ?? (def.pattern = datetime(def));
|
|
1706
|
+
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1707
1707
|
$ZodStringFormat.init(inst, def);
|
|
1708
1708
|
});
|
|
1709
1709
|
var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
@@ -5700,6 +5700,11 @@ function preprocess(fn, schema) {
|
|
|
5700
5700
|
});
|
|
5701
5701
|
}
|
|
5702
5702
|
//#endregion
|
|
5703
|
+
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
5704
|
+
function datetime(params) {
|
|
5705
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
5706
|
+
}
|
|
5707
|
+
//#endregion
|
|
5703
5708
|
//#region src/json-schema-subset/utils.ts
|
|
5704
5709
|
var nextId = 0;
|
|
5705
5710
|
function createId() {
|
|
@@ -8582,6 +8587,32 @@ var triggerScheduleSchema = array(union([object({
|
|
|
8582
8587
|
value: number()
|
|
8583
8588
|
})]));
|
|
8584
8589
|
//#endregion
|
|
8590
|
+
//#region src/localization/common/timeZone.ts
|
|
8591
|
+
/** Validate a named timezone using the same runtime data used for date conversion. */
|
|
8592
|
+
function isTimeZone(value) {
|
|
8593
|
+
try {
|
|
8594
|
+
Intl.DateTimeFormat("en", { timeZone: value });
|
|
8595
|
+
return true;
|
|
8596
|
+
} catch {
|
|
8597
|
+
return false;
|
|
8598
|
+
}
|
|
8599
|
+
}
|
|
8600
|
+
//#endregion
|
|
8601
|
+
//#region src/flow/common/wait.ts
|
|
8602
|
+
/** Drafts retain incomplete values; semantic validation gates publication and execution. */
|
|
8603
|
+
var waitAutoContinueDraftSchema = discriminatedUnion("kind", [strictObject({
|
|
8604
|
+
kind: literal("after"),
|
|
8605
|
+
durationMs: number().nullable()
|
|
8606
|
+
}), strictObject({
|
|
8607
|
+
kind: literal("at"),
|
|
8608
|
+
at: string(),
|
|
8609
|
+
timezone: string().optional()
|
|
8610
|
+
})]);
|
|
8611
|
+
discriminatedUnion("kind", [waitAutoContinueDraftSchema.options[0].extend({ durationMs: number().int().positive().max(Number.MAX_SAFE_INTEGER) }), waitAutoContinueDraftSchema.options[1].extend({
|
|
8612
|
+
at: datetime({ offset: true }),
|
|
8613
|
+
timezone: string().refine(isTimeZone, "Select a valid IANA timezone.").optional()
|
|
8614
|
+
})]);
|
|
8615
|
+
//#endregion
|
|
8585
8616
|
//#region src/flow/common/webhookMethod.ts
|
|
8586
8617
|
var webhookMethods = [
|
|
8587
8618
|
"GET",
|
|
@@ -8590,6 +8621,24 @@ var webhookMethods = [
|
|
|
8590
8621
|
"PATCH",
|
|
8591
8622
|
"DELETE"
|
|
8592
8623
|
];
|
|
8624
|
+
//#endregion
|
|
8625
|
+
//#region src/flow/common/webhookResponse.ts
|
|
8626
|
+
var webhookResponseTimeout = {
|
|
8627
|
+
defaultMs: 3e4,
|
|
8628
|
+
minMs: 1e3,
|
|
8629
|
+
maxMs: 6e4
|
|
8630
|
+
};
|
|
8631
|
+
({
|
|
8632
|
+
jsonSchema: {
|
|
8633
|
+
type: "object",
|
|
8634
|
+
additionalProperties: { type: [
|
|
8635
|
+
"string",
|
|
8636
|
+
"number",
|
|
8637
|
+
"boolean"
|
|
8638
|
+
] }
|
|
8639
|
+
},
|
|
8640
|
+
nullable: true
|
|
8641
|
+
}).jsonSchema;
|
|
8593
8642
|
var text = string();
|
|
8594
8643
|
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.");
|
|
8595
8644
|
var json = json$1();
|
|
@@ -8817,9 +8866,24 @@ var webhookOptions = object({
|
|
|
8817
8866
|
allowedMethods: never().optional(),
|
|
8818
8867
|
allowedOrigins: strings.optional(),
|
|
8819
8868
|
noResponseBody: never().optional(),
|
|
8869
|
+
responseBody: discriminatedUnion("kind", [strictObject({
|
|
8870
|
+
kind: literal("workflow-outputs"),
|
|
8871
|
+
output: text.optional(),
|
|
8872
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
8873
|
+
}), strictObject({
|
|
8874
|
+
kind: literal("webhook-response"),
|
|
8875
|
+
nodeId: text.optional(),
|
|
8876
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
8877
|
+
})]).optional(),
|
|
8820
8878
|
responseData: text.optional(),
|
|
8821
8879
|
responseHeaders: record$1(text, text).optional(),
|
|
8822
|
-
|
|
8880
|
+
responseHeadersSource: strictObject({
|
|
8881
|
+
kind: literal("workflow-outputs"),
|
|
8882
|
+
output: text.optional()
|
|
8883
|
+
}).optional(),
|
|
8884
|
+
responseHeaderOutputs: record$1(text, text).optional(),
|
|
8885
|
+
responseStatusCode: number().int().min(200).max(599).optional(),
|
|
8886
|
+
responseStatusCodeOutput: text.optional()
|
|
8823
8887
|
});
|
|
8824
8888
|
var webhook = {
|
|
8825
8889
|
bodyFields: array(input),
|
|
@@ -8874,6 +8938,12 @@ var base = {
|
|
|
8874
8938
|
onError: _enum(["stop", "error"]).optional()
|
|
8875
8939
|
};
|
|
8876
8940
|
var node = union([
|
|
8941
|
+
strictObject({
|
|
8942
|
+
...base,
|
|
8943
|
+
kind: literal("webhook-response"),
|
|
8944
|
+
retry: never().optional(),
|
|
8945
|
+
onError: never().optional()
|
|
8946
|
+
}),
|
|
8877
8947
|
strictObject({
|
|
8878
8948
|
...base,
|
|
8879
8949
|
kind: literal("outputs"),
|
|
@@ -8906,7 +8976,8 @@ var node = union([
|
|
|
8906
8976
|
strictObject({
|
|
8907
8977
|
...base,
|
|
8908
8978
|
kind: literal("wait"),
|
|
8909
|
-
...wait
|
|
8979
|
+
...wait,
|
|
8980
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
8910
8981
|
}).omit({ timeoutMs: true }),
|
|
8911
8982
|
object({
|
|
8912
8983
|
...trigger,
|
|
@@ -8993,7 +9064,8 @@ var revision = object({
|
|
|
8993
9064
|
literal(6),
|
|
8994
9065
|
literal(7),
|
|
8995
9066
|
literal(8),
|
|
8996
|
-
literal(9)
|
|
9067
|
+
literal(9),
|
|
9068
|
+
literal(10)
|
|
8997
9069
|
]),
|
|
8998
9070
|
document,
|
|
8999
9071
|
modules: record$1(text, module)
|
|
@@ -9248,14 +9320,14 @@ function repairRevisionEnvelope(value) {
|
|
|
9248
9320
|
checkJsonDepth(value);
|
|
9249
9321
|
const envelopeSource = record(value);
|
|
9250
9322
|
if (envelopeSource.kind != "open-flow-flow-revision" || envelopeSource.version != 1) throw new TypeError("The value is not an Open Flow Revision envelope.");
|
|
9251
|
-
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion >
|
|
9323
|
+
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 10) throw new TypeError("The Flow model is newer than this package.");
|
|
9252
9324
|
let sourceDocument = record(envelopeSource.modelVersion == 1 || envelopeSource.modelVersion == 2 ? upgradeLegacyDocument(envelopeSource.document) : envelopeSource.document);
|
|
9253
9325
|
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion < 6) sourceDocument = upgradeTaskNodes(sourceDocument);
|
|
9254
9326
|
sourceDocument = record(normalizeDocument(sourceDocument));
|
|
9255
9327
|
const bindings = record(sourceDocument.bindings);
|
|
9256
9328
|
const sourceGraph = repairGraph(sourceDocument.graph, bindings);
|
|
9257
9329
|
return decodeRevisionContent({
|
|
9258
|
-
modelVersion:
|
|
9330
|
+
modelVersion: 10,
|
|
9259
9331
|
document: {
|
|
9260
9332
|
bindings: repairedEntries(sourceDocument.bindings, binding),
|
|
9261
9333
|
graph: sourceGraph
|
|
@@ -9389,8 +9461,14 @@ var shapes = {
|
|
|
9389
9461
|
},
|
|
9390
9462
|
"graph.node.resolution.set": {
|
|
9391
9463
|
...at,
|
|
9392
|
-
before:
|
|
9393
|
-
|
|
9464
|
+
before: strictObject({
|
|
9465
|
+
...wait,
|
|
9466
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9467
|
+
}),
|
|
9468
|
+
value: strictObject({
|
|
9469
|
+
...wait,
|
|
9470
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
9471
|
+
})
|
|
9394
9472
|
},
|
|
9395
9473
|
"graph.node.webhook.set": {
|
|
9396
9474
|
...at,
|
|
@@ -9451,12 +9529,14 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9451
9529
|
...shape
|
|
9452
9530
|
})])).values()])).min(1);
|
|
9453
9531
|
function checkModelVersion(content) {
|
|
9532
|
+
if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "webhook" && (candidateNode.options?.responseBody != null || candidateNode.options?.responseStatusCodeOutput != null || candidateNode.options?.responseHeadersSource != null || candidateNode.options?.responseHeaderOutputs != null))) throw new TypeError("Dynamic Webhook responses require Flow model version 10.");
|
|
9454
9533
|
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.");
|
|
9455
9534
|
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
|
|
9456
9535
|
if (candidateNode.onError != null) return true;
|
|
9457
9536
|
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;
|
|
9458
9537
|
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))));
|
|
9459
9538
|
})) throw new TypeError("Node error handling requires Flow model version 9.");
|
|
9539
|
+
if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidate) => candidate.kind === "webhook-response")) throw new TypeError("Webhook response nodes require Flow model version 10.");
|
|
9460
9540
|
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.");
|
|
9461
9541
|
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.");
|
|
9462
9542
|
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.");
|
|
@@ -9504,10 +9584,10 @@ function upgradeRevisionContent(content) {
|
|
|
9504
9584
|
function upgradeDecodedRevisionContent(content) {
|
|
9505
9585
|
const graph = content.document.graph;
|
|
9506
9586
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9507
|
-
if (!hasManual && content.modelVersion ==
|
|
9587
|
+
if (!hasManual && content.modelVersion == 10) return content;
|
|
9508
9588
|
return {
|
|
9509
9589
|
...content,
|
|
9510
|
-
modelVersion:
|
|
9590
|
+
modelVersion: 10,
|
|
9511
9591
|
document: {
|
|
9512
9592
|
...content.document,
|
|
9513
9593
|
graph: hasManual ? {
|
|
@@ -9782,6 +9862,10 @@ function canonicalNode(value) {
|
|
|
9782
9862
|
} }
|
|
9783
9863
|
};
|
|
9784
9864
|
switch (value.kind) {
|
|
9865
|
+
case "webhook-response": return {
|
|
9866
|
+
...common,
|
|
9867
|
+
kind: value.kind
|
|
9868
|
+
};
|
|
9785
9869
|
case "outputs": return {
|
|
9786
9870
|
...common,
|
|
9787
9871
|
kind: value.kind,
|
|
@@ -9823,7 +9907,8 @@ function canonicalNode(value) {
|
|
|
9823
9907
|
...common,
|
|
9824
9908
|
inputDefinitions: canonicalPorts(value.inputDefinitions),
|
|
9825
9909
|
kind: value.kind,
|
|
9826
|
-
prompt: value.prompt
|
|
9910
|
+
prompt: value.prompt,
|
|
9911
|
+
...value.kind == "wait" && value.autoContinue != null ? { autoContinue: { ...value.autoContinue } } : {}
|
|
9827
9912
|
};
|
|
9828
9913
|
}
|
|
9829
9914
|
}
|
|
@@ -9935,9 +10020,20 @@ function canonicalTriggerDefinition(snapshot) {
|
|
|
9935
10020
|
function canonicalWebhookOptions(value) {
|
|
9936
10021
|
return {
|
|
9937
10022
|
...value.allowedOrigins == null ? {} : { allowedOrigins: value.allowedOrigins },
|
|
10023
|
+
...value.responseBody == null ? {} : { responseBody: {
|
|
10024
|
+
kind: value.responseBody.kind,
|
|
10025
|
+
...value.responseBody.kind === "workflow-outputs" ? value.responseBody.output == null ? {} : { output: value.responseBody.output } : value.responseBody.nodeId == null ? {} : { nodeId: value.responseBody.nodeId },
|
|
10026
|
+
...value.responseBody.timeoutMs == null ? {} : { timeoutMs: value.responseBody.timeoutMs }
|
|
10027
|
+
} },
|
|
9938
10028
|
...value.responseData == null ? {} : { responseData: value.responseData },
|
|
9939
10029
|
...value.responseHeaders == null ? {} : { responseHeaders: value.responseHeaders },
|
|
9940
|
-
...value.
|
|
10030
|
+
...value.responseHeadersSource == null ? {} : { responseHeadersSource: {
|
|
10031
|
+
kind: value.responseHeadersSource.kind,
|
|
10032
|
+
...value.responseHeadersSource.output == null ? {} : { output: value.responseHeadersSource.output }
|
|
10033
|
+
} },
|
|
10034
|
+
...value.responseHeaderOutputs == null ? {} : { responseHeaderOutputs: value.responseHeaderOutputs },
|
|
10035
|
+
...value.responseStatusCode == null ? {} : { responseStatusCode: value.responseStatusCode },
|
|
10036
|
+
...value.responseStatusCodeOutput == null ? {} : { responseStatusCodeOutput: value.responseStatusCodeOutput }
|
|
9941
10037
|
};
|
|
9942
10038
|
}
|
|
9943
10039
|
function canonicalTriggerSchedule(value) {
|
|
@@ -10062,7 +10158,7 @@ function revisionRepairKind(bytes) {
|
|
|
10062
10158
|
return;
|
|
10063
10159
|
}
|
|
10064
10160
|
const source = value;
|
|
10065
|
-
return typeof source.modelVersion == "number" && source.modelVersion <
|
|
10161
|
+
return typeof source.modelVersion == "number" && source.modelVersion < 10 ? "upgrade" : "repair";
|
|
10066
10162
|
}
|
|
10067
10163
|
function repairRevision(bytes) {
|
|
10068
10164
|
return repairRevisionEnvelope(revisionValue(bytes));
|
|
@@ -3,6 +3,9 @@ import type { Diagnostic } from './flow-semantics.js';
|
|
|
3
3
|
export declare function isResolutionNode(node: GraphNode | undefined): node is Extract<GraphNode, {
|
|
4
4
|
readonly kind: 'approval' | 'wait';
|
|
5
5
|
}>;
|
|
6
|
+
/** Execution reachability is independent of data bindings and selected runtime branches. */
|
|
7
|
+
export declare function executionReachableNodes(graph: Graph, source: string): ReadonlySet<string>;
|
|
8
|
+
export declare function webhookResponseDiagnostics(graph: Graph, triggerId: string, path?: string): readonly Diagnostic[];
|
|
6
9
|
export declare function nodeInputPorts(node: GraphNode): Readonly<Record<string, InputPortDefinition>>;
|
|
7
10
|
export declare function resolutionActions(node: Extract<GraphNode, {
|
|
8
11
|
readonly kind: 'approval' | 'wait';
|