@fluidgrids/workflows 2026.1027.1 → 2026.1028.2
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/README.md +144 -13
- package/dist/activation-BBh1p82z.d.cts +57 -0
- package/dist/activation-DnhG7SmF.d.ts +57 -0
- package/dist/assemble-BLqQ8lSu.d.cts +39 -0
- package/dist/assemble-DWgaXHd-.d.ts +39 -0
- package/dist/chunk-2J6TF7YI.cjs +86 -0
- package/dist/chunk-4LYSEANA.js +199 -0
- package/dist/chunk-623FVQSN.cjs +251 -0
- package/dist/{chunk-W32BSO3M.js → chunk-6FSHT5IL.js} +2 -2
- package/dist/{chunk-E3APHA6O.cjs → chunk-7AAZGVKD.js} +1 -64
- package/dist/chunk-ABFZWYHT.js +612 -0
- package/dist/{chunk-6U446SKY.js → chunk-BD7ZPG53.js} +2 -2
- package/dist/chunk-BO6OVILK.js +79 -0
- package/dist/chunk-C5OLWZ42.js +245 -0
- package/dist/{chunk-OSPTJCDI.cjs → chunk-CPDK3K5N.cjs} +6 -6
- package/dist/chunk-DHTLALBL.cjs +80 -0
- package/dist/chunk-DJYMDLV5.js +227 -0
- package/dist/{chunk-IHKXLG6I.js → chunk-E2VK7J2C.js} +1 -1
- package/dist/{chunk-3M34AUIY.cjs → chunk-FEW3JBYA.cjs} +3 -3
- package/dist/chunk-FMSW2HDF.cjs +267 -0
- package/dist/chunk-FR7KYWRO.cjs +41 -0
- package/dist/{chunk-7YR7DI7B.cjs → chunk-GBQ33SIZ.cjs} +44 -44
- package/dist/{chunk-6AIAC2FP.cjs → chunk-GVTZMA5C.cjs} +4 -4
- package/dist/{chunk-EEAIM35V.js → chunk-HWJZVOG7.js} +64 -23
- package/dist/chunk-I5LR3D2K.js +869 -0
- package/dist/chunk-IISBRUWJ.js +13 -0
- package/dist/chunk-JD2VQIDZ.cjs +15 -0
- package/dist/{chunk-UB2BHU2M.js → chunk-JZ4TOOLN.js} +1 -1
- package/dist/chunk-L24YIZY7.cjs +207 -0
- package/dist/chunk-LNUQE6D6.js +39 -0
- package/dist/chunk-M4BBAERY.cjs +1635 -0
- package/dist/chunk-N23SKIG4.js +73 -0
- package/dist/{chunk-TWOYB4Y7.cjs → chunk-NEIUQASE.cjs} +13 -13
- package/dist/chunk-P6TA5EZT.cjs +634 -0
- package/dist/chunk-PMCM2OH4.js +46 -0
- package/dist/chunk-PZCVF76Q.cjs +868 -0
- package/dist/{chunk-6BEW4QD6.js → chunk-QAN5MZEM.js} +1 -1
- package/dist/{chunk-CSYBNN3V.cjs → chunk-QKZL3ONM.cjs} +2 -2
- package/dist/chunk-QQ6ULXHI.cjs +885 -0
- package/dist/chunk-SAENRNBJ.cjs +52 -0
- package/dist/{chunk-TQF7MYEN.cjs → chunk-SAOBPYYJ.cjs} +134 -96
- package/dist/{chunk-XBIID5DY.js → chunk-SMCANK3F.js} +5 -4
- package/dist/{chunk-UWQWD7BP.cjs → chunk-SX2PNKKT.cjs} +18 -17
- package/dist/{chunk-UJNHTS6D.js → chunk-TBDXTV22.cjs} +8 -45
- package/dist/chunk-UK3WM7YZ.cjs +75 -0
- package/dist/chunk-VOKMAAJP.js +848 -0
- package/dist/chunk-VRHHBPT6.js +1622 -0
- package/dist/{chunk-5AW745OG.js → chunk-XHXIDVEC.js} +1 -1
- package/dist/chunk-XKJA7KX3.js +72 -0
- package/dist/chunk-Z2Y65YOY.cjs +7 -0
- package/dist/codegen/index.cjs +9 -7
- package/dist/codegen/index.d.cts +2 -2
- package/dist/codegen/index.d.ts +2 -2
- package/dist/codegen/index.js +6 -5
- package/dist/file-BOoHZgoQ.d.cts +1557 -0
- package/dist/file-yuPCFU5b.d.ts +1557 -0
- package/dist/history/index.cjs +287 -0
- package/dist/history/index.d.cts +157 -0
- package/dist/history/index.d.ts +157 -0
- package/dist/history/index.js +5 -0
- package/dist/index.cjs +134 -36
- package/dist/index.d.cts +137 -9
- package/dist/index.d.ts +137 -9
- package/dist/index.js +8 -3
- package/dist/ir/index.cjs +152 -158
- package/dist/ir/index.d.cts +14 -4
- package/dist/ir/index.d.ts +14 -4
- package/dist/ir/index.js +41 -50
- package/dist/lower-BzmUz0sq.d.cts +129 -0
- package/dist/lower-_-iT4HYs.d.ts +129 -0
- package/dist/lower-types-DQNBfWQn.d.cts +37 -0
- package/dist/lower-types-DQNBfWQn.d.ts +37 -0
- package/dist/{manifest-Duf-gHdO.d.cts → manifest-0OLw0i7k.d.cts} +1 -1
- package/dist/{manifest-Bp9ZJlav.d.ts → manifest-C8N6HDYl.d.ts} +1 -1
- package/dist/node-evaluator-4MSDKWOG.cjs +22 -0
- package/dist/node-evaluator-SX4LEYQC.js +12 -0
- package/dist/quickjs/index.cjs +236 -12
- package/dist/quickjs/index.d.cts +46 -5
- package/dist/quickjs/index.d.ts +46 -5
- package/dist/quickjs/index.js +230 -9
- package/dist/roundtrip/index.cjs +333 -131
- package/dist/roundtrip/index.d.cts +39 -7
- package/dist/roundtrip/index.d.ts +39 -7
- package/dist/roundtrip/index.js +185 -13
- package/dist/runtime/index.cjs +90 -0
- package/dist/runtime/index.d.cts +297 -0
- package/dist/runtime/index.d.ts +297 -0
- package/dist/runtime/index.js +8 -0
- package/dist/testing/index.cjs +1057 -0
- package/dist/testing/index.d.cts +305 -0
- package/dist/testing/index.d.ts +305 -0
- package/dist/testing/index.js +1037 -0
- package/dist/{types-Dr2Fn1Ax.d.ts → types-BGoPzgcl.d.cts} +1 -1
- package/dist/{types-Dr2Fn1Ax.d.cts → types-BGoPzgcl.d.ts} +1 -1
- package/dist/types-CpBBjaGX.d.cts +380 -0
- package/dist/types-DV-HX_Gt.d.ts +380 -0
- package/dist/{assemble-CrpUyd_3.d.ts → workflow-Bpr3vnA_.d.ts} +40 -160
- package/dist/workflow-C2a05WUJ.d.ts +444 -0
- package/dist/{assemble-DEf3znGD.d.cts → workflow-FXUkpIBc.d.cts} +40 -160
- package/dist/workflow-J-yYixny.d.cts +444 -0
- package/fixtures/README.md +128 -0
- package/fixtures/histories/activity-failure-fails-run.history.json +163 -0
- package/fixtures/histories/activity-retry-then-success.history.json +147 -0
- package/fixtures/histories/cancel-activity-abandon.history.json +126 -0
- package/fixtures/histories/cancel-activity-compensate.history.json +307 -0
- package/fixtures/histories/cancel-concurrent-non-cancellable.history.json +234 -0
- package/fixtures/histories/cancel-concurrent-scope-timeout.history.json +184 -0
- package/fixtures/histories/cancel-condition-after-cancel.history.json +200 -0
- package/fixtures/histories/cancel-during-timer.history.json +123 -0
- package/fixtures/histories/cancel-saga-compensations.history.json +325 -0
- package/fixtures/histories/cancel-scope-timeout.history.json +148 -0
- package/fixtures/histories/child-abandon-outlives-parent.history.json +191 -0
- package/fixtures/histories/child-cancel-default.history.json +234 -0
- package/fixtures/histories/child-cancel-request.history.json +206 -0
- package/fixtures/histories/child-durable-child-side.history.json +124 -0
- package/fixtures/histories/child-durable-result.history.json +163 -0
- package/fixtures/histories/child-failure-caught.history.json +166 -0
- package/fixtures/histories/child-graph-by-key.history.json +138 -0
- package/fixtures/histories/child-terminated-by-parent-close.history.json +85 -0
- package/fixtures/histories/continue-as-new-first-run.history.json +146 -0
- package/fixtures/histories/continue-as-new-history-limit.history.json +489 -0
- package/fixtures/histories/continue-as-new-last-run.history.json +147 -0
- package/fixtures/histories/continue-as-new-suggested.history.json +352 -0
- package/fixtures/histories/details-and-context.history.json +176 -0
- package/fixtures/histories/deterministic-values.history.json +128 -0
- package/fixtures/histories/engine-builtins.history.json +172 -0
- package/fixtures/histories/gather-activities.history.json +291 -0
- package/fixtures/histories/gather-all-settled.history.json +219 -0
- package/fixtures/histories/gather-mixed.history.json +281 -0
- package/fixtures/histories/input-during-running-task.history.json +111 -0
- package/fixtures/histories/nondeterminism-reordered.history.json +218 -0
- package/fixtures/histories/patched-deprecated.history.json +271 -0
- package/fixtures/histories/patched-new-run.history.json +270 -0
- package/fixtures/histories/patched-old-history.history.json +190 -0
- package/fixtures/histories/race-activity-wins.history.json +152 -0
- package/fixtures/histories/race-signal-beats-child.history.json +161 -0
- package/fixtures/histories/race-timeout-wins.history.json +118 -0
- package/fixtures/histories/side-effect-recorded.history.json +153 -0
- package/fixtures/histories/signal-buffered-at-start.history.json +157 -0
- package/fixtures/histories/signal-default-handler.history.json +187 -0
- package/fixtures/histories/signal-handler.history.json +191 -0
- package/fixtures/histories/signal-parent-child-side.history.json +132 -0
- package/fixtures/histories/signal-parent.history.json +202 -0
- package/fixtures/histories/signal-run-delivered.history.json +128 -0
- package/fixtures/histories/signal-run-undelivered.history.json +134 -0
- package/fixtures/histories/signal-wait.history.json +111 -0
- package/fixtures/histories/task-failure-code-error.history.json +137 -0
- package/fixtures/histories/task-failure-then-transient-attempt.history.json +140 -0
- package/fixtures/histories/timer-condition-met.history.json +201 -0
- package/fixtures/histories/timer-condition-timeout.history.json +118 -0
- package/fixtures/histories/timer-sleep-once.history.json +118 -0
- package/fixtures/histories/timer-sleep-sequence.history.json +210 -0
- package/fixtures/histories/update-accepted-completed.history.json +149 -0
- package/fixtures/histories/update-with-start-rejected-validation.history.json +91 -0
- package/package.json +44 -5
- package/schema/history-file.schema.json +2544 -0
- package/schema/ir-v2.schema.json +16 -0
- package/schema/run-event.schema.json +2374 -0
- package/schema/workflow-command.schema.json +1095 -0
- package/schema/workflow-task.schema.json +3560 -0
- package/dist/chunk-MBBKGD7K.js +0 -440
- package/dist/chunk-Y7NWR3WH.cjs +0 -450
- package/dist/lower-CXggJTIo.d.ts +0 -67
- package/dist/lower-DAzvsJCo.d.cts +0 -67
- package/dist/node-evaluator-CH3XCJND.cjs +0 -17
- package/dist/node-evaluator-TULXA3WE.js +0 -8
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// src/durable/workflow.ts
|
|
2
|
+
var DURABLE_MARKER = "fluidgrids.durable-workflow";
|
|
3
|
+
var KEY = /^[a-z0-9][a-z0-9_-]{0,127}$/;
|
|
4
|
+
function workflow(name, optionsOrFn, maybeFn) {
|
|
5
|
+
if (typeof name !== "string" || !KEY.test(name))
|
|
6
|
+
throw new TypeError(
|
|
7
|
+
`workflow() needs a key of lowercase letters, digits, "-" and "_" (got "${String(name)}")`
|
|
8
|
+
);
|
|
9
|
+
const fn = typeof optionsOrFn === "function" ? optionsOrFn : maybeFn;
|
|
10
|
+
const options = typeof optionsOrFn === "function" ? {} : optionsOrFn ?? {};
|
|
11
|
+
if (typeof fn !== "function") throw new TypeError(`workflow("${name}") needs a function`);
|
|
12
|
+
return Object.freeze({ __fluidgrids: DURABLE_MARKER, name, options, fn });
|
|
13
|
+
}
|
|
14
|
+
function isDurableWorkflow(value) {
|
|
15
|
+
return typeof value === "object" && value !== null && value.__fluidgrids === DURABLE_MARKER && typeof value.fn === "function";
|
|
16
|
+
}
|
|
17
|
+
function isJsonValue(value, depth = 0) {
|
|
18
|
+
if (depth > 64) return false;
|
|
19
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return true;
|
|
20
|
+
if (typeof value === "number") return Number.isFinite(value);
|
|
21
|
+
if (Array.isArray(value)) return value.every((item) => isJsonValue(item, depth + 1));
|
|
22
|
+
if (typeof value === "object") {
|
|
23
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
|
|
24
|
+
return false;
|
|
25
|
+
return Object.values(value).every((item) => isJsonValue(item, depth + 1));
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function jsonSchemaOf(schema) {
|
|
30
|
+
if (schema === void 0) return void 0;
|
|
31
|
+
const method = schema.toJSONSchema;
|
|
32
|
+
if (typeof method === "function") {
|
|
33
|
+
const produced = method.call(schema);
|
|
34
|
+
return isJsonValue(produced) && typeof produced === "object" && !Array.isArray(produced) && produced !== null ? produced : void 0;
|
|
35
|
+
}
|
|
36
|
+
return isJsonValue(schema) && !Array.isArray(schema) && schema !== null && typeof schema === "object" ? schema : void 0;
|
|
37
|
+
}
|
|
38
|
+
function interfaceOf(definition) {
|
|
39
|
+
const out = {};
|
|
40
|
+
const input = jsonSchemaOf(definition.options.input);
|
|
41
|
+
const output = jsonSchemaOf(definition.options.output);
|
|
42
|
+
if (input) out.input = input;
|
|
43
|
+
if (output) out.output = output;
|
|
44
|
+
const signals = definition.options.signals ?? [];
|
|
45
|
+
if (signals.length > 0) {
|
|
46
|
+
out.signals = {};
|
|
47
|
+
for (const signal of signals) {
|
|
48
|
+
const entry = {};
|
|
49
|
+
const payload = jsonSchemaOf(signal.schema);
|
|
50
|
+
if (payload) entry.payload = payload;
|
|
51
|
+
if (signal.description !== void 0) entry.description = signal.description;
|
|
52
|
+
out.signals[signal.name] = entry;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const queries = definition.options.queries ?? [];
|
|
56
|
+
if (queries.length > 0) {
|
|
57
|
+
out.queries = {};
|
|
58
|
+
for (const query of queries)
|
|
59
|
+
out.queries[query.name] = query.description !== void 0 ? { description: query.description } : {};
|
|
60
|
+
}
|
|
61
|
+
const updates = definition.options.updates ?? [];
|
|
62
|
+
if (updates.length > 0) {
|
|
63
|
+
out.updates = {};
|
|
64
|
+
for (const update of updates)
|
|
65
|
+
out.updates[update.name] = update.description !== void 0 ? { description: update.description } : {};
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/generated/version.ts
|
|
71
|
+
var SDK_VERSION = "2026.1028.2";
|
|
72
|
+
|
|
73
|
+
export { DURABLE_MARKER, SDK_VERSION, interfaceOf, isDurableWorkflow, jsonSchemaOf, workflow };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkGBQ33SIZ_cjs = require('./chunk-GBQ33SIZ.cjs');
|
|
4
|
+
var chunkSAENRNBJ_cjs = require('./chunk-SAENRNBJ.cjs');
|
|
5
5
|
|
|
6
6
|
// src/ir/diff.ts
|
|
7
7
|
function keyPath(base, key) {
|
|
8
8
|
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? base ? `${base}.${key}` : key : `${base}[${JSON.stringify(key)}]`;
|
|
9
9
|
}
|
|
10
10
|
function diffValues(before, after, path, out) {
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
11
|
+
if (chunkSAENRNBJ_cjs.deepEqual(before, after)) return;
|
|
12
|
+
if (chunkSAENRNBJ_cjs.isRecord(before) && chunkSAENRNBJ_cjs.isRecord(after)) {
|
|
13
13
|
const keys = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])].sort();
|
|
14
14
|
for (const key of keys) {
|
|
15
|
-
const left =
|
|
16
|
-
const right =
|
|
15
|
+
const left = chunkSAENRNBJ_cjs.ownValue(before, key);
|
|
16
|
+
const right = chunkSAENRNBJ_cjs.ownValue(after, key);
|
|
17
17
|
if (left === void 0 && right !== void 0)
|
|
18
18
|
out.push({ kind: "added", path: keyPath(path, key), after: right });
|
|
19
19
|
else if (left !== void 0 && right === void 0)
|
|
@@ -28,7 +28,7 @@ function byId(items) {
|
|
|
28
28
|
const map = /* @__PURE__ */ new Map();
|
|
29
29
|
if (!Array.isArray(items)) return map;
|
|
30
30
|
items.forEach((item, index) => {
|
|
31
|
-
if (!
|
|
31
|
+
if (!chunkSAENRNBJ_cjs.isRecord(item)) return;
|
|
32
32
|
const id = typeof item["id"] === "string" ? item["id"] : `#${index}`;
|
|
33
33
|
if (!map.has(id)) map.set(id, item);
|
|
34
34
|
});
|
|
@@ -48,23 +48,23 @@ function diffCollection(before, after, path, out) {
|
|
|
48
48
|
const common = (ids, other) => ids.filter((id) => other.has(id));
|
|
49
49
|
const leftOrder = common([...left.keys()], right);
|
|
50
50
|
const rightOrder = common([...right.keys()], left);
|
|
51
|
-
if (!
|
|
51
|
+
if (!chunkSAENRNBJ_cjs.deepEqual(leftOrder, rightOrder)) {
|
|
52
52
|
out.push({ kind: "reordered", path, before: leftOrder, after: rightOrder });
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function diffDefinitions(before, after) {
|
|
56
|
-
const left =
|
|
57
|
-
const right =
|
|
56
|
+
const left = chunkGBQ33SIZ_cjs.hashedProjection(before);
|
|
57
|
+
const right = chunkGBQ33SIZ_cjs.hashedProjection(after);
|
|
58
58
|
const out = [];
|
|
59
|
-
if (!
|
|
59
|
+
if (!chunkSAENRNBJ_cjs.isRecord(left) || !chunkSAENRNBJ_cjs.isRecord(right)) {
|
|
60
60
|
diffValues(left, right, "", out);
|
|
61
61
|
return out;
|
|
62
62
|
}
|
|
63
63
|
const { data: leftData, ...leftRest } = left;
|
|
64
64
|
const { data: rightData, ...rightRest } = right;
|
|
65
65
|
diffValues(leftRest, rightRest, "", out);
|
|
66
|
-
const leftDataRecord =
|
|
67
|
-
const rightDataRecord =
|
|
66
|
+
const leftDataRecord = chunkSAENRNBJ_cjs.isRecord(leftData) ? leftData : {};
|
|
67
|
+
const rightDataRecord = chunkSAENRNBJ_cjs.isRecord(rightData) ? rightData : {};
|
|
68
68
|
const { nodes: leftNodes, edges: leftEdges, ...leftDataRest } = leftDataRecord;
|
|
69
69
|
const { nodes: rightNodes, edges: rightEdges, ...rightDataRest } = rightDataRecord;
|
|
70
70
|
diffCollection(leftNodes, rightNodes, "data.nodes", out);
|