@serve.zone/interfaces 31.8.0 → 32.0.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 (215) hide show
  1. package/.smartconfig.json +1 -0
  2. package/changelog.md +512 -0
  3. package/dist_ts/00_commitinfo_data.js +3 -3
  4. package/dist_ts/appstore/types.d.ts +4 -6
  5. package/dist_ts/appstore/types.js +5 -5
  6. package/dist_ts/data/backup.d.ts +3 -26
  7. package/dist_ts/data/cluster.d.ts +36 -11
  8. package/dist_ts/data/cluster.js +33 -22
  9. package/dist_ts/data/clusteringress.d.ts +8 -0
  10. package/dist_ts/data/clusteringress.js +13 -8
  11. package/dist_ts/data/clusternode.d.ts +121 -74
  12. package/dist_ts/data/clusternode.js +109 -132
  13. package/dist_ts/data/clusterruntime.d.ts +39 -0
  14. package/dist_ts/data/clusterruntime.js +11 -0
  15. package/dist_ts/data/coremail.d.ts +3 -7
  16. package/dist_ts/data/coremail.js +2 -2
  17. package/dist_ts/data/coremail.runtime.d.ts +0 -1
  18. package/dist_ts/data/coremail.runtime.js +5 -22
  19. package/dist_ts/data/deploymentadoption.d.ts +0 -2
  20. package/dist_ts/data/deploymentadoption.js +40 -6
  21. package/dist_ts/data/deploymentoperation.js +16 -3
  22. package/dist_ts/data/deploymentpreflight.d.ts +0 -2
  23. package/dist_ts/data/deploymentpreflight.js +1 -1
  24. package/dist_ts/data/immutableimage.d.ts +38 -21
  25. package/dist_ts/data/immutableimage.js +45 -5
  26. package/dist_ts/data/index.d.ts +5 -1
  27. package/dist_ts/data/index.js +5 -1
  28. package/dist_ts/data/isolatedrestore.d.ts +139 -21
  29. package/dist_ts/data/isolatedrestore.golden.d.ts +0 -1
  30. package/dist_ts/data/isolatedrestore.golden.js +6 -9
  31. package/dist_ts/data/isolatedrestore.js +176 -40
  32. package/dist_ts/data/mail.d.ts +1 -1
  33. package/dist_ts/data/networkaddressplan.d.ts +78 -0
  34. package/dist_ts/data/networkaddressplan.js +114 -0
  35. package/dist_ts/data/networkauthority.d.ts +20 -22
  36. package/dist_ts/data/networkauthority.js +29 -43
  37. package/dist_ts/data/networkcredential.d.ts +10 -10
  38. package/dist_ts/data/networkcredential.js +16 -16
  39. package/dist_ts/data/networkdelivery.d.ts +18 -18
  40. package/dist_ts/data/networkdelivery.js +16 -16
  41. package/dist_ts/data/networklease.d.ts +18 -7
  42. package/dist_ts/data/networklease.js +29 -7
  43. package/dist_ts/data/networknode.d.ts +37 -0
  44. package/dist_ts/data/networknode.js +6 -0
  45. package/dist_ts/data/networkprojection.d.ts +59 -60
  46. package/dist_ts/data/networkprojection.js +53 -57
  47. package/dist_ts/data/networkprotection.d.ts +27 -28
  48. package/dist_ts/data/networkprotection.js +36 -36
  49. package/dist_ts/data/networkrouter.d.ts +11 -11
  50. package/dist_ts/data/networkrouter.js +1 -1
  51. package/dist_ts/data/networksigning.d.ts +16 -18
  52. package/dist_ts/data/networksigning.js +20 -21
  53. package/dist_ts/data/nodecredential.d.ts +4 -6
  54. package/dist_ts/data/nodeenrollment.d.ts +35 -40
  55. package/dist_ts/data/nodeenrollment.js +57 -72
  56. package/dist_ts/data/privatenetwork.d.ts +21 -24
  57. package/dist_ts/data/privatenetwork.js +39 -54
  58. package/dist_ts/data/runtimeassignment.d.ts +50 -34
  59. package/dist_ts/data/runtimeassignment.js +79 -45
  60. package/dist_ts/data/runtimeconfig.d.ts +21 -22
  61. package/dist_ts/data/runtimeconfig.js +37 -100
  62. package/dist_ts/data/runtimesession.d.ts +100 -62
  63. package/dist_ts/data/runtimesession.js +98 -79
  64. package/dist_ts/data/runtimeterminalreceipt.d.ts +28 -29
  65. package/dist_ts/data/runtimeterminalreceipt.js +42 -42
  66. package/dist_ts/data/secret.d.ts +18 -25
  67. package/dist_ts/data/secret.js +12 -52
  68. package/dist_ts/data/servicecredential.d.ts +14 -16
  69. package/dist_ts/data/servicecredential.js +17 -28
  70. package/dist_ts/data/serviceruntime.d.ts +128 -0
  71. package/dist_ts/data/serviceruntime.js +92 -0
  72. package/dist_ts/data/sparknodereport.d.ts +27 -14
  73. package/dist_ts/data/sparknodereport.js +35 -28
  74. package/dist_ts/data/webpush.d.ts +0 -1
  75. package/dist_ts/index.d.ts +2 -1
  76. package/dist_ts/index.js +3 -2
  77. package/dist_ts/platform/objectstorageretention.d.ts +21 -24
  78. package/dist_ts/platform/objectstorageretention.js +6 -18
  79. package/dist_ts/platform/storage.d.ts +1 -3
  80. package/dist_ts/platform/storagemigration.d.ts +0 -7
  81. package/dist_ts/platform/storagemigration.golden.d.ts +0 -1
  82. package/dist_ts/platform/storagemigration.golden.js +8 -12
  83. package/dist_ts/platform/storagemigration.js +6 -51
  84. package/dist_ts/platform/types.d.ts +2 -2
  85. package/dist_ts/private/canonicaljson.d.ts +9 -1
  86. package/dist_ts/private/canonicaljson.js +14 -2
  87. package/dist_ts/private/dataproperties.d.ts +62 -0
  88. package/dist_ts/private/dataproperties.js +117 -0
  89. package/dist_ts/private/networkcontract.d.ts +14 -10
  90. package/dist_ts/private/networkcontract.js +15 -1
  91. package/dist_ts/private/producercontract.d.ts +11 -0
  92. package/dist_ts/private/producercontract.js +21 -0
  93. package/dist_ts/private/releaseversion.d.ts +37 -0
  94. package/dist_ts/private/releaseversion.js +48 -0
  95. package/dist_ts/private/runtimepolicy.d.ts +31 -0
  96. package/dist_ts/private/runtimepolicy.js +90 -0
  97. package/dist_ts/private/tokenlist.d.ts +9 -0
  98. package/dist_ts/private/tokenlist.js +23 -0
  99. package/dist_ts/protocol.d.ts +137 -0
  100. package/dist_ts/protocol.js +255 -0
  101. package/dist_ts/requests/admin.d.ts +8 -8
  102. package/dist_ts/requests/backup.d.ts +102 -112
  103. package/dist_ts/requests/cluster.d.ts +47 -10
  104. package/dist_ts/requests/cluster.js +1 -1
  105. package/dist_ts/requests/clusteringress.d.ts +9 -0
  106. package/dist_ts/requests/clusteringress.js +1 -1
  107. package/dist_ts/requests/config.d.ts +3 -3
  108. package/dist_ts/requests/corestore.d.ts +0 -3
  109. package/dist_ts/requests/corestore.js +5 -9
  110. package/dist_ts/requests/network.d.ts +87 -31
  111. package/dist_ts/requests/node.d.ts +15 -28
  112. package/dist_ts/requests/pallet.d.ts +13 -13
  113. package/dist_ts/requests/runtimesession.d.ts +53 -41
  114. package/dist_ts/requests/secret.d.ts +4 -5
  115. package/dist_ts/requests/secret.js +1 -5
  116. package/dist_ts/requests/service.d.ts +60 -0
  117. package/dist_ts/runtime.corestore.d.ts +56 -74
  118. package/dist_ts/runtime.corestore.databaseexportpackage.d.ts +30 -36
  119. package/dist_ts/runtime.corestore.databaseexportpackage.golden.d.ts +11 -12
  120. package/dist_ts/runtime.corestore.databaseexportpackage.golden.js +54 -71
  121. package/dist_ts/runtime.corestore.databaseexportpackage.js +9 -25
  122. package/dist_ts/runtime.corestore.js +35 -135
  123. package/dist_ts/runtime.corestore.relay.js +2 -7
  124. package/dist_ts/runtime.d.ts +38 -48
  125. package/dist_ts/runtime.js +20 -77
  126. package/dist_ts/runtime.networkprojection.d.ts +4 -4
  127. package/dist_ts/runtime.networkprojection.js +18 -18
  128. package/dist_ts/runtime.workloadinit.d.ts +23 -24
  129. package/dist_ts/runtime.workloadinit.js +6 -13
  130. package/package.json +2 -2
  131. package/readme.md +540 -269
  132. package/ts/00_commitinfo_data.ts +3 -3
  133. package/ts/appstore/types.ts +4 -6
  134. package/ts/data/backup.ts +3 -38
  135. package/ts/data/cluster.ts +51 -34
  136. package/ts/data/clusteringress.ts +12 -12
  137. package/ts/data/clusternode.ts +204 -232
  138. package/ts/data/clusterruntime.ts +45 -0
  139. package/ts/data/coremail.runtime.ts +4 -21
  140. package/ts/data/coremail.ts +3 -7
  141. package/ts/data/deploymentadoption.ts +46 -4
  142. package/ts/data/deploymentoperation.ts +16 -1
  143. package/ts/data/deploymentpreflight.ts +0 -2
  144. package/ts/data/immutableimage.ts +71 -24
  145. package/ts/data/index.ts +5 -1
  146. package/ts/data/isolatedrestore.golden.ts +5 -9
  147. package/ts/data/isolatedrestore.ts +339 -54
  148. package/ts/data/mail.ts +1 -1
  149. package/ts/data/networkaddressplan.ts +175 -0
  150. package/ts/data/networkauthority.ts +45 -61
  151. package/ts/data/networkcredential.ts +24 -24
  152. package/ts/data/networkdelivery.ts +27 -27
  153. package/ts/data/networklease.ts +40 -13
  154. package/ts/data/networknode.ts +37 -0
  155. package/ts/data/networkprojection.ts +119 -124
  156. package/ts/data/networkprotection.ts +54 -55
  157. package/ts/data/networkrouter.ts +14 -14
  158. package/ts/data/networksigning.ts +29 -32
  159. package/ts/data/nodecredential.ts +4 -6
  160. package/ts/data/nodeenrollment.ts +96 -114
  161. package/ts/data/privatenetwork.ts +58 -74
  162. package/ts/data/runtimeassignment.ts +143 -94
  163. package/ts/data/runtimeconfig.ts +62 -122
  164. package/ts/data/runtimesession.ts +185 -138
  165. package/ts/data/runtimeterminalreceipt.ts +72 -73
  166. package/ts/data/secret.ts +28 -76
  167. package/ts/data/servicecredential.ts +33 -43
  168. package/ts/data/serviceruntime.ts +208 -0
  169. package/ts/data/sparknodereport.ts +48 -36
  170. package/ts/data/webpush.ts +0 -1
  171. package/ts/index.ts +2 -0
  172. package/ts/platform/objectstorageretention.ts +36 -55
  173. package/ts/platform/storage.ts +1 -3
  174. package/ts/platform/storagemigration.golden.ts +7 -11
  175. package/ts/platform/storagemigration.ts +5 -55
  176. package/ts/platform/types.ts +2 -2
  177. package/ts/private/canonicaljson.ts +13 -1
  178. package/ts/private/dataproperties.ts +139 -0
  179. package/ts/private/networkcontract.ts +23 -9
  180. package/ts/private/producercontract.ts +19 -0
  181. package/ts/private/releaseversion.ts +70 -0
  182. package/ts/private/runtimepolicy.ts +105 -0
  183. package/ts/private/tokenlist.ts +30 -0
  184. package/ts/protocol.ts +364 -0
  185. package/ts/requests/admin.ts +11 -11
  186. package/ts/requests/backup.ts +112 -117
  187. package/ts/requests/cluster.ts +58 -13
  188. package/ts/requests/clusteringress.ts +9 -0
  189. package/ts/requests/config.ts +3 -3
  190. package/ts/requests/corestore.ts +4 -16
  191. package/ts/requests/network.ts +90 -41
  192. package/ts/requests/node.ts +21 -38
  193. package/ts/requests/pallet.ts +17 -17
  194. package/ts/requests/runtimesession.ts +63 -51
  195. package/ts/requests/secret.ts +5 -10
  196. package/ts/requests/service.ts +81 -0
  197. package/ts/runtime.corestore.databaseexportpackage.golden.ts +77 -95
  198. package/ts/runtime.corestore.databaseexportpackage.ts +51 -73
  199. package/ts/runtime.corestore.relay.ts +1 -10
  200. package/ts/runtime.corestore.ts +118 -268
  201. package/ts/runtime.networkprojection.ts +30 -30
  202. package/ts/runtime.ts +83 -158
  203. package/ts/runtime.workloadinit.ts +36 -48
  204. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.d.ts +0 -902
  205. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.golden.d.ts +0 -35
  206. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.golden.js +0 -315
  207. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.js +0 -3315
  208. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.d.ts +0 -291
  209. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.d.ts +0 -30
  210. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.js +0 -408
  211. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.js +0 -1126
  212. package/ts/runtime.cloudlylegacydeploymentsettlement.golden.ts +0 -421
  213. package/ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.ts +0 -510
  214. package/ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.ts +0 -2470
  215. package/ts/runtime.cloudlylegacydeploymentsettlement.ts +0 -6630
