@zlink-systems/framework 0.21.0 → 0.22.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 (487) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contracts/Common/ZLinkMessage.js +5 -5
  3. package/dist/contracts/Configuration/CodecContentType.js +5 -7
  4. package/dist/contracts/Configuration/DiagnosticsValidation.js +1 -6
  5. package/dist/contracts/Configuration/EndpointNotation.js +4 -8
  6. package/dist/contracts/Configuration/Registration.js +14 -11
  7. package/dist/contracts/Configuration/RegistrationBuilders.js +32 -25
  8. package/dist/contracts/Configuration/RegistrationNormalizers.js +25 -26
  9. package/dist/contracts/Configuration/RegistrationValidators.js +36 -38
  10. package/dist/contracts/Configuration/SendTimeoutValidation.js +4 -4
  11. package/dist/contracts/Configuration/TimerRegistrationValidator.js +7 -7
  12. package/dist/contracts/Handlers/JsonContract.js +23 -11
  13. package/dist/contracts/Spots/SpotKind.js +16 -8
  14. package/dist/location-store-integration.js +16 -16
  15. package/dist/nest-integration.js +17 -11
  16. package/dist/runtime/abort.js +9 -5
  17. package/dist/runtime/actors/actor-authority-payload-codec.js +12 -16
  18. package/dist/runtime/actors/actor-authority-publication.js +18 -17
  19. package/dist/runtime/actors/actor-client.js +83 -63
  20. package/dist/runtime/actors/actor-context.js +24 -18
  21. package/dist/runtime/actors/actor-creation.js +4 -3
  22. package/dist/runtime/actors/actor-handoff.js +89 -92
  23. package/dist/runtime/actors/actor-local-native-join.js +18 -19
  24. package/dist/runtime/actors/actor-mailbox.js +1 -1
  25. package/dist/runtime/actors/actor-message-follow-context.js +24 -21
  26. package/dist/runtime/actors/actor-packet-relay-wire.js +1 -3
  27. package/dist/runtime/actors/actor-remote-joiner.js +20 -17
  28. package/dist/runtime/actors/actor-remote-wire.js +6 -7
  29. package/dist/runtime/actors/actor-runtime-state.js +87 -81
  30. package/dist/runtime/actors/actor-transfer-registry.js +3 -5
  31. package/dist/runtime/actors/bound-session-wire.js +14 -9
  32. package/dist/runtime/actors/deferred-join-accepted-journal.js +158 -124
  33. package/dist/runtime/actors/index.js +2 -5
  34. package/dist/runtime/actors/post-commit-actor-binder.js +3 -6
  35. package/dist/runtime/actors/post-commit-actor-location.js +1 -1
  36. package/dist/runtime/actors/spot-actor-dispatch.js +5 -5
  37. package/dist/runtime/actors/transferred-actor-rollback.js +4 -4
  38. package/dist/runtime/admission.js +2 -6
  39. package/dist/runtime/application-jobs/application-ingress-record-owner.js +2 -6
  40. package/dist/runtime/application-jobs/receive-flow-controller.js +11 -12
  41. package/dist/runtime/backend/mesh-completion-table.js +1 -3
  42. package/dist/runtime/backend/mesh-dispatch-pump.js +12 -16
  43. package/dist/runtime/backend/node/node-backend-adapter-factory.js +1 -3
  44. package/dist/runtime/backend/node/node-backend-adapter-support.js +26 -17
  45. package/dist/runtime/backend/node/node-mesh-backend-adapter.js +4 -3
  46. package/dist/runtime/backend/node/node-raw-binding-port.js +7 -6
  47. package/dist/runtime/backend/node/node-raw-mesh-backend.js +116 -113
  48. package/dist/runtime/backend/node/node-socket-backend-adapter.js +12 -13
  49. package/dist/runtime/backend/runtime-message.js +3 -3
  50. package/dist/runtime/backend/runtime-values.d.ts +2 -2
  51. package/dist/runtime/backend/runtime-values.js +4 -5
  52. package/dist/runtime/channels/channel-clients.js +27 -24
  53. package/dist/runtime/channels/channel-dispatch-pipeline.js +10 -18
  54. package/dist/runtime/channels/channel-dispatch-services.js +7 -4
  55. package/dist/runtime/channels/channel-dispatchers.js +9 -9
  56. package/dist/runtime/channels/channel-envelope-inspection.js +16 -13
  57. package/dist/runtime/channels/channel-envelope.js +83 -47
  58. package/dist/runtime/channels/channel-outbound-operations.js +8 -8
  59. package/dist/runtime/channels/channel-receive-loops.js +20 -22
  60. package/dist/runtime/channels/channel-receive-task-tracker.js +1 -1
  61. package/dist/runtime/channels/channel-runtime-lifecycle.js +61 -56
  62. package/dist/runtime/channels/channel-runtime-manager.js +18 -9
  63. package/dist/runtime/channels/channel-socket-registry.js +126 -123
  64. package/dist/runtime/channels/channel-transports.js +43 -33
  65. package/dist/runtime/channels/client-server-location-runtime.js +32 -40
  66. package/dist/runtime/channels/client-server-service-wire.js +29 -22
  67. package/dist/runtime/channels/dispatch-error-reporter.js +9 -7
  68. package/dist/runtime/channels/fanout-location-runtime.js +34 -47
  69. package/dist/runtime/channels/fanout-service-wire.js +3 -5
  70. package/dist/runtime/channels/local-spot-route-transport.js +7 -1
  71. package/dist/runtime/channels/route-member-snapshot.js +3 -3
  72. package/dist/runtime/channels/source-spot-router.js +6 -2
  73. package/dist/runtime/channels/spot-route-bridge-transport.js +5 -2
  74. package/dist/runtime/channels/spot-route-dispatch-strategy.js +2 -2
  75. package/dist/runtime/channels/spot-route-target-resolver.js +6 -6
  76. package/dist/runtime/diagnostics/index.js +38 -10
  77. package/dist/runtime/diagnostics/message-flow.js +47 -39
  78. package/dist/runtime/diagnostics/runtime-metrics.js +18 -9
  79. package/dist/runtime/diagnostics/runtime-observation-queue.js +8 -10
  80. package/dist/runtime/diagnostics/topology-runtime-projections.js +17 -10
  81. package/dist/runtime/execution/index.js +7 -6
  82. package/dist/runtime/execution/serial-execution-queue.js +12 -18
  83. package/dist/runtime/execution/state-lane.js +2 -2
  84. package/dist/runtime/foundation/actor-join-recovery-codec.js +31 -23
  85. package/dist/runtime/foundation/event-loop-resources.js +4 -4
  86. package/dist/runtime/foundation/message-follow-suppression-registry.js +4 -4
  87. package/dist/runtime/foundation/raw-service-mesh-runtime.js +136 -136
  88. package/dist/runtime/foundation/route-mesh-connection-policy.js +4 -4
  89. package/dist/runtime/foundation/runtime-state-projections.js +22 -11
  90. package/dist/runtime/foundation/service-authority-payload-codec.js +13 -15
  91. package/dist/runtime/foundation/service-discovery-registry.js +35 -33
  92. package/dist/runtime/foundation/service-instance-activation-recovery-codec.js +20 -22
  93. package/dist/runtime/foundation/service-liveness-registry.js +16 -12
  94. package/dist/runtime/foundation/service-maintenance-runtime.js +2 -4
  95. package/dist/runtime/foundation/service-relocation-aggregate-committer.js +24 -24
  96. package/dist/runtime/foundation/service-relocation-object-owner.js +6 -6
  97. package/dist/runtime/foundation/service-relocation-runtime.js +137 -94
  98. package/dist/runtime/foundation/service-runtime-contracts.js +5 -5
  99. package/dist/runtime/foundation/service-stateful-registry.js +24 -23
  100. package/dist/runtime/foundation/service-stateful-runtime.js +416 -438
  101. package/dist/runtime/foundation/service-stateful-wire-codec.js +95 -98
  102. package/dist/runtime/foundation/service-topology-registry.js +96 -95
  103. package/dist/runtime/foundation/service-weighted-selection.js +6 -11
  104. package/dist/runtime/foundation/service-wire-binary-primitives.js +5 -6
  105. package/dist/runtime/foundation/service-wire-m6a-codec.js +46 -35
  106. package/dist/runtime/framework-errors-internal.js +7 -10
  107. package/dist/runtime/handlers/handler-instance-scope.js +4 -5
  108. package/dist/runtime/handlers/index.js +3 -1
  109. package/dist/runtime/host/actor-packet-relay.js +74 -70
  110. package/dist/runtime/host/actor-placement-coordinator.js +29 -31
  111. package/dist/runtime/host/actor-runtime-options-factory.js +12 -14
  112. package/dist/runtime/host/actor-transfer-authority-runtime.js +7 -9
  113. package/dist/runtime/host/actor-transfer-runtime.js +176 -153
  114. package/dist/runtime/host/application-job-queue.js +18 -22
  115. package/dist/runtime/host/bound-session-relay.js +3 -1
  116. package/dist/runtime/host/channel-runtime-options-factory.js +31 -14
  117. package/dist/runtime/host/host-capacity-status.js +8 -4
  118. package/dist/runtime/host/index.js +244 -227
  119. package/dist/runtime/host/instance-activation-authority.js +93 -96
  120. package/dist/runtime/host/location-runtime-owner.js +16 -14
  121. package/dist/runtime/host/mesh-router-resolver.js +11 -13
  122. package/dist/runtime/host/relocation-direct-transfer.js +10 -9
  123. package/dist/runtime/host/remote-actor-join-receiver.js +20 -15
  124. package/dist/runtime/host/remote-actor-packet-target-store.js +18 -22
  125. package/dist/runtime/host/remote-bound-session-relay.js +97 -73
  126. package/dist/runtime/host/route-mesh-runtime.js +64 -69
  127. package/dist/runtime/host/runtime-shutdown.js +1 -2
  128. package/dist/runtime/host/service-relocation-host-runtime.js +586 -511
  129. package/dist/runtime/host/spot-address-transport.js +69 -71
  130. package/dist/runtime/host/spot-runtime-options-factory.js +30 -29
  131. package/dist/runtime/host/stateful-authority-route-runtime.js +65 -68
  132. package/dist/runtime/host/user-spot-creation-coordinator.js +61 -67
  133. package/dist/runtime/locations/actor-location-claims.js +26 -20
  134. package/dist/runtime/locations/aggregate-inventory-store.js +72 -75
  135. package/dist/runtime/locations/authority-key-codec.js +7 -7
  136. package/dist/runtime/locations/auto-connect-loop.js +3 -3
  137. package/dist/runtime/locations/auto-connect-planner.js +25 -19
  138. package/dist/runtime/locations/auto-connect-reconciler.js +51 -31
  139. package/dist/runtime/locations/in-memory-authority-store.js +128 -118
  140. package/dist/runtime/locations/in-memory-location-store.js +195 -168
  141. package/dist/runtime/locations/in-memory-provider-location-store.js +8 -10
  142. package/dist/runtime/locations/key-codec.js +1 -1
  143. package/dist/runtime/locations/lease-tracker.js +23 -21
  144. package/dist/runtime/locations/lifecycle.js +4 -5
  145. package/dist/runtime/locations/location-store-repository.js +368 -324
  146. package/dist/runtime/locations/opaque-record-key.js +2 -2
  147. package/dist/runtime/locations/resolvers.js +73 -82
  148. package/dist/runtime/locations/runtime.js +68 -63
  149. package/dist/runtime/locations/spot-location-claims.js +39 -35
  150. package/dist/runtime/messaging/framework-json-v1.js +7 -7
  151. package/dist/runtime/messaging/packet-name.js +7 -6
  152. package/dist/runtime/messaging/payload-codec.js +21 -18
  153. package/dist/runtime/protocol/service_wire_codec.generated.d.ts +30 -2
  154. package/dist/runtime/protocol/service_wire_codec.generated.js +1671 -234
  155. package/dist/runtime/routing-id.js +3 -5
  156. package/dist/runtime/spots/formal-remote-actor-admission-registry.js +35 -31
  157. package/dist/runtime/spots/formal-remote-actor-transfer-registry.js +1 -2
  158. package/dist/runtime/spots/index.js +208 -219
  159. package/dist/runtime/spots/spot-activation-registry.js +15 -14
  160. package/dist/runtime/spots/spot-activation-state.js +17 -15
  161. package/dist/runtime/spots/spot-activation.js +33 -16
  162. package/dist/runtime/spots/spot-actor-admission-coordinator.js +18 -15
  163. package/dist/runtime/spots/spot-actor-membership.js +1 -3
  164. package/dist/runtime/spots/spot-actor-packet-dispatch.js +23 -20
  165. package/dist/runtime/spots/spot-actor-packet-drain.js +12 -10
  166. package/dist/runtime/spots/spot-actor-packet-relay-dispatch.js +10 -6
  167. package/dist/runtime/spots/spot-closing.js +3 -7
  168. package/dist/runtime/spots/spot-context.js +2 -2
  169. package/dist/runtime/spots/spot-entry-activation.js +13 -14
  170. package/dist/runtime/spots/spot-handle.js +6 -3
  171. package/dist/runtime/spots/spot-handler-registry.js +12 -12
  172. package/dist/runtime/spots/spot-manager-public.js +5 -6
  173. package/dist/runtime/spots/spot-native-actor-join-admission.js +4 -3
  174. package/dist/runtime/spots/spot-node-autoconnect.js +15 -18
  175. package/dist/runtime/spots/spot-node-runtime-manager.js +74 -85
  176. package/dist/runtime/spots/spot-outbound.js +10 -14
  177. package/dist/runtime/spots/spot-remote-codec.js +22 -26
  178. package/dist/runtime/spots/spot-remote-route-codec.js +5 -7
  179. package/dist/runtime/spots/spot-route-packet-dispatch.js +16 -14
  180. package/dist/runtime/spots/spot-route-replies.js +4 -6
  181. package/dist/runtime/spots/spot-routed-actor-admission.js +9 -7
  182. package/dist/runtime/spots/spot-routed-bound-session-dispatch.js +1 -2
  183. package/dist/runtime/spots/spot-routed-frame-dispatch.js +5 -5
  184. package/dist/runtime/spots/spot-routed-spot-packet-dispatch.js +14 -10
  185. package/dist/runtime/spots/spot-serial-executor.js +5 -8
  186. package/dist/runtime/spots/spot-serial-turn-executor.js +4 -6
  187. package/dist/runtime/spots/spot-subscription-dispatch.js +5 -5
  188. package/dist/runtime/spots/spot-timer.js +25 -29
  189. package/dist/runtime/streams/actor-session-binding-registry.js +98 -107
  190. package/dist/runtime/streams/actor-session-lifecycle-coordinator.js +3 -1
  191. package/dist/runtime/streams/bound-actor-relay-sender.js +18 -16
  192. package/dist/runtime/streams/bound-session-service.js +8 -9
  193. package/dist/runtime/streams/index.js +20 -19
  194. package/dist/runtime/streams/managed-stream.js +32 -30
  195. package/dist/runtime/streams/native-fallback-bound-session.js +21 -17
  196. package/dist/runtime/streams/protocol.js +29 -18
  197. package/dist/runtime/streams/session-actor-coordinator.js +34 -37
  198. package/dist/runtime/streams/session-context.js +30 -28
  199. package/dist/runtime/streams/session-provider.js +2 -2
  200. package/dist/runtime/streams/session-serial-executor.js +1 -2
  201. package/dist/runtime/streams/stream-frame-factory.js +11 -5
  202. package/dist/runtime/streams/stream-session-runtime.js +70 -66
  203. package/dist/runtime/workers/index.js +15 -4
  204. package/package.json +2 -2
  205. package/src/contracts/Channels/RouteCalls.ts +6 -1
  206. package/src/contracts/Common/ZLinkMessage.ts +5 -5
  207. package/src/contracts/Common/ZLinkMessageMetadata.ts +4 -3
  208. package/src/contracts/Configuration/Builders.ts +14 -14
  209. package/src/contracts/Configuration/CodecContentType.ts +8 -10
  210. package/src/contracts/Configuration/DiagnosticsValidation.ts +1 -6
  211. package/src/contracts/Configuration/EndpointNotation.ts +11 -11
  212. package/src/contracts/Configuration/ObjectRoles.ts +1 -3
  213. package/src/contracts/Configuration/Registration.ts +46 -17
  214. package/src/contracts/Configuration/RegistrationBuilderPolicy.ts +10 -8
  215. package/src/contracts/Configuration/RegistrationBuilders.ts +107 -96
  216. package/src/contracts/Configuration/RegistrationCodecRegistry.ts +9 -3
  217. package/src/contracts/Configuration/RegistrationNormalizers.ts +116 -84
  218. package/src/contracts/Configuration/RegistrationTypes.ts +21 -25
  219. package/src/contracts/Configuration/RegistrationValidators.ts +122 -73
  220. package/src/contracts/Configuration/RouteChannelInternalState.ts +1 -4
  221. package/src/contracts/Configuration/RuntimeEndpointConnections.ts +4 -1
  222. package/src/contracts/Configuration/SendTimeoutValidation.ts +6 -4
  223. package/src/contracts/Configuration/TimerRegistrationValidator.ts +8 -13
  224. package/src/contracts/Dispatch/ZLinkDispatchOptions.ts +1 -6
  225. package/src/contracts/Errors/index.ts +1 -4
  226. package/src/contracts/Handlers/Attributes.ts +15 -9
  227. package/src/contracts/Handlers/IZLinkChannelHandlers.ts +24 -4
  228. package/src/contracts/Handlers/JsonContract.ts +53 -19
  229. package/src/contracts/Locations/ActorTransfer.ts +1 -5
  230. package/src/contracts/Locations/Authority.ts +4 -11
  231. package/src/contracts/Locations/Keys.ts +6 -1
  232. package/src/contracts/Locations/Options.ts +3 -2
  233. package/src/contracts/Locations/RelocationStore.ts +1 -4
  234. package/src/contracts/Locations/Resolvers.ts +5 -5
  235. package/src/contracts/Locations/RuntimeQuery.ts +6 -2
  236. package/src/contracts/Locations/Stores.ts +1 -2
  237. package/src/contracts/Locations/index.ts +2 -8
  238. package/src/contracts/RouteMesh/Contracts.ts +1 -7
  239. package/src/contracts/RouteMesh/RuntimeTopology.ts +1 -4
  240. package/src/contracts/Spots/Contracts.ts +2 -8
  241. package/src/contracts/Spots/SpotKind.ts +16 -8
  242. package/src/contracts/Spots/ZLinkSpot.ts +8 -11
  243. package/src/contracts/Streams/IZLinkSession.ts +0 -1
  244. package/src/contracts/Streams/IZLinkSessionActor.ts +5 -1
  245. package/src/contracts/Streams/IZLinkSessionPacketHandler.ts +5 -1
  246. package/src/internal.ts +5 -4
  247. package/src/location-store-integration.ts +24 -16
  248. package/src/nest-integration.ts +40 -25
  249. package/src/runtime/abort.ts +10 -4
  250. package/src/runtime/actors/actor-authority-payload-codec.ts +20 -29
  251. package/src/runtime/actors/actor-authority-publication.ts +92 -77
  252. package/src/runtime/actors/actor-client.ts +162 -133
  253. package/src/runtime/actors/actor-context.ts +138 -130
  254. package/src/runtime/actors/actor-creation.ts +47 -44
  255. package/src/runtime/actors/actor-execution-context.ts +6 -4
  256. package/src/runtime/actors/actor-handoff.ts +269 -293
  257. package/src/runtime/actors/actor-join-deferred-scope.ts +5 -4
  258. package/src/runtime/actors/actor-lifecycle-snapshot.ts +5 -8
  259. package/src/runtime/actors/actor-local-native-join.ts +131 -159
  260. package/src/runtime/actors/actor-mailbox.ts +16 -19
  261. package/src/runtime/actors/actor-message-follow-context.ts +46 -36
  262. package/src/runtime/actors/actor-packet-relay-wire.ts +32 -21
  263. package/src/runtime/actors/actor-remote-joiner.ts +50 -54
  264. package/src/runtime/actors/actor-remote-wire.ts +9 -13
  265. package/src/runtime/actors/actor-routed-join-transport.ts +10 -2
  266. package/src/runtime/actors/actor-runtime-contracts.ts +2 -5
  267. package/src/runtime/actors/actor-runtime-state.ts +127 -124
  268. package/src/runtime/actors/actor-transfer-registry.ts +9 -14
  269. package/src/runtime/actors/actor-transport-delivery-gate.ts +4 -6
  270. package/src/runtime/actors/bound-session-wire.ts +37 -17
  271. package/src/runtime/actors/deferred-join-accepted-journal.ts +351 -320
  272. package/src/runtime/actors/index.ts +43 -86
  273. package/src/runtime/actors/post-commit-actor-binder.ts +10 -10
  274. package/src/runtime/actors/post-commit-actor-location.ts +30 -23
  275. package/src/runtime/actors/spot-actor-dispatch.ts +78 -53
  276. package/src/runtime/actors/transferred-actor-rollback.ts +18 -13
  277. package/src/runtime/admission.ts +9 -9
  278. package/src/runtime/application-jobs/application-ingress-record-owner.ts +5 -15
  279. package/src/runtime/application-jobs/application-job-queue-handler-start-gate.ts +3 -2
  280. package/src/runtime/application-jobs/receive-flow-controller.ts +17 -14
  281. package/src/runtime/backend/contracts/index.ts +73 -52
  282. package/src/runtime/backend/mesh-actor-session-node-adapter.ts +4 -14
  283. package/src/runtime/backend/mesh-completion-table.ts +6 -9
  284. package/src/runtime/backend/mesh-dispatch-pump.ts +38 -30
  285. package/src/runtime/backend/node/node-backend-adapter-factory.ts +23 -21
  286. package/src/runtime/backend/node/node-backend-adapter-support.ts +36 -22
  287. package/src/runtime/backend/node/node-dealer-channel-client-transport.ts +59 -58
  288. package/src/runtime/backend/node/node-event-loop-poller.ts +2 -10
  289. package/src/runtime/backend/node/node-mesh-backend-adapter.ts +12 -5
  290. package/src/runtime/backend/node/node-monitor-backend-adapter.ts +4 -3
  291. package/src/runtime/backend/node/node-raw-binding-port.ts +29 -29
  292. package/src/runtime/backend/node/node-raw-mesh-backend.ts +335 -383
  293. package/src/runtime/backend/node/node-socket-backend-adapter.ts +101 -54
  294. package/src/runtime/backend/runtime-message.ts +5 -3
  295. package/src/runtime/backend/runtime-values.ts +10 -7
  296. package/src/runtime/channels/channel-autoconnect.ts +1 -4
  297. package/src/runtime/channels/channel-clients.ts +93 -73
  298. package/src/runtime/channels/channel-dispatch-pipeline.ts +40 -42
  299. package/src/runtime/channels/channel-dispatch-services.ts +51 -49
  300. package/src/runtime/channels/channel-dispatchers.ts +152 -96
  301. package/src/runtime/channels/channel-envelope-inspection.ts +20 -16
  302. package/src/runtime/channels/channel-envelope.ts +256 -150
  303. package/src/runtime/channels/channel-multipart.ts +13 -5
  304. package/src/runtime/channels/channel-outbound-operations.ts +37 -41
  305. package/src/runtime/channels/channel-receive-loops.ts +102 -98
  306. package/src/runtime/channels/channel-receive-task-tracker.ts +1 -1
  307. package/src/runtime/channels/channel-runtime-lifecycle.ts +248 -190
  308. package/src/runtime/channels/channel-runtime-manager.ts +63 -37
  309. package/src/runtime/channels/channel-socket-options.ts +3 -10
  310. package/src/runtime/channels/channel-socket-registry.ts +331 -273
  311. package/src/runtime/channels/channel-transports.ts +215 -197
  312. package/src/runtime/channels/client-server-location-runtime.ts +116 -100
  313. package/src/runtime/channels/client-server-service-wire.ts +37 -36
  314. package/src/runtime/channels/dispatch-error-reporter.ts +11 -8
  315. package/src/runtime/channels/fanout-location-runtime.ts +91 -94
  316. package/src/runtime/channels/fanout-service-wire.ts +5 -12
  317. package/src/runtime/channels/handler-filter-scope.ts +1 -4
  318. package/src/runtime/channels/index.ts +1 -4
  319. package/src/runtime/channels/local-spot-route-transport.ts +20 -5
  320. package/src/runtime/channels/route-member-snapshot.ts +11 -5
  321. package/src/runtime/channels/router-socket-spot-route-transport.ts +1 -7
  322. package/src/runtime/channels/source-spot-router.ts +26 -22
  323. package/src/runtime/channels/spot-direct-envelope.ts +10 -8
  324. package/src/runtime/channels/spot-node-route-transport.ts +13 -16
  325. package/src/runtime/channels/spot-route-bridge-transport.ts +26 -9
  326. package/src/runtime/channels/spot-route-dispatch-strategy.ts +40 -13
  327. package/src/runtime/channels/spot-route-target-resolver.ts +18 -9
  328. package/src/runtime/codecs/index.ts +3 -2
  329. package/src/runtime/diagnostics/flow-context.ts +12 -3
  330. package/src/runtime/diagnostics/index.ts +96 -61
  331. package/src/runtime/diagnostics/internal-event-contracts.ts +87 -33
  332. package/src/runtime/diagnostics/message-flow.ts +95 -76
  333. package/src/runtime/diagnostics/runtime-metrics.ts +46 -24
  334. package/src/runtime/diagnostics/runtime-observation-queue.ts +17 -28
  335. package/src/runtime/diagnostics/topology-runtime-projections.ts +62 -43
  336. package/src/runtime/execution/index.ts +18 -26
  337. package/src/runtime/execution/serial-execution-queue.ts +31 -40
  338. package/src/runtime/execution/state-lane.ts +2 -2
  339. package/src/runtime/foundation/actor-join-recovery-codec.ts +69 -51
  340. package/src/runtime/foundation/event-loop-resources.ts +8 -4
  341. package/src/runtime/foundation/message-follow-suppression-registry.ts +7 -14
  342. package/src/runtime/foundation/operation-identity.ts +1 -2
  343. package/src/runtime/foundation/operation-registry.ts +8 -2
  344. package/src/runtime/foundation/raw-service-mesh-runtime.ts +312 -385
  345. package/src/runtime/foundation/route-mesh-connection-policy.ts +7 -8
  346. package/src/runtime/foundation/runtime-state-projections.ts +24 -23
  347. package/src/runtime/foundation/service-authority-payload-codec.ts +54 -57
  348. package/src/runtime/foundation/service-discovery-registry.ts +67 -59
  349. package/src/runtime/foundation/service-instance-activation-recovery-codec.ts +28 -29
  350. package/src/runtime/foundation/service-liveness-registry.ts +18 -13
  351. package/src/runtime/foundation/service-mailbox.ts +14 -14
  352. package/src/runtime/foundation/service-maintenance-runtime.ts +22 -21
  353. package/src/runtime/foundation/service-metadata-codec.ts +2 -9
  354. package/src/runtime/foundation/service-relocation-aggregate-committer.ts +39 -36
  355. package/src/runtime/foundation/service-relocation-coordinator.ts +1 -4
  356. package/src/runtime/foundation/service-relocation-object-owner.ts +40 -58
  357. package/src/runtime/foundation/service-relocation-runtime.ts +292 -216
  358. package/src/runtime/foundation/service-runtime-contracts.ts +8 -8
  359. package/src/runtime/foundation/service-session-binding-ingress-port.ts +1 -4
  360. package/src/runtime/foundation/service-stateful-registry.ts +69 -59
  361. package/src/runtime/foundation/service-stateful-runtime.ts +1174 -1112
  362. package/src/runtime/foundation/service-stateful-wire-codec.ts +318 -270
  363. package/src/runtime/foundation/service-topology-registry.ts +157 -159
  364. package/src/runtime/foundation/service-weighted-selection.ts +9 -15
  365. package/src/runtime/foundation/service-wire-binary-primitives.ts +6 -12
  366. package/src/runtime/foundation/service-wire-m6a-codec.ts +69 -47
  367. package/src/runtime/framework-errors-internal.ts +31 -30
  368. package/src/runtime/handlers/handler-instance-scope.ts +18 -29
  369. package/src/runtime/handlers/index.ts +18 -8
  370. package/src/runtime/host/actor-packet-relay.ts +290 -261
  371. package/src/runtime/host/actor-placement-coordinator.ts +165 -150
  372. package/src/runtime/host/actor-runtime-options-factory.ts +89 -87
  373. package/src/runtime/host/actor-transfer-authority-runtime.ts +46 -38
  374. package/src/runtime/host/actor-transfer-runtime.ts +391 -395
  375. package/src/runtime/host/application-job-queue.ts +32 -48
  376. package/src/runtime/host/bound-session-relay.ts +7 -9
  377. package/src/runtime/host/channel-runtime-options-factory.ts +75 -35
  378. package/src/runtime/host/host-capacity-status.ts +10 -9
  379. package/src/runtime/host/index.ts +861 -789
  380. package/src/runtime/host/instance-activation-authority.ts +125 -143
  381. package/src/runtime/host/location-runtime-owner.ts +38 -26
  382. package/src/runtime/host/mesh-router-resolver.ts +30 -23
  383. package/src/runtime/host/relocation-direct-transfer.ts +15 -15
  384. package/src/runtime/host/relocation-integrity-fault-gate.ts +3 -2
  385. package/src/runtime/host/remote-actor-join-receiver.ts +43 -34
  386. package/src/runtime/host/remote-actor-packet-target-store.ts +54 -52
  387. package/src/runtime/host/remote-bound-session-relay.ts +274 -247
  388. package/src/runtime/host/route-mesh-runtime-options.ts +1 -3
  389. package/src/runtime/host/route-mesh-runtime.ts +227 -181
  390. package/src/runtime/host/runtime-shutdown.ts +4 -3
  391. package/src/runtime/host/service-relocation-control.ts +14 -5
  392. package/src/runtime/host/service-relocation-host-runtime.ts +1388 -1165
  393. package/src/runtime/host/spot-address-transport.ts +284 -237
  394. package/src/runtime/host/spot-node-runtime-options-factory.ts +14 -8
  395. package/src/runtime/host/spot-runtime-options-factory.ts +71 -62
  396. package/src/runtime/host/stateful-authority-route-runtime.ts +117 -116
  397. package/src/runtime/host/user-spot-creation-coordinator.ts +225 -220
  398. package/src/runtime/locations/actor-location-claims.ts +61 -49
  399. package/src/runtime/locations/actor-session-route-claims.ts +1 -4
  400. package/src/runtime/locations/aggregate-inventory-store.ts +105 -134
  401. package/src/runtime/locations/authority-key-codec.ts +13 -10
  402. package/src/runtime/locations/auto-connect-loop.ts +14 -11
  403. package/src/runtime/locations/auto-connect-planner.ts +42 -31
  404. package/src/runtime/locations/auto-connect-reconciler.ts +106 -63
  405. package/src/runtime/locations/canonical-codec.ts +3 -1
  406. package/src/runtime/locations/creation-operation-id.ts +4 -3
  407. package/src/runtime/locations/domain-store-contract.ts +13 -7
  408. package/src/runtime/locations/in-memory-authority-store.ts +232 -199
  409. package/src/runtime/locations/in-memory-location-store.ts +432 -250
  410. package/src/runtime/locations/in-memory-provider-location-store.ts +16 -17
  411. package/src/runtime/locations/internal-store-contracts.ts +95 -38
  412. package/src/runtime/locations/key-codec.ts +3 -4
  413. package/src/runtime/locations/lease-tracker.ts +36 -27
  414. package/src/runtime/locations/lifecycle-runtime.ts +15 -3
  415. package/src/runtime/locations/lifecycle.ts +33 -28
  416. package/src/runtime/locations/location-store-repository.ts +1329 -1185
  417. package/src/runtime/locations/opaque-record-key.ts +4 -9
  418. package/src/runtime/locations/resolvers.ts +201 -178
  419. package/src/runtime/locations/runtime.ts +251 -159
  420. package/src/runtime/locations/spot-location-claims.ts +110 -112
  421. package/src/runtime/messaging/creation-payload-codec.ts +4 -1
  422. package/src/runtime/messaging/framework-json-v1.ts +34 -15
  423. package/src/runtime/messaging/packet-name.ts +8 -6
  424. package/src/runtime/messaging/payload-codec.ts +70 -50
  425. package/src/runtime/messaging/submission-result.ts +6 -9
  426. package/src/runtime/protocol/service_wire_codec.generated.ts +1376 -159
  427. package/src/runtime/protocol/service_wire_pilot_codec.generated.ts +1 -1
  428. package/src/runtime/routing-id.ts +10 -7
  429. package/src/runtime/spots/formal-remote-actor-admission-registry.ts +56 -62
  430. package/src/runtime/spots/formal-remote-actor-transfer-registry.ts +23 -20
  431. package/src/runtime/spots/index.ts +593 -563
  432. package/src/runtime/spots/spot-activation-registry.ts +38 -34
  433. package/src/runtime/spots/spot-activation-state.ts +43 -51
  434. package/src/runtime/spots/spot-activation.ts +179 -116
  435. package/src/runtime/spots/spot-actor-admission-coordinator.ts +110 -78
  436. package/src/runtime/spots/spot-actor-join-dispatch.ts +57 -41
  437. package/src/runtime/spots/spot-actor-lifecycle-drain.ts +5 -7
  438. package/src/runtime/spots/spot-actor-membership.ts +25 -27
  439. package/src/runtime/spots/spot-actor-packet-dispatch.ts +184 -153
  440. package/src/runtime/spots/spot-actor-packet-drain.ts +54 -42
  441. package/src/runtime/spots/spot-actor-packet-relay-dispatch.ts +37 -39
  442. package/src/runtime/spots/spot-closing.ts +11 -12
  443. package/src/runtime/spots/spot-context.ts +46 -26
  444. package/src/runtime/spots/spot-entry-activation.ts +84 -65
  445. package/src/runtime/spots/spot-handle.ts +17 -15
  446. package/src/runtime/spots/spot-handler-registry.ts +44 -31
  447. package/src/runtime/spots/spot-location-claim.ts +5 -4
  448. package/src/runtime/spots/spot-manager-public.ts +62 -82
  449. package/src/runtime/spots/spot-native-actor-join-admission.ts +20 -16
  450. package/src/runtime/spots/spot-node-autoconnect.ts +54 -61
  451. package/src/runtime/spots/spot-node-runtime-manager.ts +230 -221
  452. package/src/runtime/spots/spot-outbound.ts +47 -59
  453. package/src/runtime/spots/spot-publisher-transport.ts +5 -4
  454. package/src/runtime/spots/spot-remote-codec.ts +66 -65
  455. package/src/runtime/spots/spot-remote-route-codec.ts +61 -41
  456. package/src/runtime/spots/spot-route-packet-dispatch.ts +128 -95
  457. package/src/runtime/spots/spot-route-replies.ts +23 -24
  458. package/src/runtime/spots/spot-route-reply-wire.ts +3 -2
  459. package/src/runtime/spots/spot-routed-actor-admission.ts +37 -27
  460. package/src/runtime/spots/spot-routed-bound-session-dispatch.ts +11 -17
  461. package/src/runtime/spots/spot-routed-frame-dispatch.ts +18 -15
  462. package/src/runtime/spots/spot-routed-spot-packet-dispatch.ts +35 -26
  463. package/src/runtime/spots/spot-routing-internal.ts +1 -4
  464. package/src/runtime/spots/spot-runtime-ports.ts +5 -5
  465. package/src/runtime/spots/spot-serial-executor.ts +5 -9
  466. package/src/runtime/spots/spot-serial-turn-executor.ts +19 -26
  467. package/src/runtime/spots/spot-subscription-dispatch.ts +56 -46
  468. package/src/runtime/spots/spot-timer.ts +98 -91
  469. package/src/runtime/streams/actor-session-binding-registry.ts +277 -235
  470. package/src/runtime/streams/actor-session-binding-runtime-owner.ts +7 -4
  471. package/src/runtime/streams/actor-session-lifecycle-coordinator.ts +3 -1
  472. package/src/runtime/streams/bound-actor-relay-sender.ts +53 -51
  473. package/src/runtime/streams/bound-session-response-target.ts +29 -8
  474. package/src/runtime/streams/bound-session-service.ts +39 -39
  475. package/src/runtime/streams/index.ts +176 -100
  476. package/src/runtime/streams/managed-stream.ts +98 -87
  477. package/src/runtime/streams/native-fallback-bound-session.ts +57 -52
  478. package/src/runtime/streams/protocol.ts +73 -43
  479. package/src/runtime/streams/session-actor-coordinator.ts +97 -89
  480. package/src/runtime/streams/session-calls.ts +2 -8
  481. package/src/runtime/streams/session-context.ts +66 -48
  482. package/src/runtime/streams/session-provider.ts +5 -7
  483. package/src/runtime/streams/session-serial-executor.ts +7 -6
  484. package/src/runtime/streams/stream-binding-runtime-ports.ts +79 -29
  485. package/src/runtime/streams/stream-frame-factory.ts +55 -38
  486. package/src/runtime/streams/stream-session-runtime.ts +268 -210
  487. package/src/runtime/workers/index.ts +68 -29
