@kinotic-ai/system-api 5.0.0-beta.16 → 5.0.0-beta.19

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/dist/index.cjs CHANGED
@@ -44,7 +44,6 @@ __export(exports_src, {
44
44
  WorkloadOrchestrationService: () => WorkloadOrchestrationService,
45
45
  VmProviderType: () => VmProviderType,
46
46
  VmNodeStatusType: () => VmNodeStatusType,
47
- VmNodeStatus: () => VmNodeStatus,
48
47
  VmNodeServiceProxy: () => VmNodeServiceProxy,
49
48
  VmNodeRegistration: () => VmNodeRegistration,
50
49
  VmNodeOrchestrationServiceProxy: () => VmNodeOrchestrationServiceProxy,
@@ -54,7 +53,7 @@ __export(exports_src, {
54
53
  SystemMemberService: () => SystemMemberService,
55
54
  SystemApiPlugin: () => SystemApiPlugin,
56
55
  SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
57
- SYSTEM_API_ZONE: () => import_management_api9.SYSTEM_API_ZONE,
56
+ SYSTEM_API_ZONE: () => import_management_api10.SYSTEM_API_ZONE,
58
57
  LoggersDescriptor: () => LoggersDescriptor,
59
58
  LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
60
59
  LogManager: () => LogManager,
@@ -65,22 +64,10 @@ __export(exports_src, {
65
64
  GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor
66
65
  });
67
66
  module.exports = __toCommonJS(exports_src);
68
- var import_management_api9 = require("@kinotic-ai/management-api");
69
-
70
- // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
71
- var VmNodeStatusType;
72
- ((VmNodeStatusType2) => {
73
- VmNodeStatusType2["ONLINE"] = "ONLINE";
74
- VmNodeStatusType2["OFFLINE"] = "OFFLINE";
75
- VmNodeStatusType2["DRAINING"] = "DRAINING";
76
- VmNodeStatusType2["UNREACHABLE"] = "UNREACHABLE";
77
- })(VmNodeStatusType ||= {});
67
+ var import_management_api10 = require("@kinotic-ai/management-api");
78
68
 
79
- // packages/system-api/src/api/model/workload/VmNodeStatus.ts
80
- class VmNodeStatus {
81
- type = "ONLINE" /* ONLINE */;
82
- healthMessage = null;
83
- }
69
+ // packages/system-api/src/api/model/workload/VmNode.ts
70
+ var import_management_api = require("@kinotic-ai/management-api");
84
71
 
85
72
  // packages/system-api/src/api/model/workload/VmProviderType.ts
86
73
  var VmProviderType;
@@ -94,7 +81,8 @@ class VmNode {
94
81
  id;
95
82
  name;
96
83
  hostname;
97
- status = new VmNodeStatus;
84
+ state = new import_management_api.ReconcileState;
85
+ healthMessage = null;
98
86
  providerType = "BOXLITE" /* BOXLITE */;
99
87
  totalCpus = 0;
100
88
  totalMemoryMb = 0;
@@ -102,7 +90,6 @@ class VmNode {
102
90
  freeCpus = 0;
103
91
  freeMemoryMb = 0;
104
92
  freeDiskMb = 0;
105
- reservations = [];
106
93
  lastSeen = null;
107
94
  workloadDataDir = null;
108
95
  constructor(id, name, hostname) {
@@ -111,7 +98,13 @@ class VmNode {
111
98
  this.hostname = hostname;
112
99
  }
113
100
  }
114
- // packages/system-api/src/api/model/VmNodeRegistration.ts
101
+ // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
102
+ var VmNodeStatusType;
103
+ ((VmNodeStatusType2) => {
104
+ VmNodeStatusType2["ONLINE"] = "ONLINE";
105
+ VmNodeStatusType2["DRAINING"] = "DRAINING";
106
+ })(VmNodeStatusType ||= {});
107
+ // packages/system-api/src/api/model/workload/VmNodeRegistration.ts
115
108
  class VmNodeRegistration {
116
109
  id;
117
110
  name;
@@ -127,28 +120,32 @@ class VmNodeRegistration {
127
120
  this.hostname = hostname;
128
121
  }
129
122
  }
130
- // packages/system-api/src/api/services/IVmNodeService.ts
131
- var import_management_api = require("@kinotic-ai/management-api");
123
+ // packages/system-api/src/api/services/workload/IVmNodeService.ts
124
+ var import_management_api2 = require("@kinotic-ai/management-api");
132
125
  var import_core = require("@kinotic-ai/core");
133
126
 
134
127
  class VmNodeServiceProxy extends import_core.CrudServiceProxy {
135
128
  constructor(kinotic) {
136
- super(kinotic.serviceProxy(`${import_management_api.SYSTEM_API_ZONE}~org.kinotic.system.api.services.VmNodeService`));
129
+ super(kinotic.serviceProxy(`${import_management_api2.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.VmNodeService`));
130
+ }
131
+ async findHistory(nodeId, pageable) {
132
+ const page = await this.findHistorySinglePage(nodeId, pageable);
133
+ return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.findHistorySinglePage(nodeId, pageable2));
137
134
  }
138
- findAvailableNode(requiredCpus, requiredMemoryMb, requiredDiskMb) {
139
- return this.serviceProxy.invoke("findAvailableNode", [requiredCpus, requiredMemoryMb, requiredDiskMb]);
135
+ findHistorySinglePage(nodeId, pageable) {
136
+ return this.serviceProxy.invoke("findHistory", [nodeId, pageable]);
140
137
  }
141
138
  syncIndex() {
142
139
  return this.serviceProxy.invoke("syncIndex", []);
143
140
  }
144
141
  }
145
- // packages/system-api/src/api/services/IWorkloadService.ts
146
- var import_management_api2 = require("@kinotic-ai/management-api");
142
+ // packages/system-api/src/api/services/workload/IWorkloadService.ts
143
+ var import_management_api3 = require("@kinotic-ai/management-api");
147
144
  var import_core2 = require("@kinotic-ai/core");
148
145
 
149
146
  class WorkloadServiceProxy extends import_core2.CrudServiceProxy {
150
147
  constructor(kinotic) {
151
- super(kinotic.serviceProxy(`${import_management_api2.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WorkloadService`));
148
+ super(kinotic.serviceProxy(`${import_management_api3.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.WorkloadService`));
152
149
  }
153
150
  async findAllForNode(nodeId, pageable) {
154
151
  const page = await this.findAllForNodeSinglePage(nodeId, pageable);
@@ -157,20 +154,24 @@ class WorkloadServiceProxy extends import_core2.CrudServiceProxy {
157
154
  findAllForNodeSinglePage(nodeId, pageable) {
158
155
  return this.serviceProxy.invoke("findAllForNode", [nodeId, pageable]);
159
156
  }
160
- countForNode(nodeId) {
161
- return this.serviceProxy.invoke("countForNode", [nodeId]);
157
+ async findHistory(workloadId, pageable) {
158
+ const page = await this.findHistorySinglePage(workloadId, pageable);
159
+ return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.findHistorySinglePage(workloadId, pageable2));
160
+ }
161
+ findHistorySinglePage(workloadId, pageable) {
162
+ return this.serviceProxy.invoke("findHistory", [workloadId, pageable]);
162
163
  }
163
164
  syncIndex() {
164
165
  return this.serviceProxy.invoke("syncIndex", []);
165
166
  }
166
167
  }
167
- // packages/system-api/src/api/services/IWorkloadOrchestrationService.ts
168
- var import_management_api3 = require("@kinotic-ai/management-api");
168
+ // packages/system-api/src/api/services/workload/IWorkloadOrchestrationService.ts
169
+ var import_management_api4 = require("@kinotic-ai/management-api");
169
170
 
170
171
  class WorkloadOrchestrationService {
171
172
  serviceProxy;
172
173
  constructor(kinotic) {
173
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api3.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WorkloadOrchestrationService`);
174
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api4.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.WorkloadOrchestrationService`);
174
175
  }
175
176
  deployWorkload(workload) {
176
177
  return this.serviceProxy.invoke("deployWorkload", [workload]);
@@ -181,14 +182,20 @@ class WorkloadOrchestrationService {
181
182
  destroyWorkload(workloadId) {
182
183
  return this.serviceProxy.invoke("destroyWorkload", [workloadId]);
183
184
  }
185
+ deleteWorkload(workloadId) {
186
+ return this.serviceProxy.invoke("deleteWorkload", [workloadId]);
187
+ }
188
+ deleteWorkloads(workloadIds) {
189
+ return this.serviceProxy.invoke("deleteWorkloads", [workloadIds]);
190
+ }
184
191
  }
185
- // packages/system-api/src/api/services/VmNodeOrchestrationServiceProxy.ts
186
- var import_management_api4 = require("@kinotic-ai/management-api");
192
+ // packages/system-api/src/api/services/workload/VmNodeOrchestrationServiceProxy.ts
193
+ var import_management_api5 = require("@kinotic-ai/management-api");
187
194
 
188
195
  class VmNodeOrchestrationServiceProxy {
189
196
  serviceProxy;
190
197
  constructor(kinotic) {
191
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api4.SYSTEM_API_ZONE}~org.kinotic.system.api.services.VmNodeOrchestrationService`);
198
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api5.SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.VmNodeOrchestrationService`);
192
199
  }
193
200
  registerNode(registration) {
194
201
  return this.serviceProxy.invoke("registerNode", [registration]);
@@ -204,7 +211,7 @@ class VmNodeOrchestrationServiceProxy {
204
211
  }
205
212
  }
206
213
  // packages/system-api/src/api/services/LogManager.ts
207
- var import_management_api5 = require("@kinotic-ai/management-api");
214
+ var import_management_api6 = require("@kinotic-ai/management-api");
208
215
 
209
216
  // packages/system-api/src/api/services/ILogManager.ts
210
217
  var LogLevel;
@@ -245,7 +252,7 @@ class TraceLogProperties {
245
252
  class LogManager {
246
253
  serviceProxy;
247
254
  constructor(kinotic) {
248
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api5.SYSTEM_API_ZONE}~org.kinotic.system.api.services.LogManager`);
255
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api6.SYSTEM_API_ZONE}~org.kinotic.system.api.services.LogManager`);
249
256
  }
250
257
  loggers(nodeId) {
251
258
  return this.serviceProxy.invoke("loggers", null, nodeId);
@@ -278,12 +285,12 @@ class LogManager {
278
285
  }
279
286
 
280
287
  // packages/system-api/src/api/services/IKinoticClusterInfoService.ts
281
- var import_management_api6 = require("@kinotic-ai/management-api");
288
+ var import_management_api7 = require("@kinotic-ai/management-api");
282
289
 
283
290
  class KinoticClusterInfoService {
284
291
  serviceProxy;
285
292
  constructor(kinotic) {
286
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api6.SYSTEM_API_ZONE}~org.kinotic.system.api.services.KinoticClusterInfoService`);
293
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api7.SYSTEM_API_ZONE}~org.kinotic.system.api.services.KinoticClusterInfoService`);
287
294
  }
288
295
  getClusterInfo() {
289
296
  return this.serviceProxy.invoke("getClusterInfo");
@@ -291,12 +298,12 @@ class KinoticClusterInfoService {
291
298
  }
292
299
 
293
300
  // packages/system-api/src/api/services/ISystemOrganizationService.ts
294
- var import_management_api7 = require("@kinotic-ai/management-api");
301
+ var import_management_api8 = require("@kinotic-ai/management-api");
295
302
 
296
303
  class SystemOrganizationService {
297
304
  serviceProxy;
298
305
  constructor(kinotic) {
299
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api7.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemOrganizationService`);
306
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api8.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemOrganizationService`);
300
307
  }
301
308
  findOrganizations(pageable) {
302
309
  return this.serviceProxy.invoke("findOrganizations", [pageable]);
@@ -328,12 +335,12 @@ class SystemOrganizationService {
328
335
  }
329
336
 
330
337
  // packages/system-api/src/api/services/ISystemMemberService.ts
331
- var import_management_api8 = require("@kinotic-ai/management-api");
338
+ var import_management_api9 = require("@kinotic-ai/management-api");
332
339
 
333
340
  class SystemMemberService {
334
341
  serviceProxy;
335
342
  constructor(kinotic) {
336
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api8.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemMemberService`);
343
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api9.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemMemberService`);
337
344
  }
338
345
  findUsers(pageable) {
339
346
  return this.serviceProxy.invoke("findUsers", [pageable]);
@@ -372,7 +379,7 @@ var SystemApiPlugin = {
372
379
  };
373
380
  }
374
381
  };
375
- // packages/system-api/src/api/model/KinoticClusterInfo.ts
382
+ // packages/system-api/src/api/model/cluster/KinoticClusterInfo.ts
376
383
  class KinoticClusterInfo {
377
384
  localNodeId = "";
378
385
  serverNodeCount = 0;
@@ -381,7 +388,7 @@ class KinoticClusterInfo {
381
388
  nodes = [];
382
389
  active = false;
383
390
  }
384
- // packages/system-api/src/api/model/KinoticNodeInfo.ts
391
+ // packages/system-api/src/api/model/cluster/KinoticNodeInfo.ts
385
392
  class KinoticNodeInfo {
386
393
  nodeId = "";
387
394
  order = 0;
package/dist/index.d.cts CHANGED
@@ -1,40 +1,26 @@
1
1
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
2
- import { Identifiable } from "@kinotic-ai/core";
3
- declare enum VmNodeStatusType {
4
- ONLINE = "ONLINE",
5
- OFFLINE = "OFFLINE",
6
- DRAINING = "DRAINING",
7
- UNREACHABLE = "UNREACHABLE"
8
- }
2
+ import { ReconcileState, Reconcilable } from "@kinotic-ai/management-api";
9
3
  /**
10
- * Whether a node is fit to receive workloads, and why when it is not.
4
+ * Whether a node is taking workloads, as the node reports it. A node the platform cannot reach is
5
+ * not a phase the node can report: it carries the condition NODE_UNREACHABLE beside what it last
6
+ * reported.
11
7
  */
12
- declare class VmNodeStatus {
13
- /**
14
- * Whether the node is taking workloads.
15
- */
16
- type: VmNodeStatusType;
8
+ declare enum VmNodeStatusType {
9
+ ONLINE = "ONLINE",
17
10
  /**
18
- * Why the node is not taking workloads, or null when it is. Set from the node's own report
19
- * of the guarantees it can still make — a data root that stopped enforcing disk limits, or
20
- * a firewall that stopped hiding host credentials from guests.
11
+ * The node reported something it can no longer guarantee: it keeps the workloads it has and takes
12
+ * no more until it reports no problems.
21
13
  */
22
- healthMessage: string | null;
14
+ DRAINING = "DRAINING"
23
15
  }
24
16
  /**
25
- * The room one workload's run holds on a VmNode: the CPU, memory and disk its VM is sized for,
26
- * from the moment it is placed until its run ends or it is destroyed. A workload holds at most
27
- * one reservation per node, keyed by its id.
17
+ * The reconciled state of a node: the shape both the intent and the observation take, so a node is
18
+ * in its desired state exactly when the two are equal. Intent is that the node takes workloads;
19
+ * observation is what the node reports it can do.
28
20
  */
29
- interface WorkloadReservation {
30
- /** The id of the workload holding the reservation. */
31
- workloadId: string;
32
- /** CPU the workload's VM is allotted, in cores; a fraction is a share of one core. */
33
- cpus: number;
34
- /** Memory the workload's VM is allotted, in megabytes. */
35
- memoryMb: number;
36
- /** Disk the workload's VM is allotted, in megabytes. */
37
- diskMb: number;
21
+ interface VmNodeState {
22
+ /** Whether the node takes workloads. */
23
+ phase: VmNodeStatusType;
38
24
  }
39
25
  declare enum VmProviderType {
40
26
  BOXLITE = "BOXLITE",
@@ -44,7 +30,7 @@ declare enum VmProviderType {
44
30
  * Represents a node in the cluster that is running a VmManager process
45
31
  * and is capable of hosting workloads.
46
32
  */
47
- declare class VmNode implements Identifiable<string> {
33
+ declare class VmNode implements Reconcilable<VmNodeState> {
48
34
  /**
49
35
  * Unique identifier for this node.
50
36
  */
@@ -58,9 +44,17 @@ declare class VmNode implements Identifiable<string> {
58
44
  */
59
45
  hostname: string;
60
46
  /**
61
- * Whether the node is fit to receive workloads, and why when it is not.
47
+ * What the node should be, taking workloads, and what it reports it is, with what the platform
48
+ * inferred beside the node's word: that it fell silent, or that a call to it could not be
49
+ * delivered. A node is placeable exactly when this is reconciled.
50
+ */
51
+ state: ReconcileState<VmNodeState>;
52
+ /**
53
+ * Why the node is not taking workloads, or null when it is. Set from the node's own report of
54
+ * the guarantees it can still make — a data root that stopped enforcing disk limits, or a
55
+ * firewall that stopped hiding host credentials from guests.
62
56
  */
63
- status: VmNodeStatus;
57
+ healthMessage: string | null;
64
58
  /**
65
59
  * The VM provider this node runs every workload on, determined by how the node was
66
60
  * provisioned and reported when it registers.
@@ -80,7 +74,7 @@ declare class VmNode implements Identifiable<string> {
80
74
  totalDiskMb: number;
81
75
  /**
82
76
  * CPU not allocated to any workload, in cores. What is allocated is
83
- * totalCpus - freeCpus, the sum of the reservations.
77
+ * totalCpus - freeCpus, what the workloads running on the node are sized for.
84
78
  */
85
79
  freeCpus: number;
86
80
  /**
@@ -92,12 +86,6 @@ declare class VmNode implements Identifiable<string> {
92
86
  */
93
87
  freeDiskMb: number;
94
88
  /**
95
- * The room each workload running on this node holds, one entry per workload. The free*
96
- * fields are the totals less what these hold, so a workload's room is reserved and released
97
- * by its id and never counted twice.
98
- */
99
- reservations: WorkloadReservation[];
100
- /**
101
89
  * The date and time the node was last seen/heartbeat.
102
90
  */
103
91
  lastSeen: number | null;
@@ -161,17 +149,18 @@ interface WorkloadStatusReport {
161
149
  /** When the node recorded this status, in epoch milliseconds. */
162
150
  updated: number;
163
151
  }
152
+ import { WatchEvent } from "@kinotic-ai/management-api";
164
153
  import { IKinotic } from "@kinotic-ai/core";
165
- import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
154
+ import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
166
155
  interface IVmNodeService extends ICrudServiceProxy<VmNode> {
167
156
  /**
168
- * Finds a node with sufficient resources to host a workload with the given requirements.
169
- * @param requiredCpus the CPU required, in cores
170
- * @param requiredMemoryMb the amount of memory required in megabytes
171
- * @param requiredDiskMb the amount of disk space required in megabytes
172
- * @return a Promise resolving to a suitable node, or null if none available
157
+ * Lists what happened to the node, newest first: each change of what it should be and of what it
158
+ * reports, and each mark set beside them, with what caused it.
159
+ * @param nodeId the id of the node
160
+ * @param pageable the page to return
161
+ * @return a Promise resolving to a page of ledger entries, empty when the node is not registered
173
162
  */
174
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
163
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
175
164
  /**
176
165
  * This operation makes all the recent writes immediately available for search.
177
166
  * @return a Promise that resolves when the operation is complete
@@ -180,11 +169,12 @@ interface IVmNodeService extends ICrudServiceProxy<VmNode> {
180
169
  }
181
170
  declare class VmNodeServiceProxy extends CrudServiceProxy<VmNode> implements IVmNodeService {
182
171
  constructor(kinotic: IKinotic);
183
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
172
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
173
+ findHistorySinglePage(nodeId: string, pageable: Pageable): Promise<Page<WatchEvent>>;
184
174
  syncIndex(): Promise<void>;
185
175
  }
186
- import { Workload } from "@kinotic-ai/management-api";
187
- import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage, Page, Pageable } from "@kinotic-ai/core";
176
+ import { Workload, WatchEvent as WatchEvent2 } from "@kinotic-ai/management-api";
177
+ import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage as IterablePage2, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
188
178
  interface IWorkloadService extends ICrudServiceProxy2<Workload> {
189
179
  /**
190
180
  * Finds all workloads deployed on the given node.
@@ -192,13 +182,15 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
192
182
  * @param pageable the page to return
193
183
  * @return a Promise resolving to a page of workloads
194
184
  */
195
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
185
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
196
186
  /**
197
- * Counts all workloads deployed on the given node.
198
- * @param nodeId the id of the node to count workloads for
199
- * @return a Promise resolving to the number of workloads
187
+ * Lists what happened to the workload, newest first: each status its run passed through and each
188
+ * mark set beside it, with what caused it.
189
+ * @param workloadId the workload
190
+ * @param pageable the page to return
191
+ * @return a Promise resolving to a page of ledger entries, empty when the workload does not exist
200
192
  */
201
- countForNode(nodeId: string): Promise<number>;
193
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
202
194
  /**
203
195
  * This operation makes all the recent writes immediately available for search.
204
196
  * @return a Promise that resolves when the operation is complete
@@ -207,9 +199,10 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
207
199
  }
208
200
  declare class WorkloadServiceProxy extends CrudServiceProxy2<Workload> implements IWorkloadService {
209
201
  constructor(kinotic: IKinotic2);
210
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
211
- findAllForNodeSinglePage(nodeId: string, pageable: Pageable): Promise<Page<Workload>>;
212
- countForNode(nodeId: string): Promise<number>;
202
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
203
+ findAllForNodeSinglePage(nodeId: string, pageable: Pageable2): Promise<Page2<Workload>>;
204
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
205
+ findHistorySinglePage(workloadId: string, pageable: Pageable2): Promise<Page2<WatchEvent2>>;
213
206
  syncIndex(): Promise<void>;
214
207
  }
215
208
  import { Workload as Workload2 } from "@kinotic-ai/management-api";
@@ -237,11 +230,31 @@ interface IWorkloadOrchestrationService {
237
230
  */
238
231
  stopWorkload(workloadId: string): Promise<void>;
239
232
  /**
240
- * Destroys a workload, removing it from the node and cleaning up all resources.
233
+ * Destroys a workload's VM on its node, with its disk, and returns its room. A run still open is
234
+ * recorded STOPPED. The record stays as the run's outcome, and its logs stay in the log store,
235
+ * until deleteWorkload.
241
236
  * @param workloadId the id of the workload to destroy
242
- * @return a Promise that resolves when the workload has been destroyed
237
+ * @return a Promise that resolves when the VM has been destroyed
243
238
  */
244
239
  destroyWorkload(workloadId: string): Promise<void>;
240
+ /**
241
+ * Deletes a workload's record and every log line it wrote from the organization's log store, the
242
+ * one way either is removed. A run still open on its node — starting, running, or a stop the node
243
+ * has not answered — is refused: stop or destroy it first.
244
+ * @param workloadId the id of the workload to delete
245
+ * @return a Promise that resolves when the record and its logs are gone, or rejects if the run is
246
+ * still open
247
+ */
248
+ deleteWorkload(workloadId: string): Promise<void>;
249
+ /**
250
+ * Deletes the given workloads' records and every log line they wrote, as deleteWorkload does for
251
+ * one, with the log store asked once per organization. Any run still open refuses the whole batch
252
+ * before anything is deleted.
253
+ * @param workloadIds the ids of the workloads to delete
254
+ * @return a Promise that resolves when the records and their logs are gone, or rejects if any run
255
+ * is still open
256
+ */
257
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
245
258
  }
246
259
  declare class WorkloadOrchestrationService implements IWorkloadOrchestrationService {
247
260
  private readonly serviceProxy;
@@ -249,6 +262,8 @@ declare class WorkloadOrchestrationService implements IWorkloadOrchestrationServ
249
262
  deployWorkload(workload: Workload2): Promise<Workload2>;
250
263
  stopWorkload(workloadId: string): Promise<void>;
251
264
  destroyWorkload(workloadId: string): Promise<void>;
265
+ deleteWorkload(workloadId: string): Promise<void>;
266
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
252
267
  }
253
268
  import { IKinotic as IKinotic4 } from "@kinotic-ai/core";
254
269
  /**
@@ -406,40 +421,40 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
406
421
  getClusterInfo(): Promise<KinoticClusterInfo>;
407
422
  }
408
423
  import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
409
- import { IKinotic as IKinotic6, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
424
+ import { IKinotic as IKinotic6, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
410
425
  /**
411
426
  * Cross-organization reads for platform operators. Published in the system zone, which only
412
427
  * SYSTEM participants may address, so every method takes the target organization explicitly
413
428
  * instead of resolving it from the caller's scope.
414
429
  */
415
430
  interface ISystemOrganizationService {
416
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
417
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
431
+ findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
432
+ searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
418
433
  /** Resolves null when no organization has the given id. */
419
434
  findOrganizationById(organizationId: string): Promise<Organization | null>;
420
435
  countOrganizations(): Promise<number>;
421
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
422
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
436
+ findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
437
+ findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
423
438
  /** applicationId null = the organization's members */
424
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
425
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
426
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
439
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
440
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
441
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
427
442
  }
428
443
  declare class SystemOrganizationService implements ISystemOrganizationService {
429
444
  private readonly serviceProxy;
430
445
  constructor(kinotic: IKinotic6);
431
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
432
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
446
+ findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
447
+ searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
433
448
  findOrganizationById(organizationId: string): Promise<Organization | null>;
434
449
  countOrganizations(): Promise<number>;
435
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
436
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
437
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
438
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
439
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
450
+ findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
451
+ findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
452
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
453
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
454
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
440
455
  }
441
456
  import { MachineParticipantIdentity, MachineProvisionResult, UserParticipantIdentity as UserParticipantIdentity2 } from "@kinotic-ai/management-api";
442
- import { IKinotic as IKinotic7, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
457
+ import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
443
458
  /**
444
459
  * The platform's own members: the operators who sign in to the system console, and the
445
460
  * SYSTEM-scope machines that connect as platform daemons, such as a worker node's vm-manager.
@@ -448,10 +463,10 @@ import { IKinotic as IKinotic7, Page as Page3, Pageable as Pageable3 } from "@ki
448
463
  * manage through IMachineService.
449
464
  */
450
465
  interface ISystemMemberService {
451
- findUsers(pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
452
- searchUsers(searchText: string, pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
466
+ findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
467
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
453
468
  /** Lists the platform's machines, disabled ones included. */
454
- findMachines(pageable: Pageable3): Promise<Page3<MachineParticipantIdentity>>;
469
+ findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
455
470
  /**
456
471
  * Provisions a platform machine and returns it together with its generated client secret.
457
472
  * The secret is disclosed exactly once — it cannot be retrieved later.
@@ -477,9 +492,9 @@ interface ISystemMemberService {
477
492
  declare class SystemMemberService implements ISystemMemberService {
478
493
  private readonly serviceProxy;
479
494
  constructor(kinotic: IKinotic7);
480
- findUsers(pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
481
- searchUsers(searchText: string, pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
482
- findMachines(pageable: Pageable3): Promise<Page3<MachineParticipantIdentity>>;
495
+ findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
496
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
497
+ findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
483
498
  createMachine(displayName: string): Promise<MachineProvisionResult>;
484
499
  rotateSecret(machineId: string): Promise<string>;
485
500
  setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
@@ -508,4 +523,4 @@ declare class LogManager implements ILogManager {
508
523
  declare module "@kinotic-ai/core" {
509
524
  interface KinoticSingleton extends ISystemApiExtension {}
510
525
  }
511
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadReservation, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
526
+ export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
package/dist/index.d.ts CHANGED
@@ -1,40 +1,26 @@
1
1
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
2
- import { Identifiable } from "@kinotic-ai/core";
3
- declare enum VmNodeStatusType {
4
- ONLINE = "ONLINE",
5
- OFFLINE = "OFFLINE",
6
- DRAINING = "DRAINING",
7
- UNREACHABLE = "UNREACHABLE"
8
- }
2
+ import { ReconcileState, Reconcilable } from "@kinotic-ai/management-api";
9
3
  /**
10
- * Whether a node is fit to receive workloads, and why when it is not.
4
+ * Whether a node is taking workloads, as the node reports it. A node the platform cannot reach is
5
+ * not a phase the node can report: it carries the condition NODE_UNREACHABLE beside what it last
6
+ * reported.
11
7
  */
12
- declare class VmNodeStatus {
13
- /**
14
- * Whether the node is taking workloads.
15
- */
16
- type: VmNodeStatusType;
8
+ declare enum VmNodeStatusType {
9
+ ONLINE = "ONLINE",
17
10
  /**
18
- * Why the node is not taking workloads, or null when it is. Set from the node's own report
19
- * of the guarantees it can still make — a data root that stopped enforcing disk limits, or
20
- * a firewall that stopped hiding host credentials from guests.
11
+ * The node reported something it can no longer guarantee: it keeps the workloads it has and takes
12
+ * no more until it reports no problems.
21
13
  */
22
- healthMessage: string | null;
14
+ DRAINING = "DRAINING"
23
15
  }
24
16
  /**
25
- * The room one workload's run holds on a VmNode: the CPU, memory and disk its VM is sized for,
26
- * from the moment it is placed until its run ends or it is destroyed. A workload holds at most
27
- * one reservation per node, keyed by its id.
17
+ * The reconciled state of a node: the shape both the intent and the observation take, so a node is
18
+ * in its desired state exactly when the two are equal. Intent is that the node takes workloads;
19
+ * observation is what the node reports it can do.
28
20
  */
29
- interface WorkloadReservation {
30
- /** The id of the workload holding the reservation. */
31
- workloadId: string;
32
- /** CPU the workload's VM is allotted, in cores; a fraction is a share of one core. */
33
- cpus: number;
34
- /** Memory the workload's VM is allotted, in megabytes. */
35
- memoryMb: number;
36
- /** Disk the workload's VM is allotted, in megabytes. */
37
- diskMb: number;
21
+ interface VmNodeState {
22
+ /** Whether the node takes workloads. */
23
+ phase: VmNodeStatusType;
38
24
  }
39
25
  declare enum VmProviderType {
40
26
  BOXLITE = "BOXLITE",
@@ -44,7 +30,7 @@ declare enum VmProviderType {
44
30
  * Represents a node in the cluster that is running a VmManager process
45
31
  * and is capable of hosting workloads.
46
32
  */
47
- declare class VmNode implements Identifiable<string> {
33
+ declare class VmNode implements Reconcilable<VmNodeState> {
48
34
  /**
49
35
  * Unique identifier for this node.
50
36
  */
@@ -58,9 +44,17 @@ declare class VmNode implements Identifiable<string> {
58
44
  */
59
45
  hostname: string;
60
46
  /**
61
- * Whether the node is fit to receive workloads, and why when it is not.
47
+ * What the node should be, taking workloads, and what it reports it is, with what the platform
48
+ * inferred beside the node's word: that it fell silent, or that a call to it could not be
49
+ * delivered. A node is placeable exactly when this is reconciled.
50
+ */
51
+ state: ReconcileState<VmNodeState>;
52
+ /**
53
+ * Why the node is not taking workloads, or null when it is. Set from the node's own report of
54
+ * the guarantees it can still make — a data root that stopped enforcing disk limits, or a
55
+ * firewall that stopped hiding host credentials from guests.
62
56
  */
63
- status: VmNodeStatus;
57
+ healthMessage: string | null;
64
58
  /**
65
59
  * The VM provider this node runs every workload on, determined by how the node was
66
60
  * provisioned and reported when it registers.
@@ -80,7 +74,7 @@ declare class VmNode implements Identifiable<string> {
80
74
  totalDiskMb: number;
81
75
  /**
82
76
  * CPU not allocated to any workload, in cores. What is allocated is
83
- * totalCpus - freeCpus, the sum of the reservations.
77
+ * totalCpus - freeCpus, what the workloads running on the node are sized for.
84
78
  */
85
79
  freeCpus: number;
86
80
  /**
@@ -92,12 +86,6 @@ declare class VmNode implements Identifiable<string> {
92
86
  */
93
87
  freeDiskMb: number;
94
88
  /**
95
- * The room each workload running on this node holds, one entry per workload. The free*
96
- * fields are the totals less what these hold, so a workload's room is reserved and released
97
- * by its id and never counted twice.
98
- */
99
- reservations: WorkloadReservation[];
100
- /**
101
89
  * The date and time the node was last seen/heartbeat.
102
90
  */
103
91
  lastSeen: number | null;
@@ -161,17 +149,18 @@ interface WorkloadStatusReport {
161
149
  /** When the node recorded this status, in epoch milliseconds. */
162
150
  updated: number;
163
151
  }
152
+ import { WatchEvent } from "@kinotic-ai/management-api";
164
153
  import { IKinotic } from "@kinotic-ai/core";
165
- import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
154
+ import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
166
155
  interface IVmNodeService extends ICrudServiceProxy<VmNode> {
167
156
  /**
168
- * Finds a node with sufficient resources to host a workload with the given requirements.
169
- * @param requiredCpus the CPU required, in cores
170
- * @param requiredMemoryMb the amount of memory required in megabytes
171
- * @param requiredDiskMb the amount of disk space required in megabytes
172
- * @return a Promise resolving to a suitable node, or null if none available
157
+ * Lists what happened to the node, newest first: each change of what it should be and of what it
158
+ * reports, and each mark set beside them, with what caused it.
159
+ * @param nodeId the id of the node
160
+ * @param pageable the page to return
161
+ * @return a Promise resolving to a page of ledger entries, empty when the node is not registered
173
162
  */
174
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
163
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
175
164
  /**
176
165
  * This operation makes all the recent writes immediately available for search.
177
166
  * @return a Promise that resolves when the operation is complete
@@ -180,11 +169,12 @@ interface IVmNodeService extends ICrudServiceProxy<VmNode> {
180
169
  }
181
170
  declare class VmNodeServiceProxy extends CrudServiceProxy<VmNode> implements IVmNodeService {
182
171
  constructor(kinotic: IKinotic);
183
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
172
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
173
+ findHistorySinglePage(nodeId: string, pageable: Pageable): Promise<Page<WatchEvent>>;
184
174
  syncIndex(): Promise<void>;
185
175
  }
186
- import { Workload } from "@kinotic-ai/management-api";
187
- import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage, Page, Pageable } from "@kinotic-ai/core";
176
+ import { Workload, WatchEvent as WatchEvent2 } from "@kinotic-ai/management-api";
177
+ import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage as IterablePage2, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
188
178
  interface IWorkloadService extends ICrudServiceProxy2<Workload> {
189
179
  /**
190
180
  * Finds all workloads deployed on the given node.
@@ -192,13 +182,15 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
192
182
  * @param pageable the page to return
193
183
  * @return a Promise resolving to a page of workloads
194
184
  */
195
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
185
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
196
186
  /**
197
- * Counts all workloads deployed on the given node.
198
- * @param nodeId the id of the node to count workloads for
199
- * @return a Promise resolving to the number of workloads
187
+ * Lists what happened to the workload, newest first: each status its run passed through and each
188
+ * mark set beside it, with what caused it.
189
+ * @param workloadId the workload
190
+ * @param pageable the page to return
191
+ * @return a Promise resolving to a page of ledger entries, empty when the workload does not exist
200
192
  */
201
- countForNode(nodeId: string): Promise<number>;
193
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
202
194
  /**
203
195
  * This operation makes all the recent writes immediately available for search.
204
196
  * @return a Promise that resolves when the operation is complete
@@ -207,9 +199,10 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
207
199
  }
208
200
  declare class WorkloadServiceProxy extends CrudServiceProxy2<Workload> implements IWorkloadService {
209
201
  constructor(kinotic: IKinotic2);
210
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
211
- findAllForNodeSinglePage(nodeId: string, pageable: Pageable): Promise<Page<Workload>>;
212
- countForNode(nodeId: string): Promise<number>;
202
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
203
+ findAllForNodeSinglePage(nodeId: string, pageable: Pageable2): Promise<Page2<Workload>>;
204
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
205
+ findHistorySinglePage(workloadId: string, pageable: Pageable2): Promise<Page2<WatchEvent2>>;
213
206
  syncIndex(): Promise<void>;
214
207
  }
215
208
  import { Workload as Workload2 } from "@kinotic-ai/management-api";
@@ -237,11 +230,31 @@ interface IWorkloadOrchestrationService {
237
230
  */
238
231
  stopWorkload(workloadId: string): Promise<void>;
239
232
  /**
240
- * Destroys a workload, removing it from the node and cleaning up all resources.
233
+ * Destroys a workload's VM on its node, with its disk, and returns its room. A run still open is
234
+ * recorded STOPPED. The record stays as the run's outcome, and its logs stay in the log store,
235
+ * until deleteWorkload.
241
236
  * @param workloadId the id of the workload to destroy
242
- * @return a Promise that resolves when the workload has been destroyed
237
+ * @return a Promise that resolves when the VM has been destroyed
243
238
  */
244
239
  destroyWorkload(workloadId: string): Promise<void>;
240
+ /**
241
+ * Deletes a workload's record and every log line it wrote from the organization's log store, the
242
+ * one way either is removed. A run still open on its node — starting, running, or a stop the node
243
+ * has not answered — is refused: stop or destroy it first.
244
+ * @param workloadId the id of the workload to delete
245
+ * @return a Promise that resolves when the record and its logs are gone, or rejects if the run is
246
+ * still open
247
+ */
248
+ deleteWorkload(workloadId: string): Promise<void>;
249
+ /**
250
+ * Deletes the given workloads' records and every log line they wrote, as deleteWorkload does for
251
+ * one, with the log store asked once per organization. Any run still open refuses the whole batch
252
+ * before anything is deleted.
253
+ * @param workloadIds the ids of the workloads to delete
254
+ * @return a Promise that resolves when the records and their logs are gone, or rejects if any run
255
+ * is still open
256
+ */
257
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
245
258
  }
246
259
  declare class WorkloadOrchestrationService implements IWorkloadOrchestrationService {
247
260
  private readonly serviceProxy;
@@ -249,6 +262,8 @@ declare class WorkloadOrchestrationService implements IWorkloadOrchestrationServ
249
262
  deployWorkload(workload: Workload2): Promise<Workload2>;
250
263
  stopWorkload(workloadId: string): Promise<void>;
251
264
  destroyWorkload(workloadId: string): Promise<void>;
265
+ deleteWorkload(workloadId: string): Promise<void>;
266
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
252
267
  }
253
268
  import { IKinotic as IKinotic4 } from "@kinotic-ai/core";
254
269
  /**
@@ -406,40 +421,40 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
406
421
  getClusterInfo(): Promise<KinoticClusterInfo>;
407
422
  }
408
423
  import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
409
- import { IKinotic as IKinotic6, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
424
+ import { IKinotic as IKinotic6, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
410
425
  /**
411
426
  * Cross-organization reads for platform operators. Published in the system zone, which only
412
427
  * SYSTEM participants may address, so every method takes the target organization explicitly
413
428
  * instead of resolving it from the caller's scope.
414
429
  */
415
430
  interface ISystemOrganizationService {
416
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
417
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
431
+ findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
432
+ searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
418
433
  /** Resolves null when no organization has the given id. */
419
434
  findOrganizationById(organizationId: string): Promise<Organization | null>;
420
435
  countOrganizations(): Promise<number>;
421
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
422
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
436
+ findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
437
+ findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
423
438
  /** applicationId null = the organization's members */
424
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
425
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
426
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
439
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
440
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
441
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
427
442
  }
428
443
  declare class SystemOrganizationService implements ISystemOrganizationService {
429
444
  private readonly serviceProxy;
430
445
  constructor(kinotic: IKinotic6);
431
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
432
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
446
+ findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
447
+ searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
433
448
  findOrganizationById(organizationId: string): Promise<Organization | null>;
434
449
  countOrganizations(): Promise<number>;
435
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
436
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
437
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
438
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
439
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
450
+ findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
451
+ findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
452
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
453
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
454
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
440
455
  }
441
456
  import { MachineParticipantIdentity, MachineProvisionResult, UserParticipantIdentity as UserParticipantIdentity2 } from "@kinotic-ai/management-api";
442
- import { IKinotic as IKinotic7, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
457
+ import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
443
458
  /**
444
459
  * The platform's own members: the operators who sign in to the system console, and the
445
460
  * SYSTEM-scope machines that connect as platform daemons, such as a worker node's vm-manager.
@@ -448,10 +463,10 @@ import { IKinotic as IKinotic7, Page as Page3, Pageable as Pageable3 } from "@ki
448
463
  * manage through IMachineService.
449
464
  */
450
465
  interface ISystemMemberService {
451
- findUsers(pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
452
- searchUsers(searchText: string, pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
466
+ findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
467
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
453
468
  /** Lists the platform's machines, disabled ones included. */
454
- findMachines(pageable: Pageable3): Promise<Page3<MachineParticipantIdentity>>;
469
+ findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
455
470
  /**
456
471
  * Provisions a platform machine and returns it together with its generated client secret.
457
472
  * The secret is disclosed exactly once — it cannot be retrieved later.
@@ -477,9 +492,9 @@ interface ISystemMemberService {
477
492
  declare class SystemMemberService implements ISystemMemberService {
478
493
  private readonly serviceProxy;
479
494
  constructor(kinotic: IKinotic7);
480
- findUsers(pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
481
- searchUsers(searchText: string, pageable: Pageable3): Promise<Page3<UserParticipantIdentity2>>;
482
- findMachines(pageable: Pageable3): Promise<Page3<MachineParticipantIdentity>>;
495
+ findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
496
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
497
+ findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
483
498
  createMachine(displayName: string): Promise<MachineProvisionResult>;
484
499
  rotateSecret(machineId: string): Promise<string>;
485
500
  setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
@@ -508,4 +523,4 @@ declare class LogManager implements ILogManager {
508
523
  declare module "@kinotic-ai/core" {
509
524
  interface KinoticSingleton extends ISystemApiExtension {}
510
525
  }
511
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadReservation, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
526
+ export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
package/dist/index.js CHANGED
@@ -1,20 +1,8 @@
1
1
  // packages/system-api/src/index.ts
2
2
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE9 } from "@kinotic-ai/management-api";
3
3
 
4
- // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
5
- var VmNodeStatusType;
6
- ((VmNodeStatusType2) => {
7
- VmNodeStatusType2["ONLINE"] = "ONLINE";
8
- VmNodeStatusType2["OFFLINE"] = "OFFLINE";
9
- VmNodeStatusType2["DRAINING"] = "DRAINING";
10
- VmNodeStatusType2["UNREACHABLE"] = "UNREACHABLE";
11
- })(VmNodeStatusType ||= {});
12
-
13
- // packages/system-api/src/api/model/workload/VmNodeStatus.ts
14
- class VmNodeStatus {
15
- type = "ONLINE" /* ONLINE */;
16
- healthMessage = null;
17
- }
4
+ // packages/system-api/src/api/model/workload/VmNode.ts
5
+ import { ReconcileState } from "@kinotic-ai/management-api";
18
6
 
19
7
  // packages/system-api/src/api/model/workload/VmProviderType.ts
20
8
  var VmProviderType;
@@ -28,7 +16,8 @@ class VmNode {
28
16
  id;
29
17
  name;
30
18
  hostname;
31
- status = new VmNodeStatus;
19
+ state = new ReconcileState;
20
+ healthMessage = null;
32
21
  providerType = "BOXLITE" /* BOXLITE */;
33
22
  totalCpus = 0;
34
23
  totalMemoryMb = 0;
@@ -36,7 +25,6 @@ class VmNode {
36
25
  freeCpus = 0;
37
26
  freeMemoryMb = 0;
38
27
  freeDiskMb = 0;
39
- reservations = [];
40
28
  lastSeen = null;
41
29
  workloadDataDir = null;
42
30
  constructor(id, name, hostname) {
@@ -45,7 +33,13 @@ class VmNode {
45
33
  this.hostname = hostname;
46
34
  }
47
35
  }
48
- // packages/system-api/src/api/model/VmNodeRegistration.ts
36
+ // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
37
+ var VmNodeStatusType;
38
+ ((VmNodeStatusType2) => {
39
+ VmNodeStatusType2["ONLINE"] = "ONLINE";
40
+ VmNodeStatusType2["DRAINING"] = "DRAINING";
41
+ })(VmNodeStatusType ||= {});
42
+ // packages/system-api/src/api/model/workload/VmNodeRegistration.ts
49
43
  class VmNodeRegistration {
50
44
  id;
51
45
  name;
@@ -61,50 +55,58 @@ class VmNodeRegistration {
61
55
  this.hostname = hostname;
62
56
  }
63
57
  }
64
- // packages/system-api/src/api/services/IVmNodeService.ts
58
+ // packages/system-api/src/api/services/workload/IVmNodeService.ts
65
59
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
66
- import { CrudServiceProxy } from "@kinotic-ai/core";
60
+ import { CrudServiceProxy, FunctionalIterablePage } from "@kinotic-ai/core";
67
61
 
68
62
  class VmNodeServiceProxy extends CrudServiceProxy {
69
63
  constructor(kinotic) {
70
- super(kinotic.serviceProxy(`${SYSTEM_API_ZONE}~org.kinotic.system.api.services.VmNodeService`));
64
+ super(kinotic.serviceProxy(`${SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.VmNodeService`));
65
+ }
66
+ async findHistory(nodeId, pageable) {
67
+ const page = await this.findHistorySinglePage(nodeId, pageable);
68
+ return new FunctionalIterablePage(pageable, page, (pageable2) => this.findHistorySinglePage(nodeId, pageable2));
71
69
  }
72
- findAvailableNode(requiredCpus, requiredMemoryMb, requiredDiskMb) {
73
- return this.serviceProxy.invoke("findAvailableNode", [requiredCpus, requiredMemoryMb, requiredDiskMb]);
70
+ findHistorySinglePage(nodeId, pageable) {
71
+ return this.serviceProxy.invoke("findHistory", [nodeId, pageable]);
74
72
  }
75
73
  syncIndex() {
76
74
  return this.serviceProxy.invoke("syncIndex", []);
77
75
  }
78
76
  }
79
- // packages/system-api/src/api/services/IWorkloadService.ts
77
+ // packages/system-api/src/api/services/workload/IWorkloadService.ts
80
78
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE2 } from "@kinotic-ai/management-api";
81
- import { CrudServiceProxy as CrudServiceProxy2, FunctionalIterablePage } from "@kinotic-ai/core";
79
+ import { CrudServiceProxy as CrudServiceProxy2, FunctionalIterablePage as FunctionalIterablePage2 } from "@kinotic-ai/core";
82
80
 
83
81
  class WorkloadServiceProxy extends CrudServiceProxy2 {
84
82
  constructor(kinotic) {
85
- super(kinotic.serviceProxy(`${SYSTEM_API_ZONE2}~org.kinotic.system.api.services.WorkloadService`));
83
+ super(kinotic.serviceProxy(`${SYSTEM_API_ZONE2}~org.kinotic.system.api.services.workload.WorkloadService`));
86
84
  }
87
85
  async findAllForNode(nodeId, pageable) {
88
86
  const page = await this.findAllForNodeSinglePage(nodeId, pageable);
89
- return new FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForNodeSinglePage(nodeId, pageable2));
87
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findAllForNodeSinglePage(nodeId, pageable2));
90
88
  }
91
89
  findAllForNodeSinglePage(nodeId, pageable) {
92
90
  return this.serviceProxy.invoke("findAllForNode", [nodeId, pageable]);
93
91
  }
94
- countForNode(nodeId) {
95
- return this.serviceProxy.invoke("countForNode", [nodeId]);
92
+ async findHistory(workloadId, pageable) {
93
+ const page = await this.findHistorySinglePage(workloadId, pageable);
94
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findHistorySinglePage(workloadId, pageable2));
95
+ }
96
+ findHistorySinglePage(workloadId, pageable) {
97
+ return this.serviceProxy.invoke("findHistory", [workloadId, pageable]);
96
98
  }
97
99
  syncIndex() {
98
100
  return this.serviceProxy.invoke("syncIndex", []);
99
101
  }
100
102
  }
101
- // packages/system-api/src/api/services/IWorkloadOrchestrationService.ts
103
+ // packages/system-api/src/api/services/workload/IWorkloadOrchestrationService.ts
102
104
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE3 } from "@kinotic-ai/management-api";
103
105
 
104
106
  class WorkloadOrchestrationService {
105
107
  serviceProxy;
106
108
  constructor(kinotic) {
107
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE3}~org.kinotic.system.api.services.WorkloadOrchestrationService`);
109
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE3}~org.kinotic.system.api.services.workload.WorkloadOrchestrationService`);
108
110
  }
109
111
  deployWorkload(workload) {
110
112
  return this.serviceProxy.invoke("deployWorkload", [workload]);
@@ -115,14 +117,20 @@ class WorkloadOrchestrationService {
115
117
  destroyWorkload(workloadId) {
116
118
  return this.serviceProxy.invoke("destroyWorkload", [workloadId]);
117
119
  }
120
+ deleteWorkload(workloadId) {
121
+ return this.serviceProxy.invoke("deleteWorkload", [workloadId]);
122
+ }
123
+ deleteWorkloads(workloadIds) {
124
+ return this.serviceProxy.invoke("deleteWorkloads", [workloadIds]);
125
+ }
118
126
  }
119
- // packages/system-api/src/api/services/VmNodeOrchestrationServiceProxy.ts
127
+ // packages/system-api/src/api/services/workload/VmNodeOrchestrationServiceProxy.ts
120
128
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE4 } from "@kinotic-ai/management-api";
121
129
 
122
130
  class VmNodeOrchestrationServiceProxy {
123
131
  serviceProxy;
124
132
  constructor(kinotic) {
125
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE4}~org.kinotic.system.api.services.VmNodeOrchestrationService`);
133
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE4}~org.kinotic.system.api.services.workload.VmNodeOrchestrationService`);
126
134
  }
127
135
  registerNode(registration) {
128
136
  return this.serviceProxy.invoke("registerNode", [registration]);
@@ -310,7 +318,7 @@ var SystemApiPlugin = {
310
318
  };
311
319
  }
312
320
  };
313
- // packages/system-api/src/api/model/KinoticClusterInfo.ts
321
+ // packages/system-api/src/api/model/cluster/KinoticClusterInfo.ts
314
322
  class KinoticClusterInfo {
315
323
  localNodeId = "";
316
324
  serverNodeCount = 0;
@@ -319,7 +327,7 @@ class KinoticClusterInfo {
319
327
  nodes = [];
320
328
  active = false;
321
329
  }
322
- // packages/system-api/src/api/model/KinoticNodeInfo.ts
330
+ // packages/system-api/src/api/model/cluster/KinoticNodeInfo.ts
323
331
  class KinoticNodeInfo {
324
332
  nodeId = "";
325
333
  order = 0;
@@ -333,7 +341,6 @@ export {
333
341
  WorkloadOrchestrationService,
334
342
  VmProviderType,
335
343
  VmNodeStatusType,
336
- VmNodeStatus,
337
344
  VmNodeServiceProxy,
338
345
  VmNodeRegistration,
339
346
  VmNodeOrchestrationServiceProxy,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/system-api",
3
- "version": "5.0.0-beta.16",
3
+ "version": "5.0.0-beta.19",
4
4
  "type": "module",
5
5
  "description": "Client API for the Kinotic platform's system plane: the workload and node orchestration services platform machines and operators use.",
6
6
  "files": [
@@ -38,12 +38,12 @@
38
38
  "coverage": "bun test --coverage --pass-with-no-tests"
39
39
  },
40
40
  "peerDependencies": {
41
- "@kinotic-ai/core": "^5.0.0-beta.13",
42
- "@kinotic-ai/management-api": "^5.0.0-beta.34"
41
+ "@kinotic-ai/core": "^5.0.0-beta.17",
42
+ "@kinotic-ai/management-api": "^5.0.0-beta.40"
43
43
  },
44
44
  "devDependencies": {
45
- "@kinotic-ai/core": "5.0.0-beta.13",
46
- "@kinotic-ai/management-api": "5.0.0-beta.34",
45
+ "@kinotic-ai/core": "5.0.0-beta.17",
46
+ "@kinotic-ai/management-api": "5.0.0-beta.40",
47
47
  "@types/bun": "^1.3.9",
48
48
  "typescript": "^5.9.3"
49
49
  }