@@ -1,6 +1,7 @@
1
1
  import * as plugins from '../plugins.js';
2
2
  import type { TSha256Digest, TImmutableContainerPlatform } from './immutableimage.js';
3
- import type { ISparkNodeReportRecordV2 } from './sparknodereport.js';
3
+ import type { ISparkNodeReportRecord } from './sparknodereport.js';
4
+ import { type IProtocolOffer } from '../protocol.js';
4
5
  export interface IClusterNodeMetrics {
5
6
  cpuUsagePercent: number;
6
7
  memoryUsedMB: number;
@@ -58,10 +59,82 @@ export interface IServeZoneServiceRuntimeInfo {
58
59
  updatedAt?: number;
59
60
  error?: string;
60
61
  }
61
- /** Spark -> Cloudly HTTP body for POST /spark/v1/nodes/metrics-sample */
62
+ /**
63
+ * The Swarm-era Spark runtime's own routes.
64
+ *
65
+ * A separate runtime, not an older version of the node runtime: a worker in `coreflow-node` mode
66
+ * posts these four bodies, while a pallet node posts `sparkNodeHeartbeatContract.endpoint`. They
67
+ * retire together with coreflow, not with this release.
68
+ *
69
+ * Each route states its endpoint beside the bytes it reads and writes, in the same three members
70
+ * as `sparkNodeHeartbeatContract`, so one bounded-read helper serves every Spark route. The four
71
+ * bounds differ because the bodies do: a bound is the largest body its own shape can carry here,
72
+ * rounded up, and nothing larger is read before it is refused. Every route is judged in the one
73
+ * server order `protocol.readProtocolOffer` states, against this server's `sparkSwarmNode` offer;
74
+ * none of them carries a typed error, so a refusal is answered with `protocolRefusalStatus` and an
75
+ * `IProtocolRefusal` body before the node is authenticated and before the body is acted on. Every
76
+ * answer states this server's own offer, exactly as the request states the reporter's, so each
77
+ * side judges the other from the bodies they exchanged.
78
+ */
79
+ export declare const sparkSwarmNodeContracts: Readonly<{
80
+ /** The full runtime description on every beat; each described service costs some 600 bytes. */
81
+ readonly heartbeat: Readonly<{
82
+ readonly endpoint: "/spark/swarm-nodes/heartbeat";
83
+ readonly maxRequestBytes: 32768;
84
+ readonly maxResponseBytes: 2048;
85
+ }>;
86
+ /** One sample up, every action the server holds for this node back down. */
87
+ readonly metricsSample: Readonly<{
88
+ readonly endpoint: "/spark/swarm-nodes/metrics-sample";
89
+ readonly maxRequestBytes: 4096;
90
+ readonly maxResponseBytes: 32768;
91
+ }>;
92
+ /** `resultText` is the body here, and a server keeps at most 4000 characters of it. */
93
+ readonly actionResult: Readonly<{
94
+ readonly endpoint: "/spark/swarm-nodes/action-result";
95
+ readonly maxRequestBytes: 8192;
96
+ readonly maxResponseBytes: 2048;
97
+ }>;
98
+ /**
99
+ * By far the largest of the four: a manager snapshot carries up to the 1024 observed nodes
100
+ * `validateSparkSwarmObservationRequest` admits, each with two identifiers of up to 200
101
+ * characters, which is close to 600 KiB of body this route must still be able to read.
102
+ */
103
+ readonly swarmObservation: Readonly<{
104
+ readonly endpoint: "/spark/swarm-nodes/swarm-observation";
105
+ readonly maxRequestBytes: 786432;
106
+ readonly maxResponseBytes: 2048;
107
+ }>;
108
+ readonly protocolRefusalStatus: 422;
109
+ }>;
110
+ /**
111
+ * Spark -> Cloudly body for `sparkSwarmNodeContracts.heartbeat.endpoint`.
112
+ *
113
+ * The host presentation of a Swarm-era worker: its metrics and its runtime description, both
114
+ * stated in full on every beat. This is the one owner of the shape — Cloudly and Spark each
115
+ * carried a private copy until 32.0.0, which is how the two drifted apart.
116
+ */
117
+ export interface ISparkSwarmNodeHeartbeatRequest {
118
+ nodeId: string;
119
+ nodeToken: string;
120
+ /** Read and negotiated before the node is authenticated; see `sparkSwarmNodeContracts`. */
121
+ protocol: IProtocolOffer;
122
+ metrics: IClusterNodeMetrics;
123
+ runtimeInfo: ISparkNodeRuntimeInfo;
124
+ }
125
+ /** What Cloudly answers a Swarm-era heartbeat with; `message` explains a refusal to an operator. */
126
+ export interface ISparkSwarmNodeHeartbeatResponse {
127
+ accepted: boolean;
128
+ message?: string;
129
+ /** The answering server's offer; see `sparkSwarmNodeContracts`. */
130
+ protocol: IProtocolOffer;
131
+ }
132
+ /** Spark -> Cloudly body for `sparkSwarmNodeContracts.metricsSample.endpoint`. */
62
133
  export interface ISparkMetricsSampleRequest {
63
134
  nodeId: string;
64
135
  nodeToken: string;
136
+ /** Read and negotiated before the node is authenticated; see `sparkSwarmNodeContracts`. */
137
+ protocol: IProtocolOffer;
65
138
  sample: INodeMetricsSample;
66
139
  }
67
140
  export interface ISparkMetricsSampleResponse {
@@ -69,11 +142,15 @@ export interface ISparkMetricsSampleResponse {
69
142
  message?: string;
70
143
  /** Actions queued for this node; spark executes them and posts results. */
71
144
  pendingActions?: INodeAction[];
145
+ /** The answering server's offer; see `sparkSwarmNodeContracts`. */
146
+ protocol: IProtocolOffer;
72
147
  }
73
- /** Spark -> Cloudly HTTP body for POST /spark/v1/nodes/action-result */
148
+ /** Spark -> Cloudly body for `sparkSwarmNodeContracts.actionResult.endpoint`. */
74
149
  export interface ISparkActionResultRequest {
75
150
  nodeId: string;
76
151
  nodeToken: string;
152
+ /** Read and negotiated before the node is authenticated; see `sparkSwarmNodeContracts`. */
153
+ protocol: IProtocolOffer;
77
154
  actionId: string;
78
155
  status: Extract<TNodeActionStatus, 'running' | 'succeeded' | 'failed'>;
79
156
  resultText?: string;
@@ -81,8 +158,10 @@ export interface ISparkActionResultRequest {
81
158
  export interface ISparkActionResultResponse {
82
159
  accepted: boolean;
83
160
  message?: string;
161
+ /** The answering server's offer; see `sparkSwarmNodeContracts`. */
162
+ protocol: IProtocolOffer;
84
163
  }
85
- export interface ISwarmManagerObservedNodeV1 {
164
+ export interface ISwarmManagerObservedNode {
86
165
  swarmNodeId: string;
87
166
  nodeName: string;
88
167
  platform: TImmutableContainerPlatform;
@@ -94,57 +173,36 @@ export interface ISwarmManagerObservedNodeV1 {
94
173
  reachability: 'unknown' | 'unreachable' | 'reachable';
95
174
  };
96
175
  }
97
- export interface ISwarmManagerSnapshotV1 {
98
- snapshotVersion: 1;
176
+ export interface ISwarmManagerSnapshot {
99
177
  snapshotDigest: TSha256Digest;
100
178
  nodeCount: number;
101
179
  managerCount: number;
102
- nodes: ISwarmManagerObservedNodeV1[];
180
+ nodes: ISwarmManagerObservedNode[];
103
181
  }
104
- interface ISparkSwarmObservationBaseV1 {
105
- schemaVersion: 1;
182
+ interface ISparkSwarmObservationBase {
106
183
  reporterSessionId: string;
107
184
  observationSequence: number;
108
185
  observedAt: number;
109
186
  }
110
- export type TSparkSwarmObservationV1 = (ISparkSwarmObservationBaseV1 & {
187
+ export type TSparkSwarmObservation = (ISparkSwarmObservationBase & {
111
188
  state: 'unknown';
112
189
  reason: 'docker-unavailable' | 'query-failed' | 'not-initialized';
113
- }) | (ISparkSwarmObservationBaseV1 & {
190
+ }) | (ISparkSwarmObservationBase & {
114
191
  state: 'not-member';
115
- }) | (ISparkSwarmObservationBaseV1 & {
116
- state: 'member';
117
- swarmClusterId: string;
118
- localSwarmNodeId: string;
119
- controlAvailable: boolean;
120
- managerSnapshot?: ISwarmManagerSnapshotV1;
121
- });
122
- interface ISparkSwarmObservationBaseV2 {
123
- schemaVersion: 2;
124
- reporterSessionId: string;
125
- observationSequence: number;
126
- observedAt: number;
127
- }
128
- export type TSparkSwarmObservationV2 = (ISparkSwarmObservationBaseV2 & {
129
- state: 'unknown';
130
- reason: 'docker-unavailable' | 'query-failed' | 'not-initialized';
131
- }) | (ISparkSwarmObservationBaseV2 & {
132
- state: 'not-member';
133
- }) | (ISparkSwarmObservationBaseV2 & {
192
+ }) | (ISparkSwarmObservationBase & {
134
193
  state: 'member';
135
194
  localSwarmNodeId: string;
136
195
  controlAvailable: false;
137
- }) | (ISparkSwarmObservationBaseV2 & {
196
+ }) | (ISparkSwarmObservationBase & {
138
197
  state: 'member';
139
198
  swarmClusterId: string;
140
199
  localSwarmNodeId: string;
141
200
  controlAvailable: true;
142
- managerSnapshot?: ISwarmManagerSnapshotV1;
201
+ managerSnapshot?: ISwarmManagerSnapshot;
143
202
  });
144
- export type TSparkSwarmObservationV2RejectionCode = 'sequence-conflict' | 'sequence-stale' | 'sequence-gap' | 'session-sequence-invalid' | 'session-retired' | 'observation-too-old' | 'observation-from-future' | 'observation-time-not-advancing' | 'acceptance-race';
145
- export declare const sparkSwarmObservationV2Contract: Readonly<{
146
- readonly endpoint: "/spark/v2/nodes/swarm-observation";
147
- readonly digestDomain: "serve.zone/spark-swarm-observation-v2";
203
+ export type TSparkSwarmObservationRejectionCode = 'sequence-conflict' | 'sequence-stale' | 'sequence-gap' | 'session-sequence-invalid' | 'session-retired' | 'observation-too-old' | 'observation-from-future' | 'observation-time-not-advancing' | 'acceptance-race';
204
+ export declare const sparkSwarmObservationContract: Readonly<{
205
+ readonly digestDomain: "serve.zone/spark-swarm-observation";
148
206
  readonly maximumPastAgeMs: 300000;
149
207
  readonly maximumFutureSkewMs: 30000;
150
208
  readonly retainedRetiredSessionIds: 32;
@@ -161,13 +219,14 @@ export declare const sparkSwarmObservationV2Contract: Readonly<{
161
219
  }>;
162
220
  }>;
163
221
  /** Cloudly derives node and cluster scope from this authenticated Spark request. */
164
- export interface ISparkSwarmObservationV2Request {
222
+ export interface ISparkSwarmObservationRequest {
165
223
  nodeId: string;
166
224
  nodeToken: string;
167
- observation: TSparkSwarmObservationV2;
225
+ /** Read and negotiated before the node is authenticated; see `sparkSwarmNodeContracts`. */
226
+ protocol: IProtocolOffer;
227
+ observation: TSparkSwarmObservation;
168
228
  }
169
- export interface ISparkSwarmObservationV2AcceptedReceipt {
170
- schemaVersion: 2;
229
+ export interface ISparkSwarmObservationAcceptedReceipt {
171
230
  state: 'accepted';
172
231
  nodeId: string;
173
232
  reporterSessionId: string;
@@ -176,45 +235,35 @@ export interface ISparkSwarmObservationV2AcceptedReceipt {
176
235
  acceptedAt: number;
177
236
  /** Runtime target generation observed immediately after this acceptance. */
178
237
  targetGenerationAtAcceptance: number;
238
+ /** The answering server's offer; see `sparkSwarmNodeContracts`. */
239
+ protocol: IProtocolOffer;
179
240
  }
180
- export interface ISparkSwarmObservationV2RejectedReceipt {
181
- schemaVersion: 2;
241
+ export interface ISparkSwarmObservationRejectedReceipt {
182
242
  state: 'rejected';
183
243
  nodeId: string;
184
244
  reporterSessionId: string;
185
245
  observationSequence: number;
186
246
  observationDigest: TSha256Digest;
187
247
  rejectedAt: number;
188
- code: TSparkSwarmObservationV2RejectionCode;
248
+ code: TSparkSwarmObservationRejectionCode;
189
249
  retryable: boolean;
250
+ /** The answering server's offer; see `sparkSwarmNodeContracts`. */
251
+ protocol: IProtocolOffer;
190
252
  }
191
253
  /**
192
254
  * Bound receipts are returned only after request validation and node
193
255
  * authentication. Malformed and authentication failures use generic HTTP
194
256
  * errors so they cannot expose credential or persisted replay state.
195
257
  */
196
- export type TSparkSwarmObservationV2Response = ISparkSwarmObservationV2AcceptedReceipt | ISparkSwarmObservationV2RejectedReceipt;
197
- /** Cloudly derives node and cluster scope from this authenticated Spark request. */
198
- export interface ISparkSwarmObservationRequest {
199
- nodeId: string;
200
- nodeToken: string;
201
- observation: TSparkSwarmObservationV1;
202
- }
203
- export interface ISparkSwarmObservationResponse {
204
- accepted: boolean;
205
- acceptedSequence?: number;
206
- targetGeneration?: number;
207
- message?: string;
208
- }
209
- export interface IClusterRuntimeTargetV1 {
258
+ export type TSparkSwarmObservationResponse = ISparkSwarmObservationAcceptedReceipt | ISparkSwarmObservationRejectedReceipt;
259
+ export interface IClusterRuntimeTarget {
210
260
  cloudlyNodeId: string;
211
261
  swarmClusterId: string;
212
262
  swarmNodeId: string;
213
263
  nodeName: string;
214
264
  platform: TImmutableContainerPlatform;
215
265
  }
216
- export interface IClusterRuntimeTargetSetReadyV1 {
217
- schemaVersion: 1;
266
+ export interface IClusterRuntimeTargetSetReady {
218
267
  state: 'ready';
219
268
  cloudlyClusterId: string;
220
269
  swarmClusterId: string;
@@ -222,29 +271,27 @@ export interface IClusterRuntimeTargetSetReadyV1 {
222
271
  targetSetDigest: TSha256Digest;
223
272
  acceptedAt: number;
224
273
  freshUntil: number;
225
- targets: IClusterRuntimeTargetV1[];
274
+ targets: IClusterRuntimeTarget[];
226
275
  }
227
- export interface IClusterRuntimeTargetSetUnavailableV1 {
228
- schemaVersion: 1;
276
+ export interface IClusterRuntimeTargetSetUnavailable {
229
277
  state: 'unavailable';
230
278
  cloudlyClusterId: string;
231
279
  generation: number;
232
280
  changedAt: number;
233
281
  reason: 'never-observed' | 'stale' | 'no-manager-consensus' | 'identity-conflict' | 'no-schedulable-targets';
234
282
  }
235
- export type TClusterRuntimeTargetSetV1 = IClusterRuntimeTargetSetReadyV1 | IClusterRuntimeTargetSetUnavailableV1;
236
- export declare const createSparkSwarmObservationV2DigestInput: (observationArg: TSparkSwarmObservationV2) => string;
237
- export declare const computeSparkSwarmObservationV2Digest: (observationArg: TSparkSwarmObservationV2) => Promise<TSha256Digest>;
238
- export declare const createSwarmManagerSnapshotDigestInput: (swarmClusterIdArg: string, snapshotArg: ISwarmManagerSnapshotV1) => string;
239
- export declare const computeSwarmManagerSnapshotDigest: (swarmClusterIdArg: string, snapshotArg: ISwarmManagerSnapshotV1) => Promise<TSha256Digest>;
283
+ export type TClusterRuntimeTargetSet = IClusterRuntimeTargetSetReady | IClusterRuntimeTargetSetUnavailable;
284
+ export declare const createSparkSwarmObservationDigestInput: (observationArg: TSparkSwarmObservation) => string;
285
+ export declare const computeSparkSwarmObservationDigest: (observationArg: TSparkSwarmObservation) => Promise<TSha256Digest>;
286
+ export declare const createSwarmManagerSnapshotDigestInput: (swarmClusterIdArg: string, snapshotArg: ISwarmManagerSnapshot) => string;
287
+ export declare const computeSwarmManagerSnapshotDigest: (swarmClusterIdArg: string, snapshotArg: ISwarmManagerSnapshot) => Promise<TSha256Digest>;
240
288
  export declare const validateSparkSwarmObservation: (observationArg: unknown) => Promise<string[]>;
241
- export declare const validateSparkSwarmObservationV2: (observationArg: unknown) => Promise<string[]>;
242
- export declare const validateSparkSwarmObservationV2Request: (requestArg: unknown) => Promise<string[]>;
243
- export declare const validateSparkSwarmObservationV2Response: (responseArg: unknown, expectedRequestArg: ISparkSwarmObservationV2Request) => Promise<string[]>;
244
- export declare const createClusterRuntimeTargetSetDigestInput: (targetSetArg: IClusterRuntimeTargetSetReadyV1) => string;
245
- export declare const computeClusterRuntimeTargetSetDigest: (targetSetArg: IClusterRuntimeTargetSetReadyV1) => Promise<TSha256Digest>;
289
+ export declare const validateSparkSwarmObservationRequest: (requestArg: unknown) => Promise<string[]>;
290
+ export declare const validateSparkSwarmObservationResponse: (responseArg: unknown, expectedRequestArg: ISparkSwarmObservationRequest) => Promise<string[]>;
291
+ export declare const createClusterRuntimeTargetSetDigestInput: (targetSetArg: IClusterRuntimeTargetSetReady) => string;
292
+ export declare const computeClusterRuntimeTargetSetDigest: (targetSetArg: IClusterRuntimeTargetSetReady) => Promise<TSha256Digest>;
246
293
  export declare const validateClusterRuntimeTargetSet: (targetSetArg: unknown) => Promise<string[]>;
247
- export declare const isClusterRuntimeTargetSetFresh: (targetSetArg: TClusterRuntimeTargetSetV1, nowArg: number) => targetSetArg is IClusterRuntimeTargetSetReadyV1;
294
+ export declare const isClusterRuntimeTargetSetFresh: (targetSetArg: TClusterRuntimeTargetSet, nowArg: number) => targetSetArg is IClusterRuntimeTargetSetReady;
248
295
  export type TSparkNodeMode = 'cloudly' | 'coreflow-node';
249
296
  export type TSparkCloudlyConnectionStatus = 'not-configured' | 'connecting' | 'connected' | 'failed';
250
297
  export interface ISparkNodeRuntimeInfo {
@@ -304,7 +351,7 @@ export interface IClusterNode {
304
351
  */
305
352
  sparkRuntimeInfo?: ISparkNodeRuntimeInfo;
306
353
  /** Separately accepted Pallet-era host report; never grants workload readiness. */
307
- sparkNodeReport?: ISparkNodeReportRecordV2;
354
+ sparkNodeReport?: ISparkNodeReportRecord;
308
355
  /**
309
356
  * Docker swarm node ID if part of swarm
310
357
  */