@@ -1,19 +1,23 @@
1
1
  /* This file is generated by render-service-wire-typescript.mjs. */
2
2
  /* eslint-disable */
3
3
 
4
- export type ServiceWireRuntimePredicate = (terminalResult: number, failureCode: number) => boolean;
5
- export type ServiceWireDecoderContext = Readonly<{ originalOperationKind?: MeshOperationKind; durableRelocationPresent?: boolean; applicationSnapshotPresent?: boolean; readonly effectiveCompleteMessageBytesMinusActualEnvelopeOverhead?: number | bigint; readonly effectiveCompleteMessageBytes?: number | bigint; runtimePredicates: Readonly<Record<string, ServiceWireRuntimePredicate>> }>;
6
- function fail(message: string): never { throw new RangeError(message); }
4
+ export type ServiceWireDecoderContext = Readonly<{ originalOperationKind?: MeshOperationKind; durableRelocationPresent?: boolean; applicationSnapshotPresent?: boolean; runtimePredicates?: Readonly<Record<string, unknown>>; readonly effectiveCompleteMessageBytesMinusActualEnvelopeOverhead?: number | bigint; readonly effectiveCompleteMessageBytes?: number | bigint; }>;
5
+ class ServiceWireProtocolError extends RangeError { constructor(message: string) { super(message); this.name = "ServiceWireProtocolError"; } }
6
+ function fail(message: string): never { throw new ServiceWireProtocolError(message); }
7
7
  class ServiceWireCapacityError extends RangeError { constructor(message: string) { super(message); this.name = "ServiceWireCapacityError"; } }
8
8
  function capacityFail(message: string): never { throw new ServiceWireCapacityError(message); }
9
9
  function numeric(value: unknown): bigint { return typeof value === "bigint" ? value : BigInt(value as number); }
10
10
  function same(left: unknown, right: unknown): boolean { return typeof left === "bigint" || typeof right === "bigint" ? numeric(left) === numeric(right) : left === right; }
11
11
  function requireContext(context: ServiceWireDecoderContext, name: string): unknown { const value = (context as any)[name]; if (value === undefined) fail("missing decoder context " + name); return value; }
12
- function runtimePredicate(context: ServiceWireDecoderContext, name: string, terminal: number, failure: number): boolean { const predicate = context.runtimePredicates[name]; if (!predicate) fail("missing runtime predicate " + name); return predicate(terminal, failure); }
12
+ function validTerminalFailure(terminal: number, failure: number): boolean { if (terminal === 0) return failure === 0; if ([101, 103, 108, 109, 110, 111, 112, 113].includes(terminal)) return failure === 0; return new Map([[1, 102], [2, 105], [3, 107], [4, 107], [5, 105], [6, 102], [7, 107], [8, 102], [9, 102], [10, 102], [11, 102], [12, 104], [13, 105], [14, 102], [15, 106], [16, 104], [17, 105], [18, 106], [19, 105], [20, 105], [21, 107], [22, 106], [33, 107], [34, 107], [35, 105]]).get(failure) === terminal; }
13
13
  const encoder = new TextEncoder(); const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
14
14
  function utf8(value: unknown): Uint8Array { const text = value as string; for (let index = 0; index < text.length; ++index) { const unit = text.charCodeAt(index); if (unit >= 0xd800 && unit <= 0xdbff) { const next = text.charCodeAt(++index); if (!(next >= 0xdc00 && next <= 0xdfff)) fail("lone UTF-16 surrogate"); } else if (unit >= 0xdc00 && unit <= 0xdfff) fail("lone UTF-16 surrogate"); } return encoder.encode(text); }
15
15
  function decodeUtf8(bytes: Uint8Array, label: string): string { try { return decoder.decode(bytes); } catch { return fail(label + " UTF-8"); } }
16
16
  class Reader { offset = 0; constructor(readonly bytes: Uint8Array, readonly end = bytes.length) {} get remaining(): number { return this.end - this.offset; } take(length: number): Uint8Array { if (!Number.isSafeInteger(length) || length < 0 || length > this.remaining) fail("truncated service-wire value"); const value = this.bytes.subarray(this.offset, this.offset + length); this.offset += length; return value; } bounded(length: number): Reader { return new Reader(this.take(length)); } u(width: number): bigint { let value = 0n; for (const byte of this.take(width)) value = (value << 8n) | BigInt(byte); return value; } i64(): bigint { const value = this.u(8); return (value & (1n << 63n)) === 0n ? value : value - (1n << 64n); } done(label: string): void { if (this.remaining) fail(label + " trailing bytes"); } }
17
+ interface IncrementalInput { readonly offset: number; readonly remaining: number; take(length: number): Generator<void, Uint8Array, void>; bytes(length: number): Generator<void, Uint8Array, void>; text(length: number, forbidNul: boolean, label: string): Generator<void, string, void>; bounded(length: number): IncrementalInput; u(width: number): Generator<void, bigint, void>; i64(): Generator<void, bigint, void>; done(label: string): void; }
18
+ class IncrementalReader implements IncrementalInput { offset = 0; private chunk: Uint8Array = new Uint8Array(); private chunkOffset = 0; bufferedInputByteCount = 0; get remaining(): number { return this.chunk.length - this.chunkOffset; } supply(chunk: Uint8Array): void { if (this.remaining) throw new Error("incremental reader still owns caller input"); this.chunk = chunk; this.chunkOffset = 0; } release(): void { if (this.remaining) throw new Error("incremental reader did not consume caller input"); this.discard(); } discard(): void { this.chunk = new Uint8Array(); this.chunkOffset = 0; } *take(length: number): Generator<void, Uint8Array, void> { if (!Number.isSafeInteger(length) || length < 0 || length > 8) fail("invalid incremental scalar read length"); const value = new Uint8Array(length); let filled = 0; while (filled < length) { const available = this.remaining; if (available === 0) { this.bufferedInputByteCount = filled; yield; continue; } const count = Math.min(length - filled, available); value.set(this.chunk.subarray(this.chunkOffset, this.chunkOffset + count), filled); this.chunkOffset += count; this.offset += count; filled += count; } this.bufferedInputByteCount = 0; return value; } *bytes(length: number): Generator<void, Uint8Array, void> { if (!Number.isSafeInteger(length) || length < 0) fail("invalid incremental content length"); let value: Uint8Array; try { value = new Uint8Array(length); } catch { return capacityFail("incremental content capacity"); } let filled = 0; while (filled < length) { const available = this.remaining; if (available === 0) { this.bufferedInputByteCount = 0; yield; continue; } const count = Math.min(length - filled, available); value.set(this.chunk.subarray(this.chunkOffset, this.chunkOffset + count), filled); this.chunkOffset += count; this.offset += count; filled += count; } return value; } *text(length: number, forbidNul: boolean, label: string): Generator<void, string, void> { if (!Number.isSafeInteger(length) || length < 0) fail("invalid incremental text length"); let value = "", remaining = length, codePoint = 0, needed = 0, minimum = 0; while (remaining > 0) { if (this.remaining === 0) { this.bufferedInputByteCount = 0; yield; continue; } const byte = this.chunk[this.chunkOffset++]; ++this.offset; --remaining; if (needed === 0) { if (byte <= 0x7f) { if (forbidNul && byte === 0) fail(label + " NUL"); try { value += String.fromCodePoint(byte); } catch { return capacityFail(label + " capacity"); } continue; } if (byte >= 0xc2 && byte <= 0xdf) { codePoint = byte & 0x1f; needed = 1; minimum = 0x80; continue; } if (byte >= 0xe0 && byte <= 0xef) { codePoint = byte & 0x0f; needed = 2; minimum = 0x800; continue; } if (byte >= 0xf0 && byte <= 0xf4) { codePoint = byte & 0x07; needed = 3; minimum = 0x10000; continue; } fail(label + " UTF-8"); } if ((byte & 0xc0) !== 0x80) fail(label + " UTF-8"); codePoint = (codePoint << 6) | (byte & 0x3f); if (--needed === 0) { if (codePoint < minimum || codePoint > 0x10ffff || (codePoint >= 0xd800 && codePoint <= 0xdfff) || (forbidNul && codePoint === 0)) fail(label + " UTF-8"); try { value += String.fromCodePoint(codePoint); } catch { return capacityFail(label + " capacity"); } } } if (needed !== 0) fail(label + " UTF-8"); return value; } bounded(length: number): IncrementalInput { if (!Number.isSafeInteger(length) || length < 0) fail("invalid bounded read length"); return new IncrementalBoundedReader(this, length); } *u(width: number): Generator<void, bigint, void> { let value = 0n; for (const byte of yield* this.take(width)) value = (value << 8n) | BigInt(byte); return value; } *i64(): Generator<void, bigint, void> { const value = yield* this.u(8); return (value & (1n << 63n)) === 0n ? value : value - (1n << 64n); } done(label: string): void { if (this.remaining) fail(label + " bounded body remainder"); } }
19
+ class IncrementalBoundedReader implements IncrementalInput { offset = 0; constructor(private readonly source: IncrementalReader, public remaining: number) {} private check(length: number): void { if (!Number.isSafeInteger(length) || length < 0 || length > this.remaining) fail("bounded service-wire value overflow"); } private consumed(length: number): void { this.remaining -= length; this.offset += length; } *take(length: number): Generator<void, Uint8Array, void> { this.check(length); const value = yield* this.source.take(length); this.consumed(length); return value; } *bytes(length: number): Generator<void, Uint8Array, void> { this.check(length); const value = yield* this.source.bytes(length); this.consumed(length); return value; } *text(length: number, forbidNul: boolean, label: string): Generator<void, string, void> { this.check(length); const value = yield* this.source.text(length, forbidNul, label); this.consumed(length); return value; } bounded(length: number): IncrementalInput { this.check(length); return new IncrementalNestedBoundedReader(this, length); } *u(width: number): Generator<void, bigint, void> { let value = 0n; for (const byte of yield* this.take(width)) value = (value << 8n) | BigInt(byte); return value; } *i64(): Generator<void, bigint, void> { const value = yield* this.u(8); return (value & (1n << 63n)) === 0n ? value : value - (1n << 64n); } done(label: string): void { if (this.remaining) fail(label + " bounded body remainder"); } }
20
+ class IncrementalNestedBoundedReader implements IncrementalInput { offset = 0; constructor(private readonly parent: IncrementalInput, public remaining: number) {} private check(length: number): void { if (!Number.isSafeInteger(length) || length < 0 || length > this.remaining) fail("bounded service-wire value overflow"); } private consumed(length: number): void { this.remaining -= length; this.offset += length; } *take(length: number): Generator<void, Uint8Array, void> { this.check(length); const value = yield* this.parent.take(length); this.consumed(length); return value; } *bytes(length: number): Generator<void, Uint8Array, void> { this.check(length); const value = yield* this.parent.bytes(length); this.consumed(length); return value; } *text(length: number, forbidNul: boolean, label: string): Generator<void, string, void> { this.check(length); const value = yield* this.parent.text(length, forbidNul, label); this.consumed(length); return value; } bounded(length: number): IncrementalInput { this.check(length); return new IncrementalNestedBoundedReader(this, length); } *u(width: number): Generator<void, bigint, void> { let value = 0n; for (const byte of yield* this.take(width)) value = (value << 8n) | BigInt(byte); return value; } *i64(): Generator<void, bigint, void> { const value = yield* this.u(8); return (value & (1n << 63n)) === 0n ? value : value - (1n << 64n); } done(label: string): void { if (this.remaining) fail(label + " bounded body remainder"); } }
17
21
  class Writer { readonly chunks: Uint8Array[] = []; length = 0; put(bytes: Iterable<number>): void { const chunk = bytes instanceof Uint8Array ? bytes : Uint8Array.from(bytes); if (!chunk.length) return; this.chunks.push(chunk); this.length += chunk.length; } u(value: bigint, width: number): void { const bytes = new Uint8Array(width); for (let index = width - 1; index >= 0; --index) { bytes[index] = Number(value & 255n); value >>= 8n; } this.put(bytes); } i64(value: bigint): void { this.u(BigInt.asUintN(64, value), 8); } result(): Uint8Array { if (!this.chunks.length) return new Uint8Array(); if (this.chunks.length === 1) return this.chunks[0]; const result = new Uint8Array(this.length); let offset = 0; for (const chunk of this.chunks) { result.set(chunk, offset); offset += chunk.length; } return result; } }
18
22
  function compareBytes(left: Uint8Array, right: Uint8Array): number { const count = Math.min(left.length, right.length); for (let index = 0; index < count; ++index) if (left[index] !== right[index]) return left[index] < right[index] ? -1 : 1; return left.length === right.length ? 0 : left.length < right.length ? -1 : 1; }
19
23
  function compareBigint(left: bigint, right: bigint): number { return left < right ? -1 : left > right ? 1 : 0; }
@@ -27,6 +31,10 @@ function readU8(reader: Reader, context: ServiceWireDecoderContext, enclosing: a
27
31
  void context; void enclosing; void flags;
28
32
  const raw = reader.u(1); if (raw < 0n || raw > 255n) fail("u8 range"); return Number(raw);
29
33
  }
