@fluidgrids/workflows 2026.1028.1 → 2026.1029.1

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.
Files changed (122) hide show
  1. package/README.md +72 -10
  2. package/dist/{activation-DnhG7SmF.d.ts → activation-BnVQMv9y.d.ts} +1 -1
  3. package/dist/{activation-BBh1p82z.d.cts → activation-CESehfYi.d.cts} +1 -1
  4. package/dist/{chunk-XB53G2DK.js → chunk-25BKWR2O.js} +1 -1
  5. package/dist/{chunk-CBL5JSCC.cjs → chunk-2B37XAFQ.cjs} +44 -8
  6. package/dist/{chunk-DJYMDLV5.js → chunk-2DDULZFM.js} +93 -1
  7. package/dist/{chunk-623FVQSN.cjs → chunk-3FIDHONL.cjs} +104 -0
  8. package/dist/chunk-6QPOJZT6.cjs +1180 -0
  9. package/dist/chunk-7ILGCUI6.js +154 -0
  10. package/dist/chunk-A2OHX3UQ.js +1156 -0
  11. package/dist/{chunk-VOKMAAJP.js → chunk-A36CCOWS.js} +188 -19
  12. package/dist/{chunk-FMSW2HDF.cjs → chunk-ELL2RBML.cjs} +0 -14
  13. package/dist/{chunk-JD2VQIDZ.cjs → chunk-EWYADREB.cjs} +2 -2
  14. package/dist/{chunk-5HDSBTBX.js → chunk-FQSJI5NV.js} +1 -1
  15. package/dist/{chunk-ABFZWYHT.js → chunk-FWBRQWRX.js} +156 -48
  16. package/dist/{chunk-PZCVF76Q.cjs → chunk-I47EENR4.cjs} +209 -40
  17. package/dist/chunk-J3PYFGKA.cjs +166 -0
  18. package/dist/{chunk-C5OLWZ42.js → chunk-KXJDRQ6G.js} +1 -13
  19. package/dist/chunk-M272AHEX.js +25 -0
  20. package/dist/{chunk-3FOTFQ3J.js → chunk-MJ5TGYVG.js} +333 -65
  21. package/dist/{chunk-57MSZ24T.cjs → chunk-NXFBVDOI.cjs} +3 -3
  22. package/dist/{chunk-PDHLTDZB.js → chunk-OIX4O6UR.js} +38 -2
  23. package/dist/{chunk-HR3BN4C4.cjs → chunk-OKX3FYIM.cjs} +3 -3
  24. package/dist/{chunk-CSNWNFKU.cjs → chunk-OMY3CKUZ.cjs} +404 -136
  25. package/dist/chunk-PWIUEWC3.js +81 -0
  26. package/dist/chunk-Q4MWQNJK.cjs +28 -0
  27. package/dist/{chunk-P6TA5EZT.cjs → chunk-RUQIMTN5.cjs} +171 -57
  28. package/dist/{chunk-IISBRUWJ.js → chunk-WXXNCHUY.js} +1 -1
  29. package/dist/chunk-YHBVMOMK.cjs +87 -0
  30. package/dist/codegen/index.d.cts +2 -2
  31. package/dist/codegen/index.d.ts +2 -2
  32. package/dist/collect-BTHjQaSp.d.ts +86 -0
  33. package/dist/collect-CSyOg5XC.d.cts +86 -0
  34. package/dist/{file-yuPCFU5b.d.ts → file-cgL9l9l8.d.cts} +765 -14
  35. package/dist/{file-BOoHZgoQ.d.cts → file-olQudcx5.d.ts} +765 -14
  36. package/dist/history/index.cjs +198 -86
  37. package/dist/history/index.d.cts +49 -10
  38. package/dist/history/index.d.ts +49 -10
  39. package/dist/history/index.js +49 -4
  40. package/dist/index.cjs +64 -51
  41. package/dist/index.d.cts +9 -53
  42. package/dist/index.d.ts +9 -53
  43. package/dist/index.js +5 -4
  44. package/dist/ir/index.cjs +24 -3
  45. package/dist/ir/index.d.cts +43 -4
  46. package/dist/ir/index.d.ts +43 -4
  47. package/dist/ir/index.js +24 -3
  48. package/dist/{lower-BuSvAFqi.d.cts → lower-3S6PsqjJ.d.cts} +41 -7
  49. package/dist/{lower-C_Qv_34S.d.ts → lower-DmZpQ8hJ.d.ts} +41 -7
  50. package/dist/lower-types-DQNBfWQn.d.cts +37 -0
  51. package/dist/lower-types-DQNBfWQn.d.ts +37 -0
  52. package/dist/{manifest-C8N6HDYl.d.ts → manifest-BJjrQt77.d.ts} +1 -1
  53. package/dist/{manifest-0OLw0i7k.d.cts → manifest-gRI2Q5Fj.d.cts} +1 -1
  54. package/dist/node-evaluator-SOADN23V.js +14 -0
  55. package/dist/node-evaluator-YGDEXK4U.cjs +24 -0
  56. package/dist/quickjs/index.cjs +25 -24
  57. package/dist/quickjs/index.d.cts +7 -7
  58. package/dist/quickjs/index.d.ts +7 -7
  59. package/dist/quickjs/index.js +8 -7
  60. package/dist/roundtrip/index.cjs +245 -43
  61. package/dist/roundtrip/index.d.cts +88 -11
  62. package/dist/roundtrip/index.d.ts +88 -11
  63. package/dist/roundtrip/index.js +172 -8
  64. package/dist/runtime/index.cjs +21 -20
  65. package/dist/runtime/index.d.cts +49 -7
  66. package/dist/runtime/index.d.ts +49 -7
  67. package/dist/runtime/index.js +8 -7
  68. package/dist/testing/index.cjs +514 -74
  69. package/dist/testing/index.d.cts +128 -11
  70. package/dist/testing/index.d.ts +128 -11
  71. package/dist/testing/index.js +480 -42
  72. package/dist/{types-BGoPzgcl.d.ts → types-Bb2wRnJ5.d.cts} +20 -1
  73. package/dist/{types-BGoPzgcl.d.cts → types-Bb2wRnJ5.d.ts} +20 -1
  74. package/dist/{types-DV-HX_Gt.d.ts → types-CQKOhPTa.d.cts} +122 -14
  75. package/dist/{types-CpBBjaGX.d.cts → types-CnIOinoz.d.ts} +122 -14
  76. package/dist/{workflow-Bpr3vnA_.d.ts → workflow-8uRU9rhL.d.ts} +2 -2
  77. package/dist/{workflow-FXUkpIBc.d.cts → workflow-CZOXUlQ5.d.cts} +2 -2
  78. package/dist/{workflow-J-yYixny.d.cts → workflow-DWTPHFbt.d.ts} +124 -12
  79. package/dist/{workflow-C2a05WUJ.d.ts → workflow-O6e64ZcG.d.cts} +124 -12
  80. package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
  81. package/fixtures/histories/benign-failure.history.json +146 -0
  82. package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
  83. package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
  84. package/fixtures/histories/child-options-roundtrip.history.json +192 -0
  85. package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
  86. package/fixtures/histories/continue-as-new-options.history.json +99 -0
  87. package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
  88. package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
  89. package/fixtures/histories/execution-timeout-chain.history.json +98 -0
  90. package/fixtures/histories/external-cancel-resolved.history.json +123 -0
  91. package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
  92. package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
  93. package/fixtures/histories/handler-drain-warn.history.json +222 -0
  94. package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
  95. package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
  96. package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
  97. package/fixtures/histories/local-activity-completed.history.json +157 -0
  98. package/fixtures/histories/local-activity-failed.history.json +93 -0
  99. package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
  100. package/fixtures/histories/run-retry-last-failure.history.json +90 -0
  101. package/fixtures/histories/run-timeout.history.json +159 -0
  102. package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
  103. package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
  104. package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
  105. package/package.json +1 -1
  106. package/schema/history-file.schema.json +283 -2
  107. package/schema/ir-v2.schema.json +45 -0
  108. package/schema/run-event.schema.json +264 -2
  109. package/schema/workflow-command.schema.json +178 -1
  110. package/schema/workflow-task.schema.json +392 -4
  111. package/dist/assemble-BLqQ8lSu.d.cts +0 -39
  112. package/dist/assemble-DWgaXHd-.d.ts +0 -39
  113. package/dist/chunk-2DP2Y6EU.cjs +0 -832
  114. package/dist/chunk-2J6TF7YI.cjs +0 -86
  115. package/dist/chunk-7NQ37GZU.js +0 -73
  116. package/dist/chunk-BO6OVILK.js +0 -79
  117. package/dist/chunk-FQIHX7YI.cjs +0 -80
  118. package/dist/chunk-H7KEVW2M.js +0 -816
  119. package/dist/lower-types-nofRXw9c.d.cts +0 -15
  120. package/dist/lower-types-nofRXw9c.d.ts +0 -15
  121. package/dist/node-evaluator-CJNP4GHX.js +0 -12
  122. package/dist/node-evaluator-DMKPKUWA.cjs +0 -22
