@lostgradient/weft 0.17.0 → 0.19.0

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 (172) hide show
  1. package/README.md +3 -1
  2. package/dist/cli/conformance.js +14 -18
  3. package/dist/cli/generated/operation-catalog.snapshot.json +331 -16
  4. package/dist/cli/generated/operation-client.generated.d.ts +39 -6
  5. package/dist/cli/generated/operation-client.generated.js +6 -0
  6. package/dist/core/context/child-workflow-pipe.d.ts +1 -1
  7. package/dist/core/context/child-workflow-pipe.js +1 -1
  8. package/dist/core/engine/construction.d.ts +2 -0
  9. package/dist/core/engine/construction.js +3 -0
  10. package/dist/core/engine/index.js +1 -0
  11. package/dist/core/engine/listing.d.ts +1 -0
  12. package/dist/core/engine/listing.js +6 -4
  13. package/dist/core/weft-error.d.ts +1 -1
  14. package/dist/core/weft-error.js +2 -1
  15. package/dist/core/worker-execution-dispatcher.d.ts +8 -0
  16. package/dist/core/worker-execution-dispatcher.js +4 -0
  17. package/dist/core/worker-execution-strategy-options.d.ts +16 -0
  18. package/dist/core/worker-execution-strategy.js +71 -89
  19. package/dist/core/worker-fault-handling.d.ts +45 -0
  20. package/dist/core/worker-fault-handling.js +88 -0
  21. package/dist/core/worker-protocol.d.ts +18 -1
  22. package/dist/core/worker-protocol.js +1 -1
  23. package/dist/core/worker-realm-readiness.d.ts +78 -0
  24. package/dist/core/worker-realm-readiness.js +127 -0
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.js +28 -1
  27. package/dist/json-schema.js +1 -1
  28. package/dist/runtime/portable.d.ts +14 -0
  29. package/dist/runtime/portable.js +10 -0
  30. package/dist/server/authorization-scope.d.ts +32 -2
  31. package/dist/server/index.d.ts +73 -8
  32. package/dist/server/index.js +11 -3
  33. package/dist/server/operations/get-principal.d.ts +75 -0
  34. package/dist/server/operations/get-principal.js +41 -0
  35. package/dist/server/operations/get-task-diagnostics.d.ts +43 -18
  36. package/dist/server/operations/get-task-diagnostics.js +87 -126
  37. package/dist/server/operations/get-worker-diagnostics.d.ts +177 -0
  38. package/dist/server/operations/get-worker-diagnostics.js +117 -0
  39. package/dist/server/operations/list-worker-registration-rejections.d.ts +79 -0
  40. package/dist/server/operations/list-worker-registration-rejections.js +60 -0
  41. package/dist/server/operations/list-workers.js +1 -3
  42. package/dist/server/operations/static-registrations.d.ts +28 -0
  43. package/dist/server/operations/static-registrations.js +248 -0
  44. package/dist/server/rest-bindings.d.ts +5 -0
  45. package/dist/server/rest-bindings.js +34 -313
  46. package/dist/server/runtime/authentication-bridge.js +6 -14
  47. package/dist/server/runtime/context.d.ts +23 -0
  48. package/dist/server/runtime/task-dispatch.d.ts +7 -1
  49. package/dist/server/runtime/task-dispatch.js +126 -55
  50. package/dist/server/runtime/task-ledger-completion.d.ts +68 -0
  51. package/dist/server/runtime/task-ledger-completion.js +72 -0
  52. package/dist/server/runtime/task-ledger-recovery.d.ts +55 -0
  53. package/dist/server/runtime/task-ledger-recovery.js +73 -0
  54. package/dist/server/runtime/task-ledger-runtime.d.ts +64 -0
  55. package/dist/server/runtime/task-ledger-runtime.js +34 -0
  56. package/dist/server/runtime/task-metrics.d.ts +6 -4
  57. package/dist/server/runtime/task-polling.d.ts +14 -12
  58. package/dist/server/runtime/task-polling.js +106 -82
  59. package/dist/server/runtime/task-reconciliation.d.ts +35 -8
  60. package/dist/server/runtime/task-reconciliation.js +75 -74
  61. package/dist/server/runtime/task-result-resolution.d.ts +2 -10
  62. package/dist/server/runtime/task-result-resolution.js +0 -67
  63. package/dist/server/runtime/task-result-view.d.ts +82 -0
  64. package/dist/server/runtime/task-result-view.js +48 -0
  65. package/dist/server/runtime/websocket-worker-messaging.d.ts +16 -0
  66. package/dist/server/runtime/websocket-worker-messaging.js +32 -0
  67. package/dist/server/runtime/websocket-worker-registration.d.ts +41 -0
  68. package/dist/server/runtime/websocket-worker-registration.js +134 -0
  69. package/dist/server/runtime/websocket-worker.d.ts +0 -1
  70. package/dist/server/runtime/websocket-worker.js +64 -116
  71. package/dist/server/serve-internals.d.ts +9 -6
  72. package/dist/server/serve-internals.js +14 -40
  73. package/dist/server/task-ledger-codec.d.ts +40 -0
  74. package/dist/server/task-ledger-codec.js +195 -0
  75. package/dist/server/task-ledger-keys.d.ts +13 -0
  76. package/dist/server/task-ledger-keys.js +5 -0
  77. package/dist/server/task-ledger-limits.d.ts +34 -0
  78. package/dist/server/task-ledger-limits.js +5 -0
  79. package/dist/server/task-ledger-transition-helpers.d.ts +38 -0
  80. package/dist/server/task-ledger-transition-helpers.js +42 -0
  81. package/dist/server/task-ledger-transitions-cancellation.d.ts +31 -0
  82. package/dist/server/task-ledger-transitions-cancellation.js +73 -0
  83. package/dist/server/task-ledger-transitions.d.ts +129 -0
  84. package/dist/server/task-ledger-transitions.js +162 -0
  85. package/dist/server/task-ledger-types.d.ts +220 -0
  86. package/dist/server/task-ledger-types.js +1 -0
  87. package/dist/server/task-ledger.d.ts +17 -0
  88. package/dist/server/task-ledger.js +24 -0
  89. package/dist/server/task-state.d.ts +25 -152
  90. package/dist/server/task-state.js +0 -188
  91. package/dist/server/worker-admission-policy.d.ts +70 -0
  92. package/dist/server/worker-admission-policy.js +0 -0
  93. package/dist/storage/compressed-storage.js +1 -1
  94. package/dist/storage/index.d.ts +0 -2
  95. package/dist/storage/interface.d.ts +0 -2
  96. package/dist/storage/interface.js +1 -1
  97. package/dist/storage/lmdb.js +1 -1
  98. package/dist/storage/memory.js +1 -1
  99. package/dist/storage/neon.js +1 -1
  100. package/dist/storage/postgres.js +1 -1
  101. package/dist/storage/resolve.js +1 -1
  102. package/dist/storage/scoped-storage.js +1 -1
  103. package/dist/storage/testing.js +1 -1
  104. package/dist/storage/turso.js +1 -1
  105. package/dist/storage/web-extension.js +2 -2
  106. package/dist/version.d.ts +1 -1
  107. package/dist/version.js +1 -1
  108. package/dist/web-extension.js +1 -1
  109. package/dist/worker/index.d.ts +2 -0
  110. package/dist/worker/index.js +30 -4
  111. package/dist/worker/manifest/canonical-json.d.ts +20 -0
  112. package/dist/worker/manifest/canonical-json.js +13 -0
  113. package/dist/worker/manifest/capabilities.d.ts +24 -0
  114. package/dist/worker/manifest/capabilities.js +74 -0
  115. package/dist/worker/manifest/content-digest.d.ts +20 -0
  116. package/dist/worker/manifest/content-digest.js +13 -0
  117. package/dist/worker/manifest/declared-shape-digest.d.ts +14 -0
  118. package/dist/worker/manifest/declared-shape-digest.js +4 -0
  119. package/dist/worker/manifest/digest.d.ts +82 -0
  120. package/dist/worker/manifest/digest.js +9 -0
  121. package/dist/worker/manifest/execution-identity.d.ts +92 -0
  122. package/dist/worker/manifest/execution-identity.js +36 -0
  123. package/dist/worker/manifest/failure.d.ts +59 -0
  124. package/dist/worker/manifest/failure.js +4 -0
  125. package/dist/worker/manifest/index.d.ts +22 -0
  126. package/dist/worker/manifest/index.js +23 -0
  127. package/dist/worker/manifest/internal-realm.d.ts +50 -0
  128. package/dist/worker/manifest/internal-realm.js +39 -0
  129. package/dist/worker/manifest/is-record.d.ts +12 -0
  130. package/dist/worker/manifest/is-record.js +6 -0
  131. package/dist/worker/manifest/json-scan.d.ts +26 -0
  132. package/dist/worker/manifest/json-scan.js +88 -0
  133. package/dist/worker/manifest/limits.d.ts +138 -0
  134. package/dist/worker/manifest/limits.js +1 -0
  135. package/dist/worker/manifest/normalize.d.ts +63 -0
  136. package/dist/worker/manifest/normalize.js +73 -0
  137. package/dist/worker/manifest/parse-json.d.ts +24 -0
  138. package/dist/worker/manifest/parse-json.js +15 -0
  139. package/dist/worker/manifest/parse.d.ts +86 -0
  140. package/dist/worker/manifest/parse.js +188 -0
  141. package/dist/worker/manifest/registry-contract-builder.d.ts +120 -0
  142. package/dist/worker/manifest/registry-contract-builder.js +65 -0
  143. package/dist/worker/manifest/types.d.ts +263 -0
  144. package/dist/worker/manifest/types.js +1 -0
  145. package/dist/worker/manifest/utf8.d.ts +13 -0
  146. package/dist/worker/manifest/utf8.js +7 -0
  147. package/dist/worker/options.d.ts +55 -8
  148. package/dist/worker/options.js +65 -9
  149. package/dist/worker/protocol-internals.d.ts +1 -2
  150. package/dist/worker/protocol-internals.js +0 -5
  151. package/dist/worker/protocol-messages.d.ts +33 -17
  152. package/dist/worker/protocol-schemas.d.ts +36 -74
  153. package/dist/worker/protocol-schemas.js +25 -18
  154. package/dist/worker/protocol-version.d.ts +18 -14
  155. package/dist/worker/protocol-version.js +1 -1
  156. package/dist/worker/protocol.js +1 -1
  157. package/dist/worker/registry/deployment-consistency.d.ts +78 -0
  158. package/dist/worker/registry/deployment-consistency.js +27 -0
  159. package/dist/worker/registry/drain.d.ts +14 -0
  160. package/dist/worker/registry/drain.js +24 -0
  161. package/dist/worker/registry/rejections.d.ts +31 -0
  162. package/dist/worker/registry/rejections.js +10 -0
  163. package/dist/worker/registry/summary.d.ts +0 -3
  164. package/dist/worker/registry/summary.js +2 -5
  165. package/dist/worker/registry/types.d.ts +10 -3
  166. package/dist/worker/registry.d.ts +47 -2
  167. package/dist/worker/registry.js +45 -32
  168. package/dist/workers/workflow-worker-entry.d.ts +12 -7
  169. package/dist/workers/workflow-worker-entry.js +9 -2
  170. package/package.json +3 -3
  171. package/dist/server/task-resolved-record.d.ts +0 -12
  172. package/dist/server/task-resolved-record.js +0 -35