34
+ function* readIncrementalU8(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, U8, void> {
35
+ void context; void enclosing; void flags;
36
+ const raw = yield* reader.u(1); if (raw < 0n || raw > 255n) fail("u8 range"); return Number(raw);
37
+ }
30
38
  function writeU8(input: U8, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
31
39
  void context; void enclosing; void flags; const value: any = input;
32
40
  const raw = numeric(value); if (raw < 0n || raw > 255n) fail("u8 range"); writer.u(raw, 1);
@@ -40,6 +48,10 @@ function readU16(reader: Reader, context: ServiceWireDecoderContext, enclosing:
40
48
  void context; void enclosing; void flags;
41
49
  const raw = reader.u(2); if (raw < 0n || raw > 65535n) fail("u16 range"); return Number(raw);
42
50
  }
51
+ function* readIncrementalU16(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, U16, void> {
52
+ void context; void enclosing; void flags;
53
+ const raw = yield* reader.u(2); if (raw < 0n || raw > 65535n) fail("u16 range"); return Number(raw);
54
+ }
43
55
  function writeU16(input: U16, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
44
56
  void context; void enclosing; void flags; const value: any = input;
45
57
  const raw = numeric(value); if (raw < 0n || raw > 65535n) fail("u16 range"); writer.u(raw, 2);
@@ -53,6 +65,10 @@ function readU32(reader: Reader, context: ServiceWireDecoderContext, enclosing:
53
65
  void context; void enclosing; void flags;
54
66
  const raw = reader.u(4); if (raw < 0n || raw > 4294967295n) fail("u32 range"); return Number(raw);
55
67
  }
68
+ function* readIncrementalU32(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, U32, void> {
69
+ void context; void enclosing; void flags;
70
+ const raw = yield* reader.u(4); if (raw < 0n || raw > 4294967295n) fail("u32 range"); return Number(raw);
71
+ }
56
72
  function writeU32(input: U32, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
57
73
  void context; void enclosing; void flags; const value: any = input;
58
74
  const raw = numeric(value); if (raw < 0n || raw > 4294967295n) fail("u32 range"); writer.u(raw, 4);
@@ -66,6 +82,7 @@ function readNonzeroU32(reader: Reader, context: ServiceWireDecoderContext, encl
66
82
  void context; void enclosing; void flags;
67
83
  const raw = reader.u(4); if (raw < 1n || raw > 4294967295n) fail("nonzero-u32 range"); return Number(raw);
68
84
  }
85
+
69
86
  function writeNonzeroU32(input: NonzeroU32, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
70
87
  void context; void enclosing; void flags; const value: any = input;
71
88
  const raw = numeric(value); if (raw < 1n || raw > 4294967295n) fail("nonzero-u32 range"); writer.u(raw, 4);
@@ -79,6 +96,10 @@ function readU64(reader: Reader, context: ServiceWireDecoderContext, enclosing:
79
96
  void context; void enclosing; void flags;
80
97
  const raw = reader.u(8); if (raw < 0n || raw > 18446744073709551615n) fail("u64 range"); return raw;
81
98
  }
99
+ function* readIncrementalU64(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, U64, void> {
100
+ void context; void enclosing; void flags;
101
+ const raw = yield* reader.u(8); if (raw < 0n || raw > 18446744073709551615n) fail("u64 range"); return raw;
102
+ }
82
103
  function writeU64(input: U64, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
83
104
  void context; void enclosing; void flags; const value: any = input;
84
105
  const raw = numeric(value); if (raw < 0n || raw > 18446744073709551615n) fail("u64 range"); writer.u(raw, 8);
@@ -92,6 +113,10 @@ function readNonzeroU64(reader: Reader, context: ServiceWireDecoderContext, encl
92
113
  void context; void enclosing; void flags;
93
114
  const raw = reader.u(8); if (raw < 1n || raw > 9223372036854775807n) fail("nonzero-u64 range"); return raw;
94
115
  }
116
+ function* readIncrementalNonzeroU64(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, NonzeroU64, void> {
117
+ void context; void enclosing; void flags;
118
+ const raw = yield* reader.u(8); if (raw < 1n || raw > 9223372036854775807n) fail("nonzero-u64 range"); return raw;
119
+ }
95
120
  function writeNonzeroU64(input: NonzeroU64, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
96
121
  void context; void enclosing; void flags; const value: any = input;
97
122
  const raw = numeric(value); if (raw < 1n || raw > 9223372036854775807n) fail("nonzero-u64 range"); writer.u(raw, 8);
@@ -105,6 +130,10 @@ function readOrdinalOrZero(reader: Reader, context: ServiceWireDecoderContext, e
105
130
  void context; void enclosing; void flags;
106
131
  const raw = reader.u(8); if (raw < 0n || raw > 9223372036854775807n) fail("ordinal-or-zero range"); return raw;
107
132
  }
133
+ function* readIncrementalOrdinalOrZero(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, OrdinalOrZero, void> {
134
+ void context; void enclosing; void flags;
135
+ const raw = yield* reader.u(8); if (raw < 0n || raw > 9223372036854775807n) fail("ordinal-or-zero range"); return raw;
136
+ }
108
137
  function writeOrdinalOrZero(input: OrdinalOrZero, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
109
138
  void context; void enclosing; void flags; const value: any = input;
110
139
  const raw = numeric(value); if (raw < 0n || raw > 9223372036854775807n) fail("ordinal-or-zero range"); writer.u(raw, 8);
@@ -118,6 +147,7 @@ function readRelocationLogicalLength(reader: Reader, context: ServiceWireDecoder
118
147
  void context; void enclosing; void flags;
119
148
  const raw = reader.u(8); if (raw < 0n || raw > 274877906944n) fail("relocation-logical-length range"); return raw;
120
149
  }
150
+
121
151
  function writeRelocationLogicalLength(input: RelocationLogicalLength, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
122
152
  void context; void enclosing; void flags; const value: any = input;
123
153
  const raw = numeric(value); if (raw < 0n || raw > 274877906944n) fail("relocation-logical-length range"); writer.u(raw, 8);
@@ -131,6 +161,7 @@ function readRelocationChunkCount(reader: Reader, context: ServiceWireDecoderCon
131
161
  void context; void enclosing; void flags;
132
162
  const raw = reader.u(4); if (raw < 0n || raw > 4096n) fail("relocation-chunk-count range"); return Number(raw);
133
163
  }
164
+
134
165
  function writeRelocationChunkCount(input: RelocationChunkCount, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
135
166
  void context; void enclosing; void flags; const value: any = input;
136
167
  const raw = numeric(value); if (raw < 0n || raw > 4096n) fail("relocation-chunk-count range"); writer.u(raw, 4);
@@ -144,6 +175,10 @@ function readApplicationVersion(reader: Reader, context: ServiceWireDecoderConte
144
175
  void context; void enclosing; void flags;
145
176
  const raw = reader.i64(); if (raw < 0n || raw > 9223372036854775807n) fail("application-version range"); return raw;
146
177
  }
178
+ function* readIncrementalApplicationVersion(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ApplicationVersion, void> {
179
+ void context; void enclosing; void flags;
180
+ const raw = yield* reader.i64(); if (raw < 0n || raw > 9223372036854775807n) fail("application-version range"); return raw;
181
+ }
147
182
  function writeApplicationVersion(input: ApplicationVersion, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
148
183
  void context; void enclosing; void flags; const value: any = input;
149
184
  const raw = numeric(value); if (raw < 0n || raw > 9223372036854775807n) fail("application-version range"); writer.i64(raw);
@@ -164,6 +199,14 @@ function readBool8(reader: Reader, context: ServiceWireDecoderContext, enclosing
164
199
  default: fail("bool8 enum");
165
200
  }
166
201
  }
202
+ function* readIncrementalBool8(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, Bool8, void> {
203
+ void context; void enclosing; void flags;
204
+ const raw = yield* reader.u(1); switch (Number(raw)) {
205
+ case 0: return "false";
206
+ case 1: return "true";
207
+ default: fail("bool8 enum");
208
+ }
209
+ }
167
210
  function writeBool8(input: Bool8, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
168
211
  void context; void enclosing; void flags; const value: any = input;
169
212
  writer.u(numeric(enumWireBool8(value)), 1);
@@ -175,11 +218,15 @@ export type Rid = Uint8Array;
175
218
 
176
219
  function readRid(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): Rid {
177
220
  void context; void enclosing; void flags;
178
- const length = Number(readU8(reader, context, enclosing, flags)); if (length > 255) fail("rid length"); if (length > 2147483647) capacityFail("rid capacity"); if (length < 1) fail("rid length"); return reader.take(length);
221
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("rid capacity"); if (length > 255) fail("rid length"); if (length < 1) fail("rid length"); return reader.take(length);
222
+ }
223
+ function* readIncrementalRid(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, Rid, void> {
224
+ void context; void enclosing; void flags;
225
+ const length = Number(yield* readIncrementalU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("rid capacity"); if (length > 255) fail("rid length"); if (length < 1) fail("rid length"); return yield* reader.bytes(length);
179
226
  }
180
227
  function writeRid(input: Rid, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
181
228
  void context; void enclosing; void flags; const value: any = input;
182
- const bytes = value as Uint8Array; if (bytes.length > 255) fail("rid length"); if (bytes.length > 2147483647) capacityFail("rid capacity"); if (bytes.length < 1) fail("rid length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
229
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("rid capacity"); if (bytes.length > 255) fail("rid length"); if (bytes.length < 1) fail("rid length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
183
230
  }
184
231
  export function decodeRid(bytes: Uint8Array, context: ServiceWireDecoderContext): Rid { const reader = new Reader(bytes); const value = readRid(reader, context, {}, 0); reader.done("rid"); return value; }
185
232
  export function encodeRid(value: Rid, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeRid(value, writer, context, {}, 0); return writer.result(); }
@@ -188,11 +235,12 @@ export type OptionalRid = Uint8Array | null;
188
235
 
189
236
  function readOptionalRid(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): OptionalRid {
190
237
  void context; void enclosing; void flags;
191
- const length = Number(readU8(reader, context, enclosing, flags)); if (length === 0) return null; if (length > 255) fail("optional-rid length"); if (length > 2147483647) capacityFail("optional-rid capacity"); if (length < 0) fail("optional-rid length"); return reader.take(length);
238
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length === 0) return null; if (length > 2147483647) capacityFail("optional-rid capacity"); if (length > 255) fail("optional-rid length"); if (length < 0) fail("optional-rid length"); return reader.take(length);
192
239
  }
240
+
193
241
  function writeOptionalRid(input: OptionalRid, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
194
242
  void context; void enclosing; void flags; const value: any = input;
195
- if (value === null) { writeU8(0, writer, context, enclosing, flags); return; } const bytes = value as Uint8Array; if (bytes.length > 255) fail("optional-rid length"); if (bytes.length > 2147483647) capacityFail("optional-rid capacity"); if (bytes.length < 0) fail("optional-rid length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
243
+ if (value === null) { writeU8(0, writer, context, enclosing, flags); return; } const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("optional-rid capacity"); if (bytes.length > 255) fail("optional-rid length"); if (bytes.length < 0) fail("optional-rid length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
196
244
  }
197
245
  export function decodeOptionalRid(bytes: Uint8Array, context: ServiceWireDecoderContext): OptionalRid { const reader = new Reader(bytes); const value = readOptionalRid(reader, context, {}, 0); reader.done("optional-rid"); return value; }
198
246
  export function encodeOptionalRid(value: OptionalRid, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeOptionalRid(value, writer, context, {}, 0); return writer.result(); }
@@ -201,11 +249,15 @@ export type Text8 = string;
201
249
 
202
250
  function readText8(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): Text8 {
203
251
  void context; void enclosing; void flags;
204
- const length = Number(readU8(reader, context, enclosing, flags)); if (length > 255) fail("text8 length"); if (length > 2147483647) capacityFail("text8 capacity"); if (length < 1) fail("text8 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("text8 NUL"); return decodeUtf8(bytes, "text8");
252
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("text8 capacity"); if (length > 255) fail("text8 length"); if (length < 1) fail("text8 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("text8 NUL"); return decodeUtf8(bytes, "text8");
253
+ }
254
+ function* readIncrementalText8(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, Text8, void> {
255
+ void context; void enclosing; void flags;
256
+ const length = Number(yield* readIncrementalU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("text8 capacity"); if (length > 255) fail("text8 length"); if (length < 1) fail("text8 length"); return yield* reader.text(length, true, "text8");
205
257
  }
206
258
  function writeText8(input: Text8, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
207
259
  void context; void enclosing; void flags; const value: any = input;
208
- const bytes = utf8(value); if (bytes.includes(0)) fail("text8 NUL"); if (bytes.length > 255) fail("text8 length"); if (bytes.length > 2147483647) capacityFail("text8 capacity"); if (bytes.length < 1) fail("text8 length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
260
+ const bytes = utf8(value); if (bytes.includes(0)) fail("text8 NUL"); if (bytes.length > 2147483647) capacityFail("text8 capacity"); if (bytes.length > 255) fail("text8 length"); if (bytes.length < 1) fail("text8 length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
209
261
  }
210
262
  export function decodeText8(bytes: Uint8Array, context: ServiceWireDecoderContext): Text8 { const reader = new Reader(bytes); const value = readText8(reader, context, {}, 0); reader.done("text8"); return value; }
211
263
  export function encodeText8(value: Text8, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeText8(value, writer, context, {}, 0); return writer.result(); }
@@ -214,11 +266,12 @@ export type OptionalText8 = string | null;
214
266
 
215
267
  function readOptionalText8(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): OptionalText8 {
216
268
  void context; void enclosing; void flags;
217
- const length = Number(readU8(reader, context, enclosing, flags)); if (length === 0) return null; if (length > 255) fail("optional-text8 length"); if (length > 2147483647) capacityFail("optional-text8 capacity"); if (length < 0) fail("optional-text8 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("optional-text8 NUL"); return decodeUtf8(bytes, "optional-text8");
269
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length === 0) return null; if (length > 2147483647) capacityFail("optional-text8 capacity"); if (length > 255) fail("optional-text8 length"); if (length < 0) fail("optional-text8 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("optional-text8 NUL"); return decodeUtf8(bytes, "optional-text8");
218
270
  }
271
+
219
272
  function writeOptionalText8(input: OptionalText8, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
220
273
  void context; void enclosing; void flags; const value: any = input;
221
- if (value === null) { writeU8(0, writer, context, enclosing, flags); return; } const bytes = utf8(value); if (bytes.includes(0)) fail("optional-text8 NUL"); if (bytes.length > 255) fail("optional-text8 length"); if (bytes.length > 2147483647) capacityFail("optional-text8 capacity"); if (bytes.length < 0) fail("optional-text8 length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
274
+ if (value === null) { writeU8(0, writer, context, enclosing, flags); return; } const bytes = utf8(value); if (bytes.includes(0)) fail("optional-text8 NUL"); if (bytes.length > 2147483647) capacityFail("optional-text8 capacity"); if (bytes.length > 255) fail("optional-text8 length"); if (bytes.length < 0) fail("optional-text8 length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
222
275
  }
223
276
  export function decodeOptionalText8(bytes: Uint8Array, context: ServiceWireDecoderContext): OptionalText8 { const reader = new Reader(bytes); const value = readOptionalText8(reader, context, {}, 0); reader.done("optional-text8"); return value; }
224
277
  export function encodeOptionalText8(value: OptionalText8, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeOptionalText8(value, writer, context, {}, 0); return writer.result(); }
@@ -227,11 +280,12 @@ export type Sha256Bytes = Uint8Array;
227
280
 
228
281
  function readSha256Bytes(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): Sha256Bytes {
229
282
  void context; void enclosing; void flags;
230
- const length = Number(readU8(reader, context, enclosing, flags)); if (length > 32) fail("sha256-bytes length"); if (length > 2147483647) capacityFail("sha256-bytes capacity"); if (length < 32) fail("sha256-bytes length"); return reader.take(length);
283
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("sha256-bytes capacity"); if (length > 32) fail("sha256-bytes length"); if (length < 32) fail("sha256-bytes length"); return reader.take(length);
231
284
  }
285
+
232
286
  function writeSha256Bytes(input: Sha256Bytes, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
233
287
  void context; void enclosing; void flags; const value: any = input;
234
- const bytes = value as Uint8Array; if (bytes.length > 32) fail("sha256-bytes length"); if (bytes.length > 2147483647) capacityFail("sha256-bytes capacity"); if (bytes.length < 32) fail("sha256-bytes length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
288
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("sha256-bytes capacity"); if (bytes.length > 32) fail("sha256-bytes length"); if (bytes.length < 32) fail("sha256-bytes length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
235
289
  }
236
290
  export function decodeSha256Bytes(bytes: Uint8Array, context: ServiceWireDecoderContext): Sha256Bytes { const reader = new Reader(bytes); const value = readSha256Bytes(reader, context, {}, 0); reader.done("sha256-bytes"); return value; }
237
291
  export function encodeSha256Bytes(value: Sha256Bytes, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeSha256Bytes(value, writer, context, {}, 0); return writer.result(); }
@@ -242,6 +296,7 @@ function readCreationRequestSize(reader: Reader, context: ServiceWireDecoderCont
242
296
  void context; void enclosing; void flags;
243
297
  const raw = reader.u(4); if (raw < 0n || raw > 1048576n) fail("creation-request-size range"); return Number(raw);
244
298
  }
299
+
245
300
  function writeCreationRequestSize(input: CreationRequestSize, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
246
301
  void context; void enclosing; void flags; const value: any = input;
247
302
  const raw = numeric(value); if (raw < 0n || raw > 1048576n) fail("creation-request-size range"); writer.u(raw, 4);
@@ -253,11 +308,12 @@ export type Text16 = string;
253
308
 
254
309
  function readText16(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): Text16 {
255
310
  void context; void enclosing; void flags;
256
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 65535) fail("text16 length"); if (length > 2147483647) capacityFail("text16 capacity"); if (length < 0) fail("text16 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("text16 NUL"); return decodeUtf8(bytes, "text16");
311
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("text16 capacity"); if (length > 65535) fail("text16 length"); if (length < 0) fail("text16 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("text16 NUL"); return decodeUtf8(bytes, "text16");
257
312
  }
313
+
258
314
  function writeText16(input: Text16, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
259
315
  void context; void enclosing; void flags; const value: any = input;
260
- const bytes = utf8(value); if (bytes.includes(0)) fail("text16 NUL"); if (bytes.length > 65535) fail("text16 length"); if (bytes.length > 2147483647) capacityFail("text16 capacity"); if (bytes.length < 0) fail("text16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
316
+ const bytes = utf8(value); if (bytes.includes(0)) fail("text16 NUL"); if (bytes.length > 2147483647) capacityFail("text16 capacity"); if (bytes.length > 65535) fail("text16 length"); if (bytes.length < 0) fail("text16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
261
317
  }
262
318
  export function decodeText16(bytes: Uint8Array, context: ServiceWireDecoderContext): Text16 { const reader = new Reader(bytes); const value = readText16(reader, context, {}, 0); reader.done("text16"); return value; }
263
319
  export function encodeText16(value: Text16, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeText16(value, writer, context, {}, 0); return writer.result(); }
@@ -266,11 +322,12 @@ export type NonemptyText16 = string;
266
322
 
267
323
  function readNonemptyText16(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): NonemptyText16 {
268
324
  void context; void enclosing; void flags;
269
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 65535) fail("nonempty-text16 length"); if (length > 2147483647) capacityFail("nonempty-text16 capacity"); if (length < 1) fail("nonempty-text16 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("nonempty-text16 NUL"); return decodeUtf8(bytes, "nonempty-text16");
325
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("nonempty-text16 capacity"); if (length > 65535) fail("nonempty-text16 length"); if (length < 1) fail("nonempty-text16 length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("nonempty-text16 NUL"); return decodeUtf8(bytes, "nonempty-text16");
270
326
  }
327
+
271
328
  function writeNonemptyText16(input: NonemptyText16, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
272
329
  void context; void enclosing; void flags; const value: any = input;
273
- const bytes = utf8(value); if (bytes.includes(0)) fail("nonempty-text16 NUL"); if (bytes.length > 65535) fail("nonempty-text16 length"); if (bytes.length > 2147483647) capacityFail("nonempty-text16 capacity"); if (bytes.length < 1) fail("nonempty-text16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
330
+ const bytes = utf8(value); if (bytes.includes(0)) fail("nonempty-text16 NUL"); if (bytes.length > 2147483647) capacityFail("nonempty-text16 capacity"); if (bytes.length > 65535) fail("nonempty-text16 length"); if (bytes.length < 1) fail("nonempty-text16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
274
331
  }
275
332
  export function decodeNonemptyText16(bytes: Uint8Array, context: ServiceWireDecoderContext): NonemptyText16 { const reader = new Reader(bytes); const value = readNonemptyText16(reader, context, {}, 0); reader.done("nonempty-text16"); return value; }
276
333
  export function encodeNonemptyText16(value: NonemptyText16, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeNonemptyText16(value, writer, context, {}, 0); return writer.result(); }
@@ -279,11 +336,12 @@ export type Endpoint = string;
279
336
 
280
337
  function readEndpoint(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): Endpoint {
281
338
  void context; void enclosing; void flags;
282
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 4096) fail("endpoint length"); if (length > 2147483647) capacityFail("endpoint capacity"); if (length < 1) fail("endpoint length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("endpoint NUL"); return decodeUtf8(bytes, "endpoint");
339
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("endpoint capacity"); if (length > 4096) fail("endpoint length"); if (length < 1) fail("endpoint length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("endpoint NUL"); return decodeUtf8(bytes, "endpoint");
283
340
  }
341
+
284
342
  function writeEndpoint(input: Endpoint, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
285
343
  void context; void enclosing; void flags; const value: any = input;
286
- const bytes = utf8(value); if (bytes.includes(0)) fail("endpoint NUL"); if (bytes.length > 4096) fail("endpoint length"); if (bytes.length > 2147483647) capacityFail("endpoint capacity"); if (bytes.length < 1) fail("endpoint length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
344
+ const bytes = utf8(value); if (bytes.includes(0)) fail("endpoint NUL"); if (bytes.length > 2147483647) capacityFail("endpoint capacity"); if (bytes.length > 4096) fail("endpoint length"); if (bytes.length < 1) fail("endpoint length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
287
345
  }
288
346
  export function decodeEndpoint(bytes: Uint8Array, context: ServiceWireDecoderContext): Endpoint { const reader = new Reader(bytes); const value = readEndpoint(reader, context, {}, 0); reader.done("endpoint"); return value; }
289
347
  export function encodeEndpoint(value: Endpoint, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeEndpoint(value, writer, context, {}, 0); return writer.result(); }
@@ -292,11 +350,12 @@ export type Blob16 = Uint8Array;
292
350
 
293
351
  function readBlob16(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): Blob16 {
294
352
  void context; void enclosing; void flags;
295
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 65535) fail("blob16 length"); if (length > 2147483647) capacityFail("blob16 capacity"); if (length < 0) fail("blob16 length"); return reader.take(length);
353
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("blob16 capacity"); if (length > 65535) fail("blob16 length"); if (length < 0) fail("blob16 length"); return reader.take(length);
296
354
  }
355
+
297
356
  function writeBlob16(input: Blob16, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
298
357
  void context; void enclosing; void flags; const value: any = input;
299
- const bytes = value as Uint8Array; if (bytes.length > 65535) fail("blob16 length"); if (bytes.length > 2147483647) capacityFail("blob16 capacity"); if (bytes.length < 0) fail("blob16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
358
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("blob16 capacity"); if (bytes.length > 65535) fail("blob16 length"); if (bytes.length < 0) fail("blob16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
300
359
  }
301
360
  export function decodeBlob16(bytes: Uint8Array, context: ServiceWireDecoderContext): Blob16 { const reader = new Reader(bytes); const value = readBlob16(reader, context, {}, 0); reader.done("blob16"); return value; }
302
361
  export function encodeBlob16(value: Blob16, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeBlob16(value, writer, context, {}, 0); return writer.result(); }
@@ -305,11 +364,12 @@ export type NonemptyBlob16 = Uint8Array;
305
364
 
306
365
  function readNonemptyBlob16(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): NonemptyBlob16 {
307
366
  void context; void enclosing; void flags;
308
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 65535) fail("nonempty-blob16 length"); if (length > 2147483647) capacityFail("nonempty-blob16 capacity"); if (length < 1) fail("nonempty-blob16 length"); return reader.take(length);
367
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("nonempty-blob16 capacity"); if (length > 65535) fail("nonempty-blob16 length"); if (length < 1) fail("nonempty-blob16 length"); return reader.take(length);
309
368
  }
369
+
310
370
  function writeNonemptyBlob16(input: NonemptyBlob16, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
311
371
  void context; void enclosing; void flags; const value: any = input;
312
- const bytes = value as Uint8Array; if (bytes.length > 65535) fail("nonempty-blob16 length"); if (bytes.length > 2147483647) capacityFail("nonempty-blob16 capacity"); if (bytes.length < 1) fail("nonempty-blob16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
372
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("nonempty-blob16 capacity"); if (bytes.length > 65535) fail("nonempty-blob16 length"); if (bytes.length < 1) fail("nonempty-blob16 length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
313
373
  }
314
374
  export function decodeNonemptyBlob16(bytes: Uint8Array, context: ServiceWireDecoderContext): NonemptyBlob16 { const reader = new Reader(bytes); const value = readNonemptyBlob16(reader, context, {}, 0); reader.done("nonempty-blob16"); return value; }
315
375
  export function encodeNonemptyBlob16(value: NonemptyBlob16, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeNonemptyBlob16(value, writer, context, {}, 0); return writer.result(); }
@@ -318,11 +378,15 @@ export type PacketName = string;
318
378
 
319
379
  function readPacketName(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): PacketName {
320
380
  void context; void enclosing; void flags;
321
- const length = Number(readU8(reader, context, enclosing, flags)); if (length > 255) fail("packet-name length"); if (length > 2147483647) capacityFail("packet-name capacity"); if (length < 1) fail("packet-name length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("packet-name NUL"); return decodeUtf8(bytes, "packet-name");
381
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("packet-name capacity"); if (length > 255) fail("packet-name length"); if (length < 1) fail("packet-name length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("packet-name NUL"); return decodeUtf8(bytes, "packet-name");
382
+ }
383
+ function* readIncrementalPacketName(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, PacketName, void> {
384
+ void context; void enclosing; void flags;
385
+ const length = Number(yield* readIncrementalU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("packet-name capacity"); if (length > 255) fail("packet-name length"); if (length < 1) fail("packet-name length"); return yield* reader.text(length, true, "packet-name");
322
386
  }
323
387
  function writePacketName(input: PacketName, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
324
388
  void context; void enclosing; void flags; const value: any = input;
325
- const bytes = utf8(value); if (bytes.includes(0)) fail("packet-name NUL"); if (bytes.length > 255) fail("packet-name length"); if (bytes.length > 2147483647) capacityFail("packet-name capacity"); if (bytes.length < 1) fail("packet-name length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
389
+ const bytes = utf8(value); if (bytes.includes(0)) fail("packet-name NUL"); if (bytes.length > 2147483647) capacityFail("packet-name capacity"); if (bytes.length > 255) fail("packet-name length"); if (bytes.length < 1) fail("packet-name length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
326
390
  }
327
391
  export function decodePacketName(bytes: Uint8Array, context: ServiceWireDecoderContext): PacketName { const reader = new Reader(bytes); const value = readPacketName(reader, context, {}, 0); reader.done("packet-name"); return value; }
328
392
  export function encodePacketName(value: PacketName, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writePacketName(value, writer, context, {}, 0); return writer.result(); }
@@ -331,11 +395,15 @@ export type ContentType = string;
331
395
 
332
396
  function readContentType(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): ContentType {
333
397
  void context; void enclosing; void flags;
334
- const length = Number(readU8(reader, context, enclosing, flags)); if (length > 255) fail("content-type length"); if (length > 2147483647) capacityFail("content-type capacity"); if (length < 1) fail("content-type length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("content-type NUL"); return decodeUtf8(bytes, "content-type");
398
+ const length = Number(readU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("content-type capacity"); if (length > 255) fail("content-type length"); if (length < 1) fail("content-type length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("content-type NUL"); return decodeUtf8(bytes, "content-type");
399
+ }
400
+ function* readIncrementalContentType(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ContentType, void> {
401
+ void context; void enclosing; void flags;
402
+ const length = Number(yield* readIncrementalU8(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("content-type capacity"); if (length > 255) fail("content-type length"); if (length < 1) fail("content-type length"); return yield* reader.text(length, true, "content-type");
335
403
  }
336
404
  function writeContentType(input: ContentType, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
337
405
  void context; void enclosing; void flags; const value: any = input;
338
- const bytes = utf8(value); if (bytes.includes(0)) fail("content-type NUL"); if (bytes.length > 255) fail("content-type length"); if (bytes.length > 2147483647) capacityFail("content-type capacity"); if (bytes.length < 1) fail("content-type length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
406
+ const bytes = utf8(value); if (bytes.includes(0)) fail("content-type NUL"); if (bytes.length > 2147483647) capacityFail("content-type capacity"); if (bytes.length > 255) fail("content-type length"); if (bytes.length < 1) fail("content-type length"); writeU8(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
339
407
  }
340
408
  export function decodeContentType(bytes: Uint8Array, context: ServiceWireDecoderContext): ContentType { const reader = new Reader(bytes); const value = readContentType(reader, context, {}, 0); reader.done("content-type"); return value; }
341
409
  export function encodeContentType(value: ContentType, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeContentType(value, writer, context, {}, 0); return writer.result(); }
@@ -344,11 +412,15 @@ export type ApplicationPayloadBytes = Uint8Array;
344
412
 
345
413
  function readApplicationPayloadBytes(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): ApplicationPayloadBytes {
346
414
  void context; void enclosing; void flags;
347
- const length = Number(readU32(reader, context, enclosing, flags)); if (length > 4294966774) fail("application-payload-bytes length"); if (length > 2147483647) capacityFail("application-payload-bytes capacity"); if (length < 0) fail("application-payload-bytes length"); const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytesMinusActualEnvelopeOverhead")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294966774n || BigInt(length) > negotiatedMaximum) fail("application-payload-bytes negotiated maximum"); return reader.take(length);
415
+ const length = Number(readU32(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("application-payload-bytes capacity"); if (length > 4294966774) fail("application-payload-bytes length"); if (length < 0) fail("application-payload-bytes length"); const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytesMinusActualEnvelopeOverhead")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294966774n || BigInt(length) > negotiatedMaximum) fail("application-payload-bytes negotiated maximum"); return reader.take(length);
416
+ }
417
+ function* readIncrementalApplicationPayloadBytes(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ApplicationPayloadBytes, void> {
418
+ void context; void enclosing; void flags;
419
+ const length = Number(yield* readIncrementalU32(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("application-payload-bytes capacity"); if (length > 4294966774) fail("application-payload-bytes length"); if (length < 0) fail("application-payload-bytes length"); const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytesMinusActualEnvelopeOverhead")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294966774n || BigInt(length) > negotiatedMaximum) fail("application-payload-bytes negotiated maximum"); return yield* reader.bytes(length);
348
420
  }
349
421
  function writeApplicationPayloadBytes(input: ApplicationPayloadBytes, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
350
422
  void context; void enclosing; void flags; const value: any = input;
351
- const bytes = value as Uint8Array; if (bytes.length > 4294966774) fail("application-payload-bytes length"); if (bytes.length > 2147483647) capacityFail("application-payload-bytes capacity"); if (bytes.length < 0) fail("application-payload-bytes length"); writeU32(bytes.length, writer, context, enclosing, flags); writer.put(bytes); const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytesMinusActualEnvelopeOverhead")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294966774n || BigInt(bytes.length) > negotiatedMaximum) fail("application-payload-bytes negotiated maximum");
423
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("application-payload-bytes capacity"); if (bytes.length > 4294966774) fail("application-payload-bytes length"); if (bytes.length < 0) fail("application-payload-bytes length"); writeU32(bytes.length, writer, context, enclosing, flags); writer.put(bytes); const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytesMinusActualEnvelopeOverhead")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294966774n || BigInt(bytes.length) > negotiatedMaximum) fail("application-payload-bytes negotiated maximum");
352
424
  }
353
425
  export function decodeApplicationPayloadBytes(bytes: Uint8Array, context: ServiceWireDecoderContext): ApplicationPayloadBytes { const reader = new Reader(bytes); const value = readApplicationPayloadBytes(reader, context, {}, 0); reader.done("application-payload-bytes"); return value; }
354
426
  export function encodeApplicationPayloadBytes(value: ApplicationPayloadBytes, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeApplicationPayloadBytes(value, writer, context, {}, 0); return writer.result(); }
@@ -372,6 +444,28 @@ function readApplicationPayloadEnvelopeV1(reader: Reader, context: ServiceWireDe
372
444
  const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytes")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294967295n || BigInt(reader.offset - encodedStart) > negotiatedMaximum) fail("application-payload-envelope-v1 negotiated maximum");
373
445
 
374
446
 
447
+ return value;
448
+ })();
449
+ if (reader.offset - limitStart > 4294967295) fail("application-payload-envelope-v1 maximum");
450
+ return decoded;
451
+ }
452
+ function* readIncrementalApplicationPayloadEnvelopeV1(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ApplicationPayloadEnvelopeV1, void> {
453
+ void context; void enclosing; void flags;
454
+ const limitStart = reader.offset; const decoded = yield* (function* (): Generator<void, ApplicationPayloadEnvelopeV1, void> {
455
+ const encodedStart = reader.offset; const version = yield* readIncrementalU8(reader, context, enclosing, flags); if (!same(version, 1)) fail("application-payload-envelope-v1 version"); const length = Number(yield* readIncrementalU32(reader, context, enclosing, flags)); const body = reader.bounded(length); const value: any = {};
456
+ value["packetName"] = yield* readIncrementalPacketName(body, context, value, flags);
457
+
458
+
459
+ value["contentType"] = yield* readIncrementalContentType(body, context, value, flags);
460
+
461
+
462
+ value["payload"] = yield* readIncrementalApplicationPayloadBytes(body, context, value, flags);
463
+
464
+
465
+ body.done("application-payload-envelope-v1");
466
+ const negotiatedMaximum = numeric(requireContext(context, "effectiveCompleteMessageBytes")); if (negotiatedMaximum < 0n || negotiatedMaximum > 4294967295n || BigInt(reader.offset - encodedStart) > negotiatedMaximum) fail("application-payload-envelope-v1 negotiated maximum");
467
+
468
+
375
469
  return value;
376
470
  })();
377
471
  if (reader.offset - limitStart > 4294967295) fail("application-payload-envelope-v1 maximum");
@@ -407,11 +501,15 @@ export type MetadataValue = string;
407
501
 
408
502
  function readMetadataValue(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): MetadataValue {
409
503
  void context; void enclosing; void flags;
410
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 1024) fail("metadata-value length"); if (length > 2147483647) capacityFail("metadata-value capacity"); if (length < 0) fail("metadata-value length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("metadata-value NUL"); return decodeUtf8(bytes, "metadata-value");
504
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("metadata-value capacity"); if (length > 1024) fail("metadata-value length"); if (length < 0) fail("metadata-value length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("metadata-value NUL"); return decodeUtf8(bytes, "metadata-value");
505
+ }
506
+ function* readIncrementalMetadataValue(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, MetadataValue, void> {
507
+ void context; void enclosing; void flags;
508
+ const length = Number(yield* readIncrementalU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("metadata-value capacity"); if (length > 1024) fail("metadata-value length"); if (length < 0) fail("metadata-value length"); return yield* reader.text(length, true, "metadata-value");
411
509
  }
412
510
  function writeMetadataValue(input: MetadataValue, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
413
511
  void context; void enclosing; void flags; const value: any = input;
414
- const bytes = utf8(value); if (bytes.includes(0)) fail("metadata-value NUL"); if (bytes.length > 1024) fail("metadata-value length"); if (bytes.length > 2147483647) capacityFail("metadata-value capacity"); if (bytes.length < 0) fail("metadata-value length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
512
+ const bytes = utf8(value); if (bytes.includes(0)) fail("metadata-value NUL"); if (bytes.length > 2147483647) capacityFail("metadata-value capacity"); if (bytes.length > 1024) fail("metadata-value length"); if (bytes.length < 0) fail("metadata-value length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
415
513
  }
416
514
  export function decodeMetadataValue(bytes: Uint8Array, context: ServiceWireDecoderContext): MetadataValue { const reader = new Reader(bytes); const value = readMetadataValue(reader, context, {}, 0); reader.done("metadata-value"); return value; }
417
515
  export function encodeMetadataValue(value: MetadataValue, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeMetadataValue(value, writer, context, {}, 0); return writer.result(); }
@@ -429,6 +527,19 @@ function readMetadataEntry(reader: Reader, context: ServiceWireDecoderContext, e
429
527
 
430
528
 
431
529
 
530
+ return value;
531
+ }
532
+ function* readIncrementalMetadataEntry(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, MetadataEntry, void> {
533
+ void context; void enclosing; void flags;
534
+ const value: any = {};
535
+ value["key"] = yield* readIncrementalText8(reader, context, value, flags);
536
+
537
+
538
+ value["value"] = yield* readIncrementalMetadataValue(reader, context, value, flags);
539
+
540
+
541
+
542
+
432
543
  return value;
433
544
  }
434
545
  function writeMetadataEntry(input: MetadataEntry, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -456,7 +567,20 @@ function readMetadataFrame(reader: Reader, context: ServiceWireDecoderContext, e
456
567
  layout.version = readU8(reader, context, enclosing, flags); if (!same(layout.version, 1)) fail("metadata-frame constant");
457
568
  layout.count = readU8(reader, context, enclosing, flags);
458
569
  value.entries = Array.from({ length: Number(layout.count) }, () => readMetadataEntry(reader, context, enclosing, flags));
459
- for (let left = 0; left < value.entries.length; ++left) for (let right = left + 1; right < value.entries.length; ++right) if (compareResults([compareBytes(utf8(value.entries[left]["key"]), utf8(value.entries[right]["key"]))]) === 0) fail("metadata-frame unique");
570
+ try { for (let left = 0; left < value.entries.length; ++left) for (let right = left + 1; right < value.entries.length; ++right) if (compareResults([compareBytes(utf8(value.entries[left]["key"]), utf8(value.entries[right]["key"]))]) === 0) fail("metadata-frame unique"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("metadata-frame constraint capacity"); throw error; }
571
+ return value;
572
+ })();
573
+ if (reader.offset - limitStart > 1024) fail("metadata-frame maximum");
574
+ return decoded;
575
+ }
576
+ function* readIncrementalMetadataFrame(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, MetadataFrame, void> {
577
+ void context; void enclosing; void flags;
578
+ const limitStart = reader.offset; const decoded = yield* (function* (): Generator<void, MetadataFrame, void> {
579
+ const layout: any = {}; const value: any = {};
580
+ layout.version = yield* readIncrementalU8(reader, context, enclosing, flags); if (!same(layout.version, 1)) fail("metadata-frame constant");
581
+ layout.count = yield* readIncrementalU8(reader, context, enclosing, flags);
582
+ value.entries = []; for (let index = 0; index < Number(layout.count); ++index) { const item = yield* readIncrementalMetadataEntry(reader, context, enclosing, flags); try { value.entries.push(item); } catch { capacityFail("metadata-frame capacity"); } }
583
+ try { for (let left = 0; left < value.entries.length; ++left) for (let right = left + 1; right < value.entries.length; ++right) if (compareResults([compareBytes(utf8(value.entries[left]["key"]), utf8(value.entries[right]["key"]))]) === 0) fail("metadata-frame unique"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("metadata-frame constraint capacity"); throw error; }
460
584
  return value;
461
585
  })();
462
586
  if (reader.offset - limitStart > 1024) fail("metadata-frame maximum");
@@ -465,7 +589,7 @@ function readMetadataFrame(reader: Reader, context: ServiceWireDecoderContext, e
465
589
  function writeMetadataFrame(input: MetadataFrame, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
466
590
  void context; void enclosing; void flags; const value: any = input;
467
591
  const limitStart = writer.length;
468
- for (let left = 0; left < value.entries.length; ++left) for (let right = left + 1; right < value.entries.length; ++right) if (compareResults([compareBytes(utf8(value.entries[left]["key"]), utf8(value.entries[right]["key"]))]) === 0) fail("metadata-frame unique");
592
+ try { for (let left = 0; left < value.entries.length; ++left) for (let right = left + 1; right < value.entries.length; ++right) if (compareResults([compareBytes(utf8(value.entries[left]["key"]), utf8(value.entries[right]["key"]))]) === 0) fail("metadata-frame unique"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("metadata-frame constraint capacity"); throw error; }
469
593
  writeU8(1, writer, context, enclosing, flags);
470
594
  writeU8(value.entries.length, writer, context, enclosing, flags);
471
595
  for (const item of value.entries) writeMetadataEntry(item, writer, context, enclosing, flags);
@@ -493,6 +617,7 @@ function readRuntimeState(reader: Reader, context: ServiceWireDecoderContext, en
493
617
  default: fail("runtime-state enum");
494
618
  }
495
619
  }
620
+
496
621
  function writeRuntimeState(input: RuntimeState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
497
622
  void context; void enclosing; void flags; const value: any = input;
498
623
  writer.u(numeric(enumWireRuntimeState(value)), 1);
@@ -515,6 +640,15 @@ function readStatefulObjectKind(reader: Reader, context: ServiceWireDecoderConte
515
640
  default: fail("stateful-object-kind enum");
516
641
  }
517
642
  }
643
+ function* readIncrementalStatefulObjectKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, StatefulObjectKind, void> {
644
+ void context; void enclosing; void flags;
645
+ const raw = yield* reader.u(1); switch (Number(raw)) {
646
+ case 1: return "actor";
647
+ case 2: return "userSpot";
648
+ case 3: return "instanceSpot";
649
+ default: fail("stateful-object-kind enum");
650
+ }
651
+ }
518
652
  function writeStatefulObjectKind(input: StatefulObjectKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
519
653
  void context; void enclosing; void flags; const value: any = input;
520
654
  writer.u(numeric(enumWireStatefulObjectKind(value)), 1);
@@ -537,6 +671,7 @@ function readObjectRole(reader: Reader, context: ServiceWireDecoderContext, encl
537
671
  default: fail("object-role enum");
538
672
  }
539
673
  }
674
+
540
675
  function writeObjectRole(input: ObjectRole, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
541
676
  void context; void enclosing; void flags; const value: any = input;
542
677
  writer.u(numeric(enumWireObjectRole(value)), 1);
@@ -550,6 +685,7 @@ function readObjectCapacityLimit(reader: Reader, context: ServiceWireDecoderCont
550
685
  void context; void enclosing; void flags;
551
686
  const raw = reader.u(4); if (raw < 1n || raw > 2147483647n) fail("object-capacity-limit range"); return Number(raw);
552
687
  }
688
+
553
689
  function writeObjectCapacityLimit(input: ObjectCapacityLimit, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
554
690
  void context; void enclosing; void flags; const value: any = input;
555
691
  const raw = numeric(value); if (raw < 1n || raw > 2147483647n) fail("object-capacity-limit range"); writer.u(raw, 4);
@@ -563,6 +699,7 @@ function readObjectPendingCapacityLimit(reader: Reader, context: ServiceWireDeco
563
699
  void context; void enclosing; void flags;
564
700
  const raw = reader.u(4); if (raw < 0n || raw > 2147483647n) fail("object-pending-capacity-limit range"); return Number(raw);
565
701
  }
702
+
566
703
  function writeObjectPendingCapacityLimit(input: ObjectPendingCapacityLimit, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
567
704
  void context; void enclosing; void flags; const value: any = input;
568
705
  const raw = numeric(value); if (raw < 0n || raw > 2147483647n) fail("object-pending-capacity-limit range"); writer.u(raw, 4);
@@ -583,6 +720,7 @@ function readAuthorityObjectKind(reader: Reader, context: ServiceWireDecoderCont
583
720
  default: fail("authority-object-kind enum");
584
721
  }
585
722
  }
723
+
586
724
  function writeAuthorityObjectKind(input: AuthorityObjectKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
587
725
  void context; void enclosing; void flags; const value: any = input;
588
726
  writer.u(numeric(enumWireAuthorityObjectKind(value)), 1);
@@ -605,6 +743,7 @@ function readSpotKind(reader: Reader, context: ServiceWireDecoderContext, enclos
605
743
  default: fail("spot-kind enum");
606
744
  }
607
745
  }
746
+
608
747
  function writeSpotKind(input: SpotKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
609
748
  void context; void enclosing; void flags; const value: any = input;
610
749
  writer.u(numeric(enumWireSpotKind(value)), 1);
@@ -629,6 +768,7 @@ function readEntryUserSpotAuthorityState(reader: Reader, context: ServiceWireDec
629
768
  default: fail("entry-user-spot-authority-state enum");
630
769
  }
631
770
  }
771
+
632
772
  function writeEntryUserSpotAuthorityState(input: EntryUserSpotAuthorityState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
633
773
  void context; void enclosing; void flags; const value: any = input;
634
774
  writer.u(numeric(enumWireEntryUserSpotAuthorityState(value)), 1);
@@ -649,6 +789,7 @@ function readActorAuthorityState(reader: Reader, context: ServiceWireDecoderCont
649
789
  default: fail("actor-authority-state enum");
650
790
  }
651
791
  }
792
+
652
793
  function writeActorAuthorityState(input: ActorAuthorityState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
653
794
  void context; void enclosing; void flags; const value: any = input;
654
795
  writer.u(numeric(enumWireActorAuthorityState(value)), 1);
@@ -671,6 +812,7 @@ function readRelocationPolicyKind(reader: Reader, context: ServiceWireDecoderCon
671
812
  default: fail("relocation-policy-kind enum");
672
813
  }
673
814
  }
815
+
674
816
  function writeRelocationPolicyKind(input: RelocationPolicyKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
675
817
  void context; void enclosing; void flags; const value: any = input;
676
818
  writer.u(numeric(enumWireRelocationPolicyKind(value)), 1);
@@ -693,6 +835,15 @@ function readTimerOverrunPolicyKind(reader: Reader, context: ServiceWireDecoderC
693
835
  default: fail("timer-overrun-policy-kind enum");
694
836
  }
695
837
  }
838
+ function* readIncrementalTimerOverrunPolicyKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, TimerOverrunPolicyKind, void> {
839
+ void context; void enclosing; void flags;
840
+ const raw = yield* reader.u(1); switch (Number(raw)) {
841
+ case 1: return "skipLateTicks";
842
+ case 2: return "catchUpBounded";
843
+ case 3: return "delayNextTick";
844
+ default: fail("timer-overrun-policy-kind enum");
845
+ }
846
+ }
696
847
  function writeTimerOverrunPolicyKind(input: TimerOverrunPolicyKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
697
848
  void context; void enclosing; void flags; const value: any = input;
698
849
  writer.u(numeric(enumWireTimerOverrunPolicyKind(value)), 1);
@@ -713,6 +864,7 @@ function readActorSpotKind(reader: Reader, context: ServiceWireDecoderContext, e
713
864
  default: fail("actor-spot-kind enum");
714
865
  }
715
866
  }
867
+
716
868
  function writeActorSpotKind(input: ActorSpotKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
717
869
  void context; void enclosing; void flags; const value: any = input;
718
870
  writer.u(numeric(enumWireActorSpotKind(value)), 1);
@@ -735,6 +887,15 @@ function readRelocationRole(reader: Reader, context: ServiceWireDecoderContext,
735
887
  default: fail("relocation-role enum");
736
888
  }
737
889
  }
890
+ function* readIncrementalRelocationRole(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationRole, void> {
891
+ void context; void enclosing; void flags;
892
+ const raw = yield* reader.u(1); switch (Number(raw)) {
893
+ case 1: return "source";
894
+ case 2: return "target";
895
+ case 3: return "coordinator";
896
+ default: fail("relocation-role enum");
897
+ }
898
+ }
738
899
  function writeRelocationRole(input: RelocationRole, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
739
900
  void context; void enclosing; void flags; const value: any = input;
740
901
  writer.u(numeric(enumWireRelocationRole(value)), 1);
@@ -755,6 +916,7 @@ function readActorJoinResult(reader: Reader, context: ServiceWireDecoderContext,
755
916
  default: fail("actor-join-result enum");
756
917
  }
757
918
  }
919
+
758
920
  function writeActorJoinResult(input: ActorJoinResult, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
759
921
  void context; void enclosing; void flags; const value: any = input;
760
922
  writer.u(numeric(enumWireActorJoinResult(value)), 4);
@@ -788,6 +950,7 @@ function readActorJoinReplyTail(reader: Reader, context: ServiceWireDecoderConte
788
950
 
789
951
  return value;
790
952
  }
953
+
791
954
  function writeActorJoinReplyTail(input: ActorJoinReplyTail, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
792
955
  void context; void enclosing; void flags; const value: any = input;
793
956
 
@@ -856,6 +1019,26 @@ function readMeshRecordKind(reader: Reader, context: ServiceWireDecoderContext,
856
1019
  default: fail("mesh-record-kind enum");
857
1020
  }
858
1021
  }
1022
+ function* readIncrementalMeshRecordKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, MeshRecordKind, void> {
1023
+ void context; void enclosing; void flags;
1024
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1025
+ case 1: return "nodeSend";
1026
+ case 2: return "nodeRequest";
1027
+ case 3: return "channelSend";
1028
+ case 4: return "channelRequest";
1029
+ case 5: return "spotSend";
1030
+ case 6: return "spotRequest";
1031
+ case 7: return "spotMulticast";
1032
+ case 8: return "spotControl";
1033
+ case 9: return "actorSend";
1034
+ case 10: return "actorRequest";
1035
+ case 11: return "completion";
1036
+ case 12: return "sendReady";
1037
+ case 13: return "relocationControl";
1038
+ case 14: return "instanceSpotActivation";
1039
+ default: fail("mesh-record-kind enum");
1040
+ }
1041
+ }
859
1042
  function writeMeshRecordKind(input: MeshRecordKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
860
1043
  void context; void enclosing; void flags; const value: any = input;
861
1044
  writer.u(numeric(enumWireMeshRecordKind(value)), 1);
@@ -880,6 +1063,16 @@ function readFrozenSourceKind(reader: Reader, context: ServiceWireDecoderContext
880
1063
  default: fail("frozen-source-kind enum");
881
1064
  }
882
1065
  }
1066
+ function* readIncrementalFrozenSourceKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, FrozenSourceKind, void> {
1067
+ void context; void enclosing; void flags;
1068
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1069
+ case 1: return "node";
1070
+ case 2: return "spot";
1071
+ case 3: return "actor";
1072
+ case 4: return "boundSession";
1073
+ default: fail("frozen-source-kind enum");
1074
+ }
1075
+ }
883
1076
  function writeFrozenSourceKind(input: FrozenSourceKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
884
1077
  void context; void enclosing; void flags; const value: any = input;
885
1078
  writer.u(numeric(enumWireFrozenSourceKind(value)), 1);
@@ -906,6 +1099,17 @@ function readMeshDestinationKind(reader: Reader, context: ServiceWireDecoderCont
906
1099
  default: fail("mesh-destination-kind enum");
907
1100
  }
908
1101
  }
1102
+ function* readIncrementalMeshDestinationKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, MeshDestinationKind, void> {
1103
+ void context; void enclosing; void flags;
1104
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1105
+ case 1: return "node";
1106
+ case 2: return "channel";
1107
+ case 3: return "spot";
1108
+ case 4: return "actor";
1109
+ case 5: return "boundSession";
1110
+ default: fail("mesh-destination-kind enum");
1111
+ }
1112
+ }
909
1113
  function writeMeshDestinationKind(input: MeshDestinationKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
910
1114
  void context; void enclosing; void flags; const value: any = input;
911
1115
  writer.u(numeric(enumWireMeshDestinationKind(value)), 1);
@@ -926,6 +1130,7 @@ function readServiceTopologyKind(reader: Reader, context: ServiceWireDecoderCont
926
1130
  default: fail("service-topology-kind enum");
927
1131
  }
928
1132
  }
1133
+
929
1134
  function writeServiceTopologyKind(input: ServiceTopologyKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
930
1135
  void context; void enclosing; void flags; const value: any = input;
931
1136
  writer.u(numeric(enumWireServiceTopologyKind(value)), 1);
@@ -946,6 +1151,7 @@ function readClientServerRole(reader: Reader, context: ServiceWireDecoderContext
946
1151
  default: fail("client-server-role enum");
947
1152
  }
948
1153
  }
1154
+
949
1155
  function writeClientServerRole(input: ClientServerRole, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
950
1156
  void context; void enclosing; void flags; const value: any = input;
951
1157
  writer.u(numeric(enumWireClientServerRole(value)), 1);
@@ -964,6 +1170,7 @@ function readClientServerDirection(reader: Reader, context: ServiceWireDecoderCo
964
1170
  default: fail("client-server-direction enum");
965
1171
  }
966
1172
  }
1173
+
967
1174
  function writeClientServerDirection(input: ClientServerDirection, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
968
1175
  void context; void enclosing; void flags; const value: any = input;
969
1176
  writer.u(numeric(enumWireClientServerDirection(value)), 1);
@@ -990,6 +1197,17 @@ function readActorLifecycleKind(reader: Reader, context: ServiceWireDecoderConte
990
1197
  default: fail("actor-lifecycle-kind enum");
991
1198
  }
992
1199
  }
1200
+ function* readIncrementalActorLifecycleKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ActorLifecycleKind, void> {
1201
+ void context; void enclosing; void flags;
1202
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1203
+ case 1: return "created";
1204
+ case 2: return "joined";
1205
+ case 3: return "left";
1206
+ case 4: return "disconnected";
1207
+ case 5: return "destroyed";
1208
+ default: fail("actor-lifecycle-kind enum");
1209
+ }
1210
+ }
993
1211
  function writeActorLifecycleKind(input: ActorLifecycleKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
994
1212
  void context; void enclosing; void flags; const value: any = input;
995
1213
  writer.u(numeric(enumWireActorLifecycleKind(value)), 1);
@@ -1010,6 +1228,7 @@ function readBoundSessionBindingState(reader: Reader, context: ServiceWireDecode
1010
1228
  default: fail("bound-session-binding-state enum");
1011
1229
  }
1012
1230
  }
1231
+
1013
1232
  function writeBoundSessionBindingState(input: BoundSessionBindingState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1014
1233
  void context; void enclosing; void flags; const value: any = input;
1015
1234
  writer.u(numeric(enumWireBoundSessionBindingState(value)), 1);
@@ -1030,6 +1249,7 @@ function readSessionRelocationRouteAction(reader: Reader, context: ServiceWireDe
1030
1249
  default: fail("session-relocation-route-action enum");
1031
1250
  }
1032
1251
  }
1252
+
1033
1253
  function writeSessionRelocationRouteAction(input: SessionRelocationRouteAction, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1034
1254
  void context; void enclosing; void flags; const value: any = input;
1035
1255
  writer.u(numeric(enumWireSessionRelocationRouteAction(value)), 1);
@@ -1066,6 +1286,22 @@ function readRelocationPhase(reader: Reader, context: ServiceWireDecoderContext,
1066
1286
  default: fail("relocation-phase enum");
1067
1287
  }
1068
1288
  }
1289
+ function* readIncrementalRelocationPhase(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationPhase, void> {
1290
+ void context; void enclosing; void flags;
1291
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1292
+ case 0: return "none";
1293
+ case 1: return "preparing";
1294
+ case 2: return "captured";
1295
+ case 3: return "prepared";
1296
+ case 4: return "committed";
1297
+ case 5: return "activating";
1298
+ case 6: return "activated";
1299
+ case 7: return "cleaning";
1300
+ case 8: return "completed";
1301
+ case 9: return "aborted";
1302
+ default: fail("relocation-phase enum");
1303
+ }
1304
+ }
1069
1305
  function writeRelocationPhase(input: RelocationPhase, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1070
1306
  void context; void enclosing; void flags; const value: any = input;
1071
1307
  writer.u(numeric(enumWireRelocationPhase(value)), 1);
@@ -1088,6 +1324,7 @@ function readSourceCleanupState(reader: Reader, context: ServiceWireDecoderConte
1088
1324
  default: fail("source-cleanup-state enum");
1089
1325
  }
1090
1326
  }
1327
+
1091
1328
  function writeSourceCleanupState(input: SourceCleanupState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1092
1329
  void context; void enclosing; void flags; const value: any = input;
1093
1330
  writer.u(numeric(enumWireSourceCleanupState(value)), 1);
@@ -1108,6 +1345,7 @@ function readReplyRelayAckStatus(reader: Reader, context: ServiceWireDecoderCont
1108
1345
  default: fail("reply-relay-ack-status enum");
1109
1346
  }
1110
1347
  }
1348
+
1111
1349
  function writeReplyRelayAckStatus(input: ReplyRelayAckStatus, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1112
1350
  void context; void enclosing; void flags; const value: any = input;
1113
1351
  writer.u(numeric(enumWireReplyRelayAckStatus(value)), 1);
@@ -1132,6 +1370,7 @@ function readAuthorityOperationKind(reader: Reader, context: ServiceWireDecoderC
1132
1370
  default: fail("authority-operation-kind enum");
1133
1371
  }
1134
1372
  }
1373
+
1135
1374
  function writeAuthorityOperationKind(input: AuthorityOperationKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1136
1375
  void context; void enclosing; void flags; const value: any = input;
1137
1376
  writer.u(numeric(enumWireAuthorityOperationKind(value)), 1);
@@ -1180,6 +1419,28 @@ function readMeshOperationKind(reader: Reader, context: ServiceWireDecoderContex
1180
1419
  default: fail("mesh-operation-kind enum");
1181
1420
  }
1182
1421
  }
1422
+ function* readIncrementalMeshOperationKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, MeshOperationKind, void> {
1423
+ void context; void enclosing; void flags;
1424
+ const raw = yield* reader.u(4); switch (Number(raw)) {
1425
+ case 0: return "none";
1426
+ case 1: return "nodeRequest";
1427
+ case 2: return "channelRequest";
1428
+ case 3: return "spotRequest";
1429
+ case 4: return "actorRequest";
1430
+ case 5: return "actorLookup";
1431
+ case 6: return "actorDestroy";
1432
+ case 7: return "actorJoin";
1433
+ case 8: return "actorLeave";
1434
+ case 9: return "streamBind";
1435
+ case 10: return "streamUnbind";
1436
+ case 11: return "streamClose";
1437
+ case 12: return "instanceSpotRequest";
1438
+ case 13: return "userSpotCreate";
1439
+ case 14: return "userSpotClose";
1440
+ case 15: return "actorCreate";
1441
+ default: fail("mesh-operation-kind enum");
1442
+ }
1443
+ }
1183
1444
  function writeMeshOperationKind(input: MeshOperationKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1184
1445
  void context; void enclosing; void flags; const value: any = input;
1185
1446
  writer.u(numeric(enumWireMeshOperationKind(value)), 4);
@@ -1224,6 +1485,26 @@ function readRequestTerminalResult(reader: Reader, context: ServiceWireDecoderCo
1224
1485
  default: fail("request-terminal-result enum");
1225
1486
  }
1226
1487
  }
1488
+ function* readIncrementalRequestTerminalResult(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RequestTerminalResult, void> {
1489
+ void context; void enclosing; void flags;
1490
+ const raw = yield* reader.u(4); switch (Number(raw)) {
1491
+ case 0: return "ok";
1492
+ case 101: return "timedOut";
1493
+ case 102: return "notFound";
1494
+ case 103: return "terminated";
1495
+ case 104: return "protocolError";
1496
+ case 105: return "internalError";
1497
+ case 106: return "rejected";
1498
+ case 107: return "conflict";
1499
+ case 108: return "busy";
1500
+ case 109: return "notConnected";
1501
+ case 110: return "invalidArgument";
1502
+ case 111: return "invalidState";
1503
+ case 112: return "notSupported";
1504
+ case 113: return "backpressured";
1505
+ default: fail("request-terminal-result enum");
1506
+ }
1507
+ }
1227
1508
  function writeRequestTerminalResult(input: RequestTerminalResult, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1228
1509
  void context; void enclosing; void flags; const value: any = input;
1229
1510
  writer.u(numeric(enumWireRequestTerminalResult(value)), 4);
@@ -1292,6 +1573,38 @@ function readFrameworkErrorCode(reader: Reader, context: ServiceWireDecoderConte
1292
1573
  default: fail("framework-error-code enum");
1293
1574
  }
1294
1575
  }
1576
+ function* readIncrementalFrameworkErrorCode(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, FrameworkErrorCode, void> {
1577
+ void context; void enclosing; void flags;
1578
+ const raw = yield* reader.u(4); switch (Number(raw)) {
1579
+ case 0: return "none";
1580
+ case 1: return "actorRouteNotFound";
1581
+ case 2: return "actorCreateFailed";
1582
+ case 3: return "actorAlreadyExists";
1583
+ case 4: return "actorTypeMismatch";
1584
+ case 5: return "spotCreateFailed";
1585
+ case 6: return "spotRouteNotFound";
1586
+ case 7: return "spotTypeMismatch";
1587
+ case 8: return "actorSessionNotBound";
1588
+ case 9: return "handlerNotFound";
1589
+ case 10: return "routeHandlerNotFound";
1590
+ case 11: return "actorDispatchHandlerNotFound";
1591
+ case 12: return "payloadDecodeFailed";
1592
+ case 13: return "routeNotConnected";
1593
+ case 14: return "requestTargetNotFound";
1594
+ case 15: return "requestRejected";
1595
+ case 16: return "requestProtocolError";
1596
+ case 17: return "requestFailed";
1597
+ case 18: return "workerQueueFull";
1598
+ case 19: return "workerTimedOut";
1599
+ case 20: return "workerFailed";
1600
+ case 21: return "actorLocationStale";
1601
+ case 22: return "actorCreateRejected";
1602
+ case 33: return "spotGenerationStale";
1603
+ case 34: return "spotMoving";
1604
+ case 35: return "relocationDataLost";
1605
+ default: fail("framework-error-code enum");
1606
+ }
1607
+ }
1295
1608
  function writeFrameworkErrorCode(input: FrameworkErrorCode, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1296
1609
  void context; void enclosing; void flags; const value: any = input;
1297
1610
  writer.u(numeric(enumWireFrameworkErrorCode(value)), 4);
@@ -1312,6 +1625,14 @@ function readInstanceOperationKind(reader: Reader, context: ServiceWireDecoderCo
1312
1625
  default: fail("instance-operation-kind enum");
1313
1626
  }
1314
1627
  }
1628
+ function* readIncrementalInstanceOperationKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, InstanceOperationKind, void> {
1629
+ void context; void enclosing; void flags;
1630
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1631
+ case 1: return "send";
1632
+ case 2: return "request";
1633
+ default: fail("instance-operation-kind enum");
1634
+ }
1635
+ }
1315
1636
  function writeInstanceOperationKind(input: InstanceOperationKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1316
1637
  void context; void enclosing; void flags; const value: any = input;
1317
1638
  writer.u(numeric(enumWireInstanceOperationKind(value)), 1);
@@ -1332,6 +1653,14 @@ function readInstanceRouteKind(reader: Reader, context: ServiceWireDecoderContex
1332
1653
  default: fail("instance-route-kind enum");
1333
1654
  }
1334
1655
  }
1656
+ function* readIncrementalInstanceRouteKind(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, InstanceRouteKind, void> {
1657
+ void context; void enclosing; void flags;
1658
+ const raw = yield* reader.u(1); switch (Number(raw)) {
1659
+ case 1: return "ready";
1660
+ case 2: return "coldActivation";
1661
+ default: fail("instance-route-kind enum");
1662
+ }
1663
+ }
1335
1664
  function writeInstanceRouteKind(input: InstanceRouteKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1336
1665
  void context; void enclosing; void flags; const value: any = input;
1337
1666
  writer.u(numeric(enumWireInstanceRouteKind(value)), 1);
@@ -1354,6 +1683,7 @@ function readUserSpotCreateResult(reader: Reader, context: ServiceWireDecoderCon
1354
1683
  default: fail("user-spot-create-result enum");
1355
1684
  }
1356
1685
  }
1686
+
1357
1687
  function writeUserSpotCreateResult(input: UserSpotCreateResult, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1358
1688
  void context; void enclosing; void flags; const value: any = input;
1359
1689
  writer.u(numeric(enumWireUserSpotCreateResult(value)), 1);
@@ -1376,6 +1706,7 @@ function readActorCreateResult(reader: Reader, context: ServiceWireDecoderContex
1376
1706
  default: fail("actor-create-result enum");
1377
1707
  }
1378
1708
  }
1709
+
1379
1710
  function writeActorCreateResult(input: ActorCreateResult, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1380
1711
  void context; void enclosing; void flags; const value: any = input;
1381
1712
  writer.u(numeric(enumWireActorCreateResult(value)), 1);
@@ -1400,6 +1731,7 @@ function readInstanceAuthorityState(reader: Reader, context: ServiceWireDecoderC
1400
1731
  default: fail("instance-authority-state enum");
1401
1732
  }
1402
1733
  }
1734
+
1403
1735
  function writeInstanceAuthorityState(input: InstanceAuthorityState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1404
1736
  void context; void enclosing; void flags; const value: any = input;
1405
1737
  writer.u(numeric(enumWireInstanceAuthorityState(value)), 1);
@@ -1420,6 +1752,7 @@ function readReplyRelayContextKind(reader: Reader, context: ServiceWireDecoderCo
1420
1752
  default: fail("reply-relay-context-kind enum");
1421
1753
  }
1422
1754
  }
1755
+
1423
1756
  function writeReplyRelayContextKind(input: ReplyRelayContextKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1424
1757
  void context; void enclosing; void flags; const value: any = input;
1425
1758
  writer.u(numeric(enumWireReplyRelayContextKind(value)), 1);
@@ -1440,6 +1773,7 @@ function readColdActivationCompletionKind(reader: Reader, context: ServiceWireDe
1440
1773
  default: fail("cold-activation-completion-kind enum");
1441
1774
  }
1442
1775
  }
1776
+
1443
1777
  function writeColdActivationCompletionKind(input: ColdActivationCompletionKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1444
1778
  void context; void enclosing; void flags; const value: any = input;
1445
1779
  writer.u(numeric(enumWireColdActivationCompletionKind(value)), 1);
@@ -1480,6 +1814,7 @@ function readRejectReason(reader: Reader, context: ServiceWireDecoderContext, en
1480
1814
  default: fail("reject-reason enum");
1481
1815
  }
1482
1816
  }
1817
+
1483
1818
  function writeRejectReason(input: RejectReason, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1484
1819
  void context; void enclosing; void flags; const value: any = input;
1485
1820
  writer.u(numeric(enumWireRejectReason(value)), 4);
@@ -1500,6 +1835,19 @@ function readActorRef(reader: Reader, context: ServiceWireDecoderContext, enclos
1500
1835
 
1501
1836
 
1502
1837
 
1838
+ return value;
1839
+ }
1840
+ function* readIncrementalActorRef(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ActorRef, void> {
1841
+ void context; void enclosing; void flags;
1842
+ const value: any = {};
1843
+ value["actorId"] = yield* readIncrementalText8(reader, context, value, flags);
1844
+
1845
+
1846
+ value["objectGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
1847
+
1848
+
1849
+
1850
+
1503
1851
  return value;
1504
1852
  }
1505
1853
  function writeActorRef(input: ActorRef, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -1531,6 +1879,19 @@ function readSpotRef(reader: Reader, context: ServiceWireDecoderContext, enclosi
1531
1879
 
1532
1880
 
1533
1881
 
1882
+ return value;
1883
+ }
1884
+ function* readIncrementalSpotRef(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, SpotRef, void> {
1885
+ void context; void enclosing; void flags;
1886
+ const value: any = {};
1887
+ value["spotId"] = yield* readIncrementalText8(reader, context, value, flags);
1888
+
1889
+
1890
+ value["objectGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
1891
+
1892
+
1893
+
1894
+
1534
1895
  return value;
1535
1896
  }
1536
1897
  function writeSpotRef(input: SpotRef, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -1571,6 +1932,7 @@ function readActorCreateTerminal(reader: Reader, context: ServiceWireDecoderCont
1571
1932
 
1572
1933
  return value;
1573
1934
  }
1935
+
1574
1936
  function writeActorCreateTerminal(input: ActorCreateTerminal, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1575
1937
  void context; void enclosing; void flags; const value: any = input;
1576
1938
 
@@ -1630,19 +1992,22 @@ function readCreationOperationTerminalV1(reader: Reader, context: ServiceWireDec
1630
1992
  if (same(value["terminalResult"], "ok") && !(same(value["failureCode"], "none") && same(value["hasCreation"], "true"))) fail("creation-operation-terminal-v1 terminal-success-shape");
1631
1993
  if (!same(value["terminalResult"], "ok") && !(same(value["hasCreation"], "false") && same(value["hasApplicationPayload"], "false"))) fail("creation-operation-terminal-v1 terminal-failure-shape");
1632
1994
  if (value["creation"] !== undefined && same(value["creation"]["createResult"], "existing") && !(same(value["hasApplicationPayload"], "false"))) fail("creation-operation-terminal-v1 existing-has-no-application-payload");
1633
-
1995
+ void context;
1996
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("creation-operation-terminal-v1 runtime predicate");
1634
1997
  return value;
1635
1998
  })();
1636
1999
  if (reader.offset - limitStart > 1048576) fail("creation-operation-terminal-v1 maximum");
1637
2000
  return decoded;
1638
2001
  }
2002
+
1639
2003
  function writeCreationOperationTerminalV1(input: CreationOperationTerminalV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1640
2004
  void context; void enclosing; void flags; const value: any = input;
1641
2005
  const limitStart = writer.length;
1642
2006
  if (same(value["terminalResult"], "ok") && !(same(value["failureCode"], "none") && same(value["hasCreation"], "true"))) fail("creation-operation-terminal-v1 terminal-success-shape");
1643
2007
  if (!same(value["terminalResult"], "ok") && !(same(value["hasCreation"], "false") && same(value["hasApplicationPayload"], "false"))) fail("creation-operation-terminal-v1 terminal-failure-shape");
1644
2008
  if (value["creation"] !== undefined && same(value["creation"]["createResult"], "existing") && !(same(value["hasApplicationPayload"], "false"))) fail("creation-operation-terminal-v1 existing-has-no-application-payload");
1645
-
2009
+ void context;
2010
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("creation-operation-terminal-v1 runtime predicate");
1646
2011
  writeU8(1, writer, context, enclosing, flags); const body = new Writer();
1647
2012
  if (value["terminalResult"] === undefined) fail("terminalResult required");
1648
2013
 
@@ -1697,6 +2062,7 @@ function readOptionalSpotRef(reader: Reader, context: ServiceWireDecoderContext,
1697
2062
 
1698
2063
  return value;
1699
2064
  }
2065
+
1700
2066
  function writeOptionalSpotRef(input: OptionalSpotRef, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1701
2067
  void context; void enclosing; void flags; const value: any = input;
1702
2068
 
@@ -1727,6 +2093,16 @@ function readSpotMembership(reader: Reader, context: ServiceWireDecoderContext,
1727
2093
 
1728
2094
 
1729
2095
 
2096
+ return value;
2097
+ }
2098
+ function* readIncrementalSpotMembership(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, SpotMembership, void> {
2099
+ void context; void enclosing; void flags;
2100
+ const value: any = {};
2101
+ value["spot"] = yield* readIncrementalSpotRef(reader, context, value, flags);
2102
+
2103
+
2104
+
2105
+
1730
2106
  return value;
1731
2107
  }
1732
2108
  function writeSpotMembership(input: SpotMembership, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -1759,6 +2135,7 @@ function readOptionalSpotMembership(reader: Reader, context: ServiceWireDecoderC
1759
2135
 
1760
2136
  return value;
1761
2137
  }
2138
+
1762
2139
  function writeOptionalSpotMembership(input: OptionalSpotMembership, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1763
2140
  void context; void enclosing; void flags; const value: any = input;
1764
2141
 
@@ -1799,6 +2176,7 @@ function readBoundSessionBindingTransition(reader: Reader, context: ServiceWireD
1799
2176
 
1800
2177
  return value;
1801
2178
  }
2179
+
1802
2180
  function writeBoundSessionBindingTransition(input: BoundSessionBindingTransition, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1803
2181
  void context; void enclosing; void flags; const value: any = input;
1804
2182
 
@@ -1849,6 +2227,7 @@ function readRetiredBoundSessionRouteFence(reader: Reader, context: ServiceWireD
1849
2227
 
1850
2228
  return value;
1851
2229
  }
2230
+
1852
2231
  function writeRetiredBoundSessionRouteFence(input: RetiredBoundSessionRouteFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1853
2232
  void context; void enclosing; void flags; const value: any = input;
1854
2233
 
@@ -1910,6 +2289,7 @@ function readSessionRelocationRouteUpdate(reader: Reader, context: ServiceWireDe
1910
2289
 
1911
2290
  return value;
1912
2291
  }
2292
+
1913
2293
  function writeSessionRelocationRouteUpdate(input: SessionRelocationRouteUpdate, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1914
2294
  void context; void enclosing; void flags; const value: any = input;
1915
2295
 
@@ -1969,6 +2349,7 @@ function readObjectCreationKey(reader: Reader, context: ServiceWireDecoderContex
1969
2349
 
1970
2350
  return value;
1971
2351
  }
2352
+
1972
2353
  function writeObjectCreationKey(input: ObjectCreationKey, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
1973
2354
  void context; void enclosing; void flags; const value: any = input;
1974
2355
 
@@ -2031,6 +2412,7 @@ function readObjectCreationIntentV1(reader: Reader, context: ServiceWireDecoderC
2031
2412
  if (reader.offset - limitStart > 1048576) fail("object-creation-intent-v1 maximum");
2032
2413
  return decoded;
2033
2414
  }
2415
+
2034
2416
  function writeObjectCreationIntentV1(input: ObjectCreationIntentV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2035
2417
  void context; void enclosing; void flags; const value: any = input;
2036
2418
  const limitStart = writer.length;
@@ -2089,6 +2471,7 @@ function readPendingObjectCreationV1(reader: Reader, context: ServiceWireDecoder
2089
2471
 
2090
2472
  return value;
2091
2473
  }
2474
+
2092
2475
  function writePendingObjectCreationV1(input: PendingObjectCreationV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2093
2476
  void context; void enclosing; void flags; const value: any = input;
2094
2477
 
@@ -2137,6 +2520,7 @@ function readObjectCreationTargetV1(reader: Reader, context: ServiceWireDecoderC
2137
2520
 
2138
2521
  return value;
2139
2522
  }
2523
+
2140
2524
  function writeObjectCreationTargetV1(input: ObjectCreationTargetV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2141
2525
  void context; void enclosing; void flags; const value: any = input;
2142
2526
 
@@ -2233,6 +2617,7 @@ function readInstanceActivationRecoveryV1(reader: Reader, context: ServiceWireDe
2233
2617
  if (reader.offset - limitStart > 1048576) fail("instance-activation-recovery-v1 maximum");
2234
2618
  return decoded;
2235
2619
  }
2620
+
2236
2621
  function writeInstanceActivationRecoveryV1(input: InstanceActivationRecoveryV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2237
2622
  void context; void enclosing; void flags; const value: any = input;
2238
2623
  const limitStart = writer.length;
@@ -2351,6 +2736,7 @@ function readObjectReservationFence(reader: Reader, context: ServiceWireDecoderC
2351
2736
 
2352
2737
  return value;
2353
2738
  }
2739
+
2354
2740
  function writeObjectReservationFence(input: ObjectReservationFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2355
2741
  void context; void enclosing; void flags; const value: any = input;
2356
2742
 
@@ -2410,6 +2796,7 @@ function readGenericReservationOperationKind(reader: Reader, context: ServiceWir
2410
2796
  default: fail("generic-reservation-operation-kind enum");
2411
2797
  }
2412
2798
  }
2799
+
2413
2800
  function writeGenericReservationOperationKind(input: GenericReservationOperationKind, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2414
2801
  void context; void enclosing; void flags; const value: any = input;
2415
2802
  writer.u(numeric(enumWireGenericReservationOperationKind(value)), 1);
@@ -2460,6 +2847,7 @@ function readGenericObjectReservationV1(reader: Reader, context: ServiceWireDeco
2460
2847
  if (reader.offset - limitStart > 1048576) fail("generic-object-reservation-v1 maximum");
2461
2848
  return decoded;
2462
2849
  }
2850
+
2463
2851
  function writeGenericObjectReservationV1(input: GenericObjectReservationV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2464
2852
  void context; void enclosing; void flags; const value: any = input;
2465
2853
  const limitStart = writer.length;
@@ -2526,6 +2914,7 @@ function readAggregateId(reader: Reader, context: ServiceWireDecoderContext, enc
2526
2914
 
2527
2915
  return value;
2528
2916
  }
2917
+
2529
2918
  function writeAggregateId(input: AggregateId, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2530
2919
  void context; void enclosing; void flags; const value: any = input;
2531
2920
  if (numeric(value["high"]) === 0n && numeric(value["low"]) === 0n) fail("aggregate-id all zero");
@@ -2546,11 +2935,12 @@ export type AggregateParticipantMutationBytes = Uint8Array;
2546
2935
 
2547
2936
  function readAggregateParticipantMutationBytes(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): AggregateParticipantMutationBytes {
2548
2937
  void context; void enclosing; void flags;
2549
- const length = Number(readU32(reader, context, enclosing, flags)); if (length > 1048576) fail("aggregate-participant-mutation-bytes length"); if (length > 2147483647) capacityFail("aggregate-participant-mutation-bytes capacity"); if (length < 1) fail("aggregate-participant-mutation-bytes length"); return reader.take(length);
2938
+ const length = Number(readU32(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("aggregate-participant-mutation-bytes capacity"); if (length > 1048576) fail("aggregate-participant-mutation-bytes length"); if (length < 1) fail("aggregate-participant-mutation-bytes length"); return reader.take(length);
2550
2939
  }
2940
+
2551
2941
  function writeAggregateParticipantMutationBytes(input: AggregateParticipantMutationBytes, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2552
2942
  void context; void enclosing; void flags; const value: any = input;
2553
- const bytes = value as Uint8Array; if (bytes.length > 1048576) fail("aggregate-participant-mutation-bytes length"); if (bytes.length > 2147483647) capacityFail("aggregate-participant-mutation-bytes capacity"); if (bytes.length < 1) fail("aggregate-participant-mutation-bytes length"); writeU32(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
2943
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("aggregate-participant-mutation-bytes capacity"); if (bytes.length > 1048576) fail("aggregate-participant-mutation-bytes length"); if (bytes.length < 1) fail("aggregate-participant-mutation-bytes length"); writeU32(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
2554
2944
  }
2555
2945
  export function decodeAggregateParticipantMutationBytes(bytes: Uint8Array, context: ServiceWireDecoderContext): AggregateParticipantMutationBytes { const reader = new Reader(bytes); const value = readAggregateParticipantMutationBytes(reader, context, {}, 0); reader.done("aggregate-participant-mutation-bytes"); return value; }
2556
2946
  export function encodeAggregateParticipantMutationBytes(value: AggregateParticipantMutationBytes, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeAggregateParticipantMutationBytes(value, writer, context, {}, 0); return writer.result(); }
@@ -2573,6 +2963,7 @@ function readMaintenanceAggregateParticipantV1(reader: Reader, context: ServiceW
2573
2963
 
2574
2964
  return value;
2575
2965
  }
2966
+
2576
2967
  function writeMaintenanceAggregateParticipantV1(input: MaintenanceAggregateParticipantV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2577
2968
  void context; void enclosing; void flags; const value: any = input;
2578
2969
 
@@ -2598,15 +2989,16 @@ export type AggregateParticipantVector = readonly MaintenanceAggregateParticipan
2598
2989
  function readAggregateParticipantVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): AggregateParticipantVector {
2599
2990
  void context; void enclosing; void flags;
2600
2991
  const count = Number(readU16(reader, context, enclosing, flags)); if (count > 1024) fail("aggregate-participant-vector count"); const value: any = Array.from({ length: count }, () => readMaintenanceAggregateParticipantV1(reader, context, enclosing, flags));
2601
- for (let index = 1; index < value.length; ++index) if (compareBytes((same(value[index - 1]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index - 1]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant")), (same(value[index]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant"))) >= 0) fail("aggregate-participant-vector sorted");
2602
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareBytes((same(value[left]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[left]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[left]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[left]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[left]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[left]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant")), (same(value[right]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[right]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[right]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[right]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[right]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[right]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant"))) === 0) fail("aggregate-participant-vector unique");
2992
+ try { for (let index = 1; index < value.length; ++index) if (compareBytes((same(value[index - 1]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index - 1]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant")), (same(value[index]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant"))) >= 0) fail("aggregate-participant-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("aggregate-participant-vector constraint capacity"); throw error; }
2993
+
2603
2994
  return value;
2604
2995
  }
2996
+
2605
2997
  function writeAggregateParticipantVector(input: AggregateParticipantVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2606
2998
  void context; void enclosing; void flags; const value: any = input;
2607
2999
  if (!Array.isArray(value) || value.length > 1024) fail("aggregate-participant-vector count");
2608
- for (let index = 1; index < value.length; ++index) if (compareBytes((same(value[index - 1]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index - 1]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant")), (same(value[index]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant"))) >= 0) fail("aggregate-participant-vector sorted");
2609
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareBytes((same(value[left]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[left]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[left]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[left]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[left]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[left]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant")), (same(value[right]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[right]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[right]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[right]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[right]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[right]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant"))) === 0) fail("aggregate-participant-vector unique");
3000
+ try { for (let index = 1; index < value.length; ++index) if (compareBytes((same(value[index - 1]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index - 1]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index - 1]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index - 1]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant")), (same(value[index]["object"]["objectKind"], "actor") ? canonicalAuthorityKey("zla1", ":", "a", [utf8(value[index]["object"]["actor"]["actorId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "userSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spot"]["spotId"])], 1, 255, 776) : same(value[index]["object"]["objectKind"], "instanceSpot") ? canonicalAuthorityKey("zla1", ":", "s", [utf8(value[index]["object"]["spotId"])], 1, 255, 776) : fail("aggregate-participant-vector authority key variant"))) >= 0) fail("aggregate-participant-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("aggregate-participant-vector constraint capacity"); throw error; }
3001
+
2610
3002
  writeU16(value.length, writer, context, enclosing, flags); for (const item of value) writeMaintenanceAggregateParticipantV1(item, writer, context, enclosing, flags);
2611
3003
  }
2612
3004
  export function decodeAggregateParticipantVector(bytes: Uint8Array, context: ServiceWireDecoderContext): AggregateParticipantVector { const reader = new Reader(bytes); const value = readAggregateParticipantVector(reader, context, {}, 0); reader.done("aggregate-participant-vector"); return value; }
@@ -2642,6 +3034,7 @@ function readMaintenanceAggregateV1(reader: Reader, context: ServiceWireDecoderC
2642
3034
  if (reader.offset - limitStart > 1048576) fail("maintenance-aggregate-v1 maximum");
2643
3035
  return decoded;
2644
3036
  }
3037
+
2645
3038
  function writeMaintenanceAggregateV1(input: MaintenanceAggregateV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2646
3039
  void context; void enclosing; void flags; const value: any = input;
2647
3040
  const limitStart = writer.length;
@@ -2697,6 +3090,28 @@ function readActorRouteFence(reader: Reader, context: ServiceWireDecoderContext,
2697
3090
 
2698
3091
 
2699
3092
 
3093
+ return value;
3094
+ }
3095
+ function* readIncrementalActorRouteFence(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ActorRouteFence, void> {
3096
+ void context; void enclosing; void flags;
3097
+ const value: any = {};
3098
+ value["actor"] = yield* readIncrementalActorRef(reader, context, value, flags);
3099
+
3100
+
3101
+ value["targetNodeRid"] = yield* readIncrementalRid(reader, context, value, flags);
3102
+
3103
+
3104
+ value["targetNodeGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3105
+
3106
+
3107
+ value["expectedAuthorityOwnerGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3108
+
3109
+
3110
+ value["expectedOwnerLeaseGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3111
+
3112
+
3113
+
3114
+
2700
3115
  return value;
2701
3116
  }
2702
3117
  function writeActorRouteFence(input: ActorRouteFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -2749,6 +3164,28 @@ function readSpotRouteFence(reader: Reader, context: ServiceWireDecoderContext,
2749
3164
 
2750
3165
 
2751
3166
 
3167
+ return value;
3168
+ }
3169
+ function* readIncrementalSpotRouteFence(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, SpotRouteFence, void> {
3170
+ void context; void enclosing; void flags;
3171
+ const value: any = {};
3172
+ value["spot"] = yield* readIncrementalSpotRef(reader, context, value, flags);
3173
+
3174
+
3175
+ value["targetNodeRid"] = yield* readIncrementalRid(reader, context, value, flags);
3176
+
3177
+
3178
+ value["targetNodeGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3179
+
3180
+
3181
+ value["expectedAuthorityOwnerGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3182
+
3183
+
3184
+ value["expectedOwnerLeaseGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3185
+
3186
+
3187
+
3188
+
2752
3189
  return value;
2753
3190
  }
2754
3191
  function writeSpotRouteFence(input: SpotRouteFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -2805,6 +3242,7 @@ function readUserSpotCloseFenceV1(reader: Reader, context: ServiceWireDecoderCon
2805
3242
 
2806
3243
  return value;
2807
3244
  }
3245
+
2808
3246
  function writeUserSpotCloseFenceV1(input: UserSpotCloseFenceV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2809
3247
  void context; void enclosing; void flags; const value: any = input;
2810
3248
 
@@ -2856,6 +3294,7 @@ function readMessageFollowRoute(reader: Reader, context: ServiceWireDecoderConte
2856
3294
 
2857
3295
  return value;
2858
3296
  }
3297
+
2859
3298
  function writeMessageFollowRoute(input: MessageFollowRoute, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2860
3299
  void context; void enclosing; void flags; const value: any = input;
2861
3300
 
@@ -2915,6 +3354,7 @@ function readMessageFollowRouteV1(reader: Reader, context: ServiceWireDecoderCon
2915
3354
  if (reader.offset - limitStart > 16777216) fail("message-follow-route-v1 maximum");
2916
3355
  return decoded;
2917
3356
  }
3357
+
2918
3358
  function writeMessageFollowRouteV1(input: MessageFollowRouteV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
2919
3359
  void context; void enclosing; void flags; const value: any = input;
2920
3360
  const limitStart = writer.length;
@@ -2987,6 +3427,40 @@ function readRelocationObjectIdentity(reader: Reader, context: ServiceWireDecode
2987
3427
  value["objectGeneration"] = readNonzeroU64(body, context, value, flags);
2988
3428
 
2989
3429
 
3430
+ } else fail("relocation-object-identity discriminator");
3431
+ body.done("relocation-object-identity");
3432
+
3433
+ return value;
3434
+ }
3435
+ function* readIncrementalRelocationObjectIdentity(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationObjectIdentity, void> {
3436
+ void context; void enclosing; void flags;
3437
+ const value: any = {};
3438
+ value["objectKind"] = yield* readIncrementalStatefulObjectKind(reader, context, enclosing, flags);
3439
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
3440
+ if (same(value["objectKind"], "actor")) {
3441
+ value["actor"] = yield* readIncrementalActorRef(body, context, value, flags);
3442
+
3443
+
3444
+ value["expectedAuthorityOwnerGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
3445
+
3446
+
3447
+ } else if (same(value["objectKind"], "userSpot")) {
3448
+ value["spot"] = yield* readIncrementalSpotRef(body, context, value, flags);
3449
+
3450
+
3451
+ value["expectedAuthorityOwnerGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
3452
+
3453
+
3454
+ } else if (same(value["objectKind"], "instanceSpot")) {
3455
+ value["instanceType"] = yield* readIncrementalText8(body, context, value, flags);
3456
+
3457
+
3458
+ value["spotId"] = yield* readIncrementalText8(body, context, value, flags);
3459
+
3460
+
3461
+ value["objectGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
3462
+
3463
+
2990
3464
  } else fail("relocation-object-identity discriminator");
2991
3465
  body.done("relocation-object-identity");
2992
3466
 
@@ -3061,6 +3535,7 @@ function readActorAuthorityIdentity(reader: Reader, context: ServiceWireDecoderC
3061
3535
 
3062
3536
  return value;
3063
3537
  }
3538
+
3064
3539
  function writeActorAuthorityIdentity(input: ActorAuthorityIdentity, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3065
3540
  void context; void enclosing; void flags; const value: any = input;
3066
3541
 
@@ -3129,6 +3604,7 @@ function readInstanceAuthorityIdentity(reader: Reader, context: ServiceWireDecod
3129
3604
 
3130
3605
  return value;
3131
3606
  }
3607
+
3132
3608
  function writeInstanceAuthorityIdentity(input: InstanceAuthorityIdentity, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3133
3609
  void context; void enclosing; void flags; const value: any = input;
3134
3610
 
@@ -3216,6 +3692,7 @@ function readSpotAuthorityIdentity(reader: Reader, context: ServiceWireDecoderCo
3216
3692
 
3217
3693
  return value;
3218
3694
  }
3695
+
3219
3696
  function writeSpotAuthorityIdentity(input: SpotAuthorityIdentity, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3220
3697
  void context; void enclosing; void flags; const value: any = input;
3221
3698
 
@@ -3281,6 +3758,7 @@ function readAuthorityObjectIdentity(reader: Reader, context: ServiceWireDecoder
3281
3758
 
3282
3759
  return value;
3283
3760
  }
3761
+
3284
3762
  function writeAuthorityObjectIdentity(input: AuthorityObjectIdentity, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3285
3763
  void context; void enclosing; void flags; const value: any = input;
3286
3764
 
@@ -3319,6 +3797,7 @@ function readOperationId(reader: Reader, context: ServiceWireDecoderContext, enc
3319
3797
 
3320
3798
  return value;
3321
3799
  }
3800
+
3322
3801
  function writeOperationId(input: OperationId, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3323
3802
  void context; void enclosing; void flags; const value: any = input;
3324
3803
  if (numeric(value["high"]) === 0n && numeric(value["low"]) === 0n) fail("operation-id all zero");
@@ -3348,6 +3827,19 @@ function readOperationIdOrZero(reader: Reader, context: ServiceWireDecoderContex
3348
3827
 
3349
3828
 
3350
3829
 
3830
+ return value;
3831
+ }
3832
+ function* readIncrementalOperationIdOrZero(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, OperationIdOrZero, void> {
3833
+ void context; void enclosing; void flags;
3834
+ const value: any = {};
3835
+ value["high"] = yield* readIncrementalU64(reader, context, value, flags);
3836
+
3837
+
3838
+ value["low"] = yield* readIncrementalU64(reader, context, value, flags);
3839
+
3840
+
3841
+
3842
+
3351
3843
  return value;
3352
3844
  }
3353
3845
  function writeOperationIdOrZero(input: OperationIdOrZero, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -3370,11 +3862,12 @@ export type CreationContentReference = string;
3370
3862
 
3371
3863
  function readCreationContentReference(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): CreationContentReference {
3372
3864
  void context; void enclosing; void flags;
3373
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 4096) fail("creation-content-reference length"); if (length > 2147483647) capacityFail("creation-content-reference capacity"); if (length < 1) fail("creation-content-reference length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("creation-content-reference NUL"); return decodeUtf8(bytes, "creation-content-reference");
3865
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("creation-content-reference capacity"); if (length > 4096) fail("creation-content-reference length"); if (length < 1) fail("creation-content-reference length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("creation-content-reference NUL"); return decodeUtf8(bytes, "creation-content-reference");
3374
3866
  }
3867
+
3375
3868
  function writeCreationContentReference(input: CreationContentReference, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3376
3869
  void context; void enclosing; void flags; const value: any = input;
3377
- const bytes = utf8(value); if (bytes.includes(0)) fail("creation-content-reference NUL"); if (bytes.length > 4096) fail("creation-content-reference length"); if (bytes.length > 2147483647) capacityFail("creation-content-reference capacity"); if (bytes.length < 1) fail("creation-content-reference length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
3870
+ const bytes = utf8(value); if (bytes.includes(0)) fail("creation-content-reference NUL"); if (bytes.length > 2147483647) capacityFail("creation-content-reference capacity"); if (bytes.length > 4096) fail("creation-content-reference length"); if (bytes.length < 1) fail("creation-content-reference length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
3378
3871
  }
3379
3872
  export function decodeCreationContentReference(bytes: Uint8Array, context: ServiceWireDecoderContext): CreationContentReference { const reader = new Reader(bytes); const value = readCreationContentReference(reader, context, {}, 0); reader.done("creation-content-reference"); return value; }
3380
3873
  export function encodeCreationContentReference(value: CreationContentReference, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeCreationContentReference(value, writer, context, {}, 0); return writer.result(); }
@@ -3383,11 +3876,12 @@ export type RelocationReference = string;
3383
3876
 
3384
3877
  function readRelocationReference(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): RelocationReference {
3385
3878
  void context; void enclosing; void flags;
3386
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 4096) fail("relocation-reference length"); if (length > 2147483647) capacityFail("relocation-reference capacity"); if (length < 1) fail("relocation-reference length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("relocation-reference NUL"); return decodeUtf8(bytes, "relocation-reference");
3879
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("relocation-reference capacity"); if (length > 4096) fail("relocation-reference length"); if (length < 1) fail("relocation-reference length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("relocation-reference NUL"); return decodeUtf8(bytes, "relocation-reference");
3387
3880
  }
3881
+
3388
3882
  function writeRelocationReference(input: RelocationReference, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3389
3883
  void context; void enclosing; void flags; const value: any = input;
3390
- const bytes = utf8(value); if (bytes.includes(0)) fail("relocation-reference NUL"); if (bytes.length > 4096) fail("relocation-reference length"); if (bytes.length > 2147483647) capacityFail("relocation-reference capacity"); if (bytes.length < 1) fail("relocation-reference length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
3884
+ const bytes = utf8(value); if (bytes.includes(0)) fail("relocation-reference NUL"); if (bytes.length > 2147483647) capacityFail("relocation-reference capacity"); if (bytes.length > 4096) fail("relocation-reference length"); if (bytes.length < 1) fail("relocation-reference length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
3391
3885
  }
3392
3886
  export function decodeRelocationReference(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationReference { const reader = new Reader(bytes); const value = readRelocationReference(reader, context, {}, 0); reader.done("relocation-reference"); return value; }
3393
3887
  export function encodeRelocationReference(value: RelocationReference, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeRelocationReference(value, writer, context, {}, 0); return writer.result(); }
@@ -3396,11 +3890,15 @@ export type AuthorityStoreVersion = string;
3396
3890
 
3397
3891
  function readAuthorityStoreVersion(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): AuthorityStoreVersion {
3398
3892
  void context; void enclosing; void flags;
3399
- const length = Number(readU16(reader, context, enclosing, flags)); if (length > 4096) fail("authority-store-version length"); if (length > 2147483647) capacityFail("authority-store-version capacity"); if (length < 1) fail("authority-store-version length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("authority-store-version NUL"); return decodeUtf8(bytes, "authority-store-version");
3893
+ const length = Number(readU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("authority-store-version capacity"); if (length > 4096) fail("authority-store-version length"); if (length < 1) fail("authority-store-version length"); const bytes = reader.take(length); if (bytes.includes(0)) fail("authority-store-version NUL"); return decodeUtf8(bytes, "authority-store-version");
3894
+ }
3895
+ function* readIncrementalAuthorityStoreVersion(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, AuthorityStoreVersion, void> {
3896
+ void context; void enclosing; void flags;
3897
+ const length = Number(yield* readIncrementalU16(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("authority-store-version capacity"); if (length > 4096) fail("authority-store-version length"); if (length < 1) fail("authority-store-version length"); return yield* reader.text(length, true, "authority-store-version");
3400
3898
  }
3401
3899
  function writeAuthorityStoreVersion(input: AuthorityStoreVersion, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3402
3900
  void context; void enclosing; void flags; const value: any = input;
3403
- const bytes = utf8(value); if (bytes.includes(0)) fail("authority-store-version NUL"); if (bytes.length > 4096) fail("authority-store-version length"); if (bytes.length > 2147483647) capacityFail("authority-store-version capacity"); if (bytes.length < 1) fail("authority-store-version length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
3901
+ const bytes = utf8(value); if (bytes.includes(0)) fail("authority-store-version NUL"); if (bytes.length > 2147483647) capacityFail("authority-store-version capacity"); if (bytes.length > 4096) fail("authority-store-version length"); if (bytes.length < 1) fail("authority-store-version length"); writeU16(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
3404
3902
  }
3405
3903
  export function decodeAuthorityStoreVersion(bytes: Uint8Array, context: ServiceWireDecoderContext): AuthorityStoreVersion { const reader = new Reader(bytes); const value = readAuthorityStoreVersion(reader, context, {}, 0); reader.done("authority-store-version"); return value; }
3406
3904
  export function encodeAuthorityStoreVersion(value: AuthorityStoreVersion, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeAuthorityStoreVersion(value, writer, context, {}, 0); return writer.result(); }
@@ -3427,6 +3925,28 @@ function readAuthorityGenerationFence(reader: Reader, context: ServiceWireDecode
3427
3925
 
3428
3926
 
3429
3927
 
3928
+ return value;
3929
+ }
3930
+ function* readIncrementalAuthorityGenerationFence(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, AuthorityGenerationFence, void> {
3931
+ void context; void enclosing; void flags;
3932
+ const value: any = {};
3933
+ value["objectGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3934
+
3935
+
3936
+ value["ownerId"] = yield* readIncrementalText8(reader, context, value, flags);
3937
+
3938
+
3939
+ value["authorityOwnerGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3940
+
3941
+
3942
+ value["leaseGeneration"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
3943
+
3944
+
3945
+ value["storeVersion"] = yield* readIncrementalAuthorityStoreVersion(reader, context, value, flags);
3946
+
3947
+
3948
+
3949
+
3430
3950
  return value;
3431
3951
  }
3432
3952
  function writeAuthorityGenerationFence(input: AuthorityGenerationFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -3481,6 +4001,7 @@ function readRelocationCoordinatorFence(reader: Reader, context: ServiceWireDeco
3481
4001
 
3482
4002
  return value;
3483
4003
  }
4004
+
3484
4005
  function writeRelocationCoordinatorFence(input: RelocationCoordinatorFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3485
4006
  void context; void enclosing; void flags; const value: any = input;
3486
4007
 
@@ -3530,6 +4051,7 @@ function readRelocationTargetFence(reader: Reader, context: ServiceWireDecoderCo
3530
4051
 
3531
4052
  return value;
3532
4053
  }
4054
+
3533
4055
  function writeRelocationTargetFence(input: RelocationTargetFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3534
4056
  void context; void enclosing; void flags; const value: any = input;
3535
4057
 
@@ -3575,6 +4097,7 @@ function readRequestSourceFence(reader: Reader, context: ServiceWireDecoderConte
3575
4097
 
3576
4098
  return value;
3577
4099
  }
4100
+
3578
4101
  function writeRequestSourceFence(input: RequestSourceFence, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3579
4102
  void context; void enclosing; void flags; const value: any = input;
3580
4103
 
@@ -3610,6 +4133,19 @@ function readRelocationId(reader: Reader, context: ServiceWireDecoderContext, en
3610
4133
  value["low"] = readU64(reader, context, value, flags);
3611
4134
 
3612
4135
 
4136
+ if (numeric(value["high"]) === 0n && numeric(value["low"]) === 0n) fail("relocation-id all zero");
4137
+
4138
+ return value;
4139
+ }
4140
+ function* readIncrementalRelocationId(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationId, void> {
4141
+ void context; void enclosing; void flags;
4142
+ const value: any = {};
4143
+ value["high"] = yield* readIncrementalU64(reader, context, value, flags);
4144
+
4145
+
4146
+ value["low"] = yield* readIncrementalU64(reader, context, value, flags);
4147
+
4148
+
3613
4149
  if (numeric(value["high"]) === 0n && numeric(value["low"]) === 0n) fail("relocation-id all zero");
3614
4150
 
3615
4151
  return value;
@@ -3647,6 +4183,7 @@ function readOptionalActorRef(reader: Reader, context: ServiceWireDecoderContext
3647
4183
 
3648
4184
  return value;
3649
4185
  }
4186
+
3650
4187
  function writeOptionalActorRef(input: OptionalActorRef, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3651
4188
  void context; void enclosing; void flags; const value: any = input;
3652
4189
 
@@ -3683,6 +4220,7 @@ function readOptionalBoundSessionTail(reader: Reader, context: ServiceWireDecode
3683
4220
 
3684
4221
  return value;
3685
4222
  }
4223
+
3686
4224
  function writeOptionalBoundSessionTail(input: OptionalBoundSessionTail, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3687
4225
  void context; void enclosing; void flags; const value: any = input;
3688
4226
 
@@ -3718,6 +4256,7 @@ function readChannelEntry(reader: Reader, context: ServiceWireDecoderContext, en
3718
4256
 
3719
4257
  return value;
3720
4258
  }
4259
+
3721
4260
  function writeChannelEntry(input: ChannelEntry, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3722
4261
  void context; void enclosing; void flags; const value: any = input;
3723
4262
 
@@ -3739,15 +4278,16 @@ export type ChannelVector = readonly ChannelEntry[];
3739
4278
  function readChannelVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): ChannelVector {
3740
4279
  void context; void enclosing; void flags;
3741
4280
  const count = Number(readU16(reader, context, enclosing, flags)); const value: any = Array.from({ length: count }, () => readChannelEntry(reader, context, enclosing, flags));
3742
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]["channelName"]), utf8(value[index]["channelName"]))]) >= 0) fail("channel-vector sorted");
3743
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBytes(utf8(value[left]["channelName"]), utf8(value[right]["channelName"]))]) === 0) fail("channel-vector unique");
4281
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]["channelName"]), utf8(value[index]["channelName"]))]) >= 0) fail("channel-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("channel-vector constraint capacity"); throw error; }
4282
+
3744
4283
  return value;
3745
4284
  }
4285
+
3746
4286
  function writeChannelVector(input: ChannelVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3747
4287
  void context; void enclosing; void flags; const value: any = input;
3748
4288
  if (!Array.isArray(value)) fail("channel-vector count");
3749
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]["channelName"]), utf8(value[index]["channelName"]))]) >= 0) fail("channel-vector sorted");
3750
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBytes(utf8(value[left]["channelName"]), utf8(value[right]["channelName"]))]) === 0) fail("channel-vector unique");
4289
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]["channelName"]), utf8(value[index]["channelName"]))]) >= 0) fail("channel-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("channel-vector constraint capacity"); throw error; }
4290
+
3751
4291
  writeU16(value.length, writer, context, enclosing, flags); for (const item of value) writeChannelEntry(item, writer, context, enclosing, flags);
3752
4292
  }
3753
4293
  export function decodeChannelVector(bytes: Uint8Array, context: ServiceWireDecoderContext): ChannelVector { const reader = new Reader(bytes); const value = readChannelVector(reader, context, {}, 0); reader.done("channel-vector"); return value; }
@@ -3758,15 +4298,16 @@ export type SortedText8Vector = readonly Text8[];
3758
4298
  function readSortedText8Vector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): SortedText8Vector {
3759
4299
  void context; void enclosing; void flags;
3760
4300
  const count = Number(readU16(reader, context, enclosing, flags)); if (count > 1024) fail("sorted-text8-vector count"); const value: any = Array.from({ length: count }, () => readText8(reader, context, enclosing, flags));
3761
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]), utf8(value[index]))]) >= 0) fail("sorted-text8-vector sorted");
3762
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBytes(utf8(value[left]), utf8(value[right]))]) === 0) fail("sorted-text8-vector unique");
4301
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]), utf8(value[index]))]) >= 0) fail("sorted-text8-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("sorted-text8-vector constraint capacity"); throw error; }
4302
+
3763
4303
  return value;
3764
4304
  }
4305
+
3765
4306
  function writeSortedText8Vector(input: SortedText8Vector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3766
4307
  void context; void enclosing; void flags; const value: any = input;
3767
4308
  if (!Array.isArray(value) || value.length > 1024) fail("sorted-text8-vector count");
3768
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]), utf8(value[index]))]) >= 0) fail("sorted-text8-vector sorted");
3769
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBytes(utf8(value[left]), utf8(value[right]))]) === 0) fail("sorted-text8-vector unique");
4309
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBytes(utf8(value[index - 1]), utf8(value[index]))]) >= 0) fail("sorted-text8-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("sorted-text8-vector constraint capacity"); throw error; }
4310
+
3770
4311
  writeU16(value.length, writer, context, enclosing, flags); for (const item of value) writeText8(item, writer, context, enclosing, flags);
3771
4312
  }
3772
4313
  export function decodeSortedText8Vector(bytes: Uint8Array, context: ServiceWireDecoderContext): SortedText8Vector { const reader = new Reader(bytes); const value = readSortedText8Vector(reader, context, {}, 0); reader.done("sorted-text8-vector"); return value; }
@@ -3802,6 +4343,7 @@ function readStatefulCapabilityEntry(reader: Reader, context: ServiceWireDecoder
3802
4343
 
3803
4344
  return value;
3804
4345
  }
4346
+
3805
4347
  function writeStatefulCapabilityEntry(input: StatefulCapabilityEntry, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3806
4348
  void context; void enclosing; void flags; const value: any = input;
3807
4349
 
@@ -3843,15 +4385,16 @@ export type StatefulCapabilityVector = readonly StatefulCapabilityEntry[];
3843
4385
  function readStatefulCapabilityVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): StatefulCapabilityVector {
3844
4386
  void context; void enclosing; void flags;
3845
4387
  const count = Number(readU16(reader, context, enclosing, flags)); if (count > 1024) fail("stateful-capability-vector count"); const value: any = Array.from({ length: count }, () => readStatefulCapabilityEntry(reader, context, enclosing, flags));
3846
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(enumWireStatefulObjectKind(value[index - 1]["objectKind"])), numeric(enumWireStatefulObjectKind(value[index]["objectKind"]))), compareBytes(utf8(value[index - 1]["type"]), utf8(value[index]["type"]))]) >= 0) fail("stateful-capability-vector sorted");
3847
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(enumWireStatefulObjectKind(value[left]["objectKind"])), numeric(enumWireStatefulObjectKind(value[right]["objectKind"]))), compareBytes(utf8(value[left]["type"]), utf8(value[right]["type"]))]) === 0) fail("stateful-capability-vector unique");
4388
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(enumWireStatefulObjectKind(value[index - 1]["objectKind"])), numeric(enumWireStatefulObjectKind(value[index]["objectKind"]))), compareBytes(utf8(value[index - 1]["type"]), utf8(value[index]["type"]))]) >= 0) fail("stateful-capability-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("stateful-capability-vector constraint capacity"); throw error; }
4389
+
3848
4390
  return value;
3849
4391
  }
4392
+
3850
4393
  function writeStatefulCapabilityVector(input: StatefulCapabilityVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3851
4394
  void context; void enclosing; void flags; const value: any = input;
3852
4395
  if (!Array.isArray(value) || value.length > 1024) fail("stateful-capability-vector count");
3853
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(enumWireStatefulObjectKind(value[index - 1]["objectKind"])), numeric(enumWireStatefulObjectKind(value[index]["objectKind"]))), compareBytes(utf8(value[index - 1]["type"]), utf8(value[index]["type"]))]) >= 0) fail("stateful-capability-vector sorted");
3854
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(enumWireStatefulObjectKind(value[left]["objectKind"])), numeric(enumWireStatefulObjectKind(value[right]["objectKind"]))), compareBytes(utf8(value[left]["type"]), utf8(value[right]["type"]))]) === 0) fail("stateful-capability-vector unique");
4396
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(enumWireStatefulObjectKind(value[index - 1]["objectKind"])), numeric(enumWireStatefulObjectKind(value[index]["objectKind"]))), compareBytes(utf8(value[index - 1]["type"]), utf8(value[index]["type"]))]) >= 0) fail("stateful-capability-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("stateful-capability-vector constraint capacity"); throw error; }
4397
+
3855
4398
  writeU16(value.length, writer, context, enclosing, flags); for (const item of value) writeStatefulCapabilityEntry(item, writer, context, enclosing, flags);
3856
4399
  }
3857
4400
  export function decodeStatefulCapabilityVector(bytes: Uint8Array, context: ServiceWireDecoderContext): StatefulCapabilityVector { const reader = new Reader(bytes); const value = readStatefulCapabilityVector(reader, context, {}, 0); reader.done("stateful-capability-vector"); return value; }
@@ -3933,6 +4476,7 @@ function readDescriptorExtension(reader: Reader, context: ServiceWireDecoderCont
3933
4476
  if (reader.offset - limitStart > 1048576) fail("descriptor-extension maximum");
3934
4477
  return decoded;
3935
4478
  }
4479
+
3936
4480
  function writeDescriptorExtension(input: DescriptorExtension, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
3937
4481
  void context; void enclosing; void flags; const value: any = input;
3938
4482
  const limitStart = writer.length;
@@ -4035,6 +4579,7 @@ function readRouteMeshAdmission(reader: Reader, context: ServiceWireDecoderConte
4035
4579
 
4036
4580
  return value;
4037
4581
  }
4582
+
4038
4583
  function writeRouteMeshAdmission(input: RouteMeshAdmission, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4039
4584
  void context; void enclosing; void flags; const value: any = input;
4040
4585
 
@@ -4127,6 +4672,7 @@ function readClientServerAdmission(reader: Reader, context: ServiceWireDecoderCo
4127
4672
 
4128
4673
  return value;
4129
4674
  }
4675
+
4130
4676
  function writeClientServerAdmission(input: ClientServerAdmission, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4131
4677
  void context; void enclosing; void flags; const value: any = input;
4132
4678
 
@@ -4222,6 +4768,7 @@ function readServiceAdmission(reader: Reader, context: ServiceWireDecoderContext
4222
4768
  if (reader.offset - limitStart > 1048576) fail("service-admission maximum");
4223
4769
  return decoded;
4224
4770
  }
4771
+
4225
4772
  function writeServiceAdmission(input: ServiceAdmission, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4226
4773
  void context; void enclosing; void flags; const value: any = input;
4227
4774
  const limitStart = writer.length;
@@ -4265,6 +4812,7 @@ function readInstanceReplyRoute(reader: Reader, context: ServiceWireDecoderConte
4265
4812
 
4266
4813
  return value;
4267
4814
  }
4815
+
4268
4816
  function writeInstanceReplyRoute(input: InstanceReplyRoute, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4269
4817
  void context; void enclosing; void flags; const value: any = input;
4270
4818
 
@@ -4305,6 +4853,7 @@ function readColdActivationReplyContext(reader: Reader, context: ServiceWireDeco
4305
4853
 
4306
4854
  return value;
4307
4855
  }
4856
+
4308
4857
  function writeColdActivationReplyContext(input: ColdActivationReplyContext, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4309
4858
  void context; void enclosing; void flags; const value: any = input;
4310
4859
 
@@ -4360,6 +4909,7 @@ function readReplyRelayContext(reader: Reader, context: ServiceWireDecoderContex
4360
4909
 
4361
4910
  return value;
4362
4911
  }
4912
+
4363
4913
  function writeReplyRelayContext(input: ReplyRelayContext, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4364
4914
  void context; void enclosing; void flags; const value: any = input;
4365
4915
 
@@ -4429,6 +4979,39 @@ function readSendReadyDestination(reader: Reader, context: ServiceWireDecoderCon
4429
4979
  value["bindingGeneration"] = readNonzeroU64(body, context, value, flags);
4430
4980
 
4431
4981
 
4982
+ } else fail("send-ready-destination discriminator");
4983
+ body.done("send-ready-destination");
4984
+
4985
+ return value;
4986
+ }
4987
+ function* readIncrementalSendReadyDestination(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, SendReadyDestination, void> {
4988
+ void context; void enclosing; void flags;
4989
+ const value: any = {};
4990
+ value["destinationKind"] = yield* readIncrementalMeshDestinationKind(reader, context, enclosing, flags);
4991
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
4992
+ if (same(value["destinationKind"], "node")) {
4993
+ value["targetNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
4994
+
4995
+
4996
+ } else if (same(value["destinationKind"], "channel")) {
4997
+ value["channelName"] = yield* readIncrementalText8(body, context, value, flags);
4998
+
4999
+
5000
+ } else if (same(value["destinationKind"], "spot")) {
5001
+ value["targetSpot"] = yield* readIncrementalSpotRouteFence(body, context, value, flags);
5002
+
5003
+
5004
+ } else if (same(value["destinationKind"], "actor")) {
5005
+ value["targetActor"] = yield* readIncrementalActorRouteFence(body, context, value, flags);
5006
+
5007
+
5008
+ } else if (same(value["destinationKind"], "boundSession")) {
5009
+ value["targetActor"] = yield* readIncrementalActorRouteFence(body, context, value, flags);
5010
+
5011
+
5012
+ value["bindingGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5013
+
5014
+
4432
5015
  } else fail("send-ready-destination discriminator");
4433
5016
  body.done("send-ready-destination");
4434
5017
 
@@ -4492,6 +5075,19 @@ function readActorMembershipSnapshot(reader: Reader, context: ServiceWireDecoder
4492
5075
 
4493
5076
 
4494
5077
 
5078
+ return value;
5079
+ }
5080
+ function* readIncrementalActorMembershipSnapshot(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ActorMembershipSnapshot, void> {
5081
+ void context; void enclosing; void flags;
5082
+ const value: any = {};
5083
+ value["actor"] = yield* readIncrementalActorRef(reader, context, value, flags);
5084
+
5085
+
5086
+ value["membership"] = yield* readIncrementalSpotMembership(reader, context, value, flags);
5087
+
5088
+
5089
+
5090
+
4495
5091
  return value;
4496
5092
  }
4497
5093
  function writeActorMembershipSnapshot(input: ActorMembershipSnapshot, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -4523,6 +5119,22 @@ function readOptionalActorMembershipSnapshot(reader: Reader, context: ServiceWir
4523
5119
  value["snapshot"] = readActorMembershipSnapshot(body, context, value, flags);
4524
5120
 
4525
5121
 
5122
+ } else fail("optional-actor-membership-snapshot discriminator");
5123
+ body.done("optional-actor-membership-snapshot");
5124
+
5125
+ return value;
5126
+ }
5127
+ function* readIncrementalOptionalActorMembershipSnapshot(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, OptionalActorMembershipSnapshot, void> {
5128
+ void context; void enclosing; void flags;
5129
+ const value: any = {};
5130
+ value["hasSnapshot"] = yield* readIncrementalBool8(reader, context, enclosing, flags);
5131
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
5132
+ if (same(value["hasSnapshot"], "false")) {
5133
+
5134
+ } else if (same(value["hasSnapshot"], "true")) {
5135
+ value["snapshot"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5136
+
5137
+
4526
5138
  } else fail("optional-actor-membership-snapshot discriminator");
4527
5139
  body.done("optional-actor-membership-snapshot");
4528
5140
 
@@ -4581,6 +5193,42 @@ function readActorControlData(reader: Reader, context: ServiceWireDecoderContext
4581
5193
  value["previous"] = readActorMembershipSnapshot(body, context, value, flags);
4582
5194
 
4583
5195
 
5196
+ } else fail("actor-control-data discriminator");
5197
+ body.done("actor-control-data");
5198
+
5199
+ return value;
5200
+ }
5201
+ function* readIncrementalActorControlData(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, ActorControlData, void> {
5202
+ void context; void enclosing; void flags;
5203
+ const value: any = {};
5204
+ value["lifecycleKind"] = yield* readIncrementalActorLifecycleKind(reader, context, enclosing, flags);
5205
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
5206
+ if (same(value["lifecycleKind"], "created")) {
5207
+ value["current"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5208
+
5209
+
5210
+ } else if (same(value["lifecycleKind"], "joined")) {
5211
+ value["previous"] = yield* readIncrementalOptionalActorMembershipSnapshot(body, context, value, flags);
5212
+
5213
+
5214
+ value["current"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5215
+
5216
+
5217
+ } else if (same(value["lifecycleKind"], "left")) {
5218
+ value["previous"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5219
+
5220
+
5221
+ value["current"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5222
+
5223
+
5224
+ } else if (same(value["lifecycleKind"], "disconnected")) {
5225
+ value["current"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5226
+
5227
+
5228
+ } else if (same(value["lifecycleKind"], "destroyed")) {
5229
+ value["previous"] = yield* readIncrementalActorMembershipSnapshot(body, context, value, flags);
5230
+
5231
+
4584
5232
  } else fail("actor-control-data discriminator");
4585
5233
  body.done("actor-control-data");
4586
5234
 
@@ -4659,13 +5307,41 @@ function readRelocationControlData(reader: Reader, context: ServiceWireDecoderCo
4659
5307
 
4660
5308
 
4661
5309
 
4662
- if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("relocation-control-data runtime predicate");
5310
+ void context;
5311
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("relocation-control-data runtime predicate");
5312
+ return value;
5313
+ }
5314
+ function* readIncrementalRelocationControlData(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationControlData, void> {
5315
+ void context; void enclosing; void flags;
5316
+ const value: any = {};
5317
+ value["phase"] = yield* readIncrementalRelocationPhase(reader, context, value, flags);
5318
+
5319
+
5320
+ value["role"] = yield* readIncrementalRelocationRole(reader, context, value, flags);
5321
+
5322
+
5323
+ value["relocation"] = yield* readIncrementalRelocationId(reader, context, value, flags);
5324
+
5325
+
5326
+ value["object"] = yield* readIncrementalRelocationObjectIdentity(reader, context, value, flags);
5327
+
5328
+
5329
+ value["terminalResult"] = yield* readIncrementalRequestTerminalResult(reader, context, value, flags);
5330
+
5331
+
5332
+ value["failureCode"] = yield* readIncrementalFrameworkErrorCode(reader, context, value, flags);
5333
+
5334
+
5335
+
5336
+ void context;
5337
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("relocation-control-data runtime predicate");
4663
5338
  return value;
4664
5339
  }
4665
5340
  function writeRelocationControlData(input: RelocationControlData, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4666
5341
  void context; void enclosing; void flags; const value: any = input;
4667
5342
 
4668
- if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("relocation-control-data runtime predicate");
5343
+ void context;
5344
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("relocation-control-data runtime predicate");
4669
5345
  if (value["phase"] === undefined) fail("phase required");
4670
5346
 
4671
5347
 
@@ -4751,6 +5427,7 @@ function readRequestSpecificTail(reader: Reader, context: ServiceWireDecoderCont
4751
5427
 
4752
5428
  return value;
4753
5429
  }
5430
+
4754
5431
  function writeRequestSpecificTail(input: RequestSpecificTail, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4755
5432
  void context; void enclosing; void flags; const value: any = input;
4756
5433
 
@@ -4911,6 +5588,7 @@ function readFrozenRecordBody(reader: Reader, context: ServiceWireDecoderContext
4911
5588
 
4912
5589
 
4913
5590
  }
5591
+ if (!validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"]))) fail("terminal failure predicate");
4914
5592
  } else if (same(value["recordKind"], "sendReady")) {
4915
5593
  value["destination"] = readSendReadyDestination(body, context, value, flags);
4916
5594
 
@@ -4934,12 +5612,123 @@ function readFrozenRecordBody(reader: Reader, context: ServiceWireDecoderContext
4934
5612
 
4935
5613
  } else fail("frozen-record-body discriminator");
4936
5614
 
4937
- if (same(value["recordKind"], "completion") && !(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("frozen-record-body runtime predicate");
5615
+
5616
+ return value;
5617
+ }
5618
+ function* readIncrementalFrozenRecordBody(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, FrozenRecordBody, void> {
5619
+ void context; void enclosing; void flags;
5620
+ const value: any = {};
5621
+ value["recordKind"] = enclosing["recordKind"];
5622
+ const body = reader;
5623
+ if (same(value["recordKind"], "nodeSend")) {
5624
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5625
+
5626
+
5627
+ } else if (same(value["recordKind"], "nodeRequest")) {
5628
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5629
+
5630
+
5631
+ } else if (same(value["recordKind"], "channelSend")) {
5632
+ value["channelName"] = yield* readIncrementalText8(body, context, value, flags);
5633
+
5634
+
5635
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5636
+
5637
+
5638
+ } else if (same(value["recordKind"], "channelRequest")) {
5639
+ value["channelName"] = yield* readIncrementalText8(body, context, value, flags);
5640
+
5641
+
5642
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5643
+
5644
+
5645
+ } else if (same(value["recordKind"], "spotSend")) {
5646
+ value["targetSpot"] = yield* readIncrementalSpotRouteFence(body, context, value, flags);
5647
+
5648
+
5649
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5650
+
5651
+
5652
+ } else if (same(value["recordKind"], "spotRequest")) {
5653
+ value["targetSpot"] = yield* readIncrementalSpotRouteFence(body, context, value, flags);
5654
+
5655
+
5656
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5657
+
5658
+
5659
+ } else if (same(value["recordKind"], "spotMulticast")) {
5660
+ value["channelName"] = yield* readIncrementalText8(body, context, value, flags);
5661
+
5662
+
5663
+ value["topic"] = yield* readIncrementalText8(body, context, value, flags);
5664
+
5665
+
5666
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5667
+
5668
+
5669
+ } else if (same(value["recordKind"], "spotControl")) {
5670
+ value["control"] = yield* readIncrementalActorControlData(body, context, value, flags);
5671
+
5672
+
5673
+ } else if (same(value["recordKind"], "actorSend")) {
5674
+ value["targetActor"] = yield* readIncrementalActorRouteFence(body, context, value, flags);
5675
+
5676
+
5677
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5678
+
5679
+
5680
+ } else if (same(value["recordKind"], "actorRequest")) {
5681
+ value["targetActor"] = yield* readIncrementalActorRouteFence(body, context, value, flags);
5682
+
5683
+
5684
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5685
+
5686
+
5687
+ } else if (same(value["recordKind"], "completion")) {
5688
+ value["terminalResult"] = yield* readIncrementalRequestTerminalResult(body, context, value, flags);
5689
+
5690
+
5691
+ value["failureCode"] = yield* readIncrementalFrameworkErrorCode(body, context, value, flags);
5692
+
5693
+
5694
+ value["hasPayload"] = yield* readIncrementalBool8(body, context, value, flags);
5695
+
5696
+
5697
+ if (same(value["hasPayload"], "true")) {
5698
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5699
+
5700
+
5701
+ }
5702
+ if (!validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"]))) fail("terminal failure predicate");
5703
+ } else if (same(value["recordKind"], "sendReady")) {
5704
+ value["destination"] = yield* readIncrementalSendReadyDestination(body, context, value, flags);
5705
+
5706
+
5707
+ } else if (same(value["recordKind"], "relocationControl")) {
5708
+ value["control"] = yield* readIncrementalRelocationControlData(body, context, value, flags);
5709
+
5710
+
5711
+ } else if (same(value["recordKind"], "instanceSpotActivation")) {
5712
+ value["route"] = yield* readIncrementalInstanceRouteV1(body, context, value, flags);
5713
+
5714
+
5715
+ value["sourceNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5716
+
5717
+
5718
+ value["operationKind"] = yield* readIncrementalInstanceOperationKind(body, context, value, flags);
5719
+
5720
+
5721
+ value["payload"] = yield* readIncrementalApplicationPayloadEnvelopeV1(body, context, value, flags);
5722
+
5723
+
5724
+ } else fail("frozen-record-body discriminator");
5725
+
5726
+
4938
5727
  return value;
4939
5728
  }
4940
5729
  function writeFrozenRecordBody(input: FrozenRecordBody, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
4941
5730
  void context; void enclosing; void flags; const value: any = input;
4942
- if (same(value["recordKind"], "completion") && !(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("frozen-record-body runtime predicate");
5731
+
4943
5732
 
4944
5733
  const body = writer;
4945
5734
  if (same(value["recordKind"], "nodeSend")) {
@@ -5054,6 +5843,7 @@ function writeFrozenRecordBody(input: FrozenRecordBody, writer: Writer, context:
5054
5843
 
5055
5844
  writeApplicationPayloadEnvelopeV1(value["payload"], body, context, value, flags);
5056
5845
  } else if (value["payload"] !== undefined) fail("payload forbidden");
5846
+ if (!validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"]))) fail("terminal failure predicate");
5057
5847
  } else if (same(value["recordKind"], "sendReady")) {
5058
5848
  if (value["payload"] !== undefined || value["channelName"] !== undefined || value["targetSpot"] !== undefined || value["topic"] !== undefined || value["control"] !== undefined || value["targetActor"] !== undefined || value["terminalResult"] !== undefined || value["failureCode"] !== undefined || value["hasPayload"] !== undefined || value["route"] !== undefined || value["sourceNodeGeneration"] !== undefined || value["operationKind"] !== undefined) fail("frozen-record-body discriminator agreement");
5059
5849
  if (value["destination"] === undefined) fail("destination required");
@@ -5090,81 +5880,161 @@ function writeFrozenRecordBody(input: FrozenRecordBody, writer: Writer, context:
5090
5880
  export function decodeFrozenRecordBody(bytes: Uint8Array, context: ServiceWireDecoderContext): FrozenRecordBody { const reader = new Reader(bytes); const value = readFrozenRecordBody(reader, context, {}, 0); reader.done("frozen-record-body"); return value; }
5091
5881
  export function encodeFrozenRecordBody(value: FrozenRecordBody, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeFrozenRecordBody(value, writer, context, {}, 0); return writer.result(); }
5092
5882
 
5093
- export type FrozenSourceIdentity = { readonly sourceKind: "node"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64 } | { readonly sourceKind: "spot"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64; readonly sourceSpotId: Text8 } | { readonly sourceKind: "actor"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64; readonly sourceActor: ActorRef } | { readonly sourceKind: "boundSession"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64; readonly sourceActor: ActorRef; readonly sourceSessionRid: Rid; readonly sourceBindingGeneration: NonzeroU64; readonly sourceSessionSequence: NonzeroU64 };
5883
+ export type FrozenSourceIdentity = { readonly sourceKind: "node"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64 } | { readonly sourceKind: "spot"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64; readonly sourceSpotId: Text8 } | { readonly sourceKind: "actor"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64; readonly sourceActor: ActorRef } | { readonly sourceKind: "boundSession"; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly sourceOwnerId: Text8; readonly sourceOwnerLeaseGeneration: NonzeroU64; readonly sourceActor: ActorRef; readonly sourceSessionRid: Rid; readonly sourceBindingGeneration: NonzeroU64; readonly sourceSessionSequence: NonzeroU64 };
5884
+
5885
+ function readFrozenSourceIdentity(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): FrozenSourceIdentity {
5886
+ void context; void enclosing; void flags;
5887
+ const value: any = {};
5888
+ value["sourceKind"] = readFrozenSourceKind(reader, context, enclosing, flags);
5889
+ const body = reader.bounded(Number(readU16(reader, context, enclosing, flags)));
5890
+ if (same(value["sourceKind"], "node")) {
5891
+ value["sourceNodeRid"] = readRid(body, context, value, flags);
5892
+
5893
+
5894
+ value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
5895
+
5896
+
5897
+ value["sourceOwnerId"] = readText8(body, context, value, flags);
5898
+
5899
+
5900
+ value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
5901
+
5902
+
5903
+ } else if (same(value["sourceKind"], "spot")) {
5904
+ value["sourceNodeRid"] = readRid(body, context, value, flags);
5905
+
5906
+
5907
+ value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
5908
+
5909
+
5910
+ value["sourceOwnerId"] = readText8(body, context, value, flags);
5911
+
5912
+
5913
+ value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
5914
+
5915
+
5916
+ value["sourceSpotId"] = readText8(body, context, value, flags);
5917
+
5918
+
5919
+ } else if (same(value["sourceKind"], "actor")) {
5920
+ value["sourceNodeRid"] = readRid(body, context, value, flags);
5921
+
5922
+
5923
+ value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
5924
+
5925
+
5926
+ value["sourceOwnerId"] = readText8(body, context, value, flags);
5927
+
5928
+
5929
+ value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
5930
+
5931
+
5932
+ value["sourceActor"] = readActorRef(body, context, value, flags);
5933
+
5934
+
5935
+ } else if (same(value["sourceKind"], "boundSession")) {
5936
+ value["sourceNodeRid"] = readRid(body, context, value, flags);
5937
+
5938
+
5939
+ value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
5940
+
5941
+
5942
+ value["sourceOwnerId"] = readText8(body, context, value, flags);
5943
+
5944
+
5945
+ value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
5946
+
5947
+
5948
+ value["sourceActor"] = readActorRef(body, context, value, flags);
5949
+
5950
+
5951
+ value["sourceSessionRid"] = readRid(body, context, value, flags);
5952
+
5953
+
5954
+ value["sourceBindingGeneration"] = readNonzeroU64(body, context, value, flags);
5955
+
5956
+
5957
+ value["sourceSessionSequence"] = readNonzeroU64(body, context, value, flags);
5958
+
5094
5959
 
5095
- function readFrozenSourceIdentity(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): FrozenSourceIdentity {
5960
+ } else fail("frozen-source-identity discriminator");
5961
+ body.done("frozen-source-identity");
5962
+
5963
+ return value;
5964
+ }
5965
+ function* readIncrementalFrozenSourceIdentity(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, FrozenSourceIdentity, void> {
5096
5966
  void context; void enclosing; void flags;
5097
5967
  const value: any = {};
5098
- value["sourceKind"] = readFrozenSourceKind(reader, context, enclosing, flags);
5099
- const body = reader.bounded(Number(readU16(reader, context, enclosing, flags)));
5968
+ value["sourceKind"] = yield* readIncrementalFrozenSourceKind(reader, context, enclosing, flags);
5969
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
5100
5970
  if (same(value["sourceKind"], "node")) {
5101
- value["sourceNodeRid"] = readRid(body, context, value, flags);
5971
+ value["sourceNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
5102
5972
 
5103
5973
 
5104
- value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
5974
+ value["sourceNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5105
5975
 
5106
5976
 
5107
- value["sourceOwnerId"] = readText8(body, context, value, flags);
5977
+ value["sourceOwnerId"] = yield* readIncrementalText8(body, context, value, flags);
5108
5978
 
5109
5979
 
5110
- value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
5980
+ value["sourceOwnerLeaseGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5111
5981
 
5112
5982
 
5113
5983
  } else if (same(value["sourceKind"], "spot")) {
5114
- value["sourceNodeRid"] = readRid(body, context, value, flags);
5984
+ value["sourceNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
5115
5985
 
5116
5986
 
5117
- value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
5987
+ value["sourceNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5118
5988
 
5119
5989
 
5120
- value["sourceOwnerId"] = readText8(body, context, value, flags);
5990
+ value["sourceOwnerId"] = yield* readIncrementalText8(body, context, value, flags);
5121
5991
 
5122
5992
 
5123
- value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
5993
+ value["sourceOwnerLeaseGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5124
5994
 
5125
5995
 
5126
- value["sourceSpotId"] = readText8(body, context, value, flags);
5996
+ value["sourceSpotId"] = yield* readIncrementalText8(body, context, value, flags);
5127
5997
 
5128
5998
 
5129
5999
  } else if (same(value["sourceKind"], "actor")) {
5130
- value["sourceNodeRid"] = readRid(body, context, value, flags);
6000
+ value["sourceNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
5131
6001
 
5132
6002
 
5133
- value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
6003
+ value["sourceNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5134
6004
 
5135
6005
 
5136
- value["sourceOwnerId"] = readText8(body, context, value, flags);
6006
+ value["sourceOwnerId"] = yield* readIncrementalText8(body, context, value, flags);
5137
6007
 
5138
6008
 
5139
- value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
6009
+ value["sourceOwnerLeaseGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5140
6010
 
5141
6011
 
5142
- value["sourceActor"] = readActorRef(body, context, value, flags);
6012
+ value["sourceActor"] = yield* readIncrementalActorRef(body, context, value, flags);
5143
6013
 
5144
6014
 
5145
6015
  } else if (same(value["sourceKind"], "boundSession")) {
5146
- value["sourceNodeRid"] = readRid(body, context, value, flags);
6016
+ value["sourceNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
5147
6017
 
5148
6018
 
5149
- value["sourceNodeGeneration"] = readNonzeroU64(body, context, value, flags);
6019
+ value["sourceNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5150
6020
 
5151
6021
 
5152
- value["sourceOwnerId"] = readText8(body, context, value, flags);
6022
+ value["sourceOwnerId"] = yield* readIncrementalText8(body, context, value, flags);
5153
6023
 
5154
6024
 
5155
- value["sourceOwnerLeaseGeneration"] = readNonzeroU64(body, context, value, flags);
6025
+ value["sourceOwnerLeaseGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5156
6026
 
5157
6027
 
5158
- value["sourceActor"] = readActorRef(body, context, value, flags);
6028
+ value["sourceActor"] = yield* readIncrementalActorRef(body, context, value, flags);
5159
6029
 
5160
6030
 
5161
- value["sourceSessionRid"] = readRid(body, context, value, flags);
6031
+ value["sourceSessionRid"] = yield* readIncrementalRid(body, context, value, flags);
5162
6032
 
5163
6033
 
5164
- value["sourceBindingGeneration"] = readNonzeroU64(body, context, value, flags);
6034
+ value["sourceBindingGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5165
6035
 
5166
6036
 
5167
- value["sourceSessionSequence"] = readNonzeroU64(body, context, value, flags);
6037
+ value["sourceSessionSequence"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
5168
6038
 
5169
6039
 
5170
6040
  } else fail("frozen-source-identity discriminator");
@@ -5306,6 +6176,38 @@ function readFrozenReplyRoute(reader: Reader, context: ServiceWireDecoderContext
5306
6176
  value["replyRouteId"] = readNonzeroU64(body, context, value, flags);
5307
6177
 
5308
6178
 
6179
+ } else {
6180
+
6181
+ }
6182
+ body.done("frozen-reply-route");
6183
+
6184
+ return value;
6185
+ }
6186
+ function* readIncrementalFrozenReplyRoute(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, FrozenReplyRoute, void> {
6187
+ void context; void enclosing; void flags;
6188
+ const value: any = {};
6189
+ value["originalOperationKind"] = enclosing["operationKind"];
6190
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
6191
+ if (same(value["originalOperationKind"], "nodeRequest")) {
6192
+ value["replyRouteId"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6193
+
6194
+
6195
+ } else if (same(value["originalOperationKind"], "channelRequest")) {
6196
+ value["replyRouteId"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6197
+
6198
+
6199
+ } else if (same(value["originalOperationKind"], "spotRequest")) {
6200
+ value["replyRouteId"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6201
+
6202
+
6203
+ } else if (same(value["originalOperationKind"], "actorRequest")) {
6204
+ value["replyRouteId"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6205
+
6206
+
6207
+ } else if (same(value["originalOperationKind"], "instanceSpotRequest")) {
6208
+ value["replyRouteId"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6209
+
6210
+
5309
6211
  } else {
5310
6212
 
5311
6213
  }
@@ -5390,6 +6292,39 @@ function readFrozenRecord(reader: Reader, context: ServiceWireDecoderContext, en
5390
6292
 
5391
6293
 
5392
6294
 
6295
+ return value;
6296
+ }
6297
+ function* readIncrementalFrozenRecord(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, FrozenRecord, void> {
6298
+ void context; void enclosing; void flags;
6299
+ const value: any = {};
6300
+ value["recordKind"] = yield* readIncrementalMeshRecordKind(reader, context, value, flags);
6301
+
6302
+
6303
+ value["source"] = yield* readIncrementalFrozenSourceIdentity(reader, context, value, flags);
6304
+
6305
+
6306
+ value["hasMetadata"] = yield* readIncrementalBool8(reader, context, value, flags);
6307
+
6308
+
6309
+ if (same(value["hasMetadata"], "true")) {
6310
+ value["metadata"] = yield* readIncrementalMetadataFrame(reader, context, value, flags);
6311
+
6312
+
6313
+ }
6314
+ value["operationId"] = yield* readIncrementalOperationIdOrZero(reader, context, value, flags);
6315
+
6316
+
6317
+ value["operationKind"] = yield* readIncrementalMeshOperationKind(reader, context, value, flags);
6318
+
6319
+
6320
+ value["replyRoute"] = yield* readIncrementalFrozenReplyRoute(reader, context, value, flags);
6321
+
6322
+
6323
+ value["body"] = yield* readIncrementalFrozenRecordBody(reader, context, value, flags);
6324
+
6325
+
6326
+
6327
+
5393
6328
  return value;
5394
6329
  }
5395
6330
  function writeFrozenRecord(input: FrozenRecord, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -5476,6 +6411,51 @@ function readInstanceRouteV1(reader: Reader, context: ServiceWireDecoderContext,
5476
6411
  value["deadlineUnixMs"] = readNonzeroU64(body, context, value, flags);
5477
6412
 
5478
6413
 
6414
+ } else fail("instance-route-v1 discriminator");
6415
+ body.done("instance-route-v1");
6416
+
6417
+ return value;
6418
+ }
6419
+ function* readIncrementalInstanceRouteV1(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, InstanceRouteV1, void> {
6420
+ void context; void enclosing; void flags;
6421
+ const value: any = {};
6422
+ value["routeKind"] = yield* readIncrementalInstanceRouteKind(reader, context, enclosing, flags);
6423
+ const body = reader.bounded(Number(yield* readIncrementalU16(reader, context, enclosing, flags)));
6424
+ if (same(value["routeKind"], "ready")) {
6425
+ value["targetNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
6426
+
6427
+
6428
+ value["targetNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6429
+
6430
+
6431
+ value["targetSpotId"] = yield* readIncrementalText8(body, context, value, flags);
6432
+
6433
+
6434
+ value["authority"] = yield* readIncrementalAuthorityGenerationFence(body, context, value, flags);
6435
+
6436
+
6437
+ } else if (same(value["routeKind"], "coldActivation")) {
6438
+ value["targetNodeRid"] = yield* readIncrementalRid(body, context, value, flags);
6439
+
6440
+
6441
+ value["targetNodeGeneration"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6442
+
6443
+
6444
+ value["targetSpotId"] = yield* readIncrementalText8(body, context, value, flags);
6445
+
6446
+
6447
+ value["targetMeshName"] = yield* readIncrementalText8(body, context, value, flags);
6448
+
6449
+
6450
+ value["stableType"] = yield* readIncrementalText8(body, context, value, flags);
6451
+
6452
+
6453
+ value["targetDescriptorVersion"] = yield* readIncrementalText8(body, context, value, flags);
6454
+
6455
+
6456
+ value["deadlineUnixMs"] = yield* readIncrementalNonzeroU64(body, context, value, flags);
6457
+
6458
+
5479
6459
  } else fail("instance-route-v1 discriminator");
5480
6460
  body.done("instance-route-v1");
5481
6461
 
@@ -5561,6 +6541,7 @@ function readRelocationRootPointer(reader: Reader, context: ServiceWireDecoderCo
5561
6541
 
5562
6542
  return value;
5563
6543
  }
6544
+
5564
6545
  function writeRelocationRootPointer(input: RelocationRootPointer, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5565
6546
  void context; void enclosing; void flags; const value: any = input;
5566
6547
 
@@ -5667,6 +6648,7 @@ function readAuthorityRelocationState(reader: Reader, context: ServiceWireDecode
5667
6648
  if (reader.offset - limitStart > 1048576) fail("authority-relocation-state maximum");
5668
6649
  return decoded;
5669
6650
  }
6651
+
5670
6652
  function writeAuthorityRelocationState(input: AuthorityRelocationState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5671
6653
  void context; void enclosing; void flags; const value: any = input;
5672
6654
  const limitStart = writer.length;
@@ -5800,6 +6782,7 @@ function readAuthorityActivationRecoveryState(reader: Reader, context: ServiceWi
5800
6782
 
5801
6783
  return value;
5802
6784
  }
6785
+
5803
6786
  function writeAuthorityActivationRecoveryState(input: AuthorityActivationRecoveryState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5804
6787
  void context; void enclosing; void flags; const value: any = input;
5805
6788
 
@@ -5873,6 +6856,7 @@ function readAuthorityPayloadV1(reader: Reader, context: ServiceWireDecoderConte
5873
6856
 
5874
6857
  return value;
5875
6858
  }
6859
+
5876
6860
  function writeAuthorityPayloadV1(input: AuthorityPayloadV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5877
6861
  void context; void enclosing; void flags; const value: any = input;
5878
6862
 
@@ -5933,6 +6917,22 @@ function readSavedWorkEntry(reader: Reader, context: ServiceWireDecoderContext,
5933
6917
 
5934
6918
 
5935
6919
 
6920
+ return value;
6921
+ }
6922
+ function* readIncrementalSavedWorkEntry(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, SavedWorkEntry, void> {
6923
+ void context; void enclosing; void flags;
6924
+ const value: any = {};
6925
+ value["participantId"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
6926
+
6927
+
6928
+ value["order"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
6929
+
6930
+
6931
+ value["record"] = yield* readIncrementalFrozenRecord(reader, context, value, flags);
6932
+
6933
+
6934
+
6935
+
5936
6936
  return value;
5937
6937
  }
5938
6938
  function writeSavedWorkEntry(input: SavedWorkEntry, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -5960,15 +6960,22 @@ export type SavedWorkVector = readonly SavedWorkEntry[];
5960
6960
  function readSavedWorkVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): SavedWorkVector {
5961
6961
  void context; void enclosing; void flags;
5962
6962
  const count = Number(readU32(reader, context, enclosing, flags)); const value: any = Array.from({ length: count }, () => readSavedWorkEntry(reader, context, enclosing, flags));
5963
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("saved-work-vector sorted");
5964
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["participantId"]), numeric(value[right]["participantId"])), compareBigint(numeric(value[left]["order"]), numeric(value[right]["order"]))]) === 0) fail("saved-work-vector unique");
6963
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("saved-work-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("saved-work-vector constraint capacity"); throw error; }
6964
+
6965
+ return value;
6966
+ }
6967
+ function* readIncrementalSavedWorkVector(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, SavedWorkVector, void> {
6968
+ void context; void enclosing; void flags;
6969
+ const count = Number(yield* readIncrementalU32(reader, context, enclosing, flags)); const value: any[] = []; for (let index = 0; index < count; ++index) { const item = yield* readIncrementalSavedWorkEntry(reader, context, enclosing, flags); try { value.push(item); } catch { capacityFail("saved-work-vector capacity"); } }
6970
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("saved-work-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("saved-work-vector constraint capacity"); throw error; }
6971
+
5965
6972
  return value;
5966
6973
  }
5967
6974
  function writeSavedWorkVector(input: SavedWorkVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5968
6975
  void context; void enclosing; void flags; const value: any = input;
5969
6976
  if (!Array.isArray(value)) fail("saved-work-vector count");
5970
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("saved-work-vector sorted");
5971
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["participantId"]), numeric(value[right]["participantId"])), compareBigint(numeric(value[left]["order"]), numeric(value[right]["order"]))]) === 0) fail("saved-work-vector unique");
6977
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("saved-work-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("saved-work-vector constraint capacity"); throw error; }
6978
+
5972
6979
  writeU32(value.length, writer, context, enclosing, flags); for (const item of value) writeSavedWorkEntry(item, writer, context, enclosing, flags);
5973
6980
  }
5974
6981
  export function decodeSavedWorkVector(bytes: Uint8Array, context: ServiceWireDecoderContext): SavedWorkVector { const reader = new Reader(bytes); const value = readSavedWorkVector(reader, context, {}, 0); reader.done("saved-work-vector"); return value; }
@@ -5978,11 +6985,12 @@ export type DurableBlob = Uint8Array;
5978
6985
 
5979
6986
  function readDurableBlob(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): DurableBlob {
5980
6987
  void context; void enclosing; void flags;
5981
- const length = Number(readU32(reader, context, enclosing, flags)); if (length > 67108864) fail("durable-blob length"); if (length > 2147483647) capacityFail("durable-blob capacity"); if (length < 0) fail("durable-blob length"); return reader.take(length);
6988
+ const length = Number(readU32(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("durable-blob capacity"); if (length > 67108864) fail("durable-blob length"); if (length < 0) fail("durable-blob length"); return reader.take(length);
5982
6989
  }
6990
+
5983
6991
  function writeDurableBlob(input: DurableBlob, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5984
6992
  void context; void enclosing; void flags; const value: any = input;
5985
- const bytes = value as Uint8Array; if (bytes.length > 67108864) fail("durable-blob length"); if (bytes.length > 2147483647) capacityFail("durable-blob capacity"); if (bytes.length < 0) fail("durable-blob length"); writeU32(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
6993
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("durable-blob capacity"); if (bytes.length > 67108864) fail("durable-blob length"); if (bytes.length < 0) fail("durable-blob length"); writeU32(bytes.length, writer, context, enclosing, flags); writer.put(bytes);
5986
6994
  }
5987
6995
  export function decodeDurableBlob(bytes: Uint8Array, context: ServiceWireDecoderContext): DurableBlob { const reader = new Reader(bytes); const value = readDurableBlob(reader, context, {}, 0); reader.done("durable-blob"); return value; }
5988
6996
  export function encodeDurableBlob(value: DurableBlob, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeDurableBlob(value, writer, context, {}, 0); return writer.result(); }
@@ -5991,11 +6999,15 @@ export type DurableStateBlob = Uint8Array;
5991
6999
 
5992
7000
  function readDurableStateBlob(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): DurableStateBlob {
5993
7001
  void context; void enclosing; void flags;
5994
- const length = Number(readU64(reader, context, enclosing, flags)); if (length > 67108864) fail("durable-state-blob length"); if (length > 2147483647) capacityFail("durable-state-blob capacity"); if (length < 0) fail("durable-state-blob length"); return reader.take(length);
7002
+ const length = Number(readU64(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("durable-state-blob capacity"); if (length > 67108864) fail("durable-state-blob length"); if (length < 0) fail("durable-state-blob length"); return reader.take(length);
7003
+ }
7004
+ function* readIncrementalDurableStateBlob(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, DurableStateBlob, void> {
7005
+ void context; void enclosing; void flags;
7006
+ const length = Number(yield* readIncrementalU64(reader, context, enclosing, flags)); if (length > 2147483647) capacityFail("durable-state-blob capacity"); if (length > 67108864) fail("durable-state-blob length"); if (length < 0) fail("durable-state-blob length"); return yield* reader.bytes(length);
5995
7007
  }
5996
7008
  function writeDurableStateBlob(input: DurableStateBlob, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
5997
7009
  void context; void enclosing; void flags; const value: any = input;
5998
- const bytes = value as Uint8Array; if (bytes.length > 67108864) fail("durable-state-blob length"); if (bytes.length > 2147483647) capacityFail("durable-state-blob capacity"); if (bytes.length < 0) fail("durable-state-blob length"); writeU64(numeric(bytes.length), writer, context, enclosing, flags); writer.put(bytes);
7010
+ const bytes = value as Uint8Array; if (bytes.length > 2147483647) capacityFail("durable-state-blob capacity"); if (bytes.length > 67108864) fail("durable-state-blob length"); if (bytes.length < 0) fail("durable-state-blob length"); writeU64(numeric(bytes.length), writer, context, enclosing, flags); writer.put(bytes);
5999
7011
  }
6000
7012
  export function decodeDurableStateBlob(bytes: Uint8Array, context: ServiceWireDecoderContext): DurableStateBlob { const reader = new Reader(bytes); const value = readDurableStateBlob(reader, context, {}, 0); reader.done("durable-state-blob"); return value; }
6001
7013
  export function encodeDurableStateBlob(value: DurableStateBlob, context: ServiceWireDecoderContext): Uint8Array { const writer = new Writer(); writeDurableStateBlob(value, writer, context, {}, 0); return writer.result(); }
@@ -6021,6 +7033,7 @@ function readRelocationChunkEntryV1(reader: Reader, context: ServiceWireDecoderC
6021
7033
 
6022
7034
  return value;
6023
7035
  }
7036
+
6024
7037
  function writeRelocationChunkEntryV1(input: RelocationChunkEntryV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6025
7038
  void context; void enclosing; void flags; const value: any = input;
6026
7039
 
@@ -6050,15 +7063,16 @@ export type RelocationChunkVectorV1 = readonly RelocationChunkEntryV1[];
6050
7063
  function readRelocationChunkVectorV1(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): RelocationChunkVectorV1 {
6051
7064
  void context; void enclosing; void flags;
6052
7065
  const count = Number(readU32(reader, context, enclosing, flags)); if (count > 4096) fail("relocation-chunk-vector-v1 count"); const value: any = Array.from({ length: count }, () => readRelocationChunkEntryV1(reader, context, enclosing, flags));
6053
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-chunk-vector-v1 sorted");
6054
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["order"]), numeric(value[right]["order"]))]) === 0) fail("relocation-chunk-vector-v1 unique");
7066
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-chunk-vector-v1 sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-chunk-vector-v1 constraint capacity"); throw error; }
7067
+
6055
7068
  return value;
6056
7069
  }
7070
+
6057
7071
  function writeRelocationChunkVectorV1(input: RelocationChunkVectorV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6058
7072
  void context; void enclosing; void flags; const value: any = input;
6059
7073
  if (!Array.isArray(value) || value.length > 4096) fail("relocation-chunk-vector-v1 count");
6060
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-chunk-vector-v1 sorted");
6061
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["order"]), numeric(value[right]["order"]))]) === 0) fail("relocation-chunk-vector-v1 unique");
7074
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-chunk-vector-v1 sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-chunk-vector-v1 constraint capacity"); throw error; }
7075
+
6062
7076
  writeU32(value.length, writer, context, enclosing, flags); for (const item of value) writeRelocationChunkEntryV1(item, writer, context, enclosing, flags);
6063
7077
  }
6064
7078
  export function decodeRelocationChunkVectorV1(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationChunkVectorV1 { const reader = new Reader(bytes); const value = readRelocationChunkVectorV1(reader, context, {}, 0); reader.done("relocation-chunk-vector-v1"); return value; }
@@ -6088,6 +7102,7 @@ function readRelocationManifestV1(reader: Reader, context: ServiceWireDecoderCon
6088
7102
 
6089
7103
  return value;
6090
7104
  }
7105
+
6091
7106
  function writeRelocationManifestV1(input: RelocationManifestV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6092
7107
  void context; void enclosing; void flags; const value: any = input;
6093
7108
 
@@ -6131,6 +7146,7 @@ function readRelocationDataChunkV1(reader: Reader, context: ServiceWireDecoderCo
6131
7146
 
6132
7147
  return value;
6133
7148
  }
7149
+
6134
7150
  function writeRelocationDataChunkV1(input: RelocationDataChunkV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6135
7151
  void context; void enclosing; void flags; const value: any = input;
6136
7152
 
@@ -6161,6 +7177,26 @@ function readRelocationApplicationState(reader: Reader, context: ServiceWireDeco
6161
7177
  value["payload"] = readDurableStateBlob(body, context, value, flags);
6162
7178
 
6163
7179
 
7180
+ } else fail("relocation-application-state discriminator");
7181
+ body.done("relocation-application-state");
7182
+
7183
+ return value;
7184
+ })();
7185
+ if (reader.offset - limitStart > 274877906944) fail("relocation-application-state maximum");
7186
+ return decoded;
7187
+ }
7188
+ function* readIncrementalRelocationApplicationState(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationApplicationState, void> {
7189
+ void context; void enclosing; void flags;
7190
+ const limitStart = reader.offset; const decoded = yield* (function* (): Generator<void, RelocationApplicationState, void> {
7191
+ const value: any = {};
7192
+ value["hasState"] = yield* readIncrementalBool8(reader, context, enclosing, flags);
7193
+ const body = reader.bounded(Number(yield* readIncrementalU64(reader, context, enclosing, flags)));
7194
+ if (same(value["hasState"], "false")) {
7195
+
7196
+ } else if (same(value["hasState"], "true")) {
7197
+ value["payload"] = yield* readIncrementalDurableStateBlob(body, context, value, flags);
7198
+
7199
+
6164
7200
  } else fail("relocation-application-state discriminator");
6165
7201
  body.done("relocation-application-state");
6166
7202
 
@@ -6204,6 +7240,19 @@ function readRelocationParticipantApplicationState(reader: Reader, context: Serv
6204
7240
 
6205
7241
 
6206
7242
 
7243
+ return value;
7244
+ }
7245
+ function* readIncrementalRelocationParticipantApplicationState(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationParticipantApplicationState, void> {
7246
+ void context; void enclosing; void flags;
7247
+ const value: any = {};
7248
+ value["participantId"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7249
+
7250
+
7251
+ value["applicationState"] = yield* readIncrementalRelocationApplicationState(reader, context, value, flags);
7252
+
7253
+
7254
+
7255
+
6207
7256
  return value;
6208
7257
  }
6209
7258
  function writeRelocationParticipantApplicationState(input: RelocationParticipantApplicationState, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -6227,15 +7276,22 @@ export type RelocationParticipantApplicationStateVector = readonly RelocationPar
6227
7276
  function readRelocationParticipantApplicationStateVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): RelocationParticipantApplicationStateVector {
6228
7277
  void context; void enclosing; void flags;
6229
7278
  const count = Number(readU32(reader, context, enclosing, flags)); if (count > 1024) fail("relocation-participant-application-state-vector count"); const value: any = Array.from({ length: count }, () => readRelocationParticipantApplicationState(reader, context, enclosing, flags));
6230
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"]))]) >= 0) fail("relocation-participant-application-state-vector sorted");
6231
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["participantId"]), numeric(value[right]["participantId"]))]) === 0) fail("relocation-participant-application-state-vector unique");
7279
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"]))]) >= 0) fail("relocation-participant-application-state-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-participant-application-state-vector constraint capacity"); throw error; }
7280
+
7281
+ return value;
7282
+ }
7283
+ function* readIncrementalRelocationParticipantApplicationStateVector(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationParticipantApplicationStateVector, void> {
7284
+ void context; void enclosing; void flags;
7285
+ const count = Number(yield* readIncrementalU32(reader, context, enclosing, flags)); if (count > 1024) fail("relocation-participant-application-state-vector count"); const value: any[] = []; for (let index = 0; index < count; ++index) { const item = yield* readIncrementalRelocationParticipantApplicationState(reader, context, enclosing, flags); try { value.push(item); } catch { capacityFail("relocation-participant-application-state-vector capacity"); } }
7286
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"]))]) >= 0) fail("relocation-participant-application-state-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-participant-application-state-vector constraint capacity"); throw error; }
7287
+
6232
7288
  return value;
6233
7289
  }
6234
7290
  function writeRelocationParticipantApplicationStateVector(input: RelocationParticipantApplicationStateVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6235
7291
  void context; void enclosing; void flags; const value: any = input;
6236
7292
  if (!Array.isArray(value) || value.length > 1024) fail("relocation-participant-application-state-vector count");
6237
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"]))]) >= 0) fail("relocation-participant-application-state-vector sorted");
6238
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["participantId"]), numeric(value[right]["participantId"]))]) === 0) fail("relocation-participant-application-state-vector unique");
7293
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"]))]) >= 0) fail("relocation-participant-application-state-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-participant-application-state-vector constraint capacity"); throw error; }
7294
+
6239
7295
  writeU32(value.length, writer, context, enclosing, flags); for (const item of value) writeRelocationParticipantApplicationState(item, writer, context, enclosing, flags);
6240
7296
  }
6241
7297
  export function decodeRelocationParticipantApplicationStateVector(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationParticipantApplicationStateVector { const reader = new Reader(bytes); const value = readRelocationParticipantApplicationStateVector(reader, context, {}, 0); reader.done("relocation-participant-application-state-vector"); return value; }
@@ -6278,6 +7334,43 @@ function readRelocationTimerRegistration(reader: Reader, context: ServiceWireDec
6278
7334
 
6279
7335
 
6280
7336
 
7337
+ return value;
7338
+ }
7339
+ function* readIncrementalRelocationTimerRegistration(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationTimerRegistration, void> {
7340
+ void context; void enclosing; void flags;
7341
+ const value: any = {};
7342
+ value["participantId"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7343
+
7344
+
7345
+ value["name"] = yield* readIncrementalText8(reader, context, value, flags);
7346
+
7347
+
7348
+ value["handlerType"] = yield* readIncrementalText8(reader, context, value, flags);
7349
+
7350
+
7351
+ value["periodMilliseconds"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7352
+
7353
+
7354
+ value["overrunPolicy"] = yield* readIncrementalTimerOverrunPolicyKind(reader, context, value, flags);
7355
+
7356
+
7357
+ value["maxCatchUpTicks"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7358
+
7359
+
7360
+ value["stopOnUnhandledException"] = yield* readIncrementalBool8(reader, context, value, flags);
7361
+
7362
+
7363
+ value["lastCompletedDeliveryIndex"] = yield* readIncrementalOrdinalOrZero(reader, context, value, flags);
7364
+
7365
+
7366
+ value["lastCompletedScheduledIndex"] = yield* readIncrementalOrdinalOrZero(reader, context, value, flags);
7367
+
7368
+
7369
+ value["nextScheduledAtUnixMilliseconds"] = yield* readIncrementalU64(reader, context, value, flags);
7370
+
7371
+
7372
+
7373
+
6281
7374
  return value;
6282
7375
  }
6283
7376
  function writeRelocationTimerRegistration(input: RelocationTimerRegistration, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -6333,15 +7426,22 @@ export type RelocationTimerRegistrationVector = readonly RelocationTimerRegistra
6333
7426
  function readRelocationTimerRegistrationVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): RelocationTimerRegistrationVector {
6334
7427
  void context; void enclosing; void flags;
6335
7428
  const count = Number(readU32(reader, context, enclosing, flags)); const value: any = Array.from({ length: count }, () => readRelocationTimerRegistration(reader, context, enclosing, flags));
6336
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(numeric(value[index - 1]["participantId"])), numeric(numeric(value[index]["participantId"]))), compareBytes(utf8(value[index - 1]["name"]), utf8(value[index]["name"]))]) >= 0) fail("relocation-timer-registration-vector sorted");
6337
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(numeric(value[left]["participantId"])), numeric(numeric(value[right]["participantId"]))), compareBytes(utf8(value[left]["name"]), utf8(value[right]["name"]))]) === 0) fail("relocation-timer-registration-vector unique");
7429
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(numeric(value[index - 1]["participantId"])), numeric(numeric(value[index]["participantId"]))), compareBytes(utf8(value[index - 1]["name"]), utf8(value[index]["name"]))]) >= 0) fail("relocation-timer-registration-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-timer-registration-vector constraint capacity"); throw error; }
7430
+
7431
+ return value;
7432
+ }
7433
+ function* readIncrementalRelocationTimerRegistrationVector(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationTimerRegistrationVector, void> {
7434
+ void context; void enclosing; void flags;
7435
+ const count = Number(yield* readIncrementalU32(reader, context, enclosing, flags)); const value: any[] = []; for (let index = 0; index < count; ++index) { const item = yield* readIncrementalRelocationTimerRegistration(reader, context, enclosing, flags); try { value.push(item); } catch { capacityFail("relocation-timer-registration-vector capacity"); } }
7436
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(numeric(value[index - 1]["participantId"])), numeric(numeric(value[index]["participantId"]))), compareBytes(utf8(value[index - 1]["name"]), utf8(value[index]["name"]))]) >= 0) fail("relocation-timer-registration-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-timer-registration-vector constraint capacity"); throw error; }
7437
+
6338
7438
  return value;
6339
7439
  }
6340
7440
  function writeRelocationTimerRegistrationVector(input: RelocationTimerRegistrationVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6341
7441
  void context; void enclosing; void flags; const value: any = input;
6342
7442
  if (!Array.isArray(value)) fail("relocation-timer-registration-vector count");
6343
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(numeric(value[index - 1]["participantId"])), numeric(numeric(value[index]["participantId"]))), compareBytes(utf8(value[index - 1]["name"]), utf8(value[index]["name"]))]) >= 0) fail("relocation-timer-registration-vector sorted");
6344
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(numeric(value[left]["participantId"])), numeric(numeric(value[right]["participantId"]))), compareBytes(utf8(value[left]["name"]), utf8(value[right]["name"]))]) === 0) fail("relocation-timer-registration-vector unique");
7443
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(numeric(value[index - 1]["participantId"])), numeric(numeric(value[index]["participantId"]))), compareBytes(utf8(value[index - 1]["name"]), utf8(value[index]["name"]))]) >= 0) fail("relocation-timer-registration-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-timer-registration-vector constraint capacity"); throw error; }
7444
+
6345
7445
  writeU32(value.length, writer, context, enclosing, flags); for (const item of value) writeRelocationTimerRegistration(item, writer, context, enclosing, flags);
6346
7446
  }
6347
7447
  export function decodeRelocationTimerRegistrationVector(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationTimerRegistrationVector { const reader = new Reader(bytes); const value = readRelocationTimerRegistrationVector(reader, context, {}, 0); reader.done("relocation-timer-registration-vector"); return value; }
@@ -6375,6 +7475,34 @@ function readRelocationPendingTimerTick(reader: Reader, context: ServiceWireDeco
6375
7475
 
6376
7476
 
6377
7477
 
7478
+ return value;
7479
+ }
7480
+ function* readIncrementalRelocationPendingTimerTick(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationPendingTimerTick, void> {
7481
+ void context; void enclosing; void flags;
7482
+ const value: any = {};
7483
+ value["participantId"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7484
+
7485
+
7486
+ value["order"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7487
+
7488
+
7489
+ value["timerName"] = yield* readIncrementalText8(reader, context, value, flags);
7490
+
7491
+
7492
+ value["deliveryIndex"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7493
+
7494
+
7495
+ value["scheduledIndex"] = yield* readIncrementalNonzeroU64(reader, context, value, flags);
7496
+
7497
+
7498
+ value["scheduledAtUnixMilliseconds"] = yield* readIncrementalU64(reader, context, value, flags);
7499
+
7500
+
7501
+ value["skippedTicks"] = yield* readIncrementalOrdinalOrZero(reader, context, value, flags);
7502
+
7503
+
7504
+
7505
+
6378
7506
  return value;
6379
7507
  }
6380
7508
  function writeRelocationPendingTimerTick(input: RelocationPendingTimerTick, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -6418,15 +7546,22 @@ export type RelocationPendingTimerTickVector = readonly RelocationPendingTimerTi
6418
7546
  function readRelocationPendingTimerTickVector(reader: Reader, context: ServiceWireDecoderContext, enclosing: any, flags: number): RelocationPendingTimerTickVector {
6419
7547
  void context; void enclosing; void flags;
6420
7548
  const count = Number(readU32(reader, context, enclosing, flags)); const value: any = Array.from({ length: count }, () => readRelocationPendingTimerTick(reader, context, enclosing, flags));
6421
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-pending-timer-tick-vector sorted");
6422
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["participantId"]), numeric(value[right]["participantId"])), compareBigint(numeric(value[left]["order"]), numeric(value[right]["order"]))]) === 0) fail("relocation-pending-timer-tick-vector unique");
7549
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-pending-timer-tick-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-pending-timer-tick-vector constraint capacity"); throw error; }
7550
+
7551
+ return value;
7552
+ }
7553
+ function* readIncrementalRelocationPendingTimerTickVector(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationPendingTimerTickVector, void> {
7554
+ void context; void enclosing; void flags;
7555
+ const count = Number(yield* readIncrementalU32(reader, context, enclosing, flags)); const value: any[] = []; for (let index = 0; index < count; ++index) { const item = yield* readIncrementalRelocationPendingTimerTick(reader, context, enclosing, flags); try { value.push(item); } catch { capacityFail("relocation-pending-timer-tick-vector capacity"); } }
7556
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-pending-timer-tick-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-pending-timer-tick-vector constraint capacity"); throw error; }
7557
+
6423
7558
  return value;
6424
7559
  }
6425
7560
  function writeRelocationPendingTimerTickVector(input: RelocationPendingTimerTickVector, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
6426
7561
  void context; void enclosing; void flags; const value: any = input;
6427
7562
  if (!Array.isArray(value)) fail("relocation-pending-timer-tick-vector count");
6428
- for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-pending-timer-tick-vector sorted");
6429
- for (let left = 0; left < value.length; ++left) for (let right = left + 1; right < value.length; ++right) if (compareResults([compareBigint(numeric(value[left]["participantId"]), numeric(value[right]["participantId"])), compareBigint(numeric(value[left]["order"]), numeric(value[right]["order"]))]) === 0) fail("relocation-pending-timer-tick-vector unique");
7563
+ try { for (let index = 1; index < value.length; ++index) if (compareResults([compareBigint(numeric(value[index - 1]["participantId"]), numeric(value[index]["participantId"])), compareBigint(numeric(value[index - 1]["order"]), numeric(value[index]["order"]))]) >= 0) fail("relocation-pending-timer-tick-vector sorted"); } catch (error) { if (error instanceof ServiceWireProtocolError || error instanceof ServiceWireCapacityError) throw error; if (error instanceof RangeError) capacityFail("relocation-pending-timer-tick-vector constraint capacity"); throw error; }
7564
+
6430
7565
  writeU32(value.length, writer, context, enclosing, flags); for (const item of value) writeRelocationPendingTimerTick(item, writer, context, enclosing, flags);
6431
7566
  }
6432
7567
  export function decodeRelocationPendingTimerTickVector(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationPendingTimerTickVector { const reader = new Reader(bytes); const value = readRelocationPendingTimerTickVector(reader, context, {}, 0); reader.done("relocation-pending-timer-tick-vector"); return value; }
@@ -6460,6 +7595,34 @@ function readRelocationEnvelopeV1(reader: Reader, context: ServiceWireDecoderCon
6460
7595
 
6461
7596
 
6462
7597
 
7598
+ return value;
7599
+ }
7600
+ function* readIncrementalRelocationEnvelopeV1(reader: IncrementalInput, context: ServiceWireDecoderContext, enclosing: any, flags: number): Generator<void, RelocationEnvelopeV1, void> {
7601
+ void context; void enclosing; void flags;
7602
+ const value: any = {};
7603
+ value["relocation"] = yield* readIncrementalRelocationId(reader, context, value, flags);
7604
+
7605
+
7606
+ value["object"] = yield* readIncrementalRelocationObjectIdentity(reader, context, value, flags);
7607
+
7608
+
7609
+ value["applicationVersion"] = yield* readIncrementalApplicationVersion(reader, context, value, flags);
7610
+
7611
+
7612
+ value["applicationStates"] = yield* readIncrementalRelocationParticipantApplicationStateVector(reader, context, value, flags);
7613
+
7614
+
7615
+ value["savedWork"] = yield* readIncrementalSavedWorkVector(reader, context, value, flags);
7616
+
7617
+
7618
+ value["timerRegistrations"] = yield* readIncrementalRelocationTimerRegistrationVector(reader, context, value, flags);
7619
+
7620
+
7621
+ value["pendingTimerTicks"] = yield* readIncrementalRelocationPendingTimerTickVector(reader, context, value, flags);
7622
+
7623
+
7624
+
7625
+
6463
7626
  return value;
6464
7627
  }
6465
7628
  function writeRelocationEnvelopeV1(input: RelocationEnvelopeV1, writer: Writer, context: ServiceWireDecoderContext, enclosing: any, flags: number): void {
@@ -6516,7 +7679,7 @@ export function encodeHelloCommand(value: HelloCommand, context: ServiceWireDeco
6516
7679
  const frames: Uint8Array[] = [writer.result()];
6517
7680
 
6518
7681
  return frames; }
6519
- export function validateHelloCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7682
+ export function validateHelloCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6520
7683
 
6521
7684
  export type AdmitCommand = { readonly command: "admit"; readonly flags: number; readonly admission: ServiceAdmission; };
6522
7685
  export function decodeAdmitCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): AdmitCommand { if (!frames.length) fail("admit frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 2) fail("admit header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("admit flags"); const value: any = { command: "admit", flags };
@@ -6536,7 +7699,7 @@ export function encodeAdmitCommand(value: AdmitCommand, context: ServiceWireDeco
6536
7699
  const frames: Uint8Array[] = [writer.result()];
6537
7700
 
6538
7701
  return frames; }
6539
- export function validateAdmitCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7702
+ export function validateAdmitCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6540
7703
 
6541
7704
  export type RejectCommand = { readonly command: "reject"; readonly flags: number; readonly reason: RejectReason; };
6542
7705
  export function decodeRejectCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RejectCommand { if (!frames.length) fail("reject frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 3) fail("reject header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("reject flags"); const value: any = { command: "reject", flags };
@@ -6556,7 +7719,7 @@ export function encodeRejectCommand(value: RejectCommand, context: ServiceWireDe
6556
7719
  const frames: Uint8Array[] = [writer.result()];
6557
7720
 
6558
7721
  return frames; }
6559
- export function validateRejectCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7722
+ export function validateRejectCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6560
7723
 
6561
7724
  export type UpdateCommand = { readonly command: "update"; readonly flags: number; readonly admission: ServiceAdmission; };
6562
7725
  export function decodeUpdateCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): UpdateCommand { if (!frames.length) fail("update frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 4) fail("update header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("update flags"); const value: any = { command: "update", flags };
@@ -6576,7 +7739,7 @@ export function encodeUpdateCommand(value: UpdateCommand, context: ServiceWireDe
6576
7739
  const frames: Uint8Array[] = [writer.result()];
6577
7740
 
6578
7741
  return frames; }
6579
- export function validateUpdateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7742
+ export function validateUpdateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6580
7743
 
6581
7744
  export type LivenessProbeCommand = { readonly command: "livenessProbe"; readonly flags: number; readonly probeId: NonzeroU64; };
6582
7745
  export function decodeLivenessProbeCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): LivenessProbeCommand { if (!frames.length) fail("livenessProbe frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 5) fail("livenessProbe header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("livenessProbe flags"); const value: any = { command: "livenessProbe", flags };
@@ -6596,7 +7759,7 @@ export function encodeLivenessProbeCommand(value: LivenessProbeCommand, context:
6596
7759
  const frames: Uint8Array[] = [writer.result()];
6597
7760
 
6598
7761
  return frames; }
6599
- export function validateLivenessProbeCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7762
+ export function validateLivenessProbeCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6600
7763
 
6601
7764
  export type LivenessAckCommand = { readonly command: "livenessAck"; readonly flags: number; readonly probeId: NonzeroU64; };
6602
7765
  export function decodeLivenessAckCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): LivenessAckCommand { if (!frames.length) fail("livenessAck frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 6) fail("livenessAck header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("livenessAck flags"); const value: any = { command: "livenessAck", flags };
@@ -6616,7 +7779,7 @@ export function encodeLivenessAckCommand(value: LivenessAckCommand, context: Ser
6616
7779
  const frames: Uint8Array[] = [writer.result()];
6617
7780
 
6618
7781
  return frames; }
6619
- export function validateLivenessAckCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7782
+ export function validateLivenessAckCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6620
7783
 
6621
7784
  export type NodeSendCommand = { readonly command: "nodeSend"; readonly flags: number; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6622
7785
  export function decodeNodeSendCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): NodeSendCommand { if (!frames.length) fail("nodeSend frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 16) fail("nodeSend header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("nodeSend flags"); const value: any = { command: "nodeSend", flags };
@@ -6633,7 +7796,7 @@ const frames: Uint8Array[] = [writer.result()];
6633
7796
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("nodeSend metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("nodeSend metadata forbidden");
6634
7797
  if (value.payload === undefined) fail("nodeSend payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6635
7798
  return frames; }
6636
- export function validateNodeSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7799
+ export function validateNodeSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6637
7800
 
6638
7801
  export type NodeRequestCommand = { readonly command: "nodeRequest"; readonly flags: number; readonly correlation: NonzeroU64; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6639
7802
  export function decodeNodeRequestCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): NodeRequestCommand { if (!frames.length) fail("nodeRequest frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 17) fail("nodeRequest header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("nodeRequest flags"); const value: any = { command: "nodeRequest", flags };
@@ -6655,7 +7818,7 @@ const frames: Uint8Array[] = [writer.result()];
6655
7818
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("nodeRequest metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("nodeRequest metadata forbidden");
6656
7819
  if (value.payload === undefined) fail("nodeRequest payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6657
7820
  return frames; }
6658
- export function validateNodeRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7821
+ export function validateNodeRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6659
7822
 
6660
7823
  export type ChannelSendCommand = { readonly command: "channelSend"; readonly flags: number; readonly channelName: Text8; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6661
7824
  export function decodeChannelSendCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ChannelSendCommand { if (!frames.length) fail("channelSend frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 18) fail("channelSend header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("channelSend flags"); const value: any = { command: "channelSend", flags };
@@ -6677,7 +7840,7 @@ const frames: Uint8Array[] = [writer.result()];
6677
7840
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("channelSend metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("channelSend metadata forbidden");
6678
7841
  if (value.payload === undefined) fail("channelSend payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6679
7842
  return frames; }
6680
- export function validateChannelSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7843
+ export function validateChannelSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6681
7844
 
6682
7845
  export type ChannelRequestCommand = { readonly command: "channelRequest"; readonly flags: number; readonly correlation: NonzeroU64; readonly channelName: Text8; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6683
7846
  export function decodeChannelRequestCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ChannelRequestCommand { if (!frames.length) fail("channelRequest frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 19) fail("channelRequest header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("channelRequest flags"); const value: any = { command: "channelRequest", flags };
@@ -6706,7 +7869,7 @@ const frames: Uint8Array[] = [writer.result()];
6706
7869
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("channelRequest metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("channelRequest metadata forbidden");
6707
7870
  if (value.payload === undefined) fail("channelRequest payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6708
7871
  return frames; }
6709
- export function validateChannelRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7872
+ export function validateChannelRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6710
7873
 
6711
7874
  export type ReplyCommand = { readonly command: "reply"; readonly flags: number; readonly correlation: NonzeroU64; readonly terminalResult: RequestTerminalResult; readonly failureCode: FrameworkErrorCode; readonly tail: RequestSpecificTail; readonly payload?: ApplicationPayloadEnvelopeV1; };
6712
7875
  export function decodeReplyCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ReplyCommand { if (!frames.length) fail("reply frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 20) fail("reply header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("reply flags"); const value: any = { command: "reply", flags };
@@ -6725,9 +7888,11 @@ export function decodeReplyCommand(frames: readonly Uint8Array[], context: Servi
6725
7888
  reader.done("reply"); let frameIndex = 1;
6726
7889
  if (frameIndex < frames.length) value.payload = decodeApplicationPayloadEnvelopeV1(frames[frameIndex++], context);
6727
7890
  if (frameIndex !== frames.length) fail("reply frames");
6728
- if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("reply runtime predicate");
7891
+ void context;
7892
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("reply runtime predicate");
6729
7893
  return value; }
6730
- export function encodeReplyCommand(value: ReplyCommand, context: ServiceWireDecoderContext): readonly Uint8Array[] { if ((value.flags & ~0) !== 0 || (value.flags & 0) !== 0) fail("reply flags"); if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("reply runtime predicate"); const writer = new Writer(); writer.put([90,77, 1, 20, value.flags]);
7894
+ export function encodeReplyCommand(value: ReplyCommand, context: ServiceWireDecoderContext): readonly Uint8Array[] { if ((value.flags & ~0) !== 0 || (value.flags & 0) !== 0) fail("reply flags"); void context;
7895
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("reply runtime predicate"); const writer = new Writer(); writer.put([90,77, 1, 20, value.flags]);
6731
7896
  if (value["correlation"] === undefined) fail("correlation required");
6732
7897
 
6733
7898
 
@@ -6747,7 +7912,8 @@ export function encodeReplyCommand(value: ReplyCommand, context: ServiceWireDeco
6747
7912
  const frames: Uint8Array[] = [writer.result()];
6748
7913
  if (value.payload !== undefined) frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6749
7914
  return frames; }
6750
- export function validateReplyCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("reply runtime predicate"); }
7915
+ export function validateReplyCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; void context;
7916
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("reply runtime predicate"); }
6751
7917
 
6752
7918
  export type SpotSendCommand = { readonly command: "spotSend"; readonly flags: number; readonly operation: OperationId; readonly messageFollowHopCount: U8; readonly sourceSpotId: Text8; readonly targetSpot: SpotRouteFence; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6753
7919
  export function decodeSpotSendCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): SpotSendCommand { if (!frames.length) fail("spotSend frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 21) fail("spotSend header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("spotSend flags"); const value: any = { command: "spotSend", flags };
@@ -6790,7 +7956,7 @@ const frames: Uint8Array[] = [writer.result()];
6790
7956
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("spotSend metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("spotSend metadata forbidden");
6791
7957
  if (value.payload === undefined) fail("spotSend payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6792
7958
  return frames; }
6793
- export function validateSpotSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7959
+ export function validateSpotSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6794
7960
 
6795
7961
  export type SpotRequestCommand = { readonly command: "spotRequest"; readonly flags: number; readonly correlation: NonzeroU64; readonly operation: OperationId; readonly messageFollowHopCount: U8; readonly sourceSpotId: Text8; readonly targetSpot: SpotRouteFence; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6796
7962
  export function decodeSpotRequestCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): SpotRequestCommand { if (!frames.length) fail("spotRequest frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 22) fail("spotRequest header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("spotRequest flags"); const value: any = { command: "spotRequest", flags };
@@ -6840,7 +8006,7 @@ const frames: Uint8Array[] = [writer.result()];
6840
8006
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("spotRequest metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("spotRequest metadata forbidden");
6841
8007
  if (value.payload === undefined) fail("spotRequest payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6842
8008
  return frames; }
6843
- export function validateSpotRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8009
+ export function validateSpotRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6844
8010
 
6845
8011
  export type LogicalMulticastCommand = { readonly command: "logicalMulticast"; readonly flags: number; readonly channelName: Text8; readonly topic: Text8; readonly sourceSpotId: Text8; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6846
8012
  export function decodeLogicalMulticastCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): LogicalMulticastCommand { if (!frames.length) fail("logicalMulticast frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 23) fail("logicalMulticast header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("logicalMulticast flags"); const value: any = { command: "logicalMulticast", flags };
@@ -6876,7 +8042,7 @@ const frames: Uint8Array[] = [writer.result()];
6876
8042
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("logicalMulticast metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("logicalMulticast metadata forbidden");
6877
8043
  if (value.payload === undefined) fail("logicalMulticast payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6878
8044
  return frames; }
6879
- export function validateLogicalMulticastCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8045
+ export function validateLogicalMulticastCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6880
8046
 
6881
8047
  export type ActorSendCommand = { readonly command: "actorSend"; readonly flags: number; readonly operation: OperationId; readonly messageFollowHopCount: U8; readonly sourceActor: OptionalActorRef; readonly targetActor: ActorRouteFence; readonly boundSessionTail?: OptionalBoundSessionTail; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6882
8048
  export function decodeActorSendCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorSendCommand { if (!frames.length) fail("actorSend frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 24) fail("actorSend header"); const flags = Number(reader.u(1)); if ((flags & ~7) !== 0 || (flags & 0) !== 0) fail("actorSend flags");
@@ -6932,7 +8098,7 @@ const frames: Uint8Array[] = [writer.result()];
6932
8098
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("actorSend metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("actorSend metadata forbidden");
6933
8099
  if (value.payload === undefined) fail("actorSend payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6934
8100
  return frames; }
6935
- export function validateActorSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8101
+ export function validateActorSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6936
8102
 
6937
8103
  export type ActorRequestCommand = { readonly command: "actorRequest"; readonly flags: number; readonly correlation: NonzeroU64; readonly operation: OperationId; readonly messageFollowHopCount: U8; readonly sourceActor: OptionalActorRef; readonly targetActor: ActorRouteFence; readonly boundSessionTail?: OptionalBoundSessionTail; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
6938
8104
  export function decodeActorRequestCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorRequestCommand { if (!frames.length) fail("actorRequest frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 25) fail("actorRequest header"); const flags = Number(reader.u(1)); if ((flags & ~7) !== 0 || (flags & 0) !== 0) fail("actorRequest flags");
@@ -6995,7 +8161,7 @@ const frames: Uint8Array[] = [writer.result()];
6995
8161
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("actorRequest metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("actorRequest metadata forbidden");
6996
8162
  if (value.payload === undefined) fail("actorRequest payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
6997
8163
  return frames; }
6998
- export function validateActorRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8164
+ export function validateActorRequestCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
6999
8165
 
7000
8166
  export type ActorLookupCommand = { readonly command: "actorLookup"; readonly flags: number; readonly correlation: NonzeroU64; readonly actorId: Text8; };
7001
8167
  export function decodeActorLookupCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorLookupCommand { if (!frames.length) fail("actorLookup frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 26) fail("actorLookup header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("actorLookup flags"); const value: any = { command: "actorLookup", flags };
@@ -7022,7 +8188,7 @@ export function encodeActorLookupCommand(value: ActorLookupCommand, context: Ser
7022
8188
  const frames: Uint8Array[] = [writer.result()];
7023
8189
 
7024
8190
  return frames; }
7025
- export function validateActorLookupCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8191
+ export function validateActorLookupCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7026
8192
 
7027
8193
  export type ActorDestroyCommand = { readonly command: "actorDestroy"; readonly flags: number; readonly correlation: NonzeroU64; readonly actor: ActorRouteFence; };
7028
8194
  export function decodeActorDestroyCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorDestroyCommand { if (!frames.length) fail("actorDestroy frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 27) fail("actorDestroy header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("actorDestroy flags"); const value: any = { command: "actorDestroy", flags };
@@ -7049,7 +8215,7 @@ export function encodeActorDestroyCommand(value: ActorDestroyCommand, context: S
7049
8215
  const frames: Uint8Array[] = [writer.result()];
7050
8216
 
7051
8217
  return frames; }
7052
- export function validateActorDestroyCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8218
+ export function validateActorDestroyCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7053
8219
 
7054
8220
  export type ActorJoinCommand = { readonly command: "actorJoin"; readonly flags: number; readonly correlation: NonzeroU64; readonly actor: ActorRouteFence; readonly entry: Bool8; readonly targetSpot: SpotRouteFence; readonly payload?: ApplicationPayloadEnvelopeV1; };
7055
8221
  export function decodeActorJoinCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorJoinCommand { if (!frames.length) fail("actorJoin frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 28) fail("actorJoin header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("actorJoin flags"); const value: any = { command: "actorJoin", flags };
@@ -7090,7 +8256,7 @@ export function encodeActorJoinCommand(value: ActorJoinCommand, context: Service
7090
8256
  const frames: Uint8Array[] = [writer.result()];
7091
8257
  if (value.payload !== undefined) frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
7092
8258
  return frames; }
7093
- export function validateActorJoinCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8259
+ export function validateActorJoinCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7094
8260
 
7095
8261
  export type ActorLeftCommand = { readonly command: "actorLeft"; readonly flags: number; readonly actor: ActorRef; readonly previousMembership: SpotMembership; readonly currentAuthorityOwnerGeneration: NonzeroU64; };
7096
8262
  export function decodeActorLeftCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorLeftCommand { if (!frames.length) fail("actorLeft frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 29) fail("actorLeft header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("actorLeft flags"); const value: any = { command: "actorLeft", flags };
@@ -7124,7 +8290,7 @@ export function encodeActorLeftCommand(value: ActorLeftCommand, context: Service
7124
8290
  const frames: Uint8Array[] = [writer.result()];
7125
8291
 
7126
8292
  return frames; }
7127
- export function validateActorLeftCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8293
+ export function validateActorLeftCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7128
8294
 
7129
8295
  export type RelocationReadyCommand = { readonly command: "relocationReady"; readonly flags: number; readonly relocation: RelocationId; readonly targetAttemptGeneration: NonzeroU64; readonly coordinator: RelocationCoordinatorFence; readonly target: RelocationTargetFence; readonly object: RelocationObjectIdentity; readonly senderRole: RelocationRole; };
7130
8296
  export function decodeRelocationReadyCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RelocationReadyCommand { if (!frames.length) fail("relocationReady frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 30) fail("relocationReady header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("relocationReady flags"); const value: any = { command: "relocationReady", flags };
@@ -7179,7 +8345,7 @@ export function encodeRelocationReadyCommand(value: RelocationReadyCommand, cont
7179
8345
  const frames: Uint8Array[] = [writer.result()];
7180
8346
 
7181
8347
  return frames; }
7182
- export function validateRelocationReadyCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8348
+ export function validateRelocationReadyCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7183
8349
 
7184
8350
  export type RelocationDataCommand = { readonly command: "relocationData"; readonly flags: number; readonly relocation: RelocationId; readonly targetAttemptGeneration: NonzeroU64; readonly coordinator: RelocationCoordinatorFence; readonly senderRole: RelocationRole; readonly object: RelocationObjectIdentity; readonly record: FrozenRecord; };
7185
8351
  export function decodeRelocationDataCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RelocationDataCommand { if (!frames.length) fail("relocationData frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 31) fail("relocationData header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("relocationData flags"); const value: any = { command: "relocationData", flags };
@@ -7234,7 +8400,7 @@ export function encodeRelocationDataCommand(value: RelocationDataCommand, contex
7234
8400
  const frames: Uint8Array[] = [writer.result()];
7235
8401
 
7236
8402
  return frames; }
7237
- export function validateRelocationDataCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8403
+ export function validateRelocationDataCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7238
8404
 
7239
8405
  export type ReplyRelayCommand = { readonly command: "replyRelay"; readonly flags: number; readonly operation: OperationId; readonly replyRouteId: NonzeroU64; readonly context: ReplyRelayContext; readonly terminalResult: RequestTerminalResult; readonly failureCode: FrameworkErrorCode; readonly payload?: ApplicationPayloadEnvelopeV1; };
7240
8406
  export function decodeReplyRelayCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ReplyRelayCommand { if (!frames.length) fail("replyRelay frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 33) fail("replyRelay header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("replyRelay flags"); const value: any = { command: "replyRelay", flags };
@@ -7256,9 +8422,11 @@ export function decodeReplyRelayCommand(frames: readonly Uint8Array[], context:
7256
8422
  reader.done("replyRelay"); let frameIndex = 1;
7257
8423
  if (frameIndex < frames.length) value.payload = decodeApplicationPayloadEnvelopeV1(frames[frameIndex++], context);
7258
8424
  if (frameIndex !== frames.length) fail("replyRelay frames");
7259
- if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("replyRelay runtime predicate");
8425
+ void context;
8426
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("replyRelay runtime predicate");
7260
8427
  return value; }
7261
- export function encodeReplyRelayCommand(value: ReplyRelayCommand, context: ServiceWireDecoderContext): readonly Uint8Array[] { if ((value.flags & ~0) !== 0 || (value.flags & 0) !== 0) fail("replyRelay flags"); if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("replyRelay runtime predicate"); const writer = new Writer(); writer.put([90,77, 1, 33, value.flags]);
8428
+ export function encodeReplyRelayCommand(value: ReplyRelayCommand, context: ServiceWireDecoderContext): readonly Uint8Array[] { if ((value.flags & ~0) !== 0 || (value.flags & 0) !== 0) fail("replyRelay flags"); void context;
8429
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("replyRelay runtime predicate"); const writer = new Writer(); writer.put([90,77, 1, 33, value.flags]);
7262
8430
  if (value["operation"] === undefined) fail("operation required");
7263
8431
 
7264
8432
 
@@ -7282,7 +8450,8 @@ export function encodeReplyRelayCommand(value: ReplyRelayCommand, context: Servi
7282
8450
  const frames: Uint8Array[] = [writer.result()];
7283
8451
  if (value.payload !== undefined) frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
7284
8452
  return frames; }
7285
- export function validateReplyRelayCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { if (!(runtimePredicate(context, "service-wire-constants.valid-terminal-failure", enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("replyRelay runtime predicate"); }
8453
+ export function validateReplyRelayCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; void context;
8454
+ if (!(validTerminalFailure(enumWireRequestTerminalResult(value["terminalResult"]), enumWireFrameworkErrorCode(value["failureCode"])))) fail("replyRelay runtime predicate"); }
7286
8455
 
7287
8456
  export type RelocationCutoverCommand = { readonly command: "relocationCutover"; readonly flags: number; readonly relocation: RelocationId; readonly targetAttemptGeneration: NonzeroU64; readonly coordinator: RelocationCoordinatorFence; readonly senderRole: RelocationRole; readonly object: RelocationObjectIdentity; readonly boundaryRecordCount: OrdinalOrZero; readonly boundaryChecksumCrc32c: U32; };
7288
8457
  export function decodeRelocationCutoverCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RelocationCutoverCommand { if (!frames.length) fail("relocationCutover frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 34) fail("relocationCutover header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("relocationCutover flags"); const value: any = { command: "relocationCutover", flags };
@@ -7344,7 +8513,7 @@ export function encodeRelocationCutoverCommand(value: RelocationCutoverCommand,
7344
8513
  const frames: Uint8Array[] = [writer.result()];
7345
8514
 
7346
8515
  return frames; }
7347
- export function validateRelocationCutoverCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8516
+ export function validateRelocationCutoverCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7348
8517
 
7349
8518
  export type BoundSessionSendCommand = { readonly command: "boundSessionSend"; readonly flags: number; readonly actor: ActorRouteFence; readonly expectedBindingGeneration: NonzeroU64; readonly payload: ApplicationPayloadEnvelopeV1; };
7350
8519
  export function decodeBoundSessionSendCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): BoundSessionSendCommand { if (!frames.length) fail("boundSessionSend frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 36) fail("boundSessionSend header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("boundSessionSend flags"); const value: any = { command: "boundSessionSend", flags };
@@ -7371,7 +8540,7 @@ export function encodeBoundSessionSendCommand(value: BoundSessionSendCommand, co
7371
8540
  const frames: Uint8Array[] = [writer.result()];
7372
8541
  if (value.payload === undefined) fail("boundSessionSend payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
7373
8542
  return frames; }
7374
- export function validateBoundSessionSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8543
+ export function validateBoundSessionSendCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7375
8544
 
7376
8545
  export type ActorJoinedCommand = { readonly command: "actorJoined"; readonly flags: number; readonly actor: ActorRef; readonly previousMembership: OptionalSpotMembership; readonly currentMembership: SpotMembership; readonly currentAuthorityOwnerGeneration: NonzeroU64; };
7377
8546
  export function decodeActorJoinedCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorJoinedCommand { if (!frames.length) fail("actorJoined frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 37) fail("actorJoined header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("actorJoined flags"); const value: any = { command: "actorJoined", flags };
@@ -7412,7 +8581,7 @@ export function encodeActorJoinedCommand(value: ActorJoinedCommand, context: Ser
7412
8581
  const frames: Uint8Array[] = [writer.result()];
7413
8582
 
7414
8583
  return frames; }
7415
- export function validateActorJoinedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8584
+ export function validateActorJoinedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7416
8585
 
7417
8586
  export type BoundSessionBindCommand = { readonly command: "boundSessionBind"; readonly flags: number; readonly correlation: NonzeroU64; readonly actor: ActorRouteFence; readonly sessionRid: Rid; readonly binding: BoundSessionBindingTransition; };
7418
8587
  export function decodeBoundSessionBindCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): BoundSessionBindCommand { if (!frames.length) fail("boundSessionBind frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 38) fail("boundSessionBind header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("boundSessionBind flags"); const value: any = { command: "boundSessionBind", flags };
@@ -7453,7 +8622,7 @@ export function encodeBoundSessionBindCommand(value: BoundSessionBindCommand, co
7453
8622
  const frames: Uint8Array[] = [writer.result()];
7454
8623
 
7455
8624
  return frames; }
7456
- export function validateBoundSessionBindCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8625
+ export function validateBoundSessionBindCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7457
8626
 
7458
8627
  export type InstanceSpotCommand = { readonly command: "instanceSpot"; readonly flags: number; readonly route: InstanceRouteV1; readonly sourceNodeGeneration: NonzeroU64; readonly sourceNodeRid: Rid; readonly sourceSpotId: OptionalText8; readonly operationKind: InstanceOperationKind; readonly operation: OperationIdOrZero; readonly replyRoute: InstanceReplyRoute; readonly metadata?: MetadataFrame; readonly payload: ApplicationPayloadEnvelopeV1; };
7459
8628
  export function decodeInstanceSpotCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): InstanceSpotCommand { if (!frames.length) fail("instanceSpot frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 39) fail("instanceSpot header"); const flags = Number(reader.u(1)); if ((flags & ~1) !== 0 || (flags & 0) !== 0) fail("instanceSpot flags"); const value: any = { command: "instanceSpot", flags };
@@ -7517,7 +8686,7 @@ const frames: Uint8Array[] = [writer.result()];
7517
8686
  if ((value.flags & 1) !== 0) { if (value.metadata === undefined) fail("instanceSpot metadata"); frames.push(encodeMetadataFrame(value.metadata, context)); } else if (value.metadata !== undefined) fail("instanceSpot metadata forbidden");
7518
8687
  if (value.payload === undefined) fail("instanceSpot payload"); frames.push(encodeApplicationPayloadEnvelopeV1(value.payload, context));
7519
8688
  return frames; }
7520
- export function validateInstanceSpotCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8689
+ export function validateInstanceSpotCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7521
8690
 
7522
8691
  export type RelocationPrepareCommand = { readonly command: "relocationPrepare"; readonly flags: number; readonly relocation: RelocationId; readonly targetAttemptGeneration: NonzeroU64; readonly coordinator: RelocationCoordinatorFence; readonly target: RelocationTargetFence; readonly initiatorRole: RelocationRole; readonly object: RelocationObjectIdentity; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly payloadTotalLength: RelocationLogicalLength; readonly payloadChunkCount: RelocationChunkCount; readonly payloadChecksumCrc32c: U32; readonly applicationVersion: ApplicationVersion; };
7523
8692
  export function decodeRelocationPrepareCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RelocationPrepareCommand { if (!frames.length) fail("relocationPrepare frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 40) fail("relocationPrepare header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("relocationPrepare flags"); const value: any = { command: "relocationPrepare", flags };
@@ -7614,7 +8783,7 @@ export function encodeRelocationPrepareCommand(value: RelocationPrepareCommand,
7614
8783
  const frames: Uint8Array[] = [writer.result()];
7615
8784
 
7616
8785
  return frames; }
7617
- export function validateRelocationPrepareCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8786
+ export function validateRelocationPrepareCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7618
8787
 
7619
8788
  export type SessionRelocationSealCommand = { readonly command: "sessionRelocationSeal"; readonly flags: number; readonly relocation: RelocationId; readonly coordinator: RelocationCoordinatorFence; readonly senderRole: RelocationRole; readonly actor: ActorRouteFence; readonly sessionOwnerNodeRid: Rid; readonly sessionOwnerNodeGeneration: NonzeroU64; readonly sessionOwnerId: Text8; readonly sessionOwnerLeaseGeneration: NonzeroU64; readonly sessionRid: Rid; readonly bindingGeneration: NonzeroU64; };
7620
8789
  export function decodeSessionRelocationSealCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): SessionRelocationSealCommand { if (!frames.length) fail("sessionRelocationSeal frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 42) fail("sessionRelocationSeal header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("sessionRelocationSeal flags"); const value: any = { command: "sessionRelocationSeal", flags };
@@ -7697,7 +8866,7 @@ export function encodeSessionRelocationSealCommand(value: SessionRelocationSealC
7697
8866
  const frames: Uint8Array[] = [writer.result()];
7698
8867
 
7699
8868
  return frames; }
7700
- export function validateSessionRelocationSealCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8869
+ export function validateSessionRelocationSealCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7701
8870
 
7702
8871
  export type SessionRelocationSealedCommand = { readonly command: "sessionRelocationSealed"; readonly flags: number; readonly relocation: RelocationId; readonly coordinator: RelocationCoordinatorFence; readonly actor: ActorRouteFence; readonly sessionOwnerNodeRid: Rid; readonly sessionOwnerNodeGeneration: NonzeroU64; readonly sessionOwnerId: Text8; readonly sessionOwnerLeaseGeneration: NonzeroU64; readonly sessionRid: Rid; readonly bindingGeneration: NonzeroU64; };
7703
8872
  export function decodeSessionRelocationSealedCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): SessionRelocationSealedCommand { if (!frames.length) fail("sessionRelocationSealed frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 43) fail("sessionRelocationSealed header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("sessionRelocationSealed flags"); const value: any = { command: "sessionRelocationSealed", flags };
@@ -7773,7 +8942,7 @@ export function encodeSessionRelocationSealedCommand(value: SessionRelocationSea
7773
8942
  const frames: Uint8Array[] = [writer.result()];
7774
8943
 
7775
8944
  return frames; }
7776
- export function validateSessionRelocationSealedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8945
+ export function validateSessionRelocationSealedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7777
8946
 
7778
8947
  export type SessionRelocationRouteCommand = { readonly command: "sessionRelocationRoute"; readonly flags: number; readonly relocation: RelocationId; readonly coordinator: RelocationCoordinatorFence; readonly senderRole: RelocationRole; readonly actor: ActorRef; readonly sessionOwnerNodeRid: Rid; readonly sessionOwnerNodeGeneration: NonzeroU64; readonly sessionOwnerId: Text8; readonly sessionOwnerLeaseGeneration: NonzeroU64; readonly sessionRid: Rid; readonly bindingGeneration: NonzeroU64; readonly route: SessionRelocationRouteUpdate; };
7779
8948
  export function decodeSessionRelocationRouteCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): SessionRelocationRouteCommand { if (!frames.length) fail("sessionRelocationRoute frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 44) fail("sessionRelocationRoute header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("sessionRelocationRoute flags"); const value: any = { command: "sessionRelocationRoute", flags };
@@ -7863,7 +9032,7 @@ export function encodeSessionRelocationRouteCommand(value: SessionRelocationRout
7863
9032
  const frames: Uint8Array[] = [writer.result()];
7864
9033
 
7865
9034
  return frames; }
7866
- export function validateSessionRelocationRouteCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9035
+ export function validateSessionRelocationRouteCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7867
9036
 
7868
9037
  export type ReplyRelayAckCommand = { readonly command: "replyRelayAck"; readonly flags: number; readonly relocation: RelocationId; readonly coordinator: RelocationCoordinatorFence; readonly operation: OperationId; readonly replyRouteId: NonzeroU64; readonly requestSource: RequestSourceFence; readonly status: ReplyRelayAckStatus; };
7869
9038
  export function decodeReplyRelayAckCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ReplyRelayAckCommand { if (!frames.length) fail("replyRelayAck frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 46) fail("replyRelayAck header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("replyRelayAck flags"); const value: any = { command: "replyRelayAck", flags };
@@ -7918,7 +9087,7 @@ export function encodeReplyRelayAckCommand(value: ReplyRelayAckCommand, context:
7918
9087
  const frames: Uint8Array[] = [writer.result()];
7919
9088
 
7920
9089
  return frames; }
7921
- export function validateReplyRelayAckCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9090
+ export function validateReplyRelayAckCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7922
9091
 
7923
9092
  export type UserSpotCreateCommand = { readonly command: "userSpotCreate"; readonly flags: number; readonly correlation: NonzeroU64; readonly operation: OperationId; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly spotId: Text8; readonly stableType: Text8; readonly reservation: ObjectReservationFence; readonly deadlineUnixMs: NonzeroU64; };
7924
9093
  export function decodeUserSpotCreateCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): UserSpotCreateCommand { if (!frames.length) fail("userSpotCreate frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 47) fail("userSpotCreate header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("userSpotCreate flags"); const value: any = { command: "userSpotCreate", flags };
@@ -7987,7 +9156,7 @@ export function encodeUserSpotCreateCommand(value: UserSpotCreateCommand, contex
7987
9156
  const frames: Uint8Array[] = [writer.result()];
7988
9157
 
7989
9158
  return frames; }
7990
- export function validateUserSpotCreateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9159
+ export function validateUserSpotCreateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
7991
9160
 
7992
9161
  export type UserSpotCloseCommand = { readonly command: "userSpotClose"; readonly flags: number; readonly correlation: NonzeroU64; readonly operation: OperationId; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly target: UserSpotCloseFenceV1; readonly deadlineUnixMs: NonzeroU64; };
7993
9162
  export function decodeUserSpotCloseCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): UserSpotCloseCommand { if (!frames.length) fail("userSpotClose frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 48) fail("userSpotClose header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("userSpotClose flags"); const value: any = { command: "userSpotClose", flags };
@@ -8042,7 +9211,7 @@ export function encodeUserSpotCloseCommand(value: UserSpotCloseCommand, context:
8042
9211
  const frames: Uint8Array[] = [writer.result()];
8043
9212
 
8044
9213
  return frames; }
8045
- export function validateUserSpotCloseCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9214
+ export function validateUserSpotCloseCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8046
9215
 
8047
9216
  export type ActorCreateCommand = { readonly command: "actorCreate"; readonly flags: number; readonly correlation: NonzeroU64; readonly operation: OperationId; readonly sourceNodeRid: Rid; readonly sourceNodeGeneration: NonzeroU64; readonly actorId: Text8; readonly stableType: Text8; readonly reservation: ObjectReservationFence; readonly deadlineUnixMs: NonzeroU64; };
8048
9217
  export function decodeActorCreateCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): ActorCreateCommand { if (!frames.length) fail("actorCreate frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 49) fail("actorCreate header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("actorCreate flags"); const value: any = { command: "actorCreate", flags };
@@ -8111,7 +9280,7 @@ export function encodeActorCreateCommand(value: ActorCreateCommand, context: Ser
8111
9280
  const frames: Uint8Array[] = [writer.result()];
8112
9281
 
8113
9282
  return frames; }
8114
- export function validateActorCreateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9283
+ export function validateActorCreateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8115
9284
 
8116
9285
  export type MessageFollowCommand = { readonly command: "messageFollow"; readonly flags: number; readonly route: MessageFollowRouteV1; };
8117
9286
  export function decodeMessageFollowCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): MessageFollowCommand { if (!frames.length) fail("messageFollow frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 50) fail("messageFollow header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("messageFollow flags"); const value: any = { command: "messageFollow", flags };
@@ -8131,7 +9300,7 @@ export function encodeMessageFollowCommand(value: MessageFollowCommand, context:
8131
9300
  const frames: Uint8Array[] = [writer.result()];
8132
9301
 
8133
9302
  return frames; }
8134
- export function validateMessageFollowCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9303
+ export function validateMessageFollowCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8135
9304
 
8136
9305
  export type BoundSessionReplacedCommand = { readonly command: "boundSessionReplaced"; readonly flags: number; readonly actorAuthority: ActorRouteFence; readonly retiredSession: RetiredBoundSessionRouteFence; };
8137
9306
  export function decodeBoundSessionReplacedCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): BoundSessionReplacedCommand { if (!frames.length) fail("boundSessionReplaced frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 51) fail("boundSessionReplaced header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("boundSessionReplaced flags"); const value: any = { command: "boundSessionReplaced", flags };
@@ -8158,7 +9327,7 @@ export function encodeBoundSessionReplacedCommand(value: BoundSessionReplacedCom
8158
9327
  const frames: Uint8Array[] = [writer.result()];
8159
9328
 
8160
9329
  return frames; }
8161
- export function validateBoundSessionReplacedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9330
+ export function validateBoundSessionReplacedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8162
9331
 
8163
9332
  export type RelocationStateCommand = { readonly command: "relocationState"; readonly flags: number; readonly relocation: RelocationId; readonly targetAttemptGeneration: NonzeroU64; readonly coordinator: RelocationCoordinatorFence; readonly senderRole: RelocationRole; readonly object: RelocationObjectIdentity; readonly chunkOrdinal: U32; readonly chunkData: DurableBlob; };
8164
9333
  export function decodeRelocationStateCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RelocationStateCommand { if (!frames.length) fail("relocationState frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 52) fail("relocationState header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("relocationState flags"); const value: any = { command: "relocationState", flags };
@@ -8220,7 +9389,7 @@ export function encodeRelocationStateCommand(value: RelocationStateCommand, cont
8220
9389
  const frames: Uint8Array[] = [writer.result()];
8221
9390
 
8222
9391
  return frames; }
8223
- export function validateRelocationStateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9392
+ export function validateRelocationStateCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8224
9393
 
8225
9394
  export type RelocationFailedCommand = { readonly command: "relocationFailed"; readonly flags: number; readonly relocation: RelocationId; readonly targetAttemptGeneration: NonzeroU64; readonly coordinator: RelocationCoordinatorFence; readonly target: RelocationTargetFence; readonly object: RelocationObjectIdentity; readonly senderRole: RelocationRole; readonly failureCode: FrameworkErrorCode; };
8226
9395
  export function decodeRelocationFailedCommand(frames: readonly Uint8Array[], context: ServiceWireDecoderContext): RelocationFailedCommand { if (!frames.length) fail("relocationFailed frames"); const reader = new Reader(frames[0]); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1 || Number(reader.u(1)) !== 53) fail("relocationFailed header"); const flags = Number(reader.u(1)); if ((flags & ~0) !== 0 || (flags & 0) !== 0) fail("relocationFailed flags"); const value: any = { command: "relocationFailed", flags };
@@ -8282,7 +9451,7 @@ export function encodeRelocationFailedCommand(value: RelocationFailedCommand, co
8282
9451
  const frames: Uint8Array[] = [writer.result()];
8283
9452
 
8284
9453
  return frames; }
8285
- export function validateRelocationFailedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
9454
+ export function validateRelocationFailedCommandRuntimePredicates(value: any, context: ServiceWireDecoderContext): void { void value; void context; }
8286
9455
 
8287
9456
  export type ServiceWireCommand = HelloCommand | AdmitCommand | RejectCommand | UpdateCommand | LivenessProbeCommand | LivenessAckCommand | NodeSendCommand | NodeRequestCommand | ChannelSendCommand | ChannelRequestCommand | ReplyCommand | SpotSendCommand | SpotRequestCommand | LogicalMulticastCommand | ActorSendCommand | ActorRequestCommand | ActorLookupCommand | ActorDestroyCommand | ActorJoinCommand | ActorLeftCommand | RelocationReadyCommand | RelocationDataCommand | ReplyRelayCommand | RelocationCutoverCommand | BoundSessionSendCommand | ActorJoinedCommand | BoundSessionBindCommand | InstanceSpotCommand | RelocationPrepareCommand | SessionRelocationSealCommand | SessionRelocationSealedCommand | SessionRelocationRouteCommand | ReplyRelayAckCommand | UserSpotCreateCommand | UserSpotCloseCommand | ActorCreateCommand | MessageFollowCommand | BoundSessionReplacedCommand | RelocationStateCommand | RelocationFailedCommand;
8288
9457
 
@@ -8298,5 +9467,53 @@ export function encodeRelocationDataChunkV1DurableFormat(value: RelocationDataCh
8298
9467
  export function decodeRelocationManifestV1DurableFormat(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationManifestV1 { if (bytes.length > 33554432) fail("relocation-manifest-v1 maximum"); const reader = new Reader(bytes); if (Number(reader.u(1)) !== 90 || Number(reader.u(1)) !== 76 || Number(reader.u(1)) !== 84 || Number(reader.u(1)) !== 77 || Number(reader.u(1)) !== 1) fail("relocation-manifest-v1 header"); const flags = readU16(reader, context, {}, 0); if (!same(flags, 0)) fail("relocation-manifest-v1 flags"); const length = Number(readU32(reader, context, {}, 0)); const body = reader.take(length); const checksumOffset = reader.offset; const declared = Number(reader.u(4)); reader.done("relocation-manifest-v1"); if (crc32c(bytes.slice(0, checksumOffset)) !== declared) fail("relocation-manifest-v1 checksum"); return decodeRelocationManifestV1(body, context); }
8299
9468
  export function encodeRelocationManifestV1DurableFormat(value: RelocationManifestV1, context: ServiceWireDecoderContext): Uint8Array { const body = encodeRelocationManifestV1(value, context); const writer = new Writer(); writer.put([90,76,84,77, 1]); writeU16(0, writer, context, {}, 0); writeU32(body.length, writer, context, {}, 0); writer.put(body); writer.u(BigInt(crc32c(writer.result())), 4); const bytes = writer.result(); if (bytes.length > 33554432) fail("relocation-manifest-v1 maximum"); return bytes; }
8300
9469
 
8301
- export function decodeRelocationEnvelopeV1LogicalStream(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationEnvelopeV1 { if (bytes.length > 274877906944) fail("relocation-envelope-v1 maximum"); return decodeRelocationEnvelopeV1(bytes, context); }
9470
+ export type RelocationEnvelopeV1LogicalDecodeStep =
9471
+ | { readonly state: "needMore"; readonly bufferedInputByteCount: number; readonly consumedByteCount: number; readonly continuationDepth: number }
9472
+ | { readonly state: "complete"; readonly value: RelocationEnvelopeV1; readonly consumedByteCount: number; readonly continuationDepth: number };
9473
+ export type LogicalFailureKind = "truncated" | "trailing" | "capacity" | "limit" | "protocol";
9474
+ export class LogicalDecodeError extends RangeError { constructor(readonly kind: LogicalFailureKind, readonly offset: number, options?: ErrorOptions) { super(kind + " at byte " + offset, options); this.name = "LogicalDecodeError"; } }
9475
+ export class RelocationEnvelopeV1LogicalStreamDecoder {
9476
+ static readonly maximumContinuationDepth = 12;
9477
+ private readonly reader = new IncrementalReader();
9478
+ private readonly machine: Generator<void, RelocationEnvelopeV1, void>;
9479
+ private state: "reading" | "await-final" | "complete" | "failed" = "reading";
9480
+ private pendingValue: RelocationEnvelopeV1 | undefined;
9481
+ private totalInputByteCount = 0;
9482
+ constructor(context: ServiceWireDecoderContext) {
9483
+ this.machine = readIncrementalRelocationEnvelopeV1(this.reader, context, {}, 0);
9484
+ }
9485
+ setSyntheticPriorInputByteCountForTest(value: number): void { if (this.totalInputByteCount !== 0) throw new Error("decoder already used"); this.totalInputByteCount = value; }
9486
+ private logicalFailure(error: unknown, forced?: LogicalFailureKind): LogicalDecodeError { if (error instanceof LogicalDecodeError) return error; const kind = forced ?? (error instanceof ServiceWireCapacityError ? "capacity" : "protocol"); return new LogicalDecodeError(kind, this.reader.offset, { cause: error }); }
9487
+ push(chunk: Uint8Array, finalChunk: boolean): RelocationEnvelopeV1LogicalDecodeStep {
9488
+ if (this.state === "complete" || this.state === "failed") throw new Error("terminal logical decoder push");
9489
+ if (chunk.length > 274877906944 - this.totalInputByteCount) { this.state = "failed"; throw this.logicalFailure(new RangeError("relocation-envelope-v1 encoded limit"), "limit"); }
9490
+ this.totalInputByteCount += chunk.length;
9491
+ if (this.state === "await-final") {
9492
+ if (chunk.length !== 0) { this.state = "failed"; throw this.logicalFailure(new RangeError("relocation-envelope-v1 trailing bytes"), "trailing"); }
9493
+ if (!finalChunk) return { state: "needMore", bufferedInputByteCount: 0, consumedByteCount: this.reader.offset, continuationDepth: 12 };
9494
+ this.state = "complete";
9495
+ return { state: "complete", value: this.pendingValue as RelocationEnvelopeV1, consumedByteCount: this.reader.offset, continuationDepth: 0 };
9496
+ }
9497
+ try {
9498
+ this.reader.supply(chunk);
9499
+ const result = this.machine.next();
9500
+ if (!result.done) {
9501
+ this.reader.release();
9502
+ if (finalChunk) { this.state = "failed"; throw this.logicalFailure(new RangeError("relocation-envelope-v1 truncated"), "truncated"); }
9503
+ return { state: "needMore", bufferedInputByteCount: this.reader.bufferedInputByteCount, consumedByteCount: this.reader.offset, continuationDepth: 12 };
9504
+ }
9505
+ if (this.reader.remaining !== 0) { this.state = "failed"; throw this.logicalFailure(new RangeError("relocation-envelope-v1 trailing bytes"), "trailing"); }
9506
+ this.reader.release();
9507
+ if (finalChunk) { this.state = "complete"; return { state: "complete", value: result.value, consumedByteCount: this.reader.offset, continuationDepth: 0 }; }
9508
+ this.pendingValue = result.value;
9509
+ this.state = "await-final";
9510
+ return { state: "needMore", bufferedInputByteCount: 0, consumedByteCount: this.reader.offset, continuationDepth: 12 };
9511
+ } catch (error) {
9512
+ this.reader.discard();
9513
+ this.state = "failed";
9514
+ throw this.logicalFailure(error);
9515
+ }
9516
+ }
9517
+ }
9518
+ export function decodeRelocationEnvelopeV1LogicalStream(bytes: Uint8Array, context: ServiceWireDecoderContext): RelocationEnvelopeV1 { const step = new RelocationEnvelopeV1LogicalStreamDecoder(context).push(bytes, true); if (step.state !== "complete") fail("relocation-envelope-v1 truncated"); return step.value; }
8302
9519
  export function encodeRelocationEnvelopeV1LogicalStream(value: RelocationEnvelopeV1, context: ServiceWireDecoderContext): Uint8Array { const bytes = encodeRelocationEnvelopeV1(value, context); if (bytes.length > 274877906944) fail("relocation-envelope-v1 maximum"); return bytes; }