@kinotic-ai/system-api 5.0.0-beta.5 → 5.0.0-beta.50

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.d.ts CHANGED
@@ -1,24 +1,26 @@
1
1
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
2
- import { Identifiable } from "@kinotic-ai/core";
2
+ import { ReconcileState, Reconcilable } from "@kinotic-ai/management-api";
3
+ /**
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.
7
+ */
3
8
  declare enum VmNodeStatusType {
4
9
  ONLINE = "ONLINE",
5
- OFFLINE = "OFFLINE",
10
+ /**
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.
13
+ */
6
14
  DRAINING = "DRAINING"
7
15
  }
8
16
  /**
9
- * Whether a node is fit to receive workloads, and why when it is not.
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.
10
20
  */
11
- declare class VmNodeStatus {
12
- /**
13
- * Whether the node is taking workloads.
14
- */
15
- type: VmNodeStatusType;
16
- /**
17
- * Why the node is not taking workloads, or null when it is. Set from the node's own report
18
- * of the guarantees it can still make — a data root that stopped enforcing disk limits, or
19
- * a firewall that stopped hiding host credentials from guests.
20
- */
21
- healthMessage: string | null;
21
+ interface VmNodeState {
22
+ /** Whether the node takes workloads. */
23
+ phase: VmNodeStatusType;
22
24
  }
23
25
  declare enum VmProviderType {
24
26
  BOXLITE = "BOXLITE",
@@ -28,7 +30,7 @@ declare enum VmProviderType {
28
30
  * Represents a node in the cluster that is running a VmManager process
29
31
  * and is capable of hosting workloads.
30
32
  */
31
- declare class VmNode implements Identifiable<string> {
33
+ declare class VmNode implements Reconcilable<VmNodeState> {
32
34
  /**
33
35
  * Unique identifier for this node.
34
36
  */
@@ -42,9 +44,17 @@ declare class VmNode implements Identifiable<string> {
42
44
  */
43
45
  hostname: string;
44
46
  /**
45
- * 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.
46
50
  */
47
- status: VmNodeStatus;
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.
56
+ */
57
+ healthMessage: string | null;
48
58
  /**
49
59
  * The VM provider this node runs every workload on, determined by how the node was
50
60
  * provisioned and reported when it registers.
@@ -63,21 +73,22 @@ declare class VmNode implements Identifiable<string> {
63
73
  */
64
74
  totalDiskMb: number;
65
75
  /**
66
- * Number of vCPUs currently allocated to workloads.
76
+ * CPU not allocated to any workload, in cores. What is allocated is
77
+ * totalCpus - freeCpus, what the workloads running on the node are sized for.
67
78
  */
68
- allocatedCpus: number;
79
+ freeCpus: number;
69
80
  /**
70
- * Memory currently allocated to workloads in megabytes.
81
+ * Memory not allocated to any workload, in megabytes.
71
82
  */
72
- allocatedMemoryMb: number;
83
+ freeMemoryMb: number;
73
84
  /**
74
- * Disk space currently allocated to workloads in megabytes.
85
+ * Disk space not allocated to any workload, in megabytes.
75
86
  */
76
- allocatedDiskMb: number;
87
+ freeDiskMb: number;
77
88
  /**
78
89
  * The date and time the node was last seen/heartbeat.
79
90
  */
80
- lastSeen: number | null;
91
+ lastSeen: string | null;
81
92
  /**
82
93
  * Base directory every workload volume mount on this node must live under. Reported by
83
94
  * the node at registration; deployment flows compose host paths under it.
@@ -86,18 +97,10 @@ declare class VmNode implements Identifiable<string> {
86
97
  constructor(id: string, name: string, hostname: string);
87
98
  }
88
99
  /**
89
- * DTO sent by a vm-manager process when it registers with the server.
90
- * Contains only the information the node knows about itself.
100
+ * DTO sent by a vm-manager process when it registers with the server. Contains only the information the node
101
+ * knows about itself: the node's id and name are those of the machine it authenticates as.
91
102
  */
92
103
  declare class VmNodeRegistration {
93
- /**
94
- * Unique identifier for this node.
95
- */
96
- id: string;
97
- /**
98
- * Human-readable name for the node.
99
- */
100
- name: string;
101
104
  /**
102
105
  * The hostname or address of the node.
103
106
  */
@@ -122,7 +125,7 @@ declare class VmNodeRegistration {
122
125
  * Base directory every workload volume mount on this node must live under.
123
126
  */
124
127
  workloadDataDir: string | null;
125
- constructor(id: string, name: string, hostname: string);
128
+ constructor(hostname: string);
126
129
  }
127
130
  import { WorkloadStatus } from "@kinotic-ai/management-api";
128
131
  /**
@@ -138,17 +141,51 @@ interface WorkloadStatusReport {
138
141
  /** When the node recorded this status, in epoch milliseconds. */
139
142
  updated: number;
140
143
  }
144
+ /**
145
+ * The provider whose API an LlmConfiguration calls.
146
+ */
147
+ declare enum LlmProviderType {
148
+ /** Anthropic's Messages API, serving the Claude models. */
149
+ ANTHROPIC = "ANTHROPIC",
150
+ /** OpenAI's Chat Completions API, or a server compatible with it. */
151
+ OPENAI = "OPENAI"
152
+ }
153
+ /**
154
+ * A large language model the system's services call: the provider, the model, where the provider's API is
155
+ * reached and the options each request carries. The API key the provider is called with is held in the secret
156
+ * storage and is never a field of the configuration; apiKeyHeld says whether one is held.
157
+ */
158
+ declare class LlmConfiguration {
159
+ id: string | null;
160
+ /** The name a service selects the configuration by, unique in the system. */
161
+ name: string;
162
+ provider: LlmProviderType;
163
+ /** The provider's id of the model, such as claude-opus-5-5. */
164
+ model: string;
165
+ /** The base URL of the provider's API, or null for the provider's public API. */
166
+ endpoint: string | null;
167
+ /** The most tokens a response may hold, or null for the calling service's default. */
168
+ maxTokens: number | null;
169
+ /** The sampling temperature, or null for the provider's default. */
170
+ temperature: number | null;
171
+ /** Whether an API key is held for the configuration. */
172
+ apiKeyHeld: boolean;
173
+ created: string | null;
174
+ updated: string | null;
175
+ constructor(name: string, provider: LlmProviderType, model: string);
176
+ }
177
+ import { WatchEvent } from "@kinotic-ai/management-api";
141
178
  import { IKinotic } from "@kinotic-ai/core";
142
- import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
179
+ import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
143
180
  interface IVmNodeService extends ICrudServiceProxy<VmNode> {
144
181
  /**
145
- * Finds a node with sufficient resources to host a workload with the given requirements.
146
- * @param requiredCpus the number of vCPUs required
147
- * @param requiredMemoryMb the amount of memory required in megabytes
148
- * @param requiredDiskMb the amount of disk space required in megabytes
149
- * @return a Promise resolving to a suitable node, or null if none available
182
+ * Lists what happened to the node, newest first: each change of what it should be and of what it
183
+ * reports, and each mark set beside them, with what caused it.
184
+ * @param nodeId the id of the node
185
+ * @param pageable the page to return
186
+ * @return a Promise resolving to a page of ledger entries, empty when the node is not registered
150
187
  */
151
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
188
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
152
189
  /**
153
190
  * This operation makes all the recent writes immediately available for search.
154
191
  * @return a Promise that resolves when the operation is complete
@@ -157,11 +194,12 @@ interface IVmNodeService extends ICrudServiceProxy<VmNode> {
157
194
  }
158
195
  declare class VmNodeServiceProxy extends CrudServiceProxy<VmNode> implements IVmNodeService {
159
196
  constructor(kinotic: IKinotic);
160
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
197
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
198
+ findHistorySinglePage(nodeId: string, pageable: Pageable): Promise<Page<WatchEvent>>;
161
199
  syncIndex(): Promise<void>;
162
200
  }
163
- import { Workload } from "@kinotic-ai/management-api";
164
- import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage, Page, Pageable } from "@kinotic-ai/core";
201
+ import { Workload, WatchEvent as WatchEvent2 } from "@kinotic-ai/management-api";
202
+ import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage as IterablePage2, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
165
203
  interface IWorkloadService extends ICrudServiceProxy2<Workload> {
166
204
  /**
167
205
  * Finds all workloads deployed on the given node.
@@ -169,13 +207,15 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
169
207
  * @param pageable the page to return
170
208
  * @return a Promise resolving to a page of workloads
171
209
  */
172
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
210
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
173
211
  /**
174
- * Counts all workloads deployed on the given node.
175
- * @param nodeId the id of the node to count workloads for
176
- * @return a Promise resolving to the number of workloads
212
+ * Lists what happened to the workload, newest first: each status its run passed through and each
213
+ * mark set beside it, with what caused it.
214
+ * @param workloadId the workload
215
+ * @param pageable the page to return
216
+ * @return a Promise resolving to a page of ledger entries, empty when the workload does not exist
177
217
  */
178
- countForNode(nodeId: string): Promise<number>;
218
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
179
219
  /**
180
220
  * This operation makes all the recent writes immediately available for search.
181
221
  * @return a Promise that resolves when the operation is complete
@@ -184,9 +224,10 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
184
224
  }
185
225
  declare class WorkloadServiceProxy extends CrudServiceProxy2<Workload> implements IWorkloadService {
186
226
  constructor(kinotic: IKinotic2);
187
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
188
- findAllForNodeSinglePage(nodeId: string, pageable: Pageable): Promise<Page<Workload>>;
189
- countForNode(nodeId: string): Promise<number>;
227
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
228
+ findAllForNodeSinglePage(nodeId: string, pageable: Pageable2): Promise<Page2<Workload>>;
229
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
230
+ findHistorySinglePage(workloadId: string, pageable: Pageable2): Promise<Page2<WatchEvent2>>;
190
231
  syncIndex(): Promise<void>;
191
232
  }
192
233
  import { Workload as Workload2 } from "@kinotic-ai/management-api";
@@ -208,33 +249,46 @@ interface IWorkloadOrchestrationService {
208
249
  */
209
250
  deployWorkload(workload: Workload2): Promise<Workload2>;
210
251
  /**
211
- * Restarts a stopped workload in place on the node it is deployed to. Fails unless the
212
- * workload is stopped; a workload stopped with autoRemove true has no VM left to restart.
213
- * Honors the workload's detached flag the same way as {@link deployWorkload}.
214
- * @param workloadId the id of the workload to restart
215
- * @return a Promise resolving to the restarted workload
216
- */
217
- restartWorkload(workloadId: string): Promise<Workload2>;
218
- /**
219
252
  * Stops a running workload.
220
253
  * @param workloadId the id of the workload to stop
221
254
  * @return a Promise that resolves when the workload has been stopped
222
255
  */
223
256
  stopWorkload(workloadId: string): Promise<void>;
224
257
  /**
225
- * Destroys a workload, removing it from the node and cleaning up all resources.
258
+ * Destroys a workload's VM on its node, with its disk, and returns its room. A run still open is
259
+ * recorded STOPPED. The record stays as the run's outcome, and its logs stay in the log store,
260
+ * until deleteWorkload.
226
261
  * @param workloadId the id of the workload to destroy
227
- * @return a Promise that resolves when the workload has been destroyed
262
+ * @return a Promise that resolves when the VM has been destroyed
228
263
  */
229
264
  destroyWorkload(workloadId: string): Promise<void>;
265
+ /**
266
+ * Deletes a workload's record and every log line it wrote from the organization's log store, the
267
+ * one way either is removed. A run still open on its node — starting, running, or a stop the node
268
+ * has not answered — is refused: stop or destroy it first.
269
+ * @param workloadId the id of the workload to delete
270
+ * @return a Promise that resolves when the record and its logs are gone, or rejects if the run is
271
+ * still open
272
+ */
273
+ deleteWorkload(workloadId: string): Promise<void>;
274
+ /**
275
+ * Deletes the given workloads' records and every log line they wrote, as deleteWorkload does for
276
+ * one, with the log store asked once per organization. Any run still open refuses the whole batch
277
+ * before anything is deleted.
278
+ * @param workloadIds the ids of the workloads to delete
279
+ * @return a Promise that resolves when the records and their logs are gone, or rejects if any run
280
+ * is still open
281
+ */
282
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
230
283
  }
231
284
  declare class WorkloadOrchestrationService implements IWorkloadOrchestrationService {
232
285
  private readonly serviceProxy;
233
286
  constructor(kinotic: IKinotic3);
234
287
  deployWorkload(workload: Workload2): Promise<Workload2>;
235
- restartWorkload(workloadId: string): Promise<Workload2>;
236
288
  stopWorkload(workloadId: string): Promise<void>;
237
289
  destroyWorkload(workloadId: string): Promise<void>;
290
+ deleteWorkload(workloadId: string): Promise<void>;
291
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
238
292
  }
239
293
  import { IKinotic as IKinotic4 } from "@kinotic-ai/core";
240
294
  /**
@@ -245,7 +299,8 @@ declare class VmNodeOrchestrationServiceProxy {
245
299
  private readonly serviceProxy;
246
300
  constructor(kinotic: IKinotic4);
247
301
  /**
248
- * Registers this node with the orchestrator.
302
+ * Registers the machine this client authenticated as with the orchestrator, as a node whose id is the
303
+ * machine's id and whose name is the machine's display name.
249
304
  * @param registration the node registration info
250
305
  * @return a Promise resolving to the registered VmNode
251
306
  */
@@ -253,21 +308,19 @@ declare class VmNodeOrchestrationServiceProxy {
253
308
  /**
254
309
  * Sends a heartbeat to indicate this node is still alive, carrying what it can still
255
310
  * guarantee. A node reporting problems stops receiving workloads until it reports none.
256
- * @param nodeId the id of this node
257
311
  * @param problems what the node can no longer guarantee, empty when it is fit
258
312
  * @return a Promise resolving to the updated VmNode
259
313
  */
260
- heartbeat(nodeId: string, problems: string[]): Promise<VmNode>;
314
+ heartbeat(problems: string[]): Promise<VmNode>;
261
315
  /**
262
316
  * Reports the actual status of workloads on this node so the server's records track
263
317
  * transitions the orchestrator did not initiate.
264
- * @param nodeId the id of this node
265
318
  * @param reports one report per workload
266
319
  */
267
- reportWorkloadStatus(nodeId: string, reports: WorkloadStatusReport[]): Promise<void>;
320
+ reportWorkloadStatus(reports: WorkloadStatusReport[]): Promise<void>;
268
321
  /**
269
- * Deregisters this node from the orchestrator.
270
- * @param nodeId the id of this node
322
+ * Asks for a node's removal from the orchestrator.
323
+ * @param nodeId the id of the node
271
324
  */
272
325
  deregisterNode(nodeId: string): Promise<void>;
273
326
  }
@@ -299,6 +352,22 @@ declare class LoggersDescriptor {
299
352
  groups: Map<string, GroupLoggerLevelsDescriptor>;
300
353
  }
301
354
  /**
355
+ * The CRI patterns that decide what trace logging prints.
356
+ *
357
+ * Each pattern is matched against the fully qualified CRI with Ant wildcards, where `*` matches
358
+ * within one segment and `**` across segments, so
359
+ * `srv://system-api~com.acme.HeartbeatService/*` covers every method of that service and
360
+ * `srv://system-api~com.acme.HeartbeatService/ping` covers only that one.
361
+ * An include wins over an exclude, so `excludes: ['**']` plus the handful of includes worth
362
+ * watching narrows trace logging to those services alone.
363
+ */
364
+ declare class TraceLogProperties {
365
+ /** CRIs kept in trace logging whatever the excludes say. Empty leaves the excludes to decide. */
366
+ includes: string[];
367
+ /** CRIs left out of trace logging, request and reply both, unless an include covers them. */
368
+ excludes: string[];
369
+ }
370
+ /**
302
371
  * Provides the ability to manage loggers
303
372
  */
304
373
  interface ILogManager {
@@ -320,24 +389,46 @@ interface ILogManager {
320
389
  * @param level the {@link LogLevel} to set for the logger with the given name
321
390
  */
322
391
  configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
392
+ /**
393
+ * @param nodeId the kinotic node to get the trace log patterns from
394
+ * @return the CRI patterns currently deciding what the node trace logs
395
+ */
396
+ traceLog(nodeId: string): Promise<TraceLogProperties>;
397
+ /**
398
+ * Configures the CRI patterns deciding what the node trace logs, silencing a service that
399
+ * would otherwise bury the log while trace logging is on.
400
+ * The patterns replace whatever the node is using and last until it restarts, which returns it
401
+ * to the `kinotic.traceLog` it was configured with.
402
+ *
403
+ * @param nodeId the kinotic node to set the trace log patterns on
404
+ * @param traceLog the include and exclude patterns to apply
405
+ */
406
+ configureTraceLog(nodeId: string, traceLog: TraceLogProperties): Promise<void>;
323
407
  }
324
408
  import { IKinotic as IKinotic5 } from "@kinotic-ai/core";
325
409
  /**
326
- * A single kinotic-server node in the cluster. Mirrors the server's
327
- * {@code org.kinotic.domain.api.model.cluster.KinoticNodeInfo}.
410
+ * A single server node in the cluster, of the org, system or app server. Mirrors the server's
411
+ * {@code org.kinotic.system.api.model.cluster.KinoticNodeInfo}.
328
412
  */
329
413
  declare class KinoticNodeInfo {
330
414
  nodeId: string;
331
415
  order: number;
332
- local: boolean;
333
- version: string;
416
+ /** The server kind the node runs, such as management, system or app. */
417
+ serverName: string;
418
+ addresses: string[];
419
+ hostNames: string[];
420
+ /** The Kinotic version the node runs; null when the node runs from classes rather than a packaged jar. */
421
+ version: string | null;
422
+ /** The service name that labels the logs of the server the node runs, for LogService's server log methods; null when the deployment configures none. */
423
+ telemetryServiceName: string | null;
424
+ /** The service instance id that labels the node's own logs, narrowing a server log query to this node; null when the deployment configures none. */
425
+ telemetryServiceInstanceId: string | null;
334
426
  }
335
427
  /**
336
- * The kinotic-server cluster's current topology and state. Mirrors the server's
337
- * {@code org.kinotic.domain.api.model.cluster.KinoticClusterInfo}.
428
+ * The current topology and state of the cluster the org, system and app servers form. Mirrors the
429
+ * server's {@code org.kinotic.system.api.model.cluster.KinoticClusterInfo}.
338
430
  */
339
431
  declare class KinoticClusterInfo {
340
- localNodeId: string;
341
432
  serverNodeCount: number;
342
433
  topologyVersion: number;
343
434
  clusterState: string;
@@ -345,7 +436,7 @@ declare class KinoticClusterInfo {
345
436
  active: boolean;
346
437
  }
347
438
  /**
348
- * Queries the kinotic-server cluster's topology and state.
439
+ * Queries the topology and state of the cluster the org, system and app servers form.
349
440
  */
350
441
  interface IKinoticClusterInfoService {
351
442
  /**
@@ -358,38 +449,366 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
358
449
  constructor(kinotic: IKinotic5);
359
450
  getClusterInfo(): Promise<KinoticClusterInfo>;
360
451
  }
361
- import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
362
- import { IKinotic as IKinotic6, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
452
+ import { IKinotic as IKinotic6 } from "@kinotic-ai/core";
453
+ import { VulnerabilityFinding } from "@kinotic-ai/management-api";
454
+ /**
455
+ * The advisories affecting the libraries one build of a Kinotic server runs, with the cluster nodes
456
+ * running that build. Mirrors the server's org.kinotic.system.api.model.cluster.ServerVulnerabilities.
457
+ */
458
+ declare class ServerVulnerabilities {
459
+ /** The server kind the build is, such as management, system or app. */
460
+ serverName: string;
461
+ /** The Kinotic version of the build; null when its nodes run from classes rather than a packaged jar. */
462
+ version: string | null;
463
+ /** How many nodes run the build. */
464
+ nodeCount: number;
465
+ /** How many libraries the build runs; none when its nodes' classpath holds no library list, such as when an IDE runs them from classes. */
466
+ componentCount: number;
467
+ /** The advisories affecting the build's libraries, the most severe first. */
468
+ findings: VulnerabilityFinding[];
469
+ /** Why the build's libraries could not be checked, or null when they were; a build that could not be checked has no findings. */
470
+ error: string | null;
471
+ }
472
+ /**
473
+ * The vulnerability advisories affecting the Kinotic cluster itself: the libraries each running
474
+ * server build was built with, checked against the advisories read from OSV.
475
+ */
476
+ interface IClusterVulnerabilityService {
477
+ /**
478
+ * Checks the libraries of every server build the cluster's nodes run against the advisories.
479
+ * @return one entry per server build running, the nodes of one server kind and version that list
480
+ * the same libraries, ordered by server kind then version
481
+ */
482
+ findAll(): Promise<ServerVulnerabilities[]>;
483
+ }
484
+ declare class ClusterVulnerabilityService implements IClusterVulnerabilityService {
485
+ private readonly serviceProxy;
486
+ constructor(kinotic: IKinotic6);
487
+ findAll(): Promise<ServerVulnerabilities[]>;
488
+ }
489
+ import { VulnerabilityAdvisory, VulnerabilityAlert } from "@kinotic-ai/management-api";
490
+ import { IKinotic as IKinotic7, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
491
+ import { PackageEcosystem } from "@kinotic-ai/management-api";
492
+ /**
493
+ * How far the advisories of one PackageEcosystem have been read from OSV, and how many of them are
494
+ * stored.
495
+ */
496
+ interface OsvImportStatus {
497
+ ecosystem: PackageEcosystem;
498
+ /**
499
+ * The newest modification time of an advisory read; every advisory OSV changed up to it is stored
500
+ * as OSV holds it. Null until the ecosystem's first import completes.
501
+ */
502
+ syncedThrough: string | null;
503
+ /**
504
+ * How many advisories naming a package of the ecosystem are stored and not withdrawn.
505
+ */
506
+ advisoryCount: number;
507
+ }
363
508
  /**
364
- * Cross-organization reads for platform operators. Published in the system zone, which only
509
+ * The vulnerability advisories read from OSV, for system users: how far each ecosystem's import
510
+ * has read, and, for an advisory, the projects of every organization it affects.
511
+ */
512
+ interface IVulnerabilityAdvisoryService {
513
+ /**
514
+ * Reports how far the advisories of each package ecosystem have been read from OSV.
515
+ * @return one status per ecosystem, in the order of PackageEcosystem
516
+ */
517
+ findImportStatus(): Promise<OsvImportStatus[]>;
518
+ /**
519
+ * Finds the stored advisories by OSV id, by alias such as a CVE, or by package.
520
+ * @param search an OSV id or an alias, matched ignoring case and including withdrawn advisories,
521
+ * or a package URL such as pkg:npm/lodash, matched by its package without the
522
+ * version and listing the advisories not withdrawn
523
+ * @param pageable the page to return
524
+ */
525
+ findAdvisories(search: string, pageable: Pageable3): Promise<Page3<VulnerabilityAdvisory>>;
526
+ /**
527
+ * Lists the alerts an advisory has raised, one per affected project, across every organization.
528
+ * @param advisoryId the advisory's OSV id
529
+ * @param pageable the page to return
530
+ */
531
+ findAlerts(advisoryId: string, pageable: Pageable3): Promise<Page3<VulnerabilityAlert>>;
532
+ }
533
+ declare class VulnerabilityAdvisoryService implements IVulnerabilityAdvisoryService {
534
+ private readonly serviceProxy;
535
+ constructor(kinotic: IKinotic7);
536
+ findImportStatus(): Promise<OsvImportStatus[]>;
537
+ findAdvisories(search: string, pageable: Pageable3): Promise<Page3<VulnerabilityAdvisory>>;
538
+ findAlerts(advisoryId: string, pageable: Pageable3): Promise<Page3<VulnerabilityAlert>>;
539
+ }
540
+ import { Application, Organization, Project, ApplicationParticipantIdentity, OrganizationParticipantIdentity, PendingInviteSummary } from "@kinotic-ai/management-api";
541
+ import { IKinotic as IKinotic8, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
542
+ /**
543
+ * Cross-organization reads for system users. Published in the system zone, which only
365
544
  * SYSTEM participants may address, so every method takes the target organization explicitly
366
545
  * instead of resolving it from the caller's scope.
367
546
  */
368
547
  interface ISystemOrganizationService {
369
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
370
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
548
+ findOrganizations(pageable: Pageable4): Promise<Page4<Organization>>;
549
+ searchOrganizations(searchText: string, pageable: Pageable4): Promise<Page4<Organization>>;
371
550
  /** Resolves null when no organization has the given id. */
372
551
  findOrganizationById(organizationId: string): Promise<Organization | null>;
373
552
  countOrganizations(): Promise<number>;
374
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
375
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
376
- /** applicationId null = the organization's members */
377
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
378
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
379
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
553
+ findApplications(organizationId: string, pageable: Pageable4): Promise<Page4<Application>>;
554
+ findProjects(organizationId: string, pageable: Pageable4): Promise<Page4<Project>>;
555
+ findMembers(organizationId: string, pageable: Pageable4): Promise<Page4<OrganizationParticipantIdentity>>;
556
+ searchMembers(searchText: string, organizationId: string, pageable: Pageable4): Promise<Page4<OrganizationParticipantIdentity>>;
557
+ findApplicationUsers(organizationId: string, applicationId: string, pageable: Pageable4): Promise<Page4<ApplicationParticipantIdentity>>;
558
+ searchApplicationUsers(searchText: string, organizationId: string, applicationId: string, pageable: Pageable4): Promise<Page4<ApplicationParticipantIdentity>>;
559
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable4): Promise<Page4<PendingInviteSummary>>;
380
560
  }
381
561
  declare class SystemOrganizationService implements ISystemOrganizationService {
382
562
  private readonly serviceProxy;
383
- constructor(kinotic: IKinotic6);
384
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
385
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
563
+ constructor(kinotic: IKinotic8);
564
+ findOrganizations(pageable: Pageable4): Promise<Page4<Organization>>;
565
+ searchOrganizations(searchText: string, pageable: Pageable4): Promise<Page4<Organization>>;
386
566
  findOrganizationById(organizationId: string): Promise<Organization | null>;
387
567
  countOrganizations(): Promise<number>;
388
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
389
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
390
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
391
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
392
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
568
+ findApplications(organizationId: string, pageable: Pageable4): Promise<Page4<Application>>;
569
+ findProjects(organizationId: string, pageable: Pageable4): Promise<Page4<Project>>;
570
+ findMembers(organizationId: string, pageable: Pageable4): Promise<Page4<OrganizationParticipantIdentity>>;
571
+ searchMembers(searchText: string, organizationId: string, pageable: Pageable4): Promise<Page4<OrganizationParticipantIdentity>>;
572
+ findApplicationUsers(organizationId: string, applicationId: string, pageable: Pageable4): Promise<Page4<ApplicationParticipantIdentity>>;
573
+ searchApplicationUsers(searchText: string, organizationId: string, applicationId: string, pageable: Pageable4): Promise<Page4<ApplicationParticipantIdentity>>;
574
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable4): Promise<Page4<PendingInviteSummary>>;
575
+ }
576
+ import { MachineParticipantIdentity, MachineProvisionResult, SystemParticipantIdentity } from "@kinotic-ai/management-api";
577
+ import { IKinotic as IKinotic9, Page as Page5, Pageable as Pageable5 } from "@kinotic-ai/core";
578
+ /**
579
+ * The system's own members: the system users who sign in to the system console, and the
580
+ * SYSTEM-scope machines that connect as system daemons, such as a worker node's vm-manager.
581
+ * Published in the system zone, which only SYSTEM participants may address; every method works
582
+ * on SYSTEM scope alone, so an organization's users and machines stay that organization's to
583
+ * manage through IMachineService.
584
+ */
585
+ interface ISystemMemberService {
586
+ findUsers(pageable: Pageable5): Promise<Page5<SystemParticipantIdentity>>;
587
+ searchUsers(searchText: string, pageable: Pageable5): Promise<Page5<SystemParticipantIdentity>>;
588
+ /**
589
+ * Adds a system user, who holds the system's full authority once signed in. The user is pending until it first
590
+ * signs in: through one of the providers the system console's login offers, which signs in the account whose
591
+ * verified email is `email`, or with a password `resetUserPassword` issues.
592
+ */
593
+ addUser(email: string, displayName: string | null): Promise<SystemParticipantIdentity>;
594
+ /**
595
+ * Enables or disables a system user. A disabled user cannot sign in; a session it already holds lasts until it
596
+ * expires. Callers cannot disable themselves.
597
+ */
598
+ setUserEnabled(userId: string, enabled: boolean): Promise<void>;
599
+ /**
600
+ * Replaces a system user's password with a generated one, returned exactly once. Refused while the system
601
+ * console's login takes no password.
602
+ */
603
+ resetUserPassword(userId: string): Promise<string>;
604
+ /** Lists the system's machines, disabled ones included. */
605
+ findMachines(pageable: Pageable5): Promise<Page5<MachineParticipantIdentity>>;
606
+ /**
607
+ * Provisions a system machine and returns it together with its generated client secret.
608
+ * The secret is disclosed exactly once — it cannot be retrieved later.
609
+ */
610
+ createMachine(displayName: string): Promise<MachineProvisionResult>;
611
+ /**
612
+ * Replaces a system machine's client secret, returning the new secret exactly once. The
613
+ * old secret stops working immediately; a connection the machine already holds lasts until
614
+ * it disconnects.
615
+ */
616
+ rotateSecret(machineId: string): Promise<string>;
617
+ /**
618
+ * Enables or disables a system machine. A disabled machine is cut off on its next
619
+ * connection, and enabling it restores access with the same credential.
620
+ */
621
+ setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
622
+ /**
623
+ * Permanently removes a system machine, including its stored credential. A removed
624
+ * machine's id cannot authenticate again.
625
+ */
626
+ removeMachine(machineId: string): Promise<void>;
627
+ }
628
+ declare class SystemMemberService implements ISystemMemberService {
629
+ private readonly serviceProxy;
630
+ constructor(kinotic: IKinotic9);
631
+ findUsers(pageable: Pageable5): Promise<Page5<SystemParticipantIdentity>>;
632
+ searchUsers(searchText: string, pageable: Pageable5): Promise<Page5<SystemParticipantIdentity>>;
633
+ addUser(email: string, displayName: string | null): Promise<SystemParticipantIdentity>;
634
+ setUserEnabled(userId: string, enabled: boolean): Promise<void>;
635
+ resetUserPassword(userId: string): Promise<string>;
636
+ findMachines(pageable: Pageable5): Promise<Page5<MachineParticipantIdentity>>;
637
+ createMachine(displayName: string): Promise<MachineProvisionResult>;
638
+ rotateSecret(machineId: string): Promise<string>;
639
+ setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
640
+ removeMachine(machineId: string): Promise<void>;
641
+ }
642
+ import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
643
+ import { IKinotic as IKinotic10 } from "@kinotic-ai/core";
644
+ import { IterablePage as IterablePage3, Pageable as Pageable6 } from "@kinotic-ai/core";
645
+ /**
646
+ * The ledger of every watched record on the platform.
647
+ */
648
+ interface IWatchEventService {
649
+ /**
650
+ * Lists what happened to every watched record, newest first: each change of what a record should
651
+ * be and of what it reports, each mark set beside them, and each status a run passed through, with
652
+ * what caused it.
653
+ * @param pageable the page to return
654
+ * @return a Promise resolving to a page of ledger entries
655
+ */
656
+ findAll(pageable: Pageable6): Promise<IterablePage3<WatchEvent3>>;
657
+ }
658
+ declare class WatchEventService implements IWatchEventService {
659
+ private readonly serviceProxy;
660
+ constructor(kinotic: IKinotic10);
661
+ findAll(pageable: Pageable6): Promise<IterablePage3<WatchEvent3>>;
662
+ private findAllSinglePage;
663
+ }
664
+ import { IKinotic as IKinotic11, Page as Page6, Pageable as Pageable7 } from "@kinotic-ai/core";
665
+ /**
666
+ * The large language models the system's services call, each an LlmConfiguration that system users
667
+ * manage and a service selects by name. A configuration's API key is given on save and held in the system's
668
+ * scope of the secret storage until a save gives another or the configuration is deleted. Published in the
669
+ * system zone, which only SYSTEM participants and the system's own cluster members may address.
670
+ */
671
+ interface ILlmConfigurationService {
672
+ findAll(pageable: Pageable7): Promise<Page6<LlmConfiguration>>;
673
+ /** Resolves null when no configuration has the given id. */
674
+ findById(id: string): Promise<LlmConfiguration | null>;
675
+ /** Resolves null when no configuration has the given name. */
676
+ findByName(name: string): Promise<LlmConfiguration | null>;
677
+ /**
678
+ * Saves a configuration, new or changed, and makes apiKey, when given, the key it calls its provider with.
679
+ * A null or blank apiKey keeps the key held for the configuration, if any. Its name must be one no other
680
+ * configuration has.
681
+ */
682
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
683
+ /** Deletes the configuration and the API key held for it. */
684
+ deleteById(id: string): Promise<void>;
685
+ }
686
+ declare class LlmConfigurationService implements ILlmConfigurationService {
687
+ private readonly serviceProxy;
688
+ constructor(kinotic: IKinotic11);
689
+ findAll(pageable: Pageable7): Promise<Page6<LlmConfiguration>>;
690
+ findById(id: string): Promise<LlmConfiguration | null>;
691
+ findByName(name: string): Promise<LlmConfiguration | null>;
692
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
693
+ deleteById(id: string): Promise<void>;
694
+ }
695
+ import { JobRun } from "@kinotic-ai/management-api";
696
+ import { IKinotic as IKinotic12 } from "@kinotic-ai/core";
697
+ /**
698
+ * A grind job system users can start on demand, as the console lists it.
699
+ */
700
+ interface SystemJobDescriptor {
701
+ /**
702
+ * The name identifying the job, which is also the name recorded on each of its runs.
703
+ */
704
+ readonly name: string;
705
+ /**
706
+ * The version of the job's definition, recorded on each of its runs.
707
+ */
708
+ readonly version: string | null;
709
+ /**
710
+ * What the job does.
711
+ */
712
+ readonly description: string | null;
713
+ }
714
+ /**
715
+ * Starts the system jobs on demand. A run is owned by the system and executes on the
716
+ * node that started it, and is listed, watched and read through Kinotic.jobMonitoring like any
717
+ * other job run.
718
+ */
719
+ interface ISystemJobService {
720
+ /**
721
+ * Lists the system jobs that can be started, ordered by name.
722
+ */
723
+ findSystemJobs(): Promise<SystemJobDescriptor[]>;
724
+ /**
725
+ * Starts a run of the named system job, resolving with the run once it and its task ledger are
726
+ * recorded; rejects when no system job has the given name.
727
+ * @param name the name of the job to run
728
+ */
729
+ startSystemJob(name: string): Promise<JobRun>;
730
+ }
731
+ declare class SystemJobService implements ISystemJobService {
732
+ private readonly serviceProxy;
733
+ constructor(kinotic: IKinotic12);
734
+ findSystemJobs(): Promise<SystemJobDescriptor[]>;
735
+ startSystemJob(name: string): Promise<JobRun>;
736
+ }
737
+ import { IKinotic as IKinotic13 } from "@kinotic-ai/core";
738
+ /**
739
+ * The Enterprise Features a Kinotic Enterprise License key turns on.
740
+ */
741
+ declare enum EnterpriseFeature {
742
+ /** Azure Key Vault secret storage. */
743
+ AZURE_KEY_VAULT = "AZURE_KEY_VAULT",
744
+ /** Okta and Microsoft Entra sign-in through an organization's own client. */
745
+ ENTERPRISE_IDENTITY_PROVIDERS = "ENTERPRISE_IDENTITY_PROVIDERS"
746
+ }
747
+ /**
748
+ * Where a Kinotic Enterprise License stands now.
749
+ */
750
+ declare enum LicenseStatus {
751
+ /** Before its expiry: its features are on. */
752
+ ACTIVE = "ACTIVE",
753
+ /** Expired less than the grace period ago: its features stay on until the grace period ends. */
754
+ GRACE_PERIOD = "GRACE_PERIOD",
755
+ /** Its grace period has ended: its features are off. */
756
+ EXPIRED = "EXPIRED"
757
+ }
758
+ /**
759
+ * A verified Kinotic Enterprise License: who it is issued to, the cluster it is bound to, when it was issued and
760
+ * expires, and the Enterprise Features it turns on until its grace period ends.
761
+ */
762
+ declare class License {
763
+ /** The party the license is issued to. */
764
+ licensee: string;
765
+ /**
766
+ * The id of the one cluster the license works on, the UID of that cluster's kube-system namespace, or null when
767
+ * it works on any cluster.
768
+ */
769
+ clusterId: string | null;
770
+ /** When the license was issued, or null when its key does not say. */
771
+ issuedAt: string | null;
772
+ /** When the license expires. */
773
+ expiresAt: string;
774
+ /** When the license stops turning its features on, a grace period after it expires. */
775
+ graceEndsAt: string;
776
+ /** Where the license stands at the time it was handed out. */
777
+ status: LicenseStatus;
778
+ /** The Enterprise Features the license turns on while it is active or in its grace period. */
779
+ features: EnterpriseFeature[];
780
+ constructor(licensee: string, expiresAt: string, graceEndsAt: string, status: LicenseStatus);
781
+ }
782
+ /**
783
+ * The Kinotic Enterprise License key the whole cluster runs on, which system users read and replace without
784
+ * restarting a server. A key bound to the cluster is renewed from Minds Ignited's license server once a day. Published in the system zone, which only SYSTEM participants and the system's own cluster
785
+ * members may address.
786
+ */
787
+ interface ILicenseService {
788
+ /** Resolves null when no valid key is installed. */
789
+ findCurrent(): Promise<License | null>;
790
+ /**
791
+ * Installs licenseKey for the whole cluster in place of the installed key, resolving with the license it holds.
792
+ * The call resolves once the key is stored and the node that took the call runs on it; every other node runs on
793
+ * it shortly after, except a node the cluster could not reach, which reads it within ten minutes. Rejects a key
794
+ * Minds Ignited did not sign, one naming no licensee or expiry, one bound to another cluster, one whose grace
795
+ * period has ended, and, on a cluster that stores secrets in Azure Key Vault, one that does not turn
796
+ * AZURE_KEY_VAULT on.
797
+ */
798
+ install(licenseKey: string): Promise<License>;
799
+ /**
800
+ * The id of this cluster, the UID of its kube-system namespace, which a customer gives Minds Ignited to get a key
801
+ * bound to the cluster. Resolves null when the cluster does not run in Kubernetes, or has not been able to read
802
+ * the namespace yet.
803
+ */
804
+ findClusterId(): Promise<string | null>;
805
+ }
806
+ declare class LicenseService implements ILicenseService {
807
+ private readonly serviceProxy;
808
+ constructor(kinotic: IKinotic13);
809
+ findCurrent(): Promise<License | null>;
810
+ install(licenseKey: string): Promise<License>;
811
+ findClusterId(): Promise<string | null>;
393
812
  }
394
813
  interface ISystemApiExtension {
395
814
  vmNodes: IVmNodeService;
@@ -397,18 +816,27 @@ interface ISystemApiExtension {
397
816
  workloadOrchestration: IWorkloadOrchestrationService;
398
817
  logManager: ILogManager;
399
818
  clusterInfo: IKinoticClusterInfoService;
819
+ clusterVulnerabilities: IClusterVulnerabilityService;
820
+ vulnerabilityAdvisories: IVulnerabilityAdvisoryService;
400
821
  systemOrganizations: ISystemOrganizationService;
822
+ systemMembers: ISystemMemberService;
823
+ watchEvents: IWatchEventService;
824
+ llmConfigurations: ILlmConfigurationService;
825
+ systemJobs: ISystemJobService;
826
+ licenses: ILicenseService;
401
827
  }
402
828
  declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
403
- import { IKinotic as IKinotic7 } from "@kinotic-ai/core";
829
+ import { IKinotic as IKinotic14 } from "@kinotic-ai/core";
404
830
  declare class LogManager implements ILogManager {
405
831
  private readonly serviceProxy;
406
- constructor(kinotic: IKinotic7);
832
+ constructor(kinotic: IKinotic14);
407
833
  loggers(nodeId: string): Promise<LoggersDescriptor>;
408
834
  loggerLevels(nodeId: string, name: string): Promise<LoggerLevelsDescriptor>;
409
835
  configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
836
+ traceLog(nodeId: string): Promise<TraceLogProperties>;
837
+ configureTraceLog(nodeId: string, traceLog: TraceLogProperties): Promise<void>;
410
838
  }
411
839
  declare module "@kinotic-ai/core" {
412
840
  interface KinoticSingleton extends ISystemApiExtension {}
413
841
  }
414
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, SystemOrganizationService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
842
+ export { ClusterVulnerabilityService, EnterpriseFeature, GroupLoggerLevelsDescriptor, IClusterVulnerabilityService, IKinoticClusterInfoService, ILicenseService, ILlmConfigurationService, ILogManager, ISystemApiExtension, ISystemJobService, ISystemMemberService, ISystemOrganizationService, IVmNodeService, IVulnerabilityAdvisoryService, IWatchEventService, IWorkloadOrchestrationService, IWorkloadService, KinoticClusterInfo, KinoticClusterInfoService, KinoticNodeInfo, License, LicenseService, LicenseStatus, LlmConfiguration, LlmConfigurationService, LlmProviderType, LogLevel, LogManager, LoggerLevelsDescriptor, LoggersDescriptor, OsvImportStatus, SYSTEM_API_ZONE, ServerVulnerabilities, SingleLoggerLevelsDescriptor, SystemApiPlugin, SystemJobDescriptor, SystemJobService, SystemMemberService, SystemOrganizationService, TraceLogProperties, VmNode, VmNodeOrchestrationServiceProxy, VmNodeRegistration, VmNodeServiceProxy, VmNodeState, VmNodeStatusType, VmProviderType, VulnerabilityAdvisoryService, WatchEventService, WorkloadOrchestrationService, WorkloadServiceProxy, WorkloadStatusReport };