@@ -0,0 +1,248 @@
1
+ import { addWorkflowTagsOperation, addWorkflowTagsRestBinding } from "./add-workflow-tags.js";
2
+ import {
3
+ aggregateWorkflowsOperation,
4
+ aggregateWorkflowsRestBinding
5
+ } from "./aggregate-workflows.js";
6
+ import * as asyncActivity from "./async-activity.js";
7
+ import {
8
+ bulkCancelWorkflowsOperation,
9
+ bulkCancelWorkflowsRestBinding
10
+ } from "./bulk-cancel-workflows.js";
11
+ import {
12
+ bulkDeleteWorkflowsOperation,
13
+ bulkDeleteWorkflowsRestBinding
14
+ } from "./bulk-delete-workflows.js";
15
+ import {
16
+ bulkMutateWorkflowTagsOperation,
17
+ bulkMutateWorkflowTagsRestBinding
18
+ } from "./bulk-mutate-workflow-tags.js";
19
+ import {
20
+ bulkRetryFailedWorkflowsOperation,
21
+ bulkRetryFailedWorkflowsRestBinding
22
+ } from "./bulk-retry-failed-workflows.js";
23
+ import {
24
+ bulkSignalWorkflowsOperation,
25
+ bulkSignalWorkflowsRestBinding
26
+ } from "./bulk-signal-workflows.js";
27
+ import { cancelScheduleOperation, cancelScheduleRestBinding } from "./cancel-schedule.js";
28
+ import { cancelWorkflowOperation, cancelWorkflowRestBinding } from "./cancel-workflow.js";
29
+ import { createScheduleOperation, createScheduleRestBinding } from "./create-schedule.js";
30
+ import { fleetEventsSseOperation, fleetEventsSseRestBinding } from "./fleet-events-sse.js";
31
+ import { fleetEventsSubscriptionOperation } from "./fleet-events-subscription.js";
32
+ import { forkWorkflowOperation, forkWorkflowRestBinding } from "./fork-workflow.js";
33
+ import { getCheckpointAtOperation, getCheckpointAtRestBinding } from "./get-checkpoint-at.js";
34
+ import { getPrincipalOperation, getPrincipalRestBinding } from "./get-principal.js";
35
+ import { getRegistryOperation, getRegistryRestBinding } from "./get-registry.js";
36
+ import {
37
+ getRetentionOverviewOperation,
38
+ getRetentionOverviewRestBinding
39
+ } from "./get-retention-overview.js";
40
+ import { getReviewOperation, getReviewRestBinding } from "./get-review.js";
41
+ import { getScheduleOperation, getScheduleRestBinding } from "./get-schedule.js";
42
+ import { getStreamChunksOperation, getStreamChunksRestBinding } from "./get-stream-chunks.js";
43
+ import { getSystemLeaseOperation, getSystemLeaseRestBinding } from "./get-system-lease.js";
44
+ import {
45
+ clearTaskDeadLetterOperation,
46
+ clearTaskDeadLetterRestBinding,
47
+ getTaskDiagnosticsRestBinding
48
+ } from "./get-task-diagnostics.js";
49
+ import { getUpdateResultOperation, getUpdateResultRestBinding } from "./get-update-result.js";
50
+ import {
51
+ getWorkflowAttributesOperation,
52
+ getWorkflowAttributesRestBinding
53
+ } from "./get-workflow-attributes.js";
54
+ import { getWorkflowEventsOperation, getWorkflowEventsRestBinding } from "./get-workflow-events.js";
55
+ import * as workflowObservability from "./get-workflow-observability.js";
56
+ import { getWorkflowResultOperation, getWorkflowResultRestBinding } from "./get-workflow-result.js";
57
+ import {
58
+ getWorkflowTimelineOperation,
59
+ getWorkflowTimelineRestBinding
60
+ } from "./get-workflow-timeline.js";
61
+ import { getWorkflowOperation, getWorkflowRestBinding } from "./get-workflow.js";
62
+ import { listAlertsOperation, listAlertsRestBinding } from "./list-alerts.js";
63
+ import { listCheckpointsOperation, listCheckpointsRestBinding } from "./list-checkpoints.js";
64
+ import { listReviewsOperation, listReviewsRestBinding } from "./list-reviews.js";
65
+ import { listSchedulesOperation, listSchedulesRestBinding } from "./list-schedules.js";
66
+ import { listWorkflowsOperation, listWorkflowsRestBinding } from "./list-workflows.js";
67
+ import { pauseScheduleOperation, pauseScheduleRestBinding } from "./pause-schedule.js";
68
+ import { purgeWorkflowsOperation, purgeWorkflowsRestBinding } from "./purge-workflows.js";
69
+ import {
70
+ queryWorkflowOperation,
71
+ queryWorkflowRestBinding,
72
+ queryWorkflowWithInputRestBinding
73
+ } from "./query-workflow.js";
74
+ import { recoverAllOperation, recoverAllRestBinding } from "./recover-all.js";
75
+ import {
76
+ removeWorkflowTagsOperation,
77
+ removeWorkflowTagsRestBinding
78
+ } from "./remove-workflow-tags.js";
79
+ import { replayWorkflowOperation, replayWorkflowRestBinding } from "./replay-workflow.js";
80
+ import { resumeScheduleOperation, resumeScheduleRestBinding } from "./resume-schedule.js";
81
+ import { resumeWorkflowOperation, resumeWorkflowRestBinding } from "./resume-workflow.js";
82
+ import {
83
+ setWorkflowAttributesOperation,
84
+ setWorkflowAttributesRestBinding
85
+ } from "./set-workflow-attributes.js";
86
+ import { signalWorkflowOperation, signalWorkflowRestBinding } from "./signal-workflow.js";
87
+ import {
88
+ startOrSignalWorkflowOperation,
89
+ startOrSignalWorkflowRestBinding
90
+ } from "./start-or-signal-workflow.js";
91
+ import { startWorkflowOperation, startWorkflowRestBinding } from "./start-workflow.js";
92
+ import * as storageCapabilities from "./storage-capabilities.js";
93
+ import {
94
+ storageBatchOperation,
95
+ storageBatchRestBinding,
96
+ storageConditionalBatchOperation,
97
+ storageConditionalBatchRestBinding,
98
+ storageDeleteOperation,
99
+ storageDeleteRestBinding,
100
+ storageGetOperation,
101
+ storageGetRestBinding,
102
+ storagePutOperation,
103
+ storagePutRestBinding,
104
+ storageScanOperation,
105
+ storageScanRestBinding
106
+ } from "./storage.js";
107
+ import { streamWorkflowSseOperation, streamWorkflowSseRestBinding } from "./stream-workflow-sse.js";
108
+ import {
109
+ submitReviewDecisionOperation,
110
+ submitReviewDecisionRestBinding
111
+ } from "./submit-review-decision.js";
112
+ import { suspendWorkflowOperation, suspendWorkflowRestBinding } from "./suspend-workflow.js";
113
+ import { timeoutWorkflowOperation, timeoutWorkflowRestBinding } from "./timeout-workflow.js";
114
+ import { updateScheduleOperation, updateScheduleRestBinding } from "./update-schedule.js";
115
+ import { updateWorkflowOperation, updateWorkflowRestBinding } from "./update-workflow.js";
116
+ import { workflowEventsSseOperation, workflowEventsSseRestBinding } from "./workflow-events-sse.js";
117
+ import { workflowEventsSubscriptionOperation } from "./workflow-events-subscription.js";
118
+ export const STATIC_REST_BINDINGS = [
119
+ listAlertsRestBinding,
120
+ getPrincipalRestBinding,
121
+ startWorkflowRestBinding,
122
+ startOrSignalWorkflowRestBinding,
123
+ recoverAllRestBinding,
124
+ listWorkflowsRestBinding,
125
+ aggregateWorkflowsRestBinding,
126
+ purgeWorkflowsRestBinding,
127
+ bulkCancelWorkflowsRestBinding,
128
+ bulkSignalWorkflowsRestBinding,
129
+ bulkRetryFailedWorkflowsRestBinding,
130
+ bulkDeleteWorkflowsRestBinding,
131
+ bulkMutateWorkflowTagsRestBinding,
132
+ getWorkflowRestBinding,
133
+ cancelWorkflowRestBinding,
134
+ getWorkflowResultRestBinding,
135
+ getWorkflowAttributesRestBinding,
136
+ ...workflowObservability.workflowObservabilityRestBindings,
137
+ getWorkflowEventsRestBinding,
138
+ setWorkflowAttributesRestBinding,
139
+ signalWorkflowRestBinding,
140
+ asyncActivity.listPendingAsyncActivitiesRestBinding,
141
+ asyncActivity.completeAsyncActivityRestBinding,
142
+ asyncActivity.failAsyncActivityRestBinding,
143
+ queryWorkflowRestBinding,
144
+ queryWorkflowWithInputRestBinding,
145
+ resumeWorkflowRestBinding,
146
+ suspendWorkflowRestBinding,
147
+ forkWorkflowRestBinding,
148
+ timeoutWorkflowRestBinding,
149
+ updateWorkflowRestBinding,
150
+ createScheduleRestBinding,
151
+ updateScheduleRestBinding,
152
+ getRegistryRestBinding,
153
+ getSystemLeaseRestBinding,
154
+ getRetentionOverviewRestBinding,
155
+ getUpdateResultRestBinding,
156
+ listReviewsRestBinding,
157
+ getReviewRestBinding,
158
+ listCheckpointsRestBinding,
159
+ getCheckpointAtRestBinding,
160
+ getWorkflowTimelineRestBinding,
161
+ addWorkflowTagsRestBinding,
162
+ removeWorkflowTagsRestBinding,
163
+ submitReviewDecisionRestBinding,
164
+ cancelScheduleRestBinding,
165
+ pauseScheduleRestBinding,
166
+ resumeScheduleRestBinding,
167
+ getStreamChunksRestBinding,
168
+ streamWorkflowSseRestBinding,
169
+ workflowEventsSseRestBinding,
170
+ fleetEventsSseRestBinding,
171
+ getTaskDiagnosticsRestBinding,
172
+ clearTaskDeadLetterRestBinding,
173
+ listSchedulesRestBinding,
174
+ getScheduleRestBinding,
175
+ replayWorkflowRestBinding,
176
+ storageCapabilities.storageCapabilitiesRestBinding,
177
+ storageGetRestBinding,
178
+ storagePutRestBinding,
179
+ storageDeleteRestBinding,
180
+ storageScanRestBinding,
181
+ storageBatchRestBinding,
182
+ storageConditionalBatchRestBinding
183
+ ], STATIC_OPERATIONS = [
184
+ startWorkflowOperation,
185
+ startOrSignalWorkflowOperation,
186
+ recoverAllOperation,
187
+ listWorkflowsOperation,
188
+ aggregateWorkflowsOperation,
189
+ purgeWorkflowsOperation,
190
+ bulkCancelWorkflowsOperation,
191
+ bulkSignalWorkflowsOperation,
192
+ bulkRetryFailedWorkflowsOperation,
193
+ bulkDeleteWorkflowsOperation,
194
+ bulkMutateWorkflowTagsOperation,
195
+ getWorkflowOperation,
196
+ cancelWorkflowOperation,
197
+ getWorkflowResultOperation,
198
+ getWorkflowAttributesOperation,
199
+ ...workflowObservability.workflowObservabilityOperations,
200
+ getWorkflowEventsOperation,
201
+ setWorkflowAttributesOperation,
202
+ signalWorkflowOperation,
203
+ asyncActivity.listPendingAsyncActivitiesOperation,
204
+ asyncActivity.completeAsyncActivityOperation,
205
+ asyncActivity.failAsyncActivityOperation,
206
+ queryWorkflowOperation,
207
+ resumeWorkflowOperation,
208
+ suspendWorkflowOperation,
209
+ forkWorkflowOperation,
210
+ timeoutWorkflowOperation,
211
+ updateWorkflowOperation,
212
+ createScheduleOperation,
213
+ updateScheduleOperation,
214
+ getRegistryOperation,
215
+ getSystemLeaseOperation,
216
+ getRetentionOverviewOperation,
217
+ getUpdateResultOperation,
218
+ listReviewsOperation,
219
+ getReviewOperation,
220
+ listCheckpointsOperation,
221
+ getCheckpointAtOperation,
222
+ getWorkflowTimelineOperation,
223
+ addWorkflowTagsOperation,
224
+ removeWorkflowTagsOperation,
225
+ submitReviewDecisionOperation,
226
+ cancelScheduleOperation,
227
+ pauseScheduleOperation,
228
+ resumeScheduleOperation,
229
+ getStreamChunksOperation,
230
+ streamWorkflowSseOperation,
231
+ workflowEventsSseOperation,
232
+ fleetEventsSseOperation,
233
+ workflowEventsSubscriptionOperation,
234
+ fleetEventsSubscriptionOperation,
235
+ clearTaskDeadLetterOperation,
236
+ listSchedulesOperation,
237
+ listAlertsOperation,
238
+ getPrincipalOperation,
239
+ getScheduleOperation,
240
+ replayWorkflowOperation,
241
+ storageCapabilities.storageCapabilitiesOperation,
242
+ storageGetOperation,
243
+ storagePutOperation,
244
+ storageDeleteOperation,
245
+ storageScanOperation,
246
+ storageBatchOperation,
247
+ storageConditionalBatchOperation
248
+ ];
@@ -6,6 +6,11 @@
6
6
  * direct meta and discovery routes first; remaining requests then match
