@fluidgrids/workflows 2026.1029.1 → 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 (118) hide show
  1. package/README.md +112 -4
  2. package/dist/{activation-CESehfYi.d.cts → activation-DqUfpHzk.d.cts} +1 -1
  3. package/dist/{activation-BnVQMv9y.d.ts → activation-xpx1oWuo.d.ts} +1 -1
  4. package/dist/{chunk-MJ5TGYVG.js → chunk-2D3MYIIF.js} +969 -153
  5. package/dist/{chunk-2B37XAFQ.cjs → chunk-3U2NU7YC.cjs} +24 -11
  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-2DDULZFM.js → chunk-5HIVIV53.js} +86 -75
  9. package/dist/chunk-5MFVJM76.js +1222 -0
  10. package/dist/{chunk-EWYADREB.cjs → chunk-672KMMBK.cjs} +2 -2
  11. package/dist/{chunk-KXJDRQ6G.js → chunk-6A2FGSUS.js} +22 -2
  12. package/dist/{chunk-OIX4O6UR.js → chunk-6OLN6BMB.js} +16 -3
  13. package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
  14. package/dist/chunk-A5SXCA62.cjs +93 -0
  15. package/dist/chunk-AC6ZEXVR.js +85 -0
  16. package/dist/{chunk-FWBRQWRX.js → chunk-AE5Q6ZAJ.js} +167 -10
  17. package/dist/{chunk-7ILGCUI6.js → chunk-C4F5KJTI.js} +142 -3
  18. package/dist/{chunk-WXXNCHUY.js → chunk-G5H32GIG.js} +1 -1
  19. package/dist/{chunk-OMY3CKUZ.cjs → chunk-GEQDGUGB.cjs} +1042 -226
  20. package/dist/{chunk-25BKWR2O.js → chunk-HCM7ZC7Q.js} +1 -1
  21. package/dist/{chunk-I47EENR4.cjs → chunk-HMZUGSMU.cjs} +673 -156
  22. package/dist/{chunk-NXFBVDOI.cjs → chunk-IQPXHQQQ.cjs} +8 -4
  23. package/dist/{chunk-RUQIMTN5.cjs → chunk-ISOIA7NV.cjs} +178 -15
  24. package/dist/chunk-JSC75O5C.cjs +167 -0
  25. package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
  26. package/dist/chunk-ODZ2IAR2.cjs +1247 -0
  27. package/dist/{chunk-FQSJI5NV.js → chunk-SR7TR5KX.js} +6 -2
  28. package/dist/{chunk-OKX3FYIM.cjs → chunk-TCTE7DX5.cjs} +3 -3
  29. package/dist/{chunk-3FIDHONL.cjs → chunk-TYF56RGB.cjs} +99 -80
  30. package/dist/{chunk-J3PYFGKA.cjs → chunk-VA4OFR72.cjs} +162 -4
  31. package/dist/chunk-VU5S5A7V.js +150 -0
  32. package/dist/{chunk-A36CCOWS.js → chunk-YEHR4NNE.js} +633 -128
  33. package/dist/{chunk-ELL2RBML.cjs → chunk-ZCGKGDCL.cjs} +23 -1
  34. package/dist/codegen/index.d.cts +2 -2
  35. package/dist/codegen/index.d.ts +2 -2
  36. package/dist/{collect-BTHjQaSp.d.ts → collect-6NIEufHd.d.ts} +20 -3
  37. package/dist/{collect-CSyOg5XC.d.cts → collect-CcTCKqx6.d.cts} +20 -3
  38. package/dist/{file-cgL9l9l8.d.cts → file-BxYpwjRQ.d.cts} +250 -15
  39. package/dist/{file-olQudcx5.d.ts → file-CFdPQJI9.d.ts} +250 -15
  40. package/dist/history/index.cjs +283 -106
  41. package/dist/history/index.d.cts +549 -10
  42. package/dist/history/index.d.ts +549 -10
  43. package/dist/history/index.js +5 -4
  44. package/dist/index.cjs +146 -53
  45. package/dist/index.d.cts +38 -14
  46. package/dist/index.d.ts +38 -14
  47. package/dist/index.js +6 -5
  48. package/dist/interceptors-CNcr2dlk.d.ts +159 -0
  49. package/dist/interceptors-CqkNZVfI.d.cts +159 -0
  50. package/dist/ir/index.cjs +339 -36
  51. package/dist/ir/index.d.cts +244 -8
  52. package/dist/ir/index.d.ts +244 -8
  53. package/dist/ir/index.js +306 -21
  54. package/dist/{lower-3S6PsqjJ.d.cts → lower-BtRfIW2A.d.cts} +23 -9
  55. package/dist/{lower-DmZpQ8hJ.d.ts → lower-CpsMFOFX.d.ts} +23 -9
  56. package/dist/{manifest-BJjrQt77.d.ts → manifest-D-I_twys.d.ts} +1 -1
  57. package/dist/{manifest-gRI2Q5Fj.d.cts → manifest-DahBQVM8.d.cts} +1 -1
  58. package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
  59. package/dist/node-evaluator-LEEVD7H7.js +14 -0
  60. package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
  61. package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
  62. package/dist/quickjs/index.cjs +27 -27
  63. package/dist/quickjs/index.d.cts +6 -6
  64. package/dist/quickjs/index.d.ts +6 -6
  65. package/dist/quickjs/index.js +9 -9
  66. package/dist/roundtrip/index.cjs +72 -66
  67. package/dist/roundtrip/index.d.cts +25 -11
  68. package/dist/roundtrip/index.d.ts +25 -11
  69. package/dist/roundtrip/index.js +13 -11
  70. package/dist/runtime/index.cjs +19 -19
  71. package/dist/runtime/index.d.cts +139 -12
  72. package/dist/runtime/index.d.ts +139 -12
  73. package/dist/runtime/index.js +6 -6
  74. package/dist/testing/index.cjs +688 -121
  75. package/dist/testing/index.d.cts +174 -10
  76. package/dist/testing/index.d.ts +174 -10
  77. package/dist/testing/index.js +646 -82
  78. package/dist/{types-CnIOinoz.d.ts → types-Bv2i4cBX.d.cts} +126 -23
  79. package/dist/{types-CQKOhPTa.d.cts → types-DGx-b9eq.d.ts} +126 -23
  80. package/dist/{types-Bb2wRnJ5.d.cts → types-V7jEEUaL.d.cts} +1 -1
  81. package/dist/{types-Bb2wRnJ5.d.ts → types-V7jEEUaL.d.ts} +1 -1
  82. package/dist/{workflow-8uRU9rhL.d.ts → workflow-B18OeF7g.d.ts} +2 -2
  83. package/dist/{workflow-DWTPHFbt.d.ts → workflow-BGnv8SS6.d.ts} +261 -14
  84. package/dist/{workflow-CZOXUlQ5.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
  85. package/dist/{workflow-O6e64ZcG.d.cts → workflow-DS32Gtws.d.cts} +261 -14
  86. package/fixtures/histories/activity-options-updated.history.json +159 -0
  87. package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
  88. package/fixtures/histories/codec-opaque.history.json +229 -0
  89. package/fixtures/histories/dynamic-workflow.history.json +150 -0
  90. package/fixtures/histories/interceptor-headers.history.json +339 -0
  91. package/fixtures/histories/query-custom.history.json +213 -0
  92. package/fixtures/histories/query-default-handler.history.json +120 -0
  93. package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
  94. package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
  95. package/fixtures/histories/search-attributes-upserted.history.json +177 -0
  96. package/fixtures/histories/update-accepted-completed.history.json +45 -30
  97. package/fixtures/histories/update-default-handler.history.json +246 -0
  98. package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
  99. package/fixtures/histories/update-not-handled.history.json +138 -0
  100. package/fixtures/histories/update-rejected-no-event.history.json +190 -0
  101. package/fixtures/histories/update-with-start-admitted.history.json +150 -0
  102. package/fixtures/histories/user-activity-cancel.history.json +149 -0
  103. package/fixtures/histories/user-activity-retry.history.json +143 -0
  104. package/fixtures/histories/user-activity.history.json +149 -0
  105. package/package.json +1 -1
  106. package/schema/bridge-v2.schema.json +1062 -0
  107. package/schema/history-file.schema.json +255 -81
  108. package/schema/ir-v2.schema.json +246 -1
  109. package/schema/payload-fields.json +162 -0
  110. package/schema/run-event.schema.json +239 -80
  111. package/schema/workflow-command.schema.json +210 -84
  112. package/schema/workflow-task.schema.json +532 -167
  113. package/dist/chunk-6QPOJZT6.cjs +0 -1180
  114. package/dist/chunk-A2OHX3UQ.js +0 -1156
  115. package/dist/chunk-PWIUEWC3.js +0 -81
  116. package/dist/chunk-YHBVMOMK.cjs +0 -87
  117. package/dist/node-evaluator-SOADN23V.js +0 -14
  118. package/dist/node-evaluator-YGDEXK4U.cjs +0 -24
@@ -0,0 +1,1062 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.fluidgrids.ai/schemas/bridge-v2.schema.json",
4
+ "title": "FluidGrids worker bridge, protocol 2",
5
+ "description": "Frames between a self-hosted worker and wspace-sandbox-svc over /runner-bridge (JSON text frames, Bearer fgr_ token of kind WORKER, ping every 20 s, 65 s idle timeout, 10 MiB frame cap). Close codes: 4001 Unauthorized, 4002 Revoked, 4003 Replaced, 4004 ProtocolError, 4008 IdleTimeout, 4009 ShuttingDown, 4010 QuotaExceeded, 4011 QueueNotAllowed, 4012 FeatureDisabled.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/workerFrame"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/serviceFrame"
12
+ }
13
+ ],
14
+ "$defs": {
15
+ "workflowTaskRef": {
16
+ "type": "object",
17
+ "required": [
18
+ "kind",
19
+ "runId",
20
+ "taskId",
21
+ "attempt",
22
+ "expectedHistoryLength"
23
+ ],
24
+ "properties": {
25
+ "kind": {
26
+ "const": "workflow"
27
+ },
28
+ "runId": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "maxLength": 256
32
+ },
33
+ "taskId": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 256
37
+ },
38
+ "attempt": {
39
+ "type": "integer",
40
+ "minimum": 1
41
+ },
42
+ "expectedHistoryLength": {
43
+ "type": "integer",
44
+ "minimum": 1
45
+ }
46
+ },
47
+ "additionalProperties": false
48
+ },
49
+ "queryTaskRef": {
50
+ "type": "object",
51
+ "required": [
52
+ "kind",
53
+ "runId",
54
+ "queryTaskId"
55
+ ],
56
+ "properties": {
57
+ "kind": {
58
+ "const": "query"
59
+ },
60
+ "runId": {
61
+ "type": "string",
62
+ "minLength": 1,
63
+ "maxLength": 256
64
+ },
65
+ "queryTaskId": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "maxLength": 256
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "activityTaskRef": {
74
+ "type": "object",
75
+ "required": [
76
+ "kind",
77
+ "runId",
78
+ "activityId",
79
+ "attempt"
80
+ ],
81
+ "properties": {
82
+ "kind": {
83
+ "const": "activity"
84
+ },
85
+ "runId": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "maxLength": 256
89
+ },
90
+ "activityId": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "maxLength": 256
94
+ },
95
+ "attempt": {
96
+ "type": "integer",
97
+ "minimum": 1
98
+ }
99
+ },
100
+ "additionalProperties": false
101
+ },
102
+ "taskRef": {
103
+ "oneOf": [
104
+ {
105
+ "$ref": "#/$defs/workflowTaskRef"
106
+ },
107
+ {
108
+ "$ref": "#/$defs/queryTaskRef"
109
+ },
110
+ {
111
+ "$ref": "#/$defs/activityTaskRef"
112
+ }
113
+ ]
114
+ },
115
+ "historyPage": {
116
+ "type": "object",
117
+ "required": [
118
+ "events",
119
+ "from",
120
+ "nextAfter",
121
+ "hasMore"
122
+ ],
123
+ "properties": {
124
+ "events": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "object"
128
+ }
129
+ },
130
+ "from": {
131
+ "type": "integer",
132
+ "minimum": 1
133
+ },
134
+ "nextAfter": {
135
+ "oneOf": [
136
+ {
137
+ "type": "null"
138
+ },
139
+ {
140
+ "type": "integer",
141
+ "minimum": 1
142
+ }
143
+ ]
144
+ },
145
+ "hasMore": {
146
+ "type": "boolean"
147
+ }
148
+ },
149
+ "additionalProperties": false
150
+ },
151
+ "queryRequests": {
152
+ "type": "array",
153
+ "items": {
154
+ "type": "object",
155
+ "required": [
156
+ "queryId",
157
+ "name"
158
+ ],
159
+ "properties": {
160
+ "queryId": {
161
+ "type": "string",
162
+ "minLength": 1,
163
+ "maxLength": 256
164
+ },
165
+ "name": {
166
+ "type": "string",
167
+ "minLength": 1,
168
+ "maxLength": 256
169
+ },
170
+ "args": {}
171
+ },
172
+ "additionalProperties": false
173
+ }
174
+ },
175
+ "queryResults": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "object",
179
+ "required": [
180
+ "queryId"
181
+ ],
182
+ "properties": {
183
+ "queryId": {
184
+ "type": "string",
185
+ "minLength": 1,
186
+ "maxLength": 256
187
+ },
188
+ "value": {},
189
+ "error": {
190
+ "type": "string"
191
+ },
192
+ "rejected": {
193
+ "type": "boolean"
194
+ }
195
+ },
196
+ "additionalProperties": false
197
+ }
198
+ },
199
+ "hello": {
200
+ "type": "object",
201
+ "required": [
202
+ "type",
203
+ "protocol",
204
+ "kind",
205
+ "sdk",
206
+ "identity",
207
+ "taskQueues",
208
+ "buildIds",
209
+ "workflows",
210
+ "activities",
211
+ "slots",
212
+ "host",
213
+ "encodings"
214
+ ],
215
+ "properties": {
216
+ "type": {
217
+ "const": "hello"
218
+ },
219
+ "protocol": {
220
+ "const": 2
221
+ },
222
+ "kind": {
223
+ "const": "worker"
224
+ },
225
+ "sdk": {
226
+ "type": "object",
227
+ "required": [
228
+ "language",
229
+ "version"
230
+ ],
231
+ "properties": {
232
+ "language": {
233
+ "enum": [
234
+ "typescript",
235
+ "python"
236
+ ]
237
+ },
238
+ "version": {
239
+ "type": "string",
240
+ "minLength": 1,
241
+ "maxLength": 256
242
+ }
243
+ },
244
+ "additionalProperties": false
245
+ },
246
+ "identity": {
247
+ "type": "string",
248
+ "minLength": 1,
249
+ "maxLength": 256
250
+ },
251
+ "taskQueues": {
252
+ "type": "array",
253
+ "items": {
254
+ "type": "string",
255
+ "minLength": 1
256
+ },
257
+ "minItems": 1
258
+ },
259
+ "buildIds": {
260
+ "type": "array",
261
+ "items": {
262
+ "type": "string",
263
+ "minLength": 1
264
+ }
265
+ },
266
+ "workflows": {
267
+ "type": "array",
268
+ "items": {
269
+ "type": "string",
270
+ "minLength": 1
271
+ }
272
+ },
273
+ "activities": {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "string",
277
+ "minLength": 1
278
+ }
279
+ },
280
+ "slots": {
281
+ "type": "object",
282
+ "required": [
283
+ "workflow",
284
+ "activity",
285
+ "localActivity"
286
+ ],
287
+ "properties": {
288
+ "workflow": {
289
+ "type": "integer",
290
+ "minimum": 0
291
+ },
292
+ "activity": {
293
+ "type": "integer",
294
+ "minimum": 0
295
+ },
296
+ "localActivity": {
297
+ "type": "integer",
298
+ "minimum": 0
299
+ }
300
+ },
301
+ "additionalProperties": false
302
+ },
303
+ "host": {
304
+ "type": "object",
305
+ "properties": {
306
+ "os": {
307
+ "type": "string"
308
+ },
309
+ "arch": {
310
+ "type": "string"
311
+ },
312
+ "hostname": {
313
+ "type": "string"
314
+ },
315
+ "runtime": {
316
+ "type": "string"
317
+ }
318
+ },
319
+ "additionalProperties": false
320
+ },
321
+ "encodings": {
322
+ "type": "array",
323
+ "items": {
324
+ "type": "string",
325
+ "minLength": 1
326
+ }
327
+ }
328
+ },
329
+ "additionalProperties": false
330
+ },
331
+ "ping": {
332
+ "type": "object",
333
+ "required": [
334
+ "type"
335
+ ],
336
+ "properties": {
337
+ "type": {
338
+ "const": "ping"
339
+ },
340
+ "t": {
341
+ "type": "number"
342
+ }
343
+ },
344
+ "additionalProperties": false
345
+ },
346
+ "pollers": {
347
+ "type": "object",
348
+ "required": [
349
+ "type",
350
+ "workflow",
351
+ "activity"
352
+ ],
353
+ "properties": {
354
+ "type": {
355
+ "const": "pollers"
356
+ },
357
+ "workflow": {
358
+ "type": "integer",
359
+ "minimum": 0
360
+ },
361
+ "activity": {
362
+ "type": "integer",
363
+ "minimum": 0
364
+ }
365
+ },
366
+ "additionalProperties": false
367
+ },
368
+ "taskResult": {
369
+ "oneOf": [
370
+ {
371
+ "type": "object",
372
+ "required": [
373
+ "type",
374
+ "taskRef",
375
+ "commands",
376
+ "logs",
377
+ "cachedUpTo"
378
+ ],
379
+ "properties": {
380
+ "type": {
381
+ "const": "taskResult"
382
+ },
383
+ "taskRef": {
384
+ "$ref": "#/$defs/workflowTaskRef"
385
+ },
386
+ "commands": {
387
+ "type": "array",
388
+ "items": {
389
+ "type": "object"
390
+ }
391
+ },
392
+ "logs": {
393
+ "type": "array",
394
+ "items": {
395
+ "type": "object"
396
+ }
397
+ },
398
+ "cachedUpTo": {
399
+ "type": "integer",
400
+ "minimum": 0
401
+ },
402
+ "queryResults": {
403
+ "$ref": "#/$defs/queryResults"
404
+ },
405
+ "unfinishedHandlers": {
406
+ "type": "array",
407
+ "items": {
408
+ "type": "object"
409
+ }
410
+ }
411
+ },
412
+ "additionalProperties": false
413
+ },
414
+ {
415
+ "type": "object",
416
+ "required": [
417
+ "type",
418
+ "taskRef",
419
+ "result"
420
+ ],
421
+ "properties": {
422
+ "type": {
423
+ "const": "taskResult"
424
+ },
425
+ "taskRef": {
426
+ "$ref": "#/$defs/activityTaskRef"
427
+ },
428
+ "result": {}
429
+ },
430
+ "additionalProperties": false
431
+ },
432
+ {
433
+ "type": "object",
434
+ "required": [
435
+ "type",
436
+ "taskRef",
437
+ "queryResults"
438
+ ],
439
+ "properties": {
440
+ "type": {
441
+ "const": "taskResult"
442
+ },
443
+ "taskRef": {
444
+ "$ref": "#/$defs/queryTaskRef"
445
+ },
446
+ "queryResults": {
447
+ "$ref": "#/$defs/queryResults"
448
+ }
449
+ },
450
+ "additionalProperties": false
451
+ }
452
+ ]
453
+ },
454
+ "taskFailed": {
455
+ "oneOf": [
456
+ {
457
+ "type": "object",
458
+ "required": [
459
+ "type",
460
+ "taskRef",
461
+ "failure"
462
+ ],
463
+ "properties": {
464
+ "type": {
465
+ "const": "taskFailed"
466
+ },
467
+ "taskRef": {
468
+ "oneOf": [
469
+ {
470
+ "$ref": "#/$defs/workflowTaskRef"
471
+ },
472
+ {
473
+ "$ref": "#/$defs/queryTaskRef"
474
+ }
475
+ ]
476
+ },
477
+ "failure": {
478
+ "type": "object",
479
+ "required": [
480
+ "cause",
481
+ "message"
482
+ ],
483
+ "properties": {
484
+ "cause": {
485
+ "enum": [
486
+ "NON_DETERMINISM",
487
+ "TASK_TIMEOUT",
488
+ "ISOLATE_MEMORY",
489
+ "PROTOCOL_MISMATCH",
490
+ "BUNDLE_UNAVAILABLE",
491
+ "BUNDLE_INTEGRITY",
492
+ "WORKFLOW_CODE_ERROR",
493
+ "HISTORY_LIMIT",
494
+ "UNSUPPORTED_COMMAND",
495
+ "INVALID_REQUEST",
496
+ "INTERNAL"
497
+ ]
498
+ },
499
+ "message": {
500
+ "type": "string"
501
+ },
502
+ "stackTrace": {
503
+ "type": "string"
504
+ },
505
+ "seq": {
506
+ "type": "integer"
507
+ },
508
+ "errorType": {
509
+ "type": "string"
510
+ }
511
+ },
512
+ "additionalProperties": false
513
+ }
514
+ },
515
+ "additionalProperties": false
516
+ },
517
+ {
518
+ "type": "object",
519
+ "required": [
520
+ "type",
521
+ "taskRef",
522
+ "failure"
523
+ ],
524
+ "properties": {
525
+ "type": {
526
+ "const": "taskFailed"
527
+ },
528
+ "taskRef": {
529
+ "$ref": "#/$defs/activityTaskRef"
530
+ },
531
+ "failure": {
532
+ "type": "object",
533
+ "required": [
534
+ "errorType",
535
+ "message"
536
+ ],
537
+ "description": "An activity failure (run-event failure shape)."
538
+ }
539
+ },
540
+ "additionalProperties": false
541
+ }
542
+ ]
543
+ },
544
+ "heartbeat": {
545
+ "type": "object",
546
+ "required": [
547
+ "type",
548
+ "reqId",
549
+ "taskRef"
550
+ ],
551
+ "properties": {
552
+ "type": {
553
+ "const": "heartbeat"
554
+ },
555
+ "reqId": {
556
+ "type": "string",
557
+ "minLength": 1,
558
+ "maxLength": 256
559
+ },
560
+ "taskRef": {
561
+ "$ref": "#/$defs/activityTaskRef"
562
+ },
563
+ "details": {}
564
+ },
565
+ "additionalProperties": false
566
+ },
567
+ "workerHeartbeat": {
568
+ "type": "object",
569
+ "required": [
570
+ "type",
571
+ "slots",
572
+ "pollers",
573
+ "tasksInFlight",
574
+ "cachedRuns"
575
+ ],
576
+ "properties": {
577
+ "type": {
578
+ "const": "workerHeartbeat"
579
+ },
580
+ "slots": {
581
+ "type": "object",
582
+ "required": [
583
+ "workflow",
584
+ "activity",
585
+ "localActivity"
586
+ ],
587
+ "properties": {
588
+ "workflow": {
589
+ "type": "object",
590
+ "required": [
591
+ "used",
592
+ "total"
593
+ ],
594
+ "properties": {
595
+ "used": {
596
+ "type": "integer",
597
+ "minimum": 0
598
+ },
599
+ "total": {
600
+ "type": "integer",
601
+ "minimum": 0
602
+ }
603
+ },
604
+ "additionalProperties": false
605
+ },
606
+ "activity": {
607
+ "type": "object",
608
+ "required": [
609
+ "used",
610
+ "total"
611
+ ],
612
+ "properties": {
613
+ "used": {
614
+ "type": "integer",
615
+ "minimum": 0
616
+ },
617
+ "total": {
618
+ "type": "integer",
619
+ "minimum": 0
620
+ }
621
+ },
622
+ "additionalProperties": false
623
+ },
624
+ "localActivity": {
625
+ "type": "object",
626
+ "required": [
627
+ "used",
628
+ "total"
629
+ ],
630
+ "properties": {
631
+ "used": {
632
+ "type": "integer",
633
+ "minimum": 0
634
+ },
635
+ "total": {
636
+ "type": "integer",
637
+ "minimum": 0
638
+ }
639
+ },
640
+ "additionalProperties": false
641
+ }
642
+ },
643
+ "additionalProperties": false
644
+ },
645
+ "pollers": {
646
+ "type": "object",
647
+ "required": [
648
+ "workflow",
649
+ "activity"
650
+ ],
651
+ "properties": {
652
+ "workflow": {
653
+ "type": "integer",
654
+ "minimum": 0
655
+ },
656
+ "activity": {
657
+ "type": "integer",
658
+ "minimum": 0
659
+ }
660
+ },
661
+ "additionalProperties": false
662
+ },
663
+ "tasksInFlight": {
664
+ "type": "integer",
665
+ "minimum": 0
666
+ },
667
+ "cachedRuns": {
668
+ "type": "integer",
669
+ "minimum": 0
670
+ }
671
+ },
672
+ "additionalProperties": false
673
+ },
674
+ "req": {
675
+ "type": "object",
676
+ "required": [
677
+ "type",
678
+ "id",
679
+ "method",
680
+ "params"
681
+ ],
682
+ "properties": {
683
+ "type": {
684
+ "const": "req"
685
+ },
686
+ "id": {
687
+ "type": "string",
688
+ "minLength": 1,
689
+ "maxLength": 256
690
+ },
691
+ "method": {
692
+ "enum": [
693
+ "history.page",
694
+ "activity.connection"
695
+ ]
696
+ },
697
+ "params": {
698
+ "type": "object"
699
+ }
700
+ },
701
+ "additionalProperties": false
702
+ },
703
+ "bye": {
704
+ "type": "object",
705
+ "required": [
706
+ "type",
707
+ "reason"
708
+ ],
709
+ "properties": {
710
+ "type": {
711
+ "const": "bye"
712
+ },
713
+ "reason": {
714
+ "type": "string"
715
+ }
716
+ },
717
+ "additionalProperties": false
718
+ },
719
+ "welcome": {
720
+ "type": "object",
721
+ "required": [
722
+ "type",
723
+ "protocol",
724
+ "sessionId",
725
+ "workerId",
726
+ "workspaceId",
727
+ "heartbeatSeconds",
728
+ "workerHeartbeatSeconds",
729
+ "maxFrameBytes"
730
+ ],
731
+ "properties": {
732
+ "type": {
733
+ "const": "welcome"
734
+ },
735
+ "protocol": {
736
+ "const": 2
737
+ },
738
+ "sessionId": {
739
+ "type": "string",
740
+ "minLength": 1,
741
+ "maxLength": 256
742
+ },
743
+ "workerId": {
744
+ "type": "string",
745
+ "pattern": "^worker:.+$"
746
+ },
747
+ "workspaceId": {
748
+ "type": "string",
749
+ "minLength": 1,
750
+ "maxLength": 256
751
+ },
752
+ "heartbeatSeconds": {
753
+ "type": "integer",
754
+ "minimum": 1
755
+ },
756
+ "workerHeartbeatSeconds": {
757
+ "type": "integer",
758
+ "minimum": 1
759
+ },
760
+ "maxFrameBytes": {
761
+ "type": "integer",
762
+ "minimum": 1
763
+ }
764
+ },
765
+ "additionalProperties": false
766
+ },
767
+ "task": {
768
+ "oneOf": [
769
+ {
770
+ "type": "object",
771
+ "required": [
772
+ "type",
773
+ "taskRef",
774
+ "lease",
775
+ "request",
776
+ "history"
777
+ ],
778
+ "properties": {
779
+ "type": {
780
+ "const": "task"
781
+ },
782
+ "taskRef": {
783
+ "$ref": "#/$defs/workflowTaskRef"
784
+ },
785
+ "lease": {
786
+ "type": "object"
787
+ },
788
+ "request": {
789
+ "type": "object",
790
+ "required": [
791
+ "workflowFn",
792
+ "info",
793
+ "nowMs"
794
+ ],
795
+ "properties": {
796
+ "workflowFn": {
797
+ "type": "string",
798
+ "minLength": 1,
799
+ "maxLength": 256
800
+ },
801
+ "info": {
802
+ "type": "object"
803
+ },
804
+ "nowMs": {
805
+ "type": "number"
806
+ },
807
+ "updates": {
808
+ "type": "array",
809
+ "items": {
810
+ "type": "object"
811
+ }
812
+ },
813
+ "queries": {
814
+ "$ref": "#/$defs/queryRequests"
815
+ }
816
+ },
817
+ "additionalProperties": false
818
+ },
819
+ "history": {
820
+ "$ref": "#/$defs/historyPage"
821
+ }
822
+ },
823
+ "additionalProperties": false
824
+ },
825
+ {
826
+ "type": "object",
827
+ "required": [
828
+ "type",
829
+ "taskRef",
830
+ "request",
831
+ "history"
832
+ ],
833
+ "properties": {
834
+ "type": {
835
+ "const": "task"
836
+ },
837
+ "taskRef": {
838
+ "$ref": "#/$defs/queryTaskRef"
839
+ },
840
+ "request": {
841
+ "type": "object",
842
+ "required": [
843
+ "workflowFn",
844
+ "info",
845
+ "queries"
846
+ ],
847
+ "properties": {
848
+ "workflowFn": {
849
+ "type": "string",
850
+ "minLength": 1,
851
+ "maxLength": 256
852
+ },
853
+ "info": {
854
+ "type": "object"
855
+ },
856
+ "queries": {
857
+ "$ref": "#/$defs/queryRequests"
858
+ }
859
+ },
860
+ "additionalProperties": false
861
+ },
862
+ "history": {
863
+ "$ref": "#/$defs/historyPage"
864
+ }
865
+ },
866
+ "additionalProperties": false
867
+ },
868
+ {
869
+ "type": "object",
870
+ "required": [
871
+ "type",
872
+ "taskRef",
873
+ "lease"
874
+ ],
875
+ "properties": {
876
+ "type": {
877
+ "const": "task"
878
+ },
879
+ "taskRef": {
880
+ "$ref": "#/$defs/activityTaskRef"
881
+ },
882
+ "lease": {
883
+ "type": "object"
884
+ }
885
+ },
886
+ "additionalProperties": false
887
+ }
888
+ ]
889
+ },
890
+ "heartbeatAck": {
891
+ "type": "object",
892
+ "required": [
893
+ "type",
894
+ "reqId",
895
+ "cancelRequested",
896
+ "paused"
897
+ ],
898
+ "properties": {
899
+ "type": {
900
+ "const": "heartbeatAck"
901
+ },
902
+ "reqId": {
903
+ "type": "string",
904
+ "minLength": 1,
905
+ "maxLength": 256
906
+ },
907
+ "cancelRequested": {
908
+ "type": "boolean"
909
+ },
910
+ "paused": {
911
+ "type": "boolean"
912
+ },
913
+ "pauseReason": {
914
+ "type": "string"
915
+ }
916
+ },
917
+ "additionalProperties": false
918
+ },
919
+ "cancel": {
920
+ "type": "object",
921
+ "required": [
922
+ "type",
923
+ "taskRef",
924
+ "reason"
925
+ ],
926
+ "properties": {
927
+ "type": {
928
+ "const": "cancel"
929
+ },
930
+ "taskRef": {
931
+ "$ref": "#/$defs/taskRef"
932
+ },
933
+ "reason": {
934
+ "type": "string"
935
+ }
936
+ },
937
+ "additionalProperties": false
938
+ },
939
+ "res": {
940
+ "type": "object",
941
+ "required": [
942
+ "type",
943
+ "id",
944
+ "ok"
945
+ ],
946
+ "properties": {
947
+ "type": {
948
+ "const": "res"
949
+ },
950
+ "id": {
951
+ "type": "string",
952
+ "minLength": 1,
953
+ "maxLength": 256
954
+ },
955
+ "ok": {
956
+ "type": "boolean"
957
+ },
958
+ "result": {},
959
+ "error": {
960
+ "type": "object",
961
+ "required": [
962
+ "code",
963
+ "message"
964
+ ],
965
+ "properties": {
966
+ "code": {
967
+ "type": "string"
968
+ },
969
+ "message": {
970
+ "type": "string"
971
+ }
972
+ },
973
+ "additionalProperties": false
974
+ }
975
+ },
976
+ "additionalProperties": false,
977
+ "if": {
978
+ "properties": {
979
+ "ok": {
980
+ "const": false
981
+ }
982
+ },
983
+ "required": [
984
+ "ok"
985
+ ]
986
+ },
987
+ "then": {
988
+ "required": [
989
+ "error"
990
+ ]
991
+ }
992
+ },
993
+ "pong": {
994
+ "type": "object",
995
+ "required": [
996
+ "type"
997
+ ],
998
+ "properties": {
999
+ "type": {
1000
+ "const": "pong"
1001
+ },
1002
+ "t": {
1003
+ "type": "number"
1004
+ }
1005
+ },
1006
+ "additionalProperties": false
1007
+ },
1008
+ "workerFrame": {
1009
+ "oneOf": [
1010
+ {
1011
+ "$ref": "#/$defs/hello"
1012
+ },
1013
+ {
1014
+ "$ref": "#/$defs/ping"
1015
+ },
1016
+ {
1017
+ "$ref": "#/$defs/pollers"
1018
+ },
1019
+ {
1020
+ "$ref": "#/$defs/taskResult"
1021
+ },
1022
+ {
1023
+ "$ref": "#/$defs/taskFailed"
1024
+ },
1025
+ {
1026
+ "$ref": "#/$defs/heartbeat"
1027
+ },
1028
+ {
1029
+ "$ref": "#/$defs/workerHeartbeat"
1030
+ },
1031
+ {
1032
+ "$ref": "#/$defs/req"
1033
+ },
1034
+ {
1035
+ "$ref": "#/$defs/bye"
1036
+ }
1037
+ ]
1038
+ },
1039
+ "serviceFrame": {
1040
+ "oneOf": [
1041
+ {
1042
+ "$ref": "#/$defs/welcome"
1043
+ },
1044
+ {
1045
+ "$ref": "#/$defs/task"
1046
+ },
1047
+ {
1048
+ "$ref": "#/$defs/heartbeatAck"
1049
+ },
1050
+ {
1051
+ "$ref": "#/$defs/cancel"
1052
+ },
1053
+ {
1054
+ "$ref": "#/$defs/res"
1055
+ },
1056
+ {
1057
+ "$ref": "#/$defs/pong"
1058
+ }
1059
+ ]
1060
+ }
1061
+ }
1062
+ }