@fluidgrids/workflows 2026.1028.2 → 2026.1030.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 (154) hide show
  1. package/README.md +181 -11
  2. package/dist/{activation-BBh1p82z.d.cts → activation-DqUfpHzk.d.cts} +1 -1
  3. package/dist/{activation-DnhG7SmF.d.ts → activation-xpx1oWuo.d.ts} +1 -1
  4. package/dist/{chunk-VRHHBPT6.js → chunk-2D3MYIIF.js} +1212 -128
  5. package/dist/chunk-3U2NU7YC.cjs +124 -0
  6. package/dist/{chunk-NEIUQASE.cjs → chunk-4QKB4ARC.cjs} +3 -3
  7. package/dist/{chunk-GBQ33SIZ.cjs → chunk-54FLQNUM.cjs} +12 -1
  8. package/dist/chunk-5HIVIV53.js +330 -0
  9. package/dist/chunk-5MFVJM76.js +1222 -0
  10. package/dist/{chunk-JD2VQIDZ.cjs → chunk-672KMMBK.cjs} +2 -2
  11. package/dist/{chunk-C5OLWZ42.js → chunk-6A2FGSUS.js} +22 -14
  12. package/dist/{chunk-XKJA7KX3.js → chunk-6OLN6BMB.js} +52 -3
  13. package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
  14. package/dist/{chunk-2J6TF7YI.cjs → chunk-A5SXCA62.cjs} +10 -3
  15. package/dist/{chunk-BO6OVILK.js → chunk-AC6ZEXVR.js} +10 -4
  16. package/dist/{chunk-ABFZWYHT.js → chunk-AE5Q6ZAJ.js} +315 -50
  17. package/dist/chunk-C4F5KJTI.js +293 -0
  18. package/dist/{chunk-IISBRUWJ.js → chunk-G5H32GIG.js} +1 -1
  19. package/dist/chunk-GEQDGUGB.cjs +2719 -0
  20. package/dist/{chunk-XHXIDVEC.js → chunk-HCM7ZC7Q.js} +1 -1
  21. package/dist/chunk-HMZUGSMU.cjs +1554 -0
  22. package/dist/{chunk-SAOBPYYJ.cjs → chunk-IQPXHQQQ.cjs} +8 -4
  23. package/dist/{chunk-P6TA5EZT.cjs → chunk-ISOIA7NV.cjs} +335 -58
  24. package/dist/chunk-JSC75O5C.cjs +167 -0
  25. package/dist/chunk-M272AHEX.js +25 -0
  26. package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
  27. package/dist/chunk-ODZ2IAR2.cjs +1247 -0
  28. package/dist/chunk-Q4MWQNJK.cjs +28 -0
  29. package/dist/{chunk-HWJZVOG7.js → chunk-SR7TR5KX.js} +6 -2
  30. package/dist/{chunk-FEW3JBYA.cjs → chunk-TCTE7DX5.cjs} +3 -3
  31. package/dist/{chunk-623FVQSN.cjs → chunk-TYF56RGB.cjs} +123 -0
  32. package/dist/chunk-VA4OFR72.cjs +324 -0
  33. package/dist/chunk-VU5S5A7V.js +150 -0
  34. package/dist/chunk-YEHR4NNE.js +1522 -0
  35. package/dist/{chunk-FMSW2HDF.cjs → chunk-ZCGKGDCL.cjs} +23 -15
  36. package/dist/codegen/index.d.cts +2 -2
  37. package/dist/codegen/index.d.ts +2 -2
  38. package/dist/collect-6NIEufHd.d.ts +103 -0
  39. package/dist/collect-CcTCKqx6.d.cts +103 -0
  40. package/dist/{file-BOoHZgoQ.d.cts → file-BxYpwjRQ.d.cts} +1007 -21
  41. package/dist/{file-yuPCFU5b.d.ts → file-CFdPQJI9.d.ts} +1007 -21
  42. package/dist/history/index.cjs +375 -86
  43. package/dist/history/index.d.cts +590 -12
  44. package/dist/history/index.d.ts +590 -12
  45. package/dist/history/index.js +50 -4
  46. package/dist/index.cjs +156 -50
  47. package/dist/index.d.cts +38 -58
  48. package/dist/index.d.ts +38 -58
  49. package/dist/index.js +6 -4
  50. package/dist/interceptors-CNcr2dlk.d.ts +159 -0
  51. package/dist/interceptors-CqkNZVfI.d.cts +159 -0
  52. package/dist/ir/index.cjs +362 -38
  53. package/dist/ir/index.d.cts +282 -7
  54. package/dist/ir/index.d.ts +282 -7
  55. package/dist/ir/index.js +329 -23
  56. package/dist/{lower-BzmUz0sq.d.cts → lower-BtRfIW2A.d.cts} +56 -8
  57. package/dist/{lower-_-iT4HYs.d.ts → lower-CpsMFOFX.d.ts} +56 -8
  58. package/dist/{manifest-C8N6HDYl.d.ts → manifest-D-I_twys.d.ts} +1 -1
  59. package/dist/{manifest-0OLw0i7k.d.cts → manifest-DahBQVM8.d.cts} +1 -1
  60. package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
  61. package/dist/node-evaluator-LEEVD7H7.js +14 -0
  62. package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
  63. package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
  64. package/dist/quickjs/index.cjs +28 -27
  65. package/dist/quickjs/index.d.cts +6 -6
  66. package/dist/quickjs/index.d.ts +6 -6
  67. package/dist/quickjs/index.js +10 -9
  68. package/dist/roundtrip/index.cjs +259 -51
  69. package/dist/roundtrip/index.d.cts +100 -9
  70. package/dist/roundtrip/index.d.ts +100 -9
  71. package/dist/roundtrip/index.js +177 -11
  72. package/dist/runtime/index.cjs +21 -20
  73. package/dist/runtime/index.d.cts +184 -15
  74. package/dist/runtime/index.d.ts +184 -15
  75. package/dist/runtime/index.js +8 -7
  76. package/dist/testing/index.cjs +1122 -115
  77. package/dist/testing/index.d.cts +294 -13
  78. package/dist/testing/index.d.ts +294 -13
  79. package/dist/testing/index.js +1086 -84
  80. package/dist/{types-DV-HX_Gt.d.ts → types-Bv2i4cBX.d.cts} +244 -33
  81. package/dist/{types-CpBBjaGX.d.cts → types-DGx-b9eq.d.ts} +244 -33
  82. package/dist/{types-BGoPzgcl.d.ts → types-V7jEEUaL.d.cts} +20 -1
  83. package/dist/{types-BGoPzgcl.d.cts → types-V7jEEUaL.d.ts} +20 -1
  84. package/dist/{workflow-Bpr3vnA_.d.ts → workflow-B18OeF7g.d.ts} +2 -2
  85. package/dist/workflow-BGnv8SS6.d.ts +803 -0
  86. package/dist/{workflow-FXUkpIBc.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
  87. package/dist/workflow-DS32Gtws.d.cts +803 -0
  88. package/fixtures/histories/activity-options-updated.history.json +159 -0
  89. package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
  90. package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
  91. package/fixtures/histories/benign-failure.history.json +146 -0
  92. package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
  93. package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
  94. package/fixtures/histories/child-options-roundtrip.history.json +192 -0
  95. package/fixtures/histories/codec-opaque.history.json +229 -0
  96. package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
  97. package/fixtures/histories/continue-as-new-options.history.json +99 -0
  98. package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
  99. package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
  100. package/fixtures/histories/dynamic-workflow.history.json +150 -0
  101. package/fixtures/histories/execution-timeout-chain.history.json +98 -0
  102. package/fixtures/histories/external-cancel-resolved.history.json +123 -0
  103. package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
  104. package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
  105. package/fixtures/histories/handler-drain-warn.history.json +222 -0
  106. package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
  107. package/fixtures/histories/interceptor-headers.history.json +339 -0
  108. package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
  109. package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
  110. package/fixtures/histories/local-activity-completed.history.json +157 -0
  111. package/fixtures/histories/local-activity-failed.history.json +93 -0
  112. package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
  113. package/fixtures/histories/query-custom.history.json +213 -0
  114. package/fixtures/histories/query-default-handler.history.json +120 -0
  115. package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
  116. package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
  117. package/fixtures/histories/run-retry-last-failure.history.json +90 -0
  118. package/fixtures/histories/run-timeout.history.json +159 -0
  119. package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
  120. package/fixtures/histories/search-attributes-upserted.history.json +177 -0
  121. package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
  122. package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
  123. package/fixtures/histories/update-accepted-completed.history.json +45 -30
  124. package/fixtures/histories/update-default-handler.history.json +246 -0
  125. package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
  126. package/fixtures/histories/update-not-handled.history.json +138 -0
  127. package/fixtures/histories/update-rejected-no-event.history.json +190 -0
  128. package/fixtures/histories/update-with-start-admitted.history.json +150 -0
  129. package/fixtures/histories/user-activity-cancel.history.json +149 -0
  130. package/fixtures/histories/user-activity-retry.history.json +143 -0
  131. package/fixtures/histories/user-activity.history.json +149 -0
  132. package/package.json +1 -1
  133. package/schema/bridge-v2.schema.json +1062 -0
  134. package/schema/history-file.schema.json +538 -83
  135. package/schema/ir-v2.schema.json +290 -0
  136. package/schema/payload-fields.json +162 -0
  137. package/schema/run-event.schema.json +503 -82
  138. package/schema/workflow-command.schema.json +372 -69
  139. package/schema/workflow-task.schema.json +924 -171
  140. package/dist/assemble-BLqQ8lSu.d.cts +0 -39
  141. package/dist/assemble-DWgaXHd-.d.ts +0 -39
  142. package/dist/chunk-DHTLALBL.cjs +0 -80
  143. package/dist/chunk-DJYMDLV5.js +0 -227
  144. package/dist/chunk-I5LR3D2K.js +0 -869
  145. package/dist/chunk-M4BBAERY.cjs +0 -1635
  146. package/dist/chunk-N23SKIG4.js +0 -73
  147. package/dist/chunk-PZCVF76Q.cjs +0 -868
  148. package/dist/chunk-QQ6ULXHI.cjs +0 -885
  149. package/dist/chunk-UK3WM7YZ.cjs +0 -75
  150. package/dist/chunk-VOKMAAJP.js +0 -848
  151. package/dist/node-evaluator-4MSDKWOG.cjs +0 -22
  152. package/dist/node-evaluator-SX4LEYQC.js +0 -12
  153. package/dist/workflow-C2a05WUJ.d.ts +0 -444
  154. package/dist/workflow-J-yYixny.d.cts +0 -444
@@ -1,868 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkSAENRNBJ_cjs = require('./chunk-SAENRNBJ.cjs');
4
- var chunkP6TA5EZT_cjs = require('./chunk-P6TA5EZT.cjs');
5
- var chunk623FVQSN_cjs = require('./chunk-623FVQSN.cjs');
6
- var chunk2J6TF7YI_cjs = require('./chunk-2J6TF7YI.cjs');
7
- var _2020_js = require('ajv/dist/2020.js');
8
-
9
- // src/history/schema.ts
10
- var BASE = "https://docs.fluidgrids.ai/schemas";
11
- var RUN_EVENT_SCHEMA_ID = `${BASE}/run-event.schema.json`;
12
- var WORKFLOW_COMMAND_SCHEMA_ID = `${BASE}/workflow-command.schema.json`;
13
- var WORKFLOW_TASK_SCHEMA_ID = `${BASE}/workflow-task.schema.json`;
14
- var HISTORY_FILE_SCHEMA_ID = `${BASE}/history-file.schema.json`;
15
- var HISTORY_FILE_FORMAT = "fluidgrids.history";
16
- var ID = { type: "string", minLength: 1, maxLength: 256 };
17
- var NON_NEGATIVE_MS = { type: "integer", minimum: 0 };
18
- var STRING_MAP = { type: "object", additionalProperties: { type: "string" } };
19
- var SHARED_DEFS = {
20
- json: {
21
- description: "Any JSON value."
22
- },
23
- failure: {
24
- type: "object",
25
- required: ["errorType", "message"],
26
- properties: {
27
- errorType: { enum: [...chunk623FVQSN_cjs.ERROR_TYPES] },
28
- message: { type: "string" },
29
- type: { type: "string" },
30
- details: {},
31
- nonRetryable: { type: "boolean" },
32
- nextRetryDelayMs: NON_NEGATIVE_MS,
33
- category: { const: "BENIGN" },
34
- timeoutType: { type: "string" },
35
- cause: { $ref: "#/$defs/failure" },
36
- stackTrace: { type: "string" },
37
- source: { type: "string" }
38
- },
39
- additionalProperties: false
40
- },
41
- retryPolicy: {
42
- type: "object",
43
- required: ["retryDelay"],
44
- description: "maxRetries absent means unlimited attempts, bounded by scheduleToCloseTimeout.",
45
- properties: {
46
- maxRetries: { type: "integer", minimum: 0 },
47
- retryDelay: NON_NEGATIVE_MS,
48
- backoffMultiplier: { type: "number", minimum: 1 },
49
- maxDelay: NON_NEGATIVE_MS,
50
- retryOnErrorTypes: { type: "array", items: { enum: [...chunk623FVQSN_cjs.ERROR_TYPES] } },
51
- nonRetryableErrorTypes: { type: "array", items: { type: "string" } }
52
- },
53
- additionalProperties: false
54
- },
55
- runTarget: {
56
- oneOf: [
57
- {
58
- type: "object",
59
- required: ["runId"],
60
- properties: { runId: ID },
61
- additionalProperties: false
62
- },
63
- {
64
- type: "object",
65
- required: ["parent"],
66
- properties: { parent: { const: true } },
67
- additionalProperties: false
68
- },
69
- {
70
- type: "object",
71
- required: ["childId"],
72
- properties: { childId: ID },
73
- additionalProperties: false
74
- },
75
- {
76
- type: "object",
77
- required: ["workflowKey", "workflowId"],
78
- properties: { workflowKey: ID, workflowId: ID },
79
- additionalProperties: false
80
- }
81
- ]
82
- },
83
- childOptions: {
84
- type: "object",
85
- required: ["parentClosePolicy"],
86
- properties: {
87
- parentClosePolicy: { enum: [...chunk623FVQSN_cjs.PARENT_CLOSE_POLICIES] },
88
- cancellationType: { enum: [...chunk623FVQSN_cjs.CHILD_CANCELLATION_TYPES] },
89
- taskQueue: ID,
90
- workflowId: ID,
91
- priority: { type: "integer", minimum: 1, maximum: 5 },
92
- summary: { type: "string", maxLength: 200 },
93
- details: { type: "string" },
94
- context: { type: "object" },
95
- executionTimeout: NON_NEGATIVE_MS,
96
- runTimeout: NON_NEGATIVE_MS,
97
- workflowTaskTimeout: NON_NEGATIVE_MS,
98
- startDelay: NON_NEGATIVE_MS
99
- }
100
- },
101
- headers: STRING_MAP
102
- };
103
- function command(type, required, properties) {
104
- return {
105
- type: "object",
106
- required: ["type", ...required],
107
- properties: { type: { const: type }, headers: { $ref: "#/$defs/headers" }, ...properties },
108
- additionalProperties: false
109
- };
110
- }
111
- var COMMAND_DEFS = {
112
- SCHEDULE_ACTIVITY: command(
113
- "SCHEDULE_ACTIVITY",
114
- ["activityId", "kind", "nodeType", "operation", "args", "retry"],
115
- {
116
- activityId: ID,
117
- kind: { const: "node" },
118
- nodeType: ID,
119
- nodeVersion: { type: "string" },
120
- operation: ID,
121
- args: {},
122
- connection: ID,
123
- retry: { $ref: "#/$defs/retryPolicy" },
124
- startToCloseTimeout: NON_NEGATIVE_MS,
125
- scheduleToCloseTimeout: NON_NEGATIVE_MS,
126
- scheduleToStartTimeout: NON_NEGATIVE_MS,
127
- heartbeatTimeout: NON_NEGATIVE_MS,
128
- cancellationType: { enum: [...chunk623FVQSN_cjs.ACTIVITY_CANCELLATION_TYPES] },
129
- priority: { type: "integer", minimum: 1, maximum: 5 },
130
- summary: { type: "string", maxLength: 200 },
131
- runOn: { type: "string" }
132
- }
133
- ),
134
- REQUEST_CANCEL_ACTIVITY: command("REQUEST_CANCEL_ACTIVITY", ["activityId"], { activityId: ID }),
135
- START_TIMER: command("START_TIMER", ["timerId", "durationMs"], {
136
- timerId: ID,
137
- durationMs: { type: "integer", minimum: 1 },
138
- summary: { type: "string", maxLength: 200 }
139
- }),
140
- CANCEL_TIMER: command("CANCEL_TIMER", ["timerId"], { timerId: ID }),
141
- START_CHILD_RUN: {
142
- ...command("START_CHILD_RUN", ["childId", "input", "options"], {
143
- childId: ID,
144
- workflowKey: ID,
145
- workflowFn: ID,
146
- version: { type: "string", minLength: 1 },
147
- input: {},
148
- options: { $ref: "#/$defs/childOptions" }
149
- }),
150
- oneOf: [{ required: ["workflowKey"] }, { required: ["workflowFn"] }]
151
- },
152
- SIGNAL_RUN: command("SIGNAL_RUN", ["externalId", "target", "name", "payload"], {
153
- externalId: ID,
154
- target: { $ref: "#/$defs/runTarget" },
155
- name: ID,
156
- payload: {}
157
- }),
158
- RECORD_SIDE_EFFECT: command("RECORD_SIDE_EFFECT", ["sideEffectId", "value"], {
159
- sideEffectId: ID,
160
- value: {}
161
- }),
162
- RECORD_MARKER: command("RECORD_MARKER", ["markerId", "data"], { markerId: ID, data: {} }),
163
- COMPLETE_WORKFLOW: command("COMPLETE_WORKFLOW", ["output"], { output: {} }),
164
- FAIL_WORKFLOW: command("FAIL_WORKFLOW", ["failure"], {
165
- failure: { $ref: "#/$defs/failure" }
166
- }),
167
- CANCEL_WORKFLOW: command("CANCEL_WORKFLOW", [], {}),
168
- UPSERT_CONTEXT: command("UPSERT_CONTEXT", ["entries"], { entries: { type: "object" } }),
169
- RECORD_LOCAL_ACTIVITY: {
170
- ...command("RECORD_LOCAL_ACTIVITY", ["localActivityId", "attempts"], {
171
- localActivityId: ID,
172
- result: {},
173
- failure: { $ref: "#/$defs/failure" },
174
- attempts: { type: "integer", minimum: 1 }
175
- }),
176
- oneOf: [{ required: ["result"] }, { required: ["failure"] }]
177
- },
178
- CONTINUE_AS_NEW: command("CONTINUE_AS_NEW", ["input", "options"], {
179
- input: {},
180
- options: { type: "object" }
181
- }),
182
- REQUEST_CANCEL_EXTERNAL_RUN: command("REQUEST_CANCEL_EXTERNAL_RUN", ["externalId", "target"], {
183
- externalId: ID,
184
- target: { $ref: "#/$defs/runTarget" }
185
- }),
186
- UPSERT_SEARCH_ATTRIBUTES: command("UPSERT_SEARCH_ATTRIBUTES", ["attributes"], {
187
- attributes: { type: "object" }
188
- }),
189
- ACCEPT_UPDATE: command("ACCEPT_UPDATE", ["updateId"], { updateId: ID }),
190
- REJECT_UPDATE: command("REJECT_UPDATE", ["updateId", "failure"], {
191
- updateId: ID,
192
- failure: { $ref: "#/$defs/failure" }
193
- }),
194
- COMPLETE_UPDATE: command("COMPLETE_UPDATE", ["updateId"], {
195
- updateId: ID,
196
- result: {},
197
- failure: { $ref: "#/$defs/failure" }
198
- })
199
- };
200
- function payload(required, properties) {
201
- return { type: "object", required, properties };
202
- }
203
- var FAILURE_REF = { $ref: "#/$defs/failure" };
204
- var EVENT_PAYLOADS = {
205
- WORKFLOW_STARTED: payload(["workflowFn", "input"], {
206
- workflowFn: ID,
207
- input: {},
208
- workflowKey: { type: "string" },
209
- version: {},
210
- buildId: { type: "string" },
211
- taskQueue: { type: "string" },
212
- parentRunId: { type: ["string", "null"] },
213
- rootRunId: { type: ["string", "null"] },
214
- firstRunId: { type: ["string", "null"] },
215
- continuedFromRunId: { type: ["string", "null"] },
216
- parentClosePolicy: { enum: [...chunk623FVQSN_cjs.PARENT_CLOSE_POLICIES] },
217
- startDelay: NON_NEGATIVE_MS,
218
- lastCompletionResult: {},
219
- lastFailure: { oneOf: [{ type: "null" }, FAILURE_REF] },
220
- summary: { type: "string" },
221
- details: { type: "string" },
222
- context: { type: "object" },
223
- executionTimeout: NON_NEGATIVE_MS,
224
- runTimeout: NON_NEGATIVE_MS,
225
- workflowTaskTimeout: NON_NEGATIVE_MS,
226
- versioningBehavior: { enum: ["PINNED", "AUTO_UPGRADE"] },
227
- /** Seed of `ctx.random()`/`ctx.uuid()`; the service writes the run id. Absent: `info.runId`. */
228
- randomnessSeed: ID
229
- }),
230
- WORKFLOW_TASK_SCHEDULED: payload(["taskId"], {
231
- taskId: ID,
232
- attempt: { type: "integer", minimum: 1 }
233
- }),
234
- WORKFLOW_TASK_STARTED: payload(["taskId", "attempt"], {
235
- taskId: ID,
236
- attempt: { type: "integer", minimum: 1 },
237
- workerId: { type: "string" },
238
- buildId: { type: "string" },
239
- startedAt: {
240
- type: "string",
241
- description: "When the attempt started, if different from the event time (a transient attempt is recorded at completion). This is the clock the task saw: nowMs of its request."
242
- },
243
- historyLength: {
244
- type: "integer",
245
- minimum: 1,
246
- description: "The history length the attempt was leased with (run.taskStartedSeq), when it is not this event's own seq. Required on the WORKFLOW_TASK_STARTED of a transient attempt: input events with a higher seq that precede this event arrived during the attempt and belong to the next activation."
247
- }
248
- }),
249
- WORKFLOW_TASK_COMPLETED: payload(["taskId"], {
250
- taskId: ID,
251
- buildId: { type: "string" },
252
- workerId: { type: "string" }
253
- }),
254
- WORKFLOW_TASK_FAILED: payload(["taskId", "attempt", "cause"], {
255
- taskId: ID,
256
- attempt: { type: "integer", minimum: 1 },
257
- cause: { enum: [...chunk623FVQSN_cjs.TASK_FAILURE_CAUSES] },
258
- message: { type: "string" },
259
- stackTrace: { type: "string" },
260
- buildId: { type: "string" }
261
- }),
262
- WORKFLOW_TASK_TIMED_OUT: payload(["taskId", "attempt"], {
263
- taskId: ID,
264
- attempt: { type: "integer", minimum: 1 }
265
- }),
266
- ACTIVITY_SCHEDULED: payload(["activityId", "kind", "nodeType", "operation", "args", "retry"], {
267
- ...COMMAND_DEFS.SCHEDULE_ACTIVITY.properties,
268
- type: void 0
269
- }),
270
- ACTIVITY_STARTED: payload(["activityId", "attempt"], {
271
- activityId: ID,
272
- attempt: { type: "integer", minimum: 1 },
273
- workerId: { type: "string" }
274
- }),
275
- ACTIVITY_HEARTBEAT: payload(["activityId"], { activityId: ID, details: {} }),
276
- ACTIVITY_COMPLETED: payload(["activityId", "attempt"], {
277
- activityId: ID,
278
- attempt: { type: "integer", minimum: 1 },
279
- result: {}
280
- }),
281
- ACTIVITY_FAILED: payload(["activityId", "attempt", "failure"], {
282
- activityId: ID,
283
- attempt: { type: "integer", minimum: 1 },
284
- failure: FAILURE_REF
285
- }),
286
- ACTIVITY_TIMED_OUT: payload(["activityId", "attempt", "timeoutType"], {
287
- activityId: ID,
288
- attempt: { type: "integer", minimum: 1 },
289
- timeoutType: {
290
- enum: ["START_TO_CLOSE", "SCHEDULE_TO_START", "SCHEDULE_TO_CLOSE", "HEARTBEAT"]
291
- },
292
- failure: FAILURE_REF
293
- }),
294
- ACTIVITY_CANCEL_REQUESTED: payload(["activityId"], { activityId: ID }),
295
- ACTIVITY_CANCELLED: payload(["activityId"], { activityId: ID, details: {} }),
296
- ACTIVITY_PAUSED: payload(["activityId"], { activityId: ID, reason: { type: "string" } }),
297
- ACTIVITY_UNPAUSED: payload(["activityId"], { activityId: ID }),
298
- ACTIVITY_RESET: payload(["activityId"], { activityId: ID }),
299
- ACTIVITY_OPTIONS_UPDATED: payload(["activityId"], {
300
- activityId: ID,
301
- options: { type: "object" }
302
- }),
303
- TIMER_STARTED: payload(["timerId", "durationMs", "fireAt"], {
304
- timerId: ID,
305
- durationMs: { type: "integer", minimum: 1 },
306
- fireAt: { type: "string" },
307
- summary: { type: "string" }
308
- }),
309
- TIMER_FIRED: payload(["timerId"], { timerId: ID }),
310
- TIMER_CANCELLED: payload(["timerId"], { timerId: ID }),
311
- SIGNAL_RECEIVED: payload(["name"], {
312
- name: ID,
313
- payload: {},
314
- receivedAt: { type: "string" },
315
- actor: {},
316
- idempotencyKey: { type: "string" }
317
- }),
318
- UPDATE_ADMITTED: payload(["updateId", "name"], { updateId: ID, name: ID, args: {} }),
319
- UPDATE_ACCEPTED: payload(["updateId", "name"], { updateId: ID, name: ID, args: {} }),
320
- UPDATE_COMPLETED: payload(["updateId"], { updateId: ID, result: {}, failure: FAILURE_REF }),
321
- CHILD_RUN_INITIATED: payload(["childId", "input", "options"], {
322
- childId: ID,
323
- workflowKey: ID,
324
- workflowFn: ID,
325
- version: { type: "string" },
326
- input: {},
327
- options: { $ref: "#/$defs/childOptions" },
328
- childRunId: { type: "string" },
329
- executionKind: { enum: ["GRAPH", "DURABLE_FN"] }
330
- }),
331
- CHILD_RUN_STARTED: payload(["childId", "childRunId"], {
332
- childId: ID,
333
- childRunId: ID,
334
- executionKind: { enum: ["GRAPH", "DURABLE_FN"] }
335
- }),
336
- CHILD_RUN_COMPLETED: payload(["childId"], { childId: ID, childRunId: ID, result: {} }),
337
- CHILD_RUN_FAILED: payload(["childId", "failure"], {
338
- childId: ID,
339
- childRunId: ID,
340
- failure: FAILURE_REF
341
- }),
342
- CHILD_RUN_CANCELLED: payload(["childId"], { childId: ID, childRunId: ID }),
343
- CHILD_RUN_TERMINATED: payload(["childId"], {
344
- childId: ID,
345
- childRunId: ID,
346
- reason: { type: "string" }
347
- }),
348
- CHILD_RUN_TIMED_OUT: payload(["childId"], {
349
- childId: ID,
350
- childRunId: ID,
351
- timeoutType: { enum: ["WORKFLOW_RUN", "WORKFLOW_EXECUTION"] }
352
- }),
353
- EXTERNAL_RUN_CANCEL_REQUESTED: payload(["externalId", "target"], {
354
- externalId: ID,
355
- target: { $ref: "#/$defs/runTarget" }
356
- }),
357
- EXTERNAL_RUN_CANCEL_RESOLVED: payload(["externalId", "ok"], {
358
- externalId: ID,
359
- ok: { type: "boolean" },
360
- targetRunId: { type: "string" },
361
- failure: FAILURE_REF
362
- }),
363
- EXTERNAL_RUN_SIGNALED: {
364
- type: "object",
365
- required: ["externalId"],
366
- description: "Two forms. Initiated (appended for the SIGNAL_RUN command): {externalId, target, name, payload}. Resolved (appended by the service after delivery, dedupeKey signal-out:<runId>:<externalId>): {externalId, resolved: true, ok, failure?, targetRunId?}.",
367
- properties: {
368
- externalId: ID,
369
- target: { $ref: "#/$defs/runTarget" },
370
- name: ID,
371
- payload: {},
372
- resolved: { const: true },
373
- ok: { type: "boolean" },
374
- targetRunId: { type: "string" },
375
- failure: FAILURE_REF
376
- },
377
- if: { required: ["resolved"] },
378
- then: { required: ["ok"] },
379
- else: { required: ["target", "name"] }
380
- },
381
- SIDE_EFFECT_RECORDED: payload(["sideEffectId", "value"], { sideEffectId: ID, value: {} }),
382
- LOCAL_ACTIVITY_COMPLETED: payload(["localActivityId", "attempts"], {
383
- localActivityId: ID,
384
- result: {},
385
- attempts: { type: "integer", minimum: 1 }
386
- }),
387
- LOCAL_ACTIVITY_FAILED: payload(["localActivityId", "attempts", "failure"], {
388
- localActivityId: ID,
389
- failure: FAILURE_REF,
390
- attempts: { type: "integer", minimum: 1 }
391
- }),
392
- SEARCH_ATTRIBUTES_UPSERTED: payload(["attributes"], { attributes: { type: "object" } }),
393
- CONTEXT_UPSERTED: payload(["entries"], { entries: { type: "object" } }),
394
- MARKER_RECORDED: payload(["markerId", "data"], {
395
- markerId: ID,
396
- data: {}
397
- }),
398
- WORKFLOW_CANCEL_REQUESTED: payload([], { actor: {}, reason: { type: "string" } }),
399
- WORKFLOW_RESET: payload(["fromRunId", "toSeq"], {
400
- fromRunId: ID,
401
- toSeq: { type: "integer", minimum: 1 },
402
- reason: { type: "string" }
403
- }),
404
- VERSIONING_OVERRIDE_SET: payload(["override"], { override: {} }),
405
- WORKFLOW_COMPLETED: payload(["output"], { output: {} }),
406
- WORKFLOW_FAILED: payload(["failure"], { failure: FAILURE_REF }),
407
- WORKFLOW_CANCELLED: payload([], { details: {} }),
408
- WORKFLOW_TERMINATED: payload([], { reason: { type: "string" }, actor: {} }),
409
- WORKFLOW_TIMED_OUT: payload(["timeoutType"], {
410
- timeoutType: { enum: ["WORKFLOW_RUN", "WORKFLOW_EXECUTION"] }
411
- }),
412
- WORKFLOW_CONTINUED_AS_NEW: payload(["input", "options"], {
413
- input: {},
414
- options: { type: "object" },
415
- newRunId: { type: "string" }
416
- })
417
- };
418
- function compact(value) {
419
- const out = {};
420
- for (const [key, entry] of Object.entries(value)) {
421
- if (entry === void 0) continue;
422
- out[key] = typeof entry === "object" && entry !== null && !Array.isArray(entry) ? compact(entry) : entry;
423
- }
424
- return out;
425
- }
426
- var RUN_EVENT_RECORD = {
427
- type: "object",
428
- required: ["seq", "type", "payload", "createdAt"],
429
- properties: {
430
- seq: { type: "integer", minimum: 1 },
431
- type: { enum: [...chunk623FVQSN_cjs.EVENT_TYPES] },
432
- taskId: { type: ["string", "null"] },
433
- payload: { type: "object" },
434
- createdAt: { type: "string", minLength: 1 },
435
- dedupeKey: { type: ["string", "null"] }
436
- },
437
- allOf: chunk623FVQSN_cjs.EVENT_TYPES.map((type) => ({
438
- if: { properties: { type: { const: type } }, required: ["type"] },
439
- then: { properties: { payload: { $ref: `#/$defs/payload_${type}` } } }
440
- }))
441
- };
442
- function payloadDefs() {
443
- const defs = {};
444
- for (const type of chunk623FVQSN_cjs.EVENT_TYPES) defs[`payload_${type}`] = compact(EVENT_PAYLOADS[type]);
445
- return defs;
446
- }
447
- function commandDefs() {
448
- const defs = {};
449
- for (const type of chunk623FVQSN_cjs.COMMAND_TYPES) defs[`command_${type}`] = COMMAND_DEFS[type];
450
- return defs;
451
- }
452
- var COMMAND_ONE_OF = {
453
- type: "object",
454
- required: ["type"],
455
- properties: { type: { enum: [...chunk623FVQSN_cjs.COMMAND_TYPES] } },
456
- allOf: chunk623FVQSN_cjs.COMMAND_TYPES.map((type) => ({
457
- if: { properties: { type: { const: type } }, required: ["type"] },
458
- then: { $ref: `#/$defs/command_${type}` }
459
- }))
460
- };
461
- var RUN_EVENT_SCHEMA = {
462
- $schema: "https://json-schema.org/draft/2020-12/schema",
463
- $id: RUN_EVENT_SCHEMA_ID,
464
- title: "FluidGrids durable-function history event",
465
- description: "One row of workflow_run_events as the service returns it (offloaded payloads inlined). type is UPPER_SNAKE.",
466
- ...RUN_EVENT_RECORD,
467
- $defs: { ...SHARED_DEFS, ...payloadDefs() }
468
- };
469
- var WORKFLOW_COMMAND_SCHEMA = {
470
- $schema: "https://json-schema.org/draft/2020-12/schema",
471
- $id: WORKFLOW_COMMAND_SCHEMA_ID,
472
- title: "FluidGrids workflow-task command",
473
- description: "A flat object discriminated by an UPPER_SNAKE type. Commands travel as [JSON!]! (DB4). UPSERT_SEARCH_ATTRIBUTES, ACCEPT_UPDATE, REJECT_UPDATE and COMPLETE_UPDATE are defined but refused in Phase B.",
474
- ...COMMAND_ONE_OF,
475
- $defs: { ...SHARED_DEFS, ...commandDefs() }
476
- };
477
- var WORKFLOW_TASK_SCHEMA = {
478
- $schema: "https://json-schema.org/draft/2020-12/schema",
479
- $id: WORKFLOW_TASK_SCHEMA_ID,
480
- title: "FluidGrids workflow task (runtime ABI protocol 1)",
481
- description: 'globalThis.__fluidgridsRuntime: start(JSON of request); while (step() === "more") drain jobs; complete() returns JSON of result.',
482
- oneOf: [{ $ref: "#/$defs/request" }, { $ref: "#/$defs/result" }],
483
- $defs: {
484
- ...SHARED_DEFS,
485
- ...payloadDefs(),
486
- ...commandDefs(),
487
- event: RUN_EVENT_RECORD,
488
- command: COMMAND_ONE_OF,
489
- info: {
490
- type: "object",
491
- required: ["runId", "workspaceId"],
492
- properties: {
493
- runId: ID,
494
- workspaceId: ID,
495
- workflowKey: { type: "string" },
496
- version: {},
497
- buildId: { type: "string" },
498
- businessId: { type: "string" },
499
- attempt: { type: "integer", minimum: 1 },
500
- taskQueue: { type: "string" },
501
- parentRunId: { type: ["string", "null"] },
502
- rootRunId: { type: ["string", "null"] },
503
- firstRunId: { type: ["string", "null"] },
504
- continuedFromRunId: { type: ["string", "null"] },
505
- lastResult: {},
506
- lastFailure: { oneOf: [{ type: "null" }, FAILURE_REF] },
507
- startedAt: { type: "string" },
508
- runStartedAt: { type: "string" },
509
- historyLimit: {
510
- type: "object",
511
- required: ["events", "bytes"],
512
- properties: {
513
- events: { type: "integer", minimum: 1 },
514
- bytes: { type: "integer", minimum: 1 }
515
- }
516
- },
517
- timeouts: { type: "object" },
518
- headers: { $ref: "#/$defs/headers" },
519
- priority: { type: "integer", minimum: 1, maximum: 5 },
520
- summary: { type: "string" },
521
- details: { type: "string" },
522
- context: { type: "object" }
523
- }
524
- },
525
- request: {
526
- type: "object",
527
- required: ["protocol", "kind", "workflowFn", "info", "history", "nowMs"],
528
- properties: {
529
- protocol: { const: chunk623FVQSN_cjs.HISTORY_PROTOCOL },
530
- kind: { enum: ["task", "query", "verify"] },
531
- workflowFn: ID,
532
- info: { $ref: "#/$defs/info" },
533
- history: { type: "array", items: { $ref: "#/$defs/event" } },
534
- nowMs: { type: "number" },
535
- localActivityResults: {
536
- type: "array",
537
- items: {
538
- type: "object",
539
- required: ["localActivityId", "attempts"],
540
- properties: {
541
- localActivityId: ID,
542
- result: {},
543
- failure: FAILURE_REF,
544
- attempts: { type: "integer", minimum: 1 }
545
- }
546
- }
547
- },
548
- queries: {
549
- type: "array",
550
- items: {
551
- type: "object",
552
- required: ["queryId", "name"],
553
- properties: {
554
- queryId: ID,
555
- name: { enum: [...chunk623FVQSN_cjs.BUILT_IN_QUERIES] },
556
- args: {}
557
- }
558
- }
559
- }
560
- }
561
- },
562
- result: {
563
- type: "object",
564
- required: ["protocol", "outcome", "commands", "logs"],
565
- properties: {
566
- protocol: { const: chunk623FVQSN_cjs.HISTORY_PROTOCOL },
567
- outcome: { enum: ["commands", "failed", "localActivityRequested"] },
568
- commands: { type: "array", items: { $ref: "#/$defs/command" } },
569
- localActivityRequests: { type: "array", items: { type: "object" } },
570
- queryResults: {
571
- type: "array",
572
- items: {
573
- type: "object",
574
- required: ["queryId"],
575
- properties: { queryId: ID, value: {}, error: { type: "string" } }
576
- }
577
- },
578
- failure: {
579
- type: "object",
580
- required: ["cause", "message"],
581
- properties: {
582
- cause: { enum: [...chunk623FVQSN_cjs.TASK_FAILURE_CAUSES] },
583
- message: { type: "string" },
584
- stackTrace: { type: "string" },
585
- seq: { type: "integer" },
586
- errorType: { type: "string" }
587
- }
588
- },
589
- logs: {
590
- type: "array",
591
- items: {
592
- type: "object",
593
- required: ["level", "message"],
594
- properties: {
595
- level: { enum: ["debug", "info", "warn", "error"] },
596
- message: { type: "string" },
597
- data: {}
598
- }
599
- }
600
- },
601
- stackTrace: { type: "string" }
602
- }
603
- }
604
- }
605
- };
606
- var HISTORY_FILE_SCHEMA = {
607
- $schema: "https://json-schema.org/draft/2020-12/schema",
608
- $id: HISTORY_FILE_SCHEMA_ID,
609
- title: "FluidGrids durable-function history file",
610
- type: "object",
611
- required: ["format", "formatVersion", "workflowFn", "events"],
612
- properties: {
613
- format: { const: HISTORY_FILE_FORMAT },
614
- formatVersion: { const: chunk623FVQSN_cjs.HISTORY_PROTOCOL },
615
- name: { type: "string" },
616
- description: { type: "string" },
617
- workflowFn: ID,
618
- source: { type: "string", description: "Fixture source module, relative to the file." },
619
- replaySource: {
620
- type: "string",
621
- description: "Fixture module the replay check runs instead of source (a hotfix or a patched() version)."
622
- },
623
- replay: {
624
- type: "boolean",
625
- description: "False for histories that use Phase C features (updates); they are parsed and projected but not replayed."
626
- },
627
- info: { $ref: "#/$defs/info" },
628
- nowMs: {
629
- type: "number",
630
- description: "nowMs of the replay request for the conformance check."
631
- },
632
- events: { type: "array", items: { $ref: "#/$defs/event" } },
633
- expected: {
634
- type: "object",
635
- description: "The replay result the conformance check must reproduce."
636
- }
637
- },
638
- $defs: {
639
- ...SHARED_DEFS,
640
- ...payloadDefs(),
641
- event: RUN_EVENT_RECORD,
642
- info: WORKFLOW_TASK_SCHEMA.$defs.info
643
- }
644
- };
645
- var HISTORY_SCHEMA_FILES = [
646
- ["run-event.schema.json", RUN_EVENT_SCHEMA],
647
- ["workflow-command.schema.json", WORKFLOW_COMMAND_SCHEMA],
648
- ["workflow-task.schema.json", WORKFLOW_TASK_SCHEMA],
649
- ["history-file.schema.json", HISTORY_FILE_SCHEMA]
650
- ];
651
- var tools;
652
- function schemaTools() {
653
- if (!tools) {
654
- const ajv = new _2020_js.Ajv2020({ allErrors: true, strict: false });
655
- tools = {
656
- ajv,
657
- command: ajv.compile(WORKFLOW_COMMAND_SCHEMA),
658
- event: ajv.compile(RUN_EVENT_SCHEMA),
659
- file: ajv.compile(HISTORY_FILE_SCHEMA)
660
- };
661
- }
662
- return tools;
663
- }
664
- function issuesOf(index, errors) {
665
- const real = (errors ?? []).filter((error) => error.keyword !== "if");
666
- return real.map((error) => ({
667
- index,
668
- code: `schema.${error.keyword}`,
669
- message: `${error.instancePath || "/"} ${error.message ?? "is invalid"}`,
670
- path: error.instancePath
671
- }));
672
- }
673
- function validateCommand(command2, index = 0) {
674
- const { command: validate } = schemaTools();
675
- if (validate(command2)) {
676
- return { ok: true, command: command2 };
677
- }
678
- return { ok: false, issues: issuesOf(index, validate.errors) };
679
- }
680
- function idOf(command2) {
681
- switch (command2.type) {
682
- case "SCHEDULE_ACTIVITY":
683
- return `activity:${command2.activityId}`;
684
- case "START_TIMER":
685
- return `timer:${command2.timerId}`;
686
- case "START_CHILD_RUN":
687
- return `child:${command2.childId}`;
688
- case "SIGNAL_RUN":
689
- case "REQUEST_CANCEL_EXTERNAL_RUN":
690
- return `external:${command2.externalId}`;
691
- case "RECORD_SIDE_EFFECT":
692
- return `sideEffect:${command2.sideEffectId}`;
693
- case "RECORD_MARKER":
694
- return `marker:${command2.markerId}`;
695
- case "RECORD_LOCAL_ACTIVITY":
696
- return `local:${command2.localActivityId}`;
697
- default:
698
- return void 0;
699
- }
700
- }
701
- function validateCommands(commands, options = {}) {
702
- const max = options.maxCommands ?? 1e3;
703
- if (!Array.isArray(commands))
704
- return {
705
- ok: false,
706
- cause: "INVALID_REQUEST",
707
- issues: [{ index: 0, code: "commands.notArray", message: "commands must be an array" }]
708
- };
709
- if (commands.length > max)
710
- return {
711
- ok: false,
712
- cause: "INVALID_REQUEST",
713
- issues: [
714
- {
715
- index: max,
716
- code: "commands.tooMany",
717
- message: `A task may return at most ${max} commands; it returned ${commands.length}`
718
- }
719
- ]
720
- };
721
- const issues = [];
722
- const valid = [];
723
- const ids = /* @__PURE__ */ new Set();
724
- let unsupported = false;
725
- commands.forEach((raw, index) => {
726
- const checked = validateCommand(raw, index);
727
- if (!checked.ok) {
728
- issues.push(...checked.issues);
729
- return;
730
- }
731
- const command2 = checked.command;
732
- if (!chunkP6TA5EZT_cjs.isWorkflowCommandEnabled(command2, options.enabled)) {
733
- unsupported = true;
734
- issues.push({
735
- index,
736
- code: "commands.unsupported",
737
- message: `${command2.type} is not supported in this release`
738
- });
739
- }
740
- const id = idOf(command2);
741
- if (id !== void 0) {
742
- if (ids.has(id))
743
- issues.push({ index, code: "commands.duplicateId", message: `${id} is used twice` });
744
- ids.add(id);
745
- }
746
- if (chunk623FVQSN_cjs.TERMINAL_COMMANDS.has(command2.type) && index !== commands.length - 1)
747
- issues.push({
748
- index,
749
- code: "commands.terminalNotLast",
750
- message: `${command2.type} must be the last command of the batch`
751
- });
752
- if (command2.type === "SCHEDULE_ACTIVITY" && !chunk2J6TF7YI_cjs.isActivityNodeTypeAllowed(command2.nodeType))
753
- issues.push({
754
- index,
755
- code: "durable.activityTypeNotAllowed",
756
- message: `${command2.nodeType} cannot run as a durable activity`,
757
- path: "/nodeType"
758
- });
759
- valid.push(command2);
760
- });
761
- if (issues.length > 0)
762
- return { ok: false, cause: unsupported ? "UNSUPPORTED_COMMAND" : "INVALID_REQUEST", issues };
763
- return { ok: true, commands: valid };
764
- }
765
- function validateHistory(events) {
766
- const { event: validate } = schemaTools();
767
- if (!Array.isArray(events))
768
- return {
769
- ok: false,
770
- issues: [{ index: 0, code: "history.notArray", message: "history must be an array" }]
771
- };
772
- const issues = [];
773
- events.forEach((event, index) => {
774
- if (!validate(event)) {
775
- issues.push(...issuesOf(index, validate.errors));
776
- return;
777
- }
778
- if (chunkSAENRNBJ_cjs.isRecord(event) && event["seq"] !== index + 1)
779
- issues.push({
780
- index,
781
- code: "history.seqGap",
782
- message: `event ${index + 1} has seq ${String(event["seq"])}`
783
- });
784
- });
785
- return { ok: issues.length === 0, issues };
786
- }
787
- function validateHistoryFile(value) {
788
- const { file: validate } = schemaTools();
789
- if (validate(value)) return validateHistory(chunkSAENRNBJ_cjs.isRecord(value) ? value["events"] : void 0);
790
- return { ok: false, issues: issuesOf(0, validate.errors) };
791
- }
792
- function compilePayloadValidator(schema) {
793
- const { ajv } = schemaTools();
794
- const validate = ajv.compile(schema);
795
- return (value) => {
796
- if (validate(value)) return { ok: true };
797
- return {
798
- ok: false,
799
- errors: (validate.errors ?? []).map(
800
- (error) => `${error.instancePath || "/"} ${error.message ?? "is invalid"}`
801
- )
802
- };
803
- };
804
- }
805
-
806
- // src/history/file.ts
807
- var HistoryFileError = class extends Error {
808
- constructor(message, issues = []) {
809
- super(message);
810
- this.issues = issues;
811
- this.name = "HistoryFileError";
812
- }
813
- issues;
814
- };
815
- function parseHistoryFile(input) {
816
- let value = input;
817
- if (typeof input === "string") {
818
- try {
819
- value = JSON.parse(input);
820
- } catch (error) {
821
- throw new HistoryFileError(
822
- `Not JSON: ${error instanceof Error ? error.message : String(error)}`
823
- );
824
- }
825
- }
826
- if (!chunkSAENRNBJ_cjs.isRecord(value) || value["format"] !== HISTORY_FILE_FORMAT)
827
- throw new HistoryFileError(`Not a ${HISTORY_FILE_FORMAT} document`);
828
- const checked = validateHistoryFile(value);
829
- if (!checked.ok)
830
- throw new HistoryFileError(
831
- "The history file does not match history-file.schema.json",
832
- checked.issues.map((issue) => `#${issue.index}: ${issue.message}`)
833
- );
834
- return value;
835
- }
836
- function createHistoryFile(workflowFn, events, extra = {}) {
837
- return {
838
- format: HISTORY_FILE_FORMAT,
839
- formatVersion: chunk623FVQSN_cjs.HISTORY_PROTOCOL,
840
- ...extra,
841
- workflowFn,
842
- events
843
- };
844
- }
845
- function serializeHistoryFile(file) {
846
- return `${JSON.stringify(file, null, 2)}
847
- `;
848
- }
849
-
850
- exports.HISTORY_FILE_FORMAT = HISTORY_FILE_FORMAT;
851
- exports.HISTORY_FILE_SCHEMA = HISTORY_FILE_SCHEMA;
852
- exports.HISTORY_FILE_SCHEMA_ID = HISTORY_FILE_SCHEMA_ID;
853
- exports.HISTORY_SCHEMA_FILES = HISTORY_SCHEMA_FILES;
854
- exports.HistoryFileError = HistoryFileError;
855
- exports.RUN_EVENT_SCHEMA = RUN_EVENT_SCHEMA;
856
- exports.RUN_EVENT_SCHEMA_ID = RUN_EVENT_SCHEMA_ID;
857
- exports.WORKFLOW_COMMAND_SCHEMA = WORKFLOW_COMMAND_SCHEMA;
858
- exports.WORKFLOW_COMMAND_SCHEMA_ID = WORKFLOW_COMMAND_SCHEMA_ID;
859
- exports.WORKFLOW_TASK_SCHEMA = WORKFLOW_TASK_SCHEMA;
860
- exports.WORKFLOW_TASK_SCHEMA_ID = WORKFLOW_TASK_SCHEMA_ID;
861
- exports.compilePayloadValidator = compilePayloadValidator;
862
- exports.createHistoryFile = createHistoryFile;
863
- exports.parseHistoryFile = parseHistoryFile;
864
- exports.serializeHistoryFile = serializeHistoryFile;
865
- exports.validateCommand = validateCommand;
866
- exports.validateCommands = validateCommands;
867
- exports.validateHistory = validateHistory;
868
- exports.validateHistoryFile = validateHistoryFile;