7
7
  * these operation-backed bindings.
8
8
  *
9
+ * Statically-configured operations and bindings live in
10
+ * `operations/static-registrations.ts`; this module owns the heterogeneous
11
+ * binding type, the per-server factory wiring (metrics, workers, task
12
+ * queues, diagnostics), and the composed live registry/binding builders.
13
+ *
9
14
  * @module server/rest-bindings
10
15
  */
11
16
  import type { MetricsCollector } from '../observability/metrics.ts';
@@ -1,200 +1,33 @@
1
1
  import { createOperationRegistry } from "./operation-catalog.js";
2
- import {
3
- addWorkflowTagsOperation,
4
- addWorkflowTagsRestBinding
5
- } from "./operations/add-workflow-tags.js";
6
- import {
7
- aggregateWorkflowsOperation,
8
- aggregateWorkflowsRestBinding
9
- } from "./operations/aggregate-workflows.js";
10
- import * as asyncActivity from "./operations/async-activity.js";
11
- import {
12
- bulkCancelWorkflowsOperation,
13
- bulkCancelWorkflowsRestBinding
14
- } from "./operations/bulk-cancel-workflows.js";
15
- import {
16
- bulkDeleteWorkflowsOperation,
17
- bulkDeleteWorkflowsRestBinding
18
- } from "./operations/bulk-delete-workflows.js";
19
- import {
20
- bulkMutateWorkflowTagsOperation,
21
- bulkMutateWorkflowTagsRestBinding
22
- } from "./operations/bulk-mutate-workflow-tags.js";
23
- import {
24
- bulkRetryFailedWorkflowsOperation,
25
- bulkRetryFailedWorkflowsRestBinding
26
- } from "./operations/bulk-retry-failed-workflows.js";
27
- import {
28
- bulkSignalWorkflowsOperation,
29
- bulkSignalWorkflowsRestBinding
30
- } from "./operations/bulk-signal-workflows.js";
31
- import {
32
- cancelScheduleOperation,
33
- cancelScheduleRestBinding
34
- } from "./operations/cancel-schedule.js";
35
- import {
36
- cancelWorkflowOperation,
37
- cancelWorkflowRestBinding
38
- } from "./operations/cancel-workflow.js";
39
- import {
40
- createScheduleOperation,
41
- createScheduleRestBinding
42
- } from "./operations/create-schedule.js";
43
- import {
44
- fleetEventsSseOperation,
45
- fleetEventsSseRestBinding
46
- } from "./operations/fleet-events-sse.js";
47
- import { fleetEventsSubscriptionOperation } from "./operations/fleet-events-subscription.js";
48
- import { forkWorkflowOperation, forkWorkflowRestBinding } from "./operations/fork-workflow.js";
49
- import {
50
- getCheckpointAtOperation,
51
- getCheckpointAtRestBinding
52
- } from "./operations/get-checkpoint-at.js";
53
- import { getRegistryOperation, getRegistryRestBinding } from "./operations/get-registry.js";
54
- import {
55
- getRetentionOverviewOperation,
56
- getRetentionOverviewRestBinding
57
- } from "./operations/get-retention-overview.js";
58
- import { getReviewOperation, getReviewRestBinding } from "./operations/get-review.js";
59
- import { getScheduleOperation, getScheduleRestBinding } from "./operations/get-schedule.js";
60
- import {
61
- getStreamChunksOperation,
62
- getStreamChunksRestBinding
63
- } from "./operations/get-stream-chunks.js";
64
- import {
65
- getSystemLeaseOperation,
66
- getSystemLeaseRestBinding
67
- } from "./operations/get-system-lease.js";
68
2
  import {
69
3
  createGetSystemMetricsOperation,
70
4
  createGetSystemMetricsRestBinding
71
5
  } from "./operations/get-system-metrics.js";