@@ -1,86 +0,0 @@
1
- 'use strict';
2
-
3
- // src/history/allowlist.ts
4
- var ACTIVITY_INTERNAL_ALLOWLIST = /* @__PURE__ */ new Set([
5
- "internal:http",
6
- "internal:datatable",
7
- "internal:set",
8
- "internal:code"
9
- ]);
10
- var ACTIVITY_NODE_DENYLIST = /* @__PURE__ */ new Set([
11
- "internal:end",
12
- "internal:if",
13
- "internal:switch",
14
- "internal:loop",
15
- "internal:merge",
16
- "internal:wait",
17
- "internal:subworkflow",
18
- "internal:code-workflow",
19
- "internal:wait-for-signal",
20
- "internal:send-and-wait",
21
- "internal:respond-to-webhook",
22
- "internal:failure-triage"
23
- ]);
24
- var ACTIVITY_NODE_ALLOWLIST = {
25
- internal: ACTIVITY_INTERNAL_ALLOWLIST,
26
- refused: ACTIVITY_NODE_DENYLIST,
27
- /** Non-built-in node types (store and registry nodes) are allowed. */
28
- external: "allowed"
29
- };
30
- var LEGACY_SHORT_NAMES = /* @__PURE__ */ new Set([
31
- "if",
32
- "switch",
33
- "loop",
34
- "merge",
35
- "set",
36
- "filter",
37
- "aggregate",
38
- "wait",
39
- "noop",
40
- "code",
41
- "http",
42
- "transform",
43
- "validate",
44
- "log",
45
- "error",
46
- "subworkflow",
47
- "end",
48
- "trigger",
49
- "webhook",
50
- "schedule",
51
- "manual",
52
- "api"
53
- ]);
54
- function canonicalType(nodeType) {
55
- const lower = nodeType.trim().toLowerCase();
56
- return LEGACY_SHORT_NAMES.has(lower) ? `internal:${lower}` : lower;
57
- }
58
- function isActivityNodeTypeAllowed(nodeType) {
59
- if (typeof nodeType !== "string" || nodeType.trim() === "") return false;
60
- const type = canonicalType(nodeType);
61
- if (!type.startsWith("internal:")) return true;
62
- return ACTIVITY_INTERNAL_ALLOWLIST.has(type);
63
- }
64
- var ActivityNodeTypeNotAllowedError = class extends Error {
65
- constructor(nodeType) {
66
- super(
67
- `${nodeType} cannot run as a durable activity: only store and registry nodes and internal:http, internal:datatable, internal:set and internal:code can`
68
- );
69
- this.nodeType = nodeType;
70
- this.name = "ActivityNodeTypeNotAllowedError";
71
- }
72
- nodeType;
73
- code = "durable.activityTypeNotAllowed";
74
- errorType = "VALIDATION";
75
- nonRetryable = true;
76
- };
77
- function assertActivityNodeType(nodeType) {
78
- if (!isActivityNodeTypeAllowed(nodeType)) throw new ActivityNodeTypeNotAllowedError(nodeType);
79
- }
80
-
81
- exports.ACTIVITY_INTERNAL_ALLOWLIST = ACTIVITY_INTERNAL_ALLOWLIST;
82
- exports.ACTIVITY_NODE_ALLOWLIST = ACTIVITY_NODE_ALLOWLIST;
83
- exports.ACTIVITY_NODE_DENYLIST = ACTIVITY_NODE_DENYLIST;
84
- exports.ActivityNodeTypeNotAllowedError = ActivityNodeTypeNotAllowedError;
85
- exports.assertActivityNodeType = assertActivityNodeType;
86
- exports.isActivityNodeTypeAllowed = isActivityNodeTypeAllowed;
@@ -1,73 +0,0 @@
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.1";
72
-
73
- export { DURABLE_MARKER, SDK_VERSION, interfaceOf, isDurableWorkflow, jsonSchemaOf, workflow };
@@ -1,79 +0,0 @@
1
- // src/history/allowlist.ts
2
- var ACTIVITY_INTERNAL_ALLOWLIST = /* @__PURE__ */ new Set([
3
- "internal:http",
4
- "internal:datatable",
5
- "internal:set",
6
- "internal:code"
7
- ]);
8
- var ACTIVITY_NODE_DENYLIST = /* @__PURE__ */ new Set([
9
- "internal:end",
10
- "internal:if",
11
- "internal:switch",
12
- "internal:loop",
13
- "internal:merge",
14
- "internal:wait",
15
- "internal:subworkflow",
16
- "internal:code-workflow",
17
- "internal:wait-for-signal",
18
- "internal:send-and-wait",
19
- "internal:respond-to-webhook",
20
- "internal:failure-triage"
21
- ]);
22
- var ACTIVITY_NODE_ALLOWLIST = {
23
- internal: ACTIVITY_INTERNAL_ALLOWLIST,
24
- refused: ACTIVITY_NODE_DENYLIST,
25
- /** Non-built-in node types (store and registry nodes) are allowed. */
26
- external: "allowed"
27
- };
28
- var LEGACY_SHORT_NAMES = /* @__PURE__ */ new Set([
29
- "if",
30
- "switch",
31
- "loop",
32
- "merge",
33
- "set",
34
- "filter",
35
- "aggregate",
36
- "wait",
37
- "noop",
38
- "code",
39
- "http",
40
- "transform",
41
- "validate",
42
- "log",
43
- "error",
44
- "subworkflow",
45
- "end",
46
- "trigger",
47
- "webhook",
48
- "schedule",
49
- "manual",
50
- "api"
51
- ]);
52
- function canonicalType(nodeType) {
53
- const lower = nodeType.trim().toLowerCase();
54
- return LEGACY_SHORT_NAMES.has(lower) ? `internal:${lower}` : lower;
55
- }
56
- function isActivityNodeTypeAllowed(nodeType) {
57
- if (typeof nodeType !== "string" || nodeType.trim() === "") return false;
58
- const type = canonicalType(nodeType);
59
- if (!type.startsWith("internal:")) return true;
60
- return ACTIVITY_INTERNAL_ALLOWLIST.has(type);
61
- }
62
- var ActivityNodeTypeNotAllowedError = class extends Error {
63
- constructor(nodeType) {
64
- super(
65
- `${nodeType} cannot run as a durable activity: only store and registry nodes and internal:http, internal:datatable, internal:set and internal:code can`
66
- );
67
- this.nodeType = nodeType;
68
- this.name = "ActivityNodeTypeNotAllowedError";
69
- }
70
- nodeType;
71
- code = "durable.activityTypeNotAllowed";
72
- errorType = "VALIDATION";
73
- nonRetryable = true;
74
- };
75
- function assertActivityNodeType(nodeType) {
76
- if (!isActivityNodeTypeAllowed(nodeType)) throw new ActivityNodeTypeNotAllowedError(nodeType);
77
- }
78
-
79
- export { ACTIVITY_INTERNAL_ALLOWLIST, ACTIVITY_NODE_ALLOWLIST, ACTIVITY_NODE_DENYLIST, ActivityNodeTypeNotAllowedError, assertActivityNodeType, isActivityNodeTypeAllowed };
@@ -1,80 +0,0 @@
1
- 'use strict';
2
-
3
- // src/durable/workflow.ts
4
- var DURABLE_MARKER = "fluidgrids.durable-workflow";
5
- var KEY = /^[a-z0-9][a-z0-9_-]{0,127}$/;
6
- function workflow(name, optionsOrFn, maybeFn) {
7
- if (typeof name !== "string" || !KEY.test(name))
8
- throw new TypeError(
9
- `workflow() needs a key of lowercase letters, digits, "-" and "_" (got "${String(name)}")`
10
- );
11
- const fn = typeof optionsOrFn === "function" ? optionsOrFn : maybeFn;
12
- const options = typeof optionsOrFn === "function" ? {} : optionsOrFn ?? {};
13
- if (typeof fn !== "function") throw new TypeError(`workflow("${name}") needs a function`);
14
- return Object.freeze({ __fluidgrids: DURABLE_MARKER, name, options, fn });
15
- }
16
- function isDurableWorkflow(value) {
17
- return typeof value === "object" && value !== null && value.__fluidgrids === DURABLE_MARKER && typeof value.fn === "function";
18
- }
19
- function isJsonValue(value, depth = 0) {
20
- if (depth > 64) return false;
21
- if (value === null || typeof value === "string" || typeof value === "boolean") return true;
22
- if (typeof value === "number") return Number.isFinite(value);
23
- if (Array.isArray(value)) return value.every((item) => isJsonValue(item, depth + 1));
24
- if (typeof value === "object") {
25
- if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
26
- return false;
27
- return Object.values(value).every((item) => isJsonValue(item, depth + 1));
28
- }
29
- return false;
30
- }
31
- function jsonSchemaOf(schema) {
32
- if (schema === void 0) return void 0;
33
- const method = schema.toJSONSchema;
34
- if (typeof method === "function") {
35
- const produced = method.call(schema);
36
- return isJsonValue(produced) && typeof produced === "object" && !Array.isArray(produced) && produced !== null ? produced : void 0;
37
- }
38
- return isJsonValue(schema) && !Array.isArray(schema) && schema !== null && typeof schema === "object" ? schema : void 0;
39
- }
40
- function interfaceOf(definition) {
41
- const out = {};
42
- const input = jsonSchemaOf(definition.options.input);
43
- const output = jsonSchemaOf(definition.options.output);
44
- if (input) out.input = input;
45
- if (output) out.output = output;
46
- const signals = definition.options.signals ?? [];
47
- if (signals.length > 0) {
48
- out.signals = {};
49
- for (const signal of signals) {
50
- const entry = {};
51
- const payload = jsonSchemaOf(signal.schema);
52
- if (payload) entry.payload = payload;
53
- if (signal.description !== void 0) entry.description = signal.description;
54
- out.signals[signal.name] = entry;
55
- }
56
- }
57
- const queries = definition.options.queries ?? [];
58
- if (queries.length > 0) {
59
- out.queries = {};
60
- for (const query of queries)
61
- out.queries[query.name] = query.description !== void 0 ? { description: query.description } : {};
62
- }
63
- const updates = definition.options.updates ?? [];
64
- if (updates.length > 0) {
65
- out.updates = {};
66
- for (const update of updates)
67
- out.updates[update.name] = update.description !== void 0 ? { description: update.description } : {};
68
- }
69
- return out;
70
- }
71
-
72
- // src/generated/version.ts
73
- var SDK_VERSION = "2026.1028.1";
74
-
75
- exports.DURABLE_MARKER = DURABLE_MARKER;
76
- exports.SDK_VERSION = SDK_VERSION;
77
- exports.interfaceOf = interfaceOf;
78
- exports.isDurableWorkflow = isDurableWorkflow;
79
- exports.jsonSchemaOf = jsonSchemaOf;
80
- exports.workflow = workflow;