@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
package/dist/common/mcp.js
CHANGED
|
@@ -1019,7 +1019,7 @@ function timeSource(args) {
|
|
|
1019
1019
|
function time(args) {
|
|
1020
1020
|
return new RegExp(`^${timeSource(args)}$`);
|
|
1021
1021
|
}
|
|
1022
|
-
function datetime(args) {
|
|
1022
|
+
function datetime$1(args) {
|
|
1023
1023
|
const opts = ["Z"];
|
|
1024
1024
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
1025
1025
|
const qualified = `${timeSource({
|
|
@@ -1670,7 +1670,7 @@ var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
1670
1670
|
$ZodStringFormat.init(inst, def);
|
|
1671
1671
|
});
|
|
1672
1672
|
var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1673
|
-
def.pattern ?? (def.pattern = datetime(def));
|
|
1673
|
+
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1674
1674
|
$ZodStringFormat.init(inst, def);
|
|
1675
1675
|
});
|
|
1676
1676
|
var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
@@ -5851,6 +5851,11 @@ function preprocess(fn, schema) {
|
|
|
5851
5851
|
out: schema
|
|
5852
5852
|
});
|
|
5853
5853
|
}
|
|
5854
|
+
//#endregion
|
|
5855
|
+
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
5856
|
+
function datetime(params) {
|
|
5857
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
5858
|
+
}
|
|
5854
5859
|
/** Transient operations on each connected canvas's own viewport. */
|
|
5855
5860
|
var canvasCommandSchema = discriminatedUnion("type", [
|
|
5856
5861
|
strictObject({
|
|
@@ -6037,6 +6042,33 @@ var triggerScheduleSchema = array(union([object({
|
|
|
6037
6042
|
value: number()
|
|
6038
6043
|
})]));
|
|
6039
6044
|
//#endregion
|
|
6045
|
+
//#region src/localization/common/timeZone.ts
|
|
6046
|
+
/** Validate a named timezone using the same runtime data used for date conversion. */
|
|
6047
|
+
function isTimeZone(value) {
|
|
6048
|
+
try {
|
|
6049
|
+
Intl.DateTimeFormat("en", { timeZone: value });
|
|
6050
|
+
return true;
|
|
6051
|
+
} catch {
|
|
6052
|
+
return false;
|
|
6053
|
+
}
|
|
6054
|
+
}
|
|
6055
|
+
//#endregion
|
|
6056
|
+
//#region src/flow/common/wait.ts
|
|
6057
|
+
/** Drafts retain incomplete values; semantic validation gates publication and execution. */
|
|
6058
|
+
var waitAutoContinueDraftSchema = discriminatedUnion("kind", [strictObject({
|
|
6059
|
+
kind: literal("after"),
|
|
6060
|
+
durationMs: number().nullable()
|
|
6061
|
+
}), strictObject({
|
|
6062
|
+
kind: literal("at"),
|
|
6063
|
+
at: string$1(),
|
|
6064
|
+
timezone: string$1().optional()
|
|
6065
|
+
})]);
|
|
6066
|
+
/** Static business configuration; the deployment owns the allowed wait lifetime. */
|
|
6067
|
+
var waitAutoContinueSchema = discriminatedUnion("kind", [waitAutoContinueDraftSchema.options[0].extend({ durationMs: number().int().positive().max(Number.MAX_SAFE_INTEGER) }), waitAutoContinueDraftSchema.options[1].extend({
|
|
6068
|
+
at: datetime({ offset: true }),
|
|
6069
|
+
timezone: string$1().refine(isTimeZone, "Select a valid IANA timezone.").optional()
|
|
6070
|
+
})]);
|
|
6071
|
+
//#endregion
|
|
6040
6072
|
//#region src/flow/common/webhookMethod.ts
|
|
6041
6073
|
var webhookMethods = [
|
|
6042
6074
|
"GET",
|
|
@@ -6048,6 +6080,24 @@ var webhookMethods = [
|
|
|
6048
6080
|
function webhookSupportsBody(method) {
|
|
6049
6081
|
return method !== "GET";
|
|
6050
6082
|
}
|
|
6083
|
+
//#endregion
|
|
6084
|
+
//#region src/flow/common/webhookResponse.ts
|
|
6085
|
+
var webhookResponseTimeout = {
|
|
6086
|
+
defaultMs: 3e4,
|
|
6087
|
+
minMs: 1e3,
|
|
6088
|
+
maxMs: 6e4
|
|
6089
|
+
};
|
|
6090
|
+
({
|
|
6091
|
+
jsonSchema: {
|
|
6092
|
+
type: "object",
|
|
6093
|
+
additionalProperties: { type: [
|
|
6094
|
+
"string",
|
|
6095
|
+
"number",
|
|
6096
|
+
"boolean"
|
|
6097
|
+
] }
|
|
6098
|
+
},
|
|
6099
|
+
nullable: true
|
|
6100
|
+
}).jsonSchema;
|
|
6051
6101
|
var text = string$1();
|
|
6052
6102
|
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.");
|
|
6053
6103
|
var json$3 = json$4();
|
|
@@ -6275,9 +6325,24 @@ var webhookOptions = object({
|
|
|
6275
6325
|
allowedMethods: never().optional(),
|
|
6276
6326
|
allowedOrigins: strings$1.optional(),
|
|
6277
6327
|
noResponseBody: never().optional(),
|
|
6328
|
+
responseBody: discriminatedUnion("kind", [strictObject({
|
|
6329
|
+
kind: literal("workflow-outputs"),
|
|
6330
|
+
output: text.optional(),
|
|
6331
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
6332
|
+
}), strictObject({
|
|
6333
|
+
kind: literal("webhook-response"),
|
|
6334
|
+
nodeId: text.optional(),
|
|
6335
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
6336
|
+
})]).optional(),
|
|
6278
6337
|
responseData: text.optional(),
|
|
6279
6338
|
responseHeaders: record$2(text, text).optional(),
|
|
6280
|
-
|
|
6339
|
+
responseHeadersSource: strictObject({
|
|
6340
|
+
kind: literal("workflow-outputs"),
|
|
6341
|
+
output: text.optional()
|
|
6342
|
+
}).optional(),
|
|
6343
|
+
responseHeaderOutputs: record$2(text, text).optional(),
|
|
6344
|
+
responseStatusCode: number().int().min(200).max(599).optional(),
|
|
6345
|
+
responseStatusCodeOutput: text.optional()
|
|
6281
6346
|
});
|
|
6282
6347
|
var webhook = {
|
|
6283
6348
|
bodyFields: array(input),
|
|
@@ -6332,6 +6397,12 @@ var base = {
|
|
|
6332
6397
|
onError: _enum(["stop", "error"]).optional()
|
|
6333
6398
|
};
|
|
6334
6399
|
var node = union([
|
|
6400
|
+
strictObject({
|
|
6401
|
+
...base,
|
|
6402
|
+
kind: literal("webhook-response"),
|
|
6403
|
+
retry: never().optional(),
|
|
6404
|
+
onError: never().optional()
|
|
6405
|
+
}),
|
|
6335
6406
|
strictObject({
|
|
6336
6407
|
...base,
|
|
6337
6408
|
kind: literal("outputs"),
|
|
@@ -6364,7 +6435,8 @@ var node = union([
|
|
|
6364
6435
|
strictObject({
|
|
6365
6436
|
...base,
|
|
6366
6437
|
kind: literal("wait"),
|
|
6367
|
-
...wait
|
|
6438
|
+
...wait,
|
|
6439
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
6368
6440
|
}).omit({ timeoutMs: true }),
|
|
6369
6441
|
object({
|
|
6370
6442
|
...trigger,
|
|
@@ -6420,6 +6492,7 @@ var authoringDefinitionSchemas = {
|
|
|
6420
6492
|
ports: ports$1,
|
|
6421
6493
|
condition: strictObject(condition),
|
|
6422
6494
|
wait: strictObject(wait),
|
|
6495
|
+
waitAutoContinue: waitAutoContinueSchema,
|
|
6423
6496
|
webhook: strictObject(webhook),
|
|
6424
6497
|
schedule: triggerScheduleSchema,
|
|
6425
6498
|
capabilities: array(capability),
|
|
@@ -6466,7 +6539,8 @@ var revision = object({
|
|
|
6466
6539
|
literal(6),
|
|
6467
6540
|
literal(7),
|
|
6468
6541
|
literal(8),
|
|
6469
|
-
literal(9)
|
|
6542
|
+
literal(9),
|
|
6543
|
+
literal(10)
|
|
6470
6544
|
]),
|
|
6471
6545
|
document,
|
|
6472
6546
|
modules: record$2(text, module)
|
|
@@ -6599,8 +6673,14 @@ var shapes = {
|
|
|
6599
6673
|
},
|
|
6600
6674
|
"graph.node.resolution.set": {
|
|
6601
6675
|
...at,
|
|
6602
|
-
before:
|
|
6603
|
-
|
|
6676
|
+
before: strictObject({
|
|
6677
|
+
...wait,
|
|
6678
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
6679
|
+
}),
|
|
6680
|
+
value: strictObject({
|
|
6681
|
+
...wait,
|
|
6682
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
6683
|
+
})
|
|
6604
6684
|
},
|
|
6605
6685
|
"graph.node.webhook.set": {
|
|
6606
6686
|
...at,
|
|
@@ -6661,12 +6741,14 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
6661
6741
|
...shape
|
|
6662
6742
|
})])).values()])).min(1);
|
|
6663
6743
|
function checkModelVersion(content) {
|
|
6744
|
+
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.");
|
|
6664
6745
|
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.");
|
|
6665
6746
|
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
|
|
6666
6747
|
if (candidateNode.onError != null) return true;
|
|
6667
6748
|
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;
|
|
6668
6749
|
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))));
|
|
6669
6750
|
})) throw new TypeError("Node error handling requires Flow model version 9.");
|
|
6751
|
+
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.");
|
|
6670
6752
|
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.");
|
|
6671
6753
|
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.");
|
|
6672
6754
|
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.");
|
|
@@ -9500,6 +9582,7 @@ var patch = record$2(id$2, json$2);
|
|
|
9500
9582
|
var type = _enum([
|
|
9501
9583
|
"start",
|
|
9502
9584
|
"outputs",
|
|
9585
|
+
"webhook-response",
|
|
9503
9586
|
"workflow",
|
|
9504
9587
|
"webhook",
|
|
9505
9588
|
"cron",
|
|
@@ -9603,29 +9686,30 @@ var when = union([
|
|
|
9603
9686
|
strictObject({ any: array(union([expression, all])) })
|
|
9604
9687
|
]);
|
|
9605
9688
|
var authoringConfigurations = {
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9689
|
+
"webhook-response": strictObject({}),
|
|
9690
|
+
"workflow": strictObject({ flowId: id$2 }),
|
|
9691
|
+
"start": strictObject({ inputDefs: flowInputFields.default({}) }),
|
|
9692
|
+
"outputs": strictObject({ outputDefs: flowOutputFields.default({}) }),
|
|
9693
|
+
"error": strictObject({ sourceFlowIds: array(id$2).optional() }),
|
|
9694
|
+
"webhook": authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
|
|
9695
|
+
"cron": strictObject({ schedule: authoringDefinitionSchemas.schedule }),
|
|
9696
|
+
"poll": strictObject({
|
|
9613
9697
|
key: id$2,
|
|
9614
9698
|
connectionId: id$2.optional(),
|
|
9615
9699
|
schedule: authoringDefinitionSchemas.schedule
|
|
9616
9700
|
}),
|
|
9617
|
-
integration: strictObject({
|
|
9701
|
+
"integration": strictObject({
|
|
9618
9702
|
key: id$2,
|
|
9619
9703
|
connectionId: id$2.optional()
|
|
9620
9704
|
}),
|
|
9621
|
-
code: strictObject({
|
|
9705
|
+
"code": strictObject({
|
|
9622
9706
|
inputs: inputFields,
|
|
9623
9707
|
outputs: outputFields,
|
|
9624
9708
|
capabilities: authoringDefinitionSchemas.capabilities.optional()
|
|
9625
9709
|
}),
|
|
9626
|
-
connector: authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9627
|
-
openapi: authoringOpenApiSchema,
|
|
9628
|
-
agent: authoringDefinitionSchemas.agent.omit({
|
|
9710
|
+
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9711
|
+
"openapi": authoringOpenApiSchema,
|
|
9712
|
+
"agent": authoringDefinitionSchemas.agent.omit({
|
|
9629
9713
|
prompt: true,
|
|
9630
9714
|
tools: true
|
|
9631
9715
|
}).extend({
|
|
@@ -9634,9 +9718,9 @@ var authoringConfigurations = {
|
|
|
9634
9718
|
tools: array(agentTool),
|
|
9635
9719
|
notification: notification.optional()
|
|
9636
9720
|
}).strict(),
|
|
9637
|
-
llm: authoringLlmConfiguration.extend({ inputs: inputFields }),
|
|
9638
|
-
decision: authoringDefinitionSchemas.decision,
|
|
9639
|
-
condition: strictObject({
|
|
9721
|
+
"llm": authoringLlmConfiguration.extend({ inputs: inputFields }),
|
|
9722
|
+
"decision": authoringDefinitionSchemas.decision,
|
|
9723
|
+
"condition": strictObject({
|
|
9640
9724
|
match: _enum(["first", "all"]),
|
|
9641
9725
|
branches: array(strictObject({
|
|
9642
9726
|
name: id$2,
|
|
@@ -9644,12 +9728,15 @@ var authoringConfigurations = {
|
|
|
9644
9728
|
when
|
|
9645
9729
|
}))
|
|
9646
9730
|
}),
|
|
9647
|
-
value: strictObject({
|
|
9731
|
+
"value": strictObject({
|
|
9648
9732
|
values: patch,
|
|
9649
9733
|
outputs: outputFields
|
|
9650
9734
|
}),
|
|
9651
|
-
wait: strictObject({
|
|
9652
|
-
|
|
9735
|
+
"wait": strictObject({
|
|
9736
|
+
inputs: inputFields,
|
|
9737
|
+
autoContinue: authoringDefinitionSchemas.waitAutoContinue.optional().describe("Wait only. Omit to disable; clear config.autoContinue to remove. after counts from each wait registration; at requires an explicit offset and continues immediately if already past. Optional timezone preserves the editor zone; at remains the absolute instant. Server requires the deadline to precede the 7-day expiry.")
|
|
9738
|
+
}),
|
|
9739
|
+
"approval": strictObject({ inputs: inputFields })
|
|
9653
9740
|
};
|
|
9654
9741
|
var updates = strictObject({
|
|
9655
9742
|
onError: _enum(["stop", "error"]).optional(),
|
|
@@ -9814,7 +9901,7 @@ var resultQuerySchema = strictObject({
|
|
|
9814
9901
|
});
|
|
9815
9902
|
//#endregion
|
|
9816
9903
|
//#region src/execution/common/engineContract.ts
|
|
9817
|
-
var currentEngineContract = "open-flow-engine/
|
|
9904
|
+
var currentEngineContract = "open-flow-engine/v7";
|
|
9818
9905
|
`${JSON.stringify(currentEngineContract)}`, new Set([
|
|
9819
9906
|
"assert",
|
|
9820
9907
|
"assert/strict",
|
|
@@ -9840,7 +9927,7 @@ var currentEngineContract = "open-flow-engine/v6";
|
|
|
9840
9927
|
"url",
|
|
9841
9928
|
"util",
|
|
9842
9929
|
"zlib"
|
|
9843
|
-
].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/
|
|
9930
|
+
].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v7/nodejs-compat-v1")}`;
|
|
9844
9931
|
//#endregion
|
|
9845
9932
|
//#region src/workflow/common/workflow.ts
|
|
9846
9933
|
var portSchema = object({
|
|
@@ -11398,6 +11485,7 @@ function runWaiting(value) {
|
|
|
11398
11485
|
if (!Array.isArray(actions) || !(actions.length == 1 && actions[0] == "continue" || actions.length == 2 && actions[0] == "approve" && actions[1] == "reject")) return invalidResponse();
|
|
11399
11486
|
return {
|
|
11400
11487
|
actions,
|
|
11488
|
+
...source.autoContinueAt === void 0 ? {} : { autoContinueAt: string(source.autoContinueAt) },
|
|
11401
11489
|
expiresAt: string(source.expiresAt),
|
|
11402
11490
|
nodeId: string(source.nodeId),
|
|
11403
11491
|
prompt: string(source.prompt),
|
|
@@ -11669,24 +11757,32 @@ function decodeRunEvent(value) {
|
|
|
11669
11757
|
kind,
|
|
11670
11758
|
payload: { waitIds: payload.waitIds.map((id) => string(id)) }
|
|
11671
11759
|
};
|
|
11672
|
-
case "wait.created":
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11760
|
+
case "wait.created": {
|
|
11761
|
+
const timing = payload.autoContinueAt === void 0 ? {} : { autoContinueAt: string(payload.autoContinueAt) };
|
|
11762
|
+
return {
|
|
11763
|
+
...base,
|
|
11764
|
+
kind,
|
|
11765
|
+
payload: {
|
|
11766
|
+
...timing,
|
|
11767
|
+
expiresAt: string(payload.expiresAt),
|
|
11768
|
+
nodeId: string(payload.nodeId),
|
|
11769
|
+
waitId: string(payload.waitId),
|
|
11770
|
+
waitingSince: string(payload.waitingSince)
|
|
11771
|
+
}
|
|
11772
|
+
};
|
|
11773
|
+
}
|
|
11682
11774
|
case "run.resolved": {
|
|
11683
11775
|
const action = payload.action;
|
|
11776
|
+
const resolutionSource = payload.source;
|
|
11777
|
+
if (resolutionSource !== void 0 && resolutionSource !== "manual" && resolutionSource !== "automatic") return invalidResponse();
|
|
11778
|
+
const audit = resolutionSource === void 0 ? {} : { source: resolutionSource };
|
|
11684
11779
|
if (action !== "approve" && action !== "continue" && action !== "reject") return invalidResponse();
|
|
11685
11780
|
if (payload.comment !== null && typeof payload.comment != "string") return invalidResponse();
|
|
11686
11781
|
return {
|
|
11687
11782
|
...base,
|
|
11688
11783
|
kind,
|
|
11689
11784
|
payload: {
|
|
11785
|
+
...audit,
|
|
11690
11786
|
action,
|
|
11691
11787
|
comment: payload.comment,
|
|
11692
11788
|
resolvedAt: string(payload.resolvedAt),
|
|
@@ -11722,7 +11818,7 @@ function decodeRunEvent(value) {
|
|
|
11722
11818
|
switch (kind) {
|
|
11723
11819
|
case "node.started": {
|
|
11724
11820
|
const nodeKind = payload.nodeKind;
|
|
11725
|
-
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();
|
|
11821
|
+
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 !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
11726
11822
|
return {
|
|
11727
11823
|
...base,
|
|
11728
11824
|
kind,
|
package/dist/common/openapi.js
CHANGED
|
@@ -1923,7 +1923,7 @@ function timeSource(args) {
|
|
|
1923
1923
|
function time(args) {
|
|
1924
1924
|
return new RegExp(`^${timeSource(args)}$`);
|
|
1925
1925
|
}
|
|
1926
|
-
function datetime(args) {
|
|
1926
|
+
function datetime$1(args) {
|
|
1927
1927
|
const opts = ["Z"];
|
|
1928
1928
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
1929
1929
|
const qualified = `${timeSource({
|
|
@@ -2574,7 +2574,7 @@ var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
2574
2574
|
$ZodStringFormat.init(inst, def);
|
|
2575
2575
|
});
|
|
2576
2576
|
var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
2577
|
-
def.pattern ?? (def.pattern = datetime(def));
|
|
2577
|
+
def.pattern ?? (def.pattern = datetime$1(def));
|
|
2578
2578
|
$ZodStringFormat.init(inst, def);
|
|
2579
2579
|
});
|
|
2580
2580
|
var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
@@ -6571,6 +6571,11 @@ function preprocess(fn, schema) {
|
|
|
6571
6571
|
});
|
|
6572
6572
|
}
|
|
6573
6573
|
//#endregion
|
|
6574
|
+
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
6575
|
+
function datetime(params) {
|
|
6576
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
6577
|
+
}
|
|
6578
|
+
//#endregion
|
|
6574
6579
|
//#region src/decision/common/decision.ts
|
|
6575
6580
|
var decisionLimits = {
|
|
6576
6581
|
choice: 255,
|
|
@@ -6690,6 +6695,32 @@ var triggerScheduleSchema = array(union([object$1({
|
|
|
6690
6695
|
value: number()
|
|
6691
6696
|
})]));
|
|
6692
6697
|
//#endregion
|
|
6698
|
+
//#region src/localization/common/timeZone.ts
|
|
6699
|
+
/** Validate a named timezone using the same runtime data used for date conversion. */
|
|
6700
|
+
function isTimeZone(value) {
|
|
6701
|
+
try {
|
|
6702
|
+
Intl.DateTimeFormat("en", { timeZone: value });
|
|
6703
|
+
return true;
|
|
6704
|
+
} catch {
|
|
6705
|
+
return false;
|
|
6706
|
+
}
|
|
6707
|
+
}
|
|
6708
|
+
//#endregion
|
|
6709
|
+
//#region src/flow/common/wait.ts
|
|
6710
|
+
/** Drafts retain incomplete values; semantic validation gates publication and execution. */
|
|
6711
|
+
var waitAutoContinueDraftSchema = discriminatedUnion("kind", [strictObject({
|
|
6712
|
+
kind: literal("after"),
|
|
6713
|
+
durationMs: number().nullable()
|
|
6714
|
+
}), strictObject({
|
|
6715
|
+
kind: literal("at"),
|
|
6716
|
+
at: string(),
|
|
6717
|
+
timezone: string().optional()
|
|
6718
|
+
})]);
|
|
6719
|
+
discriminatedUnion("kind", [waitAutoContinueDraftSchema.options[0].extend({ durationMs: number().int().positive().max(Number.MAX_SAFE_INTEGER) }), waitAutoContinueDraftSchema.options[1].extend({
|
|
6720
|
+
at: datetime({ offset: true }),
|
|
6721
|
+
timezone: string().refine(isTimeZone, "Select a valid IANA timezone.").optional()
|
|
6722
|
+
})]);
|
|
6723
|
+
//#endregion
|
|
6693
6724
|
//#region src/flow/common/webhookMethod.ts
|
|
6694
6725
|
var webhookMethods = [
|
|
6695
6726
|
"GET",
|
|
@@ -6698,6 +6729,24 @@ var webhookMethods = [
|
|
|
6698
6729
|
"PATCH",
|
|
6699
6730
|
"DELETE"
|
|
6700
6731
|
];
|
|
6732
|
+
//#endregion
|
|
6733
|
+
//#region src/flow/common/webhookResponse.ts
|
|
6734
|
+
var webhookResponseTimeout = {
|
|
6735
|
+
defaultMs: 3e4,
|
|
6736
|
+
minMs: 1e3,
|
|
6737
|
+
maxMs: 6e4
|
|
6738
|
+
};
|
|
6739
|
+
({
|
|
6740
|
+
jsonSchema: {
|
|
6741
|
+
type: "object",
|
|
6742
|
+
additionalProperties: { type: [
|
|
6743
|
+
"string",
|
|
6744
|
+
"number",
|
|
6745
|
+
"boolean"
|
|
6746
|
+
] }
|
|
6747
|
+
},
|
|
6748
|
+
nullable: true
|
|
6749
|
+
}).jsonSchema;
|
|
6701
6750
|
var text = string();
|
|
6702
6751
|
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.");
|
|
6703
6752
|
var json = json$1();
|
|
@@ -6925,9 +6974,24 @@ var webhookOptions = object$1({
|
|
|
6925
6974
|
allowedMethods: never().optional(),
|
|
6926
6975
|
allowedOrigins: strings.optional(),
|
|
6927
6976
|
noResponseBody: never().optional(),
|
|
6977
|
+
responseBody: discriminatedUnion("kind", [strictObject({
|
|
6978
|
+
kind: literal("workflow-outputs"),
|
|
6979
|
+
output: text.optional(),
|
|
6980
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
6981
|
+
}), strictObject({
|
|
6982
|
+
kind: literal("webhook-response"),
|
|
6983
|
+
nodeId: text.optional(),
|
|
6984
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
6985
|
+
})]).optional(),
|
|
6928
6986
|
responseData: text.optional(),
|
|
6929
6987
|
responseHeaders: record$1(text, text).optional(),
|
|
6930
|
-
|
|
6988
|
+
responseHeadersSource: strictObject({
|
|
6989
|
+
kind: literal("workflow-outputs"),
|
|
6990
|
+
output: text.optional()
|
|
6991
|
+
}).optional(),
|
|
6992
|
+
responseHeaderOutputs: record$1(text, text).optional(),
|
|
6993
|
+
responseStatusCode: number().int().min(200).max(599).optional(),
|
|
6994
|
+
responseStatusCodeOutput: text.optional()
|
|
6931
6995
|
});
|
|
6932
6996
|
var webhook = {
|
|
6933
6997
|
bodyFields: array(input),
|
|
@@ -6982,6 +7046,12 @@ var base = {
|
|
|
6982
7046
|
onError: _enum(["stop", "error"]).optional()
|
|
6983
7047
|
};
|
|
6984
7048
|
var node = union([
|
|
7049
|
+
strictObject({
|
|
7050
|
+
...base,
|
|
7051
|
+
kind: literal("webhook-response"),
|
|
7052
|
+
retry: never().optional(),
|
|
7053
|
+
onError: never().optional()
|
|
7054
|
+
}),
|
|
6985
7055
|
strictObject({
|
|
6986
7056
|
...base,
|
|
6987
7057
|
kind: literal("outputs"),
|
|
@@ -7014,7 +7084,8 @@ var node = union([
|
|
|
7014
7084
|
strictObject({
|
|
7015
7085
|
...base,
|
|
7016
7086
|
kind: literal("wait"),
|
|
7017
|
-
...wait
|
|
7087
|
+
...wait,
|
|
7088
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
7018
7089
|
}).omit({ timeoutMs: true }),
|
|
7019
7090
|
object$1({
|
|
7020
7091
|
...trigger,
|
|
@@ -7101,7 +7172,8 @@ object$1({
|
|
|
7101
7172
|
literal(6),
|
|
7102
7173
|
literal(7),
|
|
7103
7174
|
literal(8),
|
|
7104
|
-
literal(9)
|
|
7175
|
+
literal(9),
|
|
7176
|
+
literal(10)
|
|
7105
7177
|
]),
|
|
7106
7178
|
document,
|
|
7107
7179
|
modules: record$1(text, module)
|
|
@@ -7226,8 +7298,14 @@ var shapes = {
|
|
|
7226
7298
|
},
|
|
7227
7299
|
"graph.node.resolution.set": {
|
|
7228
7300
|
...at,
|
|
7229
|
-
before:
|
|
7230
|
-
|
|
7301
|
+
before: strictObject({
|
|
7302
|
+
...wait,
|
|
7303
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
7304
|
+
}),
|
|
7305
|
+
value: strictObject({
|
|
7306
|
+
...wait,
|
|
7307
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
7308
|
+
})
|
|
7231
7309
|
},
|
|
7232
7310
|
"graph.node.webhook.set": {
|
|
7233
7311
|
...at,
|
|
@@ -1930,7 +1930,7 @@ function timeSource(args) {
|
|
|
1930
1930
|
function time(args) {
|
|
1931
1931
|
return new RegExp(`^${timeSource(args)}$`);
|
|
1932
1932
|
}
|
|
1933
|
-
function datetime(args) {
|
|
1933
|
+
function datetime$1(args) {
|
|
1934
1934
|
const opts = ["Z"];
|
|
1935
1935
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
1936
1936
|
const qualified = `${timeSource({
|
|
@@ -2581,7 +2581,7 @@ var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
2581
2581
|
$ZodStringFormat.init(inst, def);
|
|
2582
2582
|
});
|
|
2583
2583
|
var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
2584
|
-
def.pattern ?? (def.pattern = datetime(def));
|
|
2584
|
+
def.pattern ?? (def.pattern = datetime$1(def));
|
|
2585
2585
|
$ZodStringFormat.init(inst, def);
|
|
2586
2586
|
});
|
|
2587
2587
|
var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
@@ -6578,6 +6578,11 @@ function preprocess(fn, schema) {
|
|
|
6578
6578
|
});
|
|
6579
6579
|
}
|
|
6580
6580
|
//#endregion
|
|
6581
|
+
//#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
6582
|
+
function datetime(params) {
|
|
6583
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
6584
|
+
}
|
|
6585
|
+
//#endregion
|
|
6581
6586
|
//#region src/decision/common/decision.ts
|
|
6582
6587
|
var decisionLimits = {
|
|
6583
6588
|
choice: 255,
|
|
@@ -6697,6 +6702,32 @@ var triggerScheduleSchema = array(union([object({
|
|
|
6697
6702
|
value: number()
|
|
6698
6703
|
})]));
|
|
6699
6704
|
//#endregion
|
|
6705
|
+
//#region src/localization/common/timeZone.ts
|
|
6706
|
+
/** Validate a named timezone using the same runtime data used for date conversion. */
|
|
6707
|
+
function isTimeZone(value) {
|
|
6708
|
+
try {
|
|
6709
|
+
Intl.DateTimeFormat("en", { timeZone: value });
|
|
6710
|
+
return true;
|
|
6711
|
+
} catch {
|
|
6712
|
+
return false;
|
|
6713
|
+
}
|
|
6714
|
+
}
|
|
6715
|
+
//#endregion
|
|
6716
|
+
//#region src/flow/common/wait.ts
|
|
6717
|
+
/** Drafts retain incomplete values; semantic validation gates publication and execution. */
|
|
6718
|
+
var waitAutoContinueDraftSchema = discriminatedUnion("kind", [strictObject({
|
|
6719
|
+
kind: literal("after"),
|
|
6720
|
+
durationMs: number().nullable()
|
|
6721
|
+
}), strictObject({
|
|
6722
|
+
kind: literal("at"),
|
|
6723
|
+
at: string(),
|
|
6724
|
+
timezone: string().optional()
|
|
6725
|
+
})]);
|
|
6726
|
+
discriminatedUnion("kind", [waitAutoContinueDraftSchema.options[0].extend({ durationMs: number().int().positive().max(Number.MAX_SAFE_INTEGER) }), waitAutoContinueDraftSchema.options[1].extend({
|
|
6727
|
+
at: datetime({ offset: true }),
|
|
6728
|
+
timezone: string().refine(isTimeZone, "Select a valid IANA timezone.").optional()
|
|
6729
|
+
})]);
|
|
6730
|
+
//#endregion
|
|
6700
6731
|
//#region src/flow/common/webhookMethod.ts
|
|
6701
6732
|
var webhookMethods = [
|
|
6702
6733
|
"GET",
|
|
@@ -6705,6 +6736,24 @@ var webhookMethods = [
|
|
|
6705
6736
|
"PATCH",
|
|
6706
6737
|
"DELETE"
|
|
6707
6738
|
];
|
|
6739
|
+
//#endregion
|
|
6740
|
+
//#region src/flow/common/webhookResponse.ts
|
|
6741
|
+
var webhookResponseTimeout = {
|
|
6742
|
+
defaultMs: 3e4,
|
|
6743
|
+
minMs: 1e3,
|
|
6744
|
+
maxMs: 6e4
|
|
6745
|
+
};
|
|
6746
|
+
({
|
|
6747
|
+
jsonSchema: {
|
|
6748
|
+
type: "object",
|
|
6749
|
+
additionalProperties: { type: [
|
|
6750
|
+
"string",
|
|
6751
|
+
"number",
|
|
6752
|
+
"boolean"
|
|
6753
|
+
] }
|
|
6754
|
+
},
|
|
6755
|
+
nullable: true
|
|
6756
|
+
}).jsonSchema;
|
|
6708
6757
|
var text = string();
|
|
6709
6758
|
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.");
|
|
6710
6759
|
var json = json$1();
|
|
@@ -6932,9 +6981,24 @@ var webhookOptions = object({
|
|
|
6932
6981
|
allowedMethods: never().optional(),
|
|
6933
6982
|
allowedOrigins: strings.optional(),
|
|
6934
6983
|
noResponseBody: never().optional(),
|
|
6984
|
+
responseBody: discriminatedUnion("kind", [strictObject({
|
|
6985
|
+
kind: literal("workflow-outputs"),
|
|
6986
|
+
output: text.optional(),
|
|
6987
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
6988
|
+
}), strictObject({
|
|
6989
|
+
kind: literal("webhook-response"),
|
|
6990
|
+
nodeId: text.optional(),
|
|
6991
|
+
timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
|
|
6992
|
+
})]).optional(),
|
|
6935
6993
|
responseData: text.optional(),
|
|
6936
6994
|
responseHeaders: record$1(text, text).optional(),
|
|
6937
|
-
|
|
6995
|
+
responseHeadersSource: strictObject({
|
|
6996
|
+
kind: literal("workflow-outputs"),
|
|
6997
|
+
output: text.optional()
|
|
6998
|
+
}).optional(),
|
|
6999
|
+
responseHeaderOutputs: record$1(text, text).optional(),
|
|
7000
|
+
responseStatusCode: number().int().min(200).max(599).optional(),
|
|
7001
|
+
responseStatusCodeOutput: text.optional()
|
|
6938
7002
|
});
|
|
6939
7003
|
var webhook = {
|
|
6940
7004
|
bodyFields: array(input),
|
|
@@ -6989,6 +7053,12 @@ var base = {
|
|
|
6989
7053
|
onError: _enum(["stop", "error"]).optional()
|
|
6990
7054
|
};
|
|
6991
7055
|
var node = union([
|
|
7056
|
+
strictObject({
|
|
7057
|
+
...base,
|
|
7058
|
+
kind: literal("webhook-response"),
|
|
7059
|
+
retry: never().optional(),
|
|
7060
|
+
onError: never().optional()
|
|
7061
|
+
}),
|
|
6992
7062
|
strictObject({
|
|
6993
7063
|
...base,
|
|
6994
7064
|
kind: literal("outputs"),
|
|
@@ -7021,7 +7091,8 @@ var node = union([
|
|
|
7021
7091
|
strictObject({
|
|
7022
7092
|
...base,
|
|
7023
7093
|
kind: literal("wait"),
|
|
7024
|
-
...wait
|
|
7094
|
+
...wait,
|
|
7095
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
7025
7096
|
}).omit({ timeoutMs: true }),
|
|
7026
7097
|
object({
|
|
7027
7098
|
...trigger,
|
|
@@ -7108,7 +7179,8 @@ object({
|
|
|
7108
7179
|
literal(6),
|
|
7109
7180
|
literal(7),
|
|
7110
7181
|
literal(8),
|
|
7111
|
-
literal(9)
|
|
7182
|
+
literal(9),
|
|
7183
|
+
literal(10)
|
|
7112
7184
|
]),
|
|
7113
7185
|
document,
|
|
7114
7186
|
modules: record$1(text, module)
|
|
@@ -7233,8 +7305,14 @@ var shapes = {
|
|
|
7233
7305
|
},
|
|
7234
7306
|
"graph.node.resolution.set": {
|
|
7235
7307
|
...at,
|
|
7236
|
-
before:
|
|
7237
|
-
|
|
7308
|
+
before: strictObject({
|
|
7309
|
+
...wait,
|
|
7310
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
7311
|
+
}),
|
|
7312
|
+
value: strictObject({
|
|
7313
|
+
...wait,
|
|
7314
|
+
autoContinue: waitAutoContinueDraftSchema.optional()
|
|
7315
|
+
})
|
|
7238
7316
|
},
|
|
7239
7317
|
"graph.node.webhook.set": {
|
|
7240
7318
|
...at,
|