72
6
  import {
73
- clearTaskDeadLetterOperation,
74
- clearTaskDeadLetterRestBinding,
75
7
  createGetTaskDiagnosticsOperation,
76
- getTaskDiagnosticsOperation,
77
- getTaskDiagnosticsRestBinding
8
+ getTaskDiagnosticsOperation
78
9
  } from "./operations/get-task-diagnostics.js";
79
10
  import {
80
- getUpdateResultOperation,
81
- getUpdateResultRestBinding
82
- } from "./operations/get-update-result.js";
83
- import {
84
- getWorkflowAttributesOperation,
85
- getWorkflowAttributesRestBinding
86
- } from "./operations/get-workflow-attributes.js";
87
- import {
88
- getWorkflowEventsOperation,
89
- getWorkflowEventsRestBinding
90
- } from "./operations/get-workflow-events.js";
91
- import * as workflowObservability from "./operations/get-workflow-observability.js";
92
- import {
93
- getWorkflowResultOperation,
94
- getWorkflowResultRestBinding
95
- } from "./operations/get-workflow-result.js";
96
- import {
97
- getWorkflowTimelineOperation,
98
- getWorkflowTimelineRestBinding
99
- } from "./operations/get-workflow-timeline.js";
100
- import { getWorkflowOperation, getWorkflowRestBinding } from "./operations/get-workflow.js";
101
- import { listAlertsOperation, listAlertsRestBinding } from "./operations/list-alerts.js";
102
- import {
103
- listCheckpointsOperation,
104
- listCheckpointsRestBinding
105
- } from "./operations/list-checkpoints.js";
106
- import { listReviewsOperation, listReviewsRestBinding } from "./operations/list-reviews.js";
107
- import { listSchedulesOperation, listSchedulesRestBinding } from "./operations/list-schedules.js";
11
+ createGetWorkerDiagnosticsOperation,
12
+ createGetWorkerDiagnosticsRestBinding,
13
+ getWorkerDiagnosticsOperation
14
+ } from "./operations/get-worker-diagnostics.js";
108
15
  import {
109
16
  createListTaskQueuesOperation,
110
17
  createListTaskQueuesRestBinding,
111
18
  listTaskQueuesOperation
112
19
  } from "./operations/list-task-queues.js";
