@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.
- package/.smartconfig.json +1 -0
- package/changelog.md +512 -0
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/appstore/types.d.ts +4 -6
- package/dist_ts/appstore/types.js +5 -5
- package/dist_ts/data/backup.d.ts +3 -26
- package/dist_ts/data/cluster.d.ts +36 -11
- package/dist_ts/data/cluster.js +33 -22
- package/dist_ts/data/clusteringress.d.ts +8 -0
- package/dist_ts/data/clusteringress.js +13 -8
- package/dist_ts/data/clusternode.d.ts +121 -74
- package/dist_ts/data/clusternode.js +109 -132
- package/dist_ts/data/clusterruntime.d.ts +39 -0
- package/dist_ts/data/clusterruntime.js +11 -0
- package/dist_ts/data/coremail.d.ts +3 -7
- package/dist_ts/data/coremail.js +2 -2
- package/dist_ts/data/coremail.runtime.d.ts +0 -1
- package/dist_ts/data/coremail.runtime.js +5 -22
- package/dist_ts/data/deploymentadoption.d.ts +0 -2
- package/dist_ts/data/deploymentadoption.js +40 -6
- package/dist_ts/data/deploymentoperation.js +16 -3
- package/dist_ts/data/deploymentpreflight.d.ts +0 -2
- package/dist_ts/data/deploymentpreflight.js +1 -1
- package/dist_ts/data/immutableimage.d.ts +38 -21
- package/dist_ts/data/immutableimage.js +45 -5
- package/dist_ts/data/index.d.ts +5 -1
- package/dist_ts/data/index.js +5 -1
- package/dist_ts/data/isolatedrestore.d.ts +139 -21
- package/dist_ts/data/isolatedrestore.golden.d.ts +0 -1
- package/dist_ts/data/isolatedrestore.golden.js +6 -9
- package/dist_ts/data/isolatedrestore.js +176 -40
- package/dist_ts/data/mail.d.ts +1 -1
- package/dist_ts/data/networkaddressplan.d.ts +78 -0
- package/dist_ts/data/networkaddressplan.js +114 -0
- package/dist_ts/data/networkauthority.d.ts +20 -22
- package/dist_ts/data/networkauthority.js +29 -43
- package/dist_ts/data/networkcredential.d.ts +10 -10
- package/dist_ts/data/networkcredential.js +16 -16
- package/dist_ts/data/networkdelivery.d.ts +18 -18
- package/dist_ts/data/networkdelivery.js +16 -16
- package/dist_ts/data/networklease.d.ts +18 -7
- package/dist_ts/data/networklease.js +29 -7
- package/dist_ts/data/networknode.d.ts +37 -0
- package/dist_ts/data/networknode.js +6 -0
- package/dist_ts/data/networkprojection.d.ts +59 -60
- package/dist_ts/data/networkprojection.js +53 -57
- package/dist_ts/data/networkprotection.d.ts +27 -28
- package/dist_ts/data/networkprotection.js +36 -36
- package/dist_ts/data/networkrouter.d.ts +11 -11
- package/dist_ts/data/networkrouter.js +1 -1
- package/dist_ts/data/networksigning.d.ts +16 -18
- package/dist_ts/data/networksigning.js +20 -21
- package/dist_ts/data/nodecredential.d.ts +4 -6
- package/dist_ts/data/nodeenrollment.d.ts +35 -40
- package/dist_ts/data/nodeenrollment.js +57 -72
- package/dist_ts/data/privatenetwork.d.ts +21 -24
- package/dist_ts/data/privatenetwork.js +39 -54
- package/dist_ts/data/runtimeassignment.d.ts +50 -34
- package/dist_ts/data/runtimeassignment.js +79 -45
- package/dist_ts/data/runtimeconfig.d.ts +21 -22
- package/dist_ts/data/runtimeconfig.js +37 -100
- package/dist_ts/data/runtimesession.d.ts +100 -62
- package/dist_ts/data/runtimesession.js +98 -79
- package/dist_ts/data/runtimeterminalreceipt.d.ts +28 -29
- package/dist_ts/data/runtimeterminalreceipt.js +42 -42
- package/dist_ts/data/secret.d.ts +18 -25
- package/dist_ts/data/secret.js +12 -52
- package/dist_ts/data/servicecredential.d.ts +14 -16
- package/dist_ts/data/servicecredential.js +17 -28
- package/dist_ts/data/serviceruntime.d.ts +128 -0
- package/dist_ts/data/serviceruntime.js +92 -0
- package/dist_ts/data/sparknodereport.d.ts +27 -14
- package/dist_ts/data/sparknodereport.js +35 -28
- package/dist_ts/data/webpush.d.ts +0 -1
- package/dist_ts/index.d.ts +2 -1
- package/dist_ts/index.js +3 -2
- package/dist_ts/platform/objectstorageretention.d.ts +21 -24
- package/dist_ts/platform/objectstorageretention.js +6 -18
- package/dist_ts/platform/storage.d.ts +1 -3
- package/dist_ts/platform/storagemigration.d.ts +0 -7
- package/dist_ts/platform/storagemigration.golden.d.ts +0 -1
- package/dist_ts/platform/storagemigration.golden.js +8 -12
- package/dist_ts/platform/storagemigration.js +6 -51
- package/dist_ts/platform/types.d.ts +2 -2
- package/dist_ts/private/canonicaljson.d.ts +9 -1
- package/dist_ts/private/canonicaljson.js +14 -2
- package/dist_ts/private/dataproperties.d.ts +62 -0
- package/dist_ts/private/dataproperties.js +117 -0
- package/dist_ts/private/networkcontract.d.ts +14 -10
- package/dist_ts/private/networkcontract.js +15 -1
- package/dist_ts/private/producercontract.d.ts +11 -0
- package/dist_ts/private/producercontract.js +21 -0
- package/dist_ts/private/releaseversion.d.ts +37 -0
- package/dist_ts/private/releaseversion.js +48 -0
- package/dist_ts/private/runtimepolicy.d.ts +31 -0
- package/dist_ts/private/runtimepolicy.js +90 -0
- package/dist_ts/private/tokenlist.d.ts +9 -0
- package/dist_ts/private/tokenlist.js +23 -0
- package/dist_ts/protocol.d.ts +137 -0
- package/dist_ts/protocol.js +255 -0
- package/dist_ts/requests/admin.d.ts +8 -8
- package/dist_ts/requests/backup.d.ts +102 -112
- package/dist_ts/requests/cluster.d.ts +47 -10
- package/dist_ts/requests/cluster.js +1 -1
- package/dist_ts/requests/clusteringress.d.ts +9 -0
- package/dist_ts/requests/clusteringress.js +1 -1
- package/dist_ts/requests/config.d.ts +3 -3
- package/dist_ts/requests/corestore.d.ts +0 -3
- package/dist_ts/requests/corestore.js +5 -9
- package/dist_ts/requests/network.d.ts +87 -31
- package/dist_ts/requests/node.d.ts +15 -28
- package/dist_ts/requests/pallet.d.ts +13 -13
- package/dist_ts/requests/runtimesession.d.ts +53 -41
- package/dist_ts/requests/secret.d.ts +4 -5
- package/dist_ts/requests/secret.js +1 -5
- package/dist_ts/requests/service.d.ts +60 -0
- package/dist_ts/runtime.corestore.d.ts +56 -74
- package/dist_ts/runtime.corestore.databaseexportpackage.d.ts +30 -36
- package/dist_ts/runtime.corestore.databaseexportpackage.golden.d.ts +11 -12
- package/dist_ts/runtime.corestore.databaseexportpackage.golden.js +54 -71
- package/dist_ts/runtime.corestore.databaseexportpackage.js +9 -25
- package/dist_ts/runtime.corestore.js +35 -135
- package/dist_ts/runtime.corestore.relay.js +2 -7
- package/dist_ts/runtime.d.ts +38 -48
- package/dist_ts/runtime.js +20 -77
- package/dist_ts/runtime.networkprojection.d.ts +4 -4
- package/dist_ts/runtime.networkprojection.js +18 -18
- package/dist_ts/runtime.workloadinit.d.ts +23 -24
- package/dist_ts/runtime.workloadinit.js +6 -13
- package/package.json +2 -2
- package/readme.md +540 -269
- package/ts/00_commitinfo_data.ts +3 -3
- package/ts/appstore/types.ts +4 -6
- package/ts/data/backup.ts +3 -38
- package/ts/data/cluster.ts +51 -34
- package/ts/data/clusteringress.ts +12 -12
- package/ts/data/clusternode.ts +204 -232
- package/ts/data/clusterruntime.ts +45 -0
- package/ts/data/coremail.runtime.ts +4 -21
- package/ts/data/coremail.ts +3 -7
- package/ts/data/deploymentadoption.ts +46 -4
- package/ts/data/deploymentoperation.ts +16 -1
- package/ts/data/deploymentpreflight.ts +0 -2
- package/ts/data/immutableimage.ts +71 -24
- package/ts/data/index.ts +5 -1
- package/ts/data/isolatedrestore.golden.ts +5 -9
- package/ts/data/isolatedrestore.ts +339 -54
- package/ts/data/mail.ts +1 -1
- package/ts/data/networkaddressplan.ts +175 -0
- package/ts/data/networkauthority.ts +45 -61
- package/ts/data/networkcredential.ts +24 -24
- package/ts/data/networkdelivery.ts +27 -27
- package/ts/data/networklease.ts +40 -13
- package/ts/data/networknode.ts +37 -0
- package/ts/data/networkprojection.ts +119 -124
- package/ts/data/networkprotection.ts +54 -55
- package/ts/data/networkrouter.ts +14 -14
- package/ts/data/networksigning.ts +29 -32
- package/ts/data/nodecredential.ts +4 -6
- package/ts/data/nodeenrollment.ts +96 -114
- package/ts/data/privatenetwork.ts +58 -74
- package/ts/data/runtimeassignment.ts +143 -94
- package/ts/data/runtimeconfig.ts +62 -122
- package/ts/data/runtimesession.ts +185 -138
- package/ts/data/runtimeterminalreceipt.ts +72 -73
- package/ts/data/secret.ts +28 -76
- package/ts/data/servicecredential.ts +33 -43
- package/ts/data/serviceruntime.ts +208 -0
- package/ts/data/sparknodereport.ts +48 -36
- package/ts/data/webpush.ts +0 -1
- package/ts/index.ts +2 -0
- package/ts/platform/objectstorageretention.ts +36 -55
- package/ts/platform/storage.ts +1 -3
- package/ts/platform/storagemigration.golden.ts +7 -11
- package/ts/platform/storagemigration.ts +5 -55
- package/ts/platform/types.ts +2 -2
- package/ts/private/canonicaljson.ts +13 -1
- package/ts/private/dataproperties.ts +139 -0
- package/ts/private/networkcontract.ts +23 -9
- package/ts/private/producercontract.ts +19 -0
- package/ts/private/releaseversion.ts +70 -0
- package/ts/private/runtimepolicy.ts +105 -0
- package/ts/private/tokenlist.ts +30 -0
- package/ts/protocol.ts +364 -0
- package/ts/requests/admin.ts +11 -11
- package/ts/requests/backup.ts +112 -117
- package/ts/requests/cluster.ts +58 -13
- package/ts/requests/clusteringress.ts +9 -0
- package/ts/requests/config.ts +3 -3
- package/ts/requests/corestore.ts +4 -16
- package/ts/requests/network.ts +90 -41
- package/ts/requests/node.ts +21 -38
- package/ts/requests/pallet.ts +17 -17
- package/ts/requests/runtimesession.ts +63 -51
- package/ts/requests/secret.ts +5 -10
- package/ts/requests/service.ts +81 -0
- package/ts/runtime.corestore.databaseexportpackage.golden.ts +77 -95
- package/ts/runtime.corestore.databaseexportpackage.ts +51 -73
- package/ts/runtime.corestore.relay.ts +1 -10
- package/ts/runtime.corestore.ts +118 -268
- package/ts/runtime.networkprojection.ts +30 -30
- package/ts/runtime.ts +83 -158
- package/ts/runtime.workloadinit.ts +36 -48
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.d.ts +0 -902
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.golden.d.ts +0 -35
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.golden.js +0 -315
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.js +0 -3315
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.d.ts +0 -291
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.d.ts +0 -30
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.js +0 -408
- package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.js +0 -1126
- package/ts/runtime.cloudlylegacydeploymentsettlement.golden.ts +0 -421
- package/ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.ts +0 -510
- package/ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.ts +0 -2470
- 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 {
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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
|
|
98
|
-
snapshotVersion: 1;
|
|
176
|
+
export interface ISwarmManagerSnapshot {
|
|
99
177
|
snapshotDigest: TSha256Digest;
|
|
100
178
|
nodeCount: number;
|
|
101
179
|
managerCount: number;
|
|
102
|
-
nodes:
|
|
180
|
+
nodes: ISwarmManagerObservedNode[];
|
|
103
181
|
}
|
|
104
|
-
interface
|
|
105
|
-
schemaVersion: 1;
|
|
182
|
+
interface ISparkSwarmObservationBase {
|
|
106
183
|
reporterSessionId: string;
|
|
107
184
|
observationSequence: number;
|
|
108
185
|
observedAt: number;
|
|
109
186
|
}
|
|
110
|
-
export type
|
|
187
|
+
export type TSparkSwarmObservation = (ISparkSwarmObservationBase & {
|
|
111
188
|
state: 'unknown';
|
|
112
189
|
reason: 'docker-unavailable' | 'query-failed' | 'not-initialized';
|
|
113
|
-
}) | (
|
|
190
|
+
}) | (ISparkSwarmObservationBase & {
|
|
114
191
|
state: 'not-member';
|
|
115
|
-
}) | (
|
|
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
|
-
}) | (
|
|
196
|
+
}) | (ISparkSwarmObservationBase & {
|
|
138
197
|
state: 'member';
|
|
139
198
|
swarmClusterId: string;
|
|
140
199
|
localSwarmNodeId: string;
|
|
141
200
|
controlAvailable: true;
|
|
142
|
-
managerSnapshot?:
|
|
201
|
+
managerSnapshot?: ISwarmManagerSnapshot;
|
|
143
202
|
});
|
|
144
|
-
export type
|
|
145
|
-
export declare const
|
|
146
|
-
readonly
|
|
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
|
|
222
|
+
export interface ISparkSwarmObservationRequest {
|
|
165
223
|
nodeId: string;
|
|
166
224
|
nodeToken: string;
|
|
167
|
-
|
|
225
|
+
/** Read and negotiated before the node is authenticated; see `sparkSwarmNodeContracts`. */
|
|
226
|
+
protocol: IProtocolOffer;
|
|
227
|
+
observation: TSparkSwarmObservation;
|
|
168
228
|
}
|
|
169
|
-
export interface
|
|
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
|
|
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:
|
|
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
|
|
197
|
-
|
|
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
|
|
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:
|
|
274
|
+
targets: IClusterRuntimeTarget[];
|
|
226
275
|
}
|
|
227
|
-
export interface
|
|
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
|
|
236
|
-
export declare const
|
|
237
|
-
export declare const
|
|
238
|
-
export declare const createSwarmManagerSnapshotDigestInput: (swarmClusterIdArg: string, snapshotArg:
|
|
239
|
-
export declare const computeSwarmManagerSnapshotDigest: (swarmClusterIdArg: string, snapshotArg:
|
|
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
|
|
242
|
-
export declare const
|
|
243
|
-
export declare const
|
|
244
|
-
export declare const
|
|
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:
|
|
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?:
|
|
354
|
+
sparkNodeReport?: ISparkNodeReportRecord;
|
|
308
355
|
/**
|
|
309
356
|
* Docker swarm node ID if part of swarm
|
|
310
357
|
*/
|