20
+ import {
21
+ createListWorkerRegistrationRejectionsOperation,
22
+ createListWorkerRegistrationRejectionsRestBinding,
23
+ listWorkerRegistrationRejectionsOperation
24
+ } from "./operations/list-worker-registration-rejections.js";
113
25
  import {
114
26
  createListWorkersOperation,
115
27
  createListWorkersRestBinding,
116
28
  listWorkersOperation
117
29
  } from "./operations/list-workers.js";
118
- import { listWorkflowsOperation, listWorkflowsRestBinding } from "./operations/list-workflows.js";
119
- import { pauseScheduleOperation, pauseScheduleRestBinding } from "./operations/pause-schedule.js";
120
- import {
121
- purgeWorkflowsOperation,
122
- purgeWorkflowsRestBinding
123
- } from "./operations/purge-workflows.js";
124
- import {
125
- queryWorkflowOperation,
126
- queryWorkflowRestBinding,
127
- queryWorkflowWithInputRestBinding
128
- } from "./operations/query-workflow.js";
129
- import { recoverAllOperation, recoverAllRestBinding } from "./operations/recover-all.js";
130
- import {
131
- removeWorkflowTagsOperation,
132
- removeWorkflowTagsRestBinding
133
- } from "./operations/remove-workflow-tags.js";
134
- import {
135
- replayWorkflowOperation,
136
- replayWorkflowRestBinding
137
- } from "./operations/replay-workflow.js";
138
- import {
139
- resumeScheduleOperation,
140
- resumeScheduleRestBinding
141
- } from "./operations/resume-schedule.js";
142
- import {
143
- resumeWorkflowOperation,
144
- resumeWorkflowRestBinding
145
- } from "./operations/resume-workflow.js";
146
- import {
147
- setWorkflowAttributesOperation,
148
- setWorkflowAttributesRestBinding
149
- } from "./operations/set-workflow-attributes.js";
150
- import {
151
- signalWorkflowOperation,
152
- signalWorkflowRestBinding
153
- } from "./operations/signal-workflow.js";
154
- import {
155
- startOrSignalWorkflowOperation,
156
- startOrSignalWorkflowRestBinding
157
- } from "./operations/start-or-signal-workflow.js";
158
- import { startWorkflowOperation, startWorkflowRestBinding } from "./operations/start-workflow.js";
159
- import * as storageCapabilities from "./operations/storage-capabilities.js";
160
- import {
161
- storageBatchOperation,
162
- storageBatchRestBinding,
163
- storageConditionalBatchOperation,
164
- storageConditionalBatchRestBinding,
165
- storageDeleteOperation,
166
- storageDeleteRestBinding,
167
- storageGetOperation,
168
- storageGetRestBinding,
169
- storagePutOperation,
170
- storagePutRestBinding,
171
- storageScanOperation,
172
- storageScanRestBinding
173
- } from "./operations/storage.js";
174
- import {
175
- streamWorkflowSseOperation,
176
- streamWorkflowSseRestBinding
177
- } from "./operations/stream-workflow-sse.js";
178
- import {
179
- submitReviewDecisionOperation,
180
- submitReviewDecisionRestBinding
181
- } from "./operations/submit-review-decision.js";
182
- import {
183
- suspendWorkflowOperation,
184
- suspendWorkflowRestBinding
185
- } from "./operations/suspend-workflow.js";
186
- import {
187
- timeoutWorkflowOperation,
188
- timeoutWorkflowRestBinding
189
- } from "./operations/timeout-workflow.js";
190
- import {
191
- updateScheduleOperation,
192
- updateScheduleRestBinding
193
- } from "./operations/update-schedule.js";
194
- import {
195
- updateWorkflowOperation,
196
- updateWorkflowRestBinding
197
- } from "./operations/update-workflow.js";
30
+ import { STATIC_OPERATIONS, STATIC_REST_BINDINGS } from "./operations/static-registrations.js";
198
31
  import {
199
32
  clearDeploymentDrainOperation,
200
33
  clearWorkerDrainOperation,
@@ -209,76 +42,7 @@ import {
209
42
  drainDeploymentOperation,
210
43
  drainWorkerOperation
211
44
  } from "./operations/worker-drain.js";
212
- import {
213
- workflowEventsSseOperation,
214
- workflowEventsSseRestBinding
215
- } from "./operations/workflow-events-sse.js";
216
- import { workflowEventsSubscriptionOperation } from "./operations/workflow-events-subscription.js";
217
- export const REST_BINDINGS = [
218
- listAlertsRestBinding,
219
- startWorkflowRestBinding,
220
- startOrSignalWorkflowRestBinding,
221
- recoverAllRestBinding,
222
- listWorkflowsRestBinding,
223
- aggregateWorkflowsRestBinding,
224
- purgeWorkflowsRestBinding,
225
- bulkCancelWorkflowsRestBinding,
226
- bulkSignalWorkflowsRestBinding,
227
- bulkRetryFailedWorkflowsRestBinding,
228
- bulkDeleteWorkflowsRestBinding,
229
- bulkMutateWorkflowTagsRestBinding,
230
- getWorkflowRestBinding,
231
- cancelWorkflowRestBinding,
232
- getWorkflowResultRestBinding,
233
- getWorkflowAttributesRestBinding,
234
- ...workflowObservability.workflowObservabilityRestBindings,
235
- getWorkflowEventsRestBinding,
236
- setWorkflowAttributesRestBinding,
237
- signalWorkflowRestBinding,
238
- asyncActivity.listPendingAsyncActivitiesRestBinding,
239
- asyncActivity.completeAsyncActivityRestBinding,
240
- asyncActivity.failAsyncActivityRestBinding,
241
- queryWorkflowRestBinding,
242
- queryWorkflowWithInputRestBinding,
243
- resumeWorkflowRestBinding,
244
- suspendWorkflowRestBinding,
245
- forkWorkflowRestBinding,
246
- timeoutWorkflowRestBinding,
247
- updateWorkflowRestBinding,
248
- createScheduleRestBinding,
249
- updateScheduleRestBinding,
250
- getRegistryRestBinding,
251
- getSystemLeaseRestBinding,
252
- getRetentionOverviewRestBinding,
253
- getUpdateResultRestBinding,
254
- listReviewsRestBinding,
255
- getReviewRestBinding,
256
- listCheckpointsRestBinding,
257
- getCheckpointAtRestBinding,
258
- getWorkflowTimelineRestBinding,
259
- addWorkflowTagsRestBinding,
260
- removeWorkflowTagsRestBinding,
261
- submitReviewDecisionRestBinding,
262
- cancelScheduleRestBinding,
263
- pauseScheduleRestBinding,
264
- resumeScheduleRestBinding,
265
- getStreamChunksRestBinding,
266
- streamWorkflowSseRestBinding,
267
- workflowEventsSseRestBinding,
268
- fleetEventsSseRestBinding,
269
- getTaskDiagnosticsRestBinding,
270
- clearTaskDeadLetterRestBinding,
271
- listSchedulesRestBinding,
272
- getScheduleRestBinding,
273
- replayWorkflowRestBinding,
274
- storageCapabilities.storageCapabilitiesRestBinding,
275
- storageGetRestBinding,
276
- storagePutRestBinding,
277
- storageDeleteRestBinding,
278
- storageScanRestBinding,
279
- storageBatchRestBinding,
280
- storageConditionalBatchRestBinding
281
- ];
45
+ export const REST_BINDINGS = STATIC_REST_BINDINGS;
282
46
  export function createLiveRestBindings() {
283
47
  return [
284
48
  ...REST_BINDINGS,
@@ -288,7 +52,9 @@ export function createLiveRestBindings() {
288
52
  createClearWorkerDrainRestBinding(),
289
53
  createDrainDeploymentRestBinding(),
290
54
  createClearDeploymentDrainRestBinding(),
291
- createListTaskQueuesRestBinding()
55
+ createListTaskQueuesRestBinding(),
56
+ createGetWorkerDiagnosticsRestBinding(),
57
+ createListWorkerRegistrationRejectionsRestBinding()
292
58
  ];
293
59
  }
294
60
  function buildSystemMetricsOperation(options) {
@@ -346,79 +112,34 @@ function buildTaskDiagnosticsOperationForRegistry(options) {
346
112
  ...options.clock !== void 0 ? { now: options.clock } : {}
347
113
  });
348
114
  }
115
+ function buildWorkerDiagnosticsOperationForRegistry(options) {
116
+ if (options.workerRegistry === void 0)
117
+ return getWorkerDiagnosticsOperation;
118
+ return createGetWorkerDiagnosticsOperation({
119
+ workerRegistry: options.workerRegistry,
120
+ ...options.clock !== void 0 ? { clock: options.clock } : {}
121
+ });
122
+ }
123
+ function buildWorkerRegistrationRejectionsOperationForRegistry(options) {
124
+ if (options.workerRegistry === void 0)
125
+ return listWorkerRegistrationRejectionsOperation;
126
+ return createListWorkerRegistrationRejectionsOperation({
127
+ workerRegistry: options.workerRegistry
128
+ });
129
+ }
349
130
  export function createLiveOperationRegistry(options) {
350
131
  const resolved = options ?? {};
351
132
  return createOperationRegistry([
352
- startWorkflowOperation,
353
- startOrSignalWorkflowOperation,
354
- recoverAllOperation,
355
- listWorkflowsOperation,
356
- aggregateWorkflowsOperation,
357
- purgeWorkflowsOperation,
358
- bulkCancelWorkflowsOperation,
359
- bulkSignalWorkflowsOperation,
360
- bulkRetryFailedWorkflowsOperation,
361
- bulkDeleteWorkflowsOperation,
362
- bulkMutateWorkflowTagsOperation,
363
- getWorkflowOperation,
364
- cancelWorkflowOperation,
365
- getWorkflowResultOperation,
366
- getWorkflowAttributesOperation,
367
- ...workflowObservability.workflowObservabilityOperations,
368
- getWorkflowEventsOperation,
369
- setWorkflowAttributesOperation,
370
- signalWorkflowOperation,
371
- asyncActivity.listPendingAsyncActivitiesOperation,
372
- asyncActivity.completeAsyncActivityOperation,
373
- asyncActivity.failAsyncActivityOperation,
374
- queryWorkflowOperation,
375
- resumeWorkflowOperation,
376
- suspendWorkflowOperation,
377
- forkWorkflowOperation,
378
- timeoutWorkflowOperation,
379
- updateWorkflowOperation,
380
- createScheduleOperation,
381
- updateScheduleOperation,
382
- getRegistryOperation,
383
- getSystemLeaseOperation,
384
- getRetentionOverviewOperation,
385
- getUpdateResultOperation,
386
- listReviewsOperation,
387
- getReviewOperation,
388
- listCheckpointsOperation,
389
- getCheckpointAtOperation,
390
- getWorkflowTimelineOperation,
391
- addWorkflowTagsOperation,
392
- removeWorkflowTagsOperation,
393
- submitReviewDecisionOperation,
394
- cancelScheduleOperation,
395
- pauseScheduleOperation,
396
- resumeScheduleOperation,
397
- getStreamChunksOperation,
398
- streamWorkflowSseOperation,
399
- workflowEventsSseOperation,
400
- fleetEventsSseOperation,
401
- workflowEventsSubscriptionOperation,
402
- fleetEventsSubscriptionOperation,
133
+ ...STATIC_OPERATIONS,
403
134
  buildTaskDiagnosticsOperationForRegistry(resolved),
404
- clearTaskDeadLetterOperation,
405
- listSchedulesOperation,
406
- listAlertsOperation,
407
- getScheduleOperation,
408
- replayWorkflowOperation,
409
- storageCapabilities.storageCapabilitiesOperation,
410
- storageGetOperation,
411
- storagePutOperation,
412
- storageDeleteOperation,
413
- storageScanOperation,
414
- storageBatchOperation,
415
- storageConditionalBatchOperation,
416
135
  buildSystemMetricsOperation(resolved),
417
136
  buildListWorkersOperationForRegistry(resolved),
418
137
  buildDrainWorkerOperationForRegistry(resolved),
419
138
  buildClearWorkerDrainOperationForRegistry(resolved),
420
139
  buildDrainDeploymentOperationForRegistry(resolved),
421
140
  buildClearDeploymentDrainOperationForRegistry(resolved),
422
- buildListTaskQueuesOperationForRegistry(resolved)
141
+ buildListTaskQueuesOperationForRegistry(resolved),
142
+ buildWorkerDiagnosticsOperationForRegistry(resolved),
143
+ buildWorkerRegistrationRejectionsOperationForRegistry(resolved)
423
144
  ]);
